OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |