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) && !defined(USE_AURA) | 7 #if defined(OS_WIN) && !defined(USE_AURA) |
| 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 14 matching lines...) Expand all Loading... | |
| 25 #include "content/browser/browser_child_process_host_impl.h" | 25 #include "content/browser/browser_child_process_host_impl.h" |
| 26 #include "content/browser/gpu/gpu_data_manager_impl.h" | 26 #include "content/browser/gpu/gpu_data_manager_impl.h" |
| 27 #include "content/browser/plugin_service_impl.h" | 27 #include "content/browser/plugin_service_impl.h" |
| 28 #include "content/common/child_process_host_impl.h" | 28 #include "content/common/child_process_host_impl.h" |
| 29 #include "content/common/plugin_messages.h" | 29 #include "content/common/plugin_messages.h" |
| 30 #include "content/common/resource_messages.h" | 30 #include "content/common/resource_messages.h" |
| 31 #include "content/public/browser/browser_thread.h" | 31 #include "content/public/browser/browser_thread.h" |
| 32 #include "content/public/browser/content_browser_client.h" | 32 #include "content/public/browser/content_browser_client.h" |
| 33 #include "content/public/browser/notification_types.h" | 33 #include "content/public/browser/notification_types.h" |
| 34 #include "content/public/browser/plugin_service.h" | 34 #include "content/public/browser/plugin_service.h" |
| 35 #include "content/public/common/content_debug_logging.h" | |
| 35 #include "content/public/common/content_switches.h" | 36 #include "content/public/common/content_switches.h" |
| 36 #include "content/public/common/process_type.h" | 37 #include "content/public/common/process_type.h" |
| 37 #include "ipc/ipc_switches.h" | 38 #include "ipc/ipc_switches.h" |
| 38 #include "ui/base/ui_base_switches.h" | 39 #include "ui/base/ui_base_switches.h" |
| 39 #include "ui/gfx/native_widget_types.h" | 40 #include "ui/gfx/native_widget_types.h" |
| 40 #include "ui/gl/gl_switches.h" | 41 #include "ui/gl/gl_switches.h" |
| 41 | 42 |
| 42 using content::BrowserThread; | 43 using content::BrowserThread; |
| 43 using content::ChildProcessData; | 44 using content::ChildProcessData; |
| 44 using content::ChildProcessHost; | 45 using content::ChildProcessHost; |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 326 #if defined(OS_MACOSX) | 327 #if defined(OS_MACOSX) |
| 327 IPC_MESSAGE_HANDLER(PluginProcessHostMsg_PluginSelectWindow, | 328 IPC_MESSAGE_HANDLER(PluginProcessHostMsg_PluginSelectWindow, |
| 328 OnPluginSelectWindow) | 329 OnPluginSelectWindow) |
| 329 IPC_MESSAGE_HANDLER(PluginProcessHostMsg_PluginShowWindow, | 330 IPC_MESSAGE_HANDLER(PluginProcessHostMsg_PluginShowWindow, |
| 330 OnPluginShowWindow) | 331 OnPluginShowWindow) |
| 331 IPC_MESSAGE_HANDLER(PluginProcessHostMsg_PluginHideWindow, | 332 IPC_MESSAGE_HANDLER(PluginProcessHostMsg_PluginHideWindow, |
| 332 OnPluginHideWindow) | 333 OnPluginHideWindow) |
| 333 IPC_MESSAGE_HANDLER(PluginProcessHostMsg_PluginSetCursorVisibility, | 334 IPC_MESSAGE_HANDLER(PluginProcessHostMsg_PluginSetCursorVisibility, |
| 334 OnPluginSetCursorVisibility) | 335 OnPluginSetCursorVisibility) |
| 335 #endif | 336 #endif |
| 337 IPC_MESSAGE_HANDLER(PluginProcessHostMsg_RecordMsg, OnRecordMsg) | |
| 338 IPC_MESSAGE_HANDLER(PluginProcessHostMsg_GetMessages, OnGetMessages) | |
| 336 IPC_MESSAGE_UNHANDLED(handled = false) | 339 IPC_MESSAGE_UNHANDLED(handled = false) |
| 337 IPC_END_MESSAGE_MAP() | 340 IPC_END_MESSAGE_MAP() |
| 338 | 341 |
| 339 DCHECK(handled); | 342 DCHECK(handled); |
| 340 return handled; | 343 return handled; |
| 341 } | 344 } |
| 342 | 345 |
| 343 void PluginProcessHost::OnChannelConnected(int32 peer_pid) { | 346 void PluginProcessHost::OnChannelConnected(int32 peer_pid) { |
| 344 for (size_t i = 0; i < pending_requests_.size(); ++i) { | 347 for (size_t i = 0; i < pending_requests_.size(); ++i) { |
| 345 RequestPluginChannel(pending_requests_[i]); | 348 RequestPluginChannel(pending_requests_[i]); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 447 } | 450 } |
| 448 | 451 |
| 449 void PluginProcessHost::OnChannelCreated( | 452 void PluginProcessHost::OnChannelCreated( |
| 450 const IPC::ChannelHandle& channel_handle) { | 453 const IPC::ChannelHandle& channel_handle) { |
| 451 Client* client = sent_requests_.front(); | 454 Client* client = sent_requests_.front(); |
| 452 | 455 |
| 453 if (client) | 456 if (client) |
| 454 client->OnChannelOpened(channel_handle); | 457 client->OnChannelOpened(channel_handle); |
| 455 sent_requests_.pop_front(); | 458 sent_requests_.pop_front(); |
| 456 } | 459 } |
| 460 | |
| 461 // TODO(shess): Could this be annotated WRT the sending plugin? | |
| 462 void PluginProcessHost::OnRecordMsg(int bug_id, const std::string& msg) { | |
| 463 content::debug::RecordMsg(bug_id, msg); | |
| 464 } | |
| 465 | |
| 466 void PluginProcessHost::OnGetMessages(int bug_id, | |
| 467 std::vector<std::string>* msgs) { | |
| 468 if (!content::debug::GetMessages(bug_id, msgs)) | |
|
Bernhard Bauer
2012/09/05 15:04:55
Doesn't GetMessages() return false if the out vect
Scott Hess - ex-Googler
2012/09/05 17:17:05
GetMessages() returns false if there is no handler
| |
| 469 msgs->clear(); | |
| 470 } | |
| OLD | NEW |