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

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

Issue 10824033: Coverity: Fix several pass-by-values. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Win build fix. Created 8 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/themes/browser_theme_pack.cc ('k') | chrome/test/base/chrome_process_util.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 "chrome/common/extensions/url_pattern.h" 5 #include "chrome/common/extensions/url_pattern.h"
6 6
7 #include "base/string_number_conversions.h" 7 #include "base/string_number_conversions.h"
8 #include "base/string_piece.h" 8 #include "base/string_piece.h"
9 #include "base/string_split.h" 9 #include "base/string_split.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 bool IsStandardScheme(const std::string& scheme) { 70 bool IsStandardScheme(const std::string& scheme) {
71 // "*" gets the same treatment as a standard scheme. 71 // "*" gets the same treatment as a standard scheme.
72 if (scheme == "*") 72 if (scheme == "*")
73 return true; 73 return true;
74 74
75 return url_util::IsStandard(scheme.c_str(), 75 return url_util::IsStandard(scheme.c_str(),
76 url_parse::Component(0, static_cast<int>(scheme.length()))); 76 url_parse::Component(0, static_cast<int>(scheme.length())));
77 } 77 }
78 78
79 bool IsValidPortForScheme(const std::string scheme, const std::string& port) { 79 bool IsValidPortForScheme(const std::string& scheme, const std::string& port) {
80 if (port == "*") 80 if (port == "*")
81 return true; 81 return true;
82 82
83 // Only accept non-wildcard ports if the scheme uses ports. 83 // Only accept non-wildcard ports if the scheme uses ports.
84 if (url_canon::DefaultPortForScheme(scheme.c_str(), scheme.length()) == 84 if (url_canon::DefaultPortForScheme(scheme.c_str(), scheme.length()) ==
85 url_parse::PORT_UNSPECIFIED) { 85 url_parse::PORT_UNSPECIFIED) {
86 return false; 86 return false;
87 } 87 }
88 88
89 int parsed_port = url_parse::PORT_UNSPECIFIED; 89 int parsed_port = url_parse::PORT_UNSPECIFIED;
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 } 514 }
515 515
516 return result; 516 return result;
517 } 517 }
518 518
519 // static 519 // static
520 const char* URLPattern::GetParseResultString( 520 const char* URLPattern::GetParseResultString(
521 URLPattern::ParseResult parse_result) { 521 URLPattern::ParseResult parse_result) {
522 return kParseResultMessages[parse_result]; 522 return kParseResultMessages[parse_result];
523 } 523 }
OLDNEW
« no previous file with comments | « chrome/browser/themes/browser_theme_pack.cc ('k') | chrome/test/base/chrome_process_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698