Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(412)

Side by Side Diff: extensions/browser/api/vpn_provider/vpn_provider_api.cc

Issue 1223153003: Move JoinString to the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: windows Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "extensions/browser/api/vpn_provider/vpn_provider_api.h" 5 #include "extensions/browser/api/vpn_provider/vpn_provider_api.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 parameters.address, kCIDRSeperator, base::KEEP_WHITESPACE, 105 parameters.address, kCIDRSeperator, base::KEEP_WHITESPACE,
106 base::SPLIT_WANT_NONEMPTY); 106 base::SPLIT_WANT_NONEMPTY);
107 CHECK_EQ(2u, cidr_parts.size()); 107 CHECK_EQ(2u, cidr_parts.size());
108 108
109 parameter_value->SetStringWithoutPathExpansion( 109 parameter_value->SetStringWithoutPathExpansion(
110 shill::kAddressParameterThirdPartyVpn, cidr_parts[0]); 110 shill::kAddressParameterThirdPartyVpn, cidr_parts[0]);
111 111
112 parameter_value->SetStringWithoutPathExpansion( 112 parameter_value->SetStringWithoutPathExpansion(
113 shill::kSubnetPrefixParameterThirdPartyVpn, cidr_parts[1]); 113 shill::kSubnetPrefixParameterThirdPartyVpn, cidr_parts[1]);
114 114
115 std::string ip_delimiter(1, shill::kIPDelimiter);
115 parameter_value->SetStringWithoutPathExpansion( 116 parameter_value->SetStringWithoutPathExpansion(
116 shill::kExclusionListParameterThirdPartyVpn, 117 shill::kExclusionListParameterThirdPartyVpn,
117 JoinString(parameters.exclusion_list, shill::kIPDelimiter)); 118 base::JoinString(parameters.exclusion_list, ip_delimiter));
118 119
119 parameter_value->SetStringWithoutPathExpansion( 120 parameter_value->SetStringWithoutPathExpansion(
120 shill::kInclusionListParameterThirdPartyVpn, 121 shill::kInclusionListParameterThirdPartyVpn,
121 JoinString(parameters.inclusion_list, shill::kIPDelimiter)); 122 base::JoinString(parameters.inclusion_list, ip_delimiter));
122 123
123 if (parameters.mtu) { 124 if (parameters.mtu) {
124 parameter_value->SetStringWithoutPathExpansion( 125 parameter_value->SetStringWithoutPathExpansion(
125 shill::kMtuParameterThirdPartyVpn, *parameters.mtu); 126 shill::kMtuParameterThirdPartyVpn, *parameters.mtu);
126 } 127 }
127 128
128 if (parameters.broadcast_address) { 129 if (parameters.broadcast_address) {
129 parameter_value->SetStringWithoutPathExpansion( 130 parameter_value->SetStringWithoutPathExpansion(
130 shill::kBroadcastAddressParameterThirdPartyVpn, 131 shill::kBroadcastAddressParameterThirdPartyVpn,
131 *parameters.broadcast_address); 132 *parameters.broadcast_address);
132 } 133 }
133 134
135 std::string non_ip_delimiter(1, shill::kNonIPDelimiter);
134 if (parameters.domain_search) { 136 if (parameters.domain_search) {
135 parameter_value->SetStringWithoutPathExpansion( 137 parameter_value->SetStringWithoutPathExpansion(
136 shill::kDomainSearchParameterThirdPartyVpn, 138 shill::kDomainSearchParameterThirdPartyVpn,
137 JoinString(*parameters.domain_search, shill::kNonIPDelimiter)); 139 base::JoinString(*parameters.domain_search, non_ip_delimiter));
138 } 140 }
139 141
140 parameter_value->SetStringWithoutPathExpansion( 142 parameter_value->SetStringWithoutPathExpansion(
141 shill::kDnsServersParameterThirdPartyVpn, 143 shill::kDnsServersParameterThirdPartyVpn,
142 JoinString(parameters.dns_servers, shill::kIPDelimiter)); 144 base::JoinString(parameters.dns_servers, ip_delimiter));
143 145
144 return; 146 return;
145 } 147 }
146 148
147 } // namespace 149 } // namespace
148 150
149 VpnThreadExtensionFunction::~VpnThreadExtensionFunction() { 151 VpnThreadExtensionFunction::~VpnThreadExtensionFunction() {
150 } 152 }
151 153
152 void VpnThreadExtensionFunction::SignalCallCompletionSuccess() { 154 void VpnThreadExtensionFunction::SignalCallCompletionSuccess() {
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 SignalCallCompletionSuccess, 323 SignalCallCompletionSuccess,
322 this), 324 this),
323 base::Bind(&VpnProviderNotifyConnectionStateChangedFunction:: 325 base::Bind(&VpnProviderNotifyConnectionStateChangedFunction::
324 SignalCallCompletionFailure, 326 SignalCallCompletionFailure,
325 this)); 327 this));
326 328
327 return RespondLater(); 329 return RespondLater();
328 } 330 }
329 331
330 } // namespace extensions 332 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/management/management_api.cc ('k') | extensions/browser/content_verifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698