| 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 ok_to_call_get_url_(true), | 13 ok_to_call_get_url_(true), |
| 14 response_code_(-1), | 14 response_code_(-1), |
| 15 context_(new URLRequestContext()) { | 15 context_(new URLRequestContext()), |
| 16 } | 16 is_brotli_enabled_(false) {} |
| 17 | 17 |
| 18 MockFilterContext::~MockFilterContext() {} | 18 MockFilterContext::~MockFilterContext() {} |
| 19 | 19 |
| 20 void MockFilterContext::NukeUnstableInterfaces() { | 20 void MockFilterContext::NukeUnstableInterfaces() { |
| 21 context_.reset(); | 21 context_.reset(); |
| 22 ok_to_call_get_url_ = false; | 22 ok_to_call_get_url_ = false; |
| 23 request_time_ = base::Time(); | 23 request_time_ = base::Time(); |
| 24 } | 24 } |
| 25 | 25 |
| 26 bool MockFilterContext::GetMimeType(std::string* mime_type) const { | 26 bool MockFilterContext::GetMimeType(std::string* mime_type) const { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 53 int MockFilterContext::GetResponseCode() const { return response_code_; } | 53 int MockFilterContext::GetResponseCode() const { return response_code_; } |
| 54 | 54 |
| 55 const URLRequestContext* MockFilterContext::GetURLRequestContext() const { | 55 const URLRequestContext* MockFilterContext::GetURLRequestContext() const { |
| 56 return context_.get(); | 56 return context_.get(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 const BoundNetLog& MockFilterContext::GetNetLog() const { | 59 const BoundNetLog& MockFilterContext::GetNetLog() const { |
| 60 return net_log_; | 60 return net_log_; |
| 61 } | 61 } |
| 62 | 62 |
| 63 bool MockFilterContext::IsBrotliEnabled() const { |
| 64 return is_brotli_enabled_; |
| 65 } |
| 66 |
| 63 } // namespace net | 67 } // namespace net |
| OLD | NEW |