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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp

Issue 2096663002: [Origin Trials] Only flag feature bindings installed after all install methods have returned (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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/bindings/modules/v8/V8BindingForModules.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp b/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp
index 5cee46d29e4ca1ad93bb61e631b53988a2bbf303..c4c5843165beb8bec7d4b662f22c16eec717f959 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp
@@ -57,6 +57,7 @@
#include "core/inspector/InspectorTraceEvents.h"
#include "core/loader/FrameLoader.h"
#include "core/loader/FrameLoaderClient.h"
+#include "core/origin_trials/OriginTrialContext.h"
#include "core/workers/WorkerGlobalScope.h"
#include "core/workers/WorkletGlobalScope.h"
#include "core/xml/XPathNSResolver.h"
@@ -818,7 +819,20 @@ InstallOriginTrialsFunction s_installOriginTrialsFunction = &installOriginTrials
void installOriginTrials(ScriptState* scriptState)
{
+ v8::Local<v8::Context> context = scriptState->context();
+ ExecutionContext* executionContext = toExecutionContext(context);
+ OriginTrialContext* originTrialContext = OriginTrialContext::from(executionContext, OriginTrialContext::DontCreateIfNotExists);
+ if (!originTrialContext)
+ return;
+
+ ScriptState::Scope scope(scriptState);
+
(*s_installOriginTrialsFunction)(scriptState);
+
+ // Mark each enabled feature as having been installed.
+ if (!originTrialContext->featureBindingsInstalled("DurableStorage") && (RuntimeEnabledFeatures::durableStorageEnabled() || originTrialContext->isFeatureEnabled("DurableStorage", nullptr))) {
+ originTrialContext->setFeatureBindingsInstalled("DurableStorage");
+ }
}
InstallOriginTrialsFunction setInstallOriginTrialsFunction(InstallOriginTrialsFunction newInstallOriginTrialsFunction)
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698