Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(659)

Side by Side Diff: components/offline_items_collection/core/offline_item.cc

Issue 2768953002: Initial work to move downloads to ContentIds (Closed)
Patch Set: Rebase because of a conflict... with a single. import. :( Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/offline_items_collection/core/offline_item.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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_items_collection/core/offline_item.h" 5 #include "components/offline_items_collection/core/offline_item.h"
6 6
7 namespace offline_items_collection { 7 namespace offline_items_collection {
8 8
9 ContentId::ContentId() = default; 9 ContentId::ContentId() = default;
10 10
11 ContentId::ContentId(const ContentId& other) = default; 11 ContentId::ContentId(const ContentId& other) = default;
12 12
13 ContentId::ContentId(const std::string& name_space, const std::string& id) 13 ContentId::ContentId(const std::string& name_space, const std::string& id)
14 : name_space(name_space), id(id) {} 14 : name_space(name_space), id(id) {
15 DCHECK_EQ(std::string::npos, name_space.find_first_of(","));
16 }
15 17
16 ContentId::~ContentId() = default; 18 ContentId::~ContentId() = default;
17 19
18 bool ContentId::operator==(const ContentId& content_id) const { 20 bool ContentId::operator==(const ContentId& content_id) const {
19 return name_space == content_id.name_space && id == content_id.id; 21 return name_space == content_id.name_space && id == content_id.id;
20 } 22 }
21 23
22 bool ContentId::operator<(const ContentId& content_id) const { 24 bool ContentId::operator<(const ContentId& content_id) const {
23 return std::tie(name_space, id) < 25 return std::tie(name_space, id) <
24 std::tie(content_id.name_space, content_id.id); 26 std::tie(content_id.name_space, content_id.id);
(...skipping 30 matching lines...) Expand all
55 original_url == offline_item.original_url && 57 original_url == offline_item.original_url &&
56 is_off_the_record == offline_item.is_off_the_record && 58 is_off_the_record == offline_item.is_off_the_record &&
57 state == offline_item.state && 59 state == offline_item.state &&
58 is_resumable == offline_item.is_resumable && 60 is_resumable == offline_item.is_resumable &&
59 received_bytes == offline_item.received_bytes && 61 received_bytes == offline_item.received_bytes &&
60 percent_completed == offline_item.percent_completed && 62 percent_completed == offline_item.percent_completed &&
61 time_remaining_ms == offline_item.time_remaining_ms; 63 time_remaining_ms == offline_item.time_remaining_ms;
62 } 64 }
63 65
64 } // namespace offline_items_collection 66 } // namespace offline_items_collection
OLDNEW
« no previous file with comments | « components/offline_items_collection/core/offline_item.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698