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

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

Issue 2780003003: Send an event to the page load metrics to track resource starting. (Closed)
Patch Set: Created 3 years, 8 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 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 const PageLoadExtraInfo info = ComputePageLoadExtraInfo(); 554 const PageLoadExtraInfo info = ComputePageLoadExtraInfo();
555 for (const auto& observer : observers_) { 555 for (const auto& observer : observers_) {
556 DispatchObserverTimingCallbacks(observer.get(), last_timing, new_timing, 556 DispatchObserverTimingCallbacks(observer.get(), last_timing, new_timing,
557 last_metadata, info); 557 last_metadata, info);
558 } 558 }
559 return true; 559 return true;
560 } 560 }
561 return false; 561 return false;
562 } 562 }
563 563
564 void PageLoadTracker::OnStartedResource(
565 const ExtraRequestInfo& extra_request_info) {
566 for (const auto& observer : observers_) {
567 observer->OnStartedResource(extra_request_info);
568 }
569 }
570
564 void PageLoadTracker::OnLoadedResource( 571 void PageLoadTracker::OnLoadedResource(
565 const ExtraRequestInfo& extra_request_info) { 572 const ExtraRequestInfo& extra_request_info) {
566 for (const auto& observer : observers_) { 573 for (const auto& observer : observers_) {
567 observer->OnLoadedResource(extra_request_info); 574 observer->OnLoadedResource(extra_request_info);
568 } 575 }
569 } 576 }
570 577
571 void PageLoadTracker::StopTracking() { 578 void PageLoadTracker::StopTracking() {
572 did_stop_tracking_ = true; 579 did_stop_tracking_ = true;
573 observers_.clear(); 580 observers_.clear();
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 } 740 }
734 741
735 void PageLoadTracker::MediaStartedPlaying( 742 void PageLoadTracker::MediaStartedPlaying(
736 const content::WebContentsObserver::MediaPlayerInfo& video_type, 743 const content::WebContentsObserver::MediaPlayerInfo& video_type,
737 bool is_in_main_frame) { 744 bool is_in_main_frame) {
738 for (const auto& observer : observers_) 745 for (const auto& observer : observers_)
739 observer->MediaStartedPlaying(video_type, is_in_main_frame); 746 observer->MediaStartedPlaying(video_type, is_in_main_frame);
740 } 747 }
741 748
742 } // namespace page_load_metrics 749 } // namespace page_load_metrics
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698