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

Side by Side Diff: chrome/browser/prerender/prerender_local_predictor.cc

Issue 498223002: Add additional histogram events for prefetches to the prerender local (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 3 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/prerender/prerender_local_predictor.h" 5 #include "chrome/browser/prerender/prerender_local_predictor.h"
6 6
7 #include <ctype.h> 7 #include <ctype.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <map> 10 #include <map>
(...skipping 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after
1366 num_issued++; 1366 num_issued++;
1367 continue; 1367 continue;
1368 } 1368 }
1369 } 1369 }
1370 } 1370 }
1371 1371
1372 void PrerenderLocalPredictor::IssuePrerender( 1372 void PrerenderLocalPredictor::IssuePrerender(
1373 CandidatePrerenderInfo* info, 1373 CandidatePrerenderInfo* info,
1374 LocalPredictorURLInfo* url_info) { 1374 LocalPredictorURLInfo* url_info) {
1375 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1375 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1376 RecordEvent(EVENT_ISSUE_PRERENDER_CALLED);
1376 if (prefetch_list_->AddURL(url_info->url)) { 1377 if (prefetch_list_->AddURL(url_info->url)) {
1377 RecordEvent(EVENT_PREFETCH_LIST_ADDED); 1378 RecordEvent(EVENT_PREFETCH_LIST_ADDED);
1378 // If we are prefetching rather than prerendering, now is the time to launch 1379 // If we are prefetching rather than prerendering, now is the time to launch
1379 // the prefetch. 1380 // the prefetch.
1380 if (IsLocalPredictorPrerenderPrefetchEnabled()) { 1381 if (IsLocalPredictorPrerenderPrefetchEnabled()) {
1382 RecordEvent(EVENT_ISSUE_PRERENDER_PREFETCH_ENABLED);
1381 // Obtain the render frame host that caused this prefetch. 1383 // Obtain the render frame host that caused this prefetch.
1382 RenderFrameHost* rfh = RenderFrameHost::FromID(info->render_process_id_, 1384 RenderFrameHost* rfh = RenderFrameHost::FromID(info->render_process_id_,
1383 info->render_frame_id_); 1385 info->render_frame_id_);
1384 // If it is still alive, launch the prefresh. 1386 // If it is still alive, launch the prefresh.
1385 if (rfh) 1387 if (rfh) {
1386 rfh->Send(new PrefetchMsg_Prefetch(rfh->GetRoutingID(), url_info->url)); 1388 rfh->Send(new PrefetchMsg_Prefetch(rfh->GetRoutingID(), url_info->url));
1389 RecordEvent(EVENT_ISSUE_PRERENDER_PREFETCH_ISSUED);
1390 }
1387 } 1391 }
1388 } 1392 }
1389 PrerenderProperties* prerender_properties = 1393 PrerenderProperties* prerender_properties =
1390 GetIssuedPrerenderSlotForPriority(url_info->url, url_info->priority); 1394 GetIssuedPrerenderSlotForPriority(url_info->url, url_info->priority);
1391 if (!prerender_properties) { 1395 if (!prerender_properties) {
1392 RecordEvent(EVENT_CONTINUE_PRERENDER_CHECK_PRIORITY_TOO_LOW); 1396 RecordEvent(EVENT_CONTINUE_PRERENDER_CHECK_PRIORITY_TOO_LOW);
1393 return; 1397 return;
1394 } 1398 }
1395 RecordEvent(EVENT_CONTINUE_PRERENDER_CHECK_ISSUING_PRERENDER); 1399 RecordEvent(EVENT_CONTINUE_PRERENDER_CHECK_ISSUING_PRERENDER);
1396 DCHECK(prerender_properties != NULL); 1400 DCHECK(prerender_properties != NULL);
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
1562 break; 1566 break;
1563 case content::SessionStorageNamespace::MERGE_RESULT_MERGEABLE: 1567 case content::SessionStorageNamespace::MERGE_RESULT_MERGEABLE:
1564 RecordEvent(EVENT_NAMESPACE_MISMATCH_MERGE_RESULT_MERGEABLE); 1568 RecordEvent(EVENT_NAMESPACE_MISMATCH_MERGE_RESULT_MERGEABLE);
1565 break; 1569 break;
1566 default: 1570 default:
1567 NOTREACHED(); 1571 NOTREACHED();
1568 } 1572 }
1569 } 1573 }
1570 1574
1571 } // namespace prerender 1575 } // namespace prerender
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_local_predictor.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698