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/metrics_web_contents_observer.h" | 5 #include "chrome/browser/page_load_metrics/metrics_web_contents_observer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <ostream> | 8 #include <ostream> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 EndReasonForPageTransition(new_navigation->GetPageTransition()), | 570 EndReasonForPageTransition(new_navigation->GetPageTransition()), |
571 user_initiated_info, timestamp, false); | 571 user_initiated_info, timestamp, false); |
572 } | 572 } |
573 | 573 |
574 aborted_provisional_loads_.clear(); | 574 aborted_provisional_loads_.clear(); |
575 return last_aborted_load; | 575 return last_aborted_load; |
576 } | 576 } |
577 | 577 |
578 void MetricsWebContentsObserver::OnTimingUpdated( | 578 void MetricsWebContentsObserver::OnTimingUpdated( |
579 content::RenderFrameHost* render_frame_host, | 579 content::RenderFrameHost* render_frame_host, |
580 const PageLoadTiming& timing, | 580 const mojom::PageLoadTiming& timing, |
581 const PageLoadMetadata& metadata) { | 581 const mojom::PageLoadMetadata& metadata) { |
582 // We may receive notifications from frames that have been navigated away | 582 // We may receive notifications from frames that have been navigated away |
583 // from. We simply ignore them. | 583 // from. We simply ignore them. |
584 if (GetMainFrame(render_frame_host) != web_contents()->GetMainFrame()) { | 584 if (GetMainFrame(render_frame_host) != web_contents()->GetMainFrame()) { |
585 RecordInternalError(ERR_IPC_FROM_WRONG_FRAME); | 585 RecordInternalError(ERR_IPC_FROM_WRONG_FRAME); |
586 return; | 586 return; |
587 } | 587 } |
588 | 588 |
589 // While timings arriving for the wrong frame are expected, we do not expect | 589 // While timings arriving for the wrong frame are expected, we do not expect |
590 // any of the errors below. Thus, we track occurrences of all errors below, | 590 // any of the errors below. Thus, we track occurrences of all errors below, |
591 // rather than returning early after encountering an error. | 591 // rather than returning early after encountering an error. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 observer_->RemoveTestingObserver(this); | 647 observer_->RemoveTestingObserver(this); |
648 observer_ = nullptr; | 648 observer_ = nullptr; |
649 } | 649 } |
650 } | 650 } |
651 | 651 |
652 void MetricsWebContentsObserver::TestingObserver::OnGoingAway() { | 652 void MetricsWebContentsObserver::TestingObserver::OnGoingAway() { |
653 observer_ = nullptr; | 653 observer_ = nullptr; |
654 } | 654 } |
655 | 655 |
656 } // namespace page_load_metrics | 656 } // namespace page_load_metrics |
OLD | NEW |