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

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

Issue 2053943002: [DurableStorage] Enable origin trial on workers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 26c46df483554754bdfc7a058ece75313b6d7289..1a21171396b30740f77779a80c31df78d1868426 100644
--- a/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp
+++ b/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp
@@ -47,6 +47,7 @@
#include "bindings/modules/v8/V8ServiceWorkerGlobalScope.h"
#include "bindings/modules/v8/V8SharedWorkerGlobalScopePartial.h"
#include "bindings/modules/v8/V8WindowPartial.h"
+#include "bindings/modules/v8/V8WorkerNavigatorPartial.h"
#include "bindings/modules/v8/V8WorkletGlobalScope.h"
#include "core/dom/DOMArrayBuffer.h"
#include "core/dom/DOMArrayBufferView.h"
@@ -560,17 +561,23 @@ void installOriginTrialsForModules(ScriptState* scriptState)
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::String> navigatorName = v8::String::NewFromOneByte(isolate, reinterpret_cast<const uint8_t*>("navigator"), v8::NewStringType::kNormal).ToLocalChecked();
v8::Local<v8::Object> navigator = global->Get(context, navigatorName).ToLocalChecked()->ToObject();
V8WindowPartial::installDurableStorage(scriptState, global);
V8NavigatorPartial::installDurableStorage(scriptState, navigator);
} else if (executionContext->isSharedWorkerGlobalScope()) {
+ v8::Local<v8::Object> navigator = global->Get(context, navigatorName).ToLocalChecked()->ToObject();
V8SharedWorkerGlobalScopePartial::installDurableStorage(scriptState, global);
+ V8WorkerNavigatorPartial::installDurableStorage(scriptState, navigator);
} else if (executionContext->isDedicatedWorkerGlobalScope()) {
+ v8::Local<v8::Object> navigator = global->Get(context, navigatorName).ToLocalChecked()->ToObject();
V8DedicatedWorkerGlobalScopePartial::installDurableStorage(scriptState, global);
+ V8WorkerNavigatorPartial::installDurableStorage(scriptState, navigator);
} else if (executionContext->isServiceWorkerGlobalScope()) {
+ v8::Local<v8::Object> navigator = global->Get(context, navigatorName).ToLocalChecked()->ToObject();
V8ServiceWorkerGlobalScope::installDurableStorage(scriptState, global);
+ V8WorkerNavigatorPartial::installDurableStorage(scriptState, navigator);
}
originTrialContext->setFeatureBindingsInstalled("DurableStorage");
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698