Chromium Code Reviews| 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 EXTENSIONS_BROWSER_API_VPN_PROVIDER_VPN_SERVICE_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_VPN_PROVIDER_VPN_SERVICE_H_ |
| 6 #define EXTENSIONS_BROWSER_API_VPN_PROVIDER_VPN_SERVICE_H_ | 6 #define EXTENSIONS_BROWSER_API_VPN_PROVIDER_VPN_SERVICE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 166 | 166 |
| 167 // Creates a new VpnServiceProxy. The caller owns the returned value. It's | 167 // Creates a new VpnServiceProxy. The caller owns the returned value. It's |
| 168 // valid to return nullptr. | 168 // valid to return nullptr. |
| 169 std::unique_ptr<content::VpnServiceProxy> GetVpnServiceProxy(); | 169 std::unique_ptr<content::VpnServiceProxy> GetVpnServiceProxy(); |
| 170 | 170 |
| 171 private: | 171 private: |
| 172 class VpnConfiguration; | 172 class VpnConfiguration; |
| 173 class VpnServiceProxyImpl; | 173 class VpnServiceProxyImpl; |
| 174 | 174 |
| 175 using StringToConfigurationMap = std::map<std::string, VpnConfiguration*>; | 175 using StringToConfigurationMap = std::map<std::string, VpnConfiguration*>; |
| 176 using StringToOwnedConfigurationMap = | |
| 177 std::map<std::string, std::unique_ptr<VpnConfiguration>>; | |
| 176 | 178 |
| 177 // Callback used to indicate that configuration was successfully created. | 179 // Callback used to indicate that configuration was successfully created. |
| 178 void OnCreateConfigurationSuccess(const SuccessCallback& callback, | 180 void OnCreateConfigurationSuccess(const SuccessCallback& callback, |
| 179 VpnConfiguration* configuration, | 181 VpnConfiguration* configuration, |
| 180 const std::string& service_path, | 182 const std::string& service_path, |
| 181 const std::string& guid); | 183 const std::string& guid); |
| 182 | 184 |
| 183 // Callback used to indicate that configuration creation failed. | 185 // Callback used to indicate that configuration creation failed. |
| 184 void OnCreateConfigurationFailure( | 186 void OnCreateConfigurationFailure( |
| 185 const FailureCallback& callback, | 187 const FailureCallback& callback, |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 246 | 248 |
| 247 extensions::ExtensionRegistry* extension_registry_; | 249 extensions::ExtensionRegistry* extension_registry_; |
| 248 extensions::EventRouter* event_router_; | 250 extensions::EventRouter* event_router_; |
| 249 ShillThirdPartyVpnDriverClient* shill_client_; | 251 ShillThirdPartyVpnDriverClient* shill_client_; |
| 250 NetworkConfigurationHandler* network_configuration_handler_; | 252 NetworkConfigurationHandler* network_configuration_handler_; |
| 251 NetworkProfileHandler* network_profile_handler_; | 253 NetworkProfileHandler* network_profile_handler_; |
| 252 NetworkStateHandler* network_state_handler_; | 254 NetworkStateHandler* network_state_handler_; |
| 253 | 255 |
| 254 VpnConfiguration* active_configuration_; | 256 VpnConfiguration* active_configuration_; |
| 255 | 257 |
| 256 // Key map owns the VpnConfigurations. | 258 // Key map owns the VpnConfigurations. |
|
Devlin
2016/09/16 20:23:19
This comment should be unnecessary now.
Avi (use Gerrit)
2016/09/16 20:41:45
Done.
| |
| 257 StringToConfigurationMap key_to_configuration_map_; | 259 StringToOwnedConfigurationMap key_to_configuration_map_; |
| 258 | 260 |
| 259 // Service path does not own the VpnConfigurations. | 261 // Service path does not own the VpnConfigurations. |
| 260 StringToConfigurationMap service_path_to_configuration_map_; | 262 StringToConfigurationMap service_path_to_configuration_map_; |
| 261 | 263 |
| 262 base::WeakPtrFactory<VpnService> weak_factory_; | 264 base::WeakPtrFactory<VpnService> weak_factory_; |
| 263 | 265 |
| 264 DISALLOW_COPY_AND_ASSIGN(VpnService); | 266 DISALLOW_COPY_AND_ASSIGN(VpnService); |
| 265 }; | 267 }; |
| 266 | 268 |
| 267 } // namespace chromeos | 269 } // namespace chromeos |
| 268 | 270 |
| 269 #endif // EXTENSIONS_BROWSER_API_VPN_PROVIDER_VPN_SERVICE_H_ | 271 #endif // EXTENSIONS_BROWSER_API_VPN_PROVIDER_VPN_SERVICE_H_ |
| OLD | NEW |