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

Side by Side Diff: remoting/host/it2me/it2me_native_messaging_host.cc

Issue 1172183002: Move StartsWith[ASCII] to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string_util3
Patch Set: merger Created 5 years, 6 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 | « pdf/pdfium/pdfium_engine.cc ('k') | remoting/host/remoting_me2me_host.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "remoting/host/it2me/it2me_native_messaging_host.h" 5 #include "remoting/host/it2me/it2me_native_messaging_host.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 if (!message.GetString("authServiceWithToken", &auth_service_with_token)) { 161 if (!message.GetString("authServiceWithToken", &auth_service_with_token)) {
162 SendErrorAndExit(response.Pass(), 162 SendErrorAndExit(response.Pass(),
163 "'authServiceWithToken' not found in request."); 163 "'authServiceWithToken' not found in request.");
164 return; 164 return;
165 } 165 }
166 166
167 // For backward compatibility the webapp still passes OAuth service as part of 167 // For backward compatibility the webapp still passes OAuth service as part of
168 // the authServiceWithToken field. But auth service part is always expected to 168 // the authServiceWithToken field. But auth service part is always expected to
169 // be set to oauth2. 169 // be set to oauth2.
170 const char kOAuth2ServicePrefix[] = "oauth2:"; 170 const char kOAuth2ServicePrefix[] = "oauth2:";
171 if (!StartsWithASCII(auth_service_with_token, kOAuth2ServicePrefix, true)) { 171 if (!base::StartsWithASCII(auth_service_with_token, kOAuth2ServicePrefix,
172 true)) {
172 SendErrorAndExit(response.Pass(), "Invalid 'authServiceWithToken': " + 173 SendErrorAndExit(response.Pass(), "Invalid 'authServiceWithToken': " +
173 auth_service_with_token); 174 auth_service_with_token);
174 return; 175 return;
175 } 176 }
176 177
177 xmpp_config.auth_token = 178 xmpp_config.auth_token =
178 auth_service_with_token.substr(strlen(kOAuth2ServicePrefix)); 179 auth_service_with_token.substr(strlen(kOAuth2ServicePrefix));
179 180
180 #if !defined(NDEBUG) 181 #if !defined(NDEBUG)
181 std::string address; 182 std::string address;
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 } 310 }
310 311
311 /* static */ 312 /* static */
312 std::string It2MeNativeMessagingHost::HostStateToString( 313 std::string It2MeNativeMessagingHost::HostStateToString(
313 It2MeHostState host_state) { 314 It2MeHostState host_state) {
314 return ValueToName(kIt2MeHostStates, host_state); 315 return ValueToName(kIt2MeHostStates, host_state);
315 } 316 }
316 317
317 } // namespace remoting 318 } // namespace remoting
318 319
OLDNEW
« no previous file with comments | « pdf/pdfium/pdfium_engine.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698