| 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 sent_requests_.push(client); | 288 sent_requests_.push(client); |
| 289 } else { | 289 } else { |
| 290 client->OnPpapiChannelOpened(IPC::ChannelHandle(), 0); | 290 client->OnPpapiChannelOpened(IPC::ChannelHandle(), 0); |
| 291 } | 291 } |
| 292 } | 292 } |
| 293 | 293 |
| 294 void PpapiPluginProcessHost::OnProcessLaunched() { | 294 void PpapiPluginProcessHost::OnProcessLaunched() { |
| 295 host_impl_->set_plugin_process_handle(process_->GetHandle()); | 295 host_impl_->set_plugin_process_handle(process_->GetHandle()); |
| 296 } | 296 } |
| 297 | 297 |
| 298 void PpapiPluginProcessHost::OnProcessCrashed(int exit_code) { |
| 299 PluginServiceImpl::GetInstance()->RegisterPluginCrash(plugin_path_); |
| 300 } |
| 301 |
| 298 bool PpapiPluginProcessHost::OnMessageReceived(const IPC::Message& msg) { | 302 bool PpapiPluginProcessHost::OnMessageReceived(const IPC::Message& msg) { |
| 299 bool handled = true; | 303 bool handled = true; |
| 300 IPC_BEGIN_MESSAGE_MAP(PpapiPluginProcessHost, msg) | 304 IPC_BEGIN_MESSAGE_MAP(PpapiPluginProcessHost, msg) |
| 301 IPC_MESSAGE_HANDLER(PpapiHostMsg_ChannelCreated, | 305 IPC_MESSAGE_HANDLER(PpapiHostMsg_ChannelCreated, |
| 302 OnRendererPluginChannelCreated) | 306 OnRendererPluginChannelCreated) |
| 303 IPC_MESSAGE_UNHANDLED(handled = false) | 307 IPC_MESSAGE_UNHANDLED(handled = false) |
| 304 IPC_END_MESSAGE_MAP() | 308 IPC_END_MESSAGE_MAP() |
| 305 DCHECK(handled); | 309 DCHECK(handled); |
| 306 return handled; | 310 return handled; |
| 307 } | 311 } |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 if (sent_requests_.empty()) | 355 if (sent_requests_.empty()) |
| 352 return; | 356 return; |
| 353 | 357 |
| 354 // All requests should be processed FIFO, so the next item in the | 358 // All requests should be processed FIFO, so the next item in the |
| 355 // sent_requests_ queue should be the one that the plugin just created. | 359 // sent_requests_ queue should be the one that the plugin just created. |
| 356 Client* client = sent_requests_.front(); | 360 Client* client = sent_requests_.front(); |
| 357 sent_requests_.pop(); | 361 sent_requests_.pop(); |
| 358 | 362 |
| 359 client->OnPpapiChannelOpened(channel_handle, process_->GetData().id); | 363 client->OnPpapiChannelOpened(channel_handle, process_->GetData().id); |
| 360 } | 364 } |
| OLD | NEW |