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

Unified Diff: chrome/browser/chromeos/platform_keys/platform_keys.cc

Issue 2534513002: Use TaskScheduler instead of WorkerPool in platform_keys.cc. (Closed)
Patch Set: add comment about priority Created 4 years, 1 month 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/chromeos/platform_keys/platform_keys.cc
diff --git a/chrome/browser/chromeos/platform_keys/platform_keys.cc b/chrome/browser/chromeos/platform_keys/platform_keys.cc
index ea709640db55cf532f855ff5690eca94806c6c7c..cc3ca6f56f2201530aa3d3bec269a9ed5c86c473 100644
--- a/chrome/browser/chromeos/platform_keys/platform_keys.cc
+++ b/chrome/browser/chromeos/platform_keys/platform_keys.cc
@@ -10,7 +10,7 @@
#include "base/bind_helpers.h"
#include "base/location.h"
#include "base/memory/ptr_util.h"
-#include "base/threading/worker_pool.h"
+#include "base/task_scheduler/post_task.h"
#include "net/base/hash_value.h"
#include "net/cert/x509_certificate.h"
@@ -66,13 +66,17 @@ void IntersectCertificates(
callback) {
std::unique_ptr<net::CertificateList> intersection(new net::CertificateList);
net::CertificateList* const intersection_ptr = intersection.get();
- if (!base::WorkerPool::PostTaskAndReply(
- FROM_HERE, base::Bind(&IntersectOnWorkerThread, certs1, certs2,
- intersection_ptr),
- base::Bind(callback, base::Passed(&intersection)),
- false /* task_is_slow */)) {
- callback.Run(base::WrapUnique(new net::CertificateList));
- }
+
+ // This is triggered by a call to the
+ // chrome.platformKeys.selectClientCertificates extensions API. Completion
+ // does not affect browser responsiveness, hence the BACKGROUND priority.
+ base::PostTaskWithTraitsAndReply(
+ FROM_HERE, base::TaskTraits()
+ .WithPriority(base::TaskPriority::BACKGROUND)
+ .WithShutdownBehavior(
+ base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN),
+ base::Bind(&IntersectOnWorkerThread, certs1, certs2, intersection_ptr),
+ base::Bind(callback, base::Passed(&intersection)));
}
} // namespace platform_keys
« 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