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

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

Issue 2627023002: Introduce Origin-Trial for Service Worker Navigation Preload (Closed)
Patch Set: s/an/a Created 3 years, 11 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/ConditionalFeaturesForModules.cpp
diff --git a/third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp b/third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp
index 280ba64e6172d39bbf453cb390d74716b507700a..05b68ce4422fe2f66c5c1a236da3e879aa34f7ce 100644
--- a/third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp
+++ b/third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp
@@ -11,11 +11,13 @@
#include "bindings/core/v8/V8Window.h"
#include "bindings/core/v8/V8WorkerNavigator.h"
#include "bindings/modules/v8/V8DedicatedWorkerGlobalScopePartial.h"
+#include "bindings/modules/v8/V8FetchEvent.h"
#include "bindings/modules/v8/V8Gamepad.h"
#include "bindings/modules/v8/V8GamepadButton.h"
#include "bindings/modules/v8/V8InstallEvent.h"
#include "bindings/modules/v8/V8NavigatorPartial.h"
#include "bindings/modules/v8/V8ServiceWorkerGlobalScope.h"
+#include "bindings/modules/v8/V8ServiceWorkerRegistration.h"
#include "bindings/modules/v8/V8SharedWorkerGlobalScopePartial.h"
#include "bindings/modules/v8/V8WindowPartial.h"
#include "bindings/modules/v8/V8WorkerNavigatorPartial.h"
@@ -77,12 +79,46 @@ void installConditionalFeaturesForModules(
V8WindowPartial::installGamepadExtensions(
isolate, world, instanceObject, prototypeObject, interfaceObject);
}
+ if (OriginTrials::serviceWorkerNavigationPreloadEnabled(executionContext)) {
+ V8WindowPartial::installServiceWorkerNavigationPreload(
+ isolate, world, instanceObject, prototypeObject, interfaceObject);
+ }
+ } else if (wrapperTypeInfo ==
+ &V8DedicatedWorkerGlobalScope::wrapperTypeInfo) {
+ v8::Local<v8::Object> instanceObject = scriptState->context()->Global();
+ if (OriginTrials::serviceWorkerNavigationPreloadEnabled(executionContext)) {
+ V8DedicatedWorkerGlobalScopePartial::
+ installServiceWorkerNavigationPreload(
+ isolate, world, instanceObject, prototypeObject, interfaceObject);
+ }
+ } else if (wrapperTypeInfo == &V8SharedWorkerGlobalScope::wrapperTypeInfo) {
+ v8::Local<v8::Object> instanceObject = scriptState->context()->Global();
+ if (OriginTrials::serviceWorkerNavigationPreloadEnabled(executionContext)) {
+ V8SharedWorkerGlobalScopePartial::installServiceWorkerNavigationPreload(
+ isolate, world, instanceObject, prototypeObject, interfaceObject);
+ }
} else if (wrapperTypeInfo == &V8ServiceWorkerGlobalScope::wrapperTypeInfo) {
v8::Local<v8::Object> instanceObject = scriptState->context()->Global();
if (OriginTrials::foreignFetchEnabled(executionContext)) {
V8ServiceWorkerGlobalScope::installForeignFetch(
isolate, world, instanceObject, prototypeObject, interfaceObject);
}
+ if (OriginTrials::serviceWorkerNavigationPreloadEnabled(executionContext)) {
+ V8ServiceWorkerGlobalScope::installServiceWorkerNavigationPreload(
+ isolate, world, instanceObject, prototypeObject, interfaceObject);
+ }
+ } else if (wrapperTypeInfo == &V8ServiceWorkerRegistration::wrapperTypeInfo) {
+ if (OriginTrials::serviceWorkerNavigationPreloadEnabled(executionContext)) {
+ V8ServiceWorkerRegistration::installServiceWorkerNavigationPreload(
+ isolate, world, v8::Local<v8::Object>(), prototypeObject,
+ interfaceObject);
+ }
+ } else if (wrapperTypeInfo == &V8FetchEvent::wrapperTypeInfo) {
+ if (OriginTrials::serviceWorkerNavigationPreloadEnabled(executionContext)) {
+ V8FetchEvent::installServiceWorkerNavigationPreload(
+ isolate, world, v8::Local<v8::Object>(), prototypeObject,
+ interfaceObject);
+ }
} else if (wrapperTypeInfo == &V8InstallEvent::wrapperTypeInfo) {
if (OriginTrials::foreignFetchEnabled(executionContext)) {
V8InstallEvent::installForeignFetch(isolate, world,

Powered by Google App Engine
This is Rietveld 408576698