blob: 18d90af6bcbe721a6f208a3785cb75bd3a7c5ae6 [file] [log] [blame]
Abigail Klein508432f2022-12-15 17:23:211// Copyright 2022 The Chromium Authors
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 UI_ACCESSIBILITY_AX_TREE_UPDATE_UTIL_H_
6#define UI_ACCESSIBILITY_AX_TREE_UPDATE_UTIL_H_
7
8#include <vector>
9
10#include "ui/accessibility/ax_export.h"
11#include "ui/accessibility/ax_tree_update_forward.h"
12
13namespace ui {
14
15AX_EXPORT bool AXTreeUpdatesCanBeMerged(const AXTreeUpdate& u1,
16 const AXTreeUpdate& u2);
17
18// If 2 or more tree updates can all be merged into others,
19// process the whole set of tree updates, copying them to |dst|,
20// and returning true. Otherwise, return false and |dst|
21// is left unchanged.
22//
23// Merging tree updates helps minimize the overhead of calling
24// Unserialize multiple times.
Lauren Winston1fef47c2025-04-23 03:12:1425AX_EXPORT bool MergeAXTreeUpdates(std::vector<AXTreeUpdate>& src,
Jacques Newmana4149e852024-08-28 23:35:4226 std::vector<AXTreeUpdate>* dst);
Abigail Klein508432f2022-12-15 17:23:2127
28} // namespace ui
29
30#endif // UI_ACCESSIBILITY_AX_TREE_UPDATE_UTIL_H_