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

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

Issue 686763002: Fix Runtime.executionContextCreated for crafted iframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « Source/core/inspector/PageRuntimeAgent.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/PageRuntimeAgent.cpp
diff --git a/Source/core/inspector/PageRuntimeAgent.cpp b/Source/core/inspector/PageRuntimeAgent.cpp
index 9c1d5a2d6d0912b7907f10a6bb0e2972ec1027e8..e95545f2005a7c817c89be49f9da34da0f2cb943 100644
--- a/Source/core/inspector/PageRuntimeAgent.cpp
+++ b/Source/core/inspector/PageRuntimeAgent.cpp
@@ -105,8 +105,20 @@ void PageRuntimeAgent::didClearDocumentOfWindowObject(LocalFrame* frame)
m_scriptStateToId.clear();
m_frontend->executionContextsCleared();
}
+ if (!frame->script().initializeMainWorld()) {
aandrey 2014/10/29 15:18:50 I don't think we should initialize main world from
eustas 2014/10/30 10:08:04 Actually, we need to initialize main world sooner
+ // Reusing existing context.
+ String frameId = m_pageAgent->frameId(frame);
+ addExecutionContextToFrontend(ScriptState::forMainWorld(frame), true, "", frameId);
+ }
+}
+
+void PageRuntimeAgent::didCreateMainWorldContext(LocalFrame* frame, ScriptState* scriptState, SecurityOrigin* origin)
+{
+ if (!m_enabled)
+ return;
+ ASSERT(m_frontend);
String frameId = m_pageAgent->frameId(frame);
- addExecutionContextToFrontend(ScriptState::forMainWorld(frame), true, "", frameId);
+ addExecutionContextToFrontend(scriptState, true, origin->toRawString(), frameId);
}
void PageRuntimeAgent::didCreateIsolatedContext(LocalFrame* frame, ScriptState* scriptState, SecurityOrigin* origin)
« no previous file with comments | « Source/core/inspector/PageRuntimeAgent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698