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

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

Issue 2732293003: Adding UMA on page load size for pages with Media (Closed)
Patch Set: Switching to WCO::MediaStartedPlaying instead of behavior flag Created 3 years, 9 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 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 host->GetWidget()->RemoveInputEventObserver(this); 97 host->GetWidget()->RemoveInputEventObserver(this);
98 } 98 }
99 99
100 void MetricsWebContentsObserver::RenderViewHostChanged( 100 void MetricsWebContentsObserver::RenderViewHostChanged(
101 content::RenderViewHost* old_host, 101 content::RenderViewHost* old_host,
102 content::RenderViewHost* new_host) { 102 content::RenderViewHost* new_host) {
103 UnregisterInputEventObserver(old_host); 103 UnregisterInputEventObserver(old_host);
104 RegisterInputEventObserver(new_host); 104 RegisterInputEventObserver(new_host);
105 } 105 }
106 106
107 void MetricsWebContentsObserver::MediaStartedPlaying(
108 const content::WebContentsObserver::MediaPlayerInfo& video_type,
109 const content::WebContentsObserver::MediaPlayerId& id) {
110 if (committed_load_)
Bryan McQuade 2017/03/15 01:59:46 we should just make sure that the top-level frame
111 committed_load_->MediaStartedPlaying(
112 video_type, id.first == web_contents()->GetMainFrame());
113 }
114
107 bool MetricsWebContentsObserver::OnMessageReceived( 115 bool MetricsWebContentsObserver::OnMessageReceived(
108 const IPC::Message& message, 116 const IPC::Message& message,
109 content::RenderFrameHost* render_frame_host) { 117 content::RenderFrameHost* render_frame_host) {
110 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 118 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
111 bool handled = true; 119 bool handled = true;
112 IPC_BEGIN_MESSAGE_MAP_WITH_PARAM(MetricsWebContentsObserver, message, 120 IPC_BEGIN_MESSAGE_MAP_WITH_PARAM(MetricsWebContentsObserver, message,
113 render_frame_host) 121 render_frame_host)
114 IPC_MESSAGE_HANDLER(PageLoadMetricsMsg_TimingUpdated, OnTimingUpdated) 122 IPC_MESSAGE_HANDLER(PageLoadMetricsMsg_TimingUpdated, OnTimingUpdated)
115 IPC_MESSAGE_UNHANDLED(handled = false) 123 IPC_MESSAGE_UNHANDLED(handled = false)
116 IPC_END_MESSAGE_MAP() 124 IPC_END_MESSAGE_MAP()
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 content::NavigationHandle* navigation_handle) const { 566 content::NavigationHandle* navigation_handle) const {
559 DCHECK(navigation_handle->IsInMainFrame()); 567 DCHECK(navigation_handle->IsInMainFrame());
560 DCHECK(!navigation_handle->HasCommitted() || 568 DCHECK(!navigation_handle->HasCommitted() ||
561 !navigation_handle->IsSameDocument()); 569 !navigation_handle->IsSameDocument());
562 570
563 return BrowserPageTrackDecider(embedder_interface_.get(), web_contents(), 571 return BrowserPageTrackDecider(embedder_interface_.get(), web_contents(),
564 navigation_handle).ShouldTrack(); 572 navigation_handle).ShouldTrack();
565 } 573 }
566 574
567 } // namespace page_load_metrics 575 } // namespace page_load_metrics
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698