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

Side by Side Diff: third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp

Issue 2083363003: Remove an unnecessary loop when converting scheme in NavigatorContentUtils (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove an unnecessary loop when converting scheme in NavigatorContentUtils Created 4 years, 6 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 | « no previous file | third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698