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

Side by Side Diff: chrome/browser/chromeos/drive/fileapi/async_file_util.cc

Issue 1124813003: [chrome/browser/chromeos/drive] Avoid use of MessageLoopProxy by use of TTRH (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Review Comments 3 : Indent Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/chromeos/drive/fileapi/async_file_util.h" 5 #include "chrome/browser/chromeos/drive/fileapi/async_file_util.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/single_thread_task_runner.h"
11 #include "base/thread_task_runner_handle.h"
10 #include "base/threading/sequenced_worker_pool.h" 12 #include "base/threading/sequenced_worker_pool.h"
11 #include "chrome/browser/chromeos/drive/drive_integration_service.h" 13 #include "chrome/browser/chromeos/drive/drive_integration_service.h"
12 #include "chrome/browser/chromeos/drive/file_system_util.h" 14 #include "chrome/browser/chromeos/drive/file_system_util.h"
13 #include "chrome/browser/chromeos/drive/fileapi/fileapi_worker.h" 15 #include "chrome/browser/chromeos/drive/fileapi/fileapi_worker.h"
14 #include "content/public/browser/browser_thread.h" 16 #include "content/public/browser/browser_thread.h"
15 #include "google_apis/drive/task_util.h" 17 #include "google_apis/drive/task_util.h"
16 #include "storage/browser/blob/shareable_file_reference.h" 18 #include "storage/browser/blob/shareable_file_reference.h"
17 #include "storage/browser/fileapi/file_system_operation_context.h" 19 #include "storage/browser/fileapi/file_system_operation_context.h"
18 #include "storage/browser/fileapi/file_system_url.h" 20 #include "storage/browser/fileapi/file_system_url.h"
19 21
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 DCHECK_CURRENTLY_ON(BrowserThread::IO); 53 DCHECK_CURRENTLY_ON(BrowserThread::IO);
52 54
53 BrowserThread::PostTask( 55 BrowserThread::PostTask(
54 BrowserThread::UI, 56 BrowserThread::UI,
55 FROM_HERE, 57 FROM_HERE,
56 base::Bind(&fileapi_internal::RunFileSystemCallback, 58 base::Bind(&fileapi_internal::RunFileSystemCallback,
57 file_system_getter, function, 59 file_system_getter, function,
58 on_error_callback.is_null() ? 60 on_error_callback.is_null() ?
59 base::Closure() : 61 base::Closure() :
60 base::Bind(&google_apis::RunTaskWithTaskRunner, 62 base::Bind(&google_apis::RunTaskWithTaskRunner,
61 base::MessageLoopProxy::current(), 63 base::ThreadTaskRunnerHandle::Get(),
62 on_error_callback))); 64 on_error_callback)));
63 } 65 }
64 66
65 // Runs CreateOrOpenFile callback based on the given |error| and |file|. 67 // Runs CreateOrOpenFile callback based on the given |error| and |file|.
66 void RunCreateOrOpenFileCallback( 68 void RunCreateOrOpenFileCallback(
67 const AsyncFileUtil::CreateOrOpenCallback& callback, 69 const AsyncFileUtil::CreateOrOpenCallback& callback,
68 base::File file, 70 base::File file,
69 const base::Closure& close_callback_on_ui_thread) { 71 const base::Closure& close_callback_on_ui_thread) {
70 DCHECK_CURRENTLY_ON(BrowserThread::IO); 72 DCHECK_CURRENTLY_ON(BrowserThread::IO);
71 73
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 base::Bind(&RunCreateSnapshotFileCallback, callback))), 443 base::Bind(&RunCreateSnapshotFileCallback, callback))),
442 base::Bind(callback, 444 base::Bind(callback,
443 base::File::FILE_ERROR_FAILED, 445 base::File::FILE_ERROR_FAILED,
444 base::File::Info(), 446 base::File::Info(),
445 base::FilePath(), 447 base::FilePath(),
446 scoped_refptr<storage::ShareableFileReference>())); 448 scoped_refptr<storage::ShareableFileReference>()));
447 } 449 }
448 450
449 } // namespace internal 451 } // namespace internal
450 } // namespace drive 452 } // namespace drive
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/drive/file_system_util_unittest.cc ('k') | chrome/browser/chromeos/drive/fileapi/fileapi_worker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698