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_dispatcher.h" | 5 #include "ppapi/proxy/plugin_dispatcher.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 // associated with it are no longer valid. | 259 // associated with it are no longer valid. |
260 ForceFreeAllInstances(); | 260 ForceFreeAllInstances(); |
261 // TODO(brettw) free resources too! | 261 // TODO(brettw) free resources too! |
262 delete this; | 262 delete this; |
263 } | 263 } |
264 | 264 |
265 void PluginDispatcher::DidCreateInstance(PP_Instance instance) { | 265 void PluginDispatcher::DidCreateInstance(PP_Instance instance) { |
266 if (!g_instance_to_dispatcher) | 266 if (!g_instance_to_dispatcher) |
267 g_instance_to_dispatcher = new InstanceToDispatcherMap; | 267 g_instance_to_dispatcher = new InstanceToDispatcherMap; |
268 (*g_instance_to_dispatcher)[instance] = this; | 268 (*g_instance_to_dispatcher)[instance] = this; |
269 instance_map_.set(instance, scoped_ptr<InstanceData>(new InstanceData())); | 269 instance_map_.set(instance, |
| 270 std::unique_ptr<InstanceData>(new InstanceData())); |
270 } | 271 } |
271 | 272 |
272 void PluginDispatcher::DidDestroyInstance(PP_Instance instance) { | 273 void PluginDispatcher::DidDestroyInstance(PP_Instance instance) { |
273 instance_map_.erase(instance); | 274 instance_map_.erase(instance); |
274 | 275 |
275 if (g_instance_to_dispatcher) { | 276 if (g_instance_to_dispatcher) { |
276 InstanceToDispatcherMap::iterator found = g_instance_to_dispatcher->find( | 277 InstanceToDispatcherMap::iterator found = g_instance_to_dispatcher->find( |
277 instance); | 278 instance); |
278 if (found != g_instance_to_dispatcher->end()) { | 279 if (found != g_instance_to_dispatcher->end()) { |
279 DCHECK(found->second == this); | 280 DCHECK(found->second == this); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 // once they're set. The user will have to restart to get new font prefs | 340 // once they're set. The user will have to restart to get new font prefs |
340 // propogated to plugins. | 341 // propogated to plugins. |
341 if (!received_preferences_) { | 342 if (!received_preferences_) { |
342 received_preferences_ = true; | 343 received_preferences_ = true; |
343 preferences_ = prefs; | 344 preferences_ = prefs; |
344 } | 345 } |
345 } | 346 } |
346 | 347 |
347 } // namespace proxy | 348 } // namespace proxy |
348 } // namespace ppapi | 349 } // namespace ppapi |
OLD | NEW |