| 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" | |
| 36 #include "content/public/common/content_switches.h" | 35 #include "content/public/common/content_switches.h" |
| 37 #include "content/public/common/process_type.h" | 36 #include "content/public/common/process_type.h" |
| 38 #include "ipc/ipc_switches.h" | 37 #include "ipc/ipc_switches.h" |
| 39 #include "ui/base/ui_base_switches.h" | 38 #include "ui/base/ui_base_switches.h" |
| 40 #include "ui/gfx/native_widget_types.h" | 39 #include "ui/gfx/native_widget_types.h" |
| 41 #include "ui/gl/gl_switches.h" | 40 #include "ui/gl/gl_switches.h" |
| 42 | 41 |
| 43 using content::BrowserThread; | 42 using content::BrowserThread; |
| 44 using content::ChildProcessData; | 43 using content::ChildProcessData; |
| 45 using content::ChildProcessHost; | 44 using content::ChildProcessHost; |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 #if defined(OS_MACOSX) | 326 #if defined(OS_MACOSX) |
| 328 IPC_MESSAGE_HANDLER(PluginProcessHostMsg_PluginSelectWindow, | 327 IPC_MESSAGE_HANDLER(PluginProcessHostMsg_PluginSelectWindow, |
| 329 OnPluginSelectWindow) | 328 OnPluginSelectWindow) |
| 330 IPC_MESSAGE_HANDLER(PluginProcessHostMsg_PluginShowWindow, | 329 IPC_MESSAGE_HANDLER(PluginProcessHostMsg_PluginShowWindow, |
| 331 OnPluginShowWindow) | 330 OnPluginShowWindow) |
| 332 IPC_MESSAGE_HANDLER(PluginProcessHostMsg_PluginHideWindow, | 331 IPC_MESSAGE_HANDLER(PluginProcessHostMsg_PluginHideWindow, |
| 333 OnPluginHideWindow) | 332 OnPluginHideWindow) |
| 334 IPC_MESSAGE_HANDLER(PluginProcessHostMsg_PluginSetCursorVisibility, | 333 IPC_MESSAGE_HANDLER(PluginProcessHostMsg_PluginSetCursorVisibility, |
| 335 OnPluginSetCursorVisibility) | 334 OnPluginSetCursorVisibility) |
| 336 #endif | 335 #endif |
| 337 IPC_MESSAGE_HANDLER(PluginProcessHostMsg_ContentDebugRecordMsg, | |
| 338 OnContentDebugRecordMsg) | |
| 339 IPC_MESSAGE_HANDLER(PluginProcessHostMsg_ContentDebugGetMessages, | |
| 340 OnContentDebugGetMessages) | |
| 341 IPC_MESSAGE_UNHANDLED(handled = false) | 336 IPC_MESSAGE_UNHANDLED(handled = false) |
| 342 IPC_END_MESSAGE_MAP() | 337 IPC_END_MESSAGE_MAP() |
| 343 | 338 |
| 344 DCHECK(handled); | 339 DCHECK(handled); |
| 345 return handled; | 340 return handled; |
| 346 } | 341 } |
| 347 | 342 |
| 348 void PluginProcessHost::OnChannelConnected(int32 peer_pid) { | 343 void PluginProcessHost::OnChannelConnected(int32 peer_pid) { |
| 349 for (size_t i = 0; i < pending_requests_.size(); ++i) { | 344 for (size_t i = 0; i < pending_requests_.size(); ++i) { |
| 350 RequestPluginChannel(pending_requests_[i]); | 345 RequestPluginChannel(pending_requests_[i]); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 } | 447 } |
| 453 | 448 |
| 454 void PluginProcessHost::OnChannelCreated( | 449 void PluginProcessHost::OnChannelCreated( |
| 455 const IPC::ChannelHandle& channel_handle) { | 450 const IPC::ChannelHandle& channel_handle) { |
| 456 Client* client = sent_requests_.front(); | 451 Client* client = sent_requests_.front(); |
| 457 | 452 |
| 458 if (client) | 453 if (client) |
| 459 client->OnChannelOpened(channel_handle); | 454 client->OnChannelOpened(channel_handle); |
| 460 sent_requests_.pop_front(); | 455 sent_requests_.pop_front(); |
| 461 } | 456 } |
| 462 | |
| 463 // TODO(shess): Could this be annotated WRT the sending plugin? | |
| 464 void PluginProcessHost::OnContentDebugRecordMsg(int bug_id, | |
| 465 const std::string& msg) { | |
| 466 content::debug::RecordMsg(bug_id, msg); | |
| 467 } | |
| 468 | |
| 469 void PluginProcessHost::OnContentDebugGetMessages( | |
| 470 int bug_id, bool* handled, std::vector<std::string>* msgs) { | |
| 471 *handled = content::debug::GetMessages(bug_id, msgs); | |
| 472 } | |
| OLD | NEW |