| OLD | NEW |
| 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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 user_initiated_info_.user_gesture = navigation_handle->HasUserGesture(); | 452 user_initiated_info_.user_gesture = navigation_handle->HasUserGesture(); |
| 453 | 453 |
| 454 INVOKE_AND_PRUNE_OBSERVERS( | 454 INVOKE_AND_PRUNE_OBSERVERS( |
| 455 observers_, ShouldObserveMimeType, | 455 observers_, ShouldObserveMimeType, |
| 456 navigation_handle->GetWebContents()->GetContentsMimeType()); | 456 navigation_handle->GetWebContents()->GetContentsMimeType()); |
| 457 | 457 |
| 458 INVOKE_AND_PRUNE_OBSERVERS(observers_, OnCommit, navigation_handle); | 458 INVOKE_AND_PRUNE_OBSERVERS(observers_, OnCommit, navigation_handle); |
| 459 LogAbortChainHistograms(navigation_handle); | 459 LogAbortChainHistograms(navigation_handle); |
| 460 } | 460 } |
| 461 | 461 |
| 462 void PageLoadTracker::CommitSubFrame( |
| 463 content::NavigationHandle* navigation_handle) { |
| 464 INVOKE_AND_PRUNE_OBSERVERS(observers_, OnCommitSubFrame, navigation_handle); |
| 465 } |
| 466 |
| 462 void PageLoadTracker::FailedProvisionalLoad( | 467 void PageLoadTracker::FailedProvisionalLoad( |
| 463 content::NavigationHandle* navigation_handle, | 468 content::NavigationHandle* navigation_handle, |
| 464 base::TimeTicks failed_load_time) { | 469 base::TimeTicks failed_load_time) { |
| 465 DCHECK(!failed_provisional_load_info_); | 470 DCHECK(!failed_provisional_load_info_); |
| 466 failed_provisional_load_info_.reset(new FailedProvisionalLoadInfo( | 471 failed_provisional_load_info_.reset(new FailedProvisionalLoadInfo( |
| 467 failed_load_time - navigation_handle->NavigationStart(), | 472 failed_load_time - navigation_handle->NavigationStart(), |
| 468 navigation_handle->GetNetErrorCode())); | 473 navigation_handle->GetNetErrorCode())); |
| 469 } | 474 } |
| 470 | 475 |
| 471 void PageLoadTracker::Redirect(content::NavigationHandle* navigation_handle) { | 476 void PageLoadTracker::Redirect(content::NavigationHandle* navigation_handle) { |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 } | 738 } |
| 734 | 739 |
| 735 void PageLoadTracker::MediaStartedPlaying( | 740 void PageLoadTracker::MediaStartedPlaying( |
| 736 const content::WebContentsObserver::MediaPlayerInfo& video_type, | 741 const content::WebContentsObserver::MediaPlayerInfo& video_type, |
| 737 bool is_in_main_frame) { | 742 bool is_in_main_frame) { |
| 738 for (const auto& observer : observers_) | 743 for (const auto& observer : observers_) |
| 739 observer->MediaStartedPlaying(video_type, is_in_main_frame); | 744 observer->MediaStartedPlaying(video_type, is_in_main_frame); |
| 740 } | 745 } |
| 741 | 746 |
| 742 } // namespace page_load_metrics | 747 } // namespace page_load_metrics |
| OLD | NEW |