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

Unified Diff: util/net/http_body.h

Issue 791493007: Make http_body cross-platform (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@file-writer-redux
Patch Set: fixes Created 6 years 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 | « no previous file | util/net/http_body.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/net/http_body.h
diff --git a/util/net/http_body.h b/util/net/http_body.h
index 0347e636f1b103d6910d7f2c540cd5587e949977..3cc2f19d01d98ef70dcf6d488f894072a0d411be 100644
--- a/util/net/http_body.h
+++ b/util/net/http_body.h
@@ -23,6 +23,7 @@
#include "base/basictypes.h"
#include "base/files/file_path.h"
+#include "util/file/file_io.h"
namespace crashpad {
@@ -83,18 +84,16 @@ class FileHTTPBodyStream : public HTTPBodyStream {
ssize_t GetBytesBuffer(uint8_t* buffer, size_t max_len) override;
private:
- enum InvalidFD {
- kUnopenedFile = -1,
- kFileOpenError = -2,
- kClosedAtEOF = -3,
+ enum FileState {
+ kUnopenedFile,
+ kFileOpenError,
+ kClosedAtEOF,
+ kReading,
};
base::FilePath path_;
-
- // If |fd_| is greater than or equal to zero, it is an opened descriptor
- // from which an instance of this class is reading. If |fd_| is less than
- // zero, the value corresponds to an InvalidFD value.
- int fd_;
+ ScopedFileHandle file_;
+ FileState file_state_;
DISALLOW_COPY_AND_ASSIGN(FileHTTPBodyStream);
};
« no previous file with comments | « no previous file | util/net/http_body.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698