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

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

Issue 2449913002: Support WebSocket in WebRequest API. (Closed)
Patch Set: git cl format Created 3 years, 10 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/url_pattern.h ('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) 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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <ostream> 9 #include <ostream>
10 10
(...skipping 13 matching lines...) Expand all
24 const char URLPattern::kAllUrlsPattern[] = "<all_urls>"; 24 const char URLPattern::kAllUrlsPattern[] = "<all_urls>";
25 25
26 namespace { 26 namespace {
27 27
28 // TODO(aa): What about more obscure schemes like data: and javascript: ? 28 // TODO(aa): What about more obscure schemes like data: and javascript: ?
29 // Note: keep this array in sync with kValidSchemeMasks. 29 // Note: keep this array in sync with kValidSchemeMasks.
30 const char* const kValidSchemes[] = { 30 const char* const kValidSchemes[] = {
31 url::kHttpScheme, url::kHttpsScheme, 31 url::kHttpScheme, url::kHttpsScheme,
32 url::kFileScheme, url::kFtpScheme, 32 url::kFileScheme, url::kFtpScheme,
33 content::kChromeUIScheme, extensions::kExtensionScheme, 33 content::kChromeUIScheme, extensions::kExtensionScheme,
34 url::kFileSystemScheme, 34 url::kFileSystemScheme, url::kWsScheme,
35 url::kWssScheme,
35 }; 36 };
36 37
37 const int kValidSchemeMasks[] = { 38 const int kValidSchemeMasks[] = {
38 URLPattern::SCHEME_HTTP, 39 URLPattern::SCHEME_HTTP, URLPattern::SCHEME_HTTPS,
39 URLPattern::SCHEME_HTTPS, 40 URLPattern::SCHEME_FILE, URLPattern::SCHEME_FTP,
40 URLPattern::SCHEME_FILE, 41 URLPattern::SCHEME_CHROMEUI, URLPattern::SCHEME_EXTENSION,
41 URLPattern::SCHEME_FTP, 42 URLPattern::SCHEME_FILESYSTEM, URLPattern::SCHEME_WS,
42 URLPattern::SCHEME_CHROMEUI, 43 URLPattern::SCHEME_WSS,
43 URLPattern::SCHEME_EXTENSION,
44 URLPattern::SCHEME_FILESYSTEM,
45 }; 44 };
46 45
47 static_assert(arraysize(kValidSchemes) == arraysize(kValidSchemeMasks), 46 static_assert(arraysize(kValidSchemes) == arraysize(kValidSchemeMasks),
48 "must keep these arrays in sync"); 47 "must keep these arrays in sync");
49 48
50 const char kParseSuccess[] = "Success."; 49 const char kParseSuccess[] = "Success.";
51 const char kParseErrorMissingSchemeSeparator[] = "Missing scheme separator."; 50 const char kParseErrorMissingSchemeSeparator[] = "Missing scheme separator.";
52 const char kParseErrorInvalidScheme[] = "Invalid scheme."; 51 const char kParseErrorInvalidScheme[] = "Invalid scheme.";
53 const char kParseErrorWrongSchemeType[] = "Wrong scheme type."; 52 const char kParseErrorWrongSchemeType[] = "Wrong scheme type.";
54 const char kParseErrorEmptyHost[] = "Host can not be empty."; 53 const char kParseErrorEmptyHost[] = "Host can not be empty.";
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 } 623 }
625 624
626 return result; 625 return result;
627 } 626 }
628 627
629 // static 628 // static
630 const char* URLPattern::GetParseResultString( 629 const char* URLPattern::GetParseResultString(
631 URLPattern::ParseResult parse_result) { 630 URLPattern::ParseResult parse_result) {
632 return kParseResultMessages[parse_result]; 631 return kParseResultMessages[parse_result];
633 } 632 }
OLDNEW
« no previous file with comments | « extensions/common/url_pattern.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698