OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_PUBLIC_COMMON_DATA_REDUCTION_PROXY_LOFI_USER_DATA_H_ | |
6 #define CONTENT_PUBLIC_COMMON_DATA_REDUCTION_PROXY_LOFI_USER_DATA_H_ | |
7 | |
8 #include "base/supports_user_data.h" | |
9 | |
10 namespace content { | |
11 | |
12 // The LoFi state which determines whether to add the LoFi header. Must stay in | |
13 // sync with the enum in data_reduction_proxy_lofi_helper.h. | |
14 enum LoFiState { | |
15 // Request a LoFi version of the resource. | |
16 LOFI_ON = 0, | |
17 // Request a normal (non-LoFi) version of the resource. | |
18 LOFI_OFF, | |
19 // Let the browser process decide whether or not to request the LoFi version. | |
20 LOFI_DEFAULT, | |
mmenke
2015/09/21 18:03:48
This seems weird - seems to me like this should no
megjablon
2015/09/22 20:35:52
LOFI_DEFAULT is only used by navigation requests t
mmenke
2015/09/22 20:38:12
That sounds reasonable - in that case, I think we
megjablon
2015/09/22 20:53:40
Maybe I didn't explain this right. We need to be a
mmenke
2015/09/22 20:57:07
Right, but DataReductionProxyLoFiUserData is assoc
megjablon
2015/09/22 21:20:26
The navigation creates a URLRequest and when that
| |
21 }; | |
22 | |
23 // Used to annotate URLRequests with the Data Reduction Proxy LoFiState. | |
24 class DataReductionProxyLoFiUserData : public base::SupportsUserData::Data { | |
25 public: | |
26 DataReductionProxyLoFiUserData(LoFiState lofi_state); | |
27 ~DataReductionProxyLoFiUserData() override; | |
28 | |
29 LoFiState lofi_state() const { return lofi_state_; } | |
30 void set_lofi_state(LoFiState lofi_state) { lofi_state_ = lofi_state; } | |
mmenke
2015/09/21 18:03:48
Should this just be a value in ResourceRequestInfo
megjablon
2015/09/22 20:35:52
This sounds like a good and simpler idea to me. da
davidben
2015/09/22 22:20:50
Yes, please do that. But exposing a mutator here s
mmenke
2015/09/22 22:36:28
As discussed offline, this makes me, at least, muc
megjablon
2015/09/23 23:15:24
Done! LTAL and let me know if you want to move any
| |
31 | |
32 static const void* kUserDataKey; | |
33 | |
34 private: | |
35 // Whether or not to request a LoFi version of the resource or let the | |
36 // browser decide. | |
37 LoFiState lofi_state_; | |
38 }; | |
39 | |
40 } // namespace content | |
41 | |
42 #endif // CONTENT_PUBLIC_COMMON_DATA_REDUCTION_PROXY_LOFI_USER_DATA_H_ | |
OLD | NEW |