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

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

Issue 2714733003: [Offline Pages] Add a timer to BackgroundLoaderOffliner to delay SavePage by 2 seconds. (Closed)
Patch Set: 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_BACKGROUND_LOADER_OFFLINER_H_ 5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_BACKGROUND_LOADER_OFFLINER_H_
6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_BACKGROUND_LOADER_OFFLINER_H_ 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_BACKGROUND_LOADER_OFFLINER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/android/application_status_listener.h" 10 #include "base/android/application_status_listener.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 protected: 49 protected:
50 // Called to reset internal loader and observer state. 50 // Called to reset internal loader and observer state.
51 virtual void ResetState(); 51 virtual void ResetState();
52 52
53 private: 53 private:
54 friend class TestBackgroundLoaderOffliner; 54 friend class TestBackgroundLoaderOffliner;
55 55
56 enum SaveState { NONE, SAVING, DELETE_AFTER_SAVE }; 56 enum SaveState { NONE, SAVING, DELETE_AFTER_SAVE };
57 enum PageLoadState { SUCCESS, RETRIABLE, NONRETRIABLE }; 57 enum PageLoadState { SUCCESS, RETRIABLE, NONRETRIABLE };
58 58
59 // Called when the page is ready to be saved.
60 void SavePage();
61
59 // Called when the page has been saved. 62 // Called when the page has been saved.
60 void OnPageSaved(SavePageResult save_result, int64_t offline_id); 63 void OnPageSaved(SavePageResult save_result, int64_t offline_id);
61 64
62 // Called when application state has changed. 65 // Called when application state has changed.
63 void OnApplicationStateChange( 66 void OnApplicationStateChange(
64 base::android::ApplicationState application_state); 67 base::android::ApplicationState application_state);
65 68
66 std::unique_ptr<background_loader::BackgroundLoaderContents> loader_; 69 std::unique_ptr<background_loader::BackgroundLoaderContents> loader_;
67 // Not owned. 70 // Not owned.
68 content::BrowserContext* browser_context_; 71 content::BrowserContext* browser_context_;
(...skipping 11 matching lines...) Expand all
80 SaveState save_state_; 83 SaveState save_state_;
81 // Page load state. 84 // Page load state.
82 PageLoadState page_load_state_; 85 PageLoadState page_load_state_;
83 86
84 base::WeakPtrFactory<BackgroundLoaderOffliner> weak_ptr_factory_; 87 base::WeakPtrFactory<BackgroundLoaderOffliner> weak_ptr_factory_;
85 DISALLOW_COPY_AND_ASSIGN(BackgroundLoaderOffliner); 88 DISALLOW_COPY_AND_ASSIGN(BackgroundLoaderOffliner);
86 }; 89 };
87 90
88 } // namespace offline_pages 91 } // namespace offline_pages
89 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_BACKGROUND_LOADER_OFFLINER_H_ 92 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_BACKGROUND_LOADER_OFFLINER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698