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

Unified Diff: content/browser/font_list_async.cc

Issue 2886883003: Remove content::kFontListSequenceToken. (Closed)
Patch Set: Created 3 years, 7 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 | content/browser/renderer_host/pepper/pepper_browser_font_singleton_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/font_list_async.cc
diff --git a/content/browser/font_list_async.cc b/content/browser/font_list_async.cc
index 70834861ec8bb87aa920e06a4757f3c8d4fdbcf4..d393155ba5f1e924e3c97df47cae6a3c1d54035e 100644
--- a/content/browser/font_list_async.cc
+++ b/content/browser/font_list_async.cc
@@ -7,43 +7,17 @@
#include <utility>
#include "base/bind.h"
+#include "base/task_runner_util.h"
#include "base/values.h"
#include "content/common/font_list.h"
-#include "content/public/browser/browser_thread.h"
namespace content {
-namespace {
-
-// Just executes the given callback with the parameter.
-void ReturnFontListToOriginalThread(
- const base::Callback<void(std::unique_ptr<base::ListValue>)>& callback,
- std::unique_ptr<base::ListValue> result) {
- callback.Run(std::move(result));
-}
-
-void GetFontListInBlockingPool(
- BrowserThread::ID calling_thread_id,
- const base::Callback<void(std::unique_ptr<base::ListValue>)>& callback) {
- std::unique_ptr<base::ListValue> result(GetFontList_SlowBlocking());
- BrowserThread::PostTask(calling_thread_id, FROM_HERE,
- base::Bind(&ReturnFontListToOriginalThread, callback,
- base::Passed(&result)));
-}
-
-} // namespace
-
void GetFontListAsync(
- const base::Callback<void(std::unique_ptr<base::ListValue>)>& callback) {
- BrowserThread::ID id;
- bool well_known_thread = BrowserThread::GetCurrentThreadIdentifier(&id);
- DCHECK(well_known_thread)
- << "Can only call GetFontList from a well-known thread.";
-
- BrowserThread::PostBlockingPoolSequencedTask(
- kFontListSequenceToken,
- FROM_HERE,
- base::Bind(&GetFontListInBlockingPool, id, callback));
+ base::OnceCallback<void(std::unique_ptr<base::ListValue>)> callback) {
+ base::PostTaskAndReplyWithResult(GetFontListTaskRunner().get(), FROM_HERE,
+ base::BindOnce(&GetFontList_SlowBlocking),
+ std::move(callback));
}
} // namespace content
« no previous file with comments | « no previous file | content/browser/renderer_host/pepper/pepper_browser_font_singleton_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698