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

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

Issue 2645713003: [Prerender] Cleanup prerender_util (Closed)
Patch Set: Review comments Created 3 years, 11 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_manager.h" 5 #include "chrome/browser/prerender/prerender_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <functional> 10 #include <functional>
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 // Allow only Requests for offlining on low end devices, the lifetime of 904 // Allow only Requests for offlining on low end devices, the lifetime of
905 // those prerenders is managed by the offliner. 905 // those prerenders is managed by the offliner.
906 if (IsLowEndDevice() && origin != ORIGIN_OFFLINE) { 906 if (IsLowEndDevice() && origin != ORIGIN_OFFLINE) {
907 RecordFinalStatusWithoutCreatingPrerenderContents( 907 RecordFinalStatusWithoutCreatingPrerenderContents(
908 url_arg, origin, FINAL_STATUS_LOW_END_DEVICE); 908 url_arg, origin, FINAL_STATUS_LOW_END_DEVICE);
909 return nullptr; 909 return nullptr;
910 } 910 }
911 911
912 if ((origin == ORIGIN_LINK_REL_PRERENDER_CROSSDOMAIN || 912 if ((origin == ORIGIN_LINK_REL_PRERENDER_CROSSDOMAIN ||
913 origin == ORIGIN_LINK_REL_PRERENDER_SAMEDOMAIN) && 913 origin == ORIGIN_LINK_REL_PRERENDER_SAMEDOMAIN) &&
914 IsGoogleSearchResultURL(referrer.url)) { 914 IsGoogleOriginURL(referrer.url)) {
915 origin = ORIGIN_GWS_PRERENDER; 915 origin = ORIGIN_GWS_PRERENDER;
916 } 916 }
917 917
918 if (IsPrerenderSilenceExperiment(origin)) 918 if (IsPrerenderSilenceExperiment(origin))
919 return nullptr; 919 return nullptr;
920 920
921 GURL url = url_arg; 921 GURL url = url_arg;
922 GURL alias_url; 922 GURL alias_url;
923 923
924 // From here on, we will record a FinalStatus so we need to register with the 924 // From here on, we will record a FinalStatus so we need to register with the
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
1442 return weak_factory_.GetWeakPtr(); 1442 return weak_factory_.GetWeakPtr();
1443 } 1443 }
1444 1444
1445 void PrerenderManager::SetPrerenderContentsFactoryForTest( 1445 void PrerenderManager::SetPrerenderContentsFactoryForTest(
1446 PrerenderContents::Factory* prerender_contents_factory) { 1446 PrerenderContents::Factory* prerender_contents_factory) {
1447 DCHECK_CURRENTLY_ON(BrowserThread::UI); 1447 DCHECK_CURRENTLY_ON(BrowserThread::UI);
1448 prerender_contents_factory_.reset(prerender_contents_factory); 1448 prerender_contents_factory_.reset(prerender_contents_factory);
1449 } 1449 }
1450 1450
1451 } // namespace prerender 1451 } // namespace prerender
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_histograms.cc ('k') | chrome/browser/prerender/prerender_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698