Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Unified Diff: content/public/common/url_utils.h

Issue 112053002: Allow the max url length to be overridden (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: including build headers so OS_ANDROID will be defined Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..1d1f68d245b946d3d5153d18db943539315f1eb7 100644
--- a/content/public/common/url_utils.h
+++ b/content/public/common/url_utils.h
@@ -5,6 +5,9 @@
#ifndef CONTENT_PUBLIC_COMMON_URL_UTILS_H_
#define CONTENT_PUBLIC_COMMON_URL_UTILS_H_
+#include <stddef.h> // For size_t
+
+#include "build/build_config.h"
#include "content/common/content_export.h"
class GURL;
@@ -22,6 +25,28 @@ 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);
+#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 except by Android WebView for backwards compatibility.
+// Should be called early in start up before forking child processes.
+//
+// This is for supporting legacy android apps, android webview needs to
+// support loading long data urls. In chrome, the url length is limited to 2M to
+// prevent renderer process DOS-ing the browser process. So only for android
+// webview, increase the limit to 20M, which is a large enough value to satisfy
+// legacy app compatibility requirements.
+CONTENT_EXPORT void SetMaxURLChars(size_t max_chars);
+#endif
+
+// 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 GetMaxURLChars();
+
} // namespace content
#endif // CONTENT_PUBLIC_COMMON_URL_UTILS_H_

Powered by Google App Engine
This is Rietveld 408576698