OLD | NEW |
---|---|
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 Loading... | |
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 setSecurityToken(m_frame->document()->securityOrigin()); | 229 SecurityOrigin* origin = m_frame->document()->securityOrigin(); |
230 setSecurityToken(origin); | |
231 InspectorInstrumentation::didCreateMainWorldContext(m_frame, m_scrip tState.get(), origin); | |
aandrey
2014/11/04 11:21:07
ASSERT(origin);
eustas
2014/11/05 21:28:34
Done.
| |
230 ContentSecurityPolicy* csp = m_frame->document()->contentSecurityPol icy(); | 232 ContentSecurityPolicy* csp = m_frame->document()->contentSecurityPol icy(); |
231 context->AllowCodeGenerationFromStrings(csp->allowEval(0, ContentSec urityPolicy::SuppressReport)); | 233 context->AllowCodeGenerationFromStrings(csp->allowEval(0, ContentSec urityPolicy::SuppressReport)); |
232 context->SetErrorMessageForCodeGenerationFromStrings(v8String(m_isol ate, csp->evalDisabledErrorMessage())); | 234 context->SetErrorMessageForCodeGenerationFromStrings(v8String(m_isol ate, csp->evalDisabledErrorMessage())); |
233 } | 235 } |
234 } else { | 236 } else { |
235 updateActivityLogger(); | 237 updateActivityLogger(); |
236 SecurityOrigin* origin = m_world->isolatedWorldSecurityOrigin(); | 238 SecurityOrigin* origin = m_world->isolatedWorldSecurityOrigin(); |
237 setSecurityToken(origin); | 239 setSecurityToken(origin); |
238 if (origin && InspectorInstrumentation::hasFrontends()) { | 240 if (origin) |
239 InspectorInstrumentation::didCreateIsolatedContext(m_frame, m_script State.get(), origin); | 241 InspectorInstrumentation::didCreateIsolatedContext(m_frame, m_script State.get(), origin); |
240 } | |
241 } | 242 } |
242 m_frame->loader().client()->didCreateScriptContext(context, m_world->extensi onGroup(), m_world->worldId()); | 243 m_frame->loader().client()->didCreateScriptContext(context, m_world->extensi onGroup(), m_world->worldId()); |
243 return true; | 244 return true; |
244 } | 245 } |
245 | 246 |
246 void WindowProxy::createContext() | 247 void WindowProxy::createContext() |
247 { | 248 { |
248 // The documentLoader pointer could be 0 during frame shutdown. | 249 // The documentLoader pointer could be 0 during frame shutdown. |
249 // FIXME: Can we remove this check? | 250 // FIXME: Can we remove this check? |
250 if (!m_frame->loader().documentLoader()) | 251 if (!m_frame->loader().documentLoader()) |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
488 | 489 |
489 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) | 490 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) |
490 { | 491 { |
491 ASSERT(m_world->isMainWorld()); | 492 ASSERT(m_world->isMainWorld()); |
492 if (!isContextInitialized()) | 493 if (!isContextInitialized()) |
493 return; | 494 return; |
494 setSecurityToken(origin); | 495 setSecurityToken(origin); |
495 } | 496 } |
496 | 497 |
497 } // namespace blink | 498 } // namespace blink |
OLD | NEW |