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

Side by Side Diff: content/renderer/media/webrtc/stun_field_trial.cc

Issue 1278973003: Revert of Update SplitString calls to new form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « content/renderer/manifest/manifest_parser.cc ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "content/renderer/media/webrtc/stun_field_trial.h" 5 #include "content/renderer/media/webrtc/stun_field_trial.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 SaveHistogramData(prober); 126 SaveHistogramData(prober);
127 } 127 }
128 128
129 } // namespace 129 } // namespace
130 130
131 bool ParseStunProbeParameters(const std::string& params, 131 bool ParseStunProbeParameters(const std::string& params,
132 int* requests_per_ip, 132 int* requests_per_ip,
133 int* interval_ms, 133 int* interval_ms,
134 int* shared_socket_mode, 134 int* shared_socket_mode,
135 std::vector<rtc::SocketAddress>* servers) { 135 std::vector<rtc::SocketAddress>* servers) {
136 std::vector<std::string> stun_params = base::SplitString( 136 std::vector<std::string> stun_params;
137 params, "/", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); 137 base::SplitString(params, '/', &stun_params);
138 138
139 if (stun_params.size() < 4) { 139 if (stun_params.size() < 4) {
140 DLOG(ERROR) << "Not enough parameters specified in StartStunProbeTrial"; 140 DLOG(ERROR) << "Not enough parameters specified in StartStunProbeTrial";
141 return false; 141 return false;
142 } 142 }
143 auto param = stun_params.begin(); 143 auto param = stun_params.begin();
144 144
145 if (param->empty()) { 145 if (param->empty()) {
146 *requests_per_ip = 10; 146 *requests_per_ip = 10;
147 } else if (!base::StringToInt(*param, requests_per_ip)) { 147 } else if (!base::StringToInt(*param, requests_per_ip)) {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 rtc::Callback2<void, StunProber*, int>(&OnStunProbeTrialFinished))) { 213 rtc::Callback2<void, StunProber*, int>(&OnStunProbeTrialFinished))) {
214 DLOG(ERROR) << "Failed to Start in StartStunProbeTrial"; 214 DLOG(ERROR) << "Failed to Start in StartStunProbeTrial";
215 OnStunProbeTrialFinished(prober.get(), StunProber::GENERIC_FAILURE); 215 OnStunProbeTrialFinished(prober.get(), StunProber::GENERIC_FAILURE);
216 return nullptr; 216 return nullptr;
217 } 217 }
218 218
219 return prober; 219 return prober;
220 } 220 }
221 221
222 } // namespace content 222 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/manifest/manifest_parser.cc ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698