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

Side by Side Diff: chrome/browser/chromeos/gdata/task_util.cc

Issue 10825459: gdata: Move task related functions like RunTaskOnUIThread from gdata_file_system.cc to task_util.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/chromeos/gdata/task_util.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/chromeos/gdata/task_util.h"
6
7 #include "base/location.h"
8 #include "content/public/browser/browser_thread.h"
9
10 using content::BrowserThread;
11
12 namespace gdata {
13
14 void RunTaskOnThread(scoped_refptr<base::MessageLoopProxy> relay_proxy,
15 const base::Closure& task) {
16 if (relay_proxy->BelongsToCurrentThread()) {
17 task.Run();
18 } else {
19 const bool posted = relay_proxy->PostTask(FROM_HERE, task);
20 DCHECK(posted);
21 }
22 }
23
24 void RunTaskOnUIThread(const base::Closure& task) {
25 RunTaskOnThread(
26 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), task);
27 }
28
29 } // namespace gdata
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/gdata/task_util.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698