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

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/callback_helper.h

Issue 2826943002: Rewrite base::Bind to base::BindOnce with base_bind_rewriters in //chrome/browser/sync_file_system (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | chrome/browser/sync_file_system/drive_backend/drive_backend_sync_unittest.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 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 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_CALLBACK_HELPER_H_ 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_CALLBACK_HELPER_H_
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_CALLBACK_HELPER_H_ 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_CALLBACK_HELPER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <type_traits> 9 #include <type_traits>
10 10
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 static void Run(CallbackHolder<void()>* holder) { 71 static void Run(CallbackHolder<void()>* holder) {
72 holder->task_runner()->PostTask(holder->from_here(), holder->callback()); 72 holder->task_runner()->PostTask(holder->from_here(), holder->callback());
73 } 73 }
74 }; 74 };
75 75
76 template <typename... Args> 76 template <typename... Args>
77 struct RelayToTaskRunnerHelper<void(Args...)> { 77 struct RelayToTaskRunnerHelper<void(Args...)> {
78 static void Run(CallbackHolder<void(Args...)>* holder, Args... args) { 78 static void Run(CallbackHolder<void(Args...)>* holder, Args... args) {
79 holder->task_runner()->PostTask( 79 holder->task_runner()->PostTask(
80 holder->from_here(), 80 holder->from_here(),
81 base::Bind(holder->callback(), RebindForward(args)...)); 81 base::BindOnce(holder->callback(), RebindForward(args)...));
82 } 82 }
83 }; 83 };
84 84
85 } // namespace internal 85 } // namespace internal
86 86
87 template <typename T> 87 template <typename T>
88 base::Callback<T> RelayCallbackToTaskRunner( 88 base::Callback<T> RelayCallbackToTaskRunner(
89 const scoped_refptr<base::SequencedTaskRunner>& task_runner, 89 const scoped_refptr<base::SequencedTaskRunner>& task_runner,
90 const tracked_objects::Location& from_here, 90 const tracked_objects::Location& from_here,
91 const base::Callback<T>& callback) { 91 const base::Callback<T>& callback) {
(...skipping 13 matching lines...) Expand all
105 const base::Callback<T>& callback) { 105 const base::Callback<T>& callback) {
106 return RelayCallbackToTaskRunner( 106 return RelayCallbackToTaskRunner(
107 base::ThreadTaskRunnerHandle::Get(), 107 base::ThreadTaskRunnerHandle::Get(),
108 from_here, callback); 108 from_here, callback);
109 } 109 }
110 110
111 } // namespace drive_backend 111 } // namespace drive_backend
112 } // namespace sync_file_system 112 } // namespace sync_file_system
113 113
114 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_CALLBACK_HELPER_H_ 114 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_CALLBACK_HELPER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_backend/drive_backend_sync_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698