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

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

Issue 1997543002: [Useless] Hooking up storage manager in page model. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shouldClean
Patch Set: 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
« no previous file with comments | « no previous file | components/offline_pages/offline_page_model.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 // not found. See |GetBestPageForOnlineURL| for selection criteria. 208 // not found. See |GetBestPageForOnlineURL| for selection criteria.
209 const OfflinePageItem* MaybeGetBestPageForOnlineURL( 209 const OfflinePageItem* MaybeGetBestPageForOnlineURL(
210 const GURL& online_url) const; 210 const GURL& online_url) const;
211 211
212 // Checks that all of the offline pages have corresponding offline copies. 212 // Checks that all of the offline pages have corresponding offline copies.
213 // If a page is discovered to be missing an offline copy, its offline page 213 // If a page is discovered to be missing an offline copy, its offline page
214 // metadata will be removed and |OfflinePageDeleted| will be sent to model 214 // metadata will be removed and |OfflinePageDeleted| will be sent to model
215 // observers. 215 // observers.
216 void CheckForExternalFileDeletion(); 216 void CheckForExternalFileDeletion();
217 217
218 // Call storage manager to clear expired pages explicitly.
219 void ExpirePages(const OfflinePageStorageManager::ClearPageCallback&);
fgorski 2016/05/19 04:16:23 Who is calling this one?
romax 2016/05/20 00:47:50 No one is calling this one as of now. I was assumi
220
218 // Returns the policy controller. 221 // Returns the policy controller.
219 ClientPolicyController* GetPolicyController(); 222 ClientPolicyController* GetPolicyController();
220 223
221 // Methods for testing only: 224 // Methods for testing only:
222 OfflinePageMetadataStore* GetStoreForTesting(); 225 OfflinePageMetadataStore* GetStoreForTesting();
223 226
224 OfflinePageStorageManager* GetStorageManager(); 227 OfflinePageStorageManager* GetStorageManager();
225 228
226 bool is_loaded() const; 229 bool is_loaded() const;
227 230
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 325
323 // Actually does the work of deleting, requires the model is loaded. 326 // Actually does the work of deleting, requires the model is loaded.
324 void DoDeletePagesByOfflineId(const std::vector<int64_t>& offline_ids, 327 void DoDeletePagesByOfflineId(const std::vector<int64_t>& offline_ids,
325 const DeletePageCallback& callback); 328 const DeletePageCallback& callback);
326 329
327 // Similar to DoDeletePagesByOfflineId, does actual work of deleting, and 330 // Similar to DoDeletePagesByOfflineId, does actual work of deleting, and
328 // requires that the model is loaded. 331 // requires that the model is loaded.
329 void DoDeletePagesByURLPredicate(const UrlPredicate& predicate, 332 void DoDeletePagesByURLPredicate(const UrlPredicate& predicate,
330 const DeletePageCallback& callback); 333 const DeletePageCallback& callback);
331 334
335 // Callbacks for calling storage manager to expire pages.
336 void OnExpiredPagesCleared(
337 const int expired_page_count,
338 OfflinePageStorageManager::StorageClearResult result);
339
332 void RunWhenLoaded(const base::Closure& job); 340 void RunWhenLoaded(const base::Closure& job);
333 341
334 // Persistent store for offline page metadata. 342 // Persistent store for offline page metadata.
335 std::unique_ptr<OfflinePageMetadataStore> store_; 343 std::unique_ptr<OfflinePageMetadataStore> store_;
336 344
337 // Location where all of the archive files will be stored. 345 // Location where all of the archive files will be stored.
338 base::FilePath archives_dir_; 346 base::FilePath archives_dir_;
339 347
340 // The observers. 348 // The observers.
341 base::ObserverList<Observer> observers_; 349 base::ObserverList<Observer> observers_;
(...skipping 20 matching lines...) Expand all
362 std::unique_ptr<ArchiveManager> archive_manager_; 370 std::unique_ptr<ArchiveManager> archive_manager_;
363 371
364 base::WeakPtrFactory<OfflinePageModel> weak_ptr_factory_; 372 base::WeakPtrFactory<OfflinePageModel> weak_ptr_factory_;
365 373
366 DISALLOW_COPY_AND_ASSIGN(OfflinePageModel); 374 DISALLOW_COPY_AND_ASSIGN(OfflinePageModel);
367 }; 375 };
368 376
369 } // namespace offline_pages 377 } // namespace offline_pages
370 378
371 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ 379 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_
OLDNEW
« no previous file with comments | « no previous file | components/offline_pages/offline_page_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698