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

Unified Diff: net/url_request/url_request.h

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: net/url_request/url_request.h
diff --git a/net/url_request/url_request.h b/net/url_request/url_request.h
index c6ef160e69c4fb2ace304bc27e9af0cbe6c972a9..bc6dcca14eb73c5e17215fe1554f77b5b20e84e8 100644
--- a/net/url_request/url_request.h
+++ b/net/url_request/url_request.h
@@ -60,6 +60,17 @@ class X509Certificate;
// excluding the "Set-Cookie:" part.
typedef std::vector<std::string> ResponseCookies;
+// The LoFi state which determines whether to add the LoFi header. Must stay
+// in sync with the enum in navigation_params.h.
+enum LoFiState {
nasko 2015/09/04 22:47:42 This has already been defined elsewhere. Why can't
megjablon 2015/09/09 20:54:16 This is currently defined in content/common. Shoul
+ // Request a LoFi version of the resource.
+ LOFI_ON = 0,
+ // Request a normal (non-LoFi) version of the resource.
+ LOFI_OFF,
+ // Let the browser process decide whether or not to request the LoFi version.
+ LOFI_DEFAULT,
+};
+
//-----------------------------------------------------------------------------
// A class representing the asynchronous load of a data stream from an URL.
//
@@ -298,6 +309,11 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe),
// and it is permissible for it to be null.
void set_delegate(Delegate* delegate);
+ // Whether or not to request a LoFi version of the resource or let the
+ // browser decide.
+ LoFiState lofi_state() const { return lofi_state_; }
+ void set_lofi_state(LoFiState lofi_state);
+
// Indicates that the request body should be sent using chunked transfer
// encoding. This method may only be called before Start() is called.
void EnableChunkedUpload();
@@ -829,6 +845,10 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe),
scoped_ptr<const base::debug::StackTrace> stack_trace_;
+ // Whether or not to request a LoFi version of the resource or let the
+ // browser decide.
+ LoFiState lofi_state_;
+
DISALLOW_COPY_AND_ASSIGN(URLRequest);
};

Powered by Google App Engine
This is Rietveld 408576698