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

Side by Side Diff: components/cryptauth/data_with_timestamp.h

Issue 2847233003: [EasyUnlock] Move DataWithTimestamp out of ForegroundEidGenerator so it can be shared. (Closed)
Patch Set: fixes Created 3 years, 7 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
(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_CRYPTAUTH_BLE_DATA_WITH_TIMESTAMP_H_
6 #define COMPONENTS_CRYPTAUTH_BLE_DATA_WITH_TIMESTAMP_H_
7
8 #include <string>
9 #include <vector>
10
11 namespace cryptauth {
12
13 // Stores EID-related data and timestamps at which time this data becomes
14 // active or inactive.
15 struct DataWithTimestamp {
16 DataWithTimestamp(const std::string& data,
17 const int64_t start_timestamp_ms,
18 const int64_t end_timestamp_ms);
19 DataWithTimestamp(const DataWithTimestamp& other);
20
21 // Helper function to convert a vector of DataWithTimestamp objects to a human
22 // readable debug string.
23 static std::string ToDebugString(
24 const std::vector<DataWithTimestamp>& data_with_timestamps);
25
26 bool ContainsTime(const int64_t timestamp_ms) const;
27 std::string DataInHex() const;
28
29 bool operator==(const DataWithTimestamp& other) const;
30
31 // The data valid for a given time period.
32 const std::string data;
33
34 // The start time for which the data is valid, inclusive.
35 const int64_t start_timestamp_ms;
36
37 // The end time for which the data is valid, exclusive.
38 const int64_t end_timestamp_ms;
39 };
40
41 } // namespace
42
43 #endif // COMPONENTS_CRYPTAUTH_BLE_DATA_WITH_TIMESTAMP_H_
OLDNEW
« no previous file with comments | « components/cryptauth/background_eid_generator_unittest.cc ('k') | components/cryptauth/data_with_timestamp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698