OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROME_BROWSER_EXTENSIONS_API_GCD_PRIVATE_PRIVET_V3_SESSION_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_GCD_PRIVATE_PRIVET_V3_SESSION_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_GCD_PRIVATE_PRIVET_V3_SESSION_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_GCD_PRIVATE_PRIVET_V3_SESSION_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
| 10 #include <memory> |
10 #include <string> | 11 #include <string> |
11 | 12 |
12 #include "base/callback.h" | 13 #include "base/callback.h" |
13 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
14 #include "base/macros.h" | 15 #include "base/macros.h" |
15 #include "base/memory/scoped_ptr.h" | |
16 #include "base/memory/scoped_vector.h" | 16 #include "base/memory/scoped_vector.h" |
17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
18 #include "chrome/common/extensions/api/gcd_private.h" | 18 #include "chrome/common/extensions/api/gcd_private.h" |
19 #include "net/url_request/url_fetcher.h" | 19 #include "net/url_request/url_fetcher.h" |
20 | 20 |
21 namespace base { | 21 namespace base { |
22 class DictionaryValue; | 22 class DictionaryValue; |
23 } | 23 } |
24 | 24 |
25 namespace crypto { | 25 namespace crypto { |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 // Current authentication token. | 109 // Current authentication token. |
110 std::string privet_auth_token_; | 110 std::string privet_auth_token_; |
111 | 111 |
112 // ID of the session received from pairing/start. | 112 // ID of the session received from pairing/start. |
113 std::string session_id_; | 113 std::string session_id_; |
114 | 114 |
115 // Device commitment received from pairing/start. | 115 // Device commitment received from pairing/start. |
116 std::string commitment_; | 116 std::string commitment_; |
117 | 117 |
118 // Key exchange algorithm for pairing. | 118 // Key exchange algorithm for pairing. |
119 scoped_ptr<crypto::P224EncryptedKeyExchange> spake_; | 119 std::unique_ptr<crypto::P224EncryptedKeyExchange> spake_; |
120 | 120 |
121 // HTTPS port of the device. | 121 // HTTPS port of the device. |
122 uint16_t https_port_ = 0; | 122 uint16_t https_port_ = 0; |
123 | 123 |
124 // If true, HTTPS will be used. | 124 // If true, HTTPS will be used. |
125 bool use_https_ = false; | 125 bool use_https_ = false; |
126 | 126 |
127 // List of fetches to cancel when session is destroyed. | 127 // List of fetches to cancel when session is destroyed. |
128 ScopedVector<FetcherDelegate> fetchers_; | 128 ScopedVector<FetcherDelegate> fetchers_; |
129 | 129 |
130 // Intercepts POST requests. Used by tests only. | 130 // Intercepts POST requests. Used by tests only. |
131 base::Callback<void(const base::DictionaryValue&)> on_post_data_; | 131 base::Callback<void(const base::DictionaryValue&)> on_post_data_; |
132 | 132 |
133 base::WeakPtrFactory<PrivetV3Session> weak_ptr_factory_; | 133 base::WeakPtrFactory<PrivetV3Session> weak_ptr_factory_; |
134 DISALLOW_COPY_AND_ASSIGN(PrivetV3Session); | 134 DISALLOW_COPY_AND_ASSIGN(PrivetV3Session); |
135 }; | 135 }; |
136 | 136 |
137 } // namespace extensions | 137 } // namespace extensions |
138 | 138 |
139 #endif // CHROME_BROWSER_EXTENSIONS_API_GCD_PRIVATE_PRIVET_V3_SESSION_H_ | 139 #endif // CHROME_BROWSER_EXTENSIONS_API_GCD_PRIVATE_PRIVET_V3_SESSION_H_ |
OLD | NEW |