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 <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
963 | 963 |
964 if (!IsEnabled()) | 964 if (!IsEnabled()) |
965 return NULL; | 965 return NULL; |
966 | 966 |
967 if ((origin == ORIGIN_LINK_REL_PRERENDER_CROSSDOMAIN || | 967 if ((origin == ORIGIN_LINK_REL_PRERENDER_CROSSDOMAIN || |
968 origin == ORIGIN_LINK_REL_PRERENDER_SAMEDOMAIN) && | 968 origin == ORIGIN_LINK_REL_PRERENDER_SAMEDOMAIN) && |
969 IsGoogleSearchResultURL(referrer.url)) { | 969 IsGoogleSearchResultURL(referrer.url)) { |
970 origin = ORIGIN_GWS_PRERENDER; | 970 origin = ORIGIN_GWS_PRERENDER; |
971 } | 971 } |
972 | 972 |
973 DeleteOldEntries(); | |
974 to_delete_prerenders_.clear(); | |
975 | |
976 GURL url = url_arg; | 973 GURL url = url_arg; |
977 GURL alias_url; | 974 GURL alias_url; |
978 uint8 experiment = GetQueryStringBasedExperiment(url_arg); | 975 uint8 experiment = GetQueryStringBasedExperiment(url_arg); |
979 if (IsControlGroup(experiment) && | 976 if (IsControlGroup(experiment) && |
980 MaybeGetQueryStringBasedAliasURL(url, &alias_url)) { | 977 MaybeGetQueryStringBasedAliasURL(url, &alias_url)) { |
981 url = alias_url; | 978 url = alias_url; |
982 } | 979 } |
983 | 980 |
984 // From here on, we will record a FinalStatus so we need to register with the | 981 // From here on, we will record a FinalStatus so we need to register with the |
985 // histogram tracking. | 982 // histogram tracking. |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1310 if (!render_process_host || !render_process_host->GetBrowserContext()) | 1307 if (!render_process_host || !render_process_host->GetBrowserContext()) |
1311 return NULL; | 1308 return NULL; |
1312 Profile* profile = Profile::FromBrowserContext( | 1309 Profile* profile = Profile::FromBrowserContext( |
1313 render_process_host->GetBrowserContext()); | 1310 render_process_host->GetBrowserContext()); |
1314 if (!profile) | 1311 if (!profile) |
1315 return NULL; | 1312 return NULL; |
1316 return PrerenderManagerFactory::GetInstance()->GetForProfile(profile); | 1313 return PrerenderManagerFactory::GetInstance()->GetForProfile(profile); |
1317 } | 1314 } |
1318 | 1315 |
1319 } // namespace prerender | 1316 } // namespace prerender |
OLD | NEW |