Index: content/public/common/url_utils.h |
diff --git a/content/public/common/url_utils.h b/content/public/common/url_utils.h |
index 0b67ab809727c8a894690dd6d7da0d0a79743ac4..5429599c516b64dd8a345953efbdc724a5d3b307 100644 |
--- a/content/public/common/url_utils.h |
+++ b/content/public/common/url_utils.h |
@@ -5,6 +5,8 @@ |
#ifndef CONTENT_PUBLIC_COMMON_URL_UTILS_H_ |
#define CONTENT_PUBLIC_COMMON_URL_UTILS_H_ |
+#include <stddef.h> // For size_t |
+ |
#include "content/common/content_export.h" |
class GURL; |
@@ -22,6 +24,21 @@ CONTENT_EXPORT bool HasWebUIScheme(const GURL& url); |
// Check whether we can do the saving page operation for the specified URL. |
CONTENT_EXPORT bool IsSavableURL(const GURL& url); |
+// The maximum number of characters in the URL that we're willing to accept |
+// in the browser process. It is set low enough to avoid damage to the browser |
+// but high enough that a web site can abuse location.hash for a little storage. |
+// We have different values for "max accepted" and "max displayed" because |
+// a data: URI may be legitimately massive, but the full URI would kill all |
+// known operating systems if you dropped it into a UI control. |
+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.
|
+ |
+#if defined(OS_ANDROID) |
+// Set a new max size for URL's that we are willing to accept in the browser |
+// process. |
+// 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.
|
+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.
|
+#endif |
+ |
} // namespace content |
#endif // CONTENT_PUBLIC_COMMON_URL_UTILS_H_ |