Skip to content

Commit 8373219

Browse files
committed
fork additional raw chromium a11y code
1 parent 3a58179 commit 8373219

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+11198
-2
lines changed

ci/licenses.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ function verify_licenses() (
122122

123123
local actualLicenseCount
124124
actualLicenseCount="$(tail -n 1 flutter/ci/licenses_golden/licenses_flutter | tr -dc '0-9')"
125-
local expectedLicenseCount=15 # When changing this number: Update the error message below as well describing all expected license types.
125+
local expectedLicenseCount=17 # When changing this number: Update the error message below as well describing all expected license types.
126126

127127
if [[ $actualLicenseCount -ne $expectedLicenseCount ]]; then
128128
echo "=============================== ERROR ==============================="

ci/licenses_golden/licenses_flutter

Lines changed: 124 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ FILE: ../../../flutter/third_party/accessibility/ax/platform/ax_platform_node_ma
2222
FILE: ../../../flutter/third_party/accessibility/ax/platform/ax_platform_node_mac.mm
2323
FILE: ../../../flutter/third_party/accessibility/ax/tree_generator.cc
2424
FILE: ../../../flutter/third_party/accessibility/ax/tree_generator.h
25+
FILE: ../../../flutter/third_party/accessibility/base/numerics/safe_conversions.h
26+
FILE: ../../../flutter/third_party/accessibility/base/numerics/safe_conversions_impl.h
27+
FILE: ../../../flutter/third_party/accessibility/gfx/mac/coordinate_conversion.h
28+
FILE: ../../../flutter/third_party/accessibility/gfx/mac/coordinate_conversion.mm
2529
----------------------------------------------------------------------------------------------------
2630
Copyright 2014 The Chromium Authors. All rights reserved.
2731

@@ -152,6 +156,17 @@ FILE: ../../../flutter/third_party/accessibility/ax/platform/ax_system_caret_win
152156
FILE: ../../../flutter/third_party/accessibility/ax/platform/ax_system_caret_win.h
153157
FILE: ../../../flutter/third_party/accessibility/ax/platform/ax_unique_id.cc
154158
FILE: ../../../flutter/third_party/accessibility/ax/platform/ax_unique_id.h
159+
FILE: ../../../flutter/third_party/accessibility/base/numerics/checked_math.h
160+
FILE: ../../../flutter/third_party/accessibility/base/numerics/checked_math_impl.h
161+
FILE: ../../../flutter/third_party/accessibility/base/numerics/clamped_math.h
162+
FILE: ../../../flutter/third_party/accessibility/base/numerics/clamped_math_impl.h
163+
FILE: ../../../flutter/third_party/accessibility/base/numerics/math_constants.h
164+
FILE: ../../../flutter/third_party/accessibility/base/numerics/ranges.h
165+
FILE: ../../../flutter/third_party/accessibility/base/numerics/safe_conversions_arm_impl.h
166+
FILE: ../../../flutter/third_party/accessibility/base/numerics/safe_math.h
167+
FILE: ../../../flutter/third_party/accessibility/base/numerics/safe_math_arm_impl.h
168+
FILE: ../../../flutter/third_party/accessibility/base/numerics/safe_math_clang_gcc_impl.h
169+
FILE: ../../../flutter/third_party/accessibility/base/numerics/safe_math_shared_impl.h
155170
----------------------------------------------------------------------------------------------------
156171
Copyright 2017 The Chromium Authors. All rights reserved.
157172

@@ -283,6 +298,7 @@ LIBRARY: accessibility
283298
ORIGIN: ../../../flutter/third_party/accessibility/ax/ax_text_utils.cc + ../../../LICENSE
284299
TYPE: LicenseType.bsd
285300
FILE: ../../../flutter/third_party/accessibility/ax/ax_text_utils.cc
301+
FILE: ../../../flutter/third_party/accessibility/base/auto_reset.h
286302
----------------------------------------------------------------------------------------------------
287303
Copyright (c) 2011 The Chromium Authors. All rights reserved.
288304

@@ -319,6 +335,40 @@ ORIGIN: ../../../flutter/third_party/accessibility/ax/ax_text_utils.h + ../../..
319335
TYPE: LicenseType.bsd
320336
FILE: ../../../flutter/third_party/accessibility/ax/ax_text_utils.h
321337
FILE: ../../../flutter/third_party/accessibility/ax_build/build_config.h
338+
FILE: ../../../flutter/third_party/accessibility/base/compiler_specific.h
339+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/insets.h
340+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/insets_f.cc
341+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/insets_f.h
342+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/point.cc
343+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/point.h
344+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/point_conversions.cc
345+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/point_conversions.h
346+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/point_f.cc
347+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/point_f.h
348+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/point_unittest.cc
349+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/rect.cc
350+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/rect.h
351+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/rect_conversions.cc
352+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/rect_conversions.h
353+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/rect_f.cc
354+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/rect_f.h
355+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/size.cc
356+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/size.h
357+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/size_conversions.cc
358+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/size_conversions.h
359+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/size_f.cc
360+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/size_f.h
361+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/size_unittest.cc
362+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/vector2d.cc
363+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/vector2d.h
364+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/vector2d_conversions.cc
365+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/vector2d_conversions.h
366+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/vector2d_f.cc
367+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/vector2d_f.h
368+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/vector2d_unittest.cc
369+
FILE: ../../../flutter/third_party/accessibility/gfx/native_widget_types.h
370+
FILE: ../../../flutter/third_party/accessibility/gfx/transform.cc
371+
FILE: ../../../flutter/third_party/accessibility/gfx/transform.h
322372
----------------------------------------------------------------------------------------------------
323373
Copyright (c) 2012 The Chromium Authors. All rights reserved.
324374

@@ -411,6 +461,7 @@ FILE: ../../../flutter/third_party/accessibility/ax/platform/ax_platform_node_te
411461
FILE: ../../../flutter/third_party/accessibility/ax/platform/compute_attributes.cc
412462
FILE: ../../../flutter/third_party/accessibility/ax/platform/compute_attributes.h
413463
FILE: ../../../flutter/third_party/accessibility/ax/run_all_unittests.cc
464+
FILE: ../../../flutter/third_party/accessibility/base/no_destructor.h
414465
----------------------------------------------------------------------------------------------------
415466
Copyright 2018 The Chromium Authors. All rights reserved.
416467

@@ -606,6 +657,78 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
606657
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
607658
====================================================================================================
608659

660+
====================================================================================================
661+
LIBRARY: accessibility
662+
ORIGIN: ../../../flutter/third_party/accessibility/gfx/geometry/insets.cc + ../../../LICENSE
663+
TYPE: LicenseType.bsd
664+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/insets.cc
665+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/insets_unittest.cc
666+
----------------------------------------------------------------------------------------------------
667+
Copyright (c) 2009 The Chromium Authors. All rights reserved.
668+
669+
Redistribution and use in source and binary forms, with or without
670+
modification, are permitted provided that the following conditions are
671+
met:
672+
673+
* Redistributions of source code must retain the above copyright
674+
notice, this list of conditions and the following disclaimer.
675+
* Redistributions in binary form must reproduce the above
676+
copyright notice, this list of conditions and the following disclaimer
677+
in the documentation and/or other materials provided with the
678+
distribution.
679+
* Neither the name of Google Inc. nor the names of its
680+
contributors may be used to endorse or promote products derived from
681+
this software without specific prior written permission.
682+
683+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
684+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
685+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
686+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
687+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
688+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
689+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
690+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
691+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
692+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
693+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
694+
====================================================================================================
695+
696+
====================================================================================================
697+
LIBRARY: accessibility
698+
ORIGIN: ../../../flutter/third_party/accessibility/gfx/geometry/rect_unittest.cc + ../../../LICENSE
699+
TYPE: LicenseType.bsd
700+
FILE: ../../../flutter/third_party/accessibility/gfx/geometry/rect_unittest.cc
701+
FILE: ../../../flutter/third_party/accessibility/gfx/gfx_export.h
702+
----------------------------------------------------------------------------------------------------
703+
Copyright (c) 2013 The Chromium Authors. All rights reserved.
704+
705+
Redistribution and use in source and binary forms, with or without
706+
modification, are permitted provided that the following conditions are
707+
met:
708+
709+
* Redistributions of source code must retain the above copyright
710+
notice, this list of conditions and the following disclaimer.
711+
* Redistributions in binary form must reproduce the above
712+
copyright notice, this list of conditions and the following disclaimer
713+
in the documentation and/or other materials provided with the
714+
distribution.
715+
* Neither the name of Google Inc. nor the names of its
716+
contributors may be used to endorse or promote products derived from
717+
this software without specific prior written permission.
718+
719+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
720+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
721+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
722+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
723+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
724+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
725+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
726+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
727+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
728+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
729+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
730+
====================================================================================================
731+
609732
====================================================================================================
610733
LIBRARY: accessibility
611734
ORIGIN: ../../../third_party/icu/scripts/LICENSE
@@ -2549,4 +2672,4 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25492672
See the License for the specific language governing permissions and
25502673
limitations under the License.
25512674
====================================================================================================
2552-
Total license count: 15
2675+
Total license count: 17
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// Copyright (c) 2011 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 BASE_AUTO_RESET_H_
6+
#define BASE_AUTO_RESET_H_
7+
8+
#include <utility>
9+
10+
// base::AutoReset<> is useful for setting a variable to a new value only within
11+
// a particular scope. An base::AutoReset<> object resets a variable to its
12+
// original value upon destruction, making it an alternative to writing
13+
// "var = false;" or "var = old_val;" at all of a block's exit points.
14+
//
15+
// This should be obvious, but note that an base::AutoReset<> instance should
16+
// have a shorter lifetime than its scoped_variable, to prevent invalid memory
17+
// writes when the base::AutoReset<> object is destroyed.
18+
19+
namespace base {
20+
21+
template <typename T>
22+
class AutoReset {
23+
public:
24+
template <typename U>
25+
AutoReset(T* scoped_variable, U&& new_value)
26+
: scoped_variable_(scoped_variable),
27+
original_value_(
28+
std::exchange(*scoped_variable_, std::forward<U>(new_value))) {}
29+
30+
AutoReset(AutoReset&& other)
31+
: scoped_variable_(std::exchange(other.scoped_variable_, nullptr)),
32+
original_value_(std::move(other.original_value_)) {}
33+
34+
AutoReset& operator=(AutoReset&& rhs) {
35+
scoped_variable_ = std::exchange(rhs.scoped_variable_, nullptr);
36+
original_value_ = std::move(rhs.original_value_);
37+
return *this;
38+
}
39+
40+
~AutoReset() {
41+
if (scoped_variable_)
42+
*scoped_variable_ = std::move(original_value_);
43+
}
44+
45+
private:
46+
T* scoped_variable_;
47+
T original_value_;
48+
};
49+
50+
} // namespace base
51+
52+
#endif // BASE_AUTO_RESET_H_

0 commit comments

Comments
 (0)