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/host_dispatcher.h" | 5 #include "ppapi/proxy/host_dispatcher.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "ppapi/c/private/ppb_proxy_private.h" | 9 #include "ppapi/c/private/ppb_proxy_private.h" |
10 #include "ppapi/c/ppb_var.h" | 10 #include "ppapi/c/ppb_var.h" |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 | 240 |
241 void HostDispatcher::OnInvalidMessageReceived() { | 241 void HostDispatcher::OnInvalidMessageReceived() { |
242 // TODO(brettw) bug 95345 kill the plugin when an invalid message is | 242 // TODO(brettw) bug 95345 kill the plugin when an invalid message is |
243 // received. | 243 // received. |
244 } | 244 } |
245 | 245 |
246 void HostDispatcher::OnHostMsgLogWithSource(PP_Instance instance, | 246 void HostDispatcher::OnHostMsgLogWithSource(PP_Instance instance, |
247 int int_log_level, | 247 int int_log_level, |
248 const std::string& source, | 248 const std::string& source, |
249 const std::string& value) { | 249 const std::string& value) { |
250 PP_LogLevel_Dev level = static_cast<PP_LogLevel_Dev>(int_log_level); | 250 PP_LogLevel level = static_cast<PP_LogLevel>(int_log_level); |
251 if (instance) { | 251 if (instance) { |
252 PpapiGlobals::Get()->LogWithSource(instance, level, source, value); | 252 PpapiGlobals::Get()->LogWithSource(instance, level, source, value); |
253 } else { | 253 } else { |
254 PpapiGlobals::Get()->BroadcastLogWithSource(pp_module_, level, | 254 PpapiGlobals::Get()->BroadcastLogWithSource(pp_module_, level, |
255 source, value); | 255 source, value); |
256 } | 256 } |
257 } | 257 } |
258 | 258 |
259 // ScopedModuleReference ------------------------------------------------------- | 259 // ScopedModuleReference ------------------------------------------------------- |
260 | 260 |
261 ScopedModuleReference::ScopedModuleReference(Dispatcher* dispatcher) | 261 ScopedModuleReference::ScopedModuleReference(Dispatcher* dispatcher) |
262 : dispatcher_(NULL) { | 262 : dispatcher_(NULL) { |
263 if (!dispatcher->IsPlugin()) { | 263 if (!dispatcher->IsPlugin()) { |
264 dispatcher_ = static_cast<HostDispatcher*>(dispatcher); | 264 dispatcher_ = static_cast<HostDispatcher*>(dispatcher); |
265 dispatcher_->ppb_proxy()->AddRefModule(dispatcher_->pp_module()); | 265 dispatcher_->ppb_proxy()->AddRefModule(dispatcher_->pp_module()); |
266 } | 266 } |
267 } | 267 } |
268 | 268 |
269 ScopedModuleReference::~ScopedModuleReference() { | 269 ScopedModuleReference::~ScopedModuleReference() { |
270 if (dispatcher_) | 270 if (dispatcher_) |
271 dispatcher_->ppb_proxy()->ReleaseModule(dispatcher_->pp_module()); | 271 dispatcher_->ppb_proxy()->ReleaseModule(dispatcher_->pp_module()); |
272 } | 272 } |
273 | 273 |
274 } // namespace proxy | 274 } // namespace proxy |
275 } // namespace ppapi | 275 } // namespace ppapi |
OLD | NEW |