summaryrefslogtreecommitdiff
path: root/chromium/components/offline_pages/core/offline_page_archiver.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/components/offline_pages/core/offline_page_archiver.h')
-rw-r--r--chromium/components/offline_pages/core/offline_page_archiver.h24
1 files changed, 13 insertions, 11 deletions
diff --git a/chromium/components/offline_pages/core/offline_page_archiver.h b/chromium/components/offline_pages/core/offline_page_archiver.h
index 81fb7a59ea0..8bffda9bc28 100644
--- a/chromium/components/offline_pages/core/offline_page_archiver.h
+++ b/chromium/components/offline_pages/core/offline_page_archiver.h
@@ -5,13 +5,12 @@
#ifndef COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_ARCHIVER_H_
#define COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_ARCHIVER_H_
-#include <stdint.h>
+#include <cstdint>
+#include <string>
#include "base/callback.h"
#include "base/files/file_path.h"
-#include "base/memory/weak_ptr.h"
#include "base/strings/string16.h"
-#include "base/task_scheduler/post_task.h"
#include "components/offline_pages/core/offline_page_item.h"
#include "components/offline_pages/core/offline_page_types.h"
#include "url/gurl.h"
@@ -36,9 +35,6 @@ struct PublishArchiveResult {
int64_t download_id;
};
-using PublishArchiveDoneCallback =
- base::OnceCallback<void(const OfflinePageItem&, PublishArchiveResult*)>;
-
// Interface of a class responsible for creation of the archive for offline use.
//
// Archiver will be implemented by embedder and may have additional methods that
@@ -94,14 +90,17 @@ class OfflinePageArchiver {
bool use_page_problem_detectors;
};
- typedef base::Callback<void(OfflinePageArchiver* /* archiver */,
- ArchiverResult /* result */,
+ using CreateArchiveCallback =
+ base::OnceCallback<void(ArchiverResult /* result */,
const GURL& /* url */,
const base::FilePath& /* file_path */,
const base::string16& /* title */,
int64_t /* file_size */,
- const std::string& /* digest */)>
- CreateArchiveCallback;
+ const std::string& /* digest */)>;
+
+ using PublishArchiveDoneCallback =
+ base::OnceCallback<void(const OfflinePageItem& /* offline_page */,
+ PublishArchiveResult /* archive_result */)>;
virtual ~OfflinePageArchiver() {}
@@ -111,10 +110,13 @@ class OfflinePageArchiver {
virtual void CreateArchive(const base::FilePath& archives_dir,
const CreateArchiveParams& create_archive_params,
content::WebContents* web_contents,
- const CreateArchiveCallback& callback) = 0;
+ CreateArchiveCallback callback) = 0;
// Publishes the page on a background thread, then returns to the
// OfflinePageModelTaskified's done callback.
+ //
+ // TODO(https://crbug.com/849424): move the publish logic out of the archiver
+ // as it doesn't depend on the embedder code as creation logic does.
virtual void PublishArchive(
const OfflinePageItem& offline_page,
const scoped_refptr<base::SequencedTaskRunner>& background_task_runner,