fix: normalize path before calling showItemInFolder and openPath (#41642)

* fix: normalize path before calling ShowItemInFolder

* fix: normalize path before calling OpenPath
This commit is contained in:
Piotr Płaczek 2024-03-22 14:28:44 +00:00 committed by GitHub
parent 707b9a58cc
commit 90a7e5acae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -336,7 +336,8 @@ void ShowItemInFolder(const base::FilePath& full_path) {
base::ThreadPool::CreateCOMSTATaskRunner( base::ThreadPool::CreateCOMSTATaskRunner(
{base::MayBlock(), base::TaskPriority::USER_BLOCKING}) {base::MayBlock(), base::TaskPriority::USER_BLOCKING})
->PostTask(FROM_HERE, ->PostTask(FROM_HERE,
base::BindOnce(&ShowItemInFolderOnWorkerThread, full_path)); base::BindOnce(&ShowItemInFolderOnWorkerThread,
full_path.NormalizePathSeparators()));
} }
void OpenPath(const base::FilePath& full_path, OpenCallback callback) { void OpenPath(const base::FilePath& full_path, OpenCallback callback) {
@ -344,9 +345,11 @@ void OpenPath(const base::FilePath& full_path, OpenCallback callback) {
base::ThreadPool::CreateCOMSTATaskRunner( base::ThreadPool::CreateCOMSTATaskRunner(
{base::MayBlock(), base::TaskPriority::USER_BLOCKING}) {base::MayBlock(), base::TaskPriority::USER_BLOCKING})
->PostTaskAndReplyWithResult(FROM_HERE, ->PostTaskAndReplyWithResult(
base::BindOnce(&OpenPathOnThread, full_path), FROM_HERE,
std::move(callback)); base::BindOnce(&OpenPathOnThread,
full_path.NormalizePathSeparators()),
std::move(callback));
} }
void OpenExternal(const GURL& url, void OpenExternal(const GURL& url,