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

Unified Diff: net/url_request/url_request_file_dir_job.h

Issue 1467603002: URLRequestJob: change ReadRawData contract (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add done_reading_called_ to MockNetworkTransaction Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/test/url_request/url_request_slow_download_job.cc ('k') | net/url_request/url_request_file_dir_job.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_file_dir_job.h
diff --git a/net/url_request/url_request_file_dir_job.h b/net/url_request/url_request_file_dir_job.h
index 067db81ed64cc9199e0afa41f4e502718a33e3d6..f7a7b45117d8c78624de2c32115af29d85d52db8 100644
--- a/net/url_request/url_request_file_dir_job.h
+++ b/net/url_request/url_request_file_dir_job.h
@@ -10,6 +10,7 @@
#include "base/files/file_path.h"
#include "base/memory/weak_ptr.h"
#include "net/base/directory_lister.h"
+#include "net/base/net_errors.h"
#include "net/url_request/url_request_job.h"
namespace net {
@@ -29,7 +30,7 @@ class URLRequestFileDirJob
// Overridden from URLRequestJob:
void Start() override;
void Kill() override;
- bool ReadRawData(IOBuffer* buf, int buf_size, int* bytes_read) override;
+ int ReadRawData(IOBuffer* buf, int buf_size) override;
bool GetMimeType(std::string* mime_type) const override;
bool GetCharset(std::string* charset) override;
@@ -45,7 +46,7 @@ class URLRequestFileDirJob
// When we have data and a read has been pending, this function
// will fill the response buffer and notify the request
// appropriately.
- void CompleteRead();
+ void CompleteRead(Error error);
// Fills a buffer with the output.
bool FillReadBuffer(char* buf, int buf_size, int* bytes_read);
@@ -67,6 +68,7 @@ class URLRequestFileDirJob
bool read_pending_;
scoped_refptr<IOBuffer> read_buffer_;
int read_buffer_length_;
+
base::WeakPtrFactory<URLRequestFileDirJob> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(URLRequestFileDirJob);
« no previous file with comments | « net/test/url_request/url_request_slow_download_job.cc ('k') | net/url_request/url_request_file_dir_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698