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

Side by Side Diff: components/sync/base/cancelation_signal.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 4 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/internal_api/public/base/cancelation_signal.h" 5 #include "components/sync/base/cancelation_signal.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "sync/internal_api/public/base/cancelation_observer.h" 8 #include "components/sync/base/cancelation_observer.h"
9 9
10 namespace syncer { 10 namespace syncer {
11 11
12 CancelationSignal::CancelationSignal() 12 CancelationSignal::CancelationSignal() : signalled_(false), handler_(NULL) {}
13 : signalled_(false),
14 handler_(NULL) { }
15 13
16 CancelationSignal::~CancelationSignal() { 14 CancelationSignal::~CancelationSignal() {
17 DCHECK(!handler_); 15 DCHECK(!handler_);
18 } 16 }
19 17
20 bool CancelationSignal::TryRegisterHandler(CancelationObserver* handler) { 18 bool CancelationSignal::TryRegisterHandler(CancelationObserver* handler) {
21 base::AutoLock lock(signal_lock_); 19 base::AutoLock lock(signal_lock_);
22 DCHECK(!handler_); 20 DCHECK(!handler_);
23 21
24 if (signalled_) 22 if (signalled_)
(...skipping 18 matching lines...) Expand all
43 base::AutoLock lock(signal_lock_); 41 base::AutoLock lock(signal_lock_);
44 DCHECK(!signalled_); 42 DCHECK(!signalled_);
45 43
46 signalled_ = true; 44 signalled_ = true;
47 if (handler_) { 45 if (handler_) {
48 handler_->OnSignalReceived(); 46 handler_->OnSignalReceived();
49 } 47 }
50 } 48 }
51 49
52 } // namespace syncer 50 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/base/cancelation_signal.h ('k') | components/sync/base/cancelation_signal_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698