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

Side by Side Diff: chrome/browser/sync/syncable/syncable.cc

Issue 6142009: Upating the app, ceee, chrome, ipc, media, and net directories to use the correct lock.h file. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Unified patch updating all references to the new base/synchronization/lock.h Created 9 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/sync/syncable/syncable.h ('k') | chrome/browser/sync/util/channel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/sync/syncable/syncable.h" 5 #include "chrome/browser/sync/syncable/syncable.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #include <sys/stat.h> 9 #include <sys/stat.h>
10 #if defined(OS_POSIX) 10 #if defined(OS_POSIX)
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 snapshot->kernel_info.next_id -= 65536; 571 snapshot->kernel_info.next_id -= 65536;
572 snapshot->kernel_info_status = kernel_->info_status; 572 snapshot->kernel_info_status = kernel_->info_status;
573 // This one we reset on failure. 573 // This one we reset on failure.
574 kernel_->info_status = KERNEL_SHARE_INFO_VALID; 574 kernel_->info_status = KERNEL_SHARE_INFO_VALID;
575 } 575 }
576 576
577 bool Directory::SaveChanges() { 577 bool Directory::SaveChanges() {
578 bool success = false; 578 bool success = false;
579 DCHECK(store_); 579 DCHECK(store_);
580 580
581 AutoLock scoped_lock(kernel_->save_changes_mutex); 581 base::AutoLock scoped_lock(kernel_->save_changes_mutex);
582 582
583 // Snapshot and save. 583 // Snapshot and save.
584 SaveChangesSnapshot snapshot; 584 SaveChangesSnapshot snapshot;
585 TakeSnapshotForSaveChanges(&snapshot); 585 TakeSnapshotForSaveChanges(&snapshot);
586 success = store_->SaveChanges(snapshot); 586 success = store_->SaveChanges(snapshot);
587 587
588 // Handle success or failure. 588 // Handle success or failure.
589 if (success) 589 if (success)
590 VacuumAfterSaveChanges(snapshot); 590 VacuumAfterSaveChanges(snapshot);
591 else 591 else
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 1122
1123 if (NULL == originals.get() || originals->empty()) { 1123 if (NULL == originals.get() || originals->empty()) {
1124 dirkernel_->transaction_mutex.Release(); 1124 dirkernel_->transaction_mutex.Release();
1125 return false; 1125 return false;
1126 } 1126 }
1127 1127
1128 1128
1129 { 1129 {
1130 // Scoped_lock is only active through the calculate_changes and 1130 // Scoped_lock is only active through the calculate_changes and
1131 // transaction_ending events. 1131 // transaction_ending events.
1132 AutoLock scoped_lock(dirkernel_->changes_channel_mutex); 1132 base::AutoLock scoped_lock(dirkernel_->changes_channel_mutex);
1133 1133
1134 // Tell listeners to calculate changes while we still have the mutex. 1134 // Tell listeners to calculate changes while we still have the mutex.
1135 DirectoryChangeEvent event = { DirectoryChangeEvent::CALCULATE_CHANGES, 1135 DirectoryChangeEvent event = { DirectoryChangeEvent::CALCULATE_CHANGES,
1136 originals.get(), this, writer_ }; 1136 originals.get(), this, writer_ };
1137 dirkernel_->changes_channel.Notify(event); 1137 dirkernel_->changes_channel.Notify(event);
1138 1138
1139 // Necessary for reads to be performed prior to transaction mutex release. 1139 // Necessary for reads to be performed prior to transaction mutex release.
1140 // Allows the listener to use the current transaction to perform reads. 1140 // Allows the listener to use the current transaction to perform reads.
1141 DirectoryChangeEvent ending_event = 1141 DirectoryChangeEvent ending_event =
1142 { DirectoryChangeEvent::TRANSACTION_ENDING, 1142 { DirectoryChangeEvent::TRANSACTION_ENDING,
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
1730 1730
1731 FastDump& operator<<(FastDump& dump, const Blob& blob) { 1731 FastDump& operator<<(FastDump& dump, const Blob& blob) {
1732 if (blob.empty()) 1732 if (blob.empty())
1733 return dump; 1733 return dump;
1734 string buffer(base::HexEncode(&blob[0], blob.size())); 1734 string buffer(base::HexEncode(&blob[0], blob.size()));
1735 dump.out_->sputn(buffer.c_str(), buffer.size()); 1735 dump.out_->sputn(buffer.c_str(), buffer.size());
1736 return dump; 1736 return dump;
1737 } 1737 }
1738 1738
1739 } // namespace syncable 1739 } // namespace syncable
OLDNEW
« no previous file with comments | « chrome/browser/sync/syncable/syncable.h ('k') | chrome/browser/sync/util/channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698