| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This class simulates what wininet does when a dns lookup fails. | 4 // This class simulates what wininet does when a dns lookup fails. |
| 5 | 5 |
| 6 #ifndef CONTENT_TEST_NET_URL_REQUEST_ABORT_ON_END_JOB_H_ | 6 #ifndef CONTENT_TEST_NET_URL_REQUEST_ABORT_ON_END_JOB_H_ |
| 7 #define CONTENT_TEST_NET_URL_REQUEST_ABORT_ON_END_JOB_H_ | 7 #define CONTENT_TEST_NET_URL_REQUEST_ABORT_ON_END_JOB_H_ |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 virtual void GetResponseInfo(net::HttpResponseInfo* info) OVERRIDE; | 28 virtual void GetResponseInfo(net::HttpResponseInfo* info) OVERRIDE; |
| 29 virtual bool ReadRawData(net::IOBuffer* buf, | 29 virtual bool ReadRawData(net::IOBuffer* buf, |
| 30 int buf_size, | 30 int buf_size, |
| 31 int* bytes_read) OVERRIDE; | 31 int* bytes_read) OVERRIDE; |
| 32 | 32 |
| 33 static net::URLRequestJob* Factory(net::URLRequest* request, | 33 static net::URLRequestJob* Factory(net::URLRequest* request, |
| 34 net::NetworkDelegate* network_delegate, | 34 net::NetworkDelegate* network_delegate, |
| 35 const std::string& scheme); | 35 const std::string& scheme); |
| 36 | 36 |
| 37 static void AddUrlHandler(); | 37 static void AddUrlHandler(); |
| 38 static void AddUrlHandlerOnIOThread(); |
| 38 | 39 |
| 39 private: | 40 private: |
| 40 URLRequestAbortOnEndJob(net::URLRequest* request, | 41 URLRequestAbortOnEndJob(net::URLRequest* request, |
| 41 net::NetworkDelegate* network_delegate); | 42 net::NetworkDelegate* network_delegate); |
| 42 virtual ~URLRequestAbortOnEndJob(); | 43 virtual ~URLRequestAbortOnEndJob(); |
| 43 | 44 |
| 44 void GetResponseInfoConst(net::HttpResponseInfo* info) const; | 45 void GetResponseInfoConst(net::HttpResponseInfo* info) const; |
| 45 void StartAsync(); | 46 void StartAsync(); |
| 46 | 47 |
| 47 bool sent_data_; | 48 bool sent_data_; |
| 48 | 49 |
| 49 base::WeakPtrFactory<URLRequestAbortOnEndJob> weak_factory_; | 50 base::WeakPtrFactory<URLRequestAbortOnEndJob> weak_factory_; |
| 50 | 51 |
| 51 DISALLOW_COPY_AND_ASSIGN(URLRequestAbortOnEndJob); | 52 DISALLOW_COPY_AND_ASSIGN(URLRequestAbortOnEndJob); |
| 52 }; | 53 }; |
| 53 | 54 |
| 54 } // namespace content | 55 } // namespace content |
| 55 | 56 |
| 56 #endif // CONTENT_TEST_NET_URL_REQUEST_ABORT_ON_END_JOB_H_ | 57 #endif // CONTENT_TEST_NET_URL_REQUEST_ABORT_ON_END_JOB_H_ |
| OLD | NEW |