OLD | NEW |
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/ppapi_plugin_process_host.h" | 5 #include "content/browser/ppapi_plugin_process_host.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 if (Send(msg)) { | 235 if (Send(msg)) { |
236 sent_requests_.push(client); | 236 sent_requests_.push(client); |
237 } else { | 237 } else { |
238 client->OnPpapiChannelOpened(IPC::ChannelHandle(), 0); | 238 client->OnPpapiChannelOpened(IPC::ChannelHandle(), 0); |
239 } | 239 } |
240 } | 240 } |
241 | 241 |
242 void PpapiPluginProcessHost::OnProcessLaunched() { | 242 void PpapiPluginProcessHost::OnProcessLaunched() { |
243 } | 243 } |
244 | 244 |
| 245 void PpapiPluginProcessHost::OnProcessCrashed(int exit_code) { |
| 246 PluginServiceImpl::GetInstance()->RegisterPluginCrash(plugin_path_); |
| 247 } |
| 248 |
245 bool PpapiPluginProcessHost::OnMessageReceived(const IPC::Message& msg) { | 249 bool PpapiPluginProcessHost::OnMessageReceived(const IPC::Message& msg) { |
246 bool handled = true; | 250 bool handled = true; |
247 IPC_BEGIN_MESSAGE_MAP(PpapiPluginProcessHost, msg) | 251 IPC_BEGIN_MESSAGE_MAP(PpapiPluginProcessHost, msg) |
248 IPC_MESSAGE_HANDLER(PpapiHostMsg_ChannelCreated, | 252 IPC_MESSAGE_HANDLER(PpapiHostMsg_ChannelCreated, |
249 OnRendererPluginChannelCreated) | 253 OnRendererPluginChannelCreated) |
250 IPC_MESSAGE_UNHANDLED(handled = false) | 254 IPC_MESSAGE_UNHANDLED(handled = false) |
251 IPC_END_MESSAGE_MAP() | 255 IPC_END_MESSAGE_MAP() |
252 DCHECK(handled); | 256 DCHECK(handled); |
253 return handled; | 257 return handled; |
254 } | 258 } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 if (sent_requests_.empty()) | 302 if (sent_requests_.empty()) |
299 return; | 303 return; |
300 | 304 |
301 // All requests should be processed FIFO, so the next item in the | 305 // All requests should be processed FIFO, so the next item in the |
302 // sent_requests_ queue should be the one that the plugin just created. | 306 // sent_requests_ queue should be the one that the plugin just created. |
303 Client* client = sent_requests_.front(); | 307 Client* client = sent_requests_.front(); |
304 sent_requests_.pop(); | 308 sent_requests_.pop(); |
305 | 309 |
306 client->OnPpapiChannelOpened(channel_handle, process_->GetData().id); | 310 client->OnPpapiChannelOpened(channel_handle, process_->GetData().id); |
307 } | 311 } |
OLD | NEW |