Update source files for bracket style

This commit is contained in:
Marshall Greenblatt
2023-01-02 17:59:03 -05:00
parent d84b07a5cb
commit 3af3eab3e4
366 changed files with 7275 additions and 3834 deletions

View File

@@ -10,52 +10,61 @@
CefScopedTempDir::CefScopedTempDir() {}
CefScopedTempDir::~CefScopedTempDir() {
if (!path_.empty() && !Delete())
if (!path_.empty() && !Delete()) {
DLOG(WARNING) << "Could not delete temp dir in dtor.";
}
}
bool CefScopedTempDir::CreateUniqueTempDir() {
if (!path_.empty())
if (!path_.empty()) {
return false;
}
// This "scoped_dir" prefix is only used on Windows and serves as a template
// for the unique name.
if (!CefCreateNewTempDirectory("scoped_dir", path_))
if (!CefCreateNewTempDirectory("scoped_dir", path_)) {
return false;
}
return true;
}
bool CefScopedTempDir::CreateUniqueTempDirUnderPath(
const CefString& base_path) {
if (!path_.empty())
if (!path_.empty()) {
return false;
}
// If |base_path| does not exist, create it.
if (!CefCreateDirectory(base_path))
if (!CefCreateDirectory(base_path)) {
return false;
}
// Create a new, uniquely named directory under |base_path|.
if (!CefCreateTempDirectoryInDirectory(base_path, "scoped_dir_", path_))
if (!CefCreateTempDirectoryInDirectory(base_path, "scoped_dir_", path_)) {
return false;
}
return true;
}
bool CefScopedTempDir::Set(const CefString& path) {
if (!path_.empty())
if (!path_.empty()) {
return false;
}
if (!CefDirectoryExists(path) && !CefCreateDirectory(path))
if (!CefDirectoryExists(path) && !CefCreateDirectory(path)) {
return false;
}
path_ = path;
return true;
}
bool CefScopedTempDir::Delete() {
if (path_.empty())
if (path_.empty()) {
return false;
}
bool ret = CefDeleteFile(path_, true);
if (ret) {