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/var_tracker.cc

Issue 8953017: Pepper: unit tests for VarTracker (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove MockObjectVar::GetPPVar() Created 9 years 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 | Annotate | Revision Log
« no previous file with comments | « ppapi/ppapi_tests.gypi ('k') | ppapi/shared_impl/var_tracker_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) 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/shared_impl/var_tracker.h" 5 #include "ppapi/shared_impl/var_tracker.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ppapi/shared_impl/id_assignment.h" 10 #include "ppapi/shared_impl/id_assignment.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 } 155 }
156 156
157 void VarTracker::ObjectGettingZeroRef(VarMap::iterator iter) { 157 void VarTracker::ObjectGettingZeroRef(VarMap::iterator iter) {
158 DeleteObjectInfoIfNecessary(iter); 158 DeleteObjectInfoIfNecessary(iter);
159 } 159 }
160 160
161 bool VarTracker::DeleteObjectInfoIfNecessary(VarMap::iterator iter) { 161 bool VarTracker::DeleteObjectInfoIfNecessary(VarMap::iterator iter) {
162 if (iter->second.ref_count != 0 || 162 if (iter->second.ref_count != 0 ||
163 iter->second.track_with_no_reference_count != 0) 163 iter->second.track_with_no_reference_count != 0)
164 return false; // Object still alive. 164 return false; // Object still alive.
165 iter->second.var->ResetVarID();
165 live_vars_.erase(iter); 166 live_vars_.erase(iter);
166 return true; 167 return true;
167 } 168 }
168 169
169 } // namespace ppapi 170 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/ppapi_tests.gypi ('k') | ppapi/shared_impl/var_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698