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

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: test fixes 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..9d7c13a0a6b7d3ef34fa9ba7d1272939866baa80 100644
--- a/net/url_request/url_request.h
+++ b/net/url_request/url_request.h
@@ -60,6 +60,18 @@ 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 {
+ // Add the LoFi header to the request.
+ LOFI_ON = 0,
+ // Do not add the LoFi header to the request.
+ LOFI_OFF,
+ // Check with the network-quality-based triggering logic and add the header if
bengr 2015/08/25 00:00:02 See my previous comment about not specifying the i
megjablon 2015/08/25 20:29:47 Done.
+ // the network is slow.
+ LOFI_DEFAULT,
+};
+
//-----------------------------------------------------------------------------
// A class representing the asynchronous load of a data stream from an URL.
//
@@ -298,6 +310,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);
+ // TODO(megjablon): Add comment.
bengr 2015/08/25 00:00:02 Add it.
megjablon 2015/08/25 20:29:47 Done.
+ void set_lofi_state(LoFiState lofi_state);
+
+ LoFiState lofi_state() const { return 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 +846,9 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe),
scoped_ptr<const base::debug::StackTrace> stack_trace_;
+ // TODO(megjablon): Add comment
bengr 2015/08/25 00:00:02 Add it.
megjablon 2015/08/25 20:29:47 Done.
+ LoFiState lofi_state_;
+
DISALLOW_COPY_AND_ASSIGN(URLRequest);
};

Powered by Google App Engine
This is Rietveld 408576698