Index: components/copresence/tokens.h |
diff --git a/components/copresence/tokens.h b/components/copresence/tokens.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..64e43e1d6be7c9c8924c3f75e7f58f815badf175 |
--- /dev/null |
+++ b/components/copresence/tokens.h |
@@ -0,0 +1,58 @@ |
+// Copyright 2014 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_COPRESENCE_TOKENS_H_ |
+#define COMPONENTS_COPRESENCE_TOKENS_H_ |
+ |
+#include <string> |
+ |
+#include "base/time/time.h" |
+#include "components/copresence/proto/enums.pb.h" |
+ |
+namespace copresence { |
+ |
+struct AudioToken final { |
+ AudioToken(const std::string& token, bool audible) |
+ : token(token), |
+ audible(audible) {} |
+ |
+ std::string token; |
+ bool audible; |
+}; |
+ |
+// It's an error to define these constructors inline, |
rkc
2014/12/18 18:12:09
The AudioToken ctor seems to be fine being declare
Charlie
2014/12/19 03:53:33
If you don't pass in every data member explicitly,
|
+// so they're defined in tokens.cc. |
+ |
+struct TransmittedToken final { |
+ TransmittedToken(); |
+ |
+ std::string id; |
+ TokenMedium medium; |
+ base::Time start_time; |
+ base::Time stop_time; |
+ bool broadcast_confirmed; |
+}; |
+ |
+struct ReceivedToken final { |
+ enum Validity { |
+ UNKNOWN = 0, |
+ VALID = 1, |
+ INVALID = 2 |
+ }; |
+ |
+ ReceivedToken(); |
+ ReceivedToken(const std::string& id, |
+ TokenMedium medium, |
+ base::Time start_time); |
+ |
+ std::string id; |
+ TokenMedium medium; |
+ base::Time start_time; |
+ base::Time last_time; |
+ Validity valid; |
+}; |
+ |
+} // namespace copresence |
+ |
+#endif // COMPONENTS_COPRESENCE_TOKENS_H_ |