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

Side by Side Diff: mojo/edk/system/unique_identifier.h

Issue 1346383004: EDK: Remove MOJO_SYSTEM_IMPL_EXPORT, system_impl_export.h, etc. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 3 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 | « mojo/edk/system/transport_data.h ('k') | mojo/edk/system/waiter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 MOJO_EDK_SYSTEM_UNIQUE_IDENTIFIER_H_ 5 #ifndef MOJO_EDK_SYSTEM_UNIQUE_IDENTIFIER_H_
6 #define MOJO_EDK_SYSTEM_UNIQUE_IDENTIFIER_H_ 6 #define MOJO_EDK_SYSTEM_UNIQUE_IDENTIFIER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string.h> 9 #include <string.h>
10 10
11 #include <functional> 11 #include <functional>
12 #include <string> 12 #include <string>
13 13
14 #include "base/containers/hash_tables.h" // For |base::HashInts64()|. 14 #include "base/containers/hash_tables.h" // For |base::HashInts64()|.
15 #include "mojo/edk/system/system_impl_export.h"
16 #include "mojo/public/cpp/system/macros.h" 15 #include "mojo/public/cpp/system/macros.h"
17 16
18 namespace mojo { 17 namespace mojo {
19 namespace system { 18 namespace system {
20 19
21 class UniqueIdentifier; 20 class UniqueIdentifier;
22 21
23 } // namespace system 22 } // namespace system
24 } // namespace mojo 23 } // namespace mojo
25 24
(...skipping 10 matching lines...) Expand all
36 namespace embedder { 35 namespace embedder {
37 36
38 class PlatformSupport; 37 class PlatformSupport;
39 38
40 } // namespace embedder 39 } // namespace embedder
41 40
42 namespace system { 41 namespace system {
43 42
44 // |UniqueIdentifier| is a POD class whose value is used to uniquely identify 43 // |UniqueIdentifier| is a POD class whose value is used to uniquely identify
45 // things. 44 // things.
46 class MOJO_SYSTEM_IMPL_EXPORT UniqueIdentifier { 45 class UniqueIdentifier {
47 public: 46 public:
48 // This generates a new identifier. Uniqueness is "guaranteed" (i.e., 47 // This generates a new identifier. Uniqueness is "guaranteed" (i.e.,
49 // probabilistically) for identifiers. 48 // probabilistically) for identifiers.
50 static UniqueIdentifier Generate(embedder::PlatformSupport* platform_support); 49 static UniqueIdentifier Generate(embedder::PlatformSupport* platform_support);
51 50
52 // This reconstitutes an identifier from its representation as a string 51 // This reconstitutes an identifier from its representation as a string
53 // (generated by |ToString()|, below). On success, |*success| is set to true; 52 // (generated by |ToString()|, below). On success, |*success| is set to true;
54 // on failure, it is set to false (and the return value is undefined). 53 // on failure, it is set to false (and the return value is undefined).
55 static UniqueIdentifier FromString(const std::string& s, bool* success); 54 static UniqueIdentifier FromString(const std::string& s, bool* success);
56 55
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 return base::HashInts64( 97 return base::HashInts64(
99 *reinterpret_cast<uint64_t*>(unique_identifier.data_), 98 *reinterpret_cast<uint64_t*>(unique_identifier.data_),
100 *reinterpret_cast<uint64_t*>(unique_identifier.data_ + 99 *reinterpret_cast<uint64_t*>(unique_identifier.data_ +
101 sizeof(uint64_t))); 100 sizeof(uint64_t)));
102 } 101 }
103 }; 102 };
104 103
105 } // namespace std 104 } // namespace std
106 105
107 #endif // MOJO_EDK_SYSTEM_UNIQUE_IDENTIFIER_H_ 106 #endif // MOJO_EDK_SYSTEM_UNIQUE_IDENTIFIER_H_
OLDNEW
« no previous file with comments | « mojo/edk/system/transport_data.h ('k') | mojo/edk/system/waiter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698