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

Side by Side Diff: chrome/browser/automation/url_request_automation_job.h

Issue 10918279: Provide mutable members of UrlRequestContext via pure-virtual interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable test for chrome_frame_net_tests Created 8 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
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 CHROME_BROWSER_AUTOMATION_URL_REQUEST_AUTOMATION_JOB_H_ 6 #ifndef CHROME_BROWSER_AUTOMATION_URL_REQUEST_AUTOMATION_JOB_H_
7 #define CHROME_BROWSER_AUTOMATION_URL_REQUEST_AUTOMATION_JOB_H_ 7 #define CHROME_BROWSER_AUTOMATION_URL_REQUEST_AUTOMATION_JOB_H_
8 8
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "chrome/common/ref_counted_util.h" 10 #include "chrome/common/ref_counted_util.h"
11 #include "net/url_request/url_request.h" 11 #include "net/url_request/url_request.h"
12 #include "net/url_request/url_request_job.h" 12 #include "net/url_request/url_request_job.h"
13 13
14 class AutomationResourceMessageFilter; 14 class AutomationResourceMessageFilter;
15 struct AutomationURLResponse; 15 struct AutomationURLResponse;
16 16
17 namespace net { 17 namespace net {
18 class HttpResponseHeaders; 18 class HttpResponseHeaders;
19 class HttpResponseInfo; 19 class HttpResponseInfo;
20 class HttpUserAgentSettings;
20 class HostPortPair; 21 class HostPortPair;
21 } 22 }
22 23
23 namespace IPC { 24 namespace IPC {
24 class Message; 25 class Message;
25 } 26 }
26 27
27 // net::URLRequestJob implementation that loads the resources using 28 // net::URLRequestJob implementation that loads the resources using
28 // automation. 29 // automation.
29 class URLRequestAutomationJob : public net::URLRequestJob { 30 class URLRequestAutomationJob : public net::URLRequestJob {
30 public: 31 public:
31 URLRequestAutomationJob(net::URLRequest* request, 32 URLRequestAutomationJob(
32 net::NetworkDelegate* network_delegate, 33 net::URLRequest* request,
33 int tab, 34 net::NetworkDelegate* network_delegate,
34 int request_id, 35 const net::HttpUserAgentSettings* http_user_agent_settings,
35 AutomationResourceMessageFilter* filter, 36 int tab,
36 bool is_pending); 37 int request_id,
38 AutomationResourceMessageFilter* filter,
39 bool is_pending);
37 40
38 // Register our factory for HTTP/HTTPs requests. 41 // Register our factory for HTTP/HTTPs requests.
39 static void EnsureProtocolFactoryRegistered(); 42 static void EnsureProtocolFactoryRegistered();
40 43
41 static net::URLRequest::ProtocolFactory Factory; 44 static net::URLRequest::ProtocolFactory Factory;
42 45
43 // net::URLRequestJob methods. 46 // net::URLRequestJob methods.
44 virtual void Start(); 47 virtual void Start();
45 virtual void Kill(); 48 virtual void Kill();
46 virtual bool GetMimeType(std::string* mime_type) const; 49 virtual bool GetMimeType(std::string* mime_type) const;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 void OnDataAvailable(int id, const std::string& bytes); 93 void OnDataAvailable(int id, const std::string& bytes);
91 void OnRequestEnd(int id, const net::URLRequestStatus& status); 94 void OnRequestEnd(int id, const net::URLRequestStatus& status);
92 95
93 private: 96 private:
94 virtual ~URLRequestAutomationJob(); 97 virtual ~URLRequestAutomationJob();
95 98
96 // Task which is scheduled in the URLRequestAutomationJob::ReadRawData 99 // Task which is scheduled in the URLRequestAutomationJob::ReadRawData
97 // function, which completes the job. 100 // function, which completes the job.
98 void NotifyJobCompletionTask(); 101 void NotifyJobCompletionTask();
99 102
103 const net::HttpUserAgentSettings* http_user_agent_settings_;
100 int id_; 104 int id_;
101 int tab_; 105 int tab_;
102 scoped_refptr<AutomationResourceMessageFilter> message_filter_; 106 scoped_refptr<AutomationResourceMessageFilter> message_filter_;
103 107
104 scoped_refptr<net::IOBuffer> pending_buf_; 108 scoped_refptr<net::IOBuffer> pending_buf_;
105 size_t pending_buf_size_; 109 size_t pending_buf_size_;
106 110
107 std::string mime_type_; 111 std::string mime_type_;
108 scoped_refptr<net::HttpResponseHeaders> headers_; 112 scoped_refptr<net::HttpResponseHeaders> headers_;
109 std::string redirect_url_; 113 std::string redirect_url_;
(...skipping 22 matching lines...) Expand all
132 136
133 // Size of the upload data appended to the request. 137 // Size of the upload data appended to the request.
134 uint64 upload_size_; 138 uint64 upload_size_;
135 139
136 base::WeakPtrFactory<URLRequestAutomationJob> weak_factory_; 140 base::WeakPtrFactory<URLRequestAutomationJob> weak_factory_;
137 141
138 DISALLOW_COPY_AND_ASSIGN(URLRequestAutomationJob); 142 DISALLOW_COPY_AND_ASSIGN(URLRequestAutomationJob);
139 }; 143 };
140 144
141 #endif // CHROME_BROWSER_AUTOMATION_URL_REQUEST_AUTOMATION_JOB_H_ 145 #endif // CHROME_BROWSER_AUTOMATION_URL_REQUEST_AUTOMATION_JOB_H_
OLDNEW
« no previous file with comments | « android_webview/browser/net/aw_url_request_context_getter.cc ('k') | chrome/browser/automation/url_request_automation_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698