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

Side by Side Diff: third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp

Issue 2780093003: V8 bindings gen: Error if OriginTrialEnabled and SecureContext together. (Closed)
Patch Set: NavigationPreloadManager: Avoid hitting the error. Created 3 years, 8 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "bindings/modules/v8/ConditionalFeaturesForModules.h" 5 #include "bindings/modules/v8/ConditionalFeaturesForModules.h"
6 6
7 #include "bindings/core/v8/ConditionalFeatures.h" 7 #include "bindings/core/v8/ConditionalFeatures.h"
8 #include "bindings/core/v8/ConditionalFeaturesForCore.h" 8 #include "bindings/core/v8/ConditionalFeaturesForCore.h"
9 #include "bindings/core/v8/ScriptState.h" 9 #include "bindings/core/v8/ScriptState.h"
10 #include "bindings/core/v8/V8DedicatedWorkerGlobalScope.h" 10 #include "bindings/core/v8/V8DedicatedWorkerGlobalScope.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 if (!executionContext) 50 if (!executionContext)
51 return; 51 return;
52 v8::Isolate* isolate = scriptState->isolate(); 52 v8::Isolate* isolate = scriptState->isolate();
53 const DOMWrapperWorld& world = scriptState->world(); 53 const DOMWrapperWorld& world = scriptState->world();
54 if (wrapperTypeInfo == &V8Navigator::wrapperTypeInfo) { 54 if (wrapperTypeInfo == &V8Navigator::wrapperTypeInfo) {
55 if (OriginTrials::webShareEnabled(executionContext)) { 55 if (OriginTrials::webShareEnabled(executionContext)) {
56 V8NavigatorPartial::installWebShare(isolate, world, 56 V8NavigatorPartial::installWebShare(isolate, world,
57 v8::Local<v8::Object>(), 57 v8::Local<v8::Object>(),
58 prototypeObject, interfaceObject); 58 prototypeObject, interfaceObject);
59 } 59 }
60 // Mimics the [SecureContext] extended attribute. 60 // Mimics the [SecureContext] extended attribute. Work-around for
61 // https://crbug.com/695123.
61 if (OriginTrials::webUSBEnabled(executionContext) && 62 if (OriginTrials::webUSBEnabled(executionContext) &&
62 executionContext->isSecureContext()) { 63 executionContext->isSecureContext()) {
63 V8NavigatorPartial::installWebUSB(isolate, world, v8::Local<v8::Object>(), 64 V8NavigatorPartial::installWebUSB(isolate, world, v8::Local<v8::Object>(),
64 prototypeObject, interfaceObject); 65 prototypeObject, interfaceObject);
65 } 66 }
66 if (OriginTrials::webVREnabled(executionContext)) { 67 if (OriginTrials::webVREnabled(executionContext)) {
67 V8NavigatorPartial::installWebVR(isolate, world, v8::Local<v8::Object>(), 68 V8NavigatorPartial::installWebVR(isolate, world, v8::Local<v8::Object>(),
68 prototypeObject, interfaceObject); 69 prototypeObject, interfaceObject);
69 } 70 }
70 } else if (wrapperTypeInfo == &V8Window::wrapperTypeInfo) { 71 } else if (wrapperTypeInfo == &V8Window::wrapperTypeInfo) {
71 v8::Local<v8::Object> instanceObject = scriptState->context()->Global(); 72 v8::Local<v8::Object> instanceObject = scriptState->context()->Global();
72 if (OriginTrials::imageCaptureEnabled(executionContext)) { 73 if (OriginTrials::imageCaptureEnabled(executionContext)) {
73 V8WindowPartial::installImageCapture(isolate, world, instanceObject, 74 V8WindowPartial::installImageCapture(isolate, world, instanceObject,
74 prototypeObject, interfaceObject); 75 prototypeObject, interfaceObject);
75 } 76 }
76 // Mimics the [SecureContext] extended attribute. 77 // Mimics the [SecureContext] extended attribute. Work-around for
78 // https://crbug.com/695123.
77 if (OriginTrials::webUSBEnabled(executionContext) && 79 if (OriginTrials::webUSBEnabled(executionContext) &&
78 executionContext->isSecureContext()) { 80 executionContext->isSecureContext()) {
79 V8WindowPartial::installWebUSB(isolate, world, instanceObject, 81 V8WindowPartial::installWebUSB(isolate, world, instanceObject,
80 prototypeObject, interfaceObject); 82 prototypeObject, interfaceObject);
81 } 83 }
82 if (OriginTrials::webVREnabled(executionContext)) { 84 if (OriginTrials::webVREnabled(executionContext)) {
83 V8WindowPartial::installWebVR(isolate, world, instanceObject, 85 V8WindowPartial::installWebVR(isolate, world, instanceObject,
84 prototypeObject, interfaceObject); 86 prototypeObject, interfaceObject);
85 } 87 }
86 if (OriginTrials::gamepadExtensionsEnabled(executionContext)) { 88 if (OriginTrials::gamepadExtensionsEnabled(executionContext)) {
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 registerInstallConditionalFeaturesForCore(); 259 registerInstallConditionalFeaturesForCore();
258 s_originalInstallConditionalFeaturesFunction = 260 s_originalInstallConditionalFeaturesFunction =
259 setInstallConditionalFeaturesFunction( 261 setInstallConditionalFeaturesFunction(
260 &installConditionalFeaturesForModules); 262 &installConditionalFeaturesForModules);
261 s_originalInstallPendingConditionalFeatureFunction = 263 s_originalInstallPendingConditionalFeatureFunction =
262 setInstallPendingConditionalFeatureFunction( 264 setInstallPendingConditionalFeatureFunction(
263 &installPendingConditionalFeatureForModules); 265 &installPendingConditionalFeatureForModules);
264 } 266 }
265 267
266 } // namespace blink 268 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698