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

Unified Diff: third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp

Issue 2130883002: [OriginTrials] Allow origin trials to be installed without an instance object. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp
diff --git a/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp b/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp
index 1abbf997527f0240f5894273a1c43a87403cfc13..21e1fee05e464827e758fd03da967ff3d9bf720d 100644
--- a/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp
+++ b/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp
@@ -543,37 +543,29 @@ void installOriginTrialsForModules(ScriptState* scriptState)
ScriptState::Scope scope(scriptState);
v8::Local<v8::Object> global = context->Global();
- v8::Isolate* isolate = scriptState->isolate();
if (!originTrialContext->featureBindingsInstalled("DurableStorage") && (RuntimeEnabledFeatures::durableStorageEnabled() || originTrialContext->isFeatureEnabled("DurableStorage", nullptr))) {
- v8::Local<v8::String> navigatorName = v8::String::NewFromOneByte(isolate, reinterpret_cast<const uint8_t*>("navigator"), v8::NewStringType::kNormal).ToLocalChecked();
if (executionContext->isDocument()) {
- v8::Local<v8::Object> navigator = global->Get(context, navigatorName).ToLocalChecked()->ToObject();
V8WindowPartial::installDurableStorage(scriptState, global);
- V8NavigatorPartial::installDurableStorage(scriptState, navigator);
+ V8NavigatorPartial::installDurableStorage(scriptState);
} else if (executionContext->isSharedWorkerGlobalScope()) {
- v8::Local<v8::Object> navigator = global->Get(context, navigatorName).ToLocalChecked()->ToObject();
V8SharedWorkerGlobalScopePartial::installDurableStorage(scriptState, global);
- V8WorkerNavigatorPartial::installDurableStorage(scriptState, navigator);
+ V8WorkerNavigatorPartial::installDurableStorage(scriptState);
} else if (executionContext->isDedicatedWorkerGlobalScope()) {
- v8::Local<v8::Object> navigator = global->Get(context, navigatorName).ToLocalChecked()->ToObject();
V8DedicatedWorkerGlobalScopePartial::installDurableStorage(scriptState, global);
- V8WorkerNavigatorPartial::installDurableStorage(scriptState, navigator);
+ V8WorkerNavigatorPartial::installDurableStorage(scriptState);
} else if (executionContext->isServiceWorkerGlobalScope()) {
- v8::Local<v8::Object> navigator = global->Get(context, navigatorName).ToLocalChecked()->ToObject();
V8ServiceWorkerGlobalScope::installDurableStorage(scriptState, global);
- V8WorkerNavigatorPartial::installDurableStorage(scriptState, navigator);
+ V8WorkerNavigatorPartial::installDurableStorage(scriptState);
}
}
if (!originTrialContext->featureBindingsInstalled("WebBluetooth") && (RuntimeEnabledFeatures::webBluetoothEnabled() || originTrialContext->isFeatureEnabled("WebBluetooth", nullptr))) {
- v8::Local<v8::String> navigatorName = v8::String::NewFromOneByte(isolate, reinterpret_cast<const uint8_t*>("navigator"), v8::NewStringType::kNormal).ToLocalChecked();
if (executionContext->isDocument()) {
- v8::Local<v8::Object> navigator = global->Get(context, navigatorName).ToLocalChecked()->ToObject();
// For global interfaces e.g. BluetoothUUID.
V8WindowPartial::installWebBluetooth(scriptState, global);
// For navigator interfaces e.g. navigator.bluetooth.
- V8NavigatorPartial::installWebBluetooth(scriptState, navigator);
+ V8NavigatorPartial::installWebBluetooth(scriptState);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698