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