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

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

Issue 1174803002: [Offline] Adding archiver interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@offline-pages-store
Patch Set: Created 5 years, 6 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 | « components/offline_pages/BUILD.gn ('k') | components/offline_pages/offline_page_archiver.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_ARCHIVER_H_
6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_ARCHIVER_H_
7
8 #include "base/files/file_path.h"
9 #include "url/gurl.h"
10
11 namespace offline_pages {
12
13 // Interface of a class responsible for creation of the archive for offline use.
14 class OfflinePageArchiver {
15 public:
16 // Represents an in progress request to archive a page.
17 struct Request {
18 public:
19 explicit Request(const GURL& url);
20 ~Request();
21 GURL url;
22 };
23
24 // Interface of the clients that requests to archive pages.
25 class Client {
26 public:
27 virtual ~Client();
28
29 // Callback called by the archiver upon successful creation of the archive.
30 virtual void OnCreateArchiveSuccess(const Request& request,
31 const base::FilePath& file_path) = 0;
32 // Callback called by the archiver when it fails to create the archive.
33 virtual void OnCreateArchiveFailure(const Request& request) = 0;
Dmitry Titov 2015/06/11 18:35:32 What about returning some sort of error? I'm think
fgorski 2015/06/11 23:30:02 Done.
34
35 protected:
36 Client();
37 };
38
39 OfflinePageArchiver();
40 virtual ~OfflinePageArchiver();
41
42 // Starts creating the archive. Will pass result by calling methods on the
43 // passed in client.
Dmitry Titov 2015/06/11 18:35:32 It is a good place to add comment about 'suggested
fgorski 2015/06/11 23:30:02 Dropped the parameter per offline discussion.
44 virtual Request CreateArchive(
Dmitry Titov 2015/06/11 18:35:32 I think you want to return a pointer or ref to Req
fgorski 2015/06/11 23:30:02 Done.
45 const GURL& url,
46 const std::string& suggested_file_name,
47 Client* client) = 0;
48 // Cancels an in progress request to archive a page.
49 virtual void CancelRequest(const Request& request) = 0;
50 };
51
52 } // namespace offline_pages
53
54 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_ARCHIVER_H_
OLDNEW
« no previous file with comments | « components/offline_pages/BUILD.gn ('k') | components/offline_pages/offline_page_archiver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698