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/offline_page_item.h" | 5 #include "components/offline_pages/offline_page_item.h" |
6 | 6 |
7 #include "net/base/filename_util.h" | |
8 | |
9 namespace offline_pages { | 7 namespace offline_pages { |
10 | 8 |
11 namespace { | 9 namespace { |
12 const int kCurrentVersion = 1; | 10 const int kCurrentVersion = 1; |
13 } | 11 } |
14 | 12 |
15 ClientId::ClientId() : name_space(""), id("") {} | 13 ClientId::ClientId() : name_space(""), id("") {} |
16 | 14 |
17 ClientId::ClientId(std::string name_space, std::string id) | 15 ClientId::ClientId(std::string name_space, std::string id) |
18 : name_space(name_space), id(id) {} | 16 : name_space(name_space), id(id) {} |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 creation_time(creation_time), | 62 creation_time(creation_time), |
65 last_access_time(creation_time), | 63 last_access_time(creation_time), |
66 access_count(0), | 64 access_count(0), |
67 flags(NO_FLAG) {} | 65 flags(NO_FLAG) {} |
68 | 66 |
69 OfflinePageItem::OfflinePageItem(const OfflinePageItem& other) = default; | 67 OfflinePageItem::OfflinePageItem(const OfflinePageItem& other) = default; |
70 | 68 |
71 OfflinePageItem::~OfflinePageItem() { | 69 OfflinePageItem::~OfflinePageItem() { |
72 } | 70 } |
73 | 71 |
74 GURL OfflinePageItem::GetOfflineURL() const { | |
75 return net::FilePathToFileURL(file_path); | |
76 } | |
77 | |
78 bool OfflinePageItem::IsExpired() const { | 72 bool OfflinePageItem::IsExpired() const { |
79 return creation_time < expiration_time; | 73 return creation_time < expiration_time; |
80 } | 74 } |
81 | 75 |
82 } // namespace offline_pages | 76 } // namespace offline_pages |
OLD | NEW |