| 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 #ifndef NET_FILTER_MOCK_FILTER_CONTEXT_H_ | 5 #ifndef NET_FILTER_MOCK_FILTER_CONTEXT_H_ |
| 6 #define NET_FILTER_MOCK_FILTER_CONTEXT_H_ | 6 #define NET_FILTER_MOCK_FILTER_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "net/base/net_log.h" |
| 11 #include "net/filter/filter.h" | 12 #include "net/filter/filter.h" |
| 12 #include "url/gurl.h" | 13 #include "url/gurl.h" |
| 13 | 14 |
| 14 namespace net { | 15 namespace net { |
| 15 | 16 |
| 16 class URLRequestContext; | 17 class URLRequestContext; |
| 17 | 18 |
| 18 class MockFilterContext : public FilterContext { | 19 class MockFilterContext : public FilterContext { |
| 19 public: | 20 public: |
| 20 MockFilterContext(); | 21 MockFilterContext(); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // How many bytes were fed to filter(s) so far? | 67 // How many bytes were fed to filter(s) so far? |
| 67 int64 GetByteReadCount() const override; | 68 int64 GetByteReadCount() const override; |
| 68 | 69 |
| 69 int GetResponseCode() const override; | 70 int GetResponseCode() const override; |
| 70 | 71 |
| 71 // The URLRequestContext associated with the request. | 72 // The URLRequestContext associated with the request. |
| 72 const URLRequestContext* GetURLRequestContext() const override; | 73 const URLRequestContext* GetURLRequestContext() const override; |
| 73 | 74 |
| 74 void RecordPacketStats(StatisticSelector statistic) const override {} | 75 void RecordPacketStats(StatisticSelector statistic) const override {} |
| 75 | 76 |
| 77 const BoundNetLog& GetNetLog() const override; |
| 78 |
| 76 private: | 79 private: |
| 77 int buffer_size_; | 80 int buffer_size_; |
| 78 std::string mime_type_; | 81 std::string mime_type_; |
| 79 std::string content_disposition_; | 82 std::string content_disposition_; |
| 80 GURL gurl_; | 83 GURL gurl_; |
| 81 base::Time request_time_; | 84 base::Time request_time_; |
| 82 bool is_cached_content_; | 85 bool is_cached_content_; |
| 83 bool is_download_; | 86 bool is_download_; |
| 84 bool is_sdch_response_; | 87 bool is_sdch_response_; |
| 85 bool ok_to_call_get_url_; | 88 bool ok_to_call_get_url_; |
| 86 int response_code_; | 89 int response_code_; |
| 87 scoped_ptr<URLRequestContext> context_; | 90 scoped_ptr<URLRequestContext> context_; |
| 91 BoundNetLog net_log_; |
| 88 | 92 |
| 89 DISALLOW_COPY_AND_ASSIGN(MockFilterContext); | 93 DISALLOW_COPY_AND_ASSIGN(MockFilterContext); |
| 90 }; | 94 }; |
| 91 | 95 |
| 92 } // namespace net | 96 } // namespace net |
| 93 | 97 |
| 94 #endif // NET_FILTER_MOCK_FILTER_CONTEXT_H_ | 98 #endif // NET_FILTER_MOCK_FILTER_CONTEXT_H_ |
| OLD | NEW |