Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Unified Diff: chrome/browser/extensions/api/messaging/native_message_process_host.cc

Issue 2836083003: Use TaskScheduler instead of blocking pool in native_message_process_host.cc. (Closed)
Patch Set: self-review Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/messaging/native_message_process_host.cc
diff --git a/chrome/browser/extensions/api/messaging/native_message_process_host.cc b/chrome/browser/extensions/api/messaging/native_message_process_host.cc
index 1974d6abb78f694f5f2143e4af2324ba841eb322..93b5faefd81d0d8e711ce9aac71d6e1b1224d306 100644
--- a/chrome/browser/extensions/api/messaging/native_message_process_host.cc
+++ b/chrome/browser/extensions/api/messaging/native_message_process_host.cc
@@ -13,7 +13,6 @@
#include "base/logging.h"
#include "base/process/kill.h"
#include "base/task_scheduler/post_task.h"
-#include "base/threading/sequenced_worker_pool.h"
#include "build/build_config.h"
#include "chrome/browser/extensions/api/messaging/native_messaging_host_manifest.h"
#include "chrome/browser/extensions/api/messaging/native_process_launcher.h"
@@ -72,9 +71,10 @@ NativeMessageProcessHost::~NativeMessageProcessHost() {
// task on the blocking pool.
#if defined(OS_MACOSX)
base::PostTaskWithTraits(
- FROM_HERE, base::TaskTraits().MayBlock().WithPriority(
- base::TaskPriority::BACKGROUND),
- base::Bind(&base::EnsureProcessTerminated, Passed(&process_)));
+ FROM_HERE,
+ base::TaskTraits().MayBlock().WithPriority(
+ base::TaskPriority::BACKGROUND),
+ base::BindOnce(&base::EnsureProcessTerminated, Passed(&process_)));
#else
base::EnsureProcessTerminated(std::move(process_));
#endif
@@ -146,10 +146,11 @@ void NativeMessageProcessHost::OnHostProcessLaunched(
read_file_ = read_file.GetPlatformFile();
#endif
- scoped_refptr<base::TaskRunner> task_runner(
- content::BrowserThread::GetBlockingPool()->
- GetTaskRunnerWithShutdownBehavior(
- base::SequencedWorkerPool::SKIP_ON_SHUTDOWN));
+ scoped_refptr<base::TaskRunner> task_runner(base::CreateTaskRunnerWithTraits(
+ base::TaskTraits()
+ .MayBlock()
+ .WithPriority(base::TaskPriority::USER_VISIBLE)
+ .WithShutdownBehavior(base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN)));
read_stream_.reset(new net::FileStream(std::move(read_file), task_runner));
write_stream_.reset(new net::FileStream(std::move(write_file), task_runner));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698