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

Side by Side Diff: content/child/fileapi/webfilesystem_impl.cc

Issue 2873333004: Rename TaskRunner::RunsTasksOnCurrentThread() in //content (Closed)
Patch Set: Created 3 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
« no previous file with comments | « content/child/child_message_filter.cc ('k') | content/child/fileapi/webfilewriter_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/child/fileapi/webfilesystem_impl.h" 5 #include "content/child/fileapi/webfilesystem_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <tuple> 8 #include <tuple>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 if (ChildThreadImpl::current()) 90 if (ChildThreadImpl::current())
91 ChildThreadImpl::current()->Send( 91 ChildThreadImpl::current()->Send(
92 new FileSystemHostMsg_DidReceiveSnapshotFile(request_id)); 92 new FileSystemHostMsg_DidReceiveSnapshotFile(request_id));
93 } 93 }
94 94
95 template <typename Method, typename Params> 95 template <typename Method, typename Params>
96 void CallDispatcherOnMainThread( 96 void CallDispatcherOnMainThread(
97 const scoped_refptr<base::SingleThreadTaskRunner>& main_thread_task_runner, 97 const scoped_refptr<base::SingleThreadTaskRunner>& main_thread_task_runner,
98 Method method, const Params& params, 98 Method method, const Params& params,
99 WaitableCallbackResults* waitable_results) { 99 WaitableCallbackResults* waitable_results) {
100 if (!main_thread_task_runner->RunsTasksOnCurrentThread()) { 100 if (!main_thread_task_runner->RunsTasksInCurrentSequence()) {
101 main_thread_task_runner->PostTask( 101 main_thread_task_runner->PostTask(
102 FROM_HERE, 102 FROM_HERE,
103 base::Bind(&CallDispatcherOnMainThread<Method, Params>, 103 base::Bind(&CallDispatcherOnMainThread<Method, Params>,
104 main_thread_task_runner, method, params, nullptr)); 104 main_thread_task_runner, method, params, nullptr));
105 if (!waitable_results) 105 if (!waitable_results)
106 return; 106 return;
107 waitable_results->WaitAndRun(); 107 waitable_results->WaitAndRun();
108 } 108 }
109 if (!ChildThreadImpl::current() || 109 if (!ChildThreadImpl::current() ||
110 !ChildThreadImpl::current()->file_system_dispatcher()) 110 !ChildThreadImpl::current()->file_system_dispatcher())
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 WaitableCallbackResults* WebFileSystemImpl::MaybeCreateWaitableResults( 679 WaitableCallbackResults* WebFileSystemImpl::MaybeCreateWaitableResults(
680 const WebFileSystemCallbacks& callbacks, int callbacks_id) { 680 const WebFileSystemCallbacks& callbacks, int callbacks_id) {
681 if (!callbacks.ShouldBlockUntilCompletion()) 681 if (!callbacks.ShouldBlockUntilCompletion())
682 return NULL; 682 return NULL;
683 WaitableCallbackResults* results = new WaitableCallbackResults(); 683 WaitableCallbackResults* results = new WaitableCallbackResults();
684 waitable_results_[callbacks_id] = results; 684 waitable_results_[callbacks_id] = results;
685 return results; 685 return results;
686 } 686 }
687 687
688 } // namespace content 688 } // namespace content
OLDNEW
« no previous file with comments | « content/child/child_message_filter.cc ('k') | content/child/fileapi/webfilewriter_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698