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

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

Issue 2197333002: Enable PrerenderTests on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove DCHECK Created 4 years, 4 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
« no previous file with comments | « build/android/pylib/gtest/filter/unit_tests_disabled ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 25 matching lines...) Expand all
36 #include "chrome/browser/prerender/prerender_tab_helper.h" 36 #include "chrome/browser/prerender/prerender_tab_helper.h"
37 #include "chrome/browser/prerender/prerender_util.h" 37 #include "chrome/browser/prerender/prerender_util.h"
38 #include "chrome/browser/profiles/profile.h" 38 #include "chrome/browser/profiles/profile.h"
39 #include "chrome/browser/tab_contents/tab_util.h" 39 #include "chrome/browser/tab_contents/tab_util.h"
40 #include "chrome/browser/ui/browser_navigator_params.h" 40 #include "chrome/browser/ui/browser_navigator_params.h"
41 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" 41 #include "chrome/browser/ui/tab_contents/core_tab_helper.h"
42 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h" 42 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h"
43 #include "chrome/common/prerender_types.h" 43 #include "chrome/common/prerender_types.h"
44 #include "components/content_settings/core/common/pref_names.h" 44 #include "components/content_settings/core/common/pref_names.h"
45 #include "components/prefs/pref_service.h" 45 #include "components/prefs/pref_service.h"
46 #include "components/search/search.h"
47 #include "content/public/browser/browser_thread.h" 46 #include "content/public/browser/browser_thread.h"
48 #include "content/public/browser/devtools_agent_host.h" 47 #include "content/public/browser/devtools_agent_host.h"
49 #include "content/public/browser/navigation_controller.h" 48 #include "content/public/browser/navigation_controller.h"
50 #include "content/public/browser/notification_service.h" 49 #include "content/public/browser/notification_service.h"
51 #include "content/public/browser/notification_source.h" 50 #include "content/public/browser/notification_source.h"
52 #include "content/public/browser/render_frame_host.h" 51 #include "content/public/browser/render_frame_host.h"
53 #include "content/public/browser/render_process_host.h" 52 #include "content/public/browser/render_process_host.h"
54 #include "content/public/browser/render_view_host.h" 53 #include "content/public/browser/render_view_host.h"
55 #include "content/public/browser/resource_request_details.h" 54 #include "content/public/browser/resource_request_details.h"
56 #include "content/public/browser/session_storage_namespace.h" 55 #include "content/public/browser/session_storage_namespace.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 url, 268 url,
270 referrer, 269 referrer,
271 size, 270 size,
272 session_storage_namespace); 271 session_storage_namespace);
273 } 272 }
274 273
275 std::unique_ptr<PrerenderHandle> PrerenderManager::AddPrerenderForInstant( 274 std::unique_ptr<PrerenderHandle> PrerenderManager::AddPrerenderForInstant(
276 const GURL& url, 275 const GURL& url,
277 content::SessionStorageNamespace* session_storage_namespace, 276 content::SessionStorageNamespace* session_storage_namespace,
278 const gfx::Size& size) { 277 const gfx::Size& size) {
279 DCHECK(search::ShouldPrefetchSearchResults());
280 return AddPrerender(ORIGIN_INSTANT, url, content::Referrer(), size, 278 return AddPrerender(ORIGIN_INSTANT, url, content::Referrer(), size,
mmenke 2016/08/01 21:13:09 I could alternatively add kPrefetchSearchResults t
pasko 2016/08/02 09:23:47 Acknowledged.
281 session_storage_namespace); 279 session_storage_namespace);
282 } 280 }
283 281
284 std::unique_ptr<PrerenderHandle> PrerenderManager::AddPrerenderForOffline( 282 std::unique_ptr<PrerenderHandle> PrerenderManager::AddPrerenderForOffline(
285 const GURL& url, 283 const GURL& url,
286 content::SessionStorageNamespace* session_storage_namespace, 284 content::SessionStorageNamespace* session_storage_namespace,
287 const gfx::Size& size) { 285 const gfx::Size& size) {
288 return AddPrerender(ORIGIN_OFFLINE, url, content::Referrer(), size, 286 return AddPrerender(ORIGIN_OFFLINE, url, content::Referrer(), size,
289 session_storage_namespace); 287 session_storage_namespace);
290 } 288 }
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after
1283 DCHECK_EQ(1u, erased); 1281 DCHECK_EQ(1u, erased);
1284 } 1282 }
1285 1283
1286 void PrerenderManager::SetPrerenderContentsFactoryForTest( 1284 void PrerenderManager::SetPrerenderContentsFactoryForTest(
1287 PrerenderContents::Factory* prerender_contents_factory) { 1285 PrerenderContents::Factory* prerender_contents_factory) {
1288 DCHECK_CURRENTLY_ON(BrowserThread::UI); 1286 DCHECK_CURRENTLY_ON(BrowserThread::UI);
1289 prerender_contents_factory_.reset(prerender_contents_factory); 1287 prerender_contents_factory_.reset(prerender_contents_factory);
1290 } 1288 }
1291 1289
1292 } // namespace prerender 1290 } // namespace prerender
OLDNEW
« no previous file with comments | « build/android/pylib/gtest/filter/unit_tests_disabled ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698