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

Unified Diff: ui/accessibility/platform/ax_platform_node.h

Issue 1762143002: Use unique IDs for accessibility nodes on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix null obj deref in DCHECK Created 4 years, 9 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
Index: ui/accessibility/platform/ax_platform_node.h
diff --git a/ui/accessibility/platform/ax_platform_node.h b/ui/accessibility/platform/ax_platform_node.h
index 1d0ed510b38d090eca1b532343d63f291430df6e..c9df25947dd6fc82b29760ed37cb0a91131dacaf 100644
--- a/ui/accessibility/platform/ax_platform_node.h
+++ b/ui/accessibility/platform/ax_platform_node.h
@@ -46,9 +46,17 @@ class AX_EXPORT AXPlatformNode {
static AXPlatformNode* FromNativeViewAccessible(
gfx::NativeViewAccessible accessible);
+ // Each platform accessibility object has a unique id that's guaranteed
+ // to be a positive number. (It's stored in an int32_t as opposed to
+ // uint32_t because some platforms want to negate it, so we want to ensure
+ // the range is below the signed int max.) This can be used when the
+ // id has to be unique across multiple frames, since node ids are
+ // only unique within one tree.
+ static int32_t GetNextUniqueId();
+
// Call Destroy rather than deleting this, because the subclass may
// use reference counting.
- virtual void Destroy() = 0;
+ virtual void Destroy();
// Get the platform-specific accessible object type for this instance.
// On some platforms this is just a type cast, on others it may be a
@@ -65,6 +73,10 @@ class AX_EXPORT AXPlatformNode {
protected:
AXPlatformNode();
virtual ~AXPlatformNode();
+
+ AXPlatformNode* GetFromUniqueId(int32_t unique_id);
+
+ int32_t unique_id_;
};
} // namespace ui
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac.mm ('k') | ui/accessibility/platform/ax_platform_node.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698