Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Unified Diff: third_party/WebKit/Source/core/inspector/PageRuntimeAgent.cpp

Issue 1873533002: [DevTools] Force context creation when runtime is enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more tests Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/inspector/PageRuntimeAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/PageRuntimeAgent.cpp b/third_party/WebKit/Source/core/inspector/PageRuntimeAgent.cpp
index b10b2e612a8d512448c4efcbca060381cf5c2816..ca54c5c391c9a474c4a52e0dc339f1898a2d63dc 100644
--- a/third_party/WebKit/Source/core/inspector/PageRuntimeAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/PageRuntimeAgent.cpp
@@ -65,6 +65,9 @@ void PageRuntimeAgent::enable(ErrorString* errorString)
if (m_enabled)
return;
+ m_instrumentingAgents->setPageRuntimeAgent(this);
+ if (m_inspectedFrames->root()->loader().stateMachine()->committedFirstRealDocumentLoad())
+ m_inspectedFrames->root()->script().initializeMainWorld();
InspectorRuntimeAgent::enable(errorString);
}
@@ -73,6 +76,12 @@ void PageRuntimeAgent::disable(ErrorString* errorString)
if (!m_enabled)
return;
InspectorRuntimeAgent::disable(errorString);
+ m_instrumentingAgents->setPageRuntimeAgent(nullptr);
+}
+
+void PageRuntimeAgent::didClearDocumentOfWindowObject(LocalFrame* frame)
+{
+ frame->script().initializeMainWorld();
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698