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 14 matching lines...) Expand all Loading... | |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "bindings/core/v8/WindowProxy.h" | 32 #include "bindings/core/v8/WindowProxy.h" |
| 33 | 33 |
| 34 #include "bindings/core/v8/DOMWrapperWorld.h" | 34 #include "bindings/core/v8/DOMWrapperWorld.h" |
| 35 #include "bindings/core/v8/MainThreadDebugger.h" | |
| 35 #include "bindings/core/v8/ScriptController.h" | 36 #include "bindings/core/v8/ScriptController.h" |
| 36 #include "bindings/core/v8/V8Binding.h" | 37 #include "bindings/core/v8/V8Binding.h" |
| 37 #include "bindings/core/v8/V8DOMActivityLogger.h" | 38 #include "bindings/core/v8/V8DOMActivityLogger.h" |
| 38 #include "bindings/core/v8/V8Document.h" | 39 #include "bindings/core/v8/V8Document.h" |
| 39 #include "bindings/core/v8/V8GCForContextDispose.h" | 40 #include "bindings/core/v8/V8GCForContextDispose.h" |
| 40 #include "bindings/core/v8/V8HTMLCollection.h" | 41 #include "bindings/core/v8/V8HTMLCollection.h" |
| 41 #include "bindings/core/v8/V8HTMLDocument.h" | 42 #include "bindings/core/v8/V8HTMLDocument.h" |
| 42 #include "bindings/core/v8/V8HiddenValue.h" | 43 #include "bindings/core/v8/V8HiddenValue.h" |
| 43 #include "bindings/core/v8/V8Initializer.h" | 44 #include "bindings/core/v8/V8Initializer.h" |
| 44 #include "bindings/core/v8/V8ObjectConstructor.h" | 45 #include "bindings/core/v8/V8ObjectConstructor.h" |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 247 ContentSecurityPolicy* csp = m_frame->securityContext()->contentSecurity Policy(); | 248 ContentSecurityPolicy* csp = m_frame->securityContext()->contentSecurity Policy(); |
| 248 context->AllowCodeGenerationFromStrings(csp->allowEval(0, ContentSecurit yPolicy::SuppressReport)); | 249 context->AllowCodeGenerationFromStrings(csp->allowEval(0, ContentSecurit yPolicy::SuppressReport)); |
| 249 context->SetErrorMessageForCodeGenerationFromStrings(v8String(m_isolate, csp->evalDisabledErrorMessage())); | 250 context->SetErrorMessageForCodeGenerationFromStrings(v8String(m_isolate, csp->evalDisabledErrorMessage())); |
| 250 } else { | 251 } else { |
| 251 updateActivityLogger(); | 252 updateActivityLogger(); |
| 252 origin = m_world->isolatedWorldSecurityOrigin(); | 253 origin = m_world->isolatedWorldSecurityOrigin(); |
| 253 setSecurityToken(origin); | 254 setSecurityToken(origin); |
| 254 } | 255 } |
| 255 if (m_frame->isLocalFrame()) { | 256 if (m_frame->isLocalFrame()) { |
| 256 LocalFrame* frame = toLocalFrame(m_frame); | 257 LocalFrame* frame = toLocalFrame(m_frame); |
| 258 MainThreadDebugger::setContextDebugData(context, m_world->worldId() == M ainWorldId ? "page" : "injected", frame); | |
|
pfeldman
2015/07/06 12:35:50
Why do we have 3 instrumentation callbacks in a ro
| |
| 257 InspectorInstrumentation::didCreateScriptContext(frame, m_scriptState.ge t(), origin, m_world->worldId()); | 259 InspectorInstrumentation::didCreateScriptContext(frame, m_scriptState.ge t(), origin, m_world->worldId()); |
| 258 frame->loader().client()->didCreateScriptContext(context, m_world->exten sionGroup(), m_world->worldId()); | 260 frame->loader().client()->didCreateScriptContext(context, m_world->exten sionGroup(), m_world->worldId()); |
| 259 } | 261 } |
| 260 return true; | 262 return true; |
| 261 } | 263 } |
| 262 | 264 |
| 263 void WindowProxy::createContext() | 265 void WindowProxy::createContext() |
| 264 { | 266 { |
| 265 // FIXME: This should be a null check of m_frame->client(), but there are st ill some edge cases | 267 // FIXME: This should be a null check of m_frame->client(), but there are st ill some edge cases |
| 266 // that this fails to catch during frame detach. | 268 // that this fails to catch during frame detach. |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 516 | 518 |
| 517 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) | 519 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) |
| 518 { | 520 { |
| 519 ASSERT(m_world->isMainWorld()); | 521 ASSERT(m_world->isMainWorld()); |
| 520 if (!isContextInitialized()) | 522 if (!isContextInitialized()) |
| 521 return; | 523 return; |
| 522 setSecurityToken(origin); | 524 setSecurityToken(origin); |
| 523 } | 525 } |
| 524 | 526 |
| 525 } // namespace blink | 527 } // namespace blink |
| OLD | NEW |