Chromium Code Reviews| 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 MaxURLChars(); | |
| 34 | |
| 35 // Set a new max size for URL's that we are willing to accept in the browser | |
| 36 // process. | |
| 37 CONTENT_EXPORT void SetMaxURLChars(size_t maxChars); | |
|
boliu
2013/12/10 21:35:44
Maybe call this IncreaseMaxURLCharsForAndroidWebVi
Kristian Monsen
2013/12/10 21:42:07
Well, it can shrink it as well, so keeping the nam
| |
| 38 | |
| 25 } // namespace content | 39 } // namespace content |
| 26 | 40 |
| 27 #endif // CONTENT_PUBLIC_COMMON_URL_UTILS_H_ | 41 #endif // CONTENT_PUBLIC_COMMON_URL_UTILS_H_ |
| OLD | NEW |