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 #include <stddef.h> |
8 #include <windows.h> | |
9 #endif | |
10 | 8 |
11 #include <utility> | 9 #include <utility> |
12 #include <vector> | 10 #include <vector> |
13 | 11 |
14 #include "base/base_switches.h" | 12 #include "base/base_switches.h" |
15 #include "base/bind.h" | 13 #include "base/bind.h" |
16 #include "base/command_line.h" | 14 #include "base/command_line.h" |
17 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
18 #include "base/lazy_instance.h" | 16 #include "base/lazy_instance.h" |
19 #include "base/logging.h" | 17 #include "base/logging.h" |
| 18 #include "base/macros.h" |
20 #include "base/metrics/histogram.h" | 19 #include "base/metrics/histogram.h" |
21 #include "base/strings/string_number_conversions.h" | 20 #include "base/strings/string_number_conversions.h" |
22 #include "base/strings/string_util.h" | 21 #include "base/strings/string_util.h" |
23 #include "base/strings/utf_string_conversions.h" | 22 #include "base/strings/utf_string_conversions.h" |
24 #include "base/synchronization/lock.h" | 23 #include "base/synchronization/lock.h" |
| 24 #include "build/build_config.h" |
25 #include "components/tracing/tracing_switches.h" | 25 #include "components/tracing/tracing_switches.h" |
26 #include "content/browser/browser_child_process_host_impl.h" | 26 #include "content/browser/browser_child_process_host_impl.h" |
27 #include "content/browser/gpu/gpu_data_manager_impl.h" | 27 #include "content/browser/gpu/gpu_data_manager_impl.h" |
28 #include "content/browser/loader/resource_message_filter.h" | 28 #include "content/browser/loader/resource_message_filter.h" |
29 #include "content/browser/plugin_service_impl.h" | 29 #include "content/browser/plugin_service_impl.h" |
30 #include "content/common/child_process_host_impl.h" | 30 #include "content/common/child_process_host_impl.h" |
31 #include "content/common/plugin_process_messages.h" | 31 #include "content/common/plugin_process_messages.h" |
32 #include "content/common/resource_messages.h" | 32 #include "content/common/resource_messages.h" |
33 #include "content/public/browser/browser_thread.h" | 33 #include "content/public/browser/browser_thread.h" |
34 #include "content/public/browser/content_browser_client.h" | 34 #include "content/public/browser/content_browser_client.h" |
35 #include "content/public/browser/notification_types.h" | 35 #include "content/public/browser/notification_types.h" |
36 #include "content/public/browser/plugin_service.h" | 36 #include "content/public/browser/plugin_service.h" |
37 #include "content/public/browser/resource_context.h" | 37 #include "content/public/browser/resource_context.h" |
38 #include "content/public/common/content_switches.h" | 38 #include "content/public/common/content_switches.h" |
39 #include "content/public/common/process_type.h" | 39 #include "content/public/common/process_type.h" |
40 #include "content/public/common/sandboxed_process_launcher_delegate.h" | 40 #include "content/public/common/sandboxed_process_launcher_delegate.h" |
41 #include "ipc/ipc_switches.h" | 41 #include "ipc/ipc_switches.h" |
42 #include "net/url_request/url_request_context_getter.h" | 42 #include "net/url_request/url_request_context_getter.h" |
43 #include "ui/base/ui_base_switches.h" | 43 #include "ui/base/ui_base_switches.h" |
44 #include "ui/gfx/native_widget_types.h" | 44 #include "ui/gfx/native_widget_types.h" |
45 #include "ui/gfx/switches.h" | 45 #include "ui/gfx/switches.h" |
46 #include "ui/gl/gl_switches.h" | 46 #include "ui/gl/gl_switches.h" |
47 | 47 |
| 48 #if defined(OS_WIN) |
| 49 #include <windows.h> |
| 50 #endif |
| 51 |
48 #if defined(OS_MACOSX) | 52 #if defined(OS_MACOSX) |
49 #include "base/mac/mac_util.h" | 53 #include "base/mac/mac_util.h" |
50 #include "ui/gfx/geometry/rect.h" | 54 #include "ui/gfx/geometry/rect.h" |
51 #endif | 55 #endif |
52 | 56 |
53 #if defined(OS_WIN) | 57 #if defined(OS_WIN) |
54 #include "base/win/windows_version.h" | 58 #include "base/win/windows_version.h" |
55 #include "content/common/plugin_constants_win.h" | 59 #include "content/common/plugin_constants_win.h" |
56 #endif | 60 #endif |
57 | 61 |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 OnPluginHideWindow) | 295 OnPluginHideWindow) |
292 IPC_MESSAGE_HANDLER(PluginProcessHostMsg_PluginSetCursorVisibility, | 296 IPC_MESSAGE_HANDLER(PluginProcessHostMsg_PluginSetCursorVisibility, |
293 OnPluginSetCursorVisibility) | 297 OnPluginSetCursorVisibility) |
294 #endif | 298 #endif |
295 IPC_MESSAGE_UNHANDLED(handled = false) | 299 IPC_MESSAGE_UNHANDLED(handled = false) |
296 IPC_END_MESSAGE_MAP() | 300 IPC_END_MESSAGE_MAP() |
297 | 301 |
298 return handled; | 302 return handled; |
299 } | 303 } |
300 | 304 |
301 void PluginProcessHost::OnChannelConnected(int32 peer_pid) { | 305 void PluginProcessHost::OnChannelConnected(int32_t peer_pid) { |
302 for (size_t i = 0; i < pending_requests_.size(); ++i) { | 306 for (size_t i = 0; i < pending_requests_.size(); ++i) { |
303 RequestPluginChannel(pending_requests_[i]); | 307 RequestPluginChannel(pending_requests_[i]); |
304 } | 308 } |
305 | 309 |
306 pending_requests_.clear(); | 310 pending_requests_.clear(); |
307 | 311 |
308 pid_ = peer_pid; | 312 pid_ = peer_pid; |
309 { | 313 { |
310 base::AutoLock lock(g_process_webplugin_info_lock.Get()); | 314 base::AutoLock lock(g_process_webplugin_info_lock.Get()); |
311 g_process_webplugin_info.Get()[pid_] = info_; | 315 g_process_webplugin_info.Get()[pid_] = info_; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 void PluginProcessHost::GetContexts(ResourceType resource_type, | 428 void PluginProcessHost::GetContexts(ResourceType resource_type, |
425 int origin_pid, | 429 int origin_pid, |
426 ResourceContext** resource_context, | 430 ResourceContext** resource_context, |
427 net::URLRequestContext** request_context) { | 431 net::URLRequestContext** request_context) { |
428 *resource_context = | 432 *resource_context = |
429 resource_context_map_[origin_pid].resource_context; | 433 resource_context_map_[origin_pid].resource_context; |
430 *request_context = (*resource_context)->GetRequestContext(); | 434 *request_context = (*resource_context)->GetRequestContext(); |
431 } | 435 } |
432 | 436 |
433 } // namespace content | 437 } // namespace content |
OLD | NEW |