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

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

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
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 #ifndef COMPONENTS_OFFLINE_ITEMS_COLLECTION_CORE_OFFLINE_ITEM_H_ 5 #ifndef COMPONENTS_OFFLINE_ITEMS_COLLECTION_CORE_OFFLINE_ITEM_H_
6 #define COMPONENTS_OFFLINE_ITEMS_COLLECTION_CORE_OFFLINE_ITEM_H_ 6 #define COMPONENTS_OFFLINE_ITEMS_COLLECTION_CORE_OFFLINE_ITEM_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/time/time.h" 10 #include "base/time/time.h"
11 #include "components/offline_items_collection/core/offline_item_filter.h" 11 #include "components/offline_items_collection/core/offline_item_filter.h"
12 #include "components/offline_items_collection/core/offline_item_state.h" 12 #include "components/offline_items_collection/core/offline_item_state.h"
13 #include "url/gurl.h" 13 #include "url/gurl.h"
14 14
15 namespace offline_items_collection { 15 namespace offline_items_collection {
16 16
17 // An id that uniquely represents a piece of offline content. 17 // An id that uniquely represents a piece of offline content.
18 struct ContentId { 18 struct ContentId {
19 // The namespace for the offline content. This will be used to associate this 19 // The namespace for the offline content. This will be used to associate this
20 // id with a particular OfflineContentProvider. 20 // id with a particular OfflineContentProvider. A name_space can include
21 // any characters except ','. This is due to a serialization format
22 // limitation.
23 // TODO(dtrainor): Remove the 'no ,' limitation.
21 std::string name_space; 24 std::string name_space;
22 25
23 // The id of the offline item. 26 // The id of the offline item.
24 std::string id; 27 std::string id;
25 28
26 ContentId(); 29 ContentId();
27 ContentId(const ContentId& other); 30 ContentId(const ContentId& other);
28 ContentId(const std::string& name_space, const std::string& id); 31 ContentId(const std::string& name_space, const std::string& id);
29 32
30 ~ContentId(); 33 ~ContentId();
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 118
116 // The estimated time remaining for the download in milliseconds. -1 119 // The estimated time remaining for the download in milliseconds. -1
117 // represents an unknown time remaining. This field is not used if |state| is 120 // represents an unknown time remaining. This field is not used if |state| is
118 // COMPLETE. 121 // COMPLETE.
119 int64_t time_remaining_ms; 122 int64_t time_remaining_ms;
120 }; 123 };
121 124
122 } // namespace offline_items_collection 125 } // namespace offline_items_collection
123 126
124 #endif // COMPONENTS_OFFLINE_ITEMS_COLLECTION_OFFLINE_ITEM_H_ 127 #endif // COMPONENTS_OFFLINE_ITEMS_COLLECTION_OFFLINE_ITEM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698