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

Unified Diff: sync/syncable/directory.cc

Issue 10540089: Removes reference counting from syncable::Directory::Kernel as it is no longer required because syn… (Closed) Base URL: https://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/syncable/directory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/syncable/directory.cc
===================================================================
--- sync/syncable/directory.cc (revision 143339)
+++ sync/syncable/directory.cc (working copy)
@@ -147,8 +147,7 @@
const KernelLoadInfo& info, DirectoryChangeDelegate* delegate,
const browser_sync::WeakHandle<TransactionObserver>&
transaction_observer)
- : refcount(1),
- next_write_transaction_id(0),
+ : next_write_transaction_id(0),
name(name),
metahandles_index(new Directory::MetahandlesIndex),
ids_index(new Directory::IdsIndex),
@@ -167,17 +166,7 @@
DCHECK(transaction_observer.IsInitialized());
}
-void Directory::Kernel::AddRef() {
- base::subtle::NoBarrier_AtomicIncrement(&refcount, 1);
-}
-
-void Directory::Kernel::Release() {
- if (!base::subtle::NoBarrier_AtomicIncrement(&refcount, -1))
- delete this;
-}
-
Directory::Kernel::~Kernel() {
- CHECK_EQ(0, refcount);
delete unsynced_metahandles;
delete dirty_metahandles;
delete metahandles_to_purge;
@@ -288,10 +277,7 @@
delete store_;
store_ = NULL;
if (kernel_) {
- bool del = !base::subtle::NoBarrier_AtomicIncrement(&kernel_->refcount, -1);
- DCHECK(del) << "Kernel should only have a single ref";
- if (del)
- delete kernel_;
+ delete kernel_;
kernel_ = NULL;
}
}
« no previous file with comments | « sync/syncable/directory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698