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

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

Issue 2254533002: [FeaturePolicy] Initial implementation of Feature Policy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fp-flag
Patch Set: Remove overaggressive bool transform Created 4 years, 3 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 12 matching lines...) Expand all
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
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 "bindings/core/v8/WindowProxy.h" 31 #include "bindings/core/v8/WindowProxy.h"
32 32
33 #include "bindings/core/v8/ConditionalFeatures.h"
33 #include "bindings/core/v8/DOMWrapperWorld.h" 34 #include "bindings/core/v8/DOMWrapperWorld.h"
34 #include "bindings/core/v8/ScriptController.h" 35 #include "bindings/core/v8/ScriptController.h"
35 #include "bindings/core/v8/V8Binding.h" 36 #include "bindings/core/v8/V8Binding.h"
36 #include "bindings/core/v8/V8DOMActivityLogger.h" 37 #include "bindings/core/v8/V8DOMActivityLogger.h"
37 #include "bindings/core/v8/V8Document.h" 38 #include "bindings/core/v8/V8Document.h"
38 #include "bindings/core/v8/V8GCForContextDispose.h" 39 #include "bindings/core/v8/V8GCForContextDispose.h"
39 #include "bindings/core/v8/V8HTMLCollection.h" 40 #include "bindings/core/v8/V8HTMLCollection.h"
40 #include "bindings/core/v8/V8HTMLDocument.h" 41 #include "bindings/core/v8/V8HTMLDocument.h"
41 #include "bindings/core/v8/V8HiddenValue.h" 42 #include "bindings/core/v8/V8HiddenValue.h"
42 #include "bindings/core/v8/V8Initializer.h" 43 #include "bindings/core/v8/V8Initializer.h"
43 #include "bindings/core/v8/V8ObjectConstructor.h" 44 #include "bindings/core/v8/V8ObjectConstructor.h"
44 #include "bindings/core/v8/V8PagePopupControllerBinding.h" 45 #include "bindings/core/v8/V8PagePopupControllerBinding.h"
45 #include "bindings/core/v8/V8Window.h" 46 #include "bindings/core/v8/V8Window.h"
46 #include "core/frame/LocalFrame.h" 47 #include "core/frame/LocalFrame.h"
47 #include "core/frame/csp/ContentSecurityPolicy.h" 48 #include "core/frame/csp/ContentSecurityPolicy.h"
48 #include "core/html/DocumentNameCollection.h" 49 #include "core/html/DocumentNameCollection.h"
49 #include "core/html/HTMLCollection.h" 50 #include "core/html/HTMLCollection.h"
50 #include "core/html/HTMLIFrameElement.h" 51 #include "core/html/HTMLIFrameElement.h"
51 #include "core/inspector/InspectorInstrumentation.h" 52 #include "core/inspector/InspectorInstrumentation.h"
52 #include "core/inspector/MainThreadDebugger.h" 53 #include "core/inspector/MainThreadDebugger.h"
53 #include "core/loader/DocumentLoader.h" 54 #include "core/loader/DocumentLoader.h"
54 #include "core/loader/FrameLoader.h" 55 #include "core/loader/FrameLoader.h"
55 #include "core/loader/FrameLoaderClient.h" 56 #include "core/loader/FrameLoaderClient.h"
56 #include "core/origin_trials/OriginTrialContext.h" 57 #include "core/origin_trials/OriginTrialContext.h"
57 #include "platform/Histogram.h" 58 #include "platform/Histogram.h"
58 #include "platform/RuntimeEnabledFeatures.h" 59 #include "platform/RuntimeEnabledFeatures.h"
59 #include "platform/ScriptForbiddenScope.h" 60 #include "platform/ScriptForbiddenScope.h"
60 #include "platform/TraceEvent.h" 61 #include "platform/TraceEvent.h"
62 #include "platform/feature_policy/FeaturePolicy.h"
61 #include "platform/heap/Handle.h" 63 #include "platform/heap/Handle.h"
62 #include "platform/weborigin/SecurityOrigin.h" 64 #include "platform/weborigin/SecurityOrigin.h"
63 #include "public/platform/Platform.h" 65 #include "public/platform/Platform.h"
64 #include "wtf/Assertions.h" 66 #include "wtf/Assertions.h"
65 #include "wtf/StringExtras.h" 67 #include "wtf/StringExtras.h"
66 #include "wtf/text/CString.h" 68 #include "wtf/text/CString.h"
67 #include <algorithm> 69 #include <algorithm>
68 #include <utility> 70 #include <utility>
69 #include <v8-debug.h> 71 #include <v8-debug.h>
70 #include <v8.h> 72 #include <v8.h>
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 if (m_frame->isLocalFrame()) { 270 if (m_frame->isLocalFrame()) {
269 LocalFrame* frame = toLocalFrame(m_frame); 271 LocalFrame* frame = toLocalFrame(m_frame);
270 MainThreadDebugger::instance()->contextCreated(m_scriptState.get(), fram e, origin); 272 MainThreadDebugger::instance()->contextCreated(m_scriptState.get(), fram e, origin);
271 frame->loader().client()->didCreateScriptContext(context, m_world->exten sionGroup(), m_world->worldId()); 273 frame->loader().client()->didCreateScriptContext(context, m_world->exten sionGroup(), m_world->worldId());
272 } 274 }
273 // If Origin Trials have been registered before the V8 context was ready, 275 // If Origin Trials have been registered before the V8 context was ready,
274 // then inject them into the context now 276 // then inject them into the context now
275 if (m_world->isMainWorld()) { 277 if (m_world->isMainWorld()) {
276 ExecutionContext* executionContext = m_scriptState->getExecutionContext( ); 278 ExecutionContext* executionContext = m_scriptState->getExecutionContext( );
277 if (executionContext) { 279 if (executionContext) {
280 initializeConditionalFeatures(executionContext);
278 OriginTrialContext* originTrialContext = OriginTrialContext::from(ex ecutionContext); 281 OriginTrialContext* originTrialContext = OriginTrialContext::from(ex ecutionContext);
279 if (originTrialContext) 282 if (originTrialContext)
280 originTrialContext->initializePendingFeatures(); 283 originTrialContext->initializePendingFeatures();
281 } 284 }
282 } 285 }
283 return true; 286 return true;
284 } 287 }
285 288
286 void WindowProxy::createContext() 289 void WindowProxy::createContext()
287 { 290 {
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 } 556 }
554 557
555 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) 558 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin)
556 { 559 {
557 if (!isContextInitialized()) 560 if (!isContextInitialized())
558 return; 561 return;
559 setSecurityToken(origin); 562 setSecurityToken(origin);
560 } 563 }
561 564
562 } // namespace blink 565 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698