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 "ppapi/proxy/plugin_globals.h" | 5 #include "ppapi/proxy/plugin_globals.h" |
6 | 6 |
7 #include "ipc/ipc_message.h" | 7 #include "ipc/ipc_message.h" |
8 #include "ipc/ipc_sender.h" | 8 #include "ipc/ipc_sender.h" |
9 #include "ppapi/proxy/plugin_dispatcher.h" | 9 #include "ppapi/proxy/plugin_dispatcher.h" |
10 #include "ppapi/proxy/plugin_proxy_delegate.h" | 10 #include "ppapi/proxy/plugin_proxy_delegate.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 plugin_proxy_delegate_->PreCacheFont(logfontw); | 123 plugin_proxy_delegate_->PreCacheFont(logfontw); |
124 } | 124 } |
125 | 125 |
126 base::Lock* PluginGlobals::GetProxyLock() { | 126 base::Lock* PluginGlobals::GetProxyLock() { |
127 if (enable_threading_) | 127 if (enable_threading_) |
128 return &proxy_lock_; | 128 return &proxy_lock_; |
129 return NULL; | 129 return NULL; |
130 } | 130 } |
131 | 131 |
132 void PluginGlobals::LogWithSource(PP_Instance instance, | 132 void PluginGlobals::LogWithSource(PP_Instance instance, |
133 PP_LogLevel_Dev level, | 133 PP_LogLevel level, |
134 const std::string& source, | 134 const std::string& source, |
135 const std::string& value) { | 135 const std::string& value) { |
136 const std::string& fixed_up_source = source.empty() ? plugin_name_ : source; | 136 const std::string& fixed_up_source = source.empty() ? plugin_name_ : source; |
137 PluginDispatcher::LogWithSource(instance, level, fixed_up_source, value); | 137 PluginDispatcher::LogWithSource(instance, level, fixed_up_source, value); |
138 } | 138 } |
139 | 139 |
140 void PluginGlobals::BroadcastLogWithSource(PP_Module /* module */, | 140 void PluginGlobals::BroadcastLogWithSource(PP_Module /* module */, |
141 PP_LogLevel_Dev level, | 141 PP_LogLevel level, |
142 const std::string& source, | 142 const std::string& source, |
143 const std::string& value) { | 143 const std::string& value) { |
144 // Since we have only one module in a plugin process, broadcast is always | 144 // Since we have only one module in a plugin process, broadcast is always |
145 // the same as "send to everybody" which is what the dispatcher implements | 145 // the same as "send to everybody" which is what the dispatcher implements |
146 // for the "instance = 0" case. | 146 // for the "instance = 0" case. |
147 LogWithSource(0, level, source, value); | 147 LogWithSource(0, level, source, value); |
148 } | 148 } |
149 | 149 |
150 MessageLoopShared* PluginGlobals::GetCurrentMessageLoop() { | 150 MessageLoopShared* PluginGlobals::GetCurrentMessageLoop() { |
151 return MessageLoopResource::GetCurrent(); | 151 return MessageLoopResource::GetCurrent(); |
(...skipping 19 matching lines...) Expand all Loading... |
171 MessageLoopResource* PluginGlobals::loop_for_main_thread() { | 171 MessageLoopResource* PluginGlobals::loop_for_main_thread() { |
172 return loop_for_main_thread_.get(); | 172 return loop_for_main_thread_.get(); |
173 } | 173 } |
174 | 174 |
175 bool PluginGlobals::IsPluginGlobals() const { | 175 bool PluginGlobals::IsPluginGlobals() const { |
176 return true; | 176 return true; |
177 } | 177 } |
178 | 178 |
179 } // namespace proxy | 179 } // namespace proxy |
180 } // namespace ppapi | 180 } // namespace ppapi |
OLD | NEW |