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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura_unittest.cc

Issue 101013002: Make sure WindowObservers are removed from window before destruction (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cc Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/memory/shared_memory.h" 8 #include "base/memory/shared_memory.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 window_->RemoveObserver(this); 94 window_->RemoveObserver(this);
95 } 95 }
96 96
97 bool destroyed() const { return destroyed_; } 97 bool destroyed() const { return destroyed_; }
98 98
99 // aura::WindowObserver overrides: 99 // aura::WindowObserver overrides:
100 virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE { 100 virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE {
101 CHECK_EQ(window, window_); 101 CHECK_EQ(window, window_);
102 destroyed_ = true; 102 destroyed_ = true;
103 window_ = NULL; 103 window_ = NULL;
104 aura::WindowObserver::OnWindowDestroyed(window);
104 } 105 }
105 106
106 private: 107 private:
107 // Window that we're observing, or NULL if it's been destroyed. 108 // Window that we're observing, or NULL if it's been destroyed.
108 aura::Window* window_; 109 aura::Window* window_;
109 110
110 // Was |window_| destroyed? 111 // Was |window_| destroyed?
111 bool destroyed_; 112 bool destroyed_;
112 113
113 DISALLOW_COPY_AND_ASSIGN(TestWindowObserver); 114 DISALLOW_COPY_AND_ASSIGN(TestWindowObserver);
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after
1074 views[0]->WasHidden(); 1075 views[0]->WasHidden();
1075 EXPECT_FALSE(views[0]->frame_provider_); 1076 EXPECT_FALSE(views[0]->frame_provider_);
1076 1077
1077 for (size_t i = 0; i < renderer_count; ++i) { 1078 for (size_t i = 0; i < renderer_count; ++i) {
1078 views[i]->Destroy(); 1079 views[i]->Destroy();
1079 delete hosts[i]; 1080 delete hosts[i];
1080 } 1081 }
1081 } 1082 }
1082 1083
1083 } // namespace content 1084 } // namespace content
OLDNEW
« no previous file with comments | « ash/wm/window_state.cc ('k') | ui/aura/aura.gyp » ('j') | ui/aura/window_observer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698