summaryrefslogtreecommitdiff
path: root/chromium/content/browser/frame_host/navigation_entry_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/content/browser/frame_host/navigation_entry_impl.cc')
-rw-r--r--chromium/content/browser/frame_host/navigation_entry_impl.cc15
1 files changed, 3 insertions, 12 deletions
diff --git a/chromium/content/browser/frame_host/navigation_entry_impl.cc b/chromium/content/browser/frame_host/navigation_entry_impl.cc
index aa9c80e2ce7..b3f2141a93b 100644
--- a/chromium/content/browser/frame_host/navigation_entry_impl.cc
+++ b/chromium/content/browser/frame_host/navigation_entry_impl.cc
@@ -20,6 +20,7 @@
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "components/url_formatter/url_formatter.h"
+#include "content/browser/frame_host/navigation_controller_impl.h"
#include "content/common/content_constants_internal.h"
#include "content/common/navigation_params.h"
#include "content/common/page_state_serialization.h"
@@ -735,18 +736,8 @@ RequestNavigationParams NavigationEntryImpl::ConstructRequestNavigationParams(
intended_as_new_entry, pending_offset_to_send, current_offset_to_send,
current_length_to_send, IsViewSourceMode(), should_clear_history_list());
#if defined(OS_ANDROID)
- if (GetDataURLAsString() &&
- GetDataURLAsString()->size() <= kMaxLengthOfDataURLString) {
- // The number of characters that is enough for validating a data: URI. From
- // the GURL's POV, the only important part here is scheme, it doesn't check
- // the actual content. Thus we can take only the prefix of the url, to avoid
- // unneeded copying of a potentially long string.
- const size_t kDataUriPrefixMaxLen = 64;
- GURL data_url(std::string(
- GetDataURLAsString()->front_as<char>(),
- std::min(GetDataURLAsString()->size(), kDataUriPrefixMaxLen)));
- if (data_url.is_valid() && data_url.SchemeIs(url::kDataScheme))
- request_params.data_url_as_string = GetDataURLAsString()->data();
+ if (NavigationControllerImpl::ValidateDataURLAsString(GetDataURLAsString())) {
+ request_params.data_url_as_string = GetDataURLAsString()->data();
}
#endif
return request_params;