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

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

Issue 2449913002: Support WebSocket in WebRequest API. (Closed)
Patch Set: Add tests for onAuthRequired path for WS handshake. 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
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,
39 URLPattern::SCHEME_HTTPS, 40 URLPattern::SCHEME_HTTPS,
40 URLPattern::SCHEME_FILE, 41 URLPattern::SCHEME_FILE,
41 URLPattern::SCHEME_FTP, 42 URLPattern::SCHEME_FTP,
42 URLPattern::SCHEME_CHROMEUI, 43 URLPattern::SCHEME_CHROMEUI,
43 URLPattern::SCHEME_EXTENSION, 44 URLPattern::SCHEME_EXTENSION,
44 URLPattern::SCHEME_FILESYSTEM, 45 URLPattern::SCHEME_FILESYSTEM,
46 URLPattern::SCHEME_WS,
47 URLPattern::SCHEME_WSS,
45 }; 48 };
46 49
47 static_assert(arraysize(kValidSchemes) == arraysize(kValidSchemeMasks), 50 static_assert(arraysize(kValidSchemes) == arraysize(kValidSchemeMasks),
48 "must keep these arrays in sync"); 51 "must keep these arrays in sync");
49 52
50 const char kParseSuccess[] = "Success."; 53 const char kParseSuccess[] = "Success.";
51 const char kParseErrorMissingSchemeSeparator[] = "Missing scheme separator."; 54 const char kParseErrorMissingSchemeSeparator[] = "Missing scheme separator.";
52 const char kParseErrorInvalidScheme[] = "Invalid scheme."; 55 const char kParseErrorInvalidScheme[] = "Invalid scheme.";
53 const char kParseErrorWrongSchemeType[] = "Wrong scheme type."; 56 const char kParseErrorWrongSchemeType[] = "Wrong scheme type.";
54 const char kParseErrorEmptyHost[] = "Host can not be empty."; 57 const char kParseErrorEmptyHost[] = "Host can not be empty.";
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 } 627 }
625 628
626 return result; 629 return result;
627 } 630 }
628 631
629 // static 632 // static
630 const char* URLPattern::GetParseResultString( 633 const char* URLPattern::GetParseResultString(
631 URLPattern::ParseResult parse_result) { 634 URLPattern::ParseResult parse_result) {
632 return kParseResultMessages[parse_result]; 635 return kParseResultMessages[parse_result];
633 } 636 }
OLDNEW
« extensions/common/api/web_request.json ('K') | « extensions/common/url_pattern.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698