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

Unified Diff: content/renderer/render_view_impl.cc

Issue 10704048: [RDS] Reloads a page using the original request URL (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Adding unit test & removing public function Created 8 years, 6 months 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/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index d012810b227df50e5157eeb07f9ba5ca6da49175..234546ff13461861481f060d10193476cd72e1e5 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -356,7 +356,9 @@ static void StopAltErrorPageFetcher(WebDataSource* data_source) {
static bool IsReload(const ViewMsg_Navigate_Params& params) {
return
params.navigation_type == ViewMsg_Navigate_Type::RELOAD ||
- params.navigation_type == ViewMsg_Navigate_Type::RELOAD_IGNORING_CACHE;
+ params.navigation_type == ViewMsg_Navigate_Type::RELOAD_IGNORING_CACHE ||
+ params.navigation_type ==
+ ViewMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL;
}
static WebReferrerPolicy GetReferrerPolicyFromRequest(
@@ -1043,9 +1045,16 @@ void RenderViewImpl::OnNavigate(const ViewMsg_Navigate_Params& params) {
// have history state, then we need to navigate to it, which corresponds to a
// back/forward navigation event.
if (is_reload) {
+ bool reload_original_url =
+ (params.navigation_type ==
+ ViewMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL);
bool ignore_cache = (params.navigation_type ==
ViewMsg_Navigate_Type::RELOAD_IGNORING_CACHE);
- main_frame->reload(ignore_cache);
+
+ if (reload_original_url)
+ main_frame->reloadWithOverrideURL(params.url, true);
+ else
+ main_frame->reload(ignore_cache);
} else if (!params.state.empty()) {
// We must know the page ID of the page we are navigating back to.
DCHECK_NE(params.page_id, -1);
@@ -1452,6 +1461,9 @@ void RenderViewImpl::UpdateURL(WebFrame* frame) {
params.is_overriding_user_agent =
document_state->is_overriding_user_agent();
+ // Track the URL of the original request.
+ params.original_request_url = original_request.url();
+
// Save some histogram data so we can compute the average memory used per
// page load of the glyphs.
UMA_HISTOGRAM_COUNTS_10000("Memory.GlyphPagesPerLoad",
« content/public/test/test_renderer_host.h ('K') | « content/public/test/test_renderer_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698