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

Side by Side Diff: extensions/common/url_pattern.cc

Issue 1200393002: Add more string_util functions to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string
Patch Set: Android 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
« no previous file with comments | « extensions/common/error_utils.cc ('k') | extensions/renderer/dispatcher.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/common/url_pattern.h" 5 #include "extensions/common/url_pattern.h"
6 6
7 #include <ostream> 7 #include <ostream>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_piece.h" 10 #include "base/strings/string_piece.h"
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 return true; 322 return true;
323 } 323 }
324 324
325 return false; 325 return false;
326 } 326 }
327 327
328 void URLPattern::SetPath(const std::string& path) { 328 void URLPattern::SetPath(const std::string& path) {
329 spec_.clear(); 329 spec_.clear();
330 path_ = path; 330 path_ = path;
331 path_escaped_ = path_; 331 path_escaped_ = path_;
332 ReplaceSubstringsAfterOffset(&path_escaped_, 0, "\\", "\\\\"); 332 base::ReplaceSubstringsAfterOffset(&path_escaped_, 0, "\\", "\\\\");
333 ReplaceSubstringsAfterOffset(&path_escaped_, 0, "?", "\\?"); 333 base::ReplaceSubstringsAfterOffset(&path_escaped_, 0, "?", "\\?");
334 } 334 }
335 335
336 bool URLPattern::SetPort(const std::string& port) { 336 bool URLPattern::SetPort(const std::string& port) {
337 spec_.clear(); 337 spec_.clear();
338 if (IsValidPortForScheme(scheme_, port)) { 338 if (IsValidPortForScheme(scheme_, port)) {
339 port_ = port; 339 port_ = port;
340 return true; 340 return true;
341 } 341 }
342 return false; 342 return false;
343 } 343 }
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 } 605 }
606 606
607 return result; 607 return result;
608 } 608 }
609 609
610 // static 610 // static
611 const char* URLPattern::GetParseResultString( 611 const char* URLPattern::GetParseResultString(
612 URLPattern::ParseResult parse_result) { 612 URLPattern::ParseResult parse_result) {
613 return kParseResultMessages[parse_result]; 613 return kParseResultMessages[parse_result];
614 } 614 }
OLDNEW
« no previous file with comments | « extensions/common/error_utils.cc ('k') | extensions/renderer/dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698