OLD | NEW |
(Empty) | |
| 1 $$ This is a pump file for generating file templates. Pump is a python |
| 2 $$ script that is part of the Google Test suite of utilities. Description |
| 3 $$ can be found here: |
| 4 $$ |
| 5 $$ http://code.google.com/p/googletest/wiki/PumpManual |
| 6 $$ |
| 7 $$ See comment for MAX_ARITY in base/bind.h.pump. |
| 8 $var MAX_ARITY = 7 |
| 9 |
| 10 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 11 // Use of this source code is governed by a BSD-style license that can be |
| 12 // found in the LICENSE file. |
| 13 |
| 14 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_CALLBACK_TRACKER_INTERNAL_
H_ |
| 15 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_CALLBACK_TRACKER_INTERNAL_
H_ |
| 16 |
| 17 #include "base/callback_internal.h" |
| 18 #include "base/memory/scoped_ptr.h" |
| 19 #include "base/memory/weak_ptr.h" |
| 20 #include "chrome/browser/sync_file_system/drive_backend/callback_tracker.h" |
| 21 |
| 22 namespace sync_file_system { |
| 23 namespace drive_backend { |
| 24 namespace internal { |
| 25 |
| 26 class AbortHelper; |
| 27 |
| 28 template <typename> |
| 29 struct InvokeAndInvalidateHelper; |
| 30 |
| 31 $range ARITY 0..MAX_ARITY |
| 32 $for ARITY [[ |
| 33 $range ARG 1..ARITY |
| 34 |
| 35 template <$for ARG , [[typename A$(ARG)]]> |
| 36 struct InvokeAndInvalidateHelper<void($for ARG , [[A$(ARG)]])> { |
| 37 static void Run(const base::WeakPtr<AbortHelper>& abort_helper, |
| 38 const base::Callback<void($for ARG , [[A$(ARG)]])>& callback |
| 39 $if ARITY != 0 [[, ]] |
| 40 $for ARG , [[A$(ARG) a$(ARG)]] |
| 41 ) { |
| 42 scoped_ptr<AbortHelper> deleter = AbortHelper::TakeOwnership(abort_helper); |
| 43 if (deleter) { |
| 44 callback.Run( |
| 45 $for ARG , [[base::internal::CallbackForward(a$(ARG))]]); |
| 46 } |
| 47 } |
| 48 }; |
| 49 |
| 50 ]] $$ for ARITY |
| 51 |
| 52 } // namespace internal |
| 53 } // namespace drive_backend |
| 54 } // namespace sync_file_system |
| 55 |
| 56 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_CALLBACK_TRACKER_INTERN
AL_H_ |
OLD | NEW |