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" | 7 #include "net/base/filename_util.h" |
8 | 8 |
9 namespace offline_pages { | 9 namespace offline_pages { |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 : url(url), | 39 : url(url), |
40 bookmark_id(bookmark_id), | 40 bookmark_id(bookmark_id), |
41 version(kCurrentVersion), | 41 version(kCurrentVersion), |
42 file_path(file_path), | 42 file_path(file_path), |
43 file_size(file_size), | 43 file_size(file_size), |
44 creation_time(creation_time), | 44 creation_time(creation_time), |
45 last_access_time(creation_time), | 45 last_access_time(creation_time), |
46 access_count(0), | 46 access_count(0), |
47 flags(NO_FLAG) {} | 47 flags(NO_FLAG) {} |
48 | 48 |
| 49 OfflinePageItem::OfflinePageItem(const OfflinePageItem& other) = default; |
| 50 |
49 OfflinePageItem::~OfflinePageItem() { | 51 OfflinePageItem::~OfflinePageItem() { |
50 } | 52 } |
51 | 53 |
52 GURL OfflinePageItem::GetOfflineURL() const { | 54 GURL OfflinePageItem::GetOfflineURL() const { |
53 return net::FilePathToFileURL(file_path); | 55 return net::FilePathToFileURL(file_path); |
54 } | 56 } |
55 | 57 |
56 bool OfflinePageItem::IsMarkedForDeletion() const { | 58 bool OfflinePageItem::IsMarkedForDeletion() const { |
57 return (static_cast<int>(flags) & MARKED_FOR_DELETION) != 0; | 59 return (static_cast<int>(flags) & MARKED_FOR_DELETION) != 0; |
58 } | 60 } |
59 | 61 |
60 void OfflinePageItem::MarkForDeletion() { | 62 void OfflinePageItem::MarkForDeletion() { |
61 flags = static_cast<Flags>(static_cast<int>(flags) | MARKED_FOR_DELETION); | 63 flags = static_cast<Flags>(static_cast<int>(flags) | MARKED_FOR_DELETION); |
62 } | 64 } |
63 | 65 |
64 void OfflinePageItem::ClearMarkForDeletion() { | 66 void OfflinePageItem::ClearMarkForDeletion() { |
65 flags = static_cast<Flags>(static_cast<int>(flags) & ~MARKED_FOR_DELETION); | 67 flags = static_cast<Flags>(static_cast<int>(flags) & ~MARKED_FOR_DELETION); |
66 } | 68 } |
67 | 69 |
68 } // namespace offline_pages | 70 } // namespace offline_pages |
OLD | NEW |