Chromium Code Reviews| Index: components/offline_pages/core/client_id.h |
| diff --git a/components/offline_pages/core/client_id.h b/components/offline_pages/core/client_id.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5429dc23c0d601417fd2ad5264c600864a240f65 |
| --- /dev/null |
| +++ b/components/offline_pages/core/client_id.h |
| @@ -0,0 +1,36 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_OFFLINE_PAGES_CORE_CLIENT_ID_H_ |
| +#define COMPONENTS_OFFLINE_PAGES_CORE_CLIENT_ID_H_ |
| + |
| +#include <string> |
| + |
| +namespace offline_pages { |
| + |
| +// Defines a namespace/id pair that allows offline page clients to uniquely |
| +// identify their own items within adopting internal systems. It is the client's |
| +// responsibility to keep id values unique within its assigned namespace, but it |
| +// is not a requirement. |
| +struct ClientId { |
| + ClientId(); |
| + ClientId(std::string name_space, std::string id); |
|
fgorski
2017/06/02 17:33:31
Since you are moving stuff, these can be const&s.
carlosk
2017/06/02 17:51:26
Done.
|
| + |
| + bool operator==(const ClientId& client_id) const; |
| + |
| + bool operator<(const ClientId& client_id) const; |
| + |
| + // The namespace that identifies the client (of course 'namespace' is a |
| + // reserved word, so...). |
| + std::string name_space; |
| + |
| + // The client specified id that allows it to uniquely identify entries within |
| + // its namespace. These values are opaque to offline page systems and not used |
| + // internally as an identifier. |
| + std::string id; |
| +}; |
| + |
| +} // namespace offline_pages |
| + |
| +#endif // COMPONENTS_OFFLINE_PAGES_CORE_CLIENT_ID_H_ |