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

Side by Side Diff: sync/syncable/directory.cc

Issue 11533008: Use delete journal to remove bookmarks that are already deleted in sync model (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "sync/syncable/directory.h" 5 #include "sync/syncable/directory.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/perftimer.h" 8 #include "base/perftimer.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 const std::string & message) { 242 const std::string & message) {
243 DCHECK(trans != NULL); 243 DCHECK(trans != NULL);
244 unrecoverable_error_set_ = true; 244 unrecoverable_error_set_ = true;
245 unrecoverable_error_handler_->OnUnrecoverableError(location, 245 unrecoverable_error_handler_->OnUnrecoverableError(location,
246 message); 246 message);
247 } 247 }
248 248
249 void Directory::UpdateDeleteJournals(BaseTransaction* trans, 249 void Directory::UpdateDeleteJournals(BaseTransaction* trans,
250 bool was_deleted, 250 bool was_deleted,
251 const EntryKernel* entry) { 251 const EntryKernel* entry) {
252 if (!IsDeleteJournalEnabledForType(entry->GetServerModelType())) 252 if (!IsDeleteJournalEnabled(entry->GetServerModelType()))
253 return; 253 return;
254 254
255 ScopedKernelLock lock(this); 255 ScopedKernelLock lock(this);
256 IdsIndex::const_iterator it = 256 IdsIndex::const_iterator it =
257 kernel_->delete_journals_->find(const_cast<EntryKernel*>(entry)); 257 kernel_->delete_journals_->find(const_cast<EntryKernel*>(entry));
258 258
259 if (entry->ref(SERVER_IS_DEL)) { 259 if (entry->ref(SERVER_IS_DEL)) {
260 if (it == kernel_->delete_journals_->end()) { 260 if (it == kernel_->delete_journals_->end()) {
261 // New delete. 261 // New delete.
262 EntryKernel* t = new EntryKernel(*entry); 262 EntryKernel* t = new EntryKernel(*entry);
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1379 return false; 1379 return false;
1380 } 1380 }
1381 } 1381 }
1382 1382
1383 ScopedKernelLock::ScopedKernelLock(const Directory* dir) 1383 ScopedKernelLock::ScopedKernelLock(const Directory* dir)
1384 : scoped_lock_(dir->kernel_->mutex), dir_(const_cast<Directory*>(dir)) { 1384 : scoped_lock_(dir->kernel_->mutex), dir_(const_cast<Directory*>(dir)) {
1385 } 1385 }
1386 1386
1387 } // namespace syncable 1387 } // namespace syncable
1388 } // namespace syncer 1388 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698