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

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

Issue 2044613003: Adds unit tests for offline_pages::PrerenderAdapter calling PrerenderManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missing override Created 4 years, 6 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 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ 5 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_
6 #define CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <list> 10 #include <list>
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 } 48 }
49 49
50 namespace content { 50 namespace content {
51 class WebContents; 51 class WebContents;
52 } 52 }
53 53
54 namespace gfx { 54 namespace gfx {
55 class Size; 55 class Size;
56 } 56 }
57 57
58 namespace offline_pages {
59 class PrerenderAdapterTest;
60 }
61
58 namespace prerender { 62 namespace prerender {
59 63
60 class PrerenderHandle; 64 class PrerenderHandle;
61 class PrerenderHistory; 65 class PrerenderHistory;
62 class PrerenderLocalPredictor; 66 class PrerenderLocalPredictor;
63 67
64 // PrerenderManager is responsible for initiating and keeping prerendered 68 // PrerenderManager is responsible for initiating and keeping prerendered
65 // views of web pages. All methods must be called on the UI thread unless 69 // views of web pages. All methods must be called on the UI thread unless
66 // indicated otherwise. 70 // indicated otherwise.
67 class PrerenderManager : public base::SupportsWeakPtr<PrerenderManager>, 71 class PrerenderManager : public base::SupportsWeakPtr<PrerenderManager>,
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 // might have committed an omnibox navigation. This is used to possibly 391 // might have committed an omnibox navigation. This is used to possibly
388 // shorten the TTL of the prerendered page. 392 // shorten the TTL of the prerendered page.
389 void SourceNavigatedAway(PrerenderData* prerender_data); 393 void SourceNavigatedAway(PrerenderData* prerender_data);
390 394
391 private: 395 private:
392 friend class ::InstantSearchPrerendererTest; 396 friend class ::InstantSearchPrerendererTest;
393 friend class PrerenderBrowserTest; 397 friend class PrerenderBrowserTest;
394 friend class PrerenderContents; 398 friend class PrerenderContents;
395 friend class PrerenderHandle; 399 friend class PrerenderHandle;
396 friend class UnitTestPrerenderManager; 400 friend class UnitTestPrerenderManager;
401 friend class offline_pages::PrerenderAdapterTest;
mmenke 2016/06/11 00:40:32 Is this still needed? If so, I recommend adding B
dougarnett 2016/06/12 16:43:09 SetPrerenderContentsFactory() is what the test nee
mmenke 2016/06/13 14:52:59 Could you please rename it to SetPrerenderContents
397 402
398 class OnCloseWebContentsDeleter; 403 class OnCloseWebContentsDeleter;
399 struct NavigationRecord; 404 struct NavigationRecord;
400 405
401 // Time interval before a new prerender is allowed. 406 // Time interval before a new prerender is allowed.
402 static const int kMinTimeBetweenPrerendersMs = 500; 407 static const int kMinTimeBetweenPrerendersMs = 500;
403 408
404 // Time window for which we record old navigations, in milliseconds. 409 // Time window for which we record old navigations, in milliseconds.
405 static const int kNavigationRecordWindowMs = 5000; 410 static const int kNavigationRecordWindowMs = 5000;
406 411
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 // Set of process hosts being prerendered. 563 // Set of process hosts being prerendered.
559 typedef std::set<content::RenderProcessHost*> PrerenderProcessSet; 564 typedef std::set<content::RenderProcessHost*> PrerenderProcessSet;
560 PrerenderProcessSet prerender_process_hosts_; 565 PrerenderProcessSet prerender_process_hosts_;
561 566
562 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); 567 DISALLOW_COPY_AND_ASSIGN(PrerenderManager);
563 }; 568 };
564 569
565 } // namespace prerender 570 } // namespace prerender
566 571
567 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ 572 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/android/offline_pages/prerender_adapter_unittest.cc ('k') | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698