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/shared_impl/var_tracker.h" | 5 #include "ppapi/shared_impl/var_tracker.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/shared_memory.h" | 12 #include "base/memory/shared_memory.h" |
13 #include "ppapi/shared_impl/host_resource.h" | 13 #include "ppapi/shared_impl/host_resource.h" |
14 #include "ppapi/shared_impl/id_assignment.h" | 14 #include "ppapi/shared_impl/id_assignment.h" |
15 #include "ppapi/shared_impl/proxy_lock.h" | 15 #include "ppapi/shared_impl/proxy_lock.h" |
16 #include "ppapi/shared_impl/var.h" | 16 #include "ppapi/shared_impl/var.h" |
17 | 17 |
18 namespace ppapi { | 18 namespace ppapi { |
19 | 19 |
20 VarTracker::VarInfo::VarInfo() | 20 VarTracker::VarInfo::VarInfo() |
21 : var(), | 21 : var(), |
22 ref_count(0), | 22 ref_count(0), |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 bool VarTracker::DeleteObjectInfoIfNecessary(VarMap::iterator iter) { | 259 bool VarTracker::DeleteObjectInfoIfNecessary(VarMap::iterator iter) { |
260 if (iter->second.ref_count != 0 || | 260 if (iter->second.ref_count != 0 || |
261 iter->second.track_with_no_reference_count != 0) | 261 iter->second.track_with_no_reference_count != 0) |
262 return false; // Object still alive. | 262 return false; // Object still alive. |
263 iter->second.var->ResetVarID(); | 263 iter->second.var->ResetVarID(); |
264 live_vars_.erase(iter); | 264 live_vars_.erase(iter); |
265 return true; | 265 return true; |
266 } | 266 } |
267 | 267 |
268 } // namespace ppapi | 268 } // namespace ppapi |
OLD | NEW |