| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 HostDispatcher::~HostDispatcher() { | 88 HostDispatcher::~HostDispatcher() { |
| 89 g_module_to_dispatcher->erase(pp_module_); | 89 g_module_to_dispatcher->erase(pp_module_); |
| 90 } | 90 } |
| 91 | 91 |
| 92 bool HostDispatcher::InitHostWithChannel( | 92 bool HostDispatcher::InitHostWithChannel( |
| 93 Delegate* delegate, | 93 Delegate* delegate, |
| 94 const IPC::ChannelHandle& channel_handle, | 94 const IPC::ChannelHandle& channel_handle, |
| 95 bool is_client) { | 95 bool is_client) { |
| 96 if (!Dispatcher::InitWithChannel(delegate, channel_handle, is_client)) | 96 if (!Dispatcher::InitWithChannel(delegate, channel_handle, is_client)) |
| 97 return false; | 97 return false; |
| 98 SetDelegate(delegate); | |
| 99 return true; | 98 return true; |
| 100 } | 99 } |
| 101 | 100 |
| 102 // static | 101 // static |
| 103 HostDispatcher* HostDispatcher::GetForInstance(PP_Instance instance) { | 102 HostDispatcher* HostDispatcher::GetForInstance(PP_Instance instance) { |
| 104 if (!g_instance_to_dispatcher) | 103 if (!g_instance_to_dispatcher) |
| 105 return NULL; | 104 return NULL; |
| 106 InstanceToDispatcherMap::iterator found = g_instance_to_dispatcher->find( | 105 InstanceToDispatcherMap::iterator found = g_instance_to_dispatcher->find( |
| 107 instance); | 106 instance); |
| 108 if (found == g_instance_to_dispatcher->end()) | 107 if (found == g_instance_to_dispatcher->end()) |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 dispatcher_->ppb_proxy()->AddRefModule(dispatcher_->pp_module()); | 268 dispatcher_->ppb_proxy()->AddRefModule(dispatcher_->pp_module()); |
| 270 } | 269 } |
| 271 | 270 |
| 272 ScopedModuleReference::~ScopedModuleReference() { | 271 ScopedModuleReference::~ScopedModuleReference() { |
| 273 dispatcher_->ppb_proxy()->ReleaseModule(dispatcher_->pp_module()); | 272 dispatcher_->ppb_proxy()->ReleaseModule(dispatcher_->pp_module()); |
| 274 } | 273 } |
| 275 | 274 |
| 276 } // namespace proxy | 275 } // namespace proxy |
| 277 } // namespace pp | 276 } // namespace pp |
| 278 | 277 |
| OLD | NEW |