Chromium Code Reviews| 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/plugin_process_host.h" | 5 #include "content/browser/plugin_process_host.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #elif defined(OS_POSIX) | 9 #elif defined(OS_POSIX) |
| 10 #include <utility> // for pair<> | 10 #include <utility> // for pair<> |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 303 | 303 |
| 304 void PluginProcessHost::OnChannelError() { | 304 void PluginProcessHost::OnChannelError() { |
| 305 CancelRequests(); | 305 CancelRequests(); |
| 306 } | 306 } |
| 307 | 307 |
| 308 bool PluginProcessHost::CanShutdown() { | 308 bool PluginProcessHost::CanShutdown() { |
| 309 return sent_requests_.empty(); | 309 return sent_requests_.empty(); |
| 310 } | 310 } |
| 311 | 311 |
| 312 void PluginProcessHost::OnProcessCrashed(int exit_code) { | 312 void PluginProcessHost::OnProcessCrashed(int exit_code) { |
| 313 #if defined(ENABLE_PLUGINS) | |
|
jam
2012/12/19 01:55:15
why is this file included if no plugins?
nilesh
2012/12/19 21:07:44
Removed.
| |
| 313 PluginServiceImpl::GetInstance()->RegisterPluginCrash(info_.path); | 314 PluginServiceImpl::GetInstance()->RegisterPluginCrash(info_.path); |
| 315 #endif | |
| 314 } | 316 } |
| 315 | 317 |
| 316 void PluginProcessHost::CancelRequests() { | 318 void PluginProcessHost::CancelRequests() { |
| 317 for (size_t i = 0; i < pending_requests_.size(); ++i) | 319 for (size_t i = 0; i < pending_requests_.size(); ++i) |
| 318 pending_requests_[i]->OnError(); | 320 pending_requests_[i]->OnError(); |
| 319 pending_requests_.clear(); | 321 pending_requests_.clear(); |
| 320 | 322 |
| 321 while (!sent_requests_.empty()) { | 323 while (!sent_requests_.empty()) { |
| 322 Client* client = sent_requests_.front(); | 324 Client* client = sent_requests_.front(); |
| 323 if (client) | 325 if (client) |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 402 void PluginProcessHost::OnChannelCreated( | 404 void PluginProcessHost::OnChannelCreated( |
| 403 const IPC::ChannelHandle& channel_handle) { | 405 const IPC::ChannelHandle& channel_handle) { |
| 404 Client* client = sent_requests_.front(); | 406 Client* client = sent_requests_.front(); |
| 405 | 407 |
| 406 if (client) | 408 if (client) |
| 407 client->OnChannelOpened(channel_handle); | 409 client->OnChannelOpened(channel_handle); |
| 408 sent_requests_.pop_front(); | 410 sent_requests_.pop_front(); |
| 409 } | 411 } |
| 410 | 412 |
| 411 } // namespace content | 413 } // namespace content |
| OLD | NEW |