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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 #include "core/frame/LocalFrame.h" | 46 #include "core/frame/LocalFrame.h" |
47 #include "core/frame/csp/ContentSecurityPolicy.h" | 47 #include "core/frame/csp/ContentSecurityPolicy.h" |
48 #include "core/html/DocumentNameCollection.h" | 48 #include "core/html/DocumentNameCollection.h" |
49 #include "core/html/HTMLCollection.h" | 49 #include "core/html/HTMLCollection.h" |
50 #include "core/html/HTMLIFrameElement.h" | 50 #include "core/html/HTMLIFrameElement.h" |
51 #include "core/inspector/InspectorInstrumentation.h" | 51 #include "core/inspector/InspectorInstrumentation.h" |
52 #include "core/inspector/MainThreadDebugger.h" | 52 #include "core/inspector/MainThreadDebugger.h" |
53 #include "core/loader/DocumentLoader.h" | 53 #include "core/loader/DocumentLoader.h" |
54 #include "core/loader/FrameLoader.h" | 54 #include "core/loader/FrameLoader.h" |
55 #include "core/loader/FrameLoaderClient.h" | 55 #include "core/loader/FrameLoaderClient.h" |
| 56 #include "core/origin_trials/OriginTrialContext.h" |
56 #include "platform/Histogram.h" | 57 #include "platform/Histogram.h" |
57 #include "platform/RuntimeEnabledFeatures.h" | 58 #include "platform/RuntimeEnabledFeatures.h" |
58 #include "platform/ScriptForbiddenScope.h" | 59 #include "platform/ScriptForbiddenScope.h" |
59 #include "platform/TraceEvent.h" | 60 #include "platform/TraceEvent.h" |
60 #include "platform/heap/Handle.h" | 61 #include "platform/heap/Handle.h" |
61 #include "platform/weborigin/SecurityOrigin.h" | 62 #include "platform/weborigin/SecurityOrigin.h" |
62 #include "public/platform/Platform.h" | 63 #include "public/platform/Platform.h" |
63 #include "wtf/Assertions.h" | 64 #include "wtf/Assertions.h" |
64 #include "wtf/OwnPtr.h" | 65 #include "wtf/OwnPtr.h" |
65 #include "wtf/StringExtras.h" | 66 #include "wtf/StringExtras.h" |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 } else { | 264 } else { |
264 updateActivityLogger(); | 265 updateActivityLogger(); |
265 origin = m_world->isolatedWorldSecurityOrigin(); | 266 origin = m_world->isolatedWorldSecurityOrigin(); |
266 setSecurityToken(origin); | 267 setSecurityToken(origin); |
267 } | 268 } |
268 if (m_frame->isLocalFrame()) { | 269 if (m_frame->isLocalFrame()) { |
269 LocalFrame* frame = toLocalFrame(m_frame); | 270 LocalFrame* frame = toLocalFrame(m_frame); |
270 MainThreadDebugger::instance()->contextCreated(m_scriptState.get(), fram
e, origin); | 271 MainThreadDebugger::instance()->contextCreated(m_scriptState.get(), fram
e, origin); |
271 frame->loader().client()->didCreateScriptContext(context, m_world->exten
sionGroup(), m_world->worldId()); | 272 frame->loader().client()->didCreateScriptContext(context, m_world->exten
sionGroup(), m_world->worldId()); |
272 } | 273 } |
| 274 // If Origin Trials have been registered before the V8 context was ready, |
| 275 // then inject them into the context now |
| 276 ExecutionContext* executionContext = m_scriptState->getExecutionContext(); |
| 277 if (executionContext) { |
| 278 OriginTrialContext* originTrialContext = OriginTrialContext::from(execut
ionContext); |
| 279 if (originTrialContext) |
| 280 originTrialContext->initializePendingTrials(); |
| 281 } |
273 return true; | 282 return true; |
274 } | 283 } |
275 | 284 |
276 void WindowProxy::createContext() | 285 void WindowProxy::createContext() |
277 { | 286 { |
278 // FIXME: This should be a null check of m_frame->client(), but there are st
ill some edge cases | 287 // FIXME: This should be a null check of m_frame->client(), but there are st
ill some edge cases |
279 // that this fails to catch during frame detach. | 288 // that this fails to catch during frame detach. |
280 if (m_frame->isLocalFrame() && !toLocalFrame(m_frame)->loader().documentLoad
er()) | 289 if (m_frame->isLocalFrame() && !toLocalFrame(m_frame)->loader().documentLoad
er()) |
281 return; | 290 return; |
282 | 291 |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 } | 562 } |
554 | 563 |
555 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) | 564 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) |
556 { | 565 { |
557 if (!isContextInitialized()) | 566 if (!isContextInitialized()) |
558 return; | 567 return; |
559 setSecurityToken(origin); | 568 setSecurityToken(origin); |
560 } | 569 } |
561 | 570 |
562 } // namespace blink | 571 } // namespace blink |
OLD | NEW |