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

Unified Diff: content/browser/font_list_async.cc

Issue 9500008: Move font_list_async.h to content/public. Switch to Pass() goodness to simplify code. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix clang Created 8 years, 10 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 | « content/browser/font_list_async.h ('k') | content/browser/renderer_host/pepper_message_filter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/font_list_async.cc
===================================================================
--- content/browser/font_list_async.cc (revision 124079)
+++ content/browser/font_list_async.cc (working copy)
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/browser/font_list_async.h"
+#include "content/public/browser/font_list_async.h"
#include "base/bind.h"
#include "base/values.h"
@@ -15,30 +15,24 @@
// Just executes the given callback with the parameter.
void ReturnFontListToOriginalThread(
- const base::Callback<void(scoped_refptr<FontListResult>)>& callback,
- scoped_refptr<FontListResult> result) {
- callback.Run(result);
+ const base::Callback<void(scoped_ptr<base::ListValue>)>& callback,
+ scoped_ptr<base::ListValue> result) {
+ callback.Run(result.Pass());
}
void GetFontListOnFileThread(
BrowserThread::ID calling_thread_id,
- const base::Callback<void(scoped_refptr<FontListResult>)>& callback) {
- scoped_refptr<FontListResult> result(new FontListResult);
- result->list.reset(GetFontList_SlowBlocking());
+ const base::Callback<void(scoped_ptr<base::ListValue>)>& callback) {
+ scoped_ptr<base::ListValue> result(GetFontList_SlowBlocking());
BrowserThread::PostTask(calling_thread_id, FROM_HERE,
- base::Bind(&ReturnFontListToOriginalThread, callback, result));
+ base::Bind(&ReturnFontListToOriginalThread, callback,
+ base::Passed(&result)));
}
} // namespace
-FontListResult::FontListResult() {
-}
-
-FontListResult::~FontListResult() {
-}
-
void GetFontListAsync(
- const base::Callback<void(scoped_refptr<FontListResult>)>& callback) {
+ const base::Callback<void(scoped_ptr<base::ListValue>)>& callback) {
BrowserThread::ID id;
bool well_known_thread = BrowserThread::GetCurrentThreadIdentifier(&id);
DCHECK(well_known_thread)
« no previous file with comments | « content/browser/font_list_async.h ('k') | content/browser/renderer_host/pepper_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698