Skip to content

Commit 01783f2

Browse files
committed
Fix base::ThreadPool usage
1 parent f41daea commit 01783f2

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/api/nw_window_api.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "base/strings/stringprintf.h"
55
#include "base/strings/utf_string_conversions.h"
66
#include "base/task/post_task.h"
7+
#include "base/task/thread_pool.h"
78
#include "content/public/browser/render_widget_host.h"
89
#include "chrome/browser/browser_process.h"
910
#include "chrome/browser/devtools/devtools_window.h"
@@ -972,8 +973,8 @@ ExtensionFunction::ResponseAction
972973
NwCurrentWindowInternalGetPrintersFunction::Run() {
973974
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
974975

975-
base::PostTaskAndReplyWithResult(
976-
FROM_HERE, {base::ThreadPool(), base::MayBlock(), base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
976+
base::ThreadPool::PostTaskAndReplyWithResult(
977+
FROM_HERE, {base::MayBlock(), base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
977978
base::BindOnce(&EnumeratePrintersAsync),
978979
base::BindOnce(&NwCurrentWindowInternalGetPrintersFunction::OnGetPrinterList,
979980
this));

src/api/shell/shell.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "base/files/file_util.h"
2525
#include "base/bind.h"
2626
#include "base/logging.h"
27+
#include "base/task/thread_pool.h"
2728
#include "base/values.h"
2829
#include "base/task/post_task.h"
2930
#include "content/public/browser/browser_context.h"
@@ -64,9 +65,9 @@ void Shell::Call(const std::string& method,
6465
arguments.GetString(0, &full_path);
6566
FilePath path = FilePath::FromUTF8Unsafe(full_path);
6667
platform_util::OpenItemType *item_type = new platform_util::OpenItemType();
67-
base::PostTaskAndReplyWithResult(
68+
base::ThreadPool::PostTaskAndReplyWithResult(
6869
FROM_HERE,
69-
{base::ThreadPool(), base::MayBlock(), base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
70+
{base::MayBlock(), base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
7071
base::BindOnce(&VerifyItemType, path, base::Unretained(item_type)),
7172
base::BindOnce(&OnItemTypeVerified, profile, path, base::Owned(item_type))
7273
);

0 commit comments

Comments
 (0)