summaryrefslogtreecommitdiffstats
path: root/chromium/android_webview/common/js_java_interaction/interfaces.mojom
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/android_webview/common/js_java_interaction/interfaces.mojom')
-rw-r--r--chromium/android_webview/common/js_java_interaction/interfaces.mojom21
1 files changed, 14 insertions, 7 deletions
diff --git a/chromium/android_webview/common/js_java_interaction/interfaces.mojom b/chromium/android_webview/common/js_java_interaction/interfaces.mojom
index 5a7ea23c403..ec016b360a6 100644
--- a/chromium/android_webview/common/js_java_interaction/interfaces.mojom
+++ b/chromium/android_webview/common/js_java_interaction/interfaces.mojom
@@ -7,9 +7,20 @@ module android_webview.mojom;
import "mojo/public/mojom/base/string16.mojom";
import "services/network/public/mojom/proxy_config.mojom";
+// JsObject struct represents a JavaScript object we will inject in the main
+// JavaScript world of a frame. |js_object_name| will be used as the name
+// of the JavaScript object. We will inject the object if the frame's origin
+// matches |allowed_origin_rules|. |js_to_java_messaging| will be used for
+// that JavaScript object to send message back to browser (hence Java) side.
+struct JsObject {
+ mojo_base.mojom.String16 js_object_name;
+ pending_associated_remote<JsToJavaMessaging> js_to_java_messaging;
+ network.mojom.ProxyBypassRules allowed_origin_rules;
+};
+
// For JavaScript postMessage() API, implemented by browser.
interface JsToJavaMessaging {
- // Called from renderer, browser receives |message| and possible |ports|.
+ // Called from renderer, browser receives |message| and possible |ports|,
// The |message| is an opaque type and the contents are defined by the client
// of this API.
PostMessage(mojo_base.mojom.String16 message,
@@ -30,10 +41,6 @@ interface JavaToJsMessaging {
// For browser to configure renderer, implemented by renderer.
interface JsJavaConfigurator {
// Called from browser, to tell renderer that if we need to inject
- // a JavaScript object with the given |js_object_name| based on
- // |need_to_inject_js_object| flag. Only frames with the origin matches
- // |allowed_origin_rules| will have the object injected.
- SetJsApiService(bool need_to_inject_js_object,
- mojo_base.mojom.String16 js_object_name,
- network.mojom.ProxyBypassRules allowed_origin_rules);
+ // JavaScript objects to the frame based on the |js_objects| array.
+ SetJsObjects(array<android_webview.mojom.JsObject> js_objects);
}; \ No newline at end of file