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

Unified Diff: chrome/browser/sync/syncable/syncable.cc

Issue 8565035: sync: don't notify from ~BaseTransaction if the writer is INVALID. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove DebugQueue Created 9 years, 1 month 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 | « chrome/browser/sync/syncable/syncable.h ('k') | chrome/browser/sync/util/dbgq.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/syncable/syncable.cc
diff --git a/chrome/browser/sync/syncable/syncable.cc b/chrome/browser/sync/syncable/syncable.cc
index efeecaf94440d8411742f63c28016e9bca6a3ec6..747e6bc2a5668947aafea4ef9faefd67b3835209 100644
--- a/chrome/browser/sync/syncable/syncable.cc
+++ b/chrome/browser/sync/syncable/syncable.cc
@@ -715,10 +715,12 @@ bool Directory::SaveChanges() {
}
void Directory::VacuumAfterSaveChanges(const SaveChangesSnapshot& snapshot) {
+ if (snapshot.dirty_metas.empty())
+ return;
+
// Need a write transaction as we are about to permanently purge entries.
WriteTransaction trans(FROM_HERE, VACUUM_AFTER_SAVE, this);
ScopedKernelLock lock(this);
- kernel_->flushed_metahandles.Push(0); // Begin flush marker
// Now drop everything we can out of memory.
for (EntryKernelSet::const_iterator i = snapshot.dirty_metas.begin();
i != snapshot.dirty_metas.end(); ++i) {
@@ -731,8 +733,6 @@ void Directory::VacuumAfterSaveChanges(const SaveChangesSnapshot& snapshot) {
// We now drop deleted metahandles that are up to date on both the client
// and the server.
size_t num_erased = 0;
- int64 handle = entry->ref(META_HANDLE);
- kernel_->flushed_metahandles.Push(handle);
num_erased = kernel_->ids_index->erase(entry);
DCHECK_EQ(1u, num_erased);
num_erased = kernel_->metahandles_index->erase(entry);
@@ -1158,8 +1158,10 @@ BaseTransaction::BaseTransaction(const tracked_objects::Location& from_here,
}
BaseTransaction::~BaseTransaction() {
- dirkernel_->observers->Notify(
- &TransactionObserver::OnTransactionEnd, from_here_, writer_);
+ if (writer_ != INVALID) {
+ dirkernel_->observers->Notify(
+ &TransactionObserver::OnTransactionEnd, from_here_, writer_);
+ }
}
ReadTransaction::ReadTransaction(const tracked_objects::Location& location,
« no previous file with comments | « chrome/browser/sync/syncable/syncable.h ('k') | chrome/browser/sync/util/dbgq.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698