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}
The SchemaLoader name implies that the object is used for loading
schemas, but for some reason also has logic to resolve a type and
namespace. Move this into a separate NamespaceResolver file to
make it easier to reuse SchemaLoader.
BUG=None
Review-Url: https://codereview.chromium.org/2596583002
Cr-Commit-Position: refs/heads/master@{#440201}
At the moment the 3 modules that use extension API schemas, those in
extensions/common/api, chrome/common/extensions/api, and extensions/shell/api,
are generated with different C++ namespaces: "core_api", "api", and
"shell::api" respectively.
This is a pointless distinction to make since as far as JS is concerned they
must all go on the window.chrome object, therefore namespace conflicts are
impossible. It just ends up adding code noise.
The only problem it solves is that all bundle compiles are generated to the
same name, "GeneratedSchemas" and "GeneratedFunctionRegistry". This patch
solves that a different way, by adding a JSON schema compiler option to give
those generated classes a prefix such that they are "GeneratedSchemas",
"ChromeGeneratedSchemas", and "ShellGeneratedSchemas" respectively.
This lets us to a global substitution from "core_api" to just "api".
R=rockot@chromium.org, dpranke@chromium.orgTBR=ben@chromium.org
Review URL: https://codereview.chromium.org/1226353004
Cr-Commit-Position: refs/heads/master@{#340119}
Remove all inlined enums from extension APIs.
BUG=472279
TBR=derat@chromium.org (mechanical changes to chrome/browser/chromeos/app_mode/kiosk_app_update_service.cc and chrome/browser/ui/ash/ash_keyboard_controller_proxy.cc)
Review URL: https://codereview.chromium.org/1055673002
Cr-Commit-Position: refs/heads/master@{#323912}
* Fixed in this version: dependencies for *_api_registration on *_api.
Split bundle generation steps so that API registration is generated in browser, not common.
We now have schema generation, schema bundle generation, and schema bundle registration generation; the last of these is generated in a separate build target and output to browser rather than common.
Fix a couple of dangling gyp issues also.
BUG=405226
TBR=scottmg@chromium.org,sky@chromium.org
Review URL: https://codereview.chromium.org/513633002
Cr-Commit-Position: refs/heads/master@{#292090}
Causing build failure in Android due to failed include for extensions/common/api/runtime.h.
This reverts commit 3b70ef14be.
BUG=none
TBR=yoz
Review URL: https://codereview.chromium.org/506253003
Cr-Commit-Position: refs/heads/master@{#292059}
We now have schema generation, schema bundle generation, and schema bundle registration generation; the last of these is generated in a separate build target and output to browser rather than common.
Fix a couple of dangling gyp issues also.
BUG=405226
TBR=sky@chromium.org
Review URL: https://codereview.chromium.org/489153003
Cr-Commit-Position: refs/heads/master@{#292057}
This replaces the hard-coded chrome/browser/extensions/api path with
a command-line option (impl_dir).
BUG=349019
Review URL: https://codereview.chromium.org/183763032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@254995 0039d316-1c4b-4281-b951-d872f2087c98
This cl lays the groundwork for sharing all ax enums between platfrom accessibility and extension accessibility.
BUG=
Review URL: https://codereview.chromium.org/143473003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@249993 0039d316-1c4b-4281-b951-d872f2087c98
The SchemaLoader looks for schema files in the current directory. This
isn't very robust and may cause problems for other products than
Chromium if they run the script from a GYP file in another directory.
The SchemaLoader is supplied two arguments now: the path to API files
relative to the root path (for use in #includes) and the regular path
to API files (for file access).
BUG=
Review URL: https://codereview.chromium.org/23534063
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225977 0039d316-1c4b-4281-b951-d872f2087c98
Now all the extensions API schemas are loaded lazily, to
avoid the memory overhead of loading them upfront. Also,
the API feature system now can use the URL to determine
availability of the API. APIs can now be checked for
availability separately, without needing to load all the APIs.
Review URL: https://chromiumcodereview.appspot.com/12522004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190058 0039d316-1c4b-4281-b951-d872f2087c98
The physical tests I've added are initial dummies - kalman, please take a look at the *structure* of the test setup. It feels like there is a lot of repetition of test names, but I like using python's unittest framework so it runs as a presubmit check. Any hints?
I have a lot more tests I'd like to add.
Note that there needs to be functionality to disable tests, e.g. there will need to be some tests that will fail from the IDL return value type bug (https://code.google.com/p/chromium/issues/detail?id=170837).
Thanks,
Sasha
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=183709
Review URL: https://chromiumcodereview.appspot.com/12218151
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@183931 0039d316-1c4b-4281-b951-d872f2087c98
> Added unit tests for the Dart Chrome.* API wrappers, testing the Dart output mode from JSON Schema Compiler.
>
> The physical tests I've added are initial dummies - kalman, please take a look at the *structure* of the test setup. It feels like there is a lot of repetition of test names, but I like using python's unittest framework so it runs as a presubmit check. Any hints?
>
> I have a lot more tests I'd like to add.
>
> Note that there needs to be functionality to disable tests, e.g. there will need to be some tests that will fail from the IDL return value type bug (https://code.google.com/p/chromium/issues/detail?id=170837).
>
> Thanks,
>
> Sasha
>
> Review URL: https://chromiumcodereview.appspot.com/12218151TBR=sashab@chromium.org
Review URL: https://codereview.chromium.org/12320030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@183751 0039d316-1c4b-4281-b951-d872f2087c98
The physical tests I've added are initial dummies - kalman, please take a look at the *structure* of the test setup. It feels like there is a lot of repetition of test names, but I like using python's unittest framework so it runs as a presubmit check. Any hints?
I have a lot more tests I'd like to add.
Note that there needs to be functionality to disable tests, e.g. there will need to be some tests that will fail from the IDL return value type bug (https://code.google.com/p/chromium/issues/detail?id=170837).
Thanks,
Sasha
Review URL: https://chromiumcodereview.appspot.com/12218151
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@183709 0039d316-1c4b-4281-b951-d872f2087c98
Modified json_schema_compiler to allow a -l option to specify the language.
Also allowed for a -H option to specify a hooks file, which is currently only
supported for Dart.
Review URL: https://chromiumcodereview.appspot.com/12041098
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180845 0039d316-1c4b-4281-b951-d872f2087c98
The json schema stuff already has this support, to skip generation of C++
code for certain functions. Doing the same thing for IDL is slightly
complicated by the fact that we still want to generate JSON for functions
marked nocompile.
BUG=129080
TEST=includes unit and browser tests
Review URL: https://chromiumcodereview.appspot.com/10435003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138707 0039d316-1c4b-4281-b951-d872f2087c98
Files are now named like "file_name.h" instead of "fileName.h" or "file.name.h"
BUG=125669
TEST=All previous tests for the renamed files
This broke Linux and Linux64:
g++: out/Release/obj/gen/chrome/common/extensions/api/experimental.fontSettings.cc: No such file or directory
g++: no input files
make: *** [out/Release/obj.target/api/gen/chrome/common/extensions/api/experimental.fontSettings.o] Error 1
Review URL: http://codereview.chromium.org/10272021TBR=cduvall@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10348005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@135081 0039d316-1c4b-4281-b951-d872f2087c98
Files are now named like "file_name.h" instead of "fileName.h" or "file.name.h"
BUG=125669
TEST=All previous tests for the renamed files
Review URL: http://codereview.chromium.org/10272021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@135077 0039d316-1c4b-4281-b951-d872f2087c98
JSON schema compiler now supports having strings as types.
Similar to http://crbug.com/122075
BUG=124771
TEST=cpp_type_generator_test.py
Review URL: http://codereview.chromium.org/10206034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134674 0039d316-1c4b-4281-b951-d872f2087c98
Instead of sharing a single namespace internally for types, makes
json_schema_compiler treat types as their fully-qualified selfs. This allows
two different namespaces to have types with the same name, and to be able to
reference the others' types by a fully-qualified name. This change also causes
namespaces to not be added twice to their CppTypeGenerators.
BUG=119954
TEST=none
Review URL: http://codereview.chromium.org/9834088
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129251 0039d316-1c4b-4281-b951-d872f2087c98
This is an incremental step towards fully IDL-specified API bindings. This
patch adds code which generates JSON based on IDL for the purpose of exposing
bindings to javascript.
BUG=119137
TEST=Code should compile and existing tests should pass.
Review URL: http://codereview.chromium.org/9774001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127908 0039d316-1c4b-4281-b951-d872f2087c98
Refactor extension_function_dispatcher to extract ExtensionFunctionRegistry.
This allows us to generate an additional code block that takes an ExtensionFunctionRegistry
and asks it to register generated API functions.
Then switch DnsResolve over to get registered this way.
Along the way, notice that DNSResolve is capitalized using an untenable style. Fix that.
Fixes since original 127159:
- change name of build rule to gen_bundle_api
- actually add per-file dependencies to .gyp (this was why clean builds
failed)
- change 'outputs' to match the emitted filename, fixing a needless
rebuild problem.
- split the top-level build action that was a part of
json_schema_compile.gypi, and include it only in api.gyp, thus fixing
the problem where json_schema_compiler_tests.gyp was asking it to create
outputs in the tools/json_schema_compiler_test directory, again causing
needless work during the build process.
BUG=none (essential plumbing work)
TEST=same as before.
Review URL: https://chromiumcodereview.appspot.com/9716003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127555 0039d316-1c4b-4281-b951-d872f2087c98