| 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_ITEM_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_ITEM_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_ITEM_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_ITEM_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 15 #include "url/gurl.h" | 15 #include "url/gurl.h" |
| 16 | 16 |
| 17 namespace offline_pages { | 17 namespace offline_pages { |
| 18 | 18 |
| 19 struct ClientId { | 19 struct ClientId { |
| 20 // The namespace for the id (of course 'namespace' is a reserved word, so...) | 20 // The namespace for the id (of course 'namespace' is a reserved word, so...) |
| 21 std::string name_space; | 21 std::string name_space; |
| 22 // The id in the client's namespace. Opaque to us. | 22 // The id in the client's namespace. Opaque to us. |
| 23 std::string id; | 23 std::string id; |
| 24 | 24 |
| 25 ClientId(); | 25 ClientId(); |
| 26 ClientId(std::string name_space, std::string id); | 26 ClientId(std::string name_space, std::string id); |
| 27 | 27 |
| 28 bool operator==(const ClientId& client_id) const; | 28 bool operator==(const ClientId& client_id) const; |
| 29 |
| 30 bool operator<(const ClientId& client_id) const; |
| 29 }; | 31 }; |
| 30 | 32 |
| 31 // Metadata of the offline page. | 33 // Metadata of the offline page. |
| 32 struct OfflinePageItem { | 34 struct OfflinePageItem { |
| 33 public: | 35 public: |
| 34 // Note that this should match with Flags enum in offline_pages.proto. | 36 // Note that this should match with Flags enum in offline_pages.proto. |
| 35 enum Flags { | 37 enum Flags { |
| 36 NO_FLAG = 0, | 38 NO_FLAG = 0, |
| 37 MARKED_FOR_DELETION = 0x1, | 39 MARKED_FOR_DELETION = 0x1, |
| 38 }; | 40 }; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 base::Time expiration_time; | 84 base::Time expiration_time; |
| 83 // Number of times that the offline archive has been accessed. | 85 // Number of times that the offline archive has been accessed. |
| 84 int access_count; | 86 int access_count; |
| 85 // Flags about the state and behavior of the offline page. | 87 // Flags about the state and behavior of the offline page. |
| 86 Flags flags; | 88 Flags flags; |
| 87 }; | 89 }; |
| 88 | 90 |
| 89 } // namespace offline_pages | 91 } // namespace offline_pages |
| 90 | 92 |
| 91 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_ITEM_H_ | 93 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_ITEM_H_ |
| OLD | NEW |