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

Side by Side Diff: components/sync/base/scoped_event_signal.h

Issue 2496723003: [Sync] Signal UIModelWorker to abort on sync shutdown. (Closed)
Patch Set: Address comments + add test. Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef COMPONENTS_SYNC_BASE_SCOPED_EVENT_SIGNAL_H_ 5 #ifndef COMPONENTS_SYNC_BASE_SCOPED_EVENT_SIGNAL_H_
6 #define COMPONENTS_SYNC_BASE_SCOPED_EVENT_SIGNAL_H_ 6 #define COMPONENTS_SYNC_BASE_SCOPED_EVENT_SIGNAL_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 9
10 namespace base { 10 namespace base {
(...skipping 11 matching lines...) Expand all
22 22
23 // This ScopedEventSignal will signal |other|'s WaitableEvent in its 23 // This ScopedEventSignal will signal |other|'s WaitableEvent in its
24 // destructor. |other| will not signal anything in its destructor. The 24 // destructor. |other| will not signal anything in its destructor. The
25 // assignment operator cannot be used if this ScopedEventSignal's 25 // assignment operator cannot be used if this ScopedEventSignal's
26 // WaitableEvent hasn't been moved to another ScopedEventSignal. 26 // WaitableEvent hasn't been moved to another ScopedEventSignal.
27 ScopedEventSignal(ScopedEventSignal&& other); 27 ScopedEventSignal(ScopedEventSignal&& other);
28 ScopedEventSignal& operator=(ScopedEventSignal&& other); 28 ScopedEventSignal& operator=(ScopedEventSignal&& other);
29 29
30 ~ScopedEventSignal(); 30 ~ScopedEventSignal();
31 31
32 // Whether the wrapped event has been signaled already.
33 bool IsSignaled() const;
34
32 private: 35 private:
33 base::WaitableEvent* event_; 36 base::WaitableEvent* event_;
34 37
35 DISALLOW_COPY_AND_ASSIGN(ScopedEventSignal); 38 DISALLOW_COPY_AND_ASSIGN(ScopedEventSignal);
36 }; 39 };
37 40
38 } // namespace syncer 41 } // namespace syncer
39 42
40 #endif // COMPONENTS_SYNC_BASE_SCOPED_EVENT_SIGNAL_H_ 43 #endif // COMPONENTS_SYNC_BASE_SCOPED_EVENT_SIGNAL_H_
OLDNEW
« no previous file with comments | « no previous file | components/sync/base/scoped_event_signal.cc » ('j') | components/sync/driver/glue/ui_model_worker.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698