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

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

Issue 2262653003: Make URLRequest::Read to return net errors or bytes read instead of a bool (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more fixes Created 4 years, 3 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 // this call, nor is it obliged to fail with "canceled" unless not all data 89 // this call, nor is it obliged to fail with "canceled" unless not all data
90 // was sent as a result. A typical case would be where the job is almost 90 // was sent as a result. A typical case would be where the job is almost
91 // complete and can succeed before the canceled notification can be 91 // complete and can succeed before the canceled notification can be
92 // dispatched (from the message loop). 92 // dispatched (from the message loop).
93 // 93 //
94 // The job should be prepared to receive multiple calls to kill it, but only 94 // The job should be prepared to receive multiple calls to kill it, but only
95 // one notification must be issued. 95 // one notification must be issued.
96 virtual void Kill(); 96 virtual void Kill();
97 97
98 // Called to read post-filtered data from this Job, returning the number of 98 // Called to read post-filtered data from this Job, returning the number of
99 // bytes read, 0 when there is no more data, or -1 if there was an error. 99 // bytes read, 0 when there is no more data, or net error if there was an
100 // This is just the backend for URLRequest::Read, see that function for 100 // error. This is just the backend for URLRequest::Read, see that function for
101 // more info. 101 // more info.
102 int Read(IOBuffer* buf, int buf_size);
103 // Deprecated.
102 bool Read(IOBuffer* buf, int buf_size, int* bytes_read); 104 bool Read(IOBuffer* buf, int buf_size, int* bytes_read);
103 105
104 // Stops further caching of this request, if any. For more info, see 106 // Stops further caching of this request, if any. For more info, see
105 // URLRequest::StopCaching(). 107 // URLRequest::StopCaching().
106 virtual void StopCaching(); 108 virtual void StopCaching();
107 109
108 virtual bool GetFullRequestHeaders(HttpRequestHeaders* headers) const; 110 virtual bool GetFullRequestHeaders(HttpRequestHeaders* headers) const;
109 111
110 // Get the number of bytes received from network. The values returned by this 112 // Get the number of bytes received from network. The values returned by this
111 // will never decrease over the lifetime of the URLRequestJob. 113 // will never decrease over the lifetime of the URLRequestJob.
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 int64_t last_notified_total_sent_bytes_; 461 int64_t last_notified_total_sent_bytes_;
460 462
461 base::WeakPtrFactory<URLRequestJob> weak_factory_; 463 base::WeakPtrFactory<URLRequestJob> weak_factory_;
462 464
463 DISALLOW_COPY_AND_ASSIGN(URLRequestJob); 465 DISALLOW_COPY_AND_ASSIGN(URLRequestJob);
464 }; 466 };
465 467
466 } // namespace net 468 } // namespace net
467 469
468 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_ 470 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698