Chromium Code Reviews| Index: net/filter/mock_filter_context.h |
| diff --git a/net/filter/mock_filter_context.h b/net/filter/mock_filter_context.h |
| index 21e56ac92e17c314ba49d5f1bca21a0348a32816..dc2fcb08087488185d4fa8c1414b30365ea20bfb 100644 |
| --- a/net/filter/mock_filter_context.h |
| +++ b/net/filter/mock_filter_context.h |
| @@ -7,11 +7,14 @@ |
| #include <string> |
| +#include "base/memory/scoped_ptr.h" |
| #include "net/filter/filter.h" |
| #include "url/gurl.h" |
| namespace net { |
| +class URLRequestContext; |
| + |
| class MockFilterContext : public FilterContext { |
| public: |
| MockFilterContext(); |
| @@ -29,6 +32,7 @@ class MockFilterContext : public FilterContext { |
| void SetSdchResponse(bool is_sdch_response) { |
| is_sdch_response_ = is_sdch_response; |
| } |
| + URLRequestContext* GetModifiableURLRequestContext() { return context_.get(); } |
|
jar (doing other things)
2014/06/09 23:03:01
nit: nice to use const on such accessors.
Randy Smith (Not in Mondays)
2014/06/10 20:38:41
Actually, the whole point of this accessor is that
jar (doing other things)
2014/06/11 20:04:43
I wasn't asking for the return value to be const,
Randy Smith (Not in Mondays)
2014/06/11 20:43:37
Sorry, another const parsing braino. Done.
|
| virtual bool GetMimeType(std::string* mime_type) const OVERRIDE; |
| @@ -57,6 +61,9 @@ class MockFilterContext : public FilterContext { |
| virtual int GetResponseCode() const OVERRIDE; |
| + // The URLRequestContext associated with the request. |
| + virtual const URLRequestContext* GetURLRequestContext() const OVERRIDE; |
| + |
| virtual void RecordPacketStats(StatisticSelector statistic) const OVERRIDE {} |
| private: |
| @@ -69,6 +76,7 @@ class MockFilterContext : public FilterContext { |
| bool is_download_; |
| bool is_sdch_response_; |
| int response_code_; |
| + scoped_ptr<URLRequestContext> context_; |
| DISALLOW_COPY_AND_ASSIGN(MockFilterContext); |
| }; |