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

Unified Diff: base/callback.h

Issue 6542026: Callback: De-inline CallbackBase, and move to callback_helpers -> callback_internal.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/base
Patch Set: add in the destrcutor actually Created 9 years, 10 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/bind_internal.h.pump ('k') | base/callback.h.pump » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/callback.h
diff --git a/base/callback.h b/base/callback.h
index 9e43afbef2a076159ba3f99db3261ef062b07b8c..9c76aa5246586344a2c4f2febd40fda79f623bb8 100644
--- a/base/callback.h
+++ b/base/callback.h
@@ -11,7 +11,7 @@
#define BASE_CALLBACK_H_
#pragma once
-#include "base/callback_helpers.h"
+#include "base/callback_internal.h"
#include "base/callback_old.h"
// New, super-duper, unified Callback system. This will eventually replace
@@ -212,49 +212,6 @@
namespace base {
-namespace internal {
-
-// Holds the methods that don't require specialization to reduce template bloat.
-class CallbackBase {
- public:
- // Returns true if Callback is null (doesn't refer to anything).
- bool is_null() const {
- return invoker_storage_.get() == NULL;
- }
-
- // Returns the Callback into an uninitalized state.
- void Reset() {
- invoker_storage_ = NULL;
- polymorphic_invoke_ = NULL;
- }
-
- bool Equals(const CallbackBase& other) const {
- return invoker_storage_.get() == other.invoker_storage_.get() &&
- polymorphic_invoke_ == other.polymorphic_invoke_;
- }
-
- protected:
- // In C++, it is safe to cast function pointers to function pointers of
- // another type. It is not okay to use void*. We create a InvokeFuncStorage
- // that that can store our function pointer, and then cast it back to
- // the original type on usage.
- typedef void(*InvokeFuncStorage)(void);
-
- CallbackBase(InvokeFuncStorage polymorphic_invoke,
- scoped_refptr<InvokerStorageBase>* invoker_storage)
- : polymorphic_invoke_(polymorphic_invoke) {
- if (invoker_storage) {
- invoker_storage_.swap(*invoker_storage);
- }
- }
-
- scoped_refptr<InvokerStorageBase> invoker_storage_;
- InvokeFuncStorage polymorphic_invoke_;
-};
-
-} // namespace internal
-
-
// First, we forward declare the Callback class template. This informs the
// compiler that the template only has 1 type parameter which is the function
// signature that the Callback is representing.
« no previous file with comments | « base/bind_internal.h.pump ('k') | base/callback.h.pump » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698