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/ppapi_plugin/ppapi_thread.h" | 5 #include "content/ppapi_plugin/ppapi_thread.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 : is_broker_(is_broker), | 82 : is_broker_(is_broker), |
83 connect_instance_func_(NULL), | 83 connect_instance_func_(NULL), |
84 local_pp_module_( | 84 local_pp_module_( |
85 base::RandInt(0, std::numeric_limits<PP_Module>::max())), | 85 base::RandInt(0, std::numeric_limits<PP_Module>::max())), |
86 next_plugin_dispatcher_id_(1), | 86 next_plugin_dispatcher_id_(1), |
87 ALLOW_THIS_IN_INITIALIZER_LIST(dispatcher_message_listener_(this)) { | 87 ALLOW_THIS_IN_INITIALIZER_LIST(dispatcher_message_listener_(this)) { |
88 ppapi::proxy::PluginGlobals* globals = ppapi::proxy::PluginGlobals::Get(); | 88 ppapi::proxy::PluginGlobals* globals = ppapi::proxy::PluginGlobals::Get(); |
89 globals->set_plugin_proxy_delegate(this); | 89 globals->set_plugin_proxy_delegate(this); |
90 globals->set_command_line( | 90 globals->set_command_line( |
91 command_line.GetSwitchValueASCII(switches::kPpapiFlashArgs)); | 91 command_line.GetSwitchValueASCII(switches::kPpapiFlashArgs)); |
92 if (command_line.HasSwitch(switches::kDisablePepperThreading)) { | 92 globals->set_enable_threading( |
93 globals->set_enable_threading(false); | 93 !command_line.HasSwitch(switches::kDisablePepperThreading)); |
94 } else if (command_line.HasSwitch(switches::kEnablePepperThreading)) { | |
95 globals->set_enable_threading(true); | |
96 } else { | |
97 globals->set_enable_threading(false); | |
98 } | |
99 | 94 |
100 webkit_platform_support_.reset(new PpapiWebKitPlatformSupportImpl); | 95 webkit_platform_support_.reset(new PpapiWebKitPlatformSupportImpl); |
101 WebKit::initialize(webkit_platform_support_.get()); | 96 WebKit::initialize(webkit_platform_support_.get()); |
102 | 97 |
103 // Register interfaces that expect messages from the browser process. Please | 98 // Register interfaces that expect messages from the browser process. Please |
104 // note that only those InterfaceProxy-based ones require registration. | 99 // note that only those InterfaceProxy-based ones require registration. |
105 AddRoute(ppapi::API_ID_PPB_TCPSERVERSOCKET_PRIVATE, | 100 AddRoute(ppapi::API_ID_PPB_TCPSERVERSOCKET_PRIVATE, |
106 &dispatcher_message_listener_); | 101 &dispatcher_message_listener_); |
107 AddRoute(ppapi::API_ID_PPB_TCPSOCKET_PRIVATE, | 102 AddRoute(ppapi::API_ID_PPB_TCPSOCKET_PRIVATE, |
108 &dispatcher_message_listener_); | 103 &dispatcher_message_listener_); |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 | 440 |
446 // plugin() is NULL when in-process. Which is fine, because this is | 441 // plugin() is NULL when in-process. Which is fine, because this is |
447 // just a hook for setting the process name. | 442 // just a hook for setting the process name. |
448 if (GetContentClient()->plugin()) { | 443 if (GetContentClient()->plugin()) { |
449 GetContentClient()->plugin()->PluginProcessStarted( | 444 GetContentClient()->plugin()->PluginProcessStarted( |
450 path.BaseName().RemoveExtension().LossyDisplayName()); | 445 path.BaseName().RemoveExtension().LossyDisplayName()); |
451 } | 446 } |
452 } | 447 } |
453 | 448 |
454 } // namespace content | 449 } // namespace content |
OLD | NEW |