Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2010 Apple Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 231 | 231 |
| 232 builder.append(scheme); | 232 builder.append(scheme); |
| 233 } | 233 } |
| 234 return builder.toString(); | 234 return builder.toString(); |
| 235 } | 235 } |
| 236 | 236 |
| 237 bool SchemeRegistry::shouldTreatURLSchemeAsLegacy(const String& scheme) { | 237 bool SchemeRegistry::shouldTreatURLSchemeAsLegacy(const String& scheme) { |
| 238 return scheme == "ftp" || scheme == "gopher"; | 238 return scheme == "ftp" || scheme == "gopher"; |
| 239 } | 239 } |
| 240 | 240 |
| 241 bool SchemeRegistry::shouldTrackUsageMetricsForScheme(const String& scheme) { | |
| 242 // The scheme represents content which likely cannot be easily updated. | |
| 243 // Specifically this includes internal pages such as about, chrome-devtools, | |
| 244 // etc. | |
| 245 // "chrome-extension" is not included because they have a single deployment | |
| 246 // point (the webstore) and are designed specifically for Chrome. | |
| 247 // "data" is not included because real sites shouldn't be using it for | |
|
PhistucK
2016/12/24 08:19:26
I have seen data: used as a top level browsing con
| |
| 248 // top-level | |
| 249 // pages and Chrome does use it internally (eg. PluginPlaceholder). | |
| 250 return scheme == "http" || scheme == "https" || scheme == "file"; | |
| 251 } | |
| 252 | |
| 241 void SchemeRegistry::registerURLSchemeAsAllowingServiceWorkers( | 253 void SchemeRegistry::registerURLSchemeAsAllowingServiceWorkers( |
| 242 const String& scheme) { | 254 const String& scheme) { |
| 243 DCHECK_EQ(scheme, scheme.lower()); | 255 DCHECK_EQ(scheme, scheme.lower()); |
| 244 getMutableURLSchemesRegistry().serviceWorkerSchemes.add(scheme); | 256 getMutableURLSchemesRegistry().serviceWorkerSchemes.add(scheme); |
| 245 } | 257 } |
| 246 | 258 |
| 247 bool SchemeRegistry::shouldTreatURLSchemeAsAllowingServiceWorkers( | 259 bool SchemeRegistry::shouldTreatURLSchemeAsAllowingServiceWorkers( |
| 248 const String& scheme) { | 260 const String& scheme) { |
| 249 DCHECK_EQ(scheme, scheme.lower()); | 261 DCHECK_EQ(scheme, scheme.lower()); |
| 250 if (scheme.isEmpty()) | 262 if (scheme.isEmpty()) |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 341 | 353 |
| 342 bool SchemeRegistry::schemeShouldBypassSecureContextCheck( | 354 bool SchemeRegistry::schemeShouldBypassSecureContextCheck( |
| 343 const String& scheme) { | 355 const String& scheme) { |
| 344 if (scheme.isEmpty()) | 356 if (scheme.isEmpty()) |
| 345 return false; | 357 return false; |
| 346 DCHECK_EQ(scheme, scheme.lower()); | 358 DCHECK_EQ(scheme, scheme.lower()); |
| 347 return getURLSchemesRegistry().secureContextBypassingSchemes.contains(scheme); | 359 return getURLSchemesRegistry().secureContextBypassingSchemes.contains(scheme); |
| 348 } | 360 } |
| 349 | 361 |
| 350 } // namespace blink | 362 } // namespace blink |
| OLD | NEW |