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

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

Issue 7826038: Get rid of some static initializers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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/debugger/debugger_remote_service.cc ('k') | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 22 matching lines...) Expand all
33 URLPattern::SCHEME_HTTPS, 33 URLPattern::SCHEME_HTTPS,
34 URLPattern::SCHEME_FILE, 34 URLPattern::SCHEME_FILE,
35 URLPattern::SCHEME_FTP, 35 URLPattern::SCHEME_FTP,
36 URLPattern::SCHEME_CHROMEUI, 36 URLPattern::SCHEME_CHROMEUI,
37 URLPattern::SCHEME_FILESYSTEM, 37 URLPattern::SCHEME_FILESYSTEM,
38 }; 38 };
39 39
40 COMPILE_ASSERT(arraysize(kValidSchemes) == arraysize(kValidSchemeMasks), 40 COMPILE_ASSERT(arraysize(kValidSchemes) == arraysize(kValidSchemeMasks),
41 must_keep_these_arrays_in_sync); 41 must_keep_these_arrays_in_sync);
42 42
43 const char* kParseSuccess = "Success."; 43 const char kParseSuccess[] = "Success.";
44 const char* kParseErrorMissingSchemeSeparator = "Missing scheme separator."; 44 const char kParseErrorMissingSchemeSeparator[] = "Missing scheme separator.";
45 const char* kParseErrorInvalidScheme = "Invalid scheme."; 45 const char kParseErrorInvalidScheme[] = "Invalid scheme.";
46 const char* kParseErrorWrongSchemeType = "Wrong scheme type."; 46 const char kParseErrorWrongSchemeType[] = "Wrong scheme type.";
47 const char* kParseErrorEmptyHost = "Host can not be empty."; 47 const char kParseErrorEmptyHost[] = "Host can not be empty.";
48 const char* kParseErrorInvalidHostWildcard = "Invalid host wildcard."; 48 const char kParseErrorInvalidHostWildcard[] = "Invalid host wildcard.";
49 const char* kParseErrorEmptyPath = "Empty path."; 49 const char kParseErrorEmptyPath[] = "Empty path.";
50 const char* kParseErrorHasColon = 50 const char kParseErrorHasColon[] =
51 "Ports are not supported in URL patterns. ':' may not be used in a host."; 51 "Ports are not supported in URL patterns. ':' may not be used in a host.";
52 const char* kParseErrorInvalidPort = 52 const char kParseErrorInvalidPort[] =
53 "Invalid port."; 53 "Invalid port.";
54 54
55 // Message explaining each URLPattern::ParseResult. 55 // Message explaining each URLPattern::ParseResult.
56 const char* kParseResultMessages[] = { 56 const char* const kParseResultMessages[] = {
57 kParseSuccess, 57 kParseSuccess,
58 kParseErrorMissingSchemeSeparator, 58 kParseErrorMissingSchemeSeparator,
59 kParseErrorInvalidScheme, 59 kParseErrorInvalidScheme,
60 kParseErrorWrongSchemeType, 60 kParseErrorWrongSchemeType,
61 kParseErrorEmptyHost, 61 kParseErrorEmptyHost,
62 kParseErrorInvalidHostWildcard, 62 kParseErrorInvalidHostWildcard,
63 kParseErrorEmptyPath, 63 kParseErrorEmptyPath,
64 kParseErrorHasColon, 64 kParseErrorHasColon,
65 kParseErrorInvalidPort, 65 kParseErrorInvalidPort,
66 }; 66 };
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 } 490 }
491 491
492 return result; 492 return result;
493 } 493 }
494 494
495 // static 495 // static
496 const char* URLPattern::GetParseResultString( 496 const char* URLPattern::GetParseResultString(
497 URLPattern::ParseResult parse_result) { 497 URLPattern::ParseResult parse_result) {
498 return kParseResultMessages[parse_result]; 498 return kParseResultMessages[parse_result];
499 } 499 }
OLDNEW
« no previous file with comments | « chrome/browser/debugger/debugger_remote_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698