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

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

Issue 1310743003: Consistently use LoFi for an entire page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressing comments Created 5 years, 4 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/browser/frame_host/navigation_request.cc
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
index a99074f2ce3aeb56440b44cc0e9530f0f0c1db39..0d242d1f8c0f20aeee417c6b80a316148db11dd3 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -12,6 +12,7 @@
#include "content/browser/frame_host/navigator.h"
#include "content/browser/loader/navigation_url_loader.h"
#include "content/browser/site_instance_impl.h"
+#include "content/common/navigation_params.h"
#include "content/common/resource_request_body.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/stream_handle.h"
@@ -64,6 +65,13 @@ scoped_ptr<NavigationRequest> NavigationRequest::CreateBrowserInitiated(
NavigationControllerImpl* controller) {
std::string method = entry.GetHasPostData() ? "POST" : "GET";
+ // TODO(megjablon): Do we want to turn LoFi off on reloads? Need decision.
+ LoFiState lofi_state =
+ (navigation_type == FrameMsg_Navigate_Type::RELOAD ||
+ navigation_type == FrameMsg_Navigate_Type::RELOAD_IGNORING_CACHE ||
+ navigation_type == FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL) ?
+ LOFI_OFF : LOFI_DEFAULT;
+
// Copy existing headers and add necessary headers that may not be present
// in the RequestNavigationParams.
net::HttpRequestHeaders headers;
@@ -95,7 +103,7 @@ scoped_ptr<NavigationRequest> NavigationRequest::CreateBrowserInitiated(
controller->GetPendingEntryIndex() == -1,
controller->GetIndexOfEntry(&entry),
controller->GetLastCommittedEntryIndex(),
- controller->GetEntryCount()),
+ controller->GetEntryCount(), lofi_state),
request_body, true, &frame_entry, &entry));
return navigation_request.Pass();
}

Powered by Google App Engine
This is Rietveld 408576698