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

Side by Side Diff: ppapi/shared_impl/resource_tracker.cc

Issue 1649623002: Update ppapi to not use linked_ptr or ScopedVector (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mark RawVarDataGraph as DISALLOW_COPY_AND_ASSIGN Created 4 years, 10 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/shared_impl/resource_tracker.h ('k') | ppapi/thunk/ppb_file_ref_api.h » ('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/shared_impl/resource_tracker.h" 5 #include "ppapi/shared_impl/resource_tracker.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "ppapi/shared_impl/callback_tracker.h" 10 #include "ppapi/shared_impl/callback_tracker.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 } 89 }
90 } 90 }
91 91
92 void ResourceTracker::DidCreateInstance(PP_Instance instance) { 92 void ResourceTracker::DidCreateInstance(PP_Instance instance) {
93 CheckThreadingPreconditions(); 93 CheckThreadingPreconditions();
94 // Due to the infrastructure of some tests, the instance is registered 94 // Due to the infrastructure of some tests, the instance is registered
95 // twice in a few cases. It would be nice not to do that and assert here 95 // twice in a few cases. It would be nice not to do that and assert here
96 // instead. 96 // instead.
97 if (instance_map_.find(instance) != instance_map_.end()) 97 if (instance_map_.find(instance) != instance_map_.end())
98 return; 98 return;
99 instance_map_[instance] = linked_ptr<InstanceData>(new InstanceData); 99 instance_map_[instance] = make_scoped_ptr(new InstanceData);
100 } 100 }
101 101
102 void ResourceTracker::DidDeleteInstance(PP_Instance instance) { 102 void ResourceTracker::DidDeleteInstance(PP_Instance instance) {
103 CheckThreadingPreconditions(); 103 CheckThreadingPreconditions();
104 InstanceMap::iterator found_instance = instance_map_.find(instance); 104 InstanceMap::iterator found_instance = instance_map_.find(instance);
105 105
106 // Due to the infrastructure of some tests, the instance is unregistered 106 // Due to the infrastructure of some tests, the instance is unregistered
107 // twice in a few cases. It would be nice not to do that and assert here 107 // twice in a few cases. It would be nice not to do that and assert here
108 // instead. 108 // instead.
109 if (found_instance == instance_map_.end()) 109 if (found_instance == instance_map_.end())
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 if (res == 0) 253 if (res == 0)
254 return true; 254 return true;
255 255
256 // Skipping the type bits, the least significant bit of |res| should be the 256 // Skipping the type bits, the least significant bit of |res| should be the
257 // same as that of |last_resource_value_|. 257 // same as that of |last_resource_value_|.
258 return ((res >> kPPIdTypeBits) & 1) == (last_resource_value_ & 1); 258 return ((res >> kPPIdTypeBits) & 1) == (last_resource_value_ & 1);
259 #endif 259 #endif
260 } 260 }
261 261
262 } // namespace ppapi 262 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/shared_impl/resource_tracker.h ('k') | ppapi/thunk/ppb_file_ref_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698