OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 // This class simulates what wininet does when a dns lookup fails. | |
5 | |
6 #ifndef CONTENT_BROWSER_NET_URL_REQUEST_ABORT_ON_END_JOB_H_ | |
7 #define CONTENT_BROWSER_NET_URL_REQUEST_ABORT_ON_END_JOB_H_ | |
8 #pragma once | |
9 | |
10 #include <string> | |
11 | |
12 #include "base/basictypes.h" | |
13 #include "base/compiler_specific.h" | |
14 #include "content/common/content_export.h" | |
15 #include "net/url_request/url_request_job.h" | |
16 | |
17 class URLRequestAbortOnEndJob : public net::URLRequestJob { | |
mmenke
2011/10/28 17:29:53
Think it would be nice to have some short descript
gavinp
2011/10/28 18:25:53
Done.
mmenke
2011/10/28 18:32:10
Doesn't seem to be in the last uploaded CL, but I'
| |
18 public: | |
19 static const char k400AbortOnEndUrl[]; | |
20 | |
21 // net::URLRequestJob | |
22 virtual void Start() OVERRIDE; | |
23 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE; | |
24 virtual void GetResponseInfo(net::HttpResponseInfo* info) OVERRIDE; | |
25 virtual bool ReadRawData(net::IOBuffer* buf, | |
26 int buf_size, | |
27 int *bytes_read) OVERRIDE; | |
28 | |
29 static net::URLRequestJob* Factory(net::URLRequest* request, | |
30 const std::string& scheme); | |
31 | |
32 CONTENT_EXPORT static void AddUrlHandler(); | |
33 | |
34 private: | |
35 explicit URLRequestAbortOnEndJob(net::URLRequest* request); | |
36 virtual ~URLRequestAbortOnEndJob(); | |
37 | |
38 void GetResponseInfoConst(net::HttpResponseInfo* info) const; | |
39 void StartAsync(); | |
40 | |
41 bool sent_data_; | |
42 | |
43 ScopedRunnableMethodFactory<URLRequestAbortOnEndJob> method_factory_; | |
44 | |
45 DISALLOW_COPY_AND_ASSIGN(URLRequestAbortOnEndJob); | |
46 }; | |
47 #endif | |
48 | |
OLD | NEW |