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 #include "components/offline_pages/core/offline_page_item.h" | 5 #include "components/offline_pages/core/offline_page_item.h" |
6 | 6 |
7 namespace offline_pages { | 7 namespace offline_pages { |
8 | 8 |
9 ClientId::ClientId() : name_space(""), id("") {} | |
10 | |
11 ClientId::ClientId(std::string name_space, std::string id) | |
12 : name_space(name_space), id(id) {} | |
13 | |
14 bool ClientId::operator==(const ClientId& client_id) const { | |
15 return name_space == client_id.name_space && id == client_id.id; | |
16 } | |
17 | |
18 bool ClientId::operator<(const ClientId& client_id) const { | |
19 if (name_space == client_id.name_space) | |
20 return (id < client_id.id); | |
21 | |
22 return name_space < client_id.name_space; | |
23 } | |
24 | |
25 OfflinePageItem::OfflinePageItem() | 9 OfflinePageItem::OfflinePageItem() |
26 : file_size(0), access_count(0), flags(NO_FLAG) {} | 10 : file_size(0), access_count(0), flags(NO_FLAG) {} |
27 | 11 |
28 OfflinePageItem::OfflinePageItem(const GURL& url, | 12 OfflinePageItem::OfflinePageItem(const GURL& url, |
29 int64_t offline_id, | 13 int64_t offline_id, |
30 const ClientId& client_id, | 14 const ClientId& client_id, |
31 const base::FilePath& file_path, | 15 const base::FilePath& file_path, |
32 int64_t file_size) | 16 int64_t file_size) |
33 : url(url), | 17 : url(url), |
34 offline_id(offline_id), | 18 offline_id(offline_id), |
(...skipping 28 matching lines...) Expand all Loading... |
63 client_id == other.client_id && file_path == other.file_path && | 47 client_id == other.client_id && file_path == other.file_path && |
64 creation_time == other.creation_time && | 48 creation_time == other.creation_time && |
65 last_access_time == other.last_access_time && | 49 last_access_time == other.last_access_time && |
66 access_count == other.access_count && | 50 access_count == other.access_count && |
67 title == other.title && | 51 title == other.title && |
68 flags == other.flags && | 52 flags == other.flags && |
69 original_url == other.original_url; | 53 original_url == other.original_url; |
70 } | 54 } |
71 | 55 |
72 } // namespace offline_pages | 56 } // namespace offline_pages |
OLD | NEW |