| 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 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 937 } | 937 } |
| 938 | 938 |
| 939 if (IsPrerenderSilenceExperiment(origin)) | 939 if (IsPrerenderSilenceExperiment(origin)) |
| 940 return nullptr; | 940 return nullptr; |
| 941 | 941 |
| 942 GURL url = url_arg; | 942 GURL url = url_arg; |
| 943 GURL alias_url; | 943 GURL alias_url; |
| 944 | 944 |
| 945 // From here on, we will record a FinalStatus so we need to register with the | 945 // From here on, we will record a FinalStatus so we need to register with the |
| 946 // histogram tracking. | 946 // histogram tracking. |
| 947 histograms_->RecordPrerender(origin, url_arg); | 947 histograms_->RecordPrerender(); |
| 948 | 948 |
| 949 if (profile_->GetPrefs()->GetBoolean(prefs::kBlockThirdPartyCookies) && | 949 if (profile_->GetPrefs()->GetBoolean(prefs::kBlockThirdPartyCookies) && |
| 950 origin != ORIGIN_OFFLINE) { | 950 origin != ORIGIN_OFFLINE) { |
| 951 RecordFinalStatusWithoutCreatingPrerenderContents( | 951 RecordFinalStatusWithoutCreatingPrerenderContents( |
| 952 url, origin, FINAL_STATUS_BLOCK_THIRD_PARTY_COOKIES); | 952 url, origin, FINAL_STATUS_BLOCK_THIRD_PARTY_COOKIES); |
| 953 return nullptr; | 953 return nullptr; |
| 954 } | 954 } |
| 955 | 955 |
| 956 NetworkPredictionStatus prerendering_status = | 956 NetworkPredictionStatus prerendering_status = |
| 957 GetPredictionStatusForOrigin(origin); | 957 GetPredictionStatusForOrigin(origin); |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1463 return weak_factory_.GetWeakPtr(); | 1463 return weak_factory_.GetWeakPtr(); |
| 1464 } | 1464 } |
| 1465 | 1465 |
| 1466 void PrerenderManager::SetPrerenderContentsFactoryForTest( | 1466 void PrerenderManager::SetPrerenderContentsFactoryForTest( |
| 1467 PrerenderContents::Factory* prerender_contents_factory) { | 1467 PrerenderContents::Factory* prerender_contents_factory) { |
| 1468 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1468 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1469 prerender_contents_factory_.reset(prerender_contents_factory); | 1469 prerender_contents_factory_.reset(prerender_contents_factory); |
| 1470 } | 1470 } |
| 1471 | 1471 |
| 1472 } // namespace prerender | 1472 } // namespace prerender |
| OLD | NEW |