| OLD | NEW |
| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 } | 148 } |
| 149 | 149 |
| 150 void VarTracker::ObjectGettingZeroRef(VarMap::iterator iter) { | 150 void VarTracker::ObjectGettingZeroRef(VarMap::iterator iter) { |
| 151 DeleteObjectInfoIfNecessary(iter); | 151 DeleteObjectInfoIfNecessary(iter); |
| 152 } | 152 } |
| 153 | 153 |
| 154 bool VarTracker::DeleteObjectInfoIfNecessary(VarMap::iterator iter) { | 154 bool VarTracker::DeleteObjectInfoIfNecessary(VarMap::iterator iter) { |
| 155 if (iter->second.ref_count != 0 || | 155 if (iter->second.ref_count != 0 || |
| 156 iter->second.track_with_no_reference_count != 0) | 156 iter->second.track_with_no_reference_count != 0) |
| 157 return false; // Object still alive. | 157 return false; // Object still alive. |
| 158 iter->second.var->ResetVarID(); |
| 158 live_vars_.erase(iter); | 159 live_vars_.erase(iter); |
| 159 return true; | 160 return true; |
| 160 } | 161 } |
| 161 | 162 |
| 162 } // namespace ppapi | 163 } // namespace ppapi |
| OLD | NEW |