OLD | NEW |
1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 27 matching lines...) Expand all Loading... |
38 #endif // OS_POSIX | 38 #endif // OS_POSIX |
39 | 39 |
40 FileWriter::FileWriter() : file_() { | 40 FileWriter::FileWriter() : file_() { |
41 } | 41 } |
42 | 42 |
43 FileWriter::~FileWriter() { | 43 FileWriter::~FileWriter() { |
44 } | 44 } |
45 | 45 |
46 bool FileWriter::Open(const base::FilePath& path, | 46 bool FileWriter::Open(const base::FilePath& path, |
47 FileWriteMode write_mode, | 47 FileWriteMode write_mode, |
48 bool world_readable) { | 48 FilePermissions permissions) { |
49 CHECK(!file_.is_valid()); | 49 CHECK(!file_.is_valid()); |
50 file_.reset(LoggingOpenFileForWrite(path, write_mode, world_readable)); | 50 file_.reset(LoggingOpenFileForWrite(path, write_mode, permissions)); |
51 return file_.is_valid(); | 51 return file_.is_valid(); |
52 } | 52 } |
53 | 53 |
54 void FileWriter::Close() { | 54 void FileWriter::Close() { |
55 CHECK(file_.is_valid()); | 55 CHECK(file_.is_valid()); |
56 | 56 |
57 file_.reset(); | 57 file_.reset(); |
58 } | 58 } |
59 | 59 |
60 bool FileWriter::Write(const void* data, size_t size) { | 60 bool FileWriter::Write(const void* data, size_t size) { |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 | 148 |
149 return true; | 149 return true; |
150 } | 150 } |
151 | 151 |
152 FileOffset FileWriter::Seek(FileOffset offset, int whence) { | 152 FileOffset FileWriter::Seek(FileOffset offset, int whence) { |
153 DCHECK(file_.is_valid()); | 153 DCHECK(file_.is_valid()); |
154 return LoggingSeekFile(file_.get(), offset, whence); | 154 return LoggingSeekFile(file_.get(), offset, whence); |
155 } | 155 } |
156 | 156 |
157 } // namespace crashpad | 157 } // namespace crashpad |
OLD | NEW |