diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-09 22:26:41 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-09 22:26:41 +0000 |
commit | 92aad5227a8e7b00f7fbc3e409037bf23cccda0c (patch) | |
tree | 13ec2aa09ed2e376a6c78524c3489f24d8e2d9a4 /net/base/file_stream_posix.cc | |
parent | af416dfd64790147f1b25c634b4054907e54ba12 (diff) | |
download | chromium_src-92aad5227a8e7b00f7fbc3e409037bf23cccda0c.zip chromium_src-92aad5227a8e7b00f7fbc3e409037bf23cccda0c.tar.gz chromium_src-92aad5227a8e7b00f7fbc3e409037bf23cccda0c.tar.bz2 |
Add constructor to net::FileStream to create it with a base::PlatformFile handle.
Constructor added to both _win and _posix implementations and provided a unit test.
Review URL: http://codereview.chromium.org/20137
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9428 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/file_stream_posix.cc')
-rw-r--r-- | net/base/file_stream_posix.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/base/file_stream_posix.cc b/net/base/file_stream_posix.cc index abef9c2..7b248a4 100644 --- a/net/base/file_stream_posix.cc +++ b/net/base/file_stream_posix.cc @@ -47,6 +47,12 @@ FileStream::FileStream() : file_(base::kInvalidPlatformFileValue) { DCHECK(!IsOpen()); } +FileStream::FileStream(base::PlatformFile file, int flags) + : file_(file), open_flags_(flags) { + // TODO(hclam): initialize the aync_context_ if the file handle + // is opened as an asynchronous file handle. +} + FileStream::~FileStream() { Close(); } |