| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "base/observer_list.h" | 5 #include "base/observer_list.h" |
| 6 #include "base/observer_list_threadsafe.h" | 6 #include "base/observer_list_threadsafe.h" |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/location.h" | 11 #include "base/location.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
| 14 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
| 15 #include "base/threading/platform_thread.h" | 15 #include "base/threading/platform_thread.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/googletest/include/gtest/gtest.h" |
| 17 | 17 |
| 18 namespace base { | 18 namespace base { |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 class Foo { | 21 class Foo { |
| 22 public: | 22 public: |
| 23 virtual void Observe(int x) = 0; | 23 virtual void Observe(int x) = 0; |
| 24 virtual ~Foo() {} | 24 virtual ~Foo() {} |
| 25 }; | 25 }; |
| 26 | 26 |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 ListDestructor a(observer_list); | 536 ListDestructor a(observer_list); |
| 537 observer_list->AddObserver(&a); | 537 observer_list->AddObserver(&a); |
| 538 | 538 |
| 539 FOR_EACH_OBSERVER(Foo, *observer_list, Observe(0)); | 539 FOR_EACH_OBSERVER(Foo, *observer_list, Observe(0)); |
| 540 // If this test fails, there'll be Valgrind errors when this function goes out | 540 // If this test fails, there'll be Valgrind errors when this function goes out |
| 541 // of scope. | 541 // of scope. |
| 542 } | 542 } |
| 543 | 543 |
| 544 } // namespace | 544 } // namespace |
| 545 } // namespace base | 545 } // namespace base |
| OLD | NEW |