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

Side by Side Diff: content/browser/browser_plugin/browser_plugin_embedder_helper.cc

Issue 11046002: Browser Plugin: Fixed browser process crash on embedder reload. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed nits 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/browser_plugin/browser_plugin_embedder_helper.h" 5 #include "content/browser/browser_plugin/browser_plugin_embedder_helper.h"
6 6
7 #include "content/browser/browser_plugin/browser_plugin_embedder.h" 7 #include "content/browser/browser_plugin/browser_plugin_embedder.h"
8 #include "content/browser/renderer_host/render_view_host_impl.h" 8 #include "content/browser/renderer_host/render_view_host_impl.h"
9 #include "content/common/browser_plugin_messages.h" 9 #include "content/common/browser_plugin_messages.h"
10 #include "content/common/view_messages.h" 10 #include "content/common/view_messages.h"
(...skipping 15 matching lines...) Expand all
26 } 26 }
27 27
28 bool BrowserPluginEmbedderHelper::Send(IPC::Message* message) { 28 bool BrowserPluginEmbedderHelper::Send(IPC::Message* message) {
29 return RenderViewHostObserver::Send(message); 29 return RenderViewHostObserver::Send(message);
30 } 30 }
31 31
32 bool BrowserPluginEmbedderHelper::OnMessageReceived( 32 bool BrowserPluginEmbedderHelper::OnMessageReceived(
33 const IPC::Message& message) { 33 const IPC::Message& message) {
34 bool handled = true; 34 bool handled = true;
35 IPC_BEGIN_MESSAGE_MAP(BrowserPluginEmbedderHelper, message) 35 IPC_BEGIN_MESSAGE_MAP(BrowserPluginEmbedderHelper, message)
36 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_CreateGuest,
37 OnCreateGuest);
36 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_NavigateGuest, 38 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_NavigateGuest,
37 OnNavigateGuest); 39 OnNavigateGuest);
38 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_ResizeGuest, OnResizeGuest) 40 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_ResizeGuest, OnResizeGuest)
39 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_UpdateRect_ACK, OnUpdateRectACK); 41 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_UpdateRect_ACK, OnUpdateRectACK);
40 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_SetFocus, OnSetFocus); 42 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_SetFocus, OnSetFocus);
41 IPC_MESSAGE_HANDLER_GENERIC(BrowserPluginHostMsg_HandleInputEvent, 43 IPC_MESSAGE_HANDLER_GENERIC(BrowserPluginHostMsg_HandleInputEvent,
42 OnHandleInputEvent(*static_cast<const IPC::SyncMessage*>(&message), 44 OnHandleInputEvent(*static_cast<const IPC::SyncMessage*>(&message),
43 &handled)) 45 &handled))
44 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_PluginDestroyed, 46 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_PluginDestroyed,
45 OnPluginDestroyed); 47 OnPluginDestroyed);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 92
91 IPC::Message* reply_message = 93 IPC::Message* reply_message =
92 IPC::SyncMessage::GenerateReply(&message); 94 IPC::SyncMessage::GenerateReply(&message);
93 embedder_->HandleInputEvent(instance_id, 95 embedder_->HandleInputEvent(instance_id,
94 rvh, 96 rvh,
95 guest_screen_rect, 97 guest_screen_rect,
96 *input_event, 98 *input_event,
97 reply_message); 99 reply_message);
98 } 100 }
99 101
102 void BrowserPluginEmbedderHelper::OnCreateGuest(
103 int instance_id,
104 const std::string& storage_partition_id,
105 bool persist_storage) {
106 // The first BrowserPluginHostMsg_CreateGuest message is handled in
107 // WebContentsImpl. All subsequent BrowserPluginHostMsg_CreateGuest
108 // messages are handled here.
109 embedder_->CreateGuest(render_view_host(),
110 instance_id,
111 storage_partition_id,
112 persist_storage);
113 }
114
100 void BrowserPluginEmbedderHelper::OnNavigateGuest( 115 void BrowserPluginEmbedderHelper::OnNavigateGuest(
101 int instance_id, 116 int instance_id,
102 const std::string& src, 117 const std::string& src,
103 const BrowserPluginHostMsg_ResizeGuest_Params& resize_params) { 118 const BrowserPluginHostMsg_ResizeGuest_Params& resize_params) {
104 embedder_->NavigateGuest(render_view_host(), 119 embedder_->NavigateGuest(render_view_host(),
105 instance_id, 120 instance_id,
106 src, 121 src,
107 resize_params); 122 resize_params);
108 } 123 }
109 124
(...skipping 17 matching lines...) Expand all
127 142
128 void BrowserPluginEmbedderHelper::OnStop(int instance_id) { 143 void BrowserPluginEmbedderHelper::OnStop(int instance_id) {
129 embedder_->Stop(instance_id); 144 embedder_->Stop(instance_id);
130 } 145 }
131 146
132 void BrowserPluginEmbedderHelper::OnReload(int instance_id) { 147 void BrowserPluginEmbedderHelper::OnReload(int instance_id) {
133 embedder_->Reload(instance_id); 148 embedder_->Reload(instance_id);
134 } 149 }
135 150
136 } // namespace content 151 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698