OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | |
sky
2017/06/08 19:17:49
no (c) (see style guide).
eugenebng
2017/06/09 13:16:22
Done.
| |
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 CONTENT_PUBLIC_BROWSER_REPEATED_NOTIFICATION_OBSERVER_H_ | |
sky
2017/06/08 19:17:49
guard doesn't match file name.
eugenebng
2017/06/09 13:16:22
Done.
| |
6 #define CONTENT_PUBLIC_BROWSER_REPEATED_NOTIFICATION_OBSERVER_H_ | |
7 | |
8 #include "base/run_loop.h" | |
9 #include "content/public/browser/notification_observer.h" | |
10 #include "content/public/browser/notification_registrar.h" | |
11 | |
12 namespace content { | |
13 | |
14 // RepeatedNotificationObserver allows code to wait until specified number | |
15 // of notifications of particular type are posted. | |
16 class RepeatedNotificationObserver : public NotificationObserver { | |
17 public: | |
18 explicit RepeatedNotificationObserver(int type, int count); | |
sky
2017/06/08 19:17:49
no explicit
eugenebng
2017/06/09 13:16:22
Done.
| |
19 | |
20 void Observe(int type, | |
sky
2017/06/08 19:17:49
Prefix with where override comes from, e.g.
// Not
eugenebng
2017/06/09 13:16:22
Done.
| |
21 const NotificationSource& source, | |
22 const NotificationDetails& details) override; | |
23 void Wait(); | |
sky
2017/06/08 19:17:49
Add description.
eugenebng
2017/06/09 13:16:22
Done.
| |
24 | |
25 private: | |
26 int num_outstanding_; | |
27 NotificationRegistrar registrar_; | |
28 bool running_; | |
29 base::RunLoop run_loop_; | |
30 | |
31 DISALLOW_COPY_AND_ASSIGN(RepeatedNotificationObserver); | |
32 }; | |
33 | |
34 } // namespace content | |
35 | |
36 #endif // CONTENT_PUBLIC_BROWSER_REPEATED_NOTIFICATION_OBSERVER_H_ | |
OLD | NEW |