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

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

Issue 7800010: Do not count image search results towards the GWS metric. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_manager.h" 5 #include "chrome/browser/prerender/prerender_manager.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 } 292 }
293 293
294 bool PrerenderManager::AddPrerender( 294 bool PrerenderManager::AddPrerender(
295 Origin origin, 295 Origin origin,
296 const std::pair<int, int>& child_route_id_pair, 296 const std::pair<int, int>& child_route_id_pair,
297 const GURL& url_arg, 297 const GURL& url_arg,
298 const GURL& referrer) { 298 const GURL& referrer) {
299 DCHECK(CalledOnValidThread()); 299 DCHECK(CalledOnValidThread());
300 300
301 if (origin == ORIGIN_LINK_REL_PRERENDER && 301 if (origin == ORIGIN_LINK_REL_PRERENDER &&
302 StartsWithASCII(referrer.host(), std::string("www.google."), true)) { 302 StartsWithASCII(referrer.host(), std::string("www.google."), true) &&
303 !StartsWithASCII(referrer.path(), std::string("/imgres"), true)) {
dominich 2011/08/30 14:38:12 As other Google properties use prerendering we wil
303 origin = ORIGIN_GWS_PRERENDER; 304 origin = ORIGIN_GWS_PRERENDER;
304 } 305 }
305 306
306 histograms_->RecordPrerender(origin, url_arg); 307 histograms_->RecordPrerender(origin, url_arg);
307 308
308 // If the referring page is prerendering, defer the prerender. 309 // If the referring page is prerendering, defer the prerender.
309 if (FindPrerenderContentsForChildRouteIdPair(child_route_id_pair) != 310 if (FindPrerenderContentsForChildRouteIdPair(child_route_id_pair) !=
310 prerender_list_.end()) { 311 prerender_list_.end()) {
311 AddPendingPrerender(origin, child_route_id_pair, url_arg, referrer); 312 AddPendingPrerender(origin, child_route_id_pair, url_arg, referrer);
312 return true; 313 return true;
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 DeletePendingDeleteEntries(); 1032 DeletePendingDeleteEntries();
1032 } 1033 }
1033 1034
1034 void PrerenderManager::RecordFinalStatus(Origin origin, 1035 void PrerenderManager::RecordFinalStatus(Origin origin,
1035 uint8 experiment_id, 1036 uint8 experiment_id,
1036 FinalStatus final_status) const { 1037 FinalStatus final_status) const {
1037 histograms_->RecordFinalStatus(origin, experiment_id, final_status); 1038 histograms_->RecordFinalStatus(origin, experiment_id, final_status);
1038 } 1039 }
1039 1040
1040 } // namespace prerender 1041 } // namespace prerender
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698