diff options
author | fgorski <fgorski@chromium.org> | 2015-08-12 15:44:57 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-12 22:45:24 +0000 |
commit | 4ac9b01c8a9f24b81312f5951429242418b0281a (patch) | |
tree | 02e84c01c84f3f1b45e947aad02d19c4bdefb0dc /components/offline_pages/offline_page_model.h | |
parent | 28bcb65ebc5f5c67577a813437265d7e6b885620 (diff) | |
download | chromium_src-4ac9b01c8a9f24b81312f5951429242418b0281a.zip chromium_src-4ac9b01c8a9f24b81312f5951429242418b0281a.tar.gz chromium_src-4ac9b01c8a9f24b81312f5951429242418b0281a.tar.bz2 |
[Offline pages] Wiring delete page to the offline bridge
Changes:
* Adding delete page functionality to the offline bridge,
* Adding callback for delete page in OfflinePageCallback
* Updating the offline page model to enable deleting pages by
bookmark ID,
* Adding appropriate tests for the bridge and model
* Changing the model to not use a weak pointer when calling
DeleteArchiveFile, as it was causing a DCHECK in IsValid of the ptr.
The call was replaced with a function in an anonymous namespace, to
avoid a this pointer altogether (alternative was to pass unretained)
BUG=491352
R=jianli@chromium.org,mariakhomenko@chromium.org
Review URL: https://codereview.chromium.org/1286143008
Cr-Commit-Position: refs/heads/master@{#343117}
Diffstat (limited to 'components/offline_pages/offline_page_model.h')
-rw-r--r-- | components/offline_pages/offline_page_model.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/components/offline_pages/offline_page_model.h b/components/offline_pages/offline_page_model.h index d477372..4901914 100644 --- a/components/offline_pages/offline_page_model.h +++ b/components/offline_pages/offline_page_model.h @@ -111,9 +111,10 @@ class OfflinePageModel : public KeyedService { scoped_ptr<OfflinePageArchiver> archiver, const SavePageCallback& callback); - // Deletes an offline page related to the passed |url|. Requires that the - // model is loaded - void DeletePage(const GURL& url, const DeletePageCallback& callback); + // Deletes an offline page related to the passed |bookmark_id|. Requires that + // the model is loaded. + void DeletePageByBookmarkId(int64 bookmark_id, + const DeletePageCallback& callback); // Gets all available offline pages. Requires that the model is loaded. const std::vector<OfflinePageItem>& GetAllPages() const; @@ -132,6 +133,9 @@ class OfflinePageModel : public KeyedService { private: typedef ScopedVector<OfflinePageArchiver> PendingArchivers; + void DeletePage(const OfflinePageItem& offline_page, + const DeletePageCallback& callback); + // Callback for loading pages from the offline page metadata store. void OnLoadDone(bool success, const std::vector<OfflinePageItem>& offline_pages); @@ -154,7 +158,6 @@ class OfflinePageModel : public KeyedService { void DeletePendingArchiver(OfflinePageArchiver* archiver); // Steps for deleting files and data for an offline page. - void DeleteArchiverFile(const base::FilePath& file_path, bool* success); void OnDeleteArchiverFileDone( const GURL& url, const DeletePageCallback& callback, |