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

Unified Diff: Source/bindings/core/v8/WindowProxy.cpp

Issue 686763002: Fix Runtime.executionContextCreated for crafted iframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years 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: Source/bindings/core/v8/WindowProxy.cpp
diff --git a/Source/bindings/core/v8/WindowProxy.cpp b/Source/bindings/core/v8/WindowProxy.cpp
index c2e32fd5b1d990db5bcf5182d29f89e3cf75ba64..6823cabc8cd0f97203398f8bc41fc91825c5433d 100644
--- a/Source/bindings/core/v8/WindowProxy.cpp
+++ b/Source/bindings/core/v8/WindowProxy.cpp
@@ -106,6 +106,7 @@ void WindowProxy::disposeContext(GlobalDetachmentBehavior behavior)
v8::HandleScope handleScope(m_isolate);
v8::Handle<v8::Context> context = m_scriptState->context();
m_frame->loader().client()->willReleaseScriptContext(context, m_world->worldId());
+ InspectorInstrumentation::willReleaseScriptContext(m_frame, m_scriptState.get());
if (behavior == DetachGlobal)
m_scriptState->detachGlobalObject();
@@ -222,20 +223,22 @@ bool WindowProxy::initialize()
return false;
}
+ SecurityOrigin* origin = 0;
if (m_world->isMainWorld()) {
ASSERT(m_frame->document());
// ActivityLogger for main world is updated within updateDocument().
updateDocument();
+ origin = m_frame->securityContext()->securityOrigin();
ContentSecurityPolicy* csp = m_frame->document()->contentSecurityPolicy();
context->AllowCodeGenerationFromStrings(csp->allowEval(0, ContentSecurityPolicy::SuppressReport));
context->SetErrorMessageForCodeGenerationFromStrings(v8String(m_isolate, csp->evalDisabledErrorMessage()));
} else {
updateActivityLogger();
- SecurityOrigin* origin = m_world->isolatedWorldSecurityOrigin();
+ origin = m_world->isolatedWorldSecurityOrigin();
setSecurityToken(origin);
- InspectorInstrumentation::didCreateIsolatedContext(m_frame, m_scriptState.get(), origin);
}
+ InspectorInstrumentation::didCreateScriptContext(m_frame, m_scriptState.get(), origin, m_world->isMainWorld());
m_frame->loader().client()->didCreateScriptContext(context, m_world->extensionGroup(), m_world->worldId());
return true;
}

Powered by Google App Engine
This is Rietveld 408576698