Chromium Code Reviews| Index: base/files/file.cc |
| diff --git a/base/files/file.cc b/base/files/file.cc |
| index 4902f15a2ff02744e44699317565797ebf0c05b3..508103ac7d4e1ebac1d376565bd25f3b86abe258 100644 |
| --- a/base/files/file.cc |
| +++ b/base/files/file.cc |
| @@ -31,14 +31,17 @@ File::File(const FilePath& name, uint32 flags) |
| error_(FILE_OK), |
| created_(false), |
| async_(false) { |
| - if (name.ReferencesParent()) { |
| - error_ = FILE_ERROR_ACCESS_DENIED; |
| - return; |
| - } |
| - CreateBaseFileUnsafe(name, flags); |
| + Initialize(name, flags); |
| } |
| #endif |
| +File::File(PlatformFile platform_file) |
| + : file_(platform_file), |
| + error_(FILE_OK), |
| + created_(false), |
|
cpu_(ooo_6.6-7.5)
2013/12/21 22:59:33
if they pass you a handle then the created_ = true
rvargas (doing something else)
2013/12/27 23:54:39
In this case there is not enough information to de
|
| + async_(false) { |
| +} |
| + |
| File::File(RValue other) |
| : file_(other.object->TakePlatformFile()), |
| error_(other.object->error()), |
| @@ -61,4 +64,14 @@ File& File::operator=(RValue other) { |
| return *this; |
| } |
| +#if !defined(OS_NACL) |
| +void File::Initialize(const FilePath& name, uint32 flags) { |
| + if (name.ReferencesParent()) { |
| + error_ = FILE_ERROR_ACCESS_DENIED; |
| + return; |
| + } |
| + InitializeUnsafe(name, flags); |
| +} |
| +#endif |
| + |
| } // namespace base |