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

Side by Side Diff: ui/accessibility/platform/ax_platform_node_base.cc

Issue 1987213002: Clean up code and logic related to platform accessibility node destruction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/accessibility/platform/ax_platform_node_base.h" 5 #include "ui/accessibility/platform/ax_platform_node_base.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "ui/accessibility/ax_node_data.h" 8 #include "ui/accessibility/ax_node_data.h"
9 #include "ui/accessibility/platform/ax_platform_node_delegate.h" 9 #include "ui/accessibility/platform/ax_platform_node_delegate.h"
10 10
(...skipping 28 matching lines...) Expand all
39 gfx::NativeViewAccessible AXPlatformNodeBase::ChildAtIndex(int index) { 39 gfx::NativeViewAccessible AXPlatformNodeBase::ChildAtIndex(int index) {
40 CHECK(delegate_); 40 CHECK(delegate_);
41 return delegate_->ChildAtIndex(index); 41 return delegate_->ChildAtIndex(index);
42 } 42 }
43 43
44 // AXPlatformNode overrides. 44 // AXPlatformNode overrides.
45 45
46 void AXPlatformNodeBase::Destroy() { 46 void AXPlatformNodeBase::Destroy() {
47 AXPlatformNode::Destroy(); 47 AXPlatformNode::Destroy();
48 delegate_ = nullptr; 48 delegate_ = nullptr;
49 Dispose();
50 }
51
52 void AXPlatformNodeBase::Dispose() {
49 delete this; 53 delete this;
50 } 54 }
51 55
52 gfx::NativeViewAccessible AXPlatformNodeBase::GetNativeViewAccessible() { 56 gfx::NativeViewAccessible AXPlatformNodeBase::GetNativeViewAccessible() {
53 return nullptr; 57 return nullptr;
54 } 58 }
55 59
56 AXPlatformNodeDelegate* AXPlatformNodeBase::GetDelegate() const { 60 AXPlatformNodeDelegate* AXPlatformNodeBase::GetDelegate() const {
57 return delegate_; 61 return delegate_;
58 } 62 }
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 ui::AXStringAttribute attribute, 186 ui::AXStringAttribute attribute,
183 base::string16* value) const { 187 base::string16* value) const {
184 CHECK(delegate_); 188 CHECK(delegate_);
185 return GetData().GetString16Attribute(attribute, value); 189 return GetData().GetString16Attribute(attribute, value);
186 } 190 }
187 191
188 AXPlatformNodeBase::AXPlatformNodeBase() { 192 AXPlatformNodeBase::AXPlatformNodeBase() {
189 } 193 }
190 194
191 AXPlatformNodeBase::~AXPlatformNodeBase() { 195 AXPlatformNodeBase::~AXPlatformNodeBase() {
196 CHECK(!delegate_);
192 } 197 }
193 198
194 // static 199 // static
195 AXPlatformNodeBase* AXPlatformNodeBase::FromNativeViewAccessible( 200 AXPlatformNodeBase* AXPlatformNodeBase::FromNativeViewAccessible(
196 gfx::NativeViewAccessible accessible) { 201 gfx::NativeViewAccessible accessible) {
197 return static_cast<AXPlatformNodeBase*>( 202 return static_cast<AXPlatformNodeBase*>(
198 AXPlatformNode::FromNativeViewAccessible(accessible)); 203 AXPlatformNode::FromNativeViewAccessible(accessible));
199 } 204 }
200 205
201 } // namespace ui 206 } // namespace ui
OLDNEW
« no previous file with comments | « ui/accessibility/platform/ax_platform_node_base.h ('k') | ui/accessibility/platform/ax_platform_node_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698