Changeset 198736 in webkit


Ignore:
Timestamp:
Mar 28, 2016, 8:56:53 AM (10 years ago)
Author:
timothy@apple.com
Message:

Add WebAutomationSessionProxy for WebProcess side automation tasks

https://bugs.webkit.org/show_bug.cgi?id=155221
rdar://problem/25054868

Reviewed by Joseph Pecoraro.

  • CMakeLists.txt: Add build step to build-in WebAutomationSessionProxy.js.
  • DerivedSources.make: Ditto.
  • UIProcess/Automation/WebAutomationSession.cpp:

(WebKit::WebAutomationSession::~WebAutomationSession):
(WebKit::WebAutomationSession::setProcessPool): Add / remove message receiver.

  • UIProcess/Automation/WebAutomationSession.h:
  • UIProcess/Automation/WebAutomationSession.messages.in: Added.

Test message to get things to build.

  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::removeMessageReceiver):
(WebKit::WebProcessPool::setAutomationSession):

  • UIProcess/WebProcessPool.h:
  • WebKit2.xcodeproj/project.pbxproj: Added new files.
  • WebProcess/Automation/WebAutomationSessionProxy.cpp: Added.

(WebKit::toJSString):
(WebKit::toJSValue):
(WebKit::WebAutomationSessionProxy::WebAutomationSessionProxy):
(WebKit::WebAutomationSessionProxy::~WebAutomationSessionProxy):
(WebKit::evaluate):
(WebKit::createUUID):
(WebKit::WebAutomationSessionProxy::scriptObjectForFrame):
(WebKit::WebAutomationSessionProxy::didClearWindowObjectForFrame):
Create a script object per frame that is evaluated from WebAutomationSessionProxy.js.
Clear the script object when the window object is cleared.

  • WebProcess/Automation/WebAutomationSessionProxy.h: Added.

(WebKit::WebAutomationSessionProxy::test):
Added test message to let the messages files build.

  • WebProcess/Automation/WebAutomationSessionProxy.js: Added.
  • WebProcess/Automation/WebAutomationSessionProxy.messages.in: Added.
  • WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:

(WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
Call WebAutomationSessionProxy::didClearWindowObjectForFrame to clear the script object.

  • WebProcess/WebProcess.cpp:

(WebKit::WebProcess::ensureAutomationSessionProxy):
(WebKit::WebProcess::destroyAutomationSessionProxy):
Creates and destroys the WebAutomationSessionProxy when the UIProcess WebAutomationSession
is set or removed on the WebProcessPool.

  • WebProcess/WebProcess.h:

(WebKit::WebProcess::automationSessionProxy): Added.

  • WebProcess/WebProcess.messages.in: Added. Test message to get things to build.
Location:
trunk/Source/WebKit2
Files:
6 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/CMakeLists.txt

    r198678 r198736  
    4343    "${WEBKIT2_DIR}/WebProcess"
    4444    "${WEBKIT2_DIR}/WebProcess/ApplicationCache"
     45    "${WEBKIT2_DIR}/WebProcess/Automation"
    4546    "${WEBKIT2_DIR}/WebProcess/Battery"
    4647    "${WEBKIT2_DIR}/WebProcess/Cookies"
     
    503504    WebProcess/WebProcess.cpp
    504505
     506    WebProcess/Automation/WebAutomationSessionProxy.cpp
     507
    505508    WebProcess/Battery/WebBatteryManager.cpp
    506509
     
    674677    UIProcess/WebVibrationProxy.messages.in
    675678
     679    UIProcess/Automation/WebAutomationSession.messages.in
     680
    676681    UIProcess/Databases/DatabaseProcessProxy.messages.in
    677682
     
    689694
    690695    WebProcess/WebProcess.messages.in
     696
     697    WebProcess/Automation/WebAutomationSessionProxy.messages.in
    691698
    692699    WebProcess/Battery/WebBatteryManager.messages.in
     
    799806)
    800807
     808add_custom_command(
     809    OUTPUT ${DERIVED_SOURCES_WEBKIT2_DIR}/WebAutomationSessionProxyScriptSource.h ${DERIVED_SOURCES_WEBKIT2_DIR}/WebAutomationSessionProxy.min.js
     810    MAIN_DEPENDENCY ${WEBKIT2_DIR}/WebProcess/Automation/WebAutomationSessionProxy.js
     811    DEPENDS ${JavaScriptCore_SCRIPTS_DIR}/xxd.pl ${JavaScriptCore_SCRIPTS_DIR}/jsmin.py
     812    COMMAND ${CMAKE_COMMAND} -E echo "//# sourceURL=__WebAutomationInjectedScript__" > ${DERIVED_SOURCES_WEBKIT2_DIR}/WebAutomationSessionProxy.min.js
     813    COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/jsmin.py < ${WEBKIT2_DIR}/WebProcess/Automation/WebAutomationSessionProxy.js >> ${DERIVED_SOURCES_WEBKIT2_DIR}/WebAutomationSessionProxy.min.js
     814    COMMAND ${PERL_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/xxd.pl WebAutomationSessionProxyScriptSource ${DERIVED_SOURCES_WEBKIT2_DIR}/WebAutomationSessionProxy.min.js ${DERIVED_SOURCES_WEBKIT2_DIR}/WebAutomationSessionProxyScriptSource.h
     815    VERBATIM)
     816
     817list(APPEND WebKit2_HEADERS
     818    ${DERIVED_SOURCES_WEBKIT2_DIR}/WebauotmationSessionProxyScriptSource.h
     819)
     820
    801821WEBKIT_FRAMEWORK(WebKit2)
    802822add_dependencies(WebKit2 WebCore ${WEBKIT2_EXTRA_DEPENDENCIES})
  • trunk/Source/WebKit2/ChangeLog

    r198733 r198736  
     12016-03-14  Timothy Hatcher  <timothy@apple.com>
     2
     3        Add WebAutomationSessionProxy for WebProcess side automation tasks
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=155221
     6        rdar://problem/25054868
     7
     8        Reviewed by Joseph Pecoraro.
     9
     10        * CMakeLists.txt: Add build step to build-in WebAutomationSessionProxy.js.
     11        * DerivedSources.make: Ditto.
     12
     13        * UIProcess/Automation/WebAutomationSession.cpp:
     14        (WebKit::WebAutomationSession::~WebAutomationSession):
     15        (WebKit::WebAutomationSession::setProcessPool): Add / remove message receiver.
     16        * UIProcess/Automation/WebAutomationSession.h:
     17
     18        * UIProcess/Automation/WebAutomationSession.messages.in: Added.
     19        Test message to get things to build.
     20
     21        * UIProcess/WebProcessPool.cpp:
     22        (WebKit::WebProcessPool::removeMessageReceiver):
     23        (WebKit::WebProcessPool::setAutomationSession):
     24        * UIProcess/WebProcessPool.h:
     25
     26        * WebKit2.xcodeproj/project.pbxproj: Added new files.
     27
     28        * WebProcess/Automation/WebAutomationSessionProxy.cpp: Added.
     29        (WebKit::toJSString):
     30        (WebKit::toJSValue):
     31        (WebKit::WebAutomationSessionProxy::WebAutomationSessionProxy):
     32        (WebKit::WebAutomationSessionProxy::~WebAutomationSessionProxy):
     33        (WebKit::evaluate):
     34        (WebKit::createUUID):
     35        (WebKit::WebAutomationSessionProxy::scriptObjectForFrame):
     36        (WebKit::WebAutomationSessionProxy::didClearWindowObjectForFrame):
     37        Create a script object per frame that is evaluated from WebAutomationSessionProxy.js.
     38        Clear the script object when the window object is cleared.
     39
     40        * WebProcess/Automation/WebAutomationSessionProxy.h: Added.
     41        (WebKit::WebAutomationSessionProxy::test):
     42        Added test message to let the messages files build.
     43
     44        * WebProcess/Automation/WebAutomationSessionProxy.js: Added.
     45
     46        * WebProcess/Automation/WebAutomationSessionProxy.messages.in: Added.
     47
     48        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
     49        (WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
     50        Call WebAutomationSessionProxy::didClearWindowObjectForFrame to clear the script object.
     51
     52        * WebProcess/WebProcess.cpp:
     53        (WebKit::WebProcess::ensureAutomationSessionProxy):
     54        (WebKit::WebProcess::destroyAutomationSessionProxy):
     55        Creates and destroys the WebAutomationSessionProxy when the UIProcess WebAutomationSession
     56        is set or removed on the WebProcessPool.
     57
     58        * WebProcess/WebProcess.h:
     59        (WebKit::WebProcess::automationSessionProxy): Added.
     60
     61        * WebProcess/WebProcess.messages.in: Added. Test message to get things to build.
     62
    1632016-03-28  Dan Bernstein  <mitz@apple.com>
    264
  • trunk/Source/WebKit2/DerivedSources.make

    r198678 r198736  
    3737    $(WebKit2)/Shared/mac \
    3838    $(WebKit2)/WebProcess/ApplicationCache \
     39    $(WebKit2)/WebProcess/Automation \
    3940    $(WebKit2)/WebProcess/Cookies \
    4041    $(WebKit2)/WebProcess/Databases/IndexedDB \
     
    7172    $(WEBKITADDITIONS_HEADER_SEARCH_PATHS) \
    7273#
     74
     75PYTHON = python
     76PERL = perl
     77
     78ifeq ($(OS),Windows_NT)
     79    DELETE = cmd //C del
     80else
     81    DELETE = rm -f
     82endif
    7383
    7484MESSAGE_RECEIVERS = \
     
    109119    VisitedLinkStore \
    110120    VisitedLinkTableController \
     121    WebAutomationSession \
     122    WebAutomationSessionProxy \
    111123    WebConnection \
    112124    WebCookieManager \
     
    220232
    221233all : $(firstword $(AUTOMATION_PROTOCOL_OUTPUT_FILES))
     234
     235%ScriptSource.h : %.js $(JavaScriptCore_SCRIPTS_DIR)/jsmin.py $(JavaScriptCore_SCRIPTS_DIR)/xxd.pl
     236        echo "//# sourceURL=__WebAutomationInjectedScript__" > $(basename $(notdir $<)).min.js
     237        $(PYTHON) $(JavaScriptCore_SCRIPTS_DIR)/jsmin.py < $< >> $(basename $(notdir $<)).min.js
     238        $(PERL) $(JavaScriptCore_SCRIPTS_DIR)/xxd.pl $(basename $(notdir $<))ScriptSource $(basename $(notdir $<)).min.js $@
     239        $(DELETE) $(basename $(notdir $<)).min.js
     240
     241all : WebAutomationSessionProxyScriptSource.h
  • trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp

    r198678 r198736  
    2929#include "APIAutomationSessionClient.h"
    3030#include "AutomationProtocolObjects.h"
     31#include "WebAutomationSessionMessages.h"
     32#include "WebAutomationSessionProxyMessages.h"
    3133#include "WebProcessPool.h"
    3234#include <JavaScriptCore/InspectorBackendDispatcher.h>
     
    5860{
    5961    ASSERT(!m_client);
     62
     63    if (m_processPool)
     64        m_processPool->removeMessageReceiver(Messages::WebAutomationSession::messageReceiverName());
    6065}
    6166
     
    6368{
    6469    m_client = WTFMove(client);
     70}
     71
     72void WebAutomationSession::setProcessPool(WebKit::WebProcessPool* processPool)
     73{
     74    if (m_processPool)
     75        m_processPool->removeMessageReceiver(Messages::WebAutomationSession::messageReceiverName());
     76
     77    m_processPool = processPool;
     78
     79    if (m_processPool)
     80        m_processPool->addMessageReceiver(Messages::WebAutomationSession::messageReceiverName(), *this);
    6581}
    6682
  • trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.h

    r198678 r198736  
    2929#include "APIObject.h"
    3030#include "AutomationBackendDispatchers.h"
     31#include "Connection.h"
    3132#include <wtf/Forward.h>
    3233
     
    5051class WebProcessPool;
    5152
    52 class WebAutomationSession final : public API::ObjectImpl<API::Object::Type::AutomationSession>
     53class WebAutomationSession final : public API::ObjectImpl<API::Object::Type::AutomationSession>, public IPC::MessageReceiver
    5354#if ENABLE(REMOTE_INSPECTOR)
    5455    , public Inspector::RemoteAutomationTarget
     
    6970
    7071    WebKit::WebProcessPool* processPool() const { return m_processPool; }
    71     void setProcessPool(WebKit::WebProcessPool* processPool) { m_processPool = processPool; }
     72    void setProcessPool(WebKit::WebProcessPool*);
    7273
    7374#if ENABLE(REMOTE_INSPECTOR)
     
    9495    String handleForWebPageProxy(WebKit::WebPageProxy*);
    9596
     97    // Implemented in generated WebAutomationSessionMessageReceiver.cpp
     98    void didReceiveMessage(IPC::Connection&, IPC::MessageDecoder&) override;
     99
     100    // Called by WebAutomationSession messages
     101    // FIXME: Add message functions here.
     102    void test() { };
     103
    96104    WebKit::WebProcessPool* m_processPool { nullptr };
    97105    std::unique_ptr<API::AutomationSessionClient> m_client;
  • trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp

    r198189 r198736  
    648648        process->send(Messages::WebProcess::EnsurePrivateBrowsingSession(SessionID::legacyPrivateSessionID()), 0);
    649649
     650    if (m_automationSession)
     651        process->send(Messages::WebProcess::EnsureAutomationSessionProxy(m_automationSession->sessionIdentifier()), 0);
     652
    650653    m_processes.append(process.ptr());
    651654
     
    993996}
    994997
     998void WebProcessPool::removeMessageReceiver(IPC::StringReference messageReceiverName)
     999{
     1000    m_messageReceiverMap.removeMessageReceiver(messageReceiverName);
     1001}
     1002
    9951003void WebProcessPool::removeMessageReceiver(IPC::StringReference messageReceiverName, uint64_t destinationID)
    9961004{
     
    11281136        m_automationSession->init();
    11291137        m_automationSession->setProcessPool(this);
    1130     }
     1138
     1139        sendToAllProcesses(Messages::WebProcess::EnsureAutomationSessionProxy(m_automationSession->sessionIdentifier()));
     1140    } else
     1141        sendToAllProcesses(Messages::WebProcess::DestroyAutomationSessionProxy());
    11311142#endif
    11321143}
  • trunk/Source/WebKit2/UIProcess/WebProcessPool.h

    r198189 r198736  
    127127    void addMessageReceiver(IPC::StringReference messageReceiverName, IPC::MessageReceiver&);
    128128    void addMessageReceiver(IPC::StringReference messageReceiverName, uint64_t destinationID, IPC::MessageReceiver&);
     129    void removeMessageReceiver(IPC::StringReference messageReceiverName);
    129130    void removeMessageReceiver(IPC::StringReference messageReceiverName, uint64_t destinationID);
    130131
  • trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj

    r198678 r198736  
    518518                1AFE436618B6C081009C7A48 /* UIDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AFE436418B6C081009C7A48 /* UIDelegate.h */; };
    519519                1AFF49001833DE78009AB15A /* WKDeprecatedFunctions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFF48FE1833DE78009AB15A /* WKDeprecatedFunctions.cpp */; };
     520                1C0A19461C8FF1A800FE0EBB /* WebAutomationSessionProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C0A19441C8FF1A800FE0EBB /* WebAutomationSessionProxy.cpp */; };
     521                1C0A19471C8FF1A800FE0EBB /* WebAutomationSessionProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C0A19451C8FF1A800FE0EBB /* WebAutomationSessionProxy.h */; };
     522                1C0A19531C8FFDFB00FE0EBB /* WebAutomationSessionProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C0A19511C8FFDFB00FE0EBB /* WebAutomationSessionProxyMessageReceiver.cpp */; };
     523                1C0A19541C8FFDFB00FE0EBB /* WebAutomationSessionProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C0A19521C8FFDFB00FE0EBB /* WebAutomationSessionProxyMessages.h */; };
     524                1C0A19571C90068F00FE0EBB /* WebAutomationSessionMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C0A19551C90068F00FE0EBB /* WebAutomationSessionMessageReceiver.cpp */; };
     525                1C0A19581C90068F00FE0EBB /* WebAutomationSessionMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C0A19561C90068F00FE0EBB /* WebAutomationSessionMessages.h */; };
     526                1C0A195C1C916E1B00FE0EBB /* WebAutomationSessionProxyScriptSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C0A195B1C916E1B00FE0EBB /* WebAutomationSessionProxyScriptSource.h */; };
    520527                1C891D6519B124FF00BA79DD /* WebInspectorUI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C891D6219B124FF00BA79DD /* WebInspectorUI.cpp */; };
    521528                1C891D6619B124FF00BA79DD /* WebInspectorUI.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C891D6319B124FF00BA79DD /* WebInspectorUI.h */; };
     
    24772484                1AFF48FE1833DE78009AB15A /* WKDeprecatedFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKDeprecatedFunctions.cpp; sourceTree = "<group>"; };
    24782485                1BB417C912C00CCA002BE67B /* TextCheckerCompletion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextCheckerCompletion.cpp; sourceTree = "<group>"; };
     2486                1C0A19441C8FF1A800FE0EBB /* WebAutomationSessionProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebAutomationSessionProxy.cpp; sourceTree = "<group>"; };
     2487                1C0A19451C8FF1A800FE0EBB /* WebAutomationSessionProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAutomationSessionProxy.h; sourceTree = "<group>"; };
     2488                1C0A19481C8FF30E00FE0EBB /* WebAutomationSessionProxy.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebAutomationSessionProxy.messages.in; sourceTree = "<group>"; };
     2489                1C0A19511C8FFDFB00FE0EBB /* WebAutomationSessionProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebAutomationSessionProxyMessageReceiver.cpp; sourceTree = "<group>"; };
     2490                1C0A19521C8FFDFB00FE0EBB /* WebAutomationSessionProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAutomationSessionProxyMessages.h; sourceTree = "<group>"; };
     2491                1C0A19551C90068F00FE0EBB /* WebAutomationSessionMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebAutomationSessionMessageReceiver.cpp; sourceTree = "<group>"; };
     2492                1C0A19561C90068F00FE0EBB /* WebAutomationSessionMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAutomationSessionMessages.h; sourceTree = "<group>"; };
     2493                1C0A19591C9006EA00FE0EBB /* WebAutomationSession.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebAutomationSession.messages.in; sourceTree = "<group>"; };
     2494                1C0A195A1C91669500FE0EBB /* WebAutomationSessionProxy.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = WebAutomationSessionProxy.js; sourceTree = "<group>"; };
     2495                1C0A195B1C916E1B00FE0EBB /* WebAutomationSessionProxyScriptSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAutomationSessionProxyScriptSource.h; sourceTree = "<group>"; };
    24792496                1C77C1951288A872006A742F /* WebInspectorProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebInspectorProxy.messages.in; sourceTree = "<group>"; };
    24802497                1C891D6219B124FF00BA79DD /* WebInspectorUI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebInspectorUI.cpp; sourceTree = "<group>"; };
     
    47104727                        sourceTree = "<group>";
    47114728                };
     4729                1C0A19431C8FF1A800FE0EBB /* Automation */ = {
     4730                        isa = PBXGroup;
     4731                        children = (
     4732                                1C0A19441C8FF1A800FE0EBB /* WebAutomationSessionProxy.cpp */,
     4733                                1C0A19451C8FF1A800FE0EBB /* WebAutomationSessionProxy.h */,
     4734                                1C0A195A1C91669500FE0EBB /* WebAutomationSessionProxy.js */,
     4735                                1C0A19481C8FF30E00FE0EBB /* WebAutomationSessionProxy.messages.in */,
     4736                        );
     4737                        path = Automation;
     4738                        sourceTree = "<group>";
     4739                };
    47124740                1F0181681858DC1500F92884 /* Cocoa */ = {
    47134741                        isa = PBXGroup;
     
    55965624                                9955A6EA1C7980BB00EB6A93 /* WebAutomationSession.cpp */,
    55975625                                9955A6EB1C7980BB00EB6A93 /* WebAutomationSession.h */,
     5626                                1C0A19591C9006EA00FE0EBB /* WebAutomationSession.messages.in */,
    55985627                        );
    55995628                        path = Automation;
     
    56555684                        children = (
    56565685                                7C6E70F818B2D47E00F24E2E /* cocoa */,
     5686                                1C0A19431C8FF1A800FE0EBB /* Automation */,
    56575687                                3309344B1315B93A0097A7BC /* Cookies */,
    56585688                                512A9754180DF9270039A149 /* Databases */,
     
    68766906                                1A8E7D3A18C15149005A702A /* VisitedLinkTableControllerMessageReceiver.cpp */,
    68776907                                1A8E7D3B18C15149005A702A /* VisitedLinkTableControllerMessages.h */,
     6908                                1C0A19551C90068F00FE0EBB /* WebAutomationSessionMessageReceiver.cpp */,
     6909                                1C0A19561C90068F00FE0EBB /* WebAutomationSessionMessages.h */,
     6910                                1C0A19511C8FFDFB00FE0EBB /* WebAutomationSessionProxyMessageReceiver.cpp */,
     6911                                1C0A19521C8FFDFB00FE0EBB /* WebAutomationSessionProxyMessages.h */,
     6912                                1C0A195B1C916E1B00FE0EBB /* WebAutomationSessionProxyScriptSource.h */,
    68786913                                1A1FEC1A1627B45600700F6D /* WebConnectionMessageReceiver.cpp */,
    68796914                                1A1FEC1B1627B45700700F6D /* WebConnectionMessages.h */,
     
    73497384                                BCA8C6B011E3C08700812FB7 /* InjectedBundlePageUIClient.h in Headers */,
    73507385                                9955A6F71C7986E500EB6A93 /* AutomationProtocolObjects.h in Headers */,
     7386                                1C0A19581C90068F00FE0EBB /* WebAutomationSessionMessages.h in Headers */,
    73517387                                BC33E0D112408E8600360F3F /* InjectedBundleRangeHandle.h in Headers */,
    73527388                                BC14DF77120B5B7900826C0C /* InjectedBundleScriptWorld.h in Headers */,
     
    73657401                                CE1A0BD51A48E6C60054EF74 /* ManagedConfigurationSPI.h in Headers */,
    73667402                                51933DEF1965EB31008AC3EA /* MenuUtilities.h in Headers */,
     7403                                1C0A195C1C916E1B00FE0EBB /* WebAutomationSessionProxyScriptSource.h in Headers */,
    73677404                                1A232903162C867300D82F7A /* MessageDecoder.h in Headers */,
    73687405                                1A2328FF162C866A00D82F7A /* MessageEncoder.h in Headers */,
     
    74287465                                1A2D82A7127F4EAB001EB962 /* NPObjectProxy.h in Headers */,
    74297466                                1A2D82A9127F4EAB001EB962 /* NPRemoteObjectMap.h in Headers */,
     7467                                1C0A19471C8FF1A800FE0EBB /* WebAutomationSessionProxy.h in Headers */,
    74307468                                1A2161B011F37664008AD0F5 /* NPRuntimeObjectMap.h in Headers */,
    74317469                                1A2162B111F38971008AD0F5 /* NPRuntimeUtilities.h in Headers */,
     
    74567494                                1A179780137EE82C00F97D45 /* PluginCreationParameters.h in Headers */,
    74577495                                7C3F8C91173AF52D007B7F39 /* PluginInformation.h in Headers */,
     7496                                1C0A19541C8FFDFB00FE0EBB /* WebAutomationSessionProxyMessages.h in Headers */,
    74587497                                1AEFCC1211D01F96008219D3 /* PluginInfoStore.h in Headers */,
    74597498                                1A3D610213A7CC2A00F95D4E /* PluginModuleInfo.h in Headers */,
     
    88778916                                1A2D8439127F65D5001EB962 /* NPObjectMessageReceiverMessageReceiver.cpp in Sources */,
    88788917                                1A2D82A6127F4EAB001EB962 /* NPObjectProxy.cpp in Sources */,
     8918                                1C0A19531C8FFDFB00FE0EBB /* WebAutomationSessionProxyMessageReceiver.cpp in Sources */,
    88798919                                1A2D82A8127F4EAB001EB962 /* NPRemoteObjectMap.cpp in Sources */,
    88808920                                1A2161B111F37664008AD0F5 /* NPRuntimeObjectMap.cpp in Sources */,
     
    91189158                                1C891D6519B124FF00BA79DD /* WebInspectorUI.cpp in Sources */,
    91199159                                1CA8B954127C891500576C2B /* WebInspectorUIMac.mm in Sources */,
     9160                                1C0A19571C90068F00FE0EBB /* WebAutomationSessionMessageReceiver.cpp in Sources */,
    91209161                                1CBBE4A019B66C53006B7D81 /* WebInspectorUIMessageReceiver.cpp in Sources */,
    91219162                                2DA944A11884E4F000ED86DB /* WebIOSEventFactory.mm in Sources */,
     
    92139254                                BCC5715C115ADAEF001CCAF9 /* WebSystemInterface.mm in Sources */,
    92149255                                51032F18180F73BB00961BB7 /* WebToDatabaseProcessConnection.cpp in Sources */,
     9256                                1C0A19461C8FF1A800FE0EBB /* WebAutomationSessionProxy.cpp in Sources */,
    92159257                                C0337DD8127A51B6008FF4F4 /* WebTouchEvent.cpp in Sources */,
    92169258                                2DA944A31884E4F000ED86DB /* WebTouchEventIOS.cpp in Sources */,
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

    r196223 r198736  
    3838#include "UserData.h"
    3939#include "WKBundleAPICast.h"
     40#include "WebAutomationSessionProxy.h"
    4041#include "WebBackForwardListProxy.h"
    4142#include "WebCoreArgumentCoders.h"
     
    15801581    webPage->injectedBundleLoaderClient().didClearWindowObjectForFrame(webPage, m_frame, world);
    15811582
     1583    if (auto automationSessionProxy = WebProcess::singleton().automationSessionProxy())
     1584        automationSessionProxy->didClearWindowObjectForFrame(*m_frame);
     1585
    15821586#if HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
    15831587    // Ensure the accessibility hierarchy is updated.
  • trunk/Source/WebKit2/WebProcess/WebProcess.cpp

    r198457 r198736  
    4242#include "StatisticsData.h"
    4343#include "UserData.h"
     44#include "WebAutomationSessionProxy.h"
    4445#include "WebConnectionToUIProcess.h"
    4546#include "WebCookieManager.h"
     
    14391440#endif
    14401441
     1442void WebProcess::ensureAutomationSessionProxy(const String& sessionIdentifier)
     1443{
     1444    m_automationSessionProxy = std::make_unique<WebAutomationSessionProxy>(sessionIdentifier);
     1445}
     1446
     1447void WebProcess::destroyAutomationSessionProxy()
     1448{
     1449    m_automationSessionProxy = nullptr;
     1450}
     1451
    14411452void WebProcess::prefetchDNS(const String& hostname)
    14421453{
  • trunk/Source/WebKit2/WebProcess/WebProcess.h

    r198457 r198736  
    7777class ObjCObjectGraph;
    7878class UserData;
     79class WebAutomationSessionProxy;
    7980class WebConnectionToUIProcess;
    8081class WebFrame;
     
    211212    void prefetchDNS(const String&);
    212213
     214    WebAutomationSessionProxy* automationSessionProxy() { return m_automationSessionProxy.get(); }
     215
    213216private:
    214217    WebProcess();
     
    285288    void actualPrepareToSuspend(ShouldAcknowledgeWhenReadyToSuspend);
    286289
     290    void ensureAutomationSessionProxy(const String& sessionIdentifier);
     291    void destroyAutomationSessionProxy();
     292
    287293    // ChildProcess
    288294    void initializeProcess(const ChildProcessInitializationParameters&) override;
     
    354360    WebCore::HysteresisActivity m_dnsPrefetchHystereris;
    355361
     362    std::unique_ptr<WebAutomationSessionProxy> m_automationSessionProxy;
     363
    356364#if ENABLE(DATABASE_PROCESS)
    357365    void ensureWebToDatabaseProcessConnection();
  • trunk/Source/WebKit2/WebProcess/WebProcess.messages.in

    r198189 r198736  
    9393#endif
    9494
     95    EnsureAutomationSessionProxy(String sessionIdentifier)
     96    DestroyAutomationSessionProxy()
     97
    9598    ProcessWillSuspendImminently() -> (bool handled)
    9699    PrepareToSuspend()
Note: See TracChangeset for help on using the changeset viewer.