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

Side by Side Diff: components/page_load_metrics/renderer/page_timing_metrics_sender.h

Issue 1312213010: PageLoadMetrics renderer and browser implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Relax DCHECK constraints slightly for tests Created 5 years, 3 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 2015 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_PAGE_LOAD_METRICS_RENDERER_PAGE_TIMING_METRICS_SENDER_H_
6 #define COMPONENTS_PAGE_LOAD_METRICS_RENDERER_PAGE_TIMING_METRICS_SENDER_H_
7
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "components/page_load_metrics/common/page_load_timing.h"
11
12 namespace base {
13 class Timer;
14 } // namespace base
15
16 namespace IPC {
17 class Sender;
18 } // namespace IPC
19
20 namespace page_load_metrics {
21
22 // PageTimingMetricsSender is responsible for sending page load timing metrics
23 // over IPC. PageTimingMetricsSender may coalesce sent IPCs in order to
24 // minimize IPC contention.
25 class PageTimingMetricsSender {
26 public:
27 PageTimingMetricsSender(IPC::Sender* ipc_sender,
28 int routing_id,
29 scoped_ptr<base::Timer> timer);
30 ~PageTimingMetricsSender();
31
32 void Send(const PageLoadTiming& timing);
33
34 protected:
35 base::Timer* timer() const { return timer_.get(); }
36
37 private:
38 void SendNow();
39
40 IPC::Sender* const ipc_sender_;
41 const int routing_id_;
42 scoped_ptr<base::Timer> timer_;
43 PageLoadTiming last_timing_;
44
45 DISALLOW_COPY_AND_ASSIGN(PageTimingMetricsSender);
46 };
47
48 } // namespace page_load_metrics
49
50 #endif // COMPONENTS_PAGE_LOAD_METRICS_RENDERER_PAGE_TIMING_METRICS_SENDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698