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..d558ae9fe9b2b32fd7d94318259aff294f272e97 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 initializeOriginTrialsFunction = void (*)(v8::Local<v8::Context>, const DOMWrapperWorld&); |
+ |
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); |
+// Initializes 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 |
+// initialized, but may be called multiple times, as trial tokens are |
+// encountered. It indirectly calls the function set by |
+// |setInitializeOriginTrialsFunction|. |
+CORE_EXPORT void initializeOriginTrials(v8::Local<v8::Context>, const DOMWrapperWorld&); |
+ |
+// Sets the function to be called by |initializeOriginTrials|. The function is |
+// initially set to the private |initializeOriginTrialsForCore| 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 initializeOriginTrialsFunction setInitializeOriginTrialsFunction(initializeOriginTrialsFunction); |
+ |
// If the current context causes out of memory, JavaScript setting |
// is disabled and it returns true. |
bool handleOutOfMemory(); |