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

Side by Side Diff: Source/bindings/core/v8/WindowProxy.cpp

Issue 711853002: Revert of Fix Runtime.executionContextCreated for crafted iframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2009, 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 219
220 if (!installDOMWindow()) { 220 if (!installDOMWindow()) {
221 disposeContext(DoNotDetachGlobal); 221 disposeContext(DoNotDetachGlobal);
222 return false; 222 return false;
223 } 223 }
224 224
225 if (m_world->isMainWorld()) { 225 if (m_world->isMainWorld()) {
226 // ActivityLogger for main world is updated within updateDocument(). 226 // ActivityLogger for main world is updated within updateDocument().
227 updateDocument(); 227 updateDocument();
228 if (m_frame->document()) { 228 if (m_frame->document()) {
229 SecurityOrigin* origin = m_frame->document()->securityOrigin(); 229 setSecurityToken(m_frame->document()->securityOrigin());
230 ASSERT(origin);
231 setSecurityToken(origin);
232 InspectorInstrumentation::didCreateMainWorldContext(m_frame, m_scrip tState.get(), origin);
233 ContentSecurityPolicy* csp = m_frame->document()->contentSecurityPol icy(); 230 ContentSecurityPolicy* csp = m_frame->document()->contentSecurityPol icy();
234 context->AllowCodeGenerationFromStrings(csp->allowEval(0, ContentSec urityPolicy::SuppressReport)); 231 context->AllowCodeGenerationFromStrings(csp->allowEval(0, ContentSec urityPolicy::SuppressReport));
235 context->SetErrorMessageForCodeGenerationFromStrings(v8String(m_isol ate, csp->evalDisabledErrorMessage())); 232 context->SetErrorMessageForCodeGenerationFromStrings(v8String(m_isol ate, csp->evalDisabledErrorMessage()));
236 } 233 }
237 } else { 234 } else {
238 updateActivityLogger(); 235 updateActivityLogger();
239 SecurityOrigin* origin = m_world->isolatedWorldSecurityOrigin(); 236 SecurityOrigin* origin = m_world->isolatedWorldSecurityOrigin();
240 setSecurityToken(origin); 237 setSecurityToken(origin);
241 if (origin) 238 if (origin && InspectorInstrumentation::hasFrontends()) {
242 InspectorInstrumentation::didCreateIsolatedContext(m_frame, m_script State.get(), origin); 239 InspectorInstrumentation::didCreateIsolatedContext(m_frame, m_script State.get(), origin);
240 }
243 } 241 }
244 m_frame->loader().client()->didCreateScriptContext(context, m_world->extensi onGroup(), m_world->worldId()); 242 m_frame->loader().client()->didCreateScriptContext(context, m_world->extensi onGroup(), m_world->worldId());
245 return true; 243 return true;
246 } 244 }
247 245
248 void WindowProxy::createContext() 246 void WindowProxy::createContext()
249 { 247 {
250 // The documentLoader pointer could be 0 during frame shutdown. 248 // The documentLoader pointer could be 0 during frame shutdown.
251 // FIXME: Can we remove this check? 249 // FIXME: Can we remove this check?
252 if (!m_frame->loader().documentLoader()) 250 if (!m_frame->loader().documentLoader())
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 488
491 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) 489 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin)
492 { 490 {
493 ASSERT(m_world->isMainWorld()); 491 ASSERT(m_world->isMainWorld());
494 if (!isContextInitialized()) 492 if (!isContextInitialized())
495 return; 493 return;
496 setSecurityToken(origin); 494 setSecurityToken(origin);
497 } 495 }
498 496
499 } // namespace blink 497 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/ScriptController.cpp ('k') | Source/core/inspector/InspectorInstrumentation.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698