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

Side by Side Diff: components/offline_pages/offline_page_model.h

Issue 1988973002: [Offline pages] Moving disk size related calls to Archive Manager, reorganizing UMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@archive-manager
Patch Set: Addressing feedback Created 4 years, 7 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ 5 #ifndef COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_
6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 // not found. See |GetBestPageForOnlineURL| for selection criteria. 206 // not found. See |GetBestPageForOnlineURL| for selection criteria.
207 const OfflinePageItem* MaybeGetBestPageForOnlineURL( 207 const OfflinePageItem* MaybeGetBestPageForOnlineURL(
208 const GURL& online_url) const; 208 const GURL& online_url) const;
209 209
210 // Checks that all of the offline pages have corresponding offline copies. 210 // Checks that all of the offline pages have corresponding offline copies.
211 // If a page is discovered to be missing an offline copy, its offline page 211 // If a page is discovered to be missing an offline copy, its offline page
212 // metadata will be removed and |OfflinePageDeleted| will be sent to model 212 // metadata will be removed and |OfflinePageDeleted| will be sent to model
213 // observers. 213 // observers.
214 void CheckForExternalFileDeletion(); 214 void CheckForExternalFileDeletion();
215 215
216 // Reports the storage histograms related to total size of all stored offline
217 // pages. Method is to be called after a page was saved or some pages are
218 // deleted. In the latter case |reporting_after_delete| is set to true.
219 // Caller is supposed to provide the current |total_space_bytes| on drive
220 // where the pages are stored, as well as |free_space_bytes| after the
221 // operation was taken. The method will report total size of all pages, and
222 // percentage of size of pages as compared to total space and free space.
223 void RecordStorageHistograms(int64_t total_space_bytes,
224 int64_t free_space_bytes,
225 bool reporting_after_delete);
226
227 // Returns the policy controller. 216 // Returns the policy controller.
228 ClientPolicyController* GetPolicyController(); 217 ClientPolicyController* GetPolicyController();
229 218
230 // Methods for testing only: 219 // Methods for testing only:
231 OfflinePageMetadataStore* GetStoreForTesting(); 220 OfflinePageMetadataStore* GetStoreForTesting();
232 221
233 OfflinePageStorageManager* GetStorageManager(); 222 OfflinePageStorageManager* GetStorageManager();
234 223
235 bool is_loaded() const; 224 bool is_loaded() const;
236 225
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 std::unique_ptr<ArchiveManager> archive_manager_; 360 std::unique_ptr<ArchiveManager> archive_manager_;
372 361
373 base::WeakPtrFactory<OfflinePageModel> weak_ptr_factory_; 362 base::WeakPtrFactory<OfflinePageModel> weak_ptr_factory_;
374 363
375 DISALLOW_COPY_AND_ASSIGN(OfflinePageModel); 364 DISALLOW_COPY_AND_ASSIGN(OfflinePageModel);
376 }; 365 };
377 366
378 } // namespace offline_pages 367 } // namespace offline_pages
379 368
380 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ 369 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_
OLDNEW
« no previous file with comments | « components/offline_pages/archive_manager_unittest.cc ('k') | components/offline_pages/offline_page_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698