summaryrefslogtreecommitdiffstats
path: root/android_webview/common
diff options
context:
space:
mode:
authorsgurun <sgurun@chromium.org>2015-01-23 12:54:05 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-23 20:55:32 +0000
commitd2a4306024cc3bd6c52c70646ad6ec37f0259622 (patch)
tree4872f4b3a7f746bd4cb1c8e63e820925a9404af8 /android_webview/common
parentd2e1ece564dc9b309d8d97bd988e635b5cb41047 (diff)
downloadchromium_src-d2a4306024cc3bd6c52c70646ad6ec37f0259622.zip
chromium_src-d2a4306024cc3bd6c52c70646ad6ec37f0259622.tar.gz
chromium_src-d2a4306024cc3bd6c52c70646ad6ec37f0259622.tar.bz2
Enable posting a message from JS to Android webview.
For future CL: queueing messages, sending messages from Java to JS through message channel, transferring ports in message channels, closing channels. BUG=393291 Review URL: https://codereview.chromium.org/831523004 Cr-Commit-Position: refs/heads/master@{#312922}
Diffstat (limited to 'android_webview/common')
-rw-r--r--android_webview/common/android_webview_message_generator.h1
-rw-r--r--android_webview/common/aw_message_port_messages.h32
2 files changed, 33 insertions, 0 deletions
diff --git a/android_webview/common/android_webview_message_generator.h b/android_webview/common/android_webview_message_generator.h
index 1ac28dc..f5dcce8 100644
--- a/android_webview/common/android_webview_message_generator.h
+++ b/android_webview/common/android_webview_message_generator.h
@@ -4,5 +4,6 @@
// Multiply-included file, hence no include guard.
+#include "android_webview/common/aw_message_port_messages.h"
#include "android_webview/common/print_messages.h"
#include "android_webview/common/render_view_messages.h"
diff --git a/android_webview/common/aw_message_port_messages.h b/android_webview/common/aw_message_port_messages.h
new file mode 100644
index 0000000..866d713
--- /dev/null
+++ b/android_webview/common/aw_message_port_messages.h
@@ -0,0 +1,32 @@
+// Copyright 2015 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.
+
+// Multiply-included file, no traditional include guard.
+#include <vector>
+
+#include "base/basictypes.h"
+#include "ipc/ipc_message_macros.h"
+
+#define IPC_MESSAGE_START AwMessagePortMsgStart
+
+//-----------------------------------------------------------------------------
+// MessagePort messages
+// These are messages sent from the browser to the renderer process.
+
+// Tells the renderer to convert the sent message from a WebSerializeScript
+// format to a base::ListValue. Due to the complexities of renderer/browser
+// relation, this can only be done in renderer for now.
+IPC_MESSAGE_ROUTED3(AwMessagePortMsg_Message,
+ int /* recipient message port id */,
+ base::string16 /* message */,
+ std::vector<int> /* sent message port_ids */)
+
+//-----------------------------------------------------------------------------
+// These are messages sent from the renderer to the browser process.
+
+// Response to AwMessagePortMessage_ConvertMessage
+IPC_MESSAGE_ROUTED3(AwMessagePortHostMsg_ConvertedMessage,
+ int /* recipient message port id */,
+ base::ListValue /* converted message */,
+ std::vector<int> /* sent message port_ids */)