| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // This is a "No Compile Test" suite. | 5 // This is a "No Compile Test" suite. |
| 6 // http://dev.chromium.org/developers/testing/no-compile-tests | 6 // http://dev.chromium.org/developers/testing/no-compile-tests |
| 7 | 7 |
| 8 #include "base/callback_list.h" | 8 #include "base/callback_list.h" |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
| 13 #include "base/macros.h" |
| 13 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 14 | 15 |
| 15 namespace base { | 16 namespace base { |
| 16 | 17 |
| 17 class Foo { | 18 class Foo { |
| 18 public: | 19 public: |
| 19 Foo() {} | 20 Foo() {} |
| 20 ~Foo() {} | 21 ~Foo() {} |
| 21 }; | 22 }; |
| 22 | 23 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 45 FooListener f; | 46 FooListener f; |
| 46 CallbackList<void(scoped_ptr<Foo>)> c1; | 47 CallbackList<void(scoped_ptr<Foo>)> c1; |
| 47 scoped_ptr<CallbackList<void(scoped_ptr<Foo>)>::Subscription> sub = | 48 scoped_ptr<CallbackList<void(scoped_ptr<Foo>)>::Subscription> sub = |
| 48 c1.Add(Bind(&FooListener::GotAScopedFoo, Unretained(&f))); | 49 c1.Add(Bind(&FooListener::GotAScopedFoo, Unretained(&f))); |
| 49 c1.Notify(scoped_ptr<Foo>(new Foo())); | 50 c1.Notify(scoped_ptr<Foo>(new Foo())); |
| 50 } | 51 } |
| 51 | 52 |
| 52 #endif | 53 #endif |
| 53 | 54 |
| 54 } // namespace base | 55 } // namespace base |
| OLD | NEW |