OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/revocable_store.h" | 5 #include "base/revocable_store.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 RevocableStore::Revocable::Revocable(RevocableStore* store) | 9 RevocableStore::Revocable::Revocable(RevocableStore* store) |
10 : store_reference_(store->owning_reference_) { | 10 : store_reference_(store->owning_reference_) { |
(...skipping 27 matching lines...) Expand all Loading... |
38 void RevocableStore::RevokeAll() { | 38 void RevocableStore::RevokeAll() { |
39 // We revoke all the existing items in the store and reset our count. | 39 // We revoke all the existing items in the store and reset our count. |
40 owning_reference_->set_store(NULL); | 40 owning_reference_->set_store(NULL); |
41 count_ = 0; | 41 count_ = 0; |
42 | 42 |
43 // Then we create a new owning reference for new items that get added. | 43 // Then we create a new owning reference for new items that get added. |
44 // This Release()s the old owning reference, allowing it to be freed after | 44 // This Release()s the old owning reference, allowing it to be freed after |
45 // all the items that were in the store are eventually destroyed. | 45 // all the items that were in the store are eventually destroyed. |
46 owning_reference_ = new StoreRef(this); | 46 owning_reference_ = new StoreRef(this); |
47 } | 47 } |
48 | |
OLD | NEW |