Chromium Code Reviews| Index: components/offline_pages/offline_page_metadata_store.h |
| diff --git a/components/offline_pages/offline_page_metadata_store.h b/components/offline_pages/offline_page_metadata_store.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..93d01ab1ed2c420fadd6bb5571dfcc46dddfce14 |
| --- /dev/null |
| +++ b/components/offline_pages/offline_page_metadata_store.h |
| @@ -0,0 +1,44 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_H_ |
| +#define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_H_ |
| + |
| +#include <vector> |
| + |
| +#include "base/callback.h" |
| + |
| +class GURL; |
| + |
| +namespace offline_pages { |
| + |
| +struct OfflinePageItem; |
| + |
| +// OfflinePageMetadataStore keeps metadata for the offline pages. |
|
Dmitry Titov
2015/06/08 21:47:21
Would be nice to add details, for example:
- is it
fgorski
2015/06/09 20:12:17
Done.
I added a comment that nothing like that is
|
| +class OfflinePageMetadataStore { |
| + public: |
| + typedef base::Callback<void(bool, const std::vector<OfflinePageItem>&)> |
| + LoadCallback; |
| + typedef base::Callback<void(bool)> UpdateCallback; |
| + |
| + OfflinePageMetadataStore(); |
| + virtual ~OfflinePageMetadataStore(); |
| + |
| + // Get all of the offline pages from the store. |
|
Dmitry Titov
2015/06/08 21:47:21
Since these methods are async, it's useful to docu
fgorski
2015/06/09 20:12:18
Done.
|
| + virtual void Load(const LoadCallback& callback) = 0; |
| + |
| + // Adds offline page metadata to the store for a given URL. |
| + // Result of the update is passed in callback. |
| + virtual void AddOfflinePage(const OfflinePageItem& offline_page, |
| + const UpdateCallback& callback) = 0; |
| + |
| + // Removes offline page metadata from the store. |
| + // Result of the update is passed in callback. |
| + virtual void RemoveOfflinePage(const GURL& page_url, |
| + const UpdateCallback& callback) = 0; |
| +}; |
| + |
| +} // namespace offline_pages |
| + |
| +#endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_H_ |