Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |