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

Side by Side Diff: net/url_request/url_request_job.h

Issue 2917133002: Perform redirect checks before OnReceivedRedirect in //net. (Closed)
Patch Set: rebase Created 3 years, 6 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
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 NET_URL_REQUEST_URL_REQUEST_JOB_H_ 5 #ifndef NET_URL_REQUEST_URL_REQUEST_JOB_H_
6 #define NET_URL_REQUEST_URL_REQUEST_JOB_H_ 6 #define NET_URL_REQUEST_URL_REQUEST_JOB_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 // completed. |synchronous| true if the read completed synchronously. 338 // completed. |synchronous| true if the read completed synchronously.
339 // See the documentation for |Read| above for the contract of this method. 339 // See the documentation for |Read| above for the contract of this method.
340 void SourceStreamReadComplete(bool synchronous, int result); 340 void SourceStreamReadComplete(bool synchronous, int result);
341 341
342 // Invokes ReadRawData and records bytes read if the read completes 342 // Invokes ReadRawData and records bytes read if the read completes
343 // synchronously. 343 // synchronously.
344 int ReadRawDataHelper(IOBuffer* buf, 344 int ReadRawDataHelper(IOBuffer* buf,
345 int buf_size, 345 int buf_size,
346 const CompletionCallback& callback); 346 const CompletionCallback& callback);
347 347
348 // Returns OK if |new_url| is a valid redirect target and an error code
349 // otherwise.
350 int CanFollowRedirect(const GURL& new_url);
351
348 // Called in response to a redirect that was not canceled to follow the 352 // Called in response to a redirect that was not canceled to follow the
349 // redirect. The current job will be replaced with a new job loading the 353 // redirect. The current job will be replaced with a new job loading the
350 // given redirect destination. 354 // given redirect destination.
351 void FollowRedirect(const RedirectInfo& redirect_info); 355 void FollowRedirect(const RedirectInfo& redirect_info);
352 356
353 // Called after every raw read. If |bytes_read| is > 0, this indicates 357 // Called after every raw read. If |bytes_read| is > 0, this indicates
354 // a successful read of |bytes_read| unfiltered bytes. If |bytes_read| 358 // a successful read of |bytes_read| unfiltered bytes. If |bytes_read|
355 // is 0, this indicates that there is no additional data to read. 359 // is 0, this indicates that there is no additional data to read.
356 // If |bytes_read| is negative, no bytes were read. 360 // If |bytes_read| is negative, no bytes were read.
357 void GatherRawReadStats(int bytes_read); 361 void GatherRawReadStats(int bytes_read);
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 CompletionCallback read_raw_callback_; 442 CompletionCallback read_raw_callback_;
439 443
440 base::WeakPtrFactory<URLRequestJob> weak_factory_; 444 base::WeakPtrFactory<URLRequestJob> weak_factory_;
441 445
442 DISALLOW_COPY_AND_ASSIGN(URLRequestJob); 446 DISALLOW_COPY_AND_ASSIGN(URLRequestJob);
443 }; 447 };
444 448
445 } // namespace net 449 } // namespace net
446 450
447 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_ 451 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698