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

Unified Diff: base/observer_list_unittest.cc

Issue 7134008: Revert 88151 (see crbug.com/85296) - Fix user-after-free error with ObserverList. The problem is... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 6 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/observer_list.h ('k') | content/browser/renderer_host/render_view_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/observer_list_unittest.cc
===================================================================
--- base/observer_list_unittest.cc (revision 88283)
+++ base/observer_list_unittest.cc (working copy)
@@ -422,27 +422,4 @@
<< "Adder should not observe, so sum should still be 0.";
}
-class ListDestructor : public Foo {
- public:
- explicit ListDestructor(ObserverList<Foo>* list) : list_(list) {}
- virtual void Observe(int x) {
- delete list_;
- }
- virtual ~ListDestructor() { }
- int total;
- private:
- ObserverList<Foo>* list_;
-};
-
-
-TEST(ObserverListTest, IteratorOutlivesList) {
- ObserverList<Foo>* observer_list = new ObserverList<Foo>;
- ListDestructor a(observer_list);
- observer_list->AddObserver(&a);
-
- FOR_EACH_OBSERVER(Foo, *observer_list, Observe(0));
- // If this test fails, there'll be Valgrind errors when this function goes out
- // of scope.
-}
-
} // namespace
« no previous file with comments | « base/observer_list.h ('k') | content/browser/renderer_host/render_view_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698