| 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_TEST_URL_REQUEST_URL_REQUEST_MOCK_DATA_JOB_H_ | 5 #ifndef NET_TEST_URL_REQUEST_URL_REQUEST_MOCK_DATA_JOB_H_ |
| 6 #define NET_TEST_URL_REQUEST_URL_REQUEST_MOCK_DATA_JOB_H_ | 6 #define NET_TEST_URL_REQUEST_URL_REQUEST_MOCK_DATA_JOB_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 class URLRequestMockDataJob : public URLRequestJob { | 22 class URLRequestMockDataJob : public URLRequestJob { |
| 23 public: | 23 public: |
| 24 URLRequestMockDataJob(URLRequest* request, | 24 URLRequestMockDataJob(URLRequest* request, |
| 25 NetworkDelegate* network_delegate, | 25 NetworkDelegate* network_delegate, |
| 26 const std::string& data, | 26 const std::string& data, |
| 27 int data_repeat_count, | 27 int data_repeat_count, |
| 28 bool request_client_certificate); | 28 bool request_client_certificate); |
| 29 | 29 |
| 30 void Start() override; | 30 void Start() override; |
| 31 int ReadRawData(IOBuffer* buf, int buf_size) override; | 31 int ReadRawData(IOBuffer* buf, int buf_size) override; |
| 32 int GetResponseCode() const override; | |
| 33 void GetResponseInfo(HttpResponseInfo* info) override; | 32 void GetResponseInfo(HttpResponseInfo* info) override; |
| 34 void ContinueWithCertificate(X509Certificate* client_cert, | 33 void ContinueWithCertificate(X509Certificate* client_cert, |
| 35 SSLPrivateKey* client_private_key) override; | 34 SSLPrivateKey* client_private_key) override; |
| 36 | 35 |
| 37 // Adds the testing URLs to the URLRequestFilter. | 36 // Adds the testing URLs to the URLRequestFilter. |
| 38 static void AddUrlHandler(); | 37 static void AddUrlHandler(); |
| 39 static void AddUrlHandlerForHostname(const std::string& hostname); | 38 static void AddUrlHandlerForHostname(const std::string& hostname); |
| 40 | 39 |
| 41 // Given data and repeat cound, constructs a mock URL that will return that | 40 // Given data and repeat cound, constructs a mock URL that will return that |
| 42 // data repeated |repeat_count| times when started. |data| must be safe for | 41 // data repeated |repeat_count| times when started. |data| must be safe for |
| (...skipping 22 matching lines...) Expand all Loading... |
| 65 | 64 |
| 66 std::string data_; | 65 std::string data_; |
| 67 size_t data_offset_; | 66 size_t data_offset_; |
| 68 bool request_client_certificate_; | 67 bool request_client_certificate_; |
| 69 base::WeakPtrFactory<URLRequestMockDataJob> weak_factory_; | 68 base::WeakPtrFactory<URLRequestMockDataJob> weak_factory_; |
| 70 }; | 69 }; |
| 71 | 70 |
| 72 } // namespace net | 71 } // namespace net |
| 73 | 72 |
| 74 #endif // NET_TEST_URL_REQUEST_URL_REQUEST_MOCK_DATA_JOB_H_ | 73 #endif // NET_TEST_URL_REQUEST_URL_REQUEST_MOCK_DATA_JOB_H_ |
| OLD | NEW |