Index: content/browser/renderer_host/render_process_host_impl.cc |
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc |
index 1f9ff8d5d4c79cf36cbd7b5aeed3db04c1d66fa5..2faa427d530e2fad6046363960d66a29ee3f6ae8 100644 |
--- a/content/browser/renderer_host/render_process_host_impl.cc |
+++ b/content/browser/renderer_host/render_process_host_impl.cc |
@@ -912,6 +912,7 @@ bool RenderProcessHostImpl::OnMessageReceived(const IPC::Message& msg) { |
OnUserMetricsRecordAction) |
IPC_MESSAGE_HANDLER(ViewHostMsg_RevealFolderInOS, OnRevealFolderInOS) |
IPC_MESSAGE_HANDLER(ViewHostMsg_SavedPageAsMHTML, OnSavedPageAsMHTML) |
+ IPC_MESSAGE_HANDLER(ViewHostMsg_SendPostMessage, OnSendPostMessage) |
IPC_MESSAGE_UNHANDLED_ERROR() |
IPC_END_MESSAGE_MAP_EX() |
@@ -1329,3 +1330,30 @@ void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) { |
content::GetContentClient()->browser()->GetMHTMLGenerationManager()-> |
MHTMLGenerated(job_id, data_size); |
} |
+ |
+void RenderProcessHostImpl::OnSendPostMessage(int64 browsing_instance_frame_id, |
+ const ViewMsg_PostMessage_Params& params) { |
Charlie Reis
2011/12/12 22:20:36
Line length
supersat
2011/12/15 19:30:49
Done.
|
+ DLOG(WARNING) << "OnSendPostMessage"; |
+ content::FrameMap& frame_mapper = GetBrowserContext()->frame_mapper(); |
+ content::BrowsingInstanceFrame* frame = |
+ frame_mapper.FindById(browsing_instance_frame_id); |
+ |
+ // Until we remove the proxy when a frame is closed, there might be a proxy |
+ // for a frame that no longer exists. If that's the case, just drop the msg. |
+ if (!frame) { |
Charlie Reis
2011/12/12 22:20:36
No braces on a one line if.
supersat
2011/12/15 19:30:49
Done.
|
+ return; |
+ } |
+ |
+ RenderViewHost *rvh = RenderViewHost::FromID(frame->current_process_host_id(), |
+ frame->current_route_id()); |
+ |
+ // TODO(supersat): Temporary workaround for frames not being removed from |
+ // the mapper properly. |
+ if (!rvh) { |
+ return; |
+ } |
+ |
+ rvh->Send(new ViewMsg_PostMessage(rvh->routing_id(), |
+ frame->current_frame_id(), |
+ params)); |
+} |