summaryrefslogtreecommitdiffstats
path: root/base/callback.h.pump
diff options
context:
space:
mode:
authorajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-18 23:29:31 +0000
committerajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-18 23:29:31 +0000
commit59eff91b6b042f8389c4af756968a93407bf7c24 (patch)
treeccfcfb02ef774ffd178d948275dd8e4f07f30bf7 /base/callback.h.pump
parentc1640b0e400cca2f6d6d223703dcafe46a48a7af (diff)
downloadchromium_src-59eff91b6b042f8389c4af756968a93407bf7c24.zip
chromium_src-59eff91b6b042f8389c4af756968a93407bf7c24.tar.gz
chromium_src-59eff91b6b042f8389c4af756968a93407bf7c24.tar.bz2
Callback: De-inline CallbackBase, and move to callback_helpers -> callback_internal.h
We can re-inline later if it starts being an issue. BUG=none TEST=unit-tests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=75443 Review URL: http://codereview.chromium.org/6542026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75464 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/callback.h.pump')
-rw-r--r--base/callback.h.pump45
1 files changed, 1 insertions, 44 deletions
diff --git a/base/callback.h.pump b/base/callback.h.pump
index 19b7987..2efe0c5 100644
--- a/base/callback.h.pump
+++ b/base/callback.h.pump
@@ -15,7 +15,7 @@ $var MAX_ARITY = 6
#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
@@ -216,49 +216,6 @@ $var MAX_ARITY = 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.