Web Inspector: Remove unused parameter of Page.reload
authorjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Sep 2017 17:57:08 +0000 (17:57 +0000)
committerjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Sep 2017 17:57:08 +0000 (17:57 +0000)
https://bugs.webkit.org/show_bug.cgi?id=177522

Reviewed by Matt Baker.

Source/JavaScriptCore:

* inspector/protocol/Page.json:

Source/WebCore:

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didClearWindowObjectInWorldImpl):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::reload):
(WebCore::InspectorPageAgent::frameNavigated):
(WebCore::InspectorPageAgent::didClearWindowObjectInWorld): Deleted.
* inspector/InspectorPageAgent.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222560 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/protocol/Page.json
Source/WebCore/ChangeLog
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/InspectorPageAgent.cpp
Source/WebCore/inspector/InspectorPageAgent.h

index 7ecb640..c14cad8 100644 (file)
@@ -1,3 +1,12 @@
+2017-09-26  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Remove unused parameter of Page.reload
+        https://bugs.webkit.org/show_bug.cgi?id=177522
+
+        Reviewed by Matt Baker.
+
+        * inspector/protocol/Page.json:
+
 2017-09-26  Filip Pizlo  <fpizlo@apple.com>
 
         Put g_gigacageBasePtr into its own page and make it read-only
index c30e712..2ba7414 100644 (file)
@@ -99,8 +99,7 @@
             "description": "Reloads the main frame of the inspected page.",
             "parameters": [
                 { "name": "ignoreCache", "type": "boolean", "optional": true, "description": "If true, the page is reloaded from its origin without using cached resources." },
-                { "name": "revalidateAllResources", "type": "boolean", "optional": true, "description": "If true, all cached subresources will be revalidated when the main resource loads. Otherwise, only expired cached subresources will be revalidated (the default behavior for most WebKit clients)." },
-                { "name": "scriptToEvaluateOnLoad", "type": "string", "optional": true, "description": "If set, the script will be injected into all frames of the inspected page after reload." }
+                { "name": "revalidateAllResources", "type": "boolean", "optional": true, "description": "If true, all cached subresources will be revalidated when the main resource loads. Otherwise, only expired cached subresources will be revalidated (the default behavior for most WebKit clients)." }
             ]
         },
         {
index 6f4d2ab..afd19a8 100644 (file)
@@ -1,3 +1,18 @@
+2017-09-26  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Remove unused parameter of Page.reload
+        https://bugs.webkit.org/show_bug.cgi?id=177522
+
+        Reviewed by Matt Baker.
+
+        * inspector/InspectorInstrumentation.cpp:
+        (WebCore::InspectorInstrumentation::didClearWindowObjectInWorldImpl):
+        * inspector/InspectorPageAgent.cpp:
+        (WebCore::InspectorPageAgent::reload):
+        (WebCore::InspectorPageAgent::frameNavigated):
+        (WebCore::InspectorPageAgent::didClearWindowObjectInWorld): Deleted.
+        * inspector/InspectorPageAgent.h:
+
 2017-09-27  Chris Dumez  <cdumez@apple.com>
 
         cssFloat missing in CSSPropertyDeclaration.prototype
index e90c48f..f437c03 100644 (file)
@@ -118,8 +118,6 @@ static Frame* frameForScriptExecutionContext(ScriptExecutionContext& context)
 void InspectorInstrumentation::didClearWindowObjectInWorldImpl(InstrumentingAgents& instrumentingAgents, Frame& frame, DOMWrapperWorld& world)
 {
     InspectorPageAgent* pageAgent = instrumentingAgents.inspectorPageAgent();
-    if (pageAgent)
-        pageAgent->didClearWindowObjectInWorld(&frame, world);
     if (PageDebuggerAgent* debuggerAgent = instrumentingAgents.pageDebuggerAgent()) {
         if (pageAgent && &world == &mainThreadNormalWorld() && &frame == &pageAgent->mainFrame())
             debuggerAgent->didClearMainFrameWindowObject();
index d8d1380..f46d6bf 100644 (file)
@@ -40,7 +40,6 @@
 #include "CachedScript.h"
 #include "Cookie.h"
 #include "CookieJar.h"
-#include "DOMWrapperWorld.h"
 #include "Document.h"
 #include "DocumentLoader.h"
 #include "Frame.h"
@@ -376,10 +375,8 @@ void InspectorPageAgent::disable(ErrorString&)
     setEmulatedMedia(unused, emptyString());
 }
 
-void InspectorPageAgent::reload(ErrorString&, const bool* const optionalReloadFromOrigin, const bool* const optionalRevalidateAllResources, const String* optionalScriptToEvaluateOnLoad)
+void InspectorPageAgent::reload(ErrorString&, const bool* const optionalReloadFromOrigin, const bool* const optionalRevalidateAllResources)
 {
-    m_pendingScriptToEvaluateOnLoadOnce = optionalScriptToEvaluateOnLoad ? *optionalScriptToEvaluateOnLoad : emptyString();
-
     bool reloadFromOrigin = optionalReloadFromOrigin && *optionalReloadFromOrigin;
     bool revalidateAllResources = optionalRevalidateAllResources && *optionalRevalidateAllResources;
 
@@ -639,15 +636,6 @@ void InspectorPageAgent::setShowPaintRects(ErrorString&, bool show)
     m_overlay->setShowingPaintRects(show);
 }
 
-void InspectorPageAgent::didClearWindowObjectInWorld(Frame* frame, DOMWrapperWorld& world)
-{
-    if (&world != &mainThreadNormalWorld())
-        return;
-
-    if (!m_scriptToEvaluateOnLoadOnce.isEmpty())
-        frame->script().executeScript(m_scriptToEvaluateOnLoadOnce);
-}
-
 void InspectorPageAgent::domContentEventFired()
 {
     m_isFirstLayoutAfterOnLoad = true;
@@ -661,10 +649,6 @@ void InspectorPageAgent::loadEventFired()
 
 void InspectorPageAgent::frameNavigated(Frame& frame)
 {
-    if (frame.isMainFrame()) {
-        m_scriptToEvaluateOnLoadOnce = m_pendingScriptToEvaluateOnLoadOnce;
-        m_pendingScriptToEvaluateOnLoadOnce = String();
-    }
     m_frontendDispatcher->frameNavigated(buildObjectForFrame(&frame));
 }
 
index 9e301db..0c3e56c 100644 (file)
@@ -46,7 +46,6 @@ class InspectorObject;
 namespace WebCore {
 
 class CachedResource;
-class DOMWrapperWorld;
 class DocumentLoader;
 class Frame;
 class InspectorClient;
@@ -92,7 +91,7 @@ public:
     // Page API for InspectorFrontend
     void enable(ErrorString&) override;
     void disable(ErrorString&) override;
-    void reload(ErrorString&, const bool* const optionalReloadFromOrigin, const bool* const optionalRevalidateAllResources, const String* const optionalScriptToEvaluateOnLoad) override;
+    void reload(ErrorString&, const bool* const optionalReloadFromOrigin, const bool* const optionalRevalidateAllResources) override;
     void navigate(ErrorString&, const String& url) override;
     void getCookies(ErrorString&, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Page::Cookie>>& cookies) override;
     void deleteCookie(ErrorString&, const String& cookieName, const String& url) override;
@@ -109,7 +108,6 @@ public:
     void archive(ErrorString&, String* data) override;
 
     // InspectorInstrumentation
-    void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld&);
     void domContentEventFired();
     void loadEventFired();
     void frameNavigated(Frame&);
@@ -156,8 +154,6 @@ private:
     InspectorClient* m_client { nullptr };
     InspectorOverlay* m_overlay { nullptr };
 
-    String m_pendingScriptToEvaluateOnLoadOnce;
-    String m_scriptToEvaluateOnLoadOnce;
     HashMap<Frame*, String> m_frameToIdentifier;
     HashMap<String, Frame*> m_identifierToFrame;
     HashMap<DocumentLoader*, String> m_loaderToIdentifier;