| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CC_BASE_UNIQUE_NOTIFIER_H_ | 5 #ifndef CC_BASE_UNIQUE_NOTIFIER_H_ |
| 6 #define CC_BASE_UNIQUE_NOTIFIER_H_ | 6 #define CC_BASE_UNIQUE_NOTIFIER_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 11 #include "cc/base/cc_export.h" | 11 #include "cc/base/base_export.h" |
| 12 | 12 |
| 13 namespace base { | 13 namespace base { |
| 14 class SequencedTaskRunner; | 14 class SequencedTaskRunner; |
| 15 } // namespace base | 15 } // namespace base |
| 16 | 16 |
| 17 namespace cc { | 17 namespace cc { |
| 18 | 18 |
| 19 class CC_EXPORT UniqueNotifier { | 19 class CC_BASE_EXPORT UniqueNotifier { |
| 20 public: | 20 public: |
| 21 // Configure this notifier to issue the |closure| notification when scheduled. | 21 // Configure this notifier to issue the |closure| notification when scheduled. |
| 22 UniqueNotifier(base::SequencedTaskRunner* task_runner, | 22 UniqueNotifier(base::SequencedTaskRunner* task_runner, |
| 23 const base::Closure& closure); | 23 const base::Closure& closure); |
| 24 | 24 |
| 25 // Destroying the notifier will ensure that no further notifications will | 25 // Destroying the notifier will ensure that no further notifications will |
| 26 // happen from this class. | 26 // happen from this class. |
| 27 ~UniqueNotifier(); | 27 ~UniqueNotifier(); |
| 28 | 28 |
| 29 // Schedule a notification to be run. If another notification is already | 29 // Schedule a notification to be run. If another notification is already |
| (...skipping 15 matching lines...) Expand all Loading... |
| 45 bool notification_pending_; | 45 bool notification_pending_; |
| 46 | 46 |
| 47 base::WeakPtrFactory<UniqueNotifier> weak_ptr_factory_; | 47 base::WeakPtrFactory<UniqueNotifier> weak_ptr_factory_; |
| 48 | 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(UniqueNotifier); | 49 DISALLOW_COPY_AND_ASSIGN(UniqueNotifier); |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 } // namespace cc | 52 } // namespace cc |
| 53 | 53 |
| 54 #endif // CC_BASE_UNIQUE_NOTIFIER_H_ | 54 #endif // CC_BASE_UNIQUE_NOTIFIER_H_ |
| OLD | NEW |