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

Side by Side Diff: content/browser/font_list_async.cc

Issue 1545243002: Convert Pass()→std::move() in //content/browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/public/browser/font_list_async.h" 5 #include "content/public/browser/font_list_async.h"
6 6
7 #include <utility>
8
7 #include "base/bind.h" 9 #include "base/bind.h"
8 #include "base/values.h" 10 #include "base/values.h"
9 #include "content/common/font_list.h" 11 #include "content/common/font_list.h"
10 #include "content/public/browser/browser_thread.h" 12 #include "content/public/browser/browser_thread.h"
11 13
12 namespace content { 14 namespace content {
13 15
14 namespace { 16 namespace {
15 17
16 // Just executes the given callback with the parameter. 18 // Just executes the given callback with the parameter.
17 void ReturnFontListToOriginalThread( 19 void ReturnFontListToOriginalThread(
18 const base::Callback<void(scoped_ptr<base::ListValue>)>& callback, 20 const base::Callback<void(scoped_ptr<base::ListValue>)>& callback,
19 scoped_ptr<base::ListValue> result) { 21 scoped_ptr<base::ListValue> result) {
20 callback.Run(result.Pass()); 22 callback.Run(std::move(result));
21 } 23 }
22 24
23 void GetFontListInBlockingPool( 25 void GetFontListInBlockingPool(
24 BrowserThread::ID calling_thread_id, 26 BrowserThread::ID calling_thread_id,
25 const base::Callback<void(scoped_ptr<base::ListValue>)>& callback) { 27 const base::Callback<void(scoped_ptr<base::ListValue>)>& callback) {
26 scoped_ptr<base::ListValue> result(GetFontList_SlowBlocking()); 28 scoped_ptr<base::ListValue> result(GetFontList_SlowBlocking());
27 BrowserThread::PostTask(calling_thread_id, FROM_HERE, 29 BrowserThread::PostTask(calling_thread_id, FROM_HERE,
28 base::Bind(&ReturnFontListToOriginalThread, callback, 30 base::Bind(&ReturnFontListToOriginalThread, callback,
29 base::Passed(&result))); 31 base::Passed(&result)));
30 } 32 }
31 33
32 } // namespace 34 } // namespace
33 35
34 void GetFontListAsync( 36 void GetFontListAsync(
35 const base::Callback<void(scoped_ptr<base::ListValue>)>& callback) { 37 const base::Callback<void(scoped_ptr<base::ListValue>)>& callback) {
36 BrowserThread::ID id; 38 BrowserThread::ID id;
37 bool well_known_thread = BrowserThread::GetCurrentThreadIdentifier(&id); 39 bool well_known_thread = BrowserThread::GetCurrentThreadIdentifier(&id);
38 DCHECK(well_known_thread) 40 DCHECK(well_known_thread)
39 << "Can only call GetFontList from a well-known thread."; 41 << "Can only call GetFontList from a well-known thread.";
40 42
41 BrowserThread::PostBlockingPoolSequencedTask( 43 BrowserThread::PostBlockingPoolSequencedTask(
42 kFontListSequenceToken, 44 kFontListSequenceToken,
43 FROM_HERE, 45 FROM_HERE,
44 base::Bind(&GetFontListInBlockingPool, id, callback)); 46 base::Bind(&GetFontListInBlockingPool, id, callback));
45 } 47 }
46 48
47 } // namespace content 49 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/fileapi/obfuscated_file_util_unittest.cc ('k') | content/browser/frame_host/frame_mojo_shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698