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

Side by Side Diff: chrome/browser/accessibility/ax_tree_id_registry.h

Issue 667713006: Implement automatic load of composed/embedded automation trees (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Fix UAF Created 6 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/accessibility/ax_tree_id_registry.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_ACCESSIBILITY_AX_TREE_ID_REGISTRY_H_
6 #define CHROME_BROWSER_ACCESSIBILITY_AX_TREE_ID_REGISTRY_H_
7
8 #include <map>
9
10 #include "base/stl_util.h"
11
12 template <typename T>
13 struct DefaultSingletonTraits;
14
15 // A class which generates a unique id given a process id and routing id.
16 // Currently, placeholder implementation pending finalization of out of process
17 // iframes.
18 class AXTreeIDRegistry {
19 public:
20 typedef int AXTreeID;
21 typedef std::pair<int, int> FrameID;
22
23 // Get the single instance of this class.
24 static AXTreeIDRegistry* GetInstance();
25
26 // Obtains a unique id given a |process_id| and |routing_id|. Placeholder
27 // for full implementation once out of process iframe accessibility finalizes.
28 int GetOrCreateAXTreeID(int process_id, int routing_id);
29 FrameID GetFrameID(int ax_tree_id);
30 void RemoveAXTreeID(int ax_tree_id);
31
32 private:
33 friend struct DefaultSingletonTraits<AXTreeIDRegistry>;
34
35 AXTreeIDRegistry();
36 virtual ~AXTreeIDRegistry();
37
38 // Tracks the current unique ax frame id.
39 int ax_tree_id_counter_;
40
41 // Maps an accessibility tree to its frame via ids.
42 std::map<AXTreeID, FrameID> ax_tree_to_frame_id_map_;
43
44 // Maps frames to an accessibility tree via ids.
45 std::map<FrameID, AXTreeID> frame_to_ax_tree_id_map_;
46
47 DISALLOW_COPY_AND_ASSIGN(AXTreeIDRegistry);
48 };
49
50 #endif // CHROME_BROWSER_ACCESSIBILITY_AX_TREE_ID_REGISTRY_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/accessibility/ax_tree_id_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698