Title: [197564] trunk/Source
Revision
197564
Author
[email protected]
Date
2016-03-04 08:55:55 -0800 (Fri, 04 Mar 2016)

Log Message

Inform WebKit and WebCore if a page is controlled by automation.

https://bugs.webkit.org/show_bug.cgi?id=154991
rdar://problem/24965784

Reviewed by Joseph Pecoraro.

Source/WebCore:

* page/Page.h:
(WebCore::Page::isControlledByAutomation): Added.
(WebCore::Page::setControlledByAutomation): Added.

Source/WebKit2:

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/API/C/WKPage.cpp:
(WKPageGetIsControlledByAutomation):
(WKPageSetControlledByAutomation):
* UIProcess/API/C/WKPagePrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setControlledByAutomation):
(WebKit::WebPageProxy::creationParameters):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::isControlledByAutomation):
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageIsControlledByAutomation):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_shouldDispatchFakeMouseMoveEvents):
(WebKit::WebPage::isControlledByAutomation):
(WebKit::WebPage::setControlledByAutomation):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (197563 => 197564)


--- trunk/Source/WebCore/ChangeLog	2016-03-04 16:47:55 UTC (rev 197563)
+++ trunk/Source/WebCore/ChangeLog	2016-03-04 16:55:55 UTC (rev 197564)
@@ -1,3 +1,16 @@
+2016-03-04  Timothy Hatcher  <[email protected]>
+
+        Inform WebKit and WebCore if a page is controlled by automation.
+
+        https://bugs.webkit.org/show_bug.cgi?id=154991
+        rdar://problem/24965784
+
+        Reviewed by Joseph Pecoraro.
+
+        * page/Page.h:
+        (WebCore::Page::isControlledByAutomation): Added.
+        (WebCore::Page::setControlledByAutomation): Added.
+
 2016-03-03  Antti Koivisto  <[email protected]>
 
         ComposedTreeIterator may traverse slotted nodes multiple times

Modified: trunk/Source/WebCore/page/Page.h (197563 => 197564)


--- trunk/Source/WebCore/page/Page.h	2016-03-04 16:47:55 UTC (rev 197563)
+++ trunk/Source/WebCore/page/Page.h	2016-03-04 16:55:55 UTC (rev 197564)
@@ -504,6 +504,9 @@
 
     WEBCORE_EXPORT void setTimerAlignmentIntervalIncreaseLimit(std::chrono::milliseconds);
 
+    bool isControlledByAutomation() const { return m_controlledByAutomation; }
+    void setControlledByAutomation(bool controlled) { m_controlledByAutomation = controlled; }
+
 private:
     WEBCORE_EXPORT void initGroup();
 
@@ -682,6 +685,8 @@
     
     bool m_allowsMediaDocumentInlinePlayback { false };
     bool m_showAllPlugins { false };
+
+    bool m_controlledByAutomation { false };
 };
 
 inline PageGroup& Page::group()

Modified: trunk/Source/WebKit2/ChangeLog (197563 => 197564)


--- trunk/Source/WebKit2/ChangeLog	2016-03-04 16:47:55 UTC (rev 197563)
+++ trunk/Source/WebKit2/ChangeLog	2016-03-04 16:55:55 UTC (rev 197564)
@@ -1,3 +1,35 @@
+2016-03-04  Timothy Hatcher  <[email protected]>
+
+        Inform WebKit and WebCore if a page is controlled by automation.
+
+        https://bugs.webkit.org/show_bug.cgi?id=154991
+        rdar://problem/24965784
+
+        Reviewed by Joseph Pecoraro.
+
+        * Shared/WebPageCreationParameters.cpp:
+        (WebKit::WebPageCreationParameters::encode):
+        (WebKit::WebPageCreationParameters::decode):
+        * Shared/WebPageCreationParameters.h:
+        * UIProcess/API/C/WKPage.cpp:
+        (WKPageGetIsControlledByAutomation):
+        (WKPageSetControlledByAutomation):
+        * UIProcess/API/C/WKPagePrivate.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::setControlledByAutomation):
+        (WebKit::WebPageProxy::creationParameters):
+        * UIProcess/WebPageProxy.h:
+        (WebKit::WebPageProxy::isControlledByAutomation):
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+        (WKBundlePageIsControlledByAutomation):
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::m_shouldDispatchFakeMouseMoveEvents):
+        (WebKit::WebPage::isControlledByAutomation):
+        (WebKit::WebPage::setControlledByAutomation):
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+
 2016-03-03  Chris Dumez  <[email protected]>
 
         Regression(r196770): Unable to use HipChat Mac app

Modified: trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp (197563 => 197564)


--- trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp	2016-03-04 16:47:55 UTC (rev 197563)
+++ trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp	2016-03-04 16:55:55 UTC (rev 197564)
@@ -70,6 +70,7 @@
     encoder << backgroundExtendsBeyondPage;
     encoder.encodeEnum(layerHostingMode);
     encoder << mimeTypesWithCustomContentProviders;
+    encoder << controlledByAutomation;
 
 #if ENABLE(REMOTE_INSPECTOR)
     encoder << allowsRemoteInspection;
@@ -163,6 +164,8 @@
         return false;
     if (!decoder.decode(parameters.mimeTypesWithCustomContentProviders))
         return false;
+    if (!decoder.decode(parameters.controlledByAutomation))
+        return false;
 
 #if ENABLE(REMOTE_INSPECTOR)
     if (!decoder.decode(parameters.allowsRemoteInspection))

Modified: trunk/Source/WebKit2/Shared/WebPageCreationParameters.h (197563 => 197564)


--- trunk/Source/WebKit2/Shared/WebPageCreationParameters.h	2016-03-04 16:47:55 UTC (rev 197563)
+++ trunk/Source/WebKit2/Shared/WebPageCreationParameters.h	2016-03-04 16:55:55 UTC (rev 197564)
@@ -116,6 +116,8 @@
 
     Vector<String> mimeTypesWithCustomContentProviders;
 
+    bool controlledByAutomation;
+
 #if ENABLE(REMOTE_INSPECTOR)
     bool allowsRemoteInspection;
     String remoteInspectionNameOverride;

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp (197563 => 197564)


--- trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp	2016-03-04 16:47:55 UTC (rev 197563)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp	2016-03-04 16:55:55 UTC (rev 197564)
@@ -2534,6 +2534,16 @@
 }
 #endif
 
+bool WKPageGetIsControlledByAutomation(WKPageRef page)
+{
+    return toImpl(page)->isControlledByAutomation();
+}
+
+void WKPageSetControlledByAutomation(WKPageRef page, bool controlled)
+{
+    toImpl(page)->setControlledByAutomation(controlled);
+}
+
 bool WKPageGetAllowsRemoteInspection(WKPageRef page)
 {
 #if ENABLE(REMOTE_INSPECTOR)

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h (197563 => 197564)


--- trunk/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h	2016-03-04 16:47:55 UTC (rev 197563)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h	2016-03-04 16:55:55 UTC (rev 197564)
@@ -84,6 +84,9 @@
 WK_EXPORT void WKPageDrawPagesToPDF(WKPageRef page, WKFrameRef frame, WKPrintInfo printInfo, uint32_t first, uint32_t count, WKPageDrawToPDFFunction callback, void* context);
 WK_EXPORT void WKPageEndPrinting(WKPageRef page);
 
+WK_EXPORT bool WKPageGetIsControlledByAutomation(WKPageRef page);
+WK_EXPORT void WKPageSetControlledByAutomation(WKPageRef page, bool controlled);
+
 WK_EXPORT bool WKPageGetAllowsRemoteInspection(WKPageRef page);
 WK_EXPORT void WKPageSetAllowsRemoteInspection(WKPageRef page, bool allow);
 

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (197563 => 197564)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2016-03-04 16:47:55 UTC (rev 197563)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2016-03-04 16:55:55 UTC (rev 197564)
@@ -1232,6 +1232,17 @@
     return false;
 }
 
+void WebPageProxy::setControlledByAutomation(bool controlled)
+{
+    if (m_controlledByAutomation == controlled)
+        return;
+
+    m_controlledByAutomation = controlled;
+
+    if (isValid())
+        m_process->send(Messages::WebPage::SetControlledByAutomation(controlled), m_pageID);
+}
+
 #if ENABLE(REMOTE_INSPECTOR)
 void WebPageProxy::setAllowsRemoteInspection(bool allow)
 {
@@ -5173,6 +5184,7 @@
         parameters.scrollbarOverlayStyle = Nullopt;
     parameters.backgroundExtendsBeyondPage = m_backgroundExtendsBeyondPage;
     parameters.layerHostingMode = m_layerHostingMode;
+    parameters.controlledByAutomation = m_controlledByAutomation;
 #if ENABLE(REMOTE_INSPECTOR)
     parameters.allowsRemoteInspection = m_allowsRemoteInspection;
     parameters.remoteInspectionNameOverride = m_remoteInspectionNameOverride;

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (197563 => 197564)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2016-03-04 16:47:55 UTC (rev 197563)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2016-03-04 16:55:55 UTC (rev 197564)
@@ -310,6 +310,9 @@
 
     WebInspectorProxy* inspector();
 
+    bool isControlledByAutomation() const { return m_controlledByAutomation; }
+    void setControlledByAutomation(bool);
+
 #if ENABLE(REMOTE_INSPECTOR)
     bool allowsRemoteInspection() const { return m_allowsRemoteInspection; }
     void setAllowsRemoteInspection(bool);
@@ -1679,6 +1682,8 @@
     bool m_isPageSuspended;
     bool m_addsVisitedLinks;
 
+    bool m_controlledByAutomation { false };
+
 #if ENABLE(REMOTE_INSPECTOR)
     bool m_allowsRemoteInspection;
     String m_remoteInspectionNameOverride;

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp (197563 => 197564)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp	2016-03-04 16:47:55 UTC (rev 197563)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp	2016-03-04 16:55:55 UTC (rev 197564)
@@ -568,6 +568,11 @@
     return toImpl(pageRef)->usesEphemeralSession();
 }
 
+bool WKBundlePageIsControlledByAutomation(WKBundlePageRef pageRef)
+{
+    return toImpl(pageRef)->isControlledByAutomation();
+}
+
 #if TARGET_OS_IPHONE
 void WKBundlePageSetUseTestingViewportConfiguration(WKBundlePageRef pageRef, bool useTestingViewportConfiguration)
 {

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h (197563 => 197564)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h	2016-03-04 16:47:55 UTC (rev 197563)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h	2016-03-04 16:55:55 UTC (rev 197564)
@@ -109,6 +109,8 @@
 
 WK_EXPORT bool WKBundlePageIsUsingEphemeralSession(WKBundlePageRef page);
 
+WK_EXPORT bool WKBundlePageIsControlledByAutomation(WKBundlePageRef page);
+
 WK_EXPORT void WKBundlePageStartMonitoringScrollOperations(WKBundlePageRef page);
 
 WK_EXPORT WKStringRef WKBundlePageCopyGroupIdentifier(WKBundlePageRef page);

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (197563 => 197564)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2016-03-04 16:47:55 UTC (rev 197563)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2016-03-04 16:55:55 UTC (rev 197564)
@@ -439,6 +439,8 @@
     WebCore::provideUserMediaTo(m_page.get(), new WebUserMediaClient(*this));
 #endif
 
+    m_page->setControlledByAutomation(parameters.controlledByAutomation);
+
 #if ENABLE(REMOTE_INSPECTOR)
     m_page->setRemoteInspectionAllowed(parameters.allowsRemoteInspection);
     m_page->setRemoteInspectionNameOverride(parameters.remoteInspectionNameOverride);
@@ -2335,6 +2337,16 @@
     m_findController.showFindIndicatorInSelection();
 }
 
+bool WebPage::isControlledByAutomation() const
+{
+    return m_page->isControlledByAutomation();
+}
+
+void WebPage::setControlledByAutomation(bool controlled)
+{
+    m_page->setControlledByAutomation(controlled);
+}
+
 #if ENABLE(REMOTE_INSPECTOR)
 void WebPage::setAllowsRemoteInspection(bool allow)
 {

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (197563 => 197564)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2016-03-04 16:47:55 UTC (rev 197563)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2016-03-04 16:55:55 UTC (rev 197564)
@@ -929,6 +929,9 @@
 
     void didRestoreScrollPosition();
 
+    bool isControlledByAutomation() const;
+    void setControlledByAutomation(bool);
+
 private:
     WebPage(uint64_t pageID, const WebPageCreationParameters&);
 

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (197563 => 197564)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in	2016-03-04 16:47:55 UTC (rev 197563)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in	2016-03-04 16:55:55 UTC (rev 197564)
@@ -94,6 +94,8 @@
     SetAllowsMediaDocumentInlinePlayback(bool allows)
 #endif
 
+    SetControlledByAutomation(bool controlled)
+
 #if ENABLE(REMOTE_INSPECTOR)
     SetAllowsRemoteInspection(bool allow)
     SetRemoteInspectionNameOverride(String name)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to