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

Side by Side Diff: base/task.h

Issue 7672009: Lazy creating of background pages --enable-lazy-background-pages) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix broken test Created 9 years, 4 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
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 BASE_TASK_H_ 5 #ifndef BASE_TASK_H_
6 #define BASE_TASK_H_ 6 #define BASE_TASK_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/base_export.h" 9 #include "base/base_export.h"
10 #include "base/debug/alias.h" 10 #include "base/debug/alias.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 inline CancelableTask* NewRunnableMethod(Method method, 133 inline CancelableTask* NewRunnableMethod(Method method,
134 const A& a, 134 const A& a,
135 const B& b, 135 const B& b,
136 const C& c, 136 const C& c,
137 const D& d, 137 const D& d,
138 const E& e) { 138 const E& e) {
139 return new RunnableMethod<Method, Tuple5<A, B, C, D, E> >( 139 return new RunnableMethod<Method, Tuple5<A, B, C, D, E> >(
140 weak_factory_.GetWeakPtr(), method, MakeTuple(a, b, c, d, e)); 140 weak_factory_.GetWeakPtr(), method, MakeTuple(a, b, c, d, e));
141 } 141 }
142 142
143 template <class Method, class A, class B, class C, class D, class E,
144 class F, class G>
145 inline CancelableTask* NewRunnableMethod(Method method,
146 const A& a,
147 const B& b,
148 const C& c,
149 const D& d,
150 const E& e,
151 const F& f,
152 const G& g) {
153 return new RunnableMethod<Method, Tuple7<A, B, C, D, E, F, G> >(
154 weak_factory_.GetWeakPtr(), method, MakeTuple(a, b, c, d, e, f, g));
155 }
156
143 void RevokeAll() { weak_factory_.InvalidateWeakPtrs(); } 157 void RevokeAll() { weak_factory_.InvalidateWeakPtrs(); }
144 158
145 bool empty() const { return !weak_factory_.HasWeakPtrs(); } 159 bool empty() const { return !weak_factory_.HasWeakPtrs(); }
146 160
147 protected: 161 protected:
148 template <class Method, class Params> 162 template <class Method, class Params>
149 class RunnableMethod : public CancelableTask { 163 class RunnableMethod : public CancelableTask {
150 public: 164 public:
151 RunnableMethod(const base::WeakPtr<T>& obj, 165 RunnableMethod(const base::WeakPtr<T>& obj,
152 Method meth, 166 Method meth,
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 Task* task_; 615 Task* task_;
602 bool* should_leak_task_; 616 bool* should_leak_task_;
603 static bool kTaskLeakingDefault; 617 static bool kTaskLeakingDefault;
604 }; 618 };
605 619
606 } // namespace subtle 620 } // namespace subtle
607 621
608 } // namespace base 622 } // namespace base
609 623
610 #endif // BASE_TASK_H_ 624 #endif // BASE_TASK_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/app/generated_resources.grd » ('j') | chrome/browser/extensions/extension_event_router.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698