This CL removes the usage of deprecated ListValue::AppendString(),
ListValue::AppendInteger() and ListValue::AppendBoolean() API from
tools/json_schema_compiler/.
BUG=1187102, 1187099, 1187100
Change-Id: I2d6abf3742e202c62fa8bded33eb1f0803a00c60
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3026696
Commit-Queue: Maggie Cai <mxcai@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#902293}
Chrome parses the manifest.json with the new key:
chrome_system_extension.
This is part of building Chrome OS System Extension platform on top of
Chrome Browser Extensions.
Changes:
- Introduce code under the new folder
//chrome/common/chromeos/extensions:
- chromeos_system_extensions_manifest_handlers.h/cc: that parses
chromeos_system_extension key).
- chromeos_system_extensions_api_provider.h/cc.
- Introduce the new extensions_type value: chromeos_system_extension in
Feature Compiler (that runs as part of Chrome).
- Introduce the new Manifest::Type::TYPE_CHROMEOS_SYSTEM_EXTENSION in
manifest.h and sets the type in GetTypeFromManifestValue() if
chromeos_system_extension key exists.
- Propagate TYPE_CHROMEOS_SYSTEM_EXTENSION in different places where
needed.
Bug: b:188897824, 1229585
Test: added extension_manifests_chromeos_system_extension_unittest.cc
Change-Id: I4441c7bbe9a920a0dd861ca3638d971432a38779
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2584165
Commit-Queue: Mahmoud Gawad <mgawad@google.com>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Oleh Lamzin <lamzin@google.com>
Reviewed-by: David Roger <droger@chromium.org>
Reviewed-by: Jesse Doherty <jwd@chromium.org>
Reviewed-by: Julian Pastarmov <pastarmovj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#902206}
This change removes the use of Value::GetAs* and replaces with
Value::is_*(), Value::Get*(), Value::GetIf*().
Bug: 1187003, 1187006, 1187007
Change-Id: Idcefdb56d3438c42738e9dbbf046723c38da8e6d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3022522
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Thomas Lukaszewicz <tluk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#900737}
This is a reland of 472bf833d1
Includes fix for fuchsia-x64-dbg in
components/viz/service/surfaces/surface_reference.cc
Original change's description:
> [base] Don't include <ostream> in string_piece.h
>
> It's not needed, and adds ca 200 MB of compiler input to the build.
>
> This also adds an implementation of CHECK_OP's "argument stringification"
> function for std::string values, since those previously relied on
> operator<< for stringification which would now require including
> <ostream> in many new files.
>
> Bug: 242216
> Change-Id: I34807204a82e622e50a5bbcabb7055c0b2f51f21
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3009579
> Commit-Queue: Hans Wennborg <hans@chromium.org>
> Reviewed-by: danakj <danakj@chromium.org>
> Owners-Override: danakj <danakj@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#900025}
Cq-Include-Trybots: luci.chromium.try:fuchsia-compile-x64-dbg
Bug: 242216
Change-Id: Ibdf16a1ec0307bd94aed2bfb327b7c64317e96bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3015330
Auto-Submit: Hans Wennborg <hans@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Owners-Override: danakj <danakj@chromium.org>
Commit-Queue: Hans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#900528}
It's not needed, and adds ca 200 MB of compiler input to the build.
This also adds an implementation of CHECK_OP's "argument stringification"
function for std::string values, since those previously relied on
operator<< for stringification which would now require including
<ostream> in many new files.
Bug: 242216
Change-Id: I34807204a82e622e50a5bbcabb7055c0b2f51f21
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3009579
Commit-Queue: Hans Wennborg <hans@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Owners-Override: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#900025}
In Japanese version Windows, python opens file in cp932 codec as a
default codec.
The idl_schema.py opens a file without specifying the encoding, so
python opened a file as cp932 codec, but it was actually utf-8 encoded.
This is the cause of the build fail.
I fixed the error by specifying 'utf-8' encoding when opening a file.
Bug: 1211760
Change-Id: Ibd3ab33cf3ea04d39f7481a8c39083d0627975ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2962174
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Commit-Queue: Toshiaki Tanaka <zokutyou2@gmail.com>
Cr-Commit-Position: refs/heads/master@{#893309}
This CL is part of a larger effort to deprecate python2 in PRESUBMIT.
json_schema_compiler's PRESUBMIT file will now run unit tests in
python3. In order to do this, every file's #! must specify python3
(in this dir, most were ambiguous and simply said python).
Bug: 1212101
Change-Id: I870ac1cc70325c79bccfd3df3d37432f24b97f54
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2921953
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Ari Chivukula <arichiv@chromium.org>
Cr-Commit-Position: refs/heads/master@{#887392}
- Make the include ordering more like the Chromium style.
- Include STL headers actually in use. Remove <set> which is not.
- Do not generate calls to std::vector::reserve(0).
Change-Id: I255f43b0c146513ebe156ea21293f488094d18a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2911298
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#886066}
Some OWNERS file ends with a newline character, some don't. As
text editor tends to add newline at the end of text files when
saving, normalize all OWNERS files to end with a newline '\n'.
Bug: none
Change-Id: I7eec0eaf1f39ba333767bdcd686a4f499338c568
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2905626
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#884966}
We currently generate code that takes CreateValueFromOptionalArray's
return value and passes it directly to SetWithoutExpansion. This is
(in isolation) probably not great, since storing nullptr in a
DictionaryValue makes it non-serializable (i.e. crashes).
With the new base::Value (Bug 1187001), passing a nullptr-able value to
SetWithoutExpansion has no equivalent, therefore something needs to
change.
We could make CreateValueFromOptionalArray return base::Optional and
adjust call-sites accordingly, however, since it appears that each
of CreateValueFromOptionalArray's call-sites already has an if-guard
which guarantees that it never returns nullptr, I suggest we just
remove it instead.
This is tiny step in the base::Value refactor project (Bug 1187001).
Bug: 1187097
Change-Id: Ie07b033b434a90ed3c3c82e41b39c8d79a370770
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2897045
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Cr-Commit-Position: refs/heads/master@{#883871}
This replaces:
- base::Optional -> absl::optional
- include "base/optional.h"
->
include "third_party/abseil-cpp/absl/types/optional.h"
- base::nullopt -> absl::nullopt
- base::make_optional -> absl::make_optional
This also tries to fix gdb and msvc printers.
Bug: 1202909
Change-Id: I2431990da1671751a5d804be162655f086bde8cd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2896995
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Auto-Submit: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Owners-Override: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#883301}
This change removes the use of Value::GetAsBoolean
and replaces with Value::is_bool(), Value::GetBool(),
Value::GetIfBool().
Bug: 1187003
Change-Id: Ie11137a1fe5d739a3cd932eb9d6213a046282804
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2869287
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Ayu Ishii <ayui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#879054}
This CL changes the JSON schema compiler to emit ListValue::GetList()
in "for" loop iteration instead of relying on ListValue::begin() and
ListValue::end(), which are deprecated.
Bug: 1187107
Change-Id: I9efa51561345ed5be2b7a7270b83b71b3d152386
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2866670
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Commit-Queue: David Bertoni <dbertoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#878660}
Support type and variable names in schemas which begin with digits. Do
this by prepending an underscore to the generated variable or type name.
This will be useful for supporting manifest keys like "icons" and
"requirements".
Bug: 1113513
Change-Id: I7ea285979ea9c8117dc49ceff1415d8b6f2f21bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2844545
Commit-Queue: Karan Bhatia <karandeepb@chromium.org>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#877790}
This picks up make_unique changes for target_os = "chromeos" which were
not hit on my previous Mac build.
This is a large-scale change: go/chromium-modernize-make-unique
Bug: 1194272
Change-Id: Ia5c355daecbcb0c81d69db746c97c9f321b22bae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2826514
Commit-Queue: Peter Boström <pbos@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#872701}
Several extension API schemas contained properties marking arguments as
"optional": false. However this is the default if "optional" is not
specified, so this CL removes those instances to clean things up.
Also adds a function to model.py that can be used to raise a parse error
for cases like this.
Bug: N/A
Change-Id: Ia1e21a8337df81bed3361d02fa87c5c052c328dc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2776044
Commit-Queue: Tim Judkins <tjudkins@chromium.org>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Karan Bhatia <karandeepb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#867298}
This change removes calls to base::ASCIIToUTF16 with a single-line
string literal and replaces them with a u"..." literal instead. Files
where this change would cause compilation errors were not changed.
This is a mechanical change:
$ git grep -lw ASCIIToUTF16 | xargs \
sed -i 's/\(base::\)\?ASCIIToUTF16(\("\(\\.\|[^\\"]\)*"\))/u\2/g'
$ git cl format
Bug: 1189439
Change-Id: I1097cc61165b2fcdc86755cff11f5edeb3b0270f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2780659
Commit-Queue: danakj <danakj@chromium.org>
Auto-Submit: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Owners-Override: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#865709}
This already works for json schemas. IDL schema currently only supports
specifying platform availability on namespaces. Also support it for
other IDL nodes (in particular functions).
BUG=1189892
Change-Id: Id8ee8b0e0fbfa3846eecd4bd4c3b326a731793d2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2773826
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Commit-Queue: Karan Bhatia <karandeepb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#865358}
This change adds #include <string> to files currently including
"base/strings/string16.h". This prepares these files for the planned
removal of the base::string16 alias.
In order to adhere to the style guide [1] the following logic was
performed:
* Insert into an existing block of C++ STL includes, if possible
* Else insert `#include <string>` followed by a newline before the first
#include "some_header.h" line that is not referring to a matching header
(only relevant for implementation and test files)
[1] https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes
Bug: 1184339
Change-Id: I96660fec3fff0192d53e9728bbbae86228a52c58
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2749296
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Owners-Override: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#861966}