Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: content/browser/net/url_request_abort_on_end_job.h

Issue 8538016: Revert 109534 since this change broke clobbered component build. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/nacl.gypi ('k') | content/common/content_export.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 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_BROWSER_NET_URL_REQUEST_ABORT_ON_END_JOB_H_ 6 #ifndef CONTENT_BROWSER_NET_URL_REQUEST_ABORT_ON_END_JOB_H_
7 #define 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 8 #pragma once
9 9
10 #include <string> 10 #include <string>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "content/common/content_export.h"
15 #include "net/url_request/url_request_job.h" 16 #include "net/url_request/url_request_job.h"
16 17
17 // This url request simulates a network error which occurs immediately after 18 // This url request simulates a network error which occurs immediately after
18 // receiving the very first data. 19 // receiving the very first data.
19 20
20 class URLRequestAbortOnEndJob : public net::URLRequestJob { 21 class URLRequestAbortOnEndJob : public net::URLRequestJob {
21 public: 22 public:
22 static const char k400AbortOnEndUrl[]; 23 static const char k400AbortOnEndUrl[];
23 24
24 // net::URLRequestJob 25 // net::URLRequestJob
25 virtual void Start() OVERRIDE; 26 virtual void Start() OVERRIDE;
26 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE; 27 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE;
27 virtual void GetResponseInfo(net::HttpResponseInfo* info) OVERRIDE; 28 virtual void GetResponseInfo(net::HttpResponseInfo* info) OVERRIDE;
28 virtual bool ReadRawData(net::IOBuffer* buf, 29 virtual bool ReadRawData(net::IOBuffer* buf,
29 int buf_size, 30 int buf_size,
30 int* bytes_read) OVERRIDE; 31 int* bytes_read) OVERRIDE;
31 32
32 static net::URLRequestJob* Factory(net::URLRequest* request, 33 static net::URLRequestJob* Factory(net::URLRequest* request,
33 const std::string& scheme); 34 const std::string& scheme);
34 35
35 static void AddUrlHandler(); 36 CONTENT_EXPORT static void AddUrlHandler();
36 37
37 private: 38 private:
38 explicit URLRequestAbortOnEndJob(net::URLRequest* request); 39 explicit URLRequestAbortOnEndJob(net::URLRequest* request);
39 virtual ~URLRequestAbortOnEndJob(); 40 virtual ~URLRequestAbortOnEndJob();
40 41
41 void GetResponseInfoConst(net::HttpResponseInfo* info) const; 42 void GetResponseInfoConst(net::HttpResponseInfo* info) const;
42 void StartAsync(); 43 void StartAsync();
43 44
44 bool sent_data_; 45 bool sent_data_;
45 46
46 base::WeakPtrFactory<URLRequestAbortOnEndJob> weak_factory_; 47 base::WeakPtrFactory<URLRequestAbortOnEndJob> weak_factory_;
47 48
48 DISALLOW_COPY_AND_ASSIGN(URLRequestAbortOnEndJob); 49 DISALLOW_COPY_AND_ASSIGN(URLRequestAbortOnEndJob);
49 }; 50 };
50 #endif 51 #endif
51 52
OLDNEW
« no previous file with comments | « chrome/nacl.gypi ('k') | content/common/content_export.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698