OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 CHROME_RENDERER_PAGE_LOAD_METRICS_PAGE_TIMING_METRICS_SENDER_H_ | 5 #ifndef CHROME_RENDERER_PAGE_LOAD_METRICS_PAGE_TIMING_METRICS_SENDER_H_ |
6 #define CHROME_RENDERER_PAGE_LOAD_METRICS_PAGE_TIMING_METRICS_SENDER_H_ | 6 #define CHROME_RENDERER_PAGE_LOAD_METRICS_PAGE_TIMING_METRICS_SENDER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 const PageLoadTiming& initial_timing); | 32 const PageLoadTiming& initial_timing); |
33 ~PageTimingMetricsSender(); | 33 ~PageTimingMetricsSender(); |
34 | 34 |
35 void DidObserveLoadingBehavior(blink::WebLoadingBehaviorFlag behavior); | 35 void DidObserveLoadingBehavior(blink::WebLoadingBehaviorFlag behavior); |
36 void Send(const PageLoadTiming& timing); | 36 void Send(const PageLoadTiming& timing); |
37 | 37 |
38 protected: | 38 protected: |
39 base::Timer* timer() const { return timer_.get(); } | 39 base::Timer* timer() const { return timer_.get(); } |
40 | 40 |
41 private: | 41 private: |
42 void EnsureSendTimer(int delay); | 42 void EnsureSendTimer(); |
43 void SendNow(); | 43 void SendNow(); |
44 | 44 |
45 IPC::Sender* const ipc_sender_; | 45 IPC::Sender* const ipc_sender_; |
46 const int routing_id_; | 46 const int routing_id_; |
47 std::unique_ptr<base::Timer> timer_; | 47 std::unique_ptr<base::Timer> timer_; |
48 PageLoadTiming last_timing_; | 48 PageLoadTiming last_timing_; |
49 | 49 |
50 // The the sender keep track of metadata as it comes in, because the sender is | 50 // The the sender keep track of metadata as it comes in, because the sender is |
51 // scoped to a single committed load. | 51 // scoped to a single committed load. |
52 PageLoadMetadata metadata_; | 52 PageLoadMetadata metadata_; |
53 | 53 |
| 54 bool have_sent_ipc_ = false; |
| 55 |
54 DISALLOW_COPY_AND_ASSIGN(PageTimingMetricsSender); | 56 DISALLOW_COPY_AND_ASSIGN(PageTimingMetricsSender); |
55 }; | 57 }; |
56 | 58 |
57 } // namespace page_load_metrics | 59 } // namespace page_load_metrics |
58 | 60 |
59 #endif // CHROME_RENDERER_PAGE_LOAD_METRICS_PAGE_TIMING_METRICS_SENDER_H_ | 61 #endif // CHROME_RENDERER_PAGE_LOAD_METRICS_PAGE_TIMING_METRICS_SENDER_H_ |
OLD | NEW |