| 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 GRPC = 3, | |
| 45 }; | |
| 46 | |
| 47 Assignment(); | |
| 48 Assignment(const Assignment& other); | |
| 49 ~Assignment(); | |
| 50 | |
| 51 // Returns false if the net::IPEndPoint has an unspecified IP, port, or | |
| 52 // transport protocol. | |
| 53 bool IsValid() const; | |
| 54 | |
| 55 // Specifies the transport to use to connect to the engine. | |
| 56 TransportProtocol transport_protocol; | |
| 57 | |
| 58 // Specifies the IP address and port on which to reach the engine. | |
| 59 net::IPEndPoint engine_endpoint; | |
| 60 | |
| 61 // Used to authenticate to the specified engine. | |
| 62 std::string client_auth_token; | |
| 63 | |
| 64 // Specifies the engine's X.509 certificate. | |
| 65 scoped_refptr<net::X509Certificate> cert; | |
| 66 }; | |
| 67 | |
| 68 } // namespace client | |
| 69 } // namespace blimp | |
| 70 | |
| 71 #endif // BLIMP_CLIENT_PUBLIC_SESSION_ASSIGNMENT_H_ | |
| OLD | NEW |