mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update source files for bracket style
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user