| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_data
.h" | 5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_data
.h" |
| 6 | 6 |
| 7 #include "net/url_request/url_request.h" | 7 #include "net/url_request/url_request.h" |
| 8 | 8 |
| 9 namespace data_reduction_proxy { | 9 namespace data_reduction_proxy { |
| 10 | 10 |
| 11 const void* const kDataReductionProxyUserDataKey = | 11 const void* const kDataReductionProxyUserDataKey = |
| 12 &kDataReductionProxyUserDataKey; | 12 &kDataReductionProxyUserDataKey; |
| 13 | 13 |
| 14 DataReductionProxyData::DataReductionProxyData() | 14 DataReductionProxyData::DataReductionProxyData() |
| 15 : used_data_reduction_proxy_(false), | 15 : used_data_reduction_proxy_(false), |
| 16 lofi_requested_(false), | 16 lofi_requested_(false), |
| 17 lite_page_received_(false), |
| 18 lofi_received_(false), |
| 17 effective_connection_type_(net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN) {} | 19 effective_connection_type_(net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN) {} |
| 18 | 20 |
| 19 DataReductionProxyData::~DataReductionProxyData() {} | 21 DataReductionProxyData::~DataReductionProxyData() {} |
| 20 | 22 |
| 21 std::unique_ptr<DataReductionProxyData> DataReductionProxyData::DeepCopy() | 23 std::unique_ptr<DataReductionProxyData> DataReductionProxyData::DeepCopy() |
| 22 const { | 24 const { |
| 23 std::unique_ptr<DataReductionProxyData> copy(new DataReductionProxyData()); | 25 std::unique_ptr<DataReductionProxyData> copy(new DataReductionProxyData()); |
| 24 copy->used_data_reduction_proxy_ = used_data_reduction_proxy_; | 26 copy->used_data_reduction_proxy_ = used_data_reduction_proxy_; |
| 25 copy->lofi_requested_ = lofi_requested_; | 27 copy->lofi_requested_ = lofi_requested_; |
| 28 copy->lite_page_received_ = lite_page_received_; |
| 29 copy->lofi_received_ = lofi_received_; |
| 26 copy->session_key_ = session_key_; | 30 copy->session_key_ = session_key_; |
| 27 copy->request_url_ = request_url_; | 31 copy->request_url_ = request_url_; |
| 28 copy->effective_connection_type_ = effective_connection_type_; | 32 copy->effective_connection_type_ = effective_connection_type_; |
| 29 copy->page_id_ = page_id_; | 33 copy->page_id_ = page_id_; |
| 30 return copy; | 34 return copy; |
| 31 } | 35 } |
| 32 | 36 |
| 33 DataReductionProxyData* DataReductionProxyData::GetData( | 37 DataReductionProxyData* DataReductionProxyData::GetData( |
| 34 const net::URLRequest& request) { | 38 const net::URLRequest& request) { |
| 35 DataReductionProxyData* data = static_cast<DataReductionProxyData*>( | 39 DataReductionProxyData* data = static_cast<DataReductionProxyData*>( |
| (...skipping 11 matching lines...) Expand all Loading... |
| 47 data = new DataReductionProxyData(); | 51 data = new DataReductionProxyData(); |
| 48 request->SetUserData(kDataReductionProxyUserDataKey, data); | 52 request->SetUserData(kDataReductionProxyUserDataKey, data); |
| 49 return data; | 53 return data; |
| 50 } | 54 } |
| 51 | 55 |
| 52 void DataReductionProxyData::ClearData(net::URLRequest* request) { | 56 void DataReductionProxyData::ClearData(net::URLRequest* request) { |
| 53 request->RemoveUserData(kDataReductionProxyUserDataKey); | 57 request->RemoveUserData(kDataReductionProxyUserDataKey); |
| 54 } | 58 } |
| 55 | 59 |
| 56 } // namespace data_reduction_proxy | 60 } // namespace data_reduction_proxy |
| OLD | NEW |