OLD | NEW |
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_ARCHIVER_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_ARCHIVER_H_ |
6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_ARCHIVER_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_ARCHIVER_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include "base/callback.h" | 10 #include "base/callback.h" |
9 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
10 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
11 #include "url/gurl.h" | 13 #include "url/gurl.h" |
12 | 14 |
13 namespace offline_pages { | 15 namespace offline_pages { |
14 | 16 |
15 // Interface of a class responsible for creation of the archive for offline use. | 17 // Interface of a class responsible for creation of the archive for offline use. |
16 // | 18 // |
17 // Archiver will be implemented by embedder and may have additional methods that | 19 // Archiver will be implemented by embedder and may have additional methods that |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 ERROR_DEVICE_FULL, // Cannot save the archive - device is full. | 53 ERROR_DEVICE_FULL, // Cannot save the archive - device is full. |
52 ERROR_CANCELED, // Caller canceled the request. | 54 ERROR_CANCELED, // Caller canceled the request. |
53 ERROR_CONTENT_UNAVAILABLE, // Content to archive is not available. | 55 ERROR_CONTENT_UNAVAILABLE, // Content to archive is not available. |
54 ERROR_ARCHIVE_CREATION_FAILED, // Creation of archive failed. | 56 ERROR_ARCHIVE_CREATION_FAILED, // Creation of archive failed. |
55 }; | 57 }; |
56 | 58 |
57 typedef base::Callback<void(OfflinePageArchiver* /* archiver */, | 59 typedef base::Callback<void(OfflinePageArchiver* /* archiver */, |
58 ArchiverResult /* result */, | 60 ArchiverResult /* result */, |
59 const GURL& /* url */, | 61 const GURL& /* url */, |
60 const base::FilePath& /* file_path */, | 62 const base::FilePath& /* file_path */, |
61 int64 /* file_size */)> CreateArchiveCallback; | 63 int64_t /* file_size */)> CreateArchiveCallback; |
62 | 64 |
63 virtual ~OfflinePageArchiver() {} | 65 virtual ~OfflinePageArchiver() {} |
64 | 66 |
65 // Starts creating the archive in the |archives_dir|. Once archive is created | 67 // Starts creating the archive in the |archives_dir|. Once archive is created |
66 // |callback| will be called with the result and additional information. | 68 // |callback| will be called with the result and additional information. |
67 virtual void CreateArchive(const base::FilePath& archives_dir, | 69 virtual void CreateArchive(const base::FilePath& archives_dir, |
68 const CreateArchiveCallback& callback) = 0; | 70 const CreateArchiveCallback& callback) = 0; |
69 }; | 71 }; |
70 | 72 |
71 } // namespace offline_pages | 73 } // namespace offline_pages |
72 | 74 |
73 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_ARCHIVER_H_ | 75 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_ARCHIVER_H_ |
OLD | NEW |