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

Unified Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 10829225: Browser Plugin: Add HTML5-like postMessage support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed crash + cleanup Created 8 years, 3 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: content/browser/browser_plugin/browser_plugin_guest.cc
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
index 4b1ff93c641e29a0482c34dbce3e16794f67e3a8..aa51d1fefca788e2bd6b43b028ce009a3107ffe4 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -41,7 +41,9 @@ BrowserPluginGuest::BrowserPluginGuest(int instance_id,
damage_buffer_size_(0),
#endif
pending_update_counter_(0),
- guest_hang_timeout_(kGuestHangTimeout) {
+ guest_hang_timeout_(kGuestHangTimeout),
+ swapped_out_embedder_routing_id_(MSG_ROUTING_NONE),
+ swapped_out_guest_routing_id_(MSG_ROUTING_NONE) {
DCHECK(web_contents);
// |render_view_host| manages the ownership of this BrowserPluginGuestHelper.
new BrowserPluginGuestHelper(this, render_view_host);
@@ -200,7 +202,7 @@ void BrowserPluginGuest::HandleInputEvent(RenderViewHost* render_view_host,
// embedder doesn't hang.
BrowserPluginHostMsg_HandleInputEvent::WriteReplyParams(
reply_message, false /* handled */, cursor_);
- embedder_render_process_host()->Send(reply_message);
+ SendMessageToEmbedder(reply_message);
return;
}
@@ -214,6 +216,15 @@ void BrowserPluginGuest::HandleInputEvent(RenderViewHost* render_view_host,
guest_rvh->StartHangMonitorTimeout(guest_hang_timeout_);
}
+void BrowserPluginGuest::RouteMessageEvent(
+ const ViewMsg_PostMessage_Params& params) {
+ SendMessageToEmbedder(new BrowserPluginMsg_ReceiveMessage(
+ instance_id(),
+ swapped_out_embedder_routing_id(),
+ params.source_origin,
+ params.data));
+}
+
void BrowserPluginGuest::HandleInputEventAck(RenderViewHost* render_view_host,
bool handled) {
RenderViewHostImpl* guest_rvh =

Powered by Google App Engine
This is Rietveld 408576698