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

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

Issue 2785913003: Add an Origin Trial for Navigator.getInstalledRelatedApps. (Closed)
Patch Set: Fix tests and make non-Android-specific. Created 3 years, 9 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 e2dfd258efd27c08df165965ede974fa3172017f..28a10f002ee8b361952342a33d6d81576bc7003b 100644
--- a/third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp
+++ b/third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp
@@ -52,6 +52,14 @@ void installConditionalFeaturesForModules(
v8::Isolate* isolate = scriptState->isolate();
const DOMWrapperWorld& world = scriptState->world();
if (wrapperTypeInfo == &V8Navigator::wrapperTypeInfo) {
+ // Mimics the [SecureContext] extended attribute. Work-around for
+ // https://crbug.com/695123.
+ if (OriginTrials::installedAppEnabled(executionContext) &&
+ executionContext->isSecureContext()) {
+ V8NavigatorPartial::installInstalledApp(isolate, world,
+ v8::Local<v8::Object>(),
+ prototypeObject, interfaceObject);
+ }
if (OriginTrials::webShareEnabled(executionContext)) {
V8NavigatorPartial::installWebShare(isolate, world,
v8::Local<v8::Object>(),
@@ -178,6 +186,16 @@ void installPendingConditionalFeatureForModules(
v8::Local<v8::Function>());
return;
}
+ if (feature == "InstalledApp") {
+ if (contextData->getExistingConstructorAndPrototypeForType(
+ &V8Navigator::wrapperTypeInfo, &prototypeObject,
+ &interfaceObject)) {
+ V8NavigatorPartial::installInstalledApp(isolate, world,
+ v8::Local<v8::Object>(),
+ prototypeObject, interfaceObject);
+ }
+ return;
+ }
if (feature == "ServiceWorkerNavigationPreload") {
globalInstanceObject = scriptState->context()->Global();
V8WindowPartial::installServiceWorkerNavigationPreload(

Powered by Google App Engine
This is Rietveld 408576698