Changeset 68079 in webkit


Ignore:
Timestamp:
Sep 22, 2010 1:43:49 PM (14 years ago)
Author:
Adam Roben
Message:

Autogenerate WebPage's message-receiving code and message types

This patch encompasses several changes that allow message types and
receiving code to be generated by a script, and add some type-safety
as a bonus. Messages are now represented by structs instead of an ID +
ArgumentCoder. The struct contains the arguments and the ID together,
and has a constructor that enforces the use of correct types.
Correspondingly, a new overload of WebProcessProxy::send that takes a
message struct (instead of a message ID and separate arguments) has
been added. Eventually all callers should use this overload and the
old one can be removed.

This patch only touches WebPage's messages. We should transition other
message receivers over to this new system eventually.

Fixes <http://webkit.org/b/43636> <rdar://problem/8282462> Add a
type-safe IPC mechanism to WebKit2

Reviewed by Anders Carlsson.

  • DerivedSources.make: Added. Calls generate-message-receiver.py and

generate-messages-header.py for each message receiver it knows about
(just WebPage for now).

  • Platform/CoreIPC/Arguments.h: Added First/Second/ThirdArgumentType

typedefs for use in handleMessage.

  • Platform/CoreIPC/HandleMessage.h: Added.

(CoreIPC::handleMessage): This overloaded function template decodes
arguments and passes them along to the specified function.

  • Scripts/generate-message-receiver.py: Added.
  • Scripts/generate-messages-header.py: Added.

These scripts just wrap functionality in messages.py.

  • Scripts/webkit2/init.py: Added. This just exists so that Python

will treat this directory as a package.

  • Scripts/webkit2/messages.py: Added. Contains the code to parse

messages files and generate .cpp/.h files from them.
(MessageReceiver.init): This class represents a single receiver of
messages.
(MessageReceiver.iterparameters): Returns a generator that can be used
to iterate over all the parameters of all the messages of this
receiver.
(MessageReceiver.parse): Reads a messages file from a file-like object
and parses it into a MessageReceiver object.
(Message.init): This class represents a single message.
(Message.id): Returns the ID name for this message.
(Parameter.init): This class represents a single parameter for a
message.
(messages_header_filename): Returns the name of the header that
defines the messages for a given receiver.
(surround_in_condition): Surrounds the given string in #if/#endif if
there is an associated condition.
(messages_to_kind_enum): Returns a string that defines the Kind enum
for these messages.
(function_parameter_type): Returns the type that should be used when
passing a value of the given type as a parameter to a function.
(base_class): Returns the base class for a message struct.
(message_to_struct_declaration): Returns a string that declares the
struct for this message.
(forward_declarations_for_namespace): Returns a string that contains
forward-declarations for a set of types in a given namespace.
(forward_declarations): Returns a string that contains all the
forward-declarations needed in order to declare all the message
structs for this receiver.
(generate_header_file): Returns a string containing the messages
header file for this receiver.
(handler_function): Returns the name of the function that handles a
given message for a given receiver.
(case_statement): Returns a string containing a case statement for
handling the given message.
(header_for_type): Returns the header needed to define a given type,
enclosed in quotes or angle brackets as needed.
(generate_message_handler): Returns a string containing the contents
of a .cpp file that defines a didReceive*Message function.

  • Scripts/webkit2/messages_unittest.py: Added. Contains tests for

messages.py.

  • Shared/CoreIPCSupport/WebPageMessageKinds.h: Removed. This has been

replaced by a generated WebPageMessages.h header.

  • UIProcess/WebEditCommandProxy.cpp:
  • UIProcess/WebPageProxy.cpp:

Updated to use the new message structs and WebProcessProxy::send
overload.

  • UIProcess/WebProcessProxy.h:

(WebKit::WebProcessProxy::send): Added this new overload that takes a
message struct.

  • WebKit2.xcodeproj/project.pbxproj: Added a Derived Sources shell

script target that invokes DerivedSources.make. Added "Derived
Sources" and "Scripts" groups that contain the various new files.

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::didReceivePolicyDecision):
(WebKit::WebPage::getSourceForFrame):
Changed these functions to take the raw IPC types and do the necessary
translation themselves. This keeps the generated code from need to
know how to perform the translation.

(WebKit::WebPage::didReceiveMessage): Replaced handling of WebPage
messages with a call to didReceiveWebPageMessage, whose implementation
is generated by the scripts.

  • WebProcess/WebPage/WebPage.h: Added didReceiveWebPageMessage.
  • WebProcess/WebPage/WebPage.messages.in: Added. This file declares

all of the messages that WebPage receives, roughly grouped by
functionality.

  • win/WebKit2.vcproj: Added "Derived Sources" and "Scripts" filters

that contain the various new files. Let VS resort some other files.

  • win/WebKit2Common.vsprops: Added

$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources to the include
path so that the generated messages header can be found.

  • win/WebKit2.make: Copy the generated source files to $(DSTROOT).
  • win/WebKit2Generated.make: Added a call to build-generated-files.sh.
  • win/WebKit2Generated.vcproj: Added build-generated-files.sh.
  • win/build-generated-files.sh: Added. Invokes DerivedSources.make.
Location:
trunk/WebKit2
Files:
11 added
1 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r68075 r68079  
     12010-09-22  Adam Roben  <aroben@apple.com>
     2
     3        Autogenerate WebPage's message-receiving code and message types
     4
     5        This patch encompasses several changes that allow message types and
     6        receiving code to be generated by a script, and add some type-safety
     7        as a bonus. Messages are now represented by structs instead of an ID +
     8        ArgumentCoder. The struct contains the arguments and the ID together,
     9        and has a constructor that enforces the use of correct types.
     10        Correspondingly, a new overload of WebProcessProxy::send that takes a
     11        message struct (instead of a message ID and separate arguments) has
     12        been added. Eventually all callers should use this overload and the
     13        old one can be removed.
     14
     15        This patch only touches WebPage's messages. We should transition other
     16        message receivers over to this new system eventually.
     17
     18        Fixes <http://webkit.org/b/43636> <rdar://problem/8282462> Add a
     19        type-safe IPC mechanism to WebKit2
     20
     21        Reviewed by Anders Carlsson.
     22
     23        * DerivedSources.make: Added. Calls generate-message-receiver.py and
     24        generate-messages-header.py for each message receiver it knows about
     25        (just WebPage for now).
     26
     27        * Platform/CoreIPC/Arguments.h: Added First/Second/ThirdArgumentType
     28        typedefs for use in handleMessage.
     29
     30        * Platform/CoreIPC/HandleMessage.h: Added.
     31        (CoreIPC::handleMessage): This overloaded function template decodes
     32        arguments and passes them along to the specified function.
     33
     34        * Scripts/generate-message-receiver.py: Added.
     35        * Scripts/generate-messages-header.py: Added.
     36        These scripts just wrap functionality in messages.py.
     37
     38        * Scripts/webkit2/__init__.py: Added. This just exists so that Python
     39        will treat this directory as a package.
     40
     41        * Scripts/webkit2/messages.py: Added. Contains the code to parse
     42        messages files and generate .cpp/.h files from them.
     43        (MessageReceiver.__init__): This class represents a single receiver of
     44        messages.
     45        (MessageReceiver.iterparameters): Returns a generator that can be used
     46        to iterate over all the parameters of all the messages of this
     47        receiver.
     48        (MessageReceiver.parse): Reads a messages file from a file-like object
     49        and parses it into a MessageReceiver object.
     50        (Message.__init__): This class represents a single message.
     51        (Message.id): Returns the ID name for this message.
     52        (Parameter.__init__): This class represents a single parameter for a
     53        message.
     54        (messages_header_filename): Returns the name of the header that
     55        defines the messages for a given receiver.
     56        (surround_in_condition): Surrounds the given string in #if/#endif if
     57        there is an associated condition.
     58        (messages_to_kind_enum): Returns a string that defines the Kind enum
     59        for these messages.
     60        (function_parameter_type): Returns the type that should be used when
     61        passing a value of the given type as a parameter to a function.
     62        (base_class): Returns the base class for a message struct.
     63        (message_to_struct_declaration): Returns a string that declares the
     64        struct for this message.
     65        (forward_declarations_for_namespace): Returns a string that contains
     66        forward-declarations for a set of types in a given namespace.
     67        (forward_declarations): Returns a string that contains all the
     68        forward-declarations needed in order to declare all the message
     69        structs for this receiver.
     70        (generate_header_file): Returns a string containing the messages
     71        header file for this receiver.
     72        (handler_function): Returns the name of the function that handles a
     73        given message for a given receiver.
     74        (case_statement): Returns a string containing a case statement for
     75        handling the given message.
     76        (header_for_type): Returns the header needed to define a given type,
     77        enclosed in quotes or angle brackets as needed.
     78        (generate_message_handler): Returns a string containing the contents
     79        of a .cpp file that defines a didReceive*Message function.
     80
     81        * Scripts/webkit2/messages_unittest.py: Added. Contains tests for
     82        messages.py.
     83
     84        * Shared/CoreIPCSupport/WebPageMessageKinds.h: Removed. This has been
     85        replaced by a generated WebPageMessages.h header.
     86
     87        * UIProcess/WebEditCommandProxy.cpp:
     88        * UIProcess/WebPageProxy.cpp:
     89        Updated to use the new message structs and WebProcessProxy::send
     90        overload.
     91
     92        * UIProcess/WebProcessProxy.h:
     93        (WebKit::WebProcessProxy::send): Added this new overload that takes a
     94        message struct.
     95
     96        * WebKit2.xcodeproj/project.pbxproj: Added a Derived Sources shell
     97        script target that invokes DerivedSources.make. Added "Derived
     98        Sources" and "Scripts" groups that contain the various new files.
     99
     100        * WebProcess/WebPage/WebPage.cpp:
     101        (WebKit::WebPage::didReceivePolicyDecision):
     102        (WebKit::WebPage::getSourceForFrame):
     103        Changed these functions to take the raw IPC types and do the necessary
     104        translation themselves. This keeps the generated code from need to
     105        know how to perform the translation.
     106
     107        (WebKit::WebPage::didReceiveMessage): Replaced handling of WebPage
     108        messages with a call to didReceiveWebPageMessage, whose implementation
     109        is generated by the scripts.
     110
     111        * WebProcess/WebPage/WebPage.h: Added didReceiveWebPageMessage.
     112
     113        * WebProcess/WebPage/WebPage.messages.in: Added. This file declares
     114        all of the messages that WebPage receives, roughly grouped by
     115        functionality.
     116
     117        * win/WebKit2.vcproj: Added "Derived Sources" and "Scripts" filters
     118        that contain the various new files. Let VS resort some other files.
     119
     120        * win/WebKit2Common.vsprops: Added
     121        $(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources to the include
     122        path so that the generated messages header can be found.
     123
     124        * win/WebKit2.make: Copy the generated source files to $(DSTROOT).
     125
     126        * win/WebKit2Generated.make: Added a call to build-generated-files.sh.
     127
     128        * win/WebKit2Generated.vcproj: Added build-generated-files.sh.
     129
     130        * win/build-generated-files.sh: Added. Invokes DerivedSources.make.
     131
    11322010-09-22  Anders Carlsson  <andersca@apple.com>
    2133
  • trunk/WebKit2/Platform/CoreIPC/Arguments.h

    r67754 r68079  
    5656template<typename T1> class Arguments1 {
    5757public:
     58    typedef T1 FirstArgumentType;
     59
    5860    Arguments1(T1 t1)
    5961        : m_value(t1)
     
    8789template<typename T1, typename T2> class Arguments2 : Arguments1<T1> {
    8890public:
     91    typedef T1 FirstArgumentType;
     92    typedef T2 SecondArgumentType;
     93
    8994    Arguments2(T1 t1, T2 t2)
    9095        : Arguments1<T1>(t1)
     
    123128template<typename T1, typename T2, typename T3> class Arguments3 : Arguments2<T1, T2> {
    124129public:
     130    typedef T1 FirstArgumentType;
     131    typedef T2 SecondArgumentType;
     132    typedef T3 ThirdArgumentType;
     133
    125134    Arguments3(T1 t1, T2 t2, T3 t3)
    126135        : Arguments2<T1, T2>(t1, t2)
  • trunk/WebKit2/UIProcess/WebEditCommandProxy.cpp

    r66897 r68079  
    2626#include "WebEditCommandProxy.h"
    2727
    28 #include "WebPageMessageKinds.h"
     28#include "WebPageMessages.h"
    2929#include "WebPageProxy.h"
    3030#include "WebProcessProxy.h"
     
    5353        return;
    5454
    55     m_page->process()->connection()->send(WebPageMessage::UnapplyEditCommand, m_page->pageID(), CoreIPC::In(m_commandID));
     55    m_page->process()->send(Messages::WebPage::UnapplyEditCommand(m_commandID), m_page->pageID());
    5656    m_page->registerEditCommandForRedo(this);
    5757}
     
    6262        return;
    6363
    64     m_page->process()->connection()->send(WebPageMessage::ReapplyEditCommand, m_page->pageID(), CoreIPC::In(m_commandID));
     64    m_page->process()->send(Messages::WebPage::ReapplyEditCommand(m_commandID), m_page->pageID());
    6565    m_page->registerEditCommandForUndo(this);
    6666}
  • trunk/WebKit2/UIProcess/WebPageProxy.cpp

    r67971 r68079  
    4040#include "WebFormSubmissionListenerProxy.h"
    4141#include "WebFramePolicyListenerProxy.h"
    42 #include "WebPageMessageKinds.h"
     42#include "WebPageMessages.h"
    4343#include "WebPageNamespace.h"
    4444#include "WebPageProxyMessageKinds.h"
     
    212212    m_drawingArea.clear();
    213213
    214     process()->send(WebPageMessage::Close, m_pageID, CoreIPC::In());
     214    process()->send(Messages::WebPage::Close(), m_pageID);
    215215    process()->removeWebPage(m_pageID);
    216216}
     
    221221        return true;
    222222
    223     process()->send(WebPageMessage::TryClose, m_pageID, CoreIPC::In());
     223    process()->send(Messages::WebPage::TryClose(), m_pageID);
    224224    return false;
    225225}
     
    232232    }
    233233
    234     process()->send(WebPageMessage::LoadURL, m_pageID, CoreIPC::In(url));
     234    process()->send(Messages::WebPage::LoadURL(url), m_pageID);
    235235}
    236236
     
    242242    }
    243243
    244     process()->send(WebPageMessage::LoadURLRequest, m_pageID, CoreIPC::In(urlRequest->resourceRequest()));
     244    process()->send(Messages::WebPage::LoadURLRequest(urlRequest->resourceRequest()), m_pageID);
    245245}
    246246
     
    249249    if (!isValid())
    250250        return;
    251     process()->send(WebPageMessage::LoadHTMLString, m_pageID, CoreIPC::In(htmlString, baseURL));
     251    process()->send(Messages::WebPage::LoadHTMLString(htmlString, baseURL), m_pageID);
    252252}
    253253
     
    256256    if (!isValid())
    257257        return;
    258     process()->send(WebPageMessage::LoadPlainTextString, m_pageID, CoreIPC::In(string));
     258    process()->send(Messages::WebPage::LoadPlainTextString(string), m_pageID);
    259259}
    260260
     
    263263    if (!isValid())
    264264        return;
    265     process()->send(WebPageMessage::StopLoading, m_pageID, CoreIPC::In());
     265    process()->send(Messages::WebPage::StopLoading(), m_pageID);
    266266}
    267267
     
    270270    if (!isValid())
    271271        return;
    272     process()->send(WebPageMessage::Reload, m_pageID, CoreIPC::In(reloadFromOrigin));
     272    process()->send(Messages::WebPage::Reload(reloadFromOrigin), m_pageID);
    273273}
    274274
     
    281281        return;
    282282
    283     process()->send(WebPageMessage::GoForward, m_pageID, CoreIPC::In(m_backForwardList->forwardItem()->itemID()));
     283    process()->send(Messages::WebPage::GoForward(m_backForwardList->forwardItem()->itemID()), m_pageID);
    284284}
    285285
     
    297297        return;
    298298
    299     process()->send(WebPageMessage::GoBack, m_pageID, CoreIPC::In(m_backForwardList->backItem()->itemID()));
     299    process()->send(Messages::WebPage::GoBack(m_backForwardList->backItem()->itemID()), m_pageID);
    300300}
    301301
     
    310310        return;
    311311
    312     process()->send(WebPageMessage::GoToBackForwardItem, m_pageID, CoreIPC::In(item->itemID()));
     312    process()->send(Messages::WebPage::GoToBackForwardItem(item->itemID()), m_pageID);
    313313}
    314314
     
    322322    if (!isValid())
    323323        return;
    324     process()->send(WebPageMessage::SetFocused, m_pageID, CoreIPC::In(isFocused));
     324    process()->send(Messages::WebPage::SetFocused(isFocused), m_pageID);
    325325}
    326326
     
    329329    if (!isValid())
    330330        return;
    331     process()->send(WebPageMessage::SetActive, m_pageID, CoreIPC::In(active));
     331    process()->send(Messages::WebPage::SetActive(active), m_pageID);
    332332}
    333333
     
    337337        return;
    338338
    339     process()->send(WebPageMessage::SelectAll, m_pageID, CoreIPC::In());
     339    process()->send(Messages::WebPage::SelectAll(), m_pageID);
    340340}
    341341
     
    345345        return;
    346346
    347     process()->send(WebPageMessage::Copy, m_pageID, CoreIPC::In());
     347    process()->send(Messages::WebPage::Copy(), m_pageID);
    348348}
    349349
     
    353353        return;
    354354
    355     process()->send(WebPageMessage::Cut, m_pageID, CoreIPC::In());
     355    process()->send(Messages::WebPage::Cut(), m_pageID);
    356356}
    357357
     
    361361        return;
    362362
    363     process()->send(WebPageMessage::Paste, m_pageID, CoreIPC::In());
     363    process()->send(Messages::WebPage::Paste(), m_pageID);
    364364}
    365365   
     
    372372    if (!isValid())
    373373        return;
    374     process()->send(WebPageMessage::SetIsInWindow, m_pageID, CoreIPC::In(isInWindow));
     374    process()->send(Messages::WebPage::SetIsInWindow(isInWindow), m_pageID);
    375375}
    376376
     
    380380    if (!isValid())
    381381        return;
    382     process()->send(WebPageMessage::SetWindowIsVisible, m_pageID, CoreIPC::In(windowIsVisible));
     382    process()->send(Messages::WebPage::SetWindowIsVisible(windowIsVisible), m_pageID);
    383383}
    384384
     
    387387    if (!isValid())
    388388        return;
    389     process()->send(WebPageMessage::SetWindowFrame, m_pageID, CoreIPC::In(windowFrame));
     389    process()->send(Messages::WebPage::SetWindowFrame(windowFrame), m_pageID);
    390390}
    391391
     
    400400    if (event.type() != WebEvent::MouseMove)
    401401        process()->responsivenessTimer()->start();
    402     process()->send(WebPageMessage::MouseEvent, m_pageID, CoreIPC::In(event));
     402    process()->send(Messages::WebPage::MouseEvent(event), m_pageID);
    403403}
    404404
     
    409409
    410410    process()->responsivenessTimer()->start();
    411     process()->send(WebPageMessage::WheelEvent, m_pageID, CoreIPC::In(event));
     411    process()->send(Messages::WebPage::WheelEvent(event), m_pageID);
    412412}
    413413
     
    418418
    419419    process()->responsivenessTimer()->start();
    420     process()->send(WebPageMessage::KeyEvent, m_pageID, CoreIPC::In(event));
     420    process()->send(Messages::WebPage::KeyEvent(event), m_pageID);
    421421}
    422422
     
    426426    if (!isValid())
    427427        return;
    428     process()->send(WebPageMessage::TouchEvent, m_pageID, CoreIPC::In(event));
     428    process()->send(Messages::WebPage::TouchEvent(event), m_pageID);
    429429}
    430430#endif
     
    435435        return;
    436436
    437     process()->send(WebPageMessage::DidReceivePolicyDecision, m_pageID, CoreIPC::In(frame->frameID(), listenerID, (uint32_t)action));
     437    process()->send(Messages::WebPage::DidReceivePolicyDecision(frame->frameID(), listenerID, action), m_pageID);
    438438}
    439439
     
    443443        return;
    444444
    445     process()->send(WebPageMessage::SetCustomUserAgent, m_pageID, CoreIPC::In(userAgent));
     445    process()->send(Messages::WebPage::SetCustomUserAgent(userAgent), m_pageID);
    446446}
    447447
     
    474474
    475475    m_textZoomFactor = zoomFactor;
    476     process()->send(WebPageMessage::SetTextZoomFactor, m_pageID, CoreIPC::In(m_textZoomFactor));
     476    process()->send(Messages::WebPage::SetTextZoomFactor(m_textZoomFactor), m_pageID);
    477477}
    478478
     
    486486
    487487    m_pageZoomFactor = zoomFactor;
    488     process()->send(WebPageMessage::SetPageZoomFactor, m_pageID, CoreIPC::In(m_pageZoomFactor));
     488    process()->send(Messages::WebPage::SetPageZoomFactor(m_pageZoomFactor), m_pageID);
    489489}
    490490
     
    499499    m_pageZoomFactor = pageZoomFactor;
    500500    m_textZoomFactor = textZoomFactor;
    501     process()->send(WebPageMessage::SetPageAndTextZoomFactors, m_pageID, CoreIPC::In(m_pageZoomFactor, m_textZoomFactor));
     501    process()->send(Messages::WebPage::SetPageAndTextZoomFactors(m_pageZoomFactor, m_textZoomFactor), m_pageID);
    502502}
    503503
     
    507507    uint64_t callbackID = callback->callbackID();
    508508    m_scriptReturnValueCallbacks.set(callbackID, callback.get());
    509     process()->send(WebPageMessage::RunJavaScriptInMainFrame, m_pageID, CoreIPC::In(script, callbackID));
     509    process()->send(Messages::WebPage::RunJavaScriptInMainFrame(script, callbackID), m_pageID);
    510510}
    511511
     
    515515    uint64_t callbackID = callback->callbackID();
    516516    m_renderTreeExternalRepresentationCallbacks.set(callbackID, callback.get());
    517     process()->send(WebPageMessage::GetRenderTreeExternalRepresentation, m_pageID, callbackID);
     517    process()->send(Messages::WebPage::GetRenderTreeExternalRepresentation(callbackID), m_pageID);
    518518}
    519519
     
    523523    uint64_t callbackID = callback->callbackID();
    524524    m_frameSourceCallbacks.set(callbackID, callback.get());
    525     process()->send(WebPageMessage::GetSourceForFrame, m_pageID, CoreIPC::In(frame->frameID(), callbackID));
     525    process()->send(Messages::WebPage::GetSourceForFrame(frame->frameID(), callbackID), m_pageID);
    526526}
    527527
     
    533533    // FIXME: It probably makes more sense to send individual preference changes.
    534534    // However, WebKitTestRunner depends on getting a preference change notification even if nothing changed in UI process, so that overrides get removed.
    535     process()->send(WebPageMessage::PreferencesDidChange, m_pageID, CoreIPC::In(pageNamespace()->context()->preferences()->store()));
     535    process()->send(Messages::WebPage::PreferencesDidChange(pageNamespace()->context()->preferences()->store()), m_pageID);
    536536}
    537537
     
    11821182    if (!isValid())
    11831183        return;
    1184     process()->send(WebPageMessage::DidRemoveEditCommand, m_pageID, command->commandID());
     1184    process()->send(Messages::WebPage::DidRemoveEditCommand(command->commandID()), m_pageID);
    11851185}
    11861186
  • trunk/WebKit2/UIProcess/WebProcessProxy.h

    r68070 r68079  
    6363
    6464    template<typename E, typename T> bool send(E messageID, uint64_t destinationID, const T& arguments);
     65    template<typename T> bool send(const T& message, uint64_t destinationID);
    6566   
    6667    CoreIPC::Connection* connection() const
     
    156157}
    157158
     159template<typename T>
     160bool WebProcessProxy::send(const T& message, uint64_t destinationID)
     161{
     162    OwnPtr<CoreIPC::ArgumentEncoder> argumentEncoder(new CoreIPC::ArgumentEncoder(destinationID));
     163    argumentEncoder->encode(message);
     164
     165    return sendMessage(CoreIPC::MessageID(T::messageID), argumentEncoder.release());
     166}
     167
    158168} // namespace WebKit
    159169
  • trunk/WebKit2/WebKit2.xcodeproj/project.pbxproj

    r67954 r68079  
    1515                        );
    1616                        dependencies = (
     17                                C0CE72931247E6CD00BC0EC4 /* PBXTargetDependency */,
    1718                                1A50DB3E110A3C1C000D3FE5 /* PBXTargetDependency */,
    1819                                1A50DB3C110A3C19000D3FE5 /* PBXTargetDependency */,
     
    2021                        name = All;
    2122                        productName = WebKit2;
     23                };
     24                C0CE72851247E66800BC0EC4 /* Derived Sources */ = {
     25                        isa = PBXAggregateTarget;
     26                        buildConfigurationList = C0CE72891247E68600BC0EC4 /* Build configuration list for PBXAggregateTarget "Derived Sources" */;
     27                        buildPhases = (
     28                                C0CE72841247E66800BC0EC4 /* Generate Derived Sources */,
     29                        );
     30                        dependencies = (
     31                        );
     32                        name = "Derived Sources";
     33                        productName = "Derived Sources";
    2234                };
    2335/* End PBXAggregateTarget section */
     
    150162                BC111B5D112F629800337BAB /* WebEventFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = BC111B5B112F629800337BAB /* WebEventFactory.h */; };
    151163                BC111B5E112F629800337BAB /* WebEventFactory.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC111B5C112F629800337BAB /* WebEventFactory.mm */; };
    152                 BC111B63112F638300337BAB /* WebPageMessageKinds.h in Headers */ = {isa = PBXBuildFile; fileRef = BC111B60112F638300337BAB /* WebPageMessageKinds.h */; };
    153164                BC111B64112F638300337BAB /* WebPageProxyMessageKinds.h in Headers */ = {isa = PBXBuildFile; fileRef = BC111B61112F638300337BAB /* WebPageProxyMessageKinds.h */; };
    154165                BC111B65112F638300337BAB /* WebProcessMessageKinds.h in Headers */ = {isa = PBXBuildFile; fileRef = BC111B62112F638300337BAB /* WebProcessMessageKinds.h */; };
     
    353364                BCF69FA91176D1CB00471A52 /* WKNavigationData.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF69FA71176D1CB00471A52 /* WKNavigationData.h */; settings = {ATTRIBUTES = (Public, ); }; };
    354365                BCF69FAA1176D1CB00471A52 /* WKNavigationData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCF69FA81176D1CB00471A52 /* WKNavigationData.cpp */; };
     366                C0CE72A01247E71D00BC0EC4 /* WebPageMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0CE729E1247E71D00BC0EC4 /* WebPageMessageReceiver.cpp */; };
     367                C0CE72A11247E71D00BC0EC4 /* WebPageMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = C0CE729F1247E71D00BC0EC4 /* WebPageMessages.h */; };
     368                C0CE72AD1247E78D00BC0EC4 /* HandleMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = C0CE72AC1247E78D00BC0EC4 /* HandleMessage.h */; };
    355369                C0E3AA7A1209E83000A49D01 /* ModuleMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0E3AA481209E45000A49D01 /* ModuleMac.mm */; };
    356370                C0E3AA7B1209E83500A49D01 /* Module.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0E3AA451209E2BA00A49D01 /* Module.cpp */; };
     
    386400                        remoteGlobalIDString = 8DC2EF4F0486A6940098B216;
    387401                        remoteInfo = WebKit2;
     402                };
     403                C0CE72921247E6CD00BC0EC4 /* PBXContainerItemProxy */ = {
     404                        isa = PBXContainerItemProxy;
     405                        containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
     406                        proxyType = 1;
     407                        remoteGlobalIDString = C0CE72851247E66800BC0EC4;
     408                        remoteInfo = "Derived Sources";
    388409                };
    389410/* End PBXContainerItemProxy section */
     
    543564                BC111B5B112F629800337BAB /* WebEventFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebEventFactory.h; sourceTree = "<group>"; };
    544565                BC111B5C112F629800337BAB /* WebEventFactory.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebEventFactory.mm; sourceTree = "<group>"; };
    545                 BC111B60112F638300337BAB /* WebPageMessageKinds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPageMessageKinds.h; sourceTree = "<group>"; };
    546566                BC111B61112F638300337BAB /* WebPageProxyMessageKinds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPageProxyMessageKinds.h; sourceTree = "<group>"; };
    547567                BC111B62112F638300337BAB /* WebProcessMessageKinds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebProcessMessageKinds.h; sourceTree = "<group>"; };
     
    748768                BCF69FA71176D1CB00471A52 /* WKNavigationData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKNavigationData.h; sourceTree = "<group>"; };
    749769                BCF69FA81176D1CB00471A52 /* WKNavigationData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKNavigationData.cpp; sourceTree = "<group>"; };
     770                C08FDE87124A851C007645BD /* messages_unittest.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = messages_unittest.py; sourceTree = "<group>"; };
     771                C0CE72581247E4DA00BC0EC4 /* WebPage.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebPage.messages.in; sourceTree = "<group>"; };
     772                C0CE729E1247E71D00BC0EC4 /* WebPageMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPageMessageReceiver.cpp; sourceTree = "<group>"; };
     773                C0CE729F1247E71D00BC0EC4 /* WebPageMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPageMessages.h; sourceTree = "<group>"; };
     774                C0CE72AC1247E78D00BC0EC4 /* HandleMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HandleMessage.h; sourceTree = "<group>"; };
     775                C0CE72DB1247E8F700BC0EC4 /* DerivedSources.make */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DerivedSources.make; sourceTree = "<group>"; };
     776                C0CE73361247F70E00BC0EC4 /* generate-message-receiver.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = "generate-message-receiver.py"; sourceTree = "<group>"; };
     777                C0CE73371247F70E00BC0EC4 /* generate-messages-header.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = "generate-messages-header.py"; sourceTree = "<group>"; };
     778                C0CE73391247F70E00BC0EC4 /* __init__.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = __init__.py; sourceTree = "<group>"; };
     779                C0CE734612480B7D00BC0EC4 /* messages.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = messages.py; sourceTree = "<group>"; };
    750780                C0E3AA441209E2BA00A49D01 /* Module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Module.h; sourceTree = "<group>"; };
    751781                C0E3AA451209E2BA00A49D01 /* Module.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Module.cpp; sourceTree = "<group>"; };
     
    792822                        isa = PBXGroup;
    793823                        children = (
     824                                C0CE72DB1247E8F700BC0EC4 /* DerivedSources.make */,
    794825                                BC2E6E74114196F000A63B1E /* Platform */,
    795826                                1AADDF4B10D82AF000D3D63D /* Shared */,
     
    797828                                BC032DC310F438260058C15A /* UIProcess */,
    798829                                32C88DFF0371C24200C91783 /* Other Sources */,
     830                                C0CE729D1247E71D00BC0EC4 /* Derived Sources */,
     831                                C0CE73351247F70E00BC0EC4 /* Scripts */,
    799832                                089C1665FE841158C02AAC07 /* Resources */,
    800833                                1A4F9769100E7B6600637A18 /* Configurations */,
     
    9911024                                BC032DA310F437D10058C15A /* Connection.h */,
    9921025                                BC131BC811726C2800B69727 /* CoreIPCMessageKinds.h */,
     1026                                C0CE72AC1247E78D00BC0EC4 /* HandleMessage.h */,
    9931027                                BC032DA410F437D10058C15A /* MessageID.h */,
    9941028                        );
     
    10861120                                BC963D6A113DD19200574BE2 /* WebPage.cpp */,
    10871121                                BC032D8B10F437A00058C15A /* WebPage.h */,
     1122                                C0CE72581247E4DA00BC0EC4 /* WebPage.messages.in */,
    10881123                        );
    10891124                        path = WebPage;
     
    12991334                                BCB28CBF120233D9007D99BC /* InjectedBundleMessageKinds.h */,
    13001335                                BCCB75C51203A1CE00222D1B /* WebContextMessageKinds.h */,
    1301                                 BC111B60112F638300337BAB /* WebPageMessageKinds.h */,
    13021336                                BC111B61112F638300337BAB /* WebPageProxyMessageKinds.h */,
    13031337                                BC111B62112F638300337BAB /* WebProcessMessageKinds.h */,
     
    14761510                        );
    14771511                        path = mac;
     1512                        sourceTree = "<group>";
     1513                };
     1514                C0CE729D1247E71D00BC0EC4 /* Derived Sources */ = {
     1515                        isa = PBXGroup;
     1516                        children = (
     1517                                C0CE729E1247E71D00BC0EC4 /* WebPageMessageReceiver.cpp */,
     1518                                C0CE729F1247E71D00BC0EC4 /* WebPageMessages.h */,
     1519                        );
     1520                        name = "Derived Sources";
     1521                        path = DerivedSources/WebKit2;
     1522                        sourceTree = BUILT_PRODUCTS_DIR;
     1523                };
     1524                C0CE73351247F70E00BC0EC4 /* Scripts */ = {
     1525                        isa = PBXGroup;
     1526                        children = (
     1527                                C0CE73371247F70E00BC0EC4 /* generate-messages-header.py */,
     1528                                C0CE73361247F70E00BC0EC4 /* generate-message-receiver.py */,
     1529                                C0CE73381247F70E00BC0EC4 /* webkit2 */,
     1530                        );
     1531                        path = Scripts;
     1532                        sourceTree = "<group>";
     1533                };
     1534                C0CE73381247F70E00BC0EC4 /* webkit2 */ = {
     1535                        isa = PBXGroup;
     1536                        children = (
     1537                                C0CE73391247F70E00BC0EC4 /* __init__.py */,
     1538                                C0CE734612480B7D00BC0EC4 /* messages.py */,
     1539                                C08FDE87124A851C007645BD /* messages_unittest.py */,
     1540                        );
     1541                        path = webkit2;
    14781542                        sourceTree = "<group>";
    14791543                };
     
    15521616                                BCF69F9A1176CED600471A52 /* WebNavigationDataStore.h in Headers */,
    15531617                                BC032D8F10F437A00058C15A /* WebPage.h in Headers */,
    1554                                 BC111B63112F638300337BAB /* WebPageMessageKinds.h in Headers */,
    15551618                                BCEE98C7113314D7006BCC24 /* WebPageNamespace.h in Headers */,
    15561619                                BC032DD110F4389F0058C15A /* WebPageProxy.h in Headers */,
     
    16601723                                BCF50728124329AA005955AE /* WebCertificateInfo.h in Headers */,
    16611724                                BCF5072E12432A97005955AE /* WKCertificateInfoMac.h in Headers */,
     1725                                C0CE72A11247E71D00BC0EC4 /* WebPageMessages.h in Headers */,
     1726                                C0CE72AD1247E78D00BC0EC4 /* HandleMessage.h in Headers */,
    16621727                        );
    16631728                        runOnlyForDeploymentPostprocessing = 0;
     
    17091774                        buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "WebKit2" */;
    17101775                        compatibilityVersion = "Xcode 3.1";
    1711                         developmentRegion = English;
    17121776                        hasScannedForEncodings = 1;
    17131777                        knownRegions = (
     
    17251789                                8DC2EF4F0486A6940098B216 /* WebKit2 */,
    17261790                                1A50DB1D110A3BDC000D3FE5 /* WebProcess */,
     1791                                C0CE72851247E66800BC0EC4 /* Derived Sources */,
    17271792                        );
    17281793                };
     
    17471812                };
    17481813/* End PBXResourcesBuildPhase section */
     1814
     1815/* Begin PBXShellScriptBuildPhase section */
     1816                C0CE72841247E66800BC0EC4 /* Generate Derived Sources */ = {
     1817                        isa = PBXShellScriptBuildPhase;
     1818                        buildActionMask = 2147483647;
     1819                        files = (
     1820                        );
     1821                        inputPaths = (
     1822                        );
     1823                        name = "Generate Derived Sources";
     1824                        outputPaths = (
     1825                        );
     1826                        runOnlyForDeploymentPostprocessing = 0;
     1827                        shellPath = /bin/sh;
     1828                        shellScript = "mkdir -p \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebKit2\"\ncd \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebKit2\"\n\nexport WebKit2=\"${SRCROOT}\"\n\nif [ \"${ACTION}\" = \"build\" -o \"${ACTION}\" = \"install\" -o \"${ACTION}\" = \"installhdrs\" ]; then\n    make -f \"${WebKit2}/DerivedSources.make\" -j `/usr/sbin/sysctl -n hw.availcpu`\nfi\n";
     1829                };
     1830/* End PBXShellScriptBuildPhase section */
    17491831
    17501832/* Begin PBXSourcesBuildPhase section */
     
    19121994                                BCF50725124328A9005955AE /* WKCertificateInfo.cpp in Sources */,
    19131995                                BCF5072F12432A97005955AE /* WKCertificateInfoMac.mm in Sources */,
     1996                                C0CE72A01247E71D00BC0EC4 /* WebPageMessageReceiver.cpp in Sources */,
    19141997                        );
    19151998                        runOnlyForDeploymentPostprocessing = 0;
     
    19322015                        target = 8DC2EF4F0486A6940098B216 /* WebKit2 */;
    19332016                        targetProxy = 1A50DB3D110A3C1C000D3FE5 /* PBXContainerItemProxy */;
     2017                };
     2018                C0CE72931247E6CD00BC0EC4 /* PBXTargetDependency */ = {
     2019                        isa = PBXTargetDependency;
     2020                        target = C0CE72851247E66800BC0EC4 /* Derived Sources */;
     2021                        targetProxy = C0CE72921247E6CD00BC0EC4 /* PBXContainerItemProxy */;
    19342022                };
    19352023/* End PBXTargetDependency section */
     
    20472135                        name = Production;
    20482136                };
     2137                C0CE72861247E66800BC0EC4 /* Debug */ = {
     2138                        isa = XCBuildConfiguration;
     2139                        buildSettings = {
     2140                                COPY_PHASE_STRIP = NO;
     2141                                GCC_DYNAMIC_NO_PIC = NO;
     2142                                GCC_OPTIMIZATION_LEVEL = 0;
     2143                                PRODUCT_NAME = "Derived Sources";
     2144                        };
     2145                        name = Debug;
     2146                };
     2147                C0CE72871247E66800BC0EC4 /* Release */ = {
     2148                        isa = XCBuildConfiguration;
     2149                        buildSettings = {
     2150                                COPY_PHASE_STRIP = YES;
     2151                                DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
     2152                                GCC_ENABLE_FIX_AND_CONTINUE = NO;
     2153                                PRODUCT_NAME = "Derived Sources";
     2154                                ZERO_LINK = NO;
     2155                        };
     2156                        name = Release;
     2157                };
     2158                C0CE72881247E66800BC0EC4 /* Production */ = {
     2159                        isa = XCBuildConfiguration;
     2160                        buildSettings = {
     2161                                PRODUCT_NAME = "Derived Sources";
     2162                        };
     2163                        name = Production;
     2164                };
    20492165/* End XCBuildConfiguration section */
    20502166
     
    20902206                        defaultConfigurationName = Production;
    20912207                };
     2208                C0CE72891247E68600BC0EC4 /* Build configuration list for PBXAggregateTarget "Derived Sources" */ = {
     2209                        isa = XCConfigurationList;
     2210                        buildConfigurations = (
     2211                                C0CE72861247E66800BC0EC4 /* Debug */,
     2212                                C0CE72871247E66800BC0EC4 /* Release */,
     2213                                C0CE72881247E66800BC0EC4 /* Production */,
     2214                        );
     2215                        defaultConfigurationIsVisible = 0;
     2216                        defaultConfigurationName = Production;
     2217                };
    20922218/* End XCConfigurationList section */
    20932219        };
  • trunk/WebKit2/WebProcess/WebPage/WebPage.cpp

    r68070 r68079  
    4343#include "WebFrame.h"
    4444#include "WebInspectorClient.h"
    45 #include "WebPageMessageKinds.h"
    4645#include "WebPageProxyMessageKinds.h"
    4746#include "WebProcessProxyMessageKinds.h"
     
    547546}
    548547
    549 void WebPage::didReceivePolicyDecision(WebFrame* frame, uint64_t listenerID, WebCore::PolicyAction policyAction)
    550 {
     548void WebPage::didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction)
     549{
     550    WebFrame* frame = WebProcess::shared().webFrame(frameID);
    551551    if (!frame)
    552552        return;
    553     frame->didReceivePolicyDecision(listenerID, policyAction);
     553    frame->didReceivePolicyDecision(listenerID, static_cast<WebCore::PolicyAction>(policyAction));
    554554}
    555555
     
    610610}
    611611
    612 void WebPage::getSourceForFrame(WebFrame* frame, uint64_t callbackID)
     612void WebPage::getSourceForFrame(uint64_t frameID, uint64_t callbackID)
    613613{
    614614    String resultString;
    615     if (frame)
     615    if (WebFrame* frame = WebProcess::shared().webFrame(frameID))
    616616       resultString = frame->source();
    617617    WebProcess::shared().connection()->send(WebPageProxyMessage::DidGetSourceForFrame, m_pageID, CoreIPC::In(resultString, callbackID));
     
    749749    }
    750750
    751     switch (messageID.get<WebPageMessage::Kind>()) {
    752         case WebPageMessage::SetActive: {
    753             bool active;
    754             if (!arguments->decode(active))
    755                 return;
    756          
    757             setActive(active);
    758             return;
    759         }
    760         case WebPageMessage::SetFocused: {
    761             bool focused;
    762             if (!arguments->decode(focused))
    763                 return;
    764            
    765             setFocused(focused);
    766             return;
    767         }
    768         case WebPageMessage::SetIsInWindow: {
    769             bool isInWindow;
    770             if (!arguments->decode(isInWindow))
    771                 return;
    772            
    773             setIsInWindow(isInWindow);
    774             return;
    775         }
    776 #if PLATFORM(MAC)
    777         case WebPageMessage::SetWindowIsVisible: {
    778             bool windowIsVisible;
    779             if (!arguments->decode(windowIsVisible))
    780                 return;
    781             setWindowIsVisible(windowIsVisible);
    782             return;
    783         }
    784        
    785         case WebPageMessage::SetWindowFrame: {
    786             IntRect windowFrame;
    787             if (!arguments->decode(windowFrame))
    788                 return;
    789             setWindowFrame(windowFrame);
    790             return;
    791         }
    792 #endif
    793         case WebPageMessage::MouseEvent: {
    794             WebMouseEvent event;
    795             if (!arguments->decode(event))
    796                 return;
    797             mouseEvent(event);
    798             return;
    799         }
    800         case WebPageMessage::PreferencesDidChange: {
    801             WebPreferencesStore store;
    802             if (!arguments->decode(store))
    803                 return;
    804            
    805             preferencesDidChange(store);
    806             return;
    807         }
    808         case WebPageMessage::WheelEvent: {
    809             WebWheelEvent event;
    810             if (!arguments->decode(event))
    811                 return;
    812 
    813             wheelEvent(event);
    814             return;
    815         }
    816         case WebPageMessage::KeyEvent: {
    817             WebKeyboardEvent event;
    818             if (!arguments->decode(event))
    819                 return;
    820 
    821             keyEvent(event);
    822             return;
    823         }
    824         case WebPageMessage::SelectAll: {
    825             selectAll();
    826             return;
    827         }
    828         case WebPageMessage::Copy: {
    829             copy();
    830             return;
    831         }
    832         case WebPageMessage::Cut: {
    833             cut();
    834             return;
    835         }
    836         case WebPageMessage::Paste: {
    837             paste();
    838             return;
    839         }           
    840 #if ENABLE(TOUCH_EVENTS)
    841         case WebPageMessage::TouchEvent: {
    842             WebTouchEvent event;
    843             if (!arguments->decode(event))
    844                 return;
    845             touchEvent(event);
    846         }
    847 #endif
    848         case WebPageMessage::LoadURL: {
    849             String url;
    850             if (!arguments->decode(url))
    851                 return;
    852            
    853             loadURL(url);
    854             return;
    855         }
    856         case WebPageMessage::LoadURLRequest: {
    857             ResourceRequest request;
    858             if (!arguments->decode(request))
    859                 return;
    860            
    861             loadURLRequest(request);
    862             return;
    863         }
    864         case WebPageMessage::LoadHTMLString: {
    865             String htmlString;
    866             String baseURL;
    867             if (!arguments->decode(CoreIPC::Out(htmlString, baseURL)))
    868                 return;
    869            
    870             loadHTMLString(htmlString, baseURL);
    871             return;
    872         }
    873         case WebPageMessage::LoadPlainTextString: {
    874             String string;
    875             if (!arguments->decode(CoreIPC::Out(string)))
    876                 return;
    877            
    878             loadPlainTextString(string);
    879             return;
    880         }
    881         case WebPageMessage::StopLoading:
    882             stopLoading();
    883             return;
    884         case WebPageMessage::Reload: {
    885             bool reloadFromOrigin;
    886             if (!arguments->decode(CoreIPC::Out(reloadFromOrigin)))
    887                 return;
    888 
    889             reload(reloadFromOrigin);
    890             return;
    891         }
    892         case WebPageMessage::GoForward: {
    893             uint64_t backForwardItemID;
    894             if (!arguments->decode(CoreIPC::Out(backForwardItemID)))
    895                 return;
    896             goForward(backForwardItemID);
    897             return;
    898         }
    899         case WebPageMessage::GoBack: {
    900             uint64_t backForwardItemID;
    901             if (!arguments->decode(CoreIPC::Out(backForwardItemID)))
    902                 return;
    903             goBack(backForwardItemID);
    904             return;
    905         }
    906        case WebPageMessage::GoToBackForwardItem: {
    907             uint64_t backForwardItemID;
    908             if (!arguments->decode(CoreIPC::Out(backForwardItemID)))
    909                 return;
    910             goToBackForwardItem(backForwardItemID);
    911             return;
    912         }
    913         case WebPageMessage::DidReceivePolicyDecision: {
    914             uint64_t frameID;
    915             uint64_t listenerID;
    916             uint32_t policyAction;
    917             if (!arguments->decode(CoreIPC::Out(frameID, listenerID, policyAction)))
    918                 return;
    919             didReceivePolicyDecision(WebProcess::shared().webFrame(frameID), listenerID, (WebCore::PolicyAction)policyAction);
    920             return;
    921         }
    922         case WebPageMessage::RunJavaScriptInMainFrame: {
    923             String script;
    924             uint64_t callbackID;
    925             if (!arguments->decode(CoreIPC::Out(script, callbackID)))
    926                 return;
    927             runJavaScriptInMainFrame(script, callbackID);
    928             return;
    929         }
    930         case WebPageMessage::GetRenderTreeExternalRepresentation: {
    931             uint64_t callbackID;
    932             if (!arguments->decode(callbackID))
    933                 return;
    934             getRenderTreeExternalRepresentation(callbackID);
    935             return;
    936         }
    937         case WebPageMessage::GetSourceForFrame: {
    938             uint64_t frameID;
    939             uint64_t callbackID;
    940             if (!arguments->decode(CoreIPC::Out(frameID, callbackID)))
    941                 return;
    942             getSourceForFrame(WebProcess::shared().webFrame(frameID), callbackID);
    943             return;
    944         }
    945         case WebPageMessage::Close: {
    946             close();
    947             return;
    948         }
    949         case WebPageMessage::TryClose: {
    950             tryClose();
    951             return;
    952         }
    953         case WebPageMessage::SetCustomUserAgent: {
    954             String customUserAgent;
    955             if (!arguments->decode(CoreIPC::Out(customUserAgent)))
    956                 return;
    957             setCustomUserAgent(customUserAgent);
    958             return;
    959         }
    960         case WebPageMessage::UnapplyEditCommand: {
    961             uint64_t commandID;
    962             if (!arguments->decode(CoreIPC::Out(commandID)))
    963                 return;
    964             unapplyEditCommand(commandID);
    965             return;
    966         }
    967         case WebPageMessage::ReapplyEditCommand: {
    968             uint64_t commandID;
    969             if (!arguments->decode(CoreIPC::Out(commandID)))
    970                 return;
    971             reapplyEditCommand(commandID);
    972             return;
    973         }
    974         case WebPageMessage::DidRemoveEditCommand: {
    975             uint64_t commandID;
    976             if (!arguments->decode(CoreIPC::Out(commandID)))
    977                 return;
    978             didRemoveEditCommand(commandID);
    979             return;
    980         }
    981         case WebPageMessage::SetPageZoomFactor: {
    982             double zoomFactor;
    983             if (!arguments->decode(CoreIPC::Out(zoomFactor)))
    984                 return;
    985             setPageZoomFactor(zoomFactor);
    986             return;
    987         }
    988         case WebPageMessage::SetTextZoomFactor: {
    989             double zoomFactor;
    990             if (!arguments->decode(CoreIPC::Out(zoomFactor)))
    991                 return;
    992             setTextZoomFactor(zoomFactor);
    993             return;
    994         }
    995         case WebPageMessage::SetPageAndTextZoomFactors: {
    996             double pageZoomFactor;
    997             double textZoomFactor;
    998             if (!arguments->decode(CoreIPC::Out(pageZoomFactor, textZoomFactor)))
    999                 return;
    1000             setPageAndTextZoomFactors(pageZoomFactor, textZoomFactor);
    1001             return;
    1002         }
    1003     }
    1004 
    1005     ASSERT_NOT_REACHED();
     751    didReceiveWebPageMessage(connection, messageID, arguments);
    1006752}
    1007753
  • trunk/WebKit2/WebProcess/WebPage/WebPage.h

    r68065 r68079  
    162162
    163163    void platformInitialize();
     164
     165    void didReceiveWebPageMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
     166
    164167    static const char* interpretKeyEvent(const WebCore::KeyboardEvent*);
    165168    bool performDefaultBehaviorForKeyEvent(const WebKeyboardEvent&);
     
    194197    void runJavaScriptInMainFrame(const String&, uint64_t callbackID);
    195198    void getRenderTreeExternalRepresentation(uint64_t callbackID);
    196     void getSourceForFrame(WebFrame*, uint64_t callbackID);
     199    void getSourceForFrame(uint64_t frameID, uint64_t callbackID);
    197200    void preferencesDidChange(const WebPreferencesStore&);
    198201    void platformPreferencesDidChange(const WebPreferencesStore&);
    199     void didReceivePolicyDecision(WebFrame*, uint64_t listenerID, WebCore::PolicyAction policyAction);
     202    void didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction);
    200203    void setCustomUserAgent(const String&);
    201204
  • trunk/WebKit2/win/WebKit2.make

    r61820 r68079  
    1616        xcopy "$(OBJROOT)\lib\*" "$(DSTROOT)\AppleInternal\lib\" /e/v/i/h/y
    1717        -xcopy "$(OBJROOT)\bin\WebKit2.resources\*" "$(DSTROOT)\AppleInternal\bin\WebKit2.resources" /e/v/i/h/y
     18        -mkdir "$(DSTROOT)\AppleInternal\Sources\WebKit2"
     19        xcopy "$(OBJROOT)\obj\WebKit\DerivedSources\*" "$(DSTROOT)\AppleInternal\Sources\WebKit2" /e/v/i/h/y
  • trunk/WebKit2/win/WebKit2.vcproj

    r67813 r68079  
    458458                        </File>
    459459                        <File
     460                                RelativePath="..\Shared\WebCertificateInfo.h"
     461                                >
     462                        </File>
     463                        <File
    460464                                RelativePath="..\Shared\WebCoreTypeArgumentMarshalling.h"
    461                                 >
    462                         </File>
    463                         <File
    464                                 RelativePath="..\Shared\WebCertificateInfo.h"
    465465                                >
    466466                        </File>
     
    534534                                <File
    535535                                        RelativePath="..\Shared\CoreIPCSupport\InjectedBundleMessageKinds.h"
    536                                         >
    537                                 </File>
    538                                 <File
    539                                         RelativePath="..\Shared\CoreIPCSupport\WebPageMessageKinds.h"
    540536                                        >
    541537                                </File>
     
    561557                                </File>
    562558                                <File
     559                                        RelativePath="..\Shared\win\PlatformCertificateInfo.h"
     560                                        >
     561                                </File>
     562                                <File
    563563                                        RelativePath="..\Shared\win\UpdateChunk.cpp"
    564564                                        >
     
    578578                                <File
    579579                                        RelativePath="..\Shared\win\WebEventFactory.h"
    580                                         >
    581                                 </File>
    582                                 <File
    583                                         RelativePath="..\Shared\win\PlatformCertificateInfo.h"
    584580                                        >
    585581                                </File>
     
    18131809                                </File>
    18141810                                <File
     1811                                        RelativePath="..\Platform\CoreIPC\HandleMessage.h"
     1812                                        >
     1813                                </File>
     1814                                <File
    18151815                                        RelativePath="..\Platform\CoreIPC\MessageID.h"
    18161816                                        >
     
    19371937                                >
    19381938                        </File>
     1939                </Filter>
     1940                <Filter
     1941                        Name="Derived Sources"
     1942                        >
     1943                        <File
     1944                                RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\WebPageMessageReceiver.cpp"
     1945                                >
     1946                        </File>
     1947                        <File
     1948                                RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\WebPageMessages.h"
     1949                                >
     1950                        </File>
     1951                </Filter>
     1952                <Filter
     1953                        Name="Scripts"
     1954                        >
     1955                        <File
     1956                                RelativePath="..\Scripts\generate-message-receiver.py"
     1957                                >
     1958                        </File>
     1959                        <File
     1960                                RelativePath="..\Scripts\generate-messages-header.py"
     1961                                >
     1962                        </File>
     1963                        <Filter
     1964                                Name="webkit2"
     1965                                >
     1966                                <File
     1967                                        RelativePath="..\Scripts\webkit2\__init__.py"
     1968                                        >
     1969                                </File>
     1970                                <File
     1971                                        RelativePath="..\Scripts\webkit2\messages.py"
     1972                                        >
     1973                                </File>
     1974                                <File
     1975                                        RelativePath="..\Scripts\webkit2\messages_unittest.py"
     1976                                        >
     1977                                </File>
     1978                        </Filter>
    19391979                </Filter>
    19401980                <File
  • trunk/WebKit2/win/WebKit2Common.vsprops

    r66998 r68079  
    77        <Tool
    88                Name="VCCLCompilerTool"
    9                 AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\Platform&quot;;&quot;$(ProjectDir)\..\Platform\CoreIPC&quot;;&quot;$(ProjectDir)\..\Shared&quot;;&quot;$(ProjectDir)\..\Shared\win&quot;;&quot;$(ProjectDir)\..\Shared\CoreIPCSupport&quot;;&quot;$(ProjectDir)\..\UIProcess&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C&quot;;&quot;$(ProjectDir)\..\UIProcess\API\cpp&quot;;&quot;$(ProjectDir)\..\UIProcess\API\win&quot;;&quot;$(ProjectDir)\..\UIProcess\Launcher&quot;;&quot;$(ProjectDir)\..\UIProcess\Plugins&quot;;&quot;$(ProjectDir)\..\UIProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport\win&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage\win&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\API\c&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\DOM&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\win&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\WebProcess\win&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include\pthreads&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;"
     9                AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\Platform&quot;;&quot;$(ProjectDir)\..\Platform\CoreIPC&quot;;&quot;$(ProjectDir)\..\Shared&quot;;&quot;$(ProjectDir)\..\Shared\win&quot;;&quot;$(ProjectDir)\..\Shared\CoreIPCSupport&quot;;&quot;$(ProjectDir)\..\UIProcess&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C&quot;;&quot;$(ProjectDir)\..\UIProcess\API\cpp&quot;;&quot;$(ProjectDir)\..\UIProcess\API\win&quot;;&quot;$(ProjectDir)\..\UIProcess\Launcher&quot;;&quot;$(ProjectDir)\..\UIProcess\Plugins&quot;;&quot;$(ProjectDir)\..\UIProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport\win&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage\win&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\API\c&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\DOM&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\win&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\WebProcess\win&quot;;&quot;$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include\pthreads&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;"
    1010                PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;BUILDING_WEBKIT"
    1111                UsePrecompiledHeader="2"
  • trunk/WebKit2/win/WebKit2Generated.make

    r67813 r68079  
    4848    xcopy /y /d "..\WebProcess\InjectedBundle\API\c\WKBundleRangeHandle.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
    4949    xcopy /y /d "..\WebProcess\InjectedBundle\API\c\WKBundleScriptWorld.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
     50    bash build-generated-files.sh "$(WEBKITOUTPUTDIR)"
    5051    -del "$(WEBKITOUTPUTDIR)\buildfailed"
    5152
  • trunk/WebKit2/win/WebKit2Generated.vcproj

    r61166 r68079  
    4141        <Files>
    4242                <File
     43                        RelativePath=".\build-generated-files.sh"
     44                        >
     45                </File>
     46                <File
    4347                        RelativePath=".\WebKit2Generated.make"
    4448                        >
Note: See TracChangeset for help on using the changeset viewer.