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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 } | 69 } |
70 | 70 |
71 PluginGlobals::~PluginGlobals() { | 71 PluginGlobals::~PluginGlobals() { |
72 DCHECK(plugin_globals_ == this || !plugin_globals_); | 72 DCHECK(plugin_globals_ == this || !plugin_globals_); |
73 { | 73 { |
74 ProxyAutoLock lock; | 74 ProxyAutoLock lock; |
75 // Release the main-thread message loop. We should have the last reference | 75 // Release the main-thread message loop. We should have the last reference |
76 // count, so this will delete the MessageLoop resource. We do this before | 76 // count, so this will delete the MessageLoop resource. We do this before |
77 // we clear plugin_globals_, because the Resource destructor tries to access | 77 // we clear plugin_globals_, because the Resource destructor tries to access |
78 // this PluginGlobals. | 78 // this PluginGlobals. |
79 DCHECK(!loop_for_main_thread_ || loop_for_main_thread_->HasOneRef()); | 79 DCHECK(!loop_for_main_thread_.get() || loop_for_main_thread_->HasOneRef()); |
80 loop_for_main_thread_ = NULL; | 80 loop_for_main_thread_ = NULL; |
81 } | 81 } |
82 plugin_globals_ = NULL; | 82 plugin_globals_ = NULL; |
83 } | 83 } |
84 | 84 |
85 ResourceTracker* PluginGlobals::GetResourceTracker() { | 85 ResourceTracker* PluginGlobals::GetResourceTracker() { |
86 return &plugin_resource_tracker_; | 86 return &plugin_resource_tracker_; |
87 } | 87 } |
88 | 88 |
89 VarTracker* PluginGlobals::GetVarTracker() { | 89 VarTracker* PluginGlobals::GetVarTracker() { |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 MessageLoopResource* PluginGlobals::loop_for_main_thread() { | 172 MessageLoopResource* PluginGlobals::loop_for_main_thread() { |
173 return loop_for_main_thread_.get(); | 173 return loop_for_main_thread_.get(); |
174 } | 174 } |
175 | 175 |
176 bool PluginGlobals::IsPluginGlobals() const { | 176 bool PluginGlobals::IsPluginGlobals() const { |
177 return true; | 177 return true; |
178 } | 178 } |
179 | 179 |
180 } // namespace proxy | 180 } // namespace proxy |
181 } // namespace ppapi | 181 } // namespace ppapi |
OLD | NEW |