| 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" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 } | 34 } |
| 35 URLRequestContext* GetModifiableURLRequestContext() const { | 35 URLRequestContext* GetModifiableURLRequestContext() const { |
| 36 return context_.get(); | 36 return context_.get(); |
| 37 } | 37 } |
| 38 | 38 |
| 39 // After a URLRequest's destructor is called, some interfaces may become | 39 // After a URLRequest's destructor is called, some interfaces may become |
| 40 // unstable. This method is used to signal that state, so we can tag use | 40 // unstable. This method is used to signal that state, so we can tag use |
| 41 // of those interfaces as coding errors. | 41 // of those interfaces as coding errors. |
| 42 void NukeUnstableInterfaces(); | 42 void NukeUnstableInterfaces(); |
| 43 | 43 |
| 44 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE; | 44 virtual bool GetMimeType(std::string* mime_type) const override; |
| 45 | 45 |
| 46 // What URL was used to access this data? | 46 // What URL was used to access this data? |
| 47 // Return false if gurl is not present. | 47 // Return false if gurl is not present. |
| 48 virtual bool GetURL(GURL* gurl) const OVERRIDE; | 48 virtual bool GetURL(GURL* gurl) const override; |
| 49 | 49 |
| 50 // What Content-Disposition did the server supply for this data? | 50 // What Content-Disposition did the server supply for this data? |
| 51 // Return false if Content-Disposition was not present. | 51 // Return false if Content-Disposition was not present. |
| 52 virtual bool GetContentDisposition(std::string* disposition) const OVERRIDE; | 52 virtual bool GetContentDisposition(std::string* disposition) const override; |
| 53 | 53 |
| 54 // What was this data requested from a server? | 54 // What was this data requested from a server? |
| 55 virtual base::Time GetRequestTime() const OVERRIDE; | 55 virtual base::Time GetRequestTime() const override; |
| 56 | 56 |
| 57 // Is data supplied from cache, or fresh across the net? | 57 // Is data supplied from cache, or fresh across the net? |
| 58 virtual bool IsCachedContent() const OVERRIDE; | 58 virtual bool IsCachedContent() const override; |
| 59 | 59 |
| 60 // Is this a download? | 60 // Is this a download? |
| 61 virtual bool IsDownload() const OVERRIDE; | 61 virtual bool IsDownload() const override; |
| 62 | 62 |
| 63 // Was this data flagged as a response to a request with an SDCH dictionary? | 63 // Was this data flagged as a response to a request with an SDCH dictionary? |
| 64 virtual bool SdchResponseExpected() const OVERRIDE; | 64 virtual bool SdchResponseExpected() const override; |
| 65 | 65 |
| 66 // How many bytes were fed to filter(s) so far? | 66 // How many bytes were fed to filter(s) so far? |
| 67 virtual int64 GetByteReadCount() const OVERRIDE; | 67 virtual int64 GetByteReadCount() const override; |
| 68 | 68 |
| 69 virtual int GetResponseCode() const OVERRIDE; | 69 virtual int GetResponseCode() const override; |
| 70 | 70 |
| 71 // The URLRequestContext associated with the request. | 71 // The URLRequestContext associated with the request. |
| 72 virtual const URLRequestContext* GetURLRequestContext() const OVERRIDE; | 72 virtual const URLRequestContext* GetURLRequestContext() const override; |
| 73 | 73 |
| 74 virtual void RecordPacketStats(StatisticSelector statistic) const OVERRIDE {} | 74 virtual void RecordPacketStats(StatisticSelector statistic) const override {} |
| 75 | 75 |
| 76 private: | 76 private: |
| 77 int buffer_size_; | 77 int buffer_size_; |
| 78 std::string mime_type_; | 78 std::string mime_type_; |
| 79 std::string content_disposition_; | 79 std::string content_disposition_; |
| 80 GURL gurl_; | 80 GURL gurl_; |
| 81 base::Time request_time_; | 81 base::Time request_time_; |
| 82 bool is_cached_content_; | 82 bool is_cached_content_; |
| 83 bool is_download_; | 83 bool is_download_; |
| 84 bool is_sdch_response_; | 84 bool is_sdch_response_; |
| 85 bool ok_to_call_get_url_; | 85 bool ok_to_call_get_url_; |
| 86 int response_code_; | 86 int response_code_; |
| 87 scoped_ptr<URLRequestContext> context_; | 87 scoped_ptr<URLRequestContext> context_; |
| 88 | 88 |
| 89 DISALLOW_COPY_AND_ASSIGN(MockFilterContext); | 89 DISALLOW_COPY_AND_ASSIGN(MockFilterContext); |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 } // namespace net | 92 } // namespace net |
| 93 | 93 |
| 94 #endif // NET_FILTER_MOCK_FILTER_CONTEXT_H_ | 94 #endif // NET_FILTER_MOCK_FILTER_CONTEXT_H_ |
| OLD | NEW |