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

Unified Diff: base/bind_unittest.nc

Issue 8483003: Callback API Change: Reimplement Bind(); support IgnoreResult, full currying, and use less types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 9 years, 1 month 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_unittest.cc ('k') | base/callback.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/bind_unittest.nc
diff --git a/base/bind_unittest.nc b/base/bind_unittest.nc
index eba8747bb26b64ef8abf2f03baaec86228acbf64..069092cff199e43d13295d0ac293383d122765c4 100644
--- a/base/bind_unittest.nc
+++ b/base/bind_unittest.nc
@@ -4,6 +4,7 @@
#include "base/callback.h"
#include "base/bind.h"
+#include "base/memory/ref_counted.h"
namespace base {
@@ -21,10 +22,7 @@ class NoRef {
int IntMethod0() { return 1; }
};
-class HasRef : public NoRef {
- public:
- void AddRef(void) const {}
- bool Release(void) const { return true; }
+class HasRef : public NoRef, public base::RefCounted<HasRef> {
};
class Parent {
@@ -175,6 +173,9 @@ void WontCompile() {
// Refcounted types should not be bound as a raw pointer.
void WontCompile() {
HasRef for_raw_ptr;
+ int a;
+ Callback<void(void)> ref_count_as_raw_ptr_a =
+ Bind(&VoidPolymorphic1<int*>, &a);
Callback<void(void)> ref_count_as_raw_ptr =
Bind(&VoidPolymorphic1<HasRef*>, &for_raw_ptr);
}
@@ -190,7 +191,7 @@ void WontCompile() {
weak_ptr_with_non_void_return_type.Run();
}
-#elif defined(NCTEST_DISALLOW_ASSIGN_DIFFERINT_TYPES) // [r"creating array with negative size"]
+#elif defined(NCTEST_DISALLOW_ASSIGN_DIFFERINT_TYPES) // [r"invalid conversion from"]
// Bind result cannot be assigned to Callbacks with a mismatching type.
void WontCompile() {
« no previous file with comments | « base/bind_unittest.cc ('k') | base/callback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698