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

Side by Side Diff: chrome/browser/page_load_metrics/page_load_tracker.cc

Issue 2888673002: Add support for counting same-document AMP loads. (Closed)
Patch Set: address comment Created 3 years, 7 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_tracker.h" 5 #include "chrome/browser/page_load_metrics/page_load_tracker.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 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 user_initiated_info_.user_gesture = navigation_handle->HasUserGesture(); 537 user_initiated_info_.user_gesture = navigation_handle->HasUserGesture();
538 538
539 INVOKE_AND_PRUNE_OBSERVERS( 539 INVOKE_AND_PRUNE_OBSERVERS(
540 observers_, ShouldObserveMimeType, 540 observers_, ShouldObserveMimeType,
541 navigation_handle->GetWebContents()->GetContentsMimeType()); 541 navigation_handle->GetWebContents()->GetContentsMimeType());
542 542
543 INVOKE_AND_PRUNE_OBSERVERS(observers_, OnCommit, navigation_handle); 543 INVOKE_AND_PRUNE_OBSERVERS(observers_, OnCommit, navigation_handle);
544 LogAbortChainHistograms(navigation_handle); 544 LogAbortChainHistograms(navigation_handle);
545 } 545 }
546 546
547 void PageLoadTracker::DidCommitSameDocumentNavigation(
548 content::NavigationHandle* navigation_handle) {
549 for (const auto& observer : observers_) {
550 observer->OnCommitSameDocumentNavigation(navigation_handle);
551 }
552 }
553
547 void PageLoadTracker::DidFinishSubFrameNavigation( 554 void PageLoadTracker::DidFinishSubFrameNavigation(
548 content::NavigationHandle* navigation_handle) { 555 content::NavigationHandle* navigation_handle) {
549 INVOKE_AND_PRUNE_OBSERVERS(observers_, OnDidFinishSubFrameNavigation, 556 for (const auto& observer : observers_) {
550 navigation_handle); 557 observer->OnDidFinishSubFrameNavigation(navigation_handle);
558 }
551 559
552 if (!navigation_handle->HasCommitted()) 560 if (!navigation_handle->HasCommitted())
553 return; 561 return;
554 562
555 // We have a new committed navigation, so discard information about the 563 // We have a new committed navigation, so discard information about the
556 // previously committed navigation. 564 // previously committed navigation.
557 subframe_navigation_start_offset_.erase( 565 subframe_navigation_start_offset_.erase(
558 navigation_handle->GetFrameTreeNodeId()); 566 navigation_handle->GetFrameTreeNodeId());
559 567
560 BrowserPageTrackDecider decider(embedder_interface_, 568 BrowserPageTrackDecider decider(embedder_interface_,
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
954 observer->MediaStartedPlaying(video_type, is_in_main_frame); 962 observer->MediaStartedPlaying(video_type, is_in_main_frame);
955 } 963 }
956 964
957 void PageLoadTracker::OnNavigationDelayComplete(base::TimeDelta scheduled_delay, 965 void PageLoadTracker::OnNavigationDelayComplete(base::TimeDelta scheduled_delay,
958 base::TimeDelta actual_delay) { 966 base::TimeDelta actual_delay) {
959 for (const auto& observer : observers_) 967 for (const auto& observer : observers_)
960 observer->OnNavigationDelayComplete(scheduled_delay, actual_delay); 968 observer->OnNavigationDelayComplete(scheduled_delay, actual_delay);
961 } 969 }
962 970
963 } // namespace page_load_metrics 971 } // namespace page_load_metrics
OLDNEW
« no previous file with comments | « chrome/browser/page_load_metrics/page_load_tracker.h ('k') | tools/metrics/histograms/enums.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698