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

Unified Diff: base/observer_list_threadsafe.h

Issue 9028009: base::Bind: Remove callback_old.h. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Actually remove callback_old.h Created 8 years, 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/callback_unittest.cc ('k') | chrome/browser/browsing_data_quota_helper_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/observer_list_threadsafe.h
diff --git a/base/observer_list_threadsafe.h b/base/observer_list_threadsafe.h
index 7a1d81bf050ac2bb95506ee67182791cafb31636..9acb82ac7fb83c1fdbbddd2f70b9fc2b96ea04db 100644
--- a/base/observer_list_threadsafe.h
+++ b/base/observer_list_threadsafe.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -11,7 +11,6 @@
#include "base/basictypes.h"
#include "base/bind.h"
-#include "base/callback_old.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
@@ -58,6 +57,24 @@
template <class ObserverType>
class ObserverListThreadSafe;
+// An UnboundMethod is a wrapper for a method where the actual object is
+// provided at Run dispatch time.
+template <class T, class Method, class Params>
+class UnboundMethod {
+ public:
+ UnboundMethod(Method m, const Params& p) : m_(m), p_(p) {
+ COMPILE_ASSERT(
+ (base::internal::ParamsUseScopedRefptrCorrectly<Params>::value),
+ badunboundmethodparams);
+ }
+ void Run(T* obj) const {
+ DispatchToMethod(obj, m_, p_);
+ }
+ private:
+ Method m_;
+ Params p_;
+};
+
// This class is used to work around VS2005 not accepting:
//
// friend class
« no previous file with comments | « base/callback_unittest.cc ('k') | chrome/browser/browsing_data_quota_helper_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698