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

Side by Side Diff: cc/base/unique_notifier.h

Issue 1057283003: Remove parts of //cc we aren't using (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « cc/base/time_util.h ('k') | cc/base/unique_notifier.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CC_BASE_UNIQUE_NOTIFIER_H_
6 #define CC_BASE_UNIQUE_NOTIFIER_H_
7
8 #include "base/callback.h"
9 #include "base/memory/weak_ptr.h"
10 #include "cc/base/cc_export.h"
11
12 namespace base {
13 class SequencedTaskRunner;
14 } // namespace base
15
16 namespace cc {
17
18 class CC_EXPORT UniqueNotifier {
19 public:
20 // Configure this notifier to issue the |closure| notification when scheduled.
21 UniqueNotifier(base::SequencedTaskRunner* task_runner,
22 const base::Closure& closure);
23
24 // Destroying the notifier will ensure that no further notifications will
25 // happen from this class.
26 ~UniqueNotifier();
27
28 // Schedule a notification to be run. If another notification is already
29 // pending, then only one notification will take place.
30 void Schedule();
31
32 private:
33 void Notify();
34
35 // TODO(dcheng): How come this doesn't need to hold a ref to the task runner?
36 base::SequencedTaskRunner* task_runner_;
37 base::Closure closure_;
38 bool notification_pending_;
39
40 base::WeakPtrFactory<UniqueNotifier> weak_ptr_factory_;
41
42 DISALLOW_COPY_AND_ASSIGN(UniqueNotifier);
43 };
44
45 } // namespace cc
46
47 #endif // CC_BASE_UNIQUE_NOTIFIER_H_
OLDNEW
« no previous file with comments | « cc/base/time_util.h ('k') | cc/base/unique_notifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698