OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 BLIMP_CLIENT_SESSION_ASSIGNMENT_SOURCE_H_ | 5 #ifndef BLIMP_CLIENT_CORE_SESSION_ASSIGNMENT_SOURCE_H_ |
6 #define BLIMP_CLIENT_SESSION_ASSIGNMENT_SOURCE_H_ | 6 #define BLIMP_CLIENT_CORE_SESSION_ASSIGNMENT_SOURCE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "net/base/ip_endpoint.h" | 12 #include "net/base/ip_endpoint.h" |
13 #include "net/url_request/url_fetcher_delegate.h" | 13 #include "net/url_request/url_fetcher_delegate.h" |
14 #include "url/gurl.h" | 14 #include "url/gurl.h" |
15 | 15 |
16 namespace base { | 16 namespace base { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 // Specifies the X.509 certificate that the engine must report. | 57 // Specifies the X.509 certificate that the engine must report. |
58 scoped_refptr<net::X509Certificate> cert; | 58 scoped_refptr<net::X509Certificate> cert; |
59 }; | 59 }; |
60 | 60 |
61 // AssignmentSource provides functionality to find out how a client should | 61 // AssignmentSource provides functionality to find out how a client should |
62 // connect to an engine. | 62 // connect to an engine. |
63 class AssignmentSource : public net::URLFetcherDelegate { | 63 class AssignmentSource : public net::URLFetcherDelegate { |
64 public: | 64 public: |
65 // A Java counterpart will be generated for this enum. | 65 // A Java counterpart will be generated for this enum. |
66 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.blimp.assignment | 66 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.blimp.core.session.assignment |
67 enum Result { | 67 enum Result { |
68 RESULT_UNKNOWN = 0, | 68 RESULT_UNKNOWN = 0, |
69 RESULT_OK = 1, | 69 RESULT_OK = 1, |
70 RESULT_BAD_REQUEST = 2, | 70 RESULT_BAD_REQUEST = 2, |
71 RESULT_BAD_RESPONSE = 3, | 71 RESULT_BAD_RESPONSE = 3, |
72 RESULT_INVALID_PROTOCOL_VERSION = 4, | 72 RESULT_INVALID_PROTOCOL_VERSION = 4, |
73 RESULT_EXPIRED_ACCESS_TOKEN = 5, | 73 RESULT_EXPIRED_ACCESS_TOKEN = 5, |
74 RESULT_USER_INVALID = 6, | 74 RESULT_USER_INVALID = 6, |
75 RESULT_OUT_OF_VMS = 7, | 75 RESULT_OUT_OF_VMS = 7, |
76 RESULT_SERVER_ERROR = 8, | 76 RESULT_SERVER_ERROR = 8, |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 std::unique_ptr<net::URLFetcher> url_fetcher_; | 122 std::unique_ptr<net::URLFetcher> url_fetcher_; |
123 | 123 |
124 base::WeakPtrFactory<AssignmentSource> weak_factory_; | 124 base::WeakPtrFactory<AssignmentSource> weak_factory_; |
125 | 125 |
126 DISALLOW_COPY_AND_ASSIGN(AssignmentSource); | 126 DISALLOW_COPY_AND_ASSIGN(AssignmentSource); |
127 }; | 127 }; |
128 | 128 |
129 } // namespace client | 129 } // namespace client |
130 } // namespace blimp | 130 } // namespace blimp |
131 | 131 |
132 #endif // BLIMP_CLIENT_SESSION_ASSIGNMENT_SOURCE_H_ | 132 #endif // BLIMP_CLIENT_CORE_SESSION_ASSIGNMENT_SOURCE_H_ |
OLD | NEW |