| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // ============================================================================ | |
| 6 // **************************************************************************** | |
| 7 // * THIS HEADER IS DEPRECATED, SEE base/callback.h FOR NEW IMPLEMENTATION * | |
| 8 // **************************************************************************** | |
| 9 // ============================================================================ | |
| 10 // ============================================================================ | |
| 11 // **************************************************************************** | |
| 12 // * THIS HEADER IS DEPRECATED, SEE base/callback.h FOR NEW IMPLEMENTATION * | |
| 13 // **************************************************************************** | |
| 14 // ============================================================================ | |
| 15 // ============================================================================ | |
| 16 // **************************************************************************** | |
| 17 // * THIS HEADER IS DEPRECATED, SEE base/callback.h FOR NEW IMPLEMENTATION * | |
| 18 // **************************************************************************** | |
| 19 // ============================================================================ | |
| 20 // ============================================================================ | |
| 21 // **************************************************************************** | |
| 22 // * THIS HEADER IS DEPRECATED, SEE base/callback.h FOR NEW IMPLEMENTATION * | |
| 23 // **************************************************************************** | |
| 24 // ============================================================================ | |
| 25 // ============================================================================ | |
| 26 // **************************************************************************** | |
| 27 // * THIS HEADER IS DEPRECATED, SEE base/callback.h FOR NEW IMPLEMENTATION * | |
| 28 // **************************************************************************** | |
| 29 // ============================================================================ | |
| 30 #ifndef BASE_TASK_H_ | |
| 31 #define BASE_TASK_H_ | |
| 32 #pragma once | |
| 33 | |
| 34 #include "base/base_export.h" | |
| 35 #include "base/callback.h" | |
| 36 #include "base/debug/alias.h" | |
| 37 #include "base/memory/raw_scoped_refptr_mismatch_checker.h" | |
| 38 #include "base/memory/weak_ptr.h" | |
| 39 #include "base/tuple.h" | |
| 40 | |
| 41 namespace base { | |
| 42 const size_t kDeadTask = 0xDEAD7A53; | |
| 43 } | |
| 44 | |
| 45 template<typename T> | |
| 46 void DeletePointer(T* obj) { | |
| 47 delete obj; | |
| 48 } | |
| 49 | |
| 50 namespace base { | |
| 51 | |
| 52 // ScopedClosureRunner is akin to scoped_ptr for Closures. It ensures that the | |
| 53 // Closure is executed and deleted no matter how the current scope exits. | |
| 54 class BASE_EXPORT ScopedClosureRunner { | |
| 55 public: | |
| 56 explicit ScopedClosureRunner(const Closure& closure); | |
| 57 ~ScopedClosureRunner(); | |
| 58 | |
| 59 Closure Release(); | |
| 60 | |
| 61 private: | |
| 62 Closure closure_; | |
| 63 | |
| 64 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedClosureRunner); | |
| 65 }; | |
| 66 | |
| 67 } // namespace base | |
| 68 | |
| 69 #endif // BASE_TASK_H_ | |
| OLD | NEW |