[chromecast] Rewrite usage of base::WriteFile
Only user of ScopedTempFile wasn't checking the return value so change the return value to match the non-deprecated base::WriteFile version. Bug: 41134632 Change-Id: Ia9bb23983b0f43feb7f570cf7e2870629fe11500 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5791699 Reviewed-by: Vigen Issahhanjan <vigeni@google.com> Commit-Queue: Dave Tapuska <dtapuska@chromium.org> Cr-Commit-Position: refs/heads/main@{#1342437}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
d4e11db5ed
commit
dd529535c7
chromecast/base
@ -22,9 +22,9 @@ bool ScopedTempFile::FileExists() const {
|
||||
return base::PathExists(path_);
|
||||
}
|
||||
|
||||
int ScopedTempFile::Write(const std::string& str) {
|
||||
bool ScopedTempFile::Write(const std::string& str) {
|
||||
CHECK(FileExists());
|
||||
return base::WriteFile(path_, str.c_str(), str.size());
|
||||
return base::WriteFile(path_, str);
|
||||
}
|
||||
|
||||
std::string ScopedTempFile::Read() const {
|
||||
|
@ -31,9 +31,9 @@ class ScopedTempFile {
|
||||
// return false, for example, if the file has been moved or deleted.
|
||||
bool FileExists() const;
|
||||
|
||||
// Write the contents of |str| to the file. Return the number of characters
|
||||
// written, or -1 on error. CHECKs that FileExists() returns true.
|
||||
int Write(const std::string& str);
|
||||
// Write the contents of |str| to the file. Returns the whether all the
|
||||
// contents were written to the file. CHECKs that FileExists() returns true.
|
||||
bool Write(const std::string& str);
|
||||
|
||||
// Read the file and return the contents. CHECKs that FileExists() returns
|
||||
// true.
|
||||
|
Reference in New Issue
Block a user