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

Unified Diff: content/browser/frame_host/navigation_entry_impl.cc

Issue 1497743005: Allow huge data: URIs only via WebView.loadDataWithBaseUrl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added test for serializing a huge data url Created 5 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/browser/frame_host/navigation_entry_impl.cc
diff --git a/content/browser/frame_host/navigation_entry_impl.cc b/content/browser/frame_host/navigation_entry_impl.cc
index 343951ecd0eb5647d92473898f2457278492c3c6..7e442dfb06f17430d51f32f2cfbb001cf82574e8 100644
--- a/content/browser/frame_host/navigation_entry_impl.cc
+++ b/content/browser/frame_host/navigation_entry_impl.cc
@@ -211,6 +211,14 @@ const GURL& NavigationEntryImpl::GetBaseURLForDataURL() const {
return base_url_for_data_url_;
}
+void NavigationEntryImpl::SetDataURLAsString(const std::string& url) {
+ data_url_as_string_ = url;
Charlie Reis 2015/12/10 20:43:46 Seems like we should be enforcing this starts with
mnaganov (inactive) 2015/12/11 23:14:23 Done in navigation_controller_android.
Charlie Reis 2015/12/14 20:35:56 That's a bit indirect-- navigation_controller_andr
+}
+
+const std::string& NavigationEntryImpl::GetDataURLAsString() const {
+ return data_url_as_string_;
+}
+
void NavigationEntryImpl::SetReferrer(const Referrer& referrer) {
frame_tree_->frame_entry->set_referrer(referrer);
}
@@ -520,6 +528,7 @@ scoped_ptr<NavigationEntryImpl> NavigationEntryImpl::CloneAndReplace(
copy->extra_headers_ = extra_headers_;
// ResetForCommit: source_site_instance_
copy->base_url_for_data_url_ = base_url_for_data_url_;
+ copy->data_url_as_string_ = data_url_as_string_;
// ResetForCommit: is_renderer_initiated_
copy->cached_display_title_ = cached_display_title_;
// ResetForCommit: transferred_global_request_id_
@@ -552,8 +561,8 @@ CommonNavigationParams NavigationEntryImpl::ConstructCommonNavigationParams(
return CommonNavigationParams(
dest_url, dest_referrer, GetTransitionType(), navigation_type,
!IsViewSourceMode(), should_replace_entry(), ui_timestamp, report_type,
- GetBaseURLForDataURL(), GetHistoryURLForDataURL(), lofi_state,
- navigation_start);
+ GetBaseURLForDataURL(), GetHistoryURLForDataURL(), GetDataURLAsString(),
+ lofi_state, navigation_start);
}
StartNavigationParams NavigationEntryImpl::ConstructStartNavigationParams()

Powered by Google App Engine
This is Rietveld 408576698