Index: chrome/browser/sync_file_system/sync_file_system_test_util.h |
diff --git a/chrome/browser/sync_file_system/sync_file_system_test_util.h b/chrome/browser/sync_file_system/sync_file_system_test_util.h |
index 572cc325390fc79e317cc53525024495a0b43dee..85d8273882facc93ca99de1c13a75e2013f3038c 100644 |
--- a/chrome/browser/sync_file_system/sync_file_system_test_util.h |
+++ b/chrome/browser/sync_file_system/sync_file_system_test_util.h |
@@ -27,6 +27,18 @@ void ReceiveResult2(bool* done, |
*arg2_out = base::internal::CallbackForward(arg2); |
} |
+template <typename Arg1, typename Arg2> |
+void ReceiveResultConst2(bool* done, |
tzik
2013/11/22 04:48:16
This looks not clean to me...
And to make this cle
|
+ Arg1* arg1_out, |
+ Arg2* arg2_out, |
+ Arg1 arg1, |
+ const Arg2& arg2) { |
+ EXPECT_FALSE(*done); |
+ *done = true; |
+ *arg1_out = base::internal::CallbackForward(arg1); |
+ *arg2_out = base::internal::CallbackForward(arg2); |
+} |
+ |
template <typename R> |
void AssignAndQuit(base::RunLoop* run_loop, R* result_out, R result); |
@@ -44,6 +56,14 @@ base::Callback<void(Arg1, Arg2)> CreateResultReceiver(Arg1* arg1_out, |
arg1_out, arg2_out); |
} |
kinuko
2013/11/22 04:52:41
Is it reasonable to specify we always use const &
|
+template <typename Arg1, typename Arg2> |
+base::Callback<void(Arg1, const Arg2&)> CreateResultReceiverConst( |
+ Arg1* arg1_out, Arg2* arg2_out) { |
+ return base::Bind(&ReceiveResultConst2<Arg1, Arg2>, |
+ base::Owned(new bool(false)), |
+ arg1_out, arg2_out); |
+} |
+ |
} // namespace sync_file_system |
#endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_TEST_UTIL_H_ |