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 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 // updates. | 600 // updates. |
601 if (!timing.IsEmpty()) | 601 if (!timing.IsEmpty()) |
602 RecordInternalError(ERR_TIMING_IPC_FROM_SUBFRAME); | 602 RecordInternalError(ERR_TIMING_IPC_FROM_SUBFRAME); |
603 committed_load_->UpdateChildFrameMetadata(metadata); | 603 committed_load_->UpdateChildFrameMetadata(metadata); |
604 return; | 604 return; |
605 } | 605 } |
606 | 606 |
607 committed_load_->UpdateTiming(timing, metadata); | 607 committed_load_->UpdateTiming(timing, metadata); |
608 | 608 |
609 for (auto& observer : testing_observers_) | 609 for (auto& observer : testing_observers_) |
610 observer.OnTimingUpdated(timing, metadata); | 610 observer.OnTimingUpdated(true /* is_main_frame */, timing, metadata); |
611 } | 611 } |
612 | 612 |
613 bool MetricsWebContentsObserver::ShouldTrackNavigation( | 613 bool MetricsWebContentsObserver::ShouldTrackNavigation( |
614 content::NavigationHandle* navigation_handle) const { | 614 content::NavigationHandle* navigation_handle) const { |
615 DCHECK(navigation_handle->IsInMainFrame()); | 615 DCHECK(navigation_handle->IsInMainFrame()); |
616 DCHECK(!navigation_handle->HasCommitted() || | 616 DCHECK(!navigation_handle->HasCommitted() || |
617 !navigation_handle->IsSameDocument()); | 617 !navigation_handle->IsSameDocument()); |
618 | 618 |
619 return BrowserPageTrackDecider(embedder_interface_.get(), web_contents(), | 619 return BrowserPageTrackDecider(embedder_interface_.get(), web_contents(), |
620 navigation_handle).ShouldTrack(); | 620 navigation_handle).ShouldTrack(); |
(...skipping 21 matching lines...) Expand all Loading... |
642 observer_->RemoveTestingObserver(this); | 642 observer_->RemoveTestingObserver(this); |
643 observer_ = nullptr; | 643 observer_ = nullptr; |
644 } | 644 } |
645 } | 645 } |
646 | 646 |
647 void MetricsWebContentsObserver::TestingObserver::OnGoingAway() { | 647 void MetricsWebContentsObserver::TestingObserver::OnGoingAway() { |
648 observer_ = nullptr; | 648 observer_ = nullptr; |
649 } | 649 } |
650 | 650 |
651 } // namespace page_load_metrics | 651 } // namespace page_load_metrics |
OLD | NEW |