| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // How many bytes were fed to filter(s) so far? | 62 // How many bytes were fed to filter(s) so far? |
| 62 virtual int64 GetByteReadCount() const OVERRIDE; | 63 virtual int64 GetByteReadCount() const OVERRIDE; |
| 63 | 64 |
| 64 virtual int GetResponseCode() const OVERRIDE; | 65 virtual int GetResponseCode() const OVERRIDE; |
| 65 | 66 |
| 66 // The URLRequestContext associated with the request. | 67 // The URLRequestContext associated with the request. |
| 67 virtual const URLRequestContext* GetURLRequestContext() const OVERRIDE; | 68 virtual const URLRequestContext* GetURLRequestContext() const OVERRIDE; |
| 68 | 69 |
| 69 virtual void RecordPacketStats(StatisticSelector statistic) const OVERRIDE {} | 70 virtual void RecordPacketStats(StatisticSelector statistic) const OVERRIDE {} |
| 70 | 71 |
| 72 virtual const BoundNetLog& GetNetLog() const OVERRIDE; |
| 73 |
| 71 private: | 74 private: |
| 72 int buffer_size_; | 75 int buffer_size_; |
| 73 std::string mime_type_; | 76 std::string mime_type_; |
| 74 std::string content_disposition_; | 77 std::string content_disposition_; |
| 75 GURL gurl_; | 78 GURL gurl_; |
| 76 base::Time request_time_; | 79 base::Time request_time_; |
| 77 bool is_cached_content_; | 80 bool is_cached_content_; |
| 78 bool is_download_; | 81 bool is_download_; |
| 79 bool is_sdch_response_; | 82 bool is_sdch_response_; |
| 80 int response_code_; | 83 int response_code_; |
| 81 scoped_ptr<URLRequestContext> context_; | 84 scoped_ptr<URLRequestContext> context_; |
| 85 BoundNetLog net_log_; |
| 82 | 86 |
| 83 DISALLOW_COPY_AND_ASSIGN(MockFilterContext); | 87 DISALLOW_COPY_AND_ASSIGN(MockFilterContext); |
| 84 }; | 88 }; |
| 85 | 89 |
| 86 } // namespace net | 90 } // namespace net |
| 87 | 91 |
| 88 #endif // NET_FILTER_MOCK_FILTER_CONTEXT_H_ | 92 #endif // NET_FILTER_MOCK_FILTER_CONTEXT_H_ |
| OLD | NEW |