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

Side by Side Diff: chrome/common/page_load_metrics/test/weak_mock_timer.h

Issue 2901383002: Buffer cross frame paint timing updates. (Closed)
Patch Set: address comment Created 3 years, 6 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
OLDNEW
(Empty)
1 // Copyright 2017 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 CHROME_COMMON_PAGE_LOAD_METRICS_TEST_WEAK_MOCK_TIMER_H_
6 #define CHROME_COMMON_PAGE_LOAD_METRICS_TEST_WEAK_MOCK_TIMER_H_
7
8 #include "base/macros.h"
9 #include "base/memory/weak_ptr.h"
10 #include "base/timer/mock_timer.h"
11
12 namespace page_load_metrics {
13 namespace test {
14
15 // WeakMockTimer is a MockTimer that allows clients to keep WeakPtr<>s to it.
16 class WeakMockTimer : public base::MockTimer,
17 public base::SupportsWeakPtr<WeakMockTimer> {
18 public:
19 WeakMockTimer();
20
21 private:
22 DISALLOW_COPY_AND_ASSIGN(WeakMockTimer);
23 };
24
25 // WeakMockTimerProvider is a testing helper class that test classes can inherit
26 // from to provide basic MockTimer tracking capabilities.
27 class WeakMockTimerProvider {
28 public:
29 WeakMockTimerProvider();
30 virtual ~WeakMockTimerProvider();
31
32 base::MockTimer* GetMockTimer() const;
33 void SetMockTimer(base::WeakPtr<WeakMockTimer> timer);
34
35 private:
36 base::WeakPtr<WeakMockTimer> timer_;
37
38 DISALLOW_COPY_AND_ASSIGN(WeakMockTimerProvider);
39 };
40
41 } // namespace test
42 } // namespace page_load_metrics
43
44 #endif // CHROME_COMMON_PAGE_LOAD_METRICS_TEST_WEAK_MOCK_TIMER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698