OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, Google Inc. All rights reserved. | 2 * Copyright (C) 2011, Google Inc. All rights reserved. |
3 * Copyright (C) 2014, Samsung Electronics. All rights reserved. | 3 * Copyright (C) 2014, Samsung Electronics. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 100 |
101 return true; | 101 return true; |
102 } | 102 } |
103 | 103 |
104 static bool isSchemeWhitelisted(const String& scheme) | 104 static bool isSchemeWhitelisted(const String& scheme) |
105 { | 105 { |
106 if (!schemeWhitelist) | 106 if (!schemeWhitelist) |
107 initCustomSchemeHandlerWhitelist(); | 107 initCustomSchemeHandlerWhitelist(); |
108 | 108 |
109 StringBuilder builder; | 109 StringBuilder builder; |
110 unsigned length = scheme.length(); | 110 builder.append(scheme.lower().ascii().data()); |
111 for (unsigned i = 0; i < length; ++i) | |
112 builder.append(toASCIILower(scheme[i])); | |
113 | 111 |
114 return schemeWhitelist->contains(builder.toString()); | 112 return schemeWhitelist->contains(builder.toString()); |
115 } | 113 } |
116 | 114 |
117 static bool verifyCustomHandlerScheme(const String& scheme, ExceptionState& exce
ptionState) | 115 static bool verifyCustomHandlerScheme(const String& scheme, ExceptionState& exce
ptionState) |
118 { | 116 { |
119 if (!isValidProtocol(scheme)) { | 117 if (!isValidProtocol(scheme)) { |
120 exceptionState.throwSecurityError("The scheme '" + scheme + "' is not va
lid protocol"); | 118 exceptionState.throwSecurityError("The scheme '" + scheme + "' is not va
lid protocol"); |
121 return false; | 119 return false; |
122 } | 120 } |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 { | 230 { |
233 return "NavigatorContentUtils"; | 231 return "NavigatorContentUtils"; |
234 } | 232 } |
235 | 233 |
236 void provideNavigatorContentUtilsTo(LocalFrame& frame, NavigatorContentUtilsClie
nt* client) | 234 void provideNavigatorContentUtilsTo(LocalFrame& frame, NavigatorContentUtilsClie
nt* client) |
237 { | 235 { |
238 NavigatorContentUtils::provideTo(frame, NavigatorContentUtils::supplementNam
e(), NavigatorContentUtils::create(client)); | 236 NavigatorContentUtils::provideTo(frame, NavigatorContentUtils::supplementNam
e(), NavigatorContentUtils::create(client)); |
239 } | 237 } |
240 | 238 |
241 } // namespace blink | 239 } // namespace blink |
OLD | NEW |