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

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

Issue 10829225: Browser Plugin: Add HTML5-like postMessage support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with ToT. Added subframe targeting + test. Created 8 years, 2 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_helper.cc
diff --git a/content/browser/browser_plugin/browser_plugin_guest_helper.cc b/content/browser/browser_plugin/browser_plugin_guest_helper.cc
index 68512ca4b322f160ef99dadfec65639c4a5c3f0f..b5e53bd406dfd7afc8605fb74986beb5d9473296 100644
--- a/content/browser/browser_plugin/browser_plugin_guest_helper.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest_helper.cc
@@ -5,9 +5,9 @@
#include "content/browser/browser_plugin/browser_plugin_guest_helper.h"
#include "content/browser/browser_plugin/browser_plugin_guest.h"
+#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/common/view_messages.h"
-#include "content/public/browser/render_view_host.h"
namespace content {
@@ -25,6 +25,16 @@ bool BrowserPluginGuestHelper::OnMessageReceived(
const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(BrowserPluginGuestHelper, message)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_RouteMessageEvent, OnRouteMessageEvent)
+ IPC_MESSAGE_UNHANDLED(handled = false)
+ IPC_END_MESSAGE_MAP()
+
+ if (static_cast<RenderViewHostImpl*>(render_view_host())->is_swapped_out()) {
+ return handled;
+ }
+
+ handled = true;
+ IPC_BEGIN_MESSAGE_MAP(BrowserPluginGuestHelper, message)
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect)
IPC_MESSAGE_HANDLER(ViewHostMsg_HandleInputEvent_ACK, OnHandleInputEventAck)
IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus)
@@ -65,4 +75,9 @@ void BrowserPluginGuestHelper::OnSetCursor(const WebCursor& cursor) {
guest_->SetCursor(cursor);
}
+void BrowserPluginGuestHelper::OnRouteMessageEvent(
+ const ViewMsg_PostMessage_Params& params) {
+ guest_->RouteMessageEvent(params);
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698