OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CONTENT_PUBLIC_COMMON_URL_UTILS_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_URL_UTILS_H_ |
6 #define CONTENT_PUBLIC_COMMON_URL_UTILS_H_ | 6 #define CONTENT_PUBLIC_COMMON_URL_UTILS_H_ |
7 | 7 |
| 8 #include <stddef.h> // For size_t |
| 9 |
8 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
9 | 11 |
10 class GURL; | 12 class GURL; |
11 | 13 |
12 namespace content { | 14 namespace content { |
13 | 15 |
14 // Null terminated list of schemes that are savable. This function can be | 16 // Null terminated list of schemes that are savable. This function can be |
15 // invoked on any thread. | 17 // invoked on any thread. |
16 CONTENT_EXPORT const char* const* GetSavableSchemes(); | 18 CONTENT_EXPORT const char* const* GetSavableSchemes(); |
17 | 19 |
18 // Returns true if the url has a scheme for WebUI. See also | 20 // Returns true if the url has a scheme for WebUI. See also |
19 // WebUIControllerFactory::UseWebUIForURL in the browser process. | 21 // WebUIControllerFactory::UseWebUIForURL in the browser process. |
20 CONTENT_EXPORT bool HasWebUIScheme(const GURL& url); | 22 CONTENT_EXPORT bool HasWebUIScheme(const GURL& url); |
21 | 23 |
22 // Check whether we can do the saving page operation for the specified URL. | 24 // Check whether we can do the saving page operation for the specified URL. |
23 CONTENT_EXPORT bool IsSavableURL(const GURL& url); | 25 CONTENT_EXPORT bool IsSavableURL(const GURL& url); |
24 | 26 |
| 27 // The maximum number of characters in the URL that we're willing to accept |
| 28 // in the browser process. It is set low enough to avoid damage to the browser |
| 29 // but high enough that a web site can abuse location.hash for a little storage. |
| 30 // We have different values for "max accepted" and "max displayed" because |
| 31 // a data: URI may be legitimately massive, but the full URI would kill all |
| 32 // known operating systems if you dropped it into a UI control. |
| 33 CONTENT_EXPORT size_t GetMaxURLChars(); |
| 34 |
| 35 #if defined(OS_ANDROID) |
| 36 // Set a new max size for URL's that we are willing to accept in the browser |
| 37 // process. |
| 38 // Should not be used except by Android WebView for backwards compatibility. |
| 39 // Should be called early in start up before forking child processes. |
| 40 CONTENT_EXPORT void SetMaxURLChars(size_t max_chars); |
| 41 #endif |
| 42 |
25 } // namespace content | 43 } // namespace content |
26 | 44 |
27 #endif // CONTENT_PUBLIC_COMMON_URL_UTILS_H_ | 45 #endif // CONTENT_PUBLIC_COMMON_URL_UTILS_H_ |
OLD | NEW |