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

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

Issue 2005433002: [Origin Trials] Install origin trial bindings on V8 context conditionally (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@track-ef-install
Patch Set: Rebase; Respect runtime-enabled flags as well Created 4 years, 6 months 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 } else { 263 } else {
263 updateActivityLogger(); 264 updateActivityLogger();
264 origin = m_world->isolatedWorldSecurityOrigin(); 265 origin = m_world->isolatedWorldSecurityOrigin();
265 setSecurityToken(origin); 266 setSecurityToken(origin);
266 } 267 }
267 if (m_frame->isLocalFrame()) { 268 if (m_frame->isLocalFrame()) {
268 LocalFrame* frame = toLocalFrame(m_frame); 269 LocalFrame* frame = toLocalFrame(m_frame);
269 MainThreadDebugger::instance()->contextCreated(m_scriptState.get(), fram e, origin); 270 MainThreadDebugger::instance()->contextCreated(m_scriptState.get(), fram e, origin);
270 frame->loader().client()->didCreateScriptContext(context, m_world->exten sionGroup(), m_world->worldId()); 271 frame->loader().client()->didCreateScriptContext(context, m_world->exten sionGroup(), m_world->worldId());
271 } 272 }
273 // If Origin Trials have been registered before the V8 context was ready,
274 // then inject them into the context now
275 ExecutionContext* executionContext = m_scriptState->getExecutionContext();
276 if (executionContext) {
277 OriginTrialContext* originTrialContext = OriginTrialContext::from(execut ionContext);
278 if (originTrialContext)
279 originTrialContext->initializePendingTrials();
280 }
272 return true; 281 return true;
273 } 282 }
274 283
275 void WindowProxy::createContext() 284 void WindowProxy::createContext()
276 { 285 {
277 // FIXME: This should be a null check of m_frame->client(), but there are st ill some edge cases 286 // FIXME: This should be a null check of m_frame->client(), but there are st ill some edge cases
278 // that this fails to catch during frame detach. 287 // that this fails to catch during frame detach.
279 if (m_frame->isLocalFrame() && !toLocalFrame(m_frame)->loader().documentLoad er()) 288 if (m_frame->isLocalFrame() && !toLocalFrame(m_frame)->loader().documentLoad er())
280 return; 289 return;
281 290
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 } 488 }
480 489
481 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) 490 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin)
482 { 491 {
483 if (!isContextInitialized()) 492 if (!isContextInitialized())
484 return; 493 return;
485 setSecurityToken(origin); 494 setSecurityToken(origin);
486 } 495 }
487 496
488 } // namespace blink 497 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698