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 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "net/url_request/url_request_job.h" | 14 #include "net/url_request/url_request_job.h" |
15 | 15 |
| 16 namespace content { |
| 17 |
16 // This url request simulates a network error which occurs immediately after | 18 // This url request simulates a network error which occurs immediately after |
17 // receiving the very first data. | 19 // receiving the very first data. |
18 | 20 |
19 class URLRequestAbortOnEndJob : public net::URLRequestJob { | 21 class URLRequestAbortOnEndJob : public net::URLRequestJob { |
20 public: | 22 public: |
21 static const char k400AbortOnEndUrl[]; | 23 static const char k400AbortOnEndUrl[]; |
22 | 24 |
23 // net::URLRequestJob | 25 // net::URLRequestJob |
24 virtual void Start() OVERRIDE; | 26 virtual void Start() OVERRIDE; |
25 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE; | 27 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE; |
(...skipping 16 matching lines...) Expand all Loading... |
42 void GetResponseInfoConst(net::HttpResponseInfo* info) const; | 44 void GetResponseInfoConst(net::HttpResponseInfo* info) const; |
43 void StartAsync(); | 45 void StartAsync(); |
44 | 46 |
45 bool sent_data_; | 47 bool sent_data_; |
46 | 48 |
47 base::WeakPtrFactory<URLRequestAbortOnEndJob> weak_factory_; | 49 base::WeakPtrFactory<URLRequestAbortOnEndJob> weak_factory_; |
48 | 50 |
49 DISALLOW_COPY_AND_ASSIGN(URLRequestAbortOnEndJob); | 51 DISALLOW_COPY_AND_ASSIGN(URLRequestAbortOnEndJob); |
50 }; | 52 }; |
51 | 53 |
| 54 } // namespace content |
| 55 |
52 #endif // CONTENT_TEST_NET_URL_REQUEST_ABORT_ON_END_JOB_H_ | 56 #endif // CONTENT_TEST_NET_URL_REQUEST_ABORT_ON_END_JOB_H_ |
OLD | NEW |