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

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: comment cleanup 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 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 user_initiated_info_.user_gesture = navigation_handle->HasUserGesture(); 544 user_initiated_info_.user_gesture = navigation_handle->HasUserGesture();
545 545
546 INVOKE_AND_PRUNE_OBSERVERS( 546 INVOKE_AND_PRUNE_OBSERVERS(
547 observers_, ShouldObserveMimeType, 547 observers_, ShouldObserveMimeType,
548 navigation_handle->GetWebContents()->GetContentsMimeType()); 548 navigation_handle->GetWebContents()->GetContentsMimeType());
549 549
550 INVOKE_AND_PRUNE_OBSERVERS(observers_, OnCommit, navigation_handle); 550 INVOKE_AND_PRUNE_OBSERVERS(observers_, OnCommit, navigation_handle);
551 LogAbortChainHistograms(navigation_handle); 551 LogAbortChainHistograms(navigation_handle);
552 } 552 }
553 553
554 void PageLoadTracker::DidCommitSameDocumentNavigation(
555 content::NavigationHandle* navigation_handle) {
556 for (const auto& observer : observers_) {
557 observer->OnCommitSameDocumentNavigation(navigation_handle);
558 }
559 }
560
554 void PageLoadTracker::DidFinishSubFrameNavigation( 561 void PageLoadTracker::DidFinishSubFrameNavigation(
555 content::NavigationHandle* navigation_handle) { 562 content::NavigationHandle* navigation_handle) {
556 INVOKE_AND_PRUNE_OBSERVERS(observers_, OnDidFinishSubFrameNavigation, 563 for (const auto& observer : observers_) {
557 navigation_handle); 564 observer->OnDidFinishSubFrameNavigation(navigation_handle);
565 }
558 566
559 if (!navigation_handle->HasCommitted()) 567 if (!navigation_handle->HasCommitted())
560 return; 568 return;
561 569
562 // We have a new committed navigation, so discard information about the 570 // We have a new committed navigation, so discard information about the
563 // previously committed navigation. 571 // previously committed navigation.
564 subframe_navigation_start_offset_.erase( 572 subframe_navigation_start_offset_.erase(
565 navigation_handle->GetFrameTreeNodeId()); 573 navigation_handle->GetFrameTreeNodeId());
566 574
567 BrowserPageTrackDecider decider(embedder_interface_, 575 BrowserPageTrackDecider decider(embedder_interface_,
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 observer->MediaStartedPlaying(video_type, is_in_main_frame); 944 observer->MediaStartedPlaying(video_type, is_in_main_frame);
937 } 945 }
938 946
939 void PageLoadTracker::OnNavigationDelayComplete(base::TimeDelta scheduled_delay, 947 void PageLoadTracker::OnNavigationDelayComplete(base::TimeDelta scheduled_delay,
940 base::TimeDelta actual_delay) { 948 base::TimeDelta actual_delay) {
941 for (const auto& observer : observers_) 949 for (const auto& observer : observers_)
942 observer->OnNavigationDelayComplete(scheduled_delay, actual_delay); 950 observer->OnNavigationDelayComplete(scheduled_delay, actual_delay);
943 } 951 }
944 952
945 } // namespace page_load_metrics 953 } // namespace page_load_metrics
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698