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/debug/crash_logging.h" | 10 #include "base/debug/crash_logging.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 local_pp_module_( | 90 local_pp_module_( |
91 base::RandInt(0, std::numeric_limits<PP_Module>::max())), | 91 base::RandInt(0, std::numeric_limits<PP_Module>::max())), |
92 next_plugin_dispatcher_id_(1), | 92 next_plugin_dispatcher_id_(1), |
93 dispatcher_message_listener_(this) { | 93 dispatcher_message_listener_(this) { |
94 ppapi::proxy::PluginGlobals* globals = ppapi::proxy::PluginGlobals::Get(); | 94 ppapi::proxy::PluginGlobals* globals = ppapi::proxy::PluginGlobals::Get(); |
95 globals->set_plugin_proxy_delegate(this); | 95 globals->set_plugin_proxy_delegate(this); |
96 globals->set_command_line( | 96 globals->set_command_line( |
97 command_line.GetSwitchValueASCII(switches::kPpapiFlashArgs)); | 97 command_line.GetSwitchValueASCII(switches::kPpapiFlashArgs)); |
98 | 98 |
99 webkit_platform_support_.reset(new PpapiWebKitPlatformSupportImpl); | 99 webkit_platform_support_.reset(new PpapiWebKitPlatformSupportImpl); |
100 WebKit::initialize(webkit_platform_support_.get()); | 100 blink::initialize(webkit_platform_support_.get()); |
101 | 101 |
102 // Register interfaces that expect messages from the browser process. Please | 102 // Register interfaces that expect messages from the browser process. Please |
103 // note that only those InterfaceProxy-based ones require registration. | 103 // note that only those InterfaceProxy-based ones require registration. |
104 AddRoute(ppapi::API_ID_PPB_HOSTRESOLVER_PRIVATE, | 104 AddRoute(ppapi::API_ID_PPB_HOSTRESOLVER_PRIVATE, |
105 &dispatcher_message_listener_); | 105 &dispatcher_message_listener_); |
106 } | 106 } |
107 | 107 |
108 PpapiThread::~PpapiThread() { | 108 PpapiThread::~PpapiThread() { |
109 } | 109 } |
110 | 110 |
111 void PpapiThread::Shutdown() { | 111 void PpapiThread::Shutdown() { |
112 ppapi::proxy::PluginGlobals::Get()->set_plugin_proxy_delegate(NULL); | 112 ppapi::proxy::PluginGlobals::Get()->set_plugin_proxy_delegate(NULL); |
113 if (plugin_entry_points_.shutdown_module) | 113 if (plugin_entry_points_.shutdown_module) |
114 plugin_entry_points_.shutdown_module(); | 114 plugin_entry_points_.shutdown_module(); |
115 WebKit::shutdown(); | 115 blink::shutdown(); |
116 } | 116 } |
117 | 117 |
118 bool PpapiThread::Send(IPC::Message* msg) { | 118 bool PpapiThread::Send(IPC::Message* msg) { |
119 // Allow access from multiple threads. | 119 // Allow access from multiple threads. |
120 if (base::MessageLoop::current() == message_loop()) | 120 if (base::MessageLoop::current() == message_loop()) |
121 return ChildThread::Send(msg); | 121 return ChildThread::Send(msg); |
122 | 122 |
123 return sync_message_filter()->Send(msg); | 123 return sync_message_filter()->Send(msg); |
124 } | 124 } |
125 | 125 |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 histogram_name.str(), | 495 histogram_name.str(), |
496 1, | 496 1, |
497 LOAD_RESULT_MAX, | 497 LOAD_RESULT_MAX, |
498 LOAD_RESULT_MAX + 1, | 498 LOAD_RESULT_MAX + 1, |
499 base::HistogramBase::kUmaTargetedHistogramFlag); | 499 base::HistogramBase::kUmaTargetedHistogramFlag); |
500 | 500 |
501 histogram->Add(result); | 501 histogram->Add(result); |
502 } | 502 } |
503 | 503 |
504 } // namespace content | 504 } // namespace content |
OLD | NEW |