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 #include "chrome/browser/page_load_metrics/page_load_metrics_util.h" | 5 #include "chrome/browser/page_load_metrics/page_load_metrics_util.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "chrome/common/page_load_metrics/page_load_timing.h" | 9 #include "chrome/common/page_load_metrics/page_load_timing.h" |
10 | 10 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 const base::Optional<base::TimeDelta>& b) { | 96 const base::Optional<base::TimeDelta>& b) { |
97 if (a && !b) | 97 if (a && !b) |
98 return a; | 98 return a; |
99 if (b && !a) | 99 if (b && !a) |
100 return b; | 100 return b; |
101 if (!a && !b) | 101 if (!a && !b) |
102 return a; // doesn't matter which | 102 return a; // doesn't matter which |
103 return base::Optional<base::TimeDelta>(std::min(a.value(), b.value())); | 103 return base::Optional<base::TimeDelta>(std::min(a.value(), b.value())); |
104 } | 104 } |
105 | 105 |
| 106 bool DidObserveLoadingBehaviorInAnyFrame( |
| 107 const page_load_metrics::PageLoadExtraInfo& info, |
| 108 blink::WebLoadingBehaviorFlag behavior) { |
| 109 const int all_frame_loading_behavior_flags = |
| 110 info.main_frame_metadata.behavior_flags | |
| 111 info.child_frame_metadata.behavior_flags; |
| 112 |
| 113 return (all_frame_loading_behavior_flags & behavior) != 0; |
| 114 } |
| 115 |
106 } // namespace page_load_metrics | 116 } // namespace page_load_metrics |
OLD | NEW |