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

Side by Side Diff: chrome/browser/sync/engine/all_status.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
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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/engine/all_status.h" 5 #include "chrome/browser/sync/engine/all_status.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/port.h" 10 #include "base/port.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 status_ = CreateBlankStatus(); 128 status_ = CreateBlankStatus();
129 } 129 }
130 status_.authenticated = true; 130 status_.authenticated = true;
131 } else { 131 } else {
132 status_.authenticated = false; 132 status_.authenticated = false;
133 } 133 }
134 } 134 }
135 } 135 }
136 136
137 AllStatus::Status AllStatus::status() const { 137 AllStatus::Status AllStatus::status() const {
138 AutoLock lock(mutex_); 138 base::AutoLock lock(mutex_);
139 return status_; 139 return status_;
140 } 140 }
141 141
142 void AllStatus::SetNotificationsEnabled(bool notifications_enabled) { 142 void AllStatus::SetNotificationsEnabled(bool notifications_enabled) {
143 ScopedStatusLock lock(this); 143 ScopedStatusLock lock(this);
144 status_.notifications_enabled = notifications_enabled; 144 status_.notifications_enabled = notifications_enabled;
145 } 145 }
146 146
147 void AllStatus::IncrementNotificationsSent() { 147 void AllStatus::IncrementNotificationsSent() {
148 ScopedStatusLock lock(this); 148 ScopedStatusLock lock(this);
149 ++status_.notifications_sent; 149 ++status_.notifications_sent;
150 } 150 }
151 151
152 void AllStatus::IncrementNotificationsReceived() { 152 void AllStatus::IncrementNotificationsReceived() {
153 ScopedStatusLock lock(this); 153 ScopedStatusLock lock(this);
154 ++status_.notifications_received; 154 ++status_.notifications_received;
155 } 155 }
156 156
157 ScopedStatusLock::ScopedStatusLock(AllStatus* allstatus) 157 ScopedStatusLock::ScopedStatusLock(AllStatus* allstatus)
158 : allstatus_(allstatus) { 158 : allstatus_(allstatus) {
159 allstatus->mutex_.Acquire(); 159 allstatus->mutex_.Acquire();
160 } 160 }
161 161
162 ScopedStatusLock::~ScopedStatusLock() { 162 ScopedStatusLock::~ScopedStatusLock() {
163 allstatus_->CalcStatusChanges(); 163 allstatus_->CalcStatusChanges();
164 allstatus_->mutex_.Release(); 164 allstatus_->mutex_.Release();
165 } 165 }
166 166
167 } // namespace browser_sync 167 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/engine/all_status.h ('k') | chrome/browser/sync/engine/net/server_connection_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698