summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustav Sennton <gsennton@google.com>2018-03-22 09:47:25 +0000
committerGustav Sennton <gsennton@google.com>2018-03-22 14:52:38 +0000
commite149215027e947e6655edb889f48990e90dce609 (patch)
treee5b3aae3f110003b36c1b2ffc7f730ee0624ca6b
parent7a06470db32251f50f63e68a149515758dd4883b (diff)
downloadwebview_support_interfaces-e149215027e947e6655edb889f48990e90dce609.tar.gz
[WebView Support Library] Support service worker APIs.
Provide (chromium-side) support for ServiceWorkers in the WebView Support Library. We'll add feature flags for the ServiceWorker APIs in a follow-up. Bug: 819595 Change-Id: Id4c79e3970706633e36b28538c443a00c7e59e03 Reviewed-on: https://chromium-review.googlesource.com/964142 Reviewed-by: Richard Coles <torne@chromium.org> Reviewed-by: Nate Fischer <ntfschr@chromium.org> Commit-Queue: Gustav Sennton <gsennton@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#545024} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 824511444f1772442551af893e3e0fdeafed177a
-rw-r--r--BUILD.gn3
-rw-r--r--src/org/chromium/support_lib_boundary/ServiceWorkerClientBoundaryInterface.java15
-rw-r--r--src/org/chromium/support_lib_boundary/ServiceWorkerControllerBoundaryInterface.java15
-rw-r--r--src/org/chromium/support_lib_boundary/ServiceWorkerWebSettingsBoundaryInterface.java26
-rw-r--r--src/org/chromium/support_lib_boundary/WebViewProviderFactoryBoundaryInterface.java1
5 files changed, 60 insertions, 0 deletions
diff --git a/BUILD.gn b/BUILD.gn
index dda7b79..9b36892 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -7,6 +7,9 @@ import("//build/config/android/rules.gni")
android_library("boundary_interface_java") {
java_files = [
+ "src/org/chromium/support_lib_boundary/ServiceWorkerClientBoundaryInterface.java",
+ "src/org/chromium/support_lib_boundary/ServiceWorkerControllerBoundaryInterface.java",
+ "src/org/chromium/support_lib_boundary/ServiceWorkerWebSettingsBoundaryInterface.java",
"src/org/chromium/support_lib_boundary/StaticsBoundaryInterface.java",
"src/org/chromium/support_lib_boundary/SupportLibraryInfoBoundaryInterface.java",
"src/org/chromium/support_lib_boundary/VisualStateCallbackBoundaryInterface.java",
diff --git a/src/org/chromium/support_lib_boundary/ServiceWorkerClientBoundaryInterface.java b/src/org/chromium/support_lib_boundary/ServiceWorkerClientBoundaryInterface.java
new file mode 100644
index 0000000..36a9cfc
--- /dev/null
+++ b/src/org/chromium/support_lib_boundary/ServiceWorkerClientBoundaryInterface.java
@@ -0,0 +1,15 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.support_lib_boundary;
+
+import android.webkit.WebResourceRequest;
+import android.webkit.WebResourceResponse;
+
+/**
+ * Boundary interface for ServiceWorkerClient.
+ */
+public interface ServiceWorkerClientBoundaryInterface {
+ WebResourceResponse shouldInterceptRequest(WebResourceRequest request);
+}
diff --git a/src/org/chromium/support_lib_boundary/ServiceWorkerControllerBoundaryInterface.java b/src/org/chromium/support_lib_boundary/ServiceWorkerControllerBoundaryInterface.java
new file mode 100644
index 0000000..e25e3ed
--- /dev/null
+++ b/src/org/chromium/support_lib_boundary/ServiceWorkerControllerBoundaryInterface.java
@@ -0,0 +1,15 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.support_lib_boundary;
+
+import java.lang.reflect.InvocationHandler;
+
+/**
+ * Boundary interface for ServiceWorkerController.
+ */
+public interface ServiceWorkerControllerBoundaryInterface {
+ /* ServiceWorkerWebSettings */ InvocationHandler getServiceWorkerWebSettings();
+ void setServiceWorkerClient(/* ServiceWorkerClient */ InvocationHandler client);
+}
diff --git a/src/org/chromium/support_lib_boundary/ServiceWorkerWebSettingsBoundaryInterface.java b/src/org/chromium/support_lib_boundary/ServiceWorkerWebSettingsBoundaryInterface.java
new file mode 100644
index 0000000..dfd61fa
--- /dev/null
+++ b/src/org/chromium/support_lib_boundary/ServiceWorkerWebSettingsBoundaryInterface.java
@@ -0,0 +1,26 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.support_lib_boundary;
+
+/**
+ * Boundary interface for ServiceWorkerWebSettings.
+ */
+public interface ServiceWorkerWebSettingsBoundaryInterface {
+ void setCacheMode(int mode);
+
+ int getCacheMode();
+
+ void setAllowContentAccess(boolean allow);
+
+ boolean getAllowContentAccess();
+
+ void setAllowFileAccess(boolean allow);
+
+ boolean getAllowFileAccess();
+
+ void setBlockNetworkLoads(boolean flag);
+
+ boolean getBlockNetworkLoads();
+}
diff --git a/src/org/chromium/support_lib_boundary/WebViewProviderFactoryBoundaryInterface.java b/src/org/chromium/support_lib_boundary/WebViewProviderFactoryBoundaryInterface.java
index 094e2cf..380bf42 100644
--- a/src/org/chromium/support_lib_boundary/WebViewProviderFactoryBoundaryInterface.java
+++ b/src/org/chromium/support_lib_boundary/WebViewProviderFactoryBoundaryInterface.java
@@ -15,4 +15,5 @@ public interface WebViewProviderFactoryBoundaryInterface {
/* SupportLibWebkitToCompatConverter */ InvocationHandler getWebkitToCompatConverter();
/* StaticsAdapter */ InvocationHandler getStatics();
String[] getSupportedFeatures();
+ /* SupportLibraryServiceWorkerController */ InvocationHandler getServiceWorkerController();
}