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

Side by Side Diff: chrome/browser/android/offline_pages/recent_tab_helper.h

Issue 2657013002: Introduce ThreadTaskRunnerHandle::OverrideForTesting and TestMockTimeTaskRunner::ScopedContext. (Closed)
Patch Set: fix RecentTabHelperTest crash? Created 3 years, 9 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_ANDROID_OFFLINE_PAGES_RECENT_TAB_HELPER_H_ 5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_RECENT_TAB_HELPER_H_
6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_RECENT_TAB_HELPER_H_ 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_RECENT_TAB_HELPER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 // SnapshotController::Client 44 // SnapshotController::Client
45 void StartSnapshot() override; 45 void StartSnapshot() override;
46 46
47 // Delegate that is used by RecentTabHelper to get external dependencies. 47 // Delegate that is used by RecentTabHelper to get external dependencies.
48 // Default implementation lives in .cc file, while tests provide an override. 48 // Default implementation lives in .cc file, while tests provide an override.
49 class Delegate { 49 class Delegate {
50 public: 50 public:
51 virtual ~Delegate() {} 51 virtual ~Delegate() {}
52 virtual std::unique_ptr<OfflinePageArchiver> CreatePageArchiver( 52 virtual std::unique_ptr<OfflinePageArchiver> CreatePageArchiver(
53 content::WebContents* web_contents) = 0; 53 content::WebContents* web_contents) = 0;
54 virtual scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() = 0;
55 // There is no expectations that tab_id is always present. 54 // There is no expectations that tab_id is always present.
56 virtual bool GetTabId(content::WebContents* web_contents, int* tab_id) = 0; 55 virtual bool GetTabId(content::WebContents* web_contents, int* tab_id) = 0;
57 virtual bool IsLowEndDevice() = 0; 56 virtual bool IsLowEndDevice() = 0;
58 }; 57 };
59 void SetDelegate(std::unique_ptr<RecentTabHelper::Delegate> delegate); 58 void SetDelegate(std::unique_ptr<RecentTabHelper::Delegate> delegate);
60 59
61 // Creates a request to download the current page with a properly filled 60 // Creates a request to download the current page with a properly filled
62 // |client_id| and valid |request_id| issued by RequestCoordinator from a 61 // |client_id| and valid |request_id| issued by RequestCoordinator from a
63 // suspended request. This method might be called multiple times for the same 62 // suspended request. This method might be called multiple times for the same
64 // page at any point after its navigation commits. There are some important 63 // page at any point after its navigation commits. There are some important
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 bool last_n_listen_to_tab_hidden_ = false; 144 bool last_n_listen_to_tab_hidden_ = false;
146 145
147 base::WeakPtrFactory<RecentTabHelper> weak_ptr_factory_; 146 base::WeakPtrFactory<RecentTabHelper> weak_ptr_factory_;
148 147
149 DISALLOW_COPY_AND_ASSIGN(RecentTabHelper); 148 DISALLOW_COPY_AND_ASSIGN(RecentTabHelper);
150 }; 149 };
151 150
152 } // namespace offline_pages 151 } // namespace offline_pages
153 152
154 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_RECENT_TAB_HELPER_H_ 153 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_RECENT_TAB_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698