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(); | |
|
boliu
2013/12/10 21:46:47
Oh, just noticed, this doesn't need to be exported
Tom Sepez
2013/12/10 22:12:19
nit: not clear which process this needs to be call
boliu
2013/12/10 22:21:59
The implied usage is call this early in start up b
jam
2013/12/11 17:23:32
nit: usually getters have a Get prefix, which make
Kristian Monsen
2013/12/11 22:05:42
Done. Should it also have the Google3 syntax for g
Kristian Monsen
2013/12/11 22:05:42
Done. Added a comment.
| |
| 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 exept by Android WebView for backwards compatibility. | |
|
jam
2013/12/11 17:23:32
nit: except
Kristian Monsen
2013/12/11 22:05:42
Done.
| |
| 39 CONTENT_EXPORT void SetMaxURLChars(size_t maxChars); | |
|
jam
2013/12/11 17:23:32
nit: max_chars per style guide
Kristian Monsen
2013/12/11 22:05:42
Done.
| |
| 40 #endif | |
| 41 | |
| 25 } // namespace content | 42 } // namespace content |
| 26 | 43 |
| 27 #endif // CONTENT_PUBLIC_COMMON_URL_UTILS_H_ | 44 #endif // CONTENT_PUBLIC_COMMON_URL_UTILS_H_ |
| OLD | NEW |