Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Begin working on a UserData class intended to replace UserMessageCoders
https://bugs.webkit.org/show_bug.cgi?id=125471

Reviewed by Sam Weinig.

* Shared/APIFrameHandle.cpp: Added.
* Shared/APIFrameHandle.h: Added.
Add a new API::FrameHandle class that represents a frame.

* Shared/APIObject.h:
* Shared/APIPageHandle.cpp: Added.
* Shared/APIPageHandle.h: Added.
Add a new API::PageHandle class that represents a page.

* Shared/UserData.cpp: Added.
(WebKit::UserData::UserData):
(WebKit::UserData::~UserData):
(WebKit::UserData::encode):
(WebKit::UserData::decode):
* Shared/UserData.h: Added.
Add a UserData class that can be encoded and decoded. This will be used for sending data
 between the web process and UI process without doing any of the Page -> BundlePage etc conversions.
* WebKit2.xcodeproj/project.pbxproj:

Canonical link: https://commits.webkit.org/143551@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160341 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Anders Carlsson committed Dec 10, 2013
1 parent cbfd0e3 commit b102c7a
Show file tree
Hide file tree
Showing 9 changed files with 483 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Source/WebKit2/ChangeLog
@@ -1,3 +1,29 @@
2013-12-09 Anders Carlsson <andersca@apple.com>

Begin working on a UserData class intended to replace UserMessageCoders
https://bugs.webkit.org/show_bug.cgi?id=125471

Reviewed by Sam Weinig.

* Shared/APIFrameHandle.cpp: Added.
* Shared/APIFrameHandle.h: Added.
Add a new API::FrameHandle class that represents a frame.

* Shared/APIObject.h:
* Shared/APIPageHandle.cpp: Added.
* Shared/APIPageHandle.h: Added.
Add a new API::PageHandle class that represents a page.

* Shared/UserData.cpp: Added.
(WebKit::UserData::UserData):
(WebKit::UserData::~UserData):
(WebKit::UserData::encode):
(WebKit::UserData::decode):
* Shared/UserData.h: Added.
Add a UserData class that can be encoded and decoded. This will be used for sending data
between the web process and UI process without doing any of the Page -> BundlePage etc conversions.
* WebKit2.xcodeproj/project.pbxproj:

2013-12-09 Ryuan Choi <ryuan.choi@samsung.com>

[EFL][WK2] LayoutTests are broken after r160301
Expand Down
45 changes: 45 additions & 0 deletions Source/WebKit2/Shared/APIFrameHandle.cpp
@@ -0,0 +1,45 @@
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "config.h"
#include "APIFrameHandle.h"

namespace API {

RefPtr<FrameHandle> FrameHandle::create(uint64_t frameID)
{
return adoptRef(new FrameHandle(frameID));
}

FrameHandle::FrameHandle(uint64_t frameID)
: m_frameID(frameID)
{
}

FrameHandle::~FrameHandle()
{
}

} // namespace API
49 changes: 49 additions & 0 deletions Source/WebKit2/Shared/APIFrameHandle.h
@@ -0,0 +1,49 @@
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef APIFrameHandle_h
#define APIFrameHandle_h

#include "APIObject.h"
#include <wtf/RefPtr.h>

namespace API {

class FrameHandle : public TypedObject<Object::Type::FrameHandle> {
public:
static RefPtr<FrameHandle> create(uint64_t frameID);
virtual ~FrameHandle();

uint64_t frameID() const { return m_frameID; }

private:
explicit FrameHandle(uint64_t frameID);

uint64_t m_frameID;
};

} // namespace API

#endif // APIFrameHandle_h
2 changes: 2 additions & 0 deletions Source/WebKit2/Shared/APIObject.h
Expand Up @@ -62,7 +62,9 @@ class Object
Data,
Dictionary,
Error,
FrameHandle,
Image,
PageHandle,
ProtectionSpace,
RenderLayer,
RenderObject,
Expand Down
45 changes: 45 additions & 0 deletions Source/WebKit2/Shared/APIPageHandle.cpp
@@ -0,0 +1,45 @@
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "config.h"
#include "APIPageHandle.h"

namespace API {

RefPtr<PageHandle> PageHandle::create(uint64_t pageID)
{
return adoptRef(new PageHandle(pageID));
}

PageHandle::PageHandle(uint64_t pageID)
: m_pageID(pageID)
{
}

PageHandle::~PageHandle()
{
}

} // namespace API
50 changes: 50 additions & 0 deletions Source/WebKit2/Shared/APIPageHandle.h
@@ -0,0 +1,50 @@
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef APIPageHandle_h
#define APIPageHandle_h

#include "APIObject.h"
#include <wtf/RefPtr.h>

namespace API {

class PageHandle : public TypedObject<Object::Type::PageHandle> {
public:
static RefPtr<PageHandle> create(uint64_t pageID);
virtual ~PageHandle();

uint64_t pageID() const { return m_pageID; }

private:
explicit PageHandle(uint64_t pageID);

uint64_t m_pageID;
};

} // namespace API


#endif // APIPageHandle_h

0 comments on commit b102c7a

Please sign in to comment.