Chromium Code Reviews| 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(); |
|
yurys
2014/10/30 10:23:43
When is SecurityOrigin null?
eustas
2014/10/31 06:59:53
According to setSecurityToken implementation, it c
| |
| 230 setSecurityToken(origin); | |
| 231 if (origin) | |
| 232 InspectorInstrumentation::didCreateMainWorldContext(m_frame, m_s criptState.get(), origin); | |
| 230 ContentSecurityPolicy* csp = m_frame->document()->contentSecurityPol icy(); | 233 ContentSecurityPolicy* csp = m_frame->document()->contentSecurityPol icy(); |
| 231 context->AllowCodeGenerationFromStrings(csp->allowEval(0, ContentSec urityPolicy::SuppressReport)); | 234 context->AllowCodeGenerationFromStrings(csp->allowEval(0, ContentSec urityPolicy::SuppressReport)); |
| 232 context->SetErrorMessageForCodeGenerationFromStrings(v8String(m_isol ate, csp->evalDisabledErrorMessage())); | 235 context->SetErrorMessageForCodeGenerationFromStrings(v8String(m_isol ate, csp->evalDisabledErrorMessage())); |
| 233 } | 236 } |
| 234 } else { | 237 } else { |
| 235 updateActivityLogger(); | 238 updateActivityLogger(); |
| 236 SecurityOrigin* origin = m_world->isolatedWorldSecurityOrigin(); | 239 SecurityOrigin* origin = m_world->isolatedWorldSecurityOrigin(); |
| 237 setSecurityToken(origin); | 240 setSecurityToken(origin); |
| 238 if (origin && InspectorInstrumentation::hasFrontends()) { | 241 if (origin) |
| 239 InspectorInstrumentation::didCreateIsolatedContext(m_frame, m_script State.get(), origin); | 242 InspectorInstrumentation::didCreateIsolatedContext(m_frame, m_script State.get(), origin); |
| 240 } | |
| 241 } | 243 } |
| 242 m_frame->loader().client()->didCreateScriptContext(context, m_world->extensi onGroup(), m_world->worldId()); | 244 m_frame->loader().client()->didCreateScriptContext(context, m_world->extensi onGroup(), m_world->worldId()); |
| 243 return true; | 245 return true; |
| 244 } | 246 } |
| 245 | 247 |
| 246 void WindowProxy::createContext() | 248 void WindowProxy::createContext() |
| 247 { | 249 { |
| 248 // The documentLoader pointer could be 0 during frame shutdown. | 250 // The documentLoader pointer could be 0 during frame shutdown. |
| 249 // FIXME: Can we remove this check? | 251 // FIXME: Can we remove this check? |
| 250 if (!m_frame->loader().documentLoader()) | 252 if (!m_frame->loader().documentLoader()) |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 488 | 490 |
| 489 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) | 491 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) |
| 490 { | 492 { |
| 491 ASSERT(m_world->isMainWorld()); | 493 ASSERT(m_world->isMainWorld()); |
| 492 if (!isContextInitialized()) | 494 if (!isContextInitialized()) |
| 493 return; | 495 return; |
| 494 setSecurityToken(origin); | 496 setSecurityToken(origin); |
| 495 } | 497 } |
| 496 | 498 |
| 497 } // namespace blink | 499 } // namespace blink |
| OLD | NEW |