| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "net/filter/mock_filter_context.h" | 5 #include "net/filter/mock_filter_context.h" |
| 6 | 6 |
| 7 #include "net/url_request/url_request_context.h" | 7 #include "net/url_request/url_request_context.h" |
| 8 | 8 |
| 9 namespace net { | 9 namespace net { |
| 10 | 10 |
| 11 MockFilterContext::MockFilterContext() | 11 MockFilterContext::MockFilterContext() |
| 12 : is_cached_content_(false), | 12 : is_cached_content_(false), |
| 13 is_download_(false), | 13 is_download_(false), |
| 14 is_sdch_response_(false), | |
| 15 ok_to_call_get_url_(true), | 14 ok_to_call_get_url_(true), |
| 16 response_code_(-1), | 15 response_code_(-1), |
| 17 context_(new URLRequestContext()) { | 16 context_(new URLRequestContext()) { |
| 18 } | 17 } |
| 19 | 18 |
| 20 MockFilterContext::~MockFilterContext() {} | 19 MockFilterContext::~MockFilterContext() {} |
| 21 | 20 |
| 22 void MockFilterContext::NukeUnstableInterfaces() { | 21 void MockFilterContext::NukeUnstableInterfaces() { |
| 23 context_.reset(); | 22 context_.reset(); |
| 24 ok_to_call_get_url_ = false; | 23 ok_to_call_get_url_ = false; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 47 | 46 |
| 48 // What was this data requested from a server? | 47 // What was this data requested from a server? |
| 49 base::Time MockFilterContext::GetRequestTime() const { | 48 base::Time MockFilterContext::GetRequestTime() const { |
| 50 return request_time_; | 49 return request_time_; |
| 51 } | 50 } |
| 52 | 51 |
| 53 bool MockFilterContext::IsCachedContent() const { return is_cached_content_; } | 52 bool MockFilterContext::IsCachedContent() const { return is_cached_content_; } |
| 54 | 53 |
| 55 bool MockFilterContext::IsDownload() const { return is_download_; } | 54 bool MockFilterContext::IsDownload() const { return is_download_; } |
| 56 | 55 |
| 57 bool MockFilterContext::SdchResponseExpected() const { | 56 SdchManager::DictionarySet* |
| 58 return is_sdch_response_; | 57 MockFilterContext::SdchDictionariesAdvertised() const { |
| 58 return dictionaries_handle_.get(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 int64 MockFilterContext::GetByteReadCount() const { return 0; } | 61 int64 MockFilterContext::GetByteReadCount() const { return 0; } |
| 62 | 62 |
| 63 int MockFilterContext::GetResponseCode() const { return response_code_; } | 63 int MockFilterContext::GetResponseCode() const { return response_code_; } |
| 64 | 64 |
| 65 const URLRequestContext* MockFilterContext::GetURLRequestContext() const { | 65 const URLRequestContext* MockFilterContext::GetURLRequestContext() const { |
| 66 return context_.get(); | 66 return context_.get(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 const BoundNetLog& MockFilterContext::GetNetLog() const { | 69 const BoundNetLog& MockFilterContext::GetNetLog() const { |
| 70 return net_log_; | 70 return net_log_; |
| 71 } | 71 } |
| 72 | 72 |
| 73 } // namespace net | 73 } // namespace net |
| OLD | NEW |