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