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

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/callback_tracker_internal.h.pump

Issue 310383002: [SyncFS] Introduce CallbackTracker to handle callback abortion (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698