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

Side by Side Diff: util/file/file_writer.cc

Issue 821483002: Change 'bool world_readable' to an enum (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
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 unified diff | Download patch
« no previous file with comments | « util/file/file_writer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « util/file/file_writer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698