| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 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 BLIMP_CLIENT_PUBLIC_SESSION_ASSIGNMENT_H_ |
| 6 #define BLIMP_CLIENT_PUBLIC_SESSION_ASSIGNMENT_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/memory/ref_counted.h" |
| 11 #include "net/base/ip_endpoint.h" |
| 12 |
| 13 namespace net { |
| 14 class X509Certificate; |
| 15 } |
| 16 |
| 17 namespace blimp { |
| 18 namespace client { |
| 19 |
| 20 // A Java counterpart will be generated for this enum. |
| 21 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.blimp_public.session |
| 22 enum AssignmentRequestResult { |
| 23 ASSIGNMENT_REQUEST_RESULT_UNKNOWN = 0, |
| 24 ASSIGNMENT_REQUEST_RESULT_OK = 1, |
| 25 ASSIGNMENT_REQUEST_RESULT_BAD_REQUEST = 2, |
| 26 ASSIGNMENT_REQUEST_RESULT_BAD_RESPONSE = 3, |
| 27 ASSIGNMENT_REQUEST_RESULT_INVALID_PROTOCOL_VERSION = 4, |
| 28 ASSIGNMENT_REQUEST_RESULT_EXPIRED_ACCESS_TOKEN = 5, |
| 29 ASSIGNMENT_REQUEST_RESULT_USER_INVALID = 6, |
| 30 ASSIGNMENT_REQUEST_RESULT_OUT_OF_VMS = 7, |
| 31 ASSIGNMENT_REQUEST_RESULT_SERVER_ERROR = 8, |
| 32 ASSIGNMENT_REQUEST_RESULT_SERVER_INTERRUPTED = 9, |
| 33 ASSIGNMENT_REQUEST_RESULT_NETWORK_FAILURE = 10, |
| 34 ASSIGNMENT_REQUEST_RESULT_INVALID_CERT = 11, |
| 35 }; |
| 36 |
| 37 // An Assignment contains the configuration data needed for a client |
| 38 // to connect to the engine. |
| 39 struct Assignment { |
| 40 enum TransportProtocol { |
| 41 UNKNOWN = 0, |
| 42 SSL = 1, |
| 43 TCP = 2, |
| 44 }; |
| 45 |
| 46 Assignment(); |
| 47 Assignment(const Assignment& other); |
| 48 ~Assignment(); |
| 49 |
| 50 // Returns false if the net::IPEndPoint has an unspecified IP, port, or |
| 51 // transport protocol. |
| 52 bool IsValid() const; |
| 53 |
| 54 // Specifies the transport to use to connect to the engine. |
| 55 TransportProtocol transport_protocol; |
| 56 |
| 57 // Specifies the IP address and port on which to reach the engine. |
| 58 net::IPEndPoint engine_endpoint; |
| 59 |
| 60 // Used to authenticate to the specified engine. |
| 61 std::string client_token; |
| 62 |
| 63 // Specifies the engine's X.509 certificate. |
| 64 scoped_refptr<net::X509Certificate> cert; |
| 65 }; |
| 66 |
| 67 } // namespace client |
| 68 } // namespace blimp |
| 69 |
| 70 #endif // BLIMP_CLIENT_PUBLIC_SESSION_ASSIGNMENT_H_ |
| OLD | NEW |