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

Side by Side Diff: content/public/common/url_fetcher.h

Issue 9572001: Do cookie checks in NetworkDelegate instead of the URLRequest::Delegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: TestShellNetworkDelegate Created 8 years, 9 months 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) 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 4
5 #ifndef CONTENT_PUBLIC_COMMON_URL_FETCHER_H_ 5 #ifndef CONTENT_PUBLIC_COMMON_URL_FETCHER_H_
6 #define CONTENT_PUBLIC_COMMON_URL_FETCHER_H_ 6 #define CONTENT_PUBLIC_COMMON_URL_FETCHER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 // This appends the header to the current extra request headers. 149 // This appends the header to the current extra request headers.
150 virtual void AddExtraRequestHeader(const std::string& header_line) = 0; 150 virtual void AddExtraRequestHeader(const std::string& header_line) = 0;
151 151
152 virtual void GetExtraRequestHeaders(net::HttpRequestHeaders* headers) = 0; 152 virtual void GetExtraRequestHeaders(net::HttpRequestHeaders* headers) = 0;
153 153
154 // Set the net::URLRequestContext on the request. Must be called before the 154 // Set the net::URLRequestContext on the request. Must be called before the
155 // request is started. 155 // request is started.
156 virtual void SetRequestContext( 156 virtual void SetRequestContext(
157 net::URLRequestContextGetter* request_context_getter) = 0; 157 net::URLRequestContextGetter* request_context_getter) = 0;
158 158
159 // Mark URLRequests started by the URLFetcher to stem from the given render
160 // view.
161 virtual void AssociateWithRenderView(int process_id, int routing_id) = 0;
162
159 // If |retry| is false, 5xx responses will be propagated to the observer, 163 // If |retry| is false, 5xx responses will be propagated to the observer,
160 // if it is true URLFetcher will automatically re-execute the request, 164 // if it is true URLFetcher will automatically re-execute the request,
161 // after backoff_delay() elapses. URLFetcher has it set to true by default. 165 // after backoff_delay() elapses. URLFetcher has it set to true by default.
162 virtual void SetAutomaticallyRetryOn5xx(bool retry) = 0; 166 virtual void SetAutomaticallyRetryOn5xx(bool retry) = 0;
163 167
164 virtual void SetMaxRetries(int max_retries) = 0; 168 virtual void SetMaxRetries(int max_retries) = 0;
165 virtual int GetMaxRetries() const = 0; 169 virtual int GetMaxRetries() const = 0;
166 170
167 // Returns the back-off delay before the request will be retried, 171 // Returns the back-off delay before the request will be retried,
168 // when a 5xx response was received. 172 // when a 5xx response was received.
(...skipping 16 matching lines...) Expand all
185 189
186 // Returns true if the request was delivered through a proxy. Must only 190 // Returns true if the request was delivered through a proxy. Must only
187 // be called after the OnURLFetchComplete callback has run and the request 191 // be called after the OnURLFetchComplete callback has run and the request
188 // has not failed. 192 // has not failed.
189 virtual bool WasFetchedViaProxy() const = 0; 193 virtual bool WasFetchedViaProxy() const = 0;
190 194
191 // Start the request. After this is called, you may not change any other 195 // Start the request. After this is called, you may not change any other
192 // settings. 196 // settings.
193 virtual void Start() = 0; 197 virtual void Start() = 0;
194 198
195 // Restarts the URLFetcher with a new URLRequestContextGetter.
196 virtual void StartWithRequestContextGetter(
197 net::URLRequestContextGetter* request_context_getter) = 0;
198
199 // Return the URL that we were asked to fetch. 199 // Return the URL that we were asked to fetch.
200 virtual const GURL& GetOriginalURL() const = 0; 200 virtual const GURL& GetOriginalURL() const = 0;
201 201
202 // Return the URL that this fetcher is processing. 202 // Return the URL that this fetcher is processing.
203 virtual const GURL& GetURL() const = 0; 203 virtual const GURL& GetURL() const = 0;
204 204
205 // The status of the URL fetch. 205 // The status of the URL fetch.
206 virtual const net::URLRequestStatus& GetStatus() const = 0; 206 virtual const net::URLRequestStatus& GetStatus() const = 0;
207 207
208 // The http response code received. Will return RESPONSE_CODE_INVALID 208 // The http response code received. Will return RESPONSE_CODE_INVALID
(...skipping 21 matching lines...) Expand all
230 // true, caller takes responsibility for the temp file, and it will not 230 // true, caller takes responsibility for the temp file, and it will not
231 // be removed once the URLFetcher is destroyed. User should not take 231 // be removed once the URLFetcher is destroyed. User should not take
232 // ownership more than once, or call this method after taking ownership. 232 // ownership more than once, or call this method after taking ownership.
233 virtual bool GetResponseAsFilePath(bool take_ownership, 233 virtual bool GetResponseAsFilePath(bool take_ownership,
234 FilePath* out_response_path) const = 0; 234 FilePath* out_response_path) const = 0;
235 }; 235 };
236 236
237 } // namespace content 237 } // namespace content
238 238
239 #endif // CONTENT_PUBLIC_COMMON_URL_FETCHER_H_ 239 #endif // CONTENT_PUBLIC_COMMON_URL_FETCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698