Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_SYNC_ENGINE_SIGNAL_EVENT_ON_DELETE_H_ | |
|
Nicolas Zea
2016/11/01 22:39:23
I think it would be cleaner to define this file in
fdoray
2016/11/02 15:52:05
Done.
| |
| 6 #define COMPONENTS_SYNC_ENGINE_SIGNAL_EVENT_ON_DELETE_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 | |
| 10 namespace base { | |
| 11 class WaitableEvent; | |
| 12 } | |
| 13 | |
| 14 namespace syncer { | |
| 15 | |
| 16 // An object which signals a WaitableEvent when it is deleted. Used to wait for | |
| 17 // a task to run or be abandonned. | |
| 18 class SignalEventOnDelete { | |
|
Nicolas Zea
2016/11/01 22:39:23
I wonder if it would make more sense to rename thi
fdoray
2016/11/02 15:52:05
Done.
| |
| 19 public: | |
| 20 // |event| is signaled in the destructor. | |
| 21 explicit SignalEventOnDelete(base::WaitableEvent* event); | |
| 22 | |
| 23 // This SignalEventOnDelete instance will signal |other|'s event in its | |
| 24 // destructor. |other| will not signal anything in its destructor. | |
| 25 SignalEventOnDelete(SignalEventOnDelete&& other); | |
| 26 SignalEventOnDelete& operator=(SignalEventOnDelete&& other); | |
| 27 | |
| 28 ~SignalEventOnDelete(); | |
| 29 | |
| 30 private: | |
| 31 base::WaitableEvent* event_; | |
| 32 | |
| 33 DISALLOW_COPY_AND_ASSIGN(SignalEventOnDelete); | |
| 34 }; | |
| 35 | |
| 36 } // namespace syncer | |
| 37 | |
| 38 #endif // COMPONENTS_SYNC_ENGINE_SIGNAL_EVENT_ON_DELETE_H_ | |
| OLD | NEW |