summaryrefslogtreecommitdiffstats
path: root/content/browser/font_list_async.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-29 19:20:14 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-29 19:20:14 +0000
commitec810db7e403d8d9dbc3ce36b5089cb76b632220 (patch)
tree65fcd3c4087d71d43501bc3b0b0ab7e33ff30310 /content/browser/font_list_async.cc
parentbd52c7595f5b2243a5e95adc31cb348dbcd27a32 (diff)
downloadchromium_src-ec810db7e403d8d9dbc3ce36b5089cb76b632220.zip
chromium_src-ec810db7e403d8d9dbc3ce36b5089cb76b632220.tar.gz
chromium_src-ec810db7e403d8d9dbc3ce36b5089cb76b632220.tar.bz2
Move font_list_async.h to content/public. Switch to Pass() goodness to simplify code.
BUG=98716 Review URL: https://chromiumcodereview.appspot.com/9500008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124224 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/font_list_async.cc')
-rw-r--r--content/browser/font_list_async.cc24
1 files changed, 9 insertions, 15 deletions
diff --git a/content/browser/font_list_async.cc b/content/browser/font_list_async.cc
index 51a5403..032cfdb 100644
--- a/content/browser/font_list_async.cc
+++ b/content/browser/font_list_async.cc
@@ -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 @@ namespace {
// 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)