OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_OFFLINE_PAGES_CORE_CLIENT_ID_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_CORE_CLIENT_ID_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 namespace offline_pages { |
| 11 |
| 12 // Defines a namespace/id pair that allows offline page clients to uniquely |
| 13 // identify their own items within adopting internal systems. It is the client's |
| 14 // responsibility to keep id values unique within its assigned namespace, but it |
| 15 // is not a requirement. |
| 16 struct ClientId { |
| 17 ClientId(); |
| 18 ClientId(const std::string& name_space, const std::string& id); |
| 19 |
| 20 bool operator==(const ClientId& client_id) const; |
| 21 |
| 22 bool operator<(const ClientId& client_id) const; |
| 23 |
| 24 // The namespace that identifies the client (of course 'namespace' is a |
| 25 // reserved word, so...). |
| 26 std::string name_space; |
| 27 |
| 28 // The client specified id that allows it to uniquely identify entries within |
| 29 // its namespace. These values are opaque to offline page systems and not used |
| 30 // internally as an identifier. |
| 31 std::string id; |
| 32 }; |
| 33 |
| 34 } // namespace offline_pages |
| 35 |
| 36 #endif // COMPONENTS_OFFLINE_PAGES_CORE_CLIENT_ID_H_ |
OLD | NEW |