Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: ppapi/proxy/plugin_dispatcher.cc

Issue 1864293002: Convert //ppapi to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more nullptr Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ppapi/proxy/plugin_dispatcher.h ('k') | ppapi/proxy/plugin_dispatcher_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ppapi/proxy/plugin_dispatcher.h ('k') | ppapi/proxy/plugin_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698