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

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

Issue 2005433002: [Origin Trials] Install origin trial bindings on V8 context conditionally (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@track-ef-install
Patch Set: Fix multiple definition of signature; addressing nits Created 4 years, 7 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/core/v8/V8Binding.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Binding.h b/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
index 599bc7323634e4e5364e11605d4b12affff2ff7b..775169767355d1d4723ef39e694b5d40de8bb3d4 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
+++ b/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
@@ -69,6 +69,8 @@ class WorkerGlobalScope;
class WorkerOrWorkletGlobalScope;
class XPathNSResolver;
+using InstallOriginTrialsFunction = void (*)(ScriptState*);
+
template <typename T>
struct V8TypeOf {
STATIC_ONLY(V8TypeOf);
@@ -861,6 +863,20 @@ CORE_EXPORT EventTarget* toEventTarget(v8::Isolate*, v8::Local<v8::Value>);
// to allocate it using alloca() in the callers stack frame.
CORE_EXPORT void toFlexibleArrayBufferView(v8::Isolate*, v8::Local<v8::Value>, FlexibleArrayBufferView&, void* storage = nullptr);
+// Installs all of the origin-trial-enabled V8 bindings for the given context
+// and world, based on the trial tokens which have been added to the
+// ExecutionContext. This should be called after the V8 context has been
+// installed, but may be called multiple times, as trial tokens are
+// encountered. It indirectly calls the function set by
+// |setInstallOriginTrialsFunction|.
+CORE_EXPORT void installOriginTrials(ScriptState*);
+
+// Sets the function to be called by |installOriginTrials|. The function is
+// initially set to the private |installOriginTrialsForCore| function, but
+// can be overridden by this function. A pointer to the previously set function
+// is returned, so that functions can be chained.
+CORE_EXPORT InstallOriginTrialsFunction setInstallOriginTrialsFunction(InstallOriginTrialsFunction);
+
// If the current context causes out of memory, JavaScript setting
// is disabled and it returns true.
bool handleOutOfMemory();

Powered by Google App Engine
This is Rietveld 408576698