From 3cf1ddb4ce72429819a6579d1cb7147276a62deb Mon Sep 17 00:00:00 2001 From: Andreas Tolfsen Date: Tue, 13 Dec 2016 19:11:05 +0000 Subject: [PATCH 01/70] Bug 1323253 - Enable unsafe CPOW checks in Marionette; r=automatedtester Since bug 1244425 and bug 1280947 have made it into Firefox Stable, it is now safe to enable unsafe CPOW checks in Marionette. MozReview-Commit-ID: Fwb1tIylGKQ --HG-- extra : rebase_source : 603b83a39a6a5f5dcc4f6b55dbcd0766e92cbca3 --- testing/marionette/client/marionette_driver/geckoinstance.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/testing/marionette/client/marionette_driver/geckoinstance.py b/testing/marionette/client/marionette_driver/geckoinstance.py index 8815872c867c..f457b6b5e436 100644 --- a/testing/marionette/client/marionette_driver/geckoinstance.py +++ b/testing/marionette/client/marionette_driver/geckoinstance.py @@ -32,9 +32,6 @@ class GeckoInstance(object): # Do not show datareporting policy notifications which can interfer with tests "datareporting.policy.dataSubmissionPolicyBypassNotification": True, - # Until Bug 1238095 is fixed, we have to enable CPOWs in order - # for Marionette tests to work properly. - "dom.ipc.cpows.forbid-unsafe-from-browser": False, "dom.ipc.reportProcessHangs": False, # No slow script dialogs From 68aa62d8a7c052f1f2bc3066cfdecc4e8de3ad2d Mon Sep 17 00:00:00 2001 From: CuriousLearner Date: Thu, 20 Oct 2016 18:25:34 +0530 Subject: [PATCH 02/70] Bug 1302763 - Move docker images out of testing/docker into taskcluster/docker; r=CuriousLearner MozReview-Commit-ID: 7v1uCDB5qoN --HG-- rename : testing/docker/README.md => taskcluster/docker/README.md rename : testing/docker/REGISTRY => taskcluster/docker/REGISTRY rename : testing/docker/android-gradle-build/Dockerfile => taskcluster/docker/android-gradle-build/Dockerfile rename : testing/docker/android-gradle-build/README.md => taskcluster/docker/android-gradle-build/README.md rename : testing/docker/android-gradle-build/REGISTRY => taskcluster/docker/android-gradle-build/REGISTRY rename : testing/docker/android-gradle-build/VERSION => taskcluster/docker/android-gradle-build/VERSION rename : testing/docker/android-gradle-build/bin/after.sh => taskcluster/docker/android-gradle-build/bin/after.sh rename : testing/docker/android-gradle-build/bin/before.sh => taskcluster/docker/android-gradle-build/bin/before.sh rename : testing/docker/android-gradle-build/bin/build.sh => taskcluster/docker/android-gradle-build/bin/build.sh rename : testing/docker/android-gradle-build/bin/checkout-script.sh => taskcluster/docker/android-gradle-build/bin/checkout-script.sh rename : testing/docker/android-gradle-build/bin/checkout-sources.sh => taskcluster/docker/android-gradle-build/bin/checkout-sources.sh rename : testing/docker/android-gradle-build/buildprops.json => taskcluster/docker/android-gradle-build/buildprops.json rename : testing/docker/android-gradle-build/dot-config/pip/pip.conf => taskcluster/docker/android-gradle-build/dot-config/pip/pip.conf rename : testing/docker/android-gradle-build/oauth.txt => taskcluster/docker/android-gradle-build/oauth.txt rename : testing/docker/base-build/Dockerfile => taskcluster/docker/base-build/Dockerfile rename : testing/docker/base-build/VERSION => taskcluster/docker/base-build/VERSION rename : testing/docker/base-build/system-setup.sh => taskcluster/docker/base-build/system-setup.sh rename : testing/docker/base-test/Dockerfile => taskcluster/docker/base-test/Dockerfile rename : testing/docker/base-test/REGISTRY => taskcluster/docker/base-test/REGISTRY rename : testing/docker/base-test/VERSION => taskcluster/docker/base-test/VERSION rename : testing/docker/base-test/sources.list => taskcluster/docker/base-test/sources.list rename : testing/docker/centos6-build-upd/Dockerfile => taskcluster/docker/centos6-build-upd/Dockerfile rename : testing/docker/centos6-build-upd/REGISTRY => taskcluster/docker/centos6-build-upd/REGISTRY rename : testing/docker/centos6-build-upd/VERSION => taskcluster/docker/centos6-build-upd/VERSION rename : testing/docker/centos6-build/Dockerfile => taskcluster/docker/centos6-build/Dockerfile rename : testing/docker/centos6-build/REGISTRY => taskcluster/docker/centos6-build/REGISTRY rename : testing/docker/centos6-build/VERSION => taskcluster/docker/centos6-build/VERSION rename : testing/docker/centos6-build/hgrc => taskcluster/docker/centos6-build/hgrc rename : testing/docker/centos6-build/system-setup.sh => taskcluster/docker/centos6-build/system-setup.sh rename : testing/docker/decision/Dockerfile => taskcluster/docker/decision/Dockerfile rename : testing/docker/decision/README.md => taskcluster/docker/decision/README.md rename : testing/docker/decision/REGISTRY => taskcluster/docker/decision/REGISTRY rename : testing/docker/decision/VERSION => taskcluster/docker/decision/VERSION rename : testing/docker/decision/system-setup.sh => taskcluster/docker/decision/system-setup.sh rename : testing/docker/desktop-build/Dockerfile => taskcluster/docker/desktop-build/Dockerfile rename : testing/docker/desktop-build/bin/build.sh => taskcluster/docker/desktop-build/bin/build.sh rename : testing/docker/desktop-build/bin/checkout-script.sh => taskcluster/docker/desktop-build/bin/checkout-script.sh rename : testing/docker/desktop-build/bin/checkout-sources.sh => taskcluster/docker/desktop-build/bin/checkout-sources.sh rename : testing/docker/desktop-build/buildprops.json => taskcluster/docker/desktop-build/buildprops.json rename : testing/docker/desktop-build/dot-config/pip/pip.conf => taskcluster/docker/desktop-build/dot-config/pip/pip.conf rename : testing/docker/desktop-build/oauth.txt => taskcluster/docker/desktop-build/oauth.txt rename : testing/docker/desktop-test/Dockerfile => taskcluster/docker/desktop-test/Dockerfile rename : testing/docker/desktop-test/apport => taskcluster/docker/desktop-test/apport rename : testing/docker/desktop-test/buildprops.json => taskcluster/docker/desktop-test/buildprops.json rename : testing/docker/desktop-test/deja-dup-monitor.desktop => taskcluster/docker/desktop-test/deja-dup-monitor.desktop rename : testing/docker/desktop-test/dot-files/config/pip/pip.conf => taskcluster/docker/desktop-test/dot-files/config/pip/pip.conf rename : testing/docker/desktop-test/dot-files/config/user-dirs.dirs => taskcluster/docker/desktop-test/dot-files/config/user-dirs.dirs rename : testing/docker/desktop-test/dot-files/config/user-dirs.locale => taskcluster/docker/desktop-test/dot-files/config/user-dirs.locale rename : testing/docker/desktop-test/dot-files/pulse/default.pa => taskcluster/docker/desktop-test/dot-files/pulse/default.pa rename : testing/docker/desktop-test/fonts.conf => taskcluster/docker/desktop-test/fonts.conf rename : testing/docker/desktop-test/jockey-gtk.desktop => taskcluster/docker/desktop-test/jockey-gtk.desktop rename : testing/docker/desktop-test/motd => taskcluster/docker/desktop-test/motd rename : testing/docker/desktop-test/release-upgrades => taskcluster/docker/desktop-test/release-upgrades rename : testing/docker/desktop-test/taskcluster-interactive-shell => taskcluster/docker/desktop-test/taskcluster-interactive-shell rename : testing/docker/desktop-test/tc-vcs-config.yml => taskcluster/docker/desktop-test/tc-vcs-config.yml rename : testing/docker/desktop-test/tester.env => taskcluster/docker/desktop-test/tester.env rename : testing/docker/desktop1604-test/Dockerfile => taskcluster/docker/desktop1604-test/Dockerfile rename : testing/docker/desktop1604-test/apport => taskcluster/docker/desktop1604-test/apport rename : testing/docker/desktop1604-test/buildprops.json => taskcluster/docker/desktop1604-test/buildprops.json rename : testing/docker/desktop1604-test/deja-dup-monitor.desktop => taskcluster/docker/desktop1604-test/deja-dup-monitor.desktop rename : testing/docker/desktop1604-test/dot-files/config/pip/pip.conf => taskcluster/docker/desktop1604-test/dot-files/config/pip/pip.conf rename : testing/docker/desktop1604-test/dot-files/config/user-dirs.dirs => taskcluster/docker/desktop1604-test/dot-files/config/user-dirs.dirs rename : testing/docker/desktop1604-test/dot-files/config/user-dirs.locale => taskcluster/docker/desktop1604-test/dot-files/config/user-dirs.locale rename : testing/docker/desktop1604-test/dot-files/pulse/default.pa => taskcluster/docker/desktop1604-test/dot-files/pulse/default.pa rename : testing/docker/desktop1604-test/fonts.conf => taskcluster/docker/desktop1604-test/fonts.conf rename : testing/docker/desktop1604-test/jockey-gtk.desktop => taskcluster/docker/desktop1604-test/jockey-gtk.desktop rename : testing/docker/desktop1604-test/motd => taskcluster/docker/desktop1604-test/motd rename : testing/docker/desktop1604-test/release-upgrades => taskcluster/docker/desktop1604-test/release-upgrades rename : testing/docker/desktop1604-test/taskcluster-interactive-shell => taskcluster/docker/desktop1604-test/taskcluster-interactive-shell rename : testing/docker/desktop1604-test/tc-vcs-config.yml => taskcluster/docker/desktop1604-test/tc-vcs-config.yml rename : testing/docker/desktop1604-test/tester.env => taskcluster/docker/desktop1604-test/tester.env rename : testing/docker/image_builder/Dockerfile => taskcluster/docker/image_builder/Dockerfile rename : testing/docker/image_builder/REGISTRY => taskcluster/docker/image_builder/REGISTRY rename : testing/docker/image_builder/VERSION => taskcluster/docker/image_builder/VERSION rename : testing/docker/image_builder/build-image.sh => taskcluster/docker/image_builder/build-image.sh rename : testing/docker/image_builder/setup.sh => taskcluster/docker/image_builder/setup.sh rename : testing/docker/lint/Dockerfile => taskcluster/docker/lint/Dockerfile rename : testing/docker/lint/system-setup.sh => taskcluster/docker/lint/system-setup.sh rename : testing/docker/recipes/centos6-build-system-setup.sh => taskcluster/docker/recipes/centos6-build-system-setup.sh rename : testing/docker/recipes/common.sh => taskcluster/docker/recipes/common.sh rename : testing/docker/recipes/install-mercurial.sh => taskcluster/docker/recipes/install-mercurial.sh rename : testing/docker/recipes/run-task => taskcluster/docker/recipes/run-task rename : testing/docker/recipes/tooltool.py => taskcluster/docker/recipes/tooltool.py rename : testing/docker/recipes/ubuntu1204-test-system-setup.sh => taskcluster/docker/recipes/ubuntu1204-test-system-setup.sh rename : testing/docker/recipes/ubuntu1604-test-system-setup.sh => taskcluster/docker/recipes/ubuntu1604-test-system-setup.sh rename : testing/docker/recipes/xvfb.sh => taskcluster/docker/recipes/xvfb.sh rename : testing/docker/rust-build/Dockerfile => taskcluster/docker/rust-build/Dockerfile rename : testing/docker/rust-build/README.md => taskcluster/docker/rust-build/README.md rename : testing/docker/rust-build/REGISTRY => taskcluster/docker/rust-build/REGISTRY rename : testing/docker/rust-build/VERSION => taskcluster/docker/rust-build/VERSION rename : testing/docker/rust-build/build_cargo.sh => taskcluster/docker/rust-build/build_cargo.sh rename : testing/docker/rust-build/build_rust.sh => taskcluster/docker/rust-build/build_rust.sh rename : testing/docker/rust-build/build_rust_mac.sh => taskcluster/docker/rust-build/build_rust_mac.sh rename : testing/docker/rust-build/fetch_cargo.sh => taskcluster/docker/rust-build/fetch_cargo.sh rename : testing/docker/rust-build/fetch_rust.sh => taskcluster/docker/rust-build/fetch_rust.sh rename : testing/docker/rust-build/package_rust.sh => taskcluster/docker/rust-build/package_rust.sh rename : testing/docker/rust-build/repack_rust.py => taskcluster/docker/rust-build/repack_rust.py rename : testing/docker/rust-build/splat_rust.py => taskcluster/docker/rust-build/splat_rust.py rename : testing/docker/rust-build/task.json => taskcluster/docker/rust-build/task.json rename : testing/docker/rust-build/tcbuild.py => taskcluster/docker/rust-build/tcbuild.py rename : testing/docker/rust-build/upload_rust.sh => taskcluster/docker/rust-build/upload_rust.sh rename : testing/docker/tester/Dockerfile => taskcluster/docker/tester/Dockerfile rename : testing/docker/tester/REGISTRY => taskcluster/docker/tester/REGISTRY rename : testing/docker/tester/VERSION => taskcluster/docker/tester/VERSION rename : testing/docker/tester/bin/test.sh => taskcluster/docker/tester/bin/test.sh rename : testing/docker/tester/dot-config/pip/pip.conf => taskcluster/docker/tester/dot-config/pip/pip.conf rename : testing/docker/tester/dot-config/user-dirs.dirs => taskcluster/docker/tester/dot-config/user-dirs.dirs rename : testing/docker/tester/dot-config/user-dirs.locale => taskcluster/docker/tester/dot-config/user-dirs.locale rename : testing/docker/tester/dot-pulse/default.pa => taskcluster/docker/tester/dot-pulse/default.pa rename : testing/docker/tester/tc-vcs-config.yml => taskcluster/docker/tester/tc-vcs-config.yml rename : testing/docker/tester/tester.env => taskcluster/docker/tester/tester.env rename : testing/docker/upload-symbols/Dockerfile => taskcluster/docker/upload-symbols/Dockerfile rename : testing/docker/upload-symbols/README.md => taskcluster/docker/upload-symbols/README.md rename : testing/docker/upload-symbols/bin/checkout-script.sh => taskcluster/docker/upload-symbols/bin/checkout-script.sh rename : testing/docker/upload-symbols/bin/upload.sh => taskcluster/docker/upload-symbols/bin/upload.sh rename : testing/docker/upload-symbols/test_exports.sh => taskcluster/docker/upload-symbols/test_exports.sh extra : rebase_source : 2cf145867ff1f14f8e64b20e88e93fabaff3e756 extra : source : 50adff295bf00ea0d9d7426e745acf3635e7dba5 --- AUTHORS | 1 + taskcluster/ci/android-stuff/kind.yml | 2 +- taskcluster/ci/docker-image/kind.yml | 2 +- taskcluster/ci/source-check/mozlint.yml | 6 +- {testing => taskcluster}/docker/README.md | 0 {testing => taskcluster}/docker/REGISTRY | 0 .../docker/android-gradle-build/Dockerfile | 4 +- .../docker/android-gradle-build/README.md | 0 .../docker/android-gradle-build/REGISTRY | 0 .../docker/android-gradle-build/VERSION | 0 .../docker/android-gradle-build/bin/after.sh | 0 .../docker/android-gradle-build/bin/before.sh | 0 .../docker/android-gradle-build/bin/build.sh | 0 .../bin/checkout-script.sh | 0 .../bin/checkout-sources.sh | 0 .../android-gradle-build/buildprops.json | 0 .../dot-config/pip/pip.conf | 0 .../docker/android-gradle-build/oauth.txt | 0 .../docker/base-build/Dockerfile | 0 .../docker/base-build/VERSION | 0 .../docker/base-build/system-setup.sh | 0 .../docker/base-test/Dockerfile | 0 .../docker/base-test/REGISTRY | 0 .../docker/base-test/VERSION | 0 .../docker/base-test/sources.list | 0 .../docker/centos6-build-upd/Dockerfile | 0 .../docker/centos6-build-upd/REGISTRY | 0 .../docker/centos6-build-upd/VERSION | 0 .../docker/centos6-build/Dockerfile | 0 .../docker/centos6-build/REGISTRY | 0 .../docker/centos6-build/VERSION | 0 .../docker/centos6-build/hgrc | 0 .../docker/centos6-build/system-setup.sh | 0 .../docker/decision/Dockerfile | 12 +- .../docker/decision/README.md | 0 .../docker/decision/REGISTRY | 0 .../docker/decision/VERSION | 0 .../docker/decision/system-setup.sh | 0 .../docker/desktop-build/Dockerfile | 26 +-- .../docker/desktop-build/bin/build.sh | 0 .../desktop-build/bin/checkout-script.sh | 0 .../desktop-build/bin/checkout-sources.sh | 0 .../docker/desktop-build/buildprops.json | 0 .../desktop-build/dot-config/pip/pip.conf | 0 .../docker/desktop-build/oauth.txt | 0 .../docker/desktop-test/Dockerfile | 20 +- .../docker/desktop-test/apport | 0 .../docker/desktop-test/buildprops.json | 0 .../desktop-test/deja-dup-monitor.desktop | 0 .../dot-files/config/pip/pip.conf | 0 .../dot-files/config/user-dirs.dirs | 0 .../dot-files/config/user-dirs.locale | 0 .../desktop-test/dot-files/pulse/default.pa | 0 .../docker/desktop-test/fonts.conf | 0 .../docker/desktop-test/jockey-gtk.desktop | 0 .../docker/desktop-test/motd | 0 .../docker/desktop-test/release-upgrades | 0 .../taskcluster-interactive-shell | 0 .../docker/desktop-test/tc-vcs-config.yml | 0 .../docker/desktop-test/tester.env | 0 .../docker/desktop1604-test/Dockerfile | 24 +-- .../docker/desktop1604-test/apport | 0 .../docker/desktop1604-test/buildprops.json | 0 .../desktop1604-test/deja-dup-monitor.desktop | 0 .../dot-files/config/pip/pip.conf | 0 .../dot-files/config/user-dirs.dirs | 0 .../dot-files/config/user-dirs.locale | 0 .../dot-files/pulse/default.pa | 0 .../docker/desktop1604-test/fonts.conf | 0 .../desktop1604-test/jockey-gtk.desktop | 0 .../docker/desktop1604-test/motd | 0 .../docker/desktop1604-test/release-upgrades | 0 .../taskcluster-interactive-shell | 0 .../docker/desktop1604-test/tc-vcs-config.yml | 0 .../docker/desktop1604-test/tester.env | 0 .../docker/image_builder/Dockerfile | 20 +- .../docker/image_builder/REGISTRY | 0 .../docker/image_builder/VERSION | 0 .../docker/image_builder/build-image.sh | 0 .../docker/image_builder/setup.sh | 0 .../docker/lint/Dockerfile | 12 +- .../docker/lint/system-setup.sh | 0 .../recipes/centos6-build-system-setup.sh | 0 .../docker/recipes/common.sh | 0 .../docker/recipes/install-mercurial.sh | 0 .../docker/recipes/run-task | 0 .../docker/recipes/tooltool.py | 0 .../recipes/ubuntu1204-test-system-setup.sh | 0 .../recipes/ubuntu1604-test-system-setup.sh | 0 .../docker/recipes/xvfb.sh | 0 .../docker/rust-build/Dockerfile | 0 .../docker/rust-build/README.md | 0 .../docker/rust-build/REGISTRY | 0 .../docker/rust-build/VERSION | 0 .../docker/rust-build/build_cargo.sh | 0 .../docker/rust-build/build_rust.sh | 0 .../docker/rust-build/build_rust_mac.sh | 0 .../docker/rust-build/fetch_cargo.sh | 0 .../docker/rust-build/fetch_rust.sh | 0 .../docker/rust-build/package_rust.sh | 0 taskcluster/docker/rust-build/repack_rust.py | 187 ++++++++++++++++++ .../docker/rust-build/splat_rust.py | 10 +- .../docker/rust-build/task.json | 0 .../docker/rust-build/tcbuild.py | 43 +++- .../docker/rust-build/upload_rust.sh | 0 .../docker/tester/Dockerfile | 0 .../docker/tester/REGISTRY | 0 .../docker/tester/VERSION | 0 .../docker/tester/bin/test.sh | 0 .../docker/tester/dot-config/pip/pip.conf | 0 .../docker/tester/dot-config/user-dirs.dirs | 0 .../docker/tester/dot-config/user-dirs.locale | 0 .../docker/tester/dot-pulse/default.pa | 0 .../docker/tester/tc-vcs-config.yml | 0 .../docker/tester/tester.env | 0 .../docker/upload-symbols/Dockerfile | 0 .../docker/upload-symbols/README.md | 0 .../upload-symbols/bin/checkout-script.sh | 0 .../docker/upload-symbols/bin/upload.sh | 0 .../docker/upload-symbols/test_exports.sh | 0 taskcluster/docs/docker-images.rst | 2 +- taskcluster/docs/kinds.rst | 2 +- .../scripts/builder/build-haz-linux.sh | 2 +- .../scripts/builder/sm-tooltool-config.sh | 2 +- taskcluster/taskgraph/docker.py | 4 +- taskcluster/taskgraph/task/docker_image.py | 2 +- taskcluster/taskgraph/transforms/task.py | 2 +- .../transforms/tests/test_description.py | 2 +- taskcluster/taskgraph/util/docker.py | 2 +- testing/docker/rust-build/repack_rust.py | 175 ---------------- 130 files changed, 303 insertions(+), 261 deletions(-) rename {testing => taskcluster}/docker/README.md (100%) rename {testing => taskcluster}/docker/REGISTRY (100%) rename {testing => taskcluster}/docker/android-gradle-build/Dockerfile (96%) rename {testing => taskcluster}/docker/android-gradle-build/README.md (100%) rename {testing => taskcluster}/docker/android-gradle-build/REGISTRY (100%) rename {testing => taskcluster}/docker/android-gradle-build/VERSION (100%) rename {testing => taskcluster}/docker/android-gradle-build/bin/after.sh (100%) rename {testing => taskcluster}/docker/android-gradle-build/bin/before.sh (100%) rename {testing => taskcluster}/docker/android-gradle-build/bin/build.sh (100%) rename {testing => taskcluster}/docker/android-gradle-build/bin/checkout-script.sh (100%) rename {testing => taskcluster}/docker/android-gradle-build/bin/checkout-sources.sh (100%) rename {testing => taskcluster}/docker/android-gradle-build/buildprops.json (100%) rename {testing => taskcluster}/docker/android-gradle-build/dot-config/pip/pip.conf (100%) rename {testing => taskcluster}/docker/android-gradle-build/oauth.txt (100%) rename {testing => taskcluster}/docker/base-build/Dockerfile (100%) rename {testing => taskcluster}/docker/base-build/VERSION (100%) rename {testing => taskcluster}/docker/base-build/system-setup.sh (100%) rename {testing => taskcluster}/docker/base-test/Dockerfile (100%) rename {testing => taskcluster}/docker/base-test/REGISTRY (100%) rename {testing => taskcluster}/docker/base-test/VERSION (100%) rename {testing => taskcluster}/docker/base-test/sources.list (100%) rename {testing => taskcluster}/docker/centos6-build-upd/Dockerfile (100%) rename {testing => taskcluster}/docker/centos6-build-upd/REGISTRY (100%) rename {testing => taskcluster}/docker/centos6-build-upd/VERSION (100%) rename {testing => taskcluster}/docker/centos6-build/Dockerfile (100%) rename {testing => taskcluster}/docker/centos6-build/REGISTRY (100%) rename {testing => taskcluster}/docker/centos6-build/VERSION (100%) rename {testing => taskcluster}/docker/centos6-build/hgrc (100%) rename {testing => taskcluster}/docker/centos6-build/system-setup.sh (100%) rename {testing => taskcluster}/docker/decision/Dockerfile (61%) rename {testing => taskcluster}/docker/decision/README.md (100%) rename {testing => taskcluster}/docker/decision/REGISTRY (100%) rename {testing => taskcluster}/docker/decision/VERSION (100%) rename {testing => taskcluster}/docker/decision/system-setup.sh (100%) rename {testing => taskcluster}/docker/desktop-build/Dockerfile (68%) rename {testing => taskcluster}/docker/desktop-build/bin/build.sh (100%) rename {testing => taskcluster}/docker/desktop-build/bin/checkout-script.sh (100%) rename {testing => taskcluster}/docker/desktop-build/bin/checkout-sources.sh (100%) rename {testing => taskcluster}/docker/desktop-build/buildprops.json (100%) rename {testing => taskcluster}/docker/desktop-build/dot-config/pip/pip.conf (100%) rename {testing => taskcluster}/docker/desktop-build/oauth.txt (100%) rename {testing => taskcluster}/docker/desktop-test/Dockerfile (83%) rename {testing => taskcluster}/docker/desktop-test/apport (100%) rename {testing => taskcluster}/docker/desktop-test/buildprops.json (100%) rename {testing => taskcluster}/docker/desktop-test/deja-dup-monitor.desktop (100%) rename {testing => taskcluster}/docker/desktop-test/dot-files/config/pip/pip.conf (100%) rename {testing => taskcluster}/docker/desktop-test/dot-files/config/user-dirs.dirs (100%) rename {testing => taskcluster}/docker/desktop-test/dot-files/config/user-dirs.locale (100%) rename {testing => taskcluster}/docker/desktop-test/dot-files/pulse/default.pa (100%) rename {testing => taskcluster}/docker/desktop-test/fonts.conf (100%) rename {testing => taskcluster}/docker/desktop-test/jockey-gtk.desktop (100%) rename {testing => taskcluster}/docker/desktop-test/motd (100%) rename {testing => taskcluster}/docker/desktop-test/release-upgrades (100%) rename {testing => taskcluster}/docker/desktop-test/taskcluster-interactive-shell (100%) rename {testing => taskcluster}/docker/desktop-test/tc-vcs-config.yml (100%) rename {testing => taskcluster}/docker/desktop-test/tester.env (100%) rename {testing => taskcluster}/docker/desktop1604-test/Dockerfile (81%) rename {testing => taskcluster}/docker/desktop1604-test/apport (100%) rename {testing => taskcluster}/docker/desktop1604-test/buildprops.json (100%) rename {testing => taskcluster}/docker/desktop1604-test/deja-dup-monitor.desktop (100%) rename {testing => taskcluster}/docker/desktop1604-test/dot-files/config/pip/pip.conf (100%) rename {testing => taskcluster}/docker/desktop1604-test/dot-files/config/user-dirs.dirs (100%) rename {testing => taskcluster}/docker/desktop1604-test/dot-files/config/user-dirs.locale (100%) rename {testing => taskcluster}/docker/desktop1604-test/dot-files/pulse/default.pa (100%) rename {testing => taskcluster}/docker/desktop1604-test/fonts.conf (100%) rename {testing => taskcluster}/docker/desktop1604-test/jockey-gtk.desktop (100%) rename {testing => taskcluster}/docker/desktop1604-test/motd (100%) rename {testing => taskcluster}/docker/desktop1604-test/release-upgrades (100%) rename {testing => taskcluster}/docker/desktop1604-test/taskcluster-interactive-shell (100%) rename {testing => taskcluster}/docker/desktop1604-test/tc-vcs-config.yml (100%) rename {testing => taskcluster}/docker/desktop1604-test/tester.env (100%) rename {testing => taskcluster}/docker/image_builder/Dockerfile (51%) rename {testing => taskcluster}/docker/image_builder/REGISTRY (100%) rename {testing => taskcluster}/docker/image_builder/VERSION (100%) rename {testing => taskcluster}/docker/image_builder/build-image.sh (100%) rename {testing => taskcluster}/docker/image_builder/setup.sh (100%) rename {testing => taskcluster}/docker/lint/Dockerfile (73%) rename {testing => taskcluster}/docker/lint/system-setup.sh (100%) rename {testing => taskcluster}/docker/recipes/centos6-build-system-setup.sh (100%) rename {testing => taskcluster}/docker/recipes/common.sh (100%) rename {testing => taskcluster}/docker/recipes/install-mercurial.sh (100%) rename {testing => taskcluster}/docker/recipes/run-task (100%) rename {testing => taskcluster}/docker/recipes/tooltool.py (100%) rename {testing => taskcluster}/docker/recipes/ubuntu1204-test-system-setup.sh (100%) rename {testing => taskcluster}/docker/recipes/ubuntu1604-test-system-setup.sh (100%) rename {testing => taskcluster}/docker/recipes/xvfb.sh (100%) rename {testing => taskcluster}/docker/rust-build/Dockerfile (100%) rename {testing => taskcluster}/docker/rust-build/README.md (100%) rename {testing => taskcluster}/docker/rust-build/REGISTRY (100%) rename {testing => taskcluster}/docker/rust-build/VERSION (100%) rename {testing => taskcluster}/docker/rust-build/build_cargo.sh (100%) rename {testing => taskcluster}/docker/rust-build/build_rust.sh (100%) rename {testing => taskcluster}/docker/rust-build/build_rust_mac.sh (100%) rename {testing => taskcluster}/docker/rust-build/fetch_cargo.sh (100%) rename {testing => taskcluster}/docker/rust-build/fetch_rust.sh (100%) rename {testing => taskcluster}/docker/rust-build/package_rust.sh (100%) create mode 100644 taskcluster/docker/rust-build/repack_rust.py rename {testing => taskcluster}/docker/rust-build/splat_rust.py (95%) rename {testing => taskcluster}/docker/rust-build/task.json (100%) rename {testing => taskcluster}/docker/rust-build/tcbuild.py (85%) rename {testing => taskcluster}/docker/rust-build/upload_rust.sh (100%) rename {testing => taskcluster}/docker/tester/Dockerfile (100%) rename {testing => taskcluster}/docker/tester/REGISTRY (100%) rename {testing => taskcluster}/docker/tester/VERSION (100%) rename {testing => taskcluster}/docker/tester/bin/test.sh (100%) rename {testing => taskcluster}/docker/tester/dot-config/pip/pip.conf (100%) rename {testing => taskcluster}/docker/tester/dot-config/user-dirs.dirs (100%) rename {testing => taskcluster}/docker/tester/dot-config/user-dirs.locale (100%) rename {testing => taskcluster}/docker/tester/dot-pulse/default.pa (100%) rename {testing => taskcluster}/docker/tester/tc-vcs-config.yml (100%) rename {testing => taskcluster}/docker/tester/tester.env (100%) rename {testing => taskcluster}/docker/upload-symbols/Dockerfile (100%) rename {testing => taskcluster}/docker/upload-symbols/README.md (100%) rename {testing => taskcluster}/docker/upload-symbols/bin/checkout-script.sh (100%) rename {testing => taskcluster}/docker/upload-symbols/bin/upload.sh (100%) rename {testing => taskcluster}/docker/upload-symbols/test_exports.sh (100%) delete mode 100644 testing/docker/rust-build/repack_rust.py diff --git a/AUTHORS b/AUTHORS index 7e9d1f491248..11aa3471caf0 100644 --- a/AUTHORS +++ b/AUTHORS @@ -879,6 +879,7 @@ Ryan Flint Ryan Jones Ryan VanderMeulen Ryoichi Furukawa +Sanyam Khurana sagdjb@softwareag.com Samir Gehani Sammy Ford diff --git a/taskcluster/ci/android-stuff/kind.yml b/taskcluster/ci/android-stuff/kind.yml index 32f6864687f9..3ff7bb5c5b5c 100644 --- a/taskcluster/ci/android-stuff/kind.yml +++ b/taskcluster/ci/android-stuff/kind.yml @@ -63,7 +63,7 @@ jobs: when: files-changed: - "mobile/android/config/**" - - "testing/docker/android-gradle-build/**" + - "taskcluster/docker/android-gradle-build/**" - "testing/mozharness/configs/builds/releng_sub_android_configs/*gradle_dependencies.py" - "**/*.gradle" diff --git a/taskcluster/ci/docker-image/kind.yml b/taskcluster/ci/docker-image/kind.yml index d1c118c8ee74..a990c30f6529 100644 --- a/taskcluster/ci/docker-image/kind.yml +++ b/taskcluster/ci/docker-image/kind.yml @@ -3,7 +3,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. implementation: 'taskgraph.task.docker_image:DockerImageTask' -images_path: '../../../testing/docker' +images_path: '../../../taskcluster/docker' # make a task for each docker-image we might want. For the moment, since we # write artifacts for each, these are whitelisted, but ideally that will change diff --git a/taskcluster/ci/source-check/mozlint.yml b/taskcluster/ci/source-check/mozlint.yml index fd22a9f8f0d9..7c700dd4d8b2 100644 --- a/taskcluster/ci/source-check/mozlint.yml +++ b/taskcluster/ci/source-check/mozlint.yml @@ -40,7 +40,7 @@ mozlint-eslint/opt: # Other misc lint related files. - 'python/mozlint/**' - 'tools/lint/**' - - 'testing/docker/lint/**' + - 'taskcluster/docker/lint/**' mozlint-flake8/opt: description: flake8 run over the gecko codebase @@ -66,7 +66,7 @@ mozlint-flake8/opt: - '**/.flake8' - 'python/mozlint/**' - 'tools/lint/**' - - 'testing/docker/lint/**' + - 'taskcluster/docker/lint/**' wptlint-gecko/opt: description: web-platform-tests linter @@ -94,4 +94,4 @@ wptlint-gecko/opt: - 'testing/web-platform/mozilla/meta/MANIFEST.json' - 'python/mozlint/**' - 'tools/lint/**' - - 'testing/docker/lint/**' + - 'taskcluster/docker/lint/**' diff --git a/testing/docker/README.md b/taskcluster/docker/README.md similarity index 100% rename from testing/docker/README.md rename to taskcluster/docker/README.md diff --git a/testing/docker/REGISTRY b/taskcluster/docker/REGISTRY similarity index 100% rename from testing/docker/REGISTRY rename to taskcluster/docker/REGISTRY diff --git a/testing/docker/android-gradle-build/Dockerfile b/taskcluster/docker/android-gradle-build/Dockerfile similarity index 96% rename from testing/docker/android-gradle-build/Dockerfile rename to taskcluster/docker/android-gradle-build/Dockerfile index b8fb5450f409..7b20edd8454e 100644 --- a/testing/docker/android-gradle-build/Dockerfile +++ b/taskcluster/docker/android-gradle-build/Dockerfile @@ -14,8 +14,8 @@ ADD bin /home/worker/bin RUN chmod +x /home/worker/bin/* # Add wrapper scripts for xvfb allowing tasks to easily retry starting up xvfb -# %include testing/docker/recipes/xvfb.sh -ADD topsrcdir/testing/docker/recipes/xvfb.sh /home/worker/scripts/xvfb.sh +# %include taskcluster/docker/recipes/xvfb.sh +ADD topsrcdir/taskcluster/docker/recipes/xvfb.sh /home/worker/scripts/xvfb.sh # Add configuration COPY dot-config /home/worker/.config diff --git a/testing/docker/android-gradle-build/README.md b/taskcluster/docker/android-gradle-build/README.md similarity index 100% rename from testing/docker/android-gradle-build/README.md rename to taskcluster/docker/android-gradle-build/README.md diff --git a/testing/docker/android-gradle-build/REGISTRY b/taskcluster/docker/android-gradle-build/REGISTRY similarity index 100% rename from testing/docker/android-gradle-build/REGISTRY rename to taskcluster/docker/android-gradle-build/REGISTRY diff --git a/testing/docker/android-gradle-build/VERSION b/taskcluster/docker/android-gradle-build/VERSION similarity index 100% rename from testing/docker/android-gradle-build/VERSION rename to taskcluster/docker/android-gradle-build/VERSION diff --git a/testing/docker/android-gradle-build/bin/after.sh b/taskcluster/docker/android-gradle-build/bin/after.sh similarity index 100% rename from testing/docker/android-gradle-build/bin/after.sh rename to taskcluster/docker/android-gradle-build/bin/after.sh diff --git a/testing/docker/android-gradle-build/bin/before.sh b/taskcluster/docker/android-gradle-build/bin/before.sh similarity index 100% rename from testing/docker/android-gradle-build/bin/before.sh rename to taskcluster/docker/android-gradle-build/bin/before.sh diff --git a/testing/docker/android-gradle-build/bin/build.sh b/taskcluster/docker/android-gradle-build/bin/build.sh similarity index 100% rename from testing/docker/android-gradle-build/bin/build.sh rename to taskcluster/docker/android-gradle-build/bin/build.sh diff --git a/testing/docker/android-gradle-build/bin/checkout-script.sh b/taskcluster/docker/android-gradle-build/bin/checkout-script.sh similarity index 100% rename from testing/docker/android-gradle-build/bin/checkout-script.sh rename to taskcluster/docker/android-gradle-build/bin/checkout-script.sh diff --git a/testing/docker/android-gradle-build/bin/checkout-sources.sh b/taskcluster/docker/android-gradle-build/bin/checkout-sources.sh similarity index 100% rename from testing/docker/android-gradle-build/bin/checkout-sources.sh rename to taskcluster/docker/android-gradle-build/bin/checkout-sources.sh diff --git a/testing/docker/android-gradle-build/buildprops.json b/taskcluster/docker/android-gradle-build/buildprops.json similarity index 100% rename from testing/docker/android-gradle-build/buildprops.json rename to taskcluster/docker/android-gradle-build/buildprops.json diff --git a/testing/docker/android-gradle-build/dot-config/pip/pip.conf b/taskcluster/docker/android-gradle-build/dot-config/pip/pip.conf similarity index 100% rename from testing/docker/android-gradle-build/dot-config/pip/pip.conf rename to taskcluster/docker/android-gradle-build/dot-config/pip/pip.conf diff --git a/testing/docker/android-gradle-build/oauth.txt b/taskcluster/docker/android-gradle-build/oauth.txt similarity index 100% rename from testing/docker/android-gradle-build/oauth.txt rename to taskcluster/docker/android-gradle-build/oauth.txt diff --git a/testing/docker/base-build/Dockerfile b/taskcluster/docker/base-build/Dockerfile similarity index 100% rename from testing/docker/base-build/Dockerfile rename to taskcluster/docker/base-build/Dockerfile diff --git a/testing/docker/base-build/VERSION b/taskcluster/docker/base-build/VERSION similarity index 100% rename from testing/docker/base-build/VERSION rename to taskcluster/docker/base-build/VERSION diff --git a/testing/docker/base-build/system-setup.sh b/taskcluster/docker/base-build/system-setup.sh similarity index 100% rename from testing/docker/base-build/system-setup.sh rename to taskcluster/docker/base-build/system-setup.sh diff --git a/testing/docker/base-test/Dockerfile b/taskcluster/docker/base-test/Dockerfile similarity index 100% rename from testing/docker/base-test/Dockerfile rename to taskcluster/docker/base-test/Dockerfile diff --git a/testing/docker/base-test/REGISTRY b/taskcluster/docker/base-test/REGISTRY similarity index 100% rename from testing/docker/base-test/REGISTRY rename to taskcluster/docker/base-test/REGISTRY diff --git a/testing/docker/base-test/VERSION b/taskcluster/docker/base-test/VERSION similarity index 100% rename from testing/docker/base-test/VERSION rename to taskcluster/docker/base-test/VERSION diff --git a/testing/docker/base-test/sources.list b/taskcluster/docker/base-test/sources.list similarity index 100% rename from testing/docker/base-test/sources.list rename to taskcluster/docker/base-test/sources.list diff --git a/testing/docker/centos6-build-upd/Dockerfile b/taskcluster/docker/centos6-build-upd/Dockerfile similarity index 100% rename from testing/docker/centos6-build-upd/Dockerfile rename to taskcluster/docker/centos6-build-upd/Dockerfile diff --git a/testing/docker/centos6-build-upd/REGISTRY b/taskcluster/docker/centos6-build-upd/REGISTRY similarity index 100% rename from testing/docker/centos6-build-upd/REGISTRY rename to taskcluster/docker/centos6-build-upd/REGISTRY diff --git a/testing/docker/centos6-build-upd/VERSION b/taskcluster/docker/centos6-build-upd/VERSION similarity index 100% rename from testing/docker/centos6-build-upd/VERSION rename to taskcluster/docker/centos6-build-upd/VERSION diff --git a/testing/docker/centos6-build/Dockerfile b/taskcluster/docker/centos6-build/Dockerfile similarity index 100% rename from testing/docker/centos6-build/Dockerfile rename to taskcluster/docker/centos6-build/Dockerfile diff --git a/testing/docker/centos6-build/REGISTRY b/taskcluster/docker/centos6-build/REGISTRY similarity index 100% rename from testing/docker/centos6-build/REGISTRY rename to taskcluster/docker/centos6-build/REGISTRY diff --git a/testing/docker/centos6-build/VERSION b/taskcluster/docker/centos6-build/VERSION similarity index 100% rename from testing/docker/centos6-build/VERSION rename to taskcluster/docker/centos6-build/VERSION diff --git a/testing/docker/centos6-build/hgrc b/taskcluster/docker/centos6-build/hgrc similarity index 100% rename from testing/docker/centos6-build/hgrc rename to taskcluster/docker/centos6-build/hgrc diff --git a/testing/docker/centos6-build/system-setup.sh b/taskcluster/docker/centos6-build/system-setup.sh similarity index 100% rename from testing/docker/centos6-build/system-setup.sh rename to taskcluster/docker/centos6-build/system-setup.sh diff --git a/testing/docker/decision/Dockerfile b/taskcluster/docker/decision/Dockerfile similarity index 61% rename from testing/docker/decision/Dockerfile rename to taskcluster/docker/decision/Dockerfile index 3f58399fd69c..6226c1e70621 100644 --- a/testing/docker/decision/Dockerfile +++ b/taskcluster/docker/decision/Dockerfile @@ -5,20 +5,20 @@ MAINTAINER Greg Arndt RUN useradd -d /home/worker -s /bin/bash -m worker RUN mkdir /home/worker/artifacts && chown worker:worker /home/worker/artifacts -# %include testing/docker/recipes/tooltool.py -ADD topsrcdir/testing/docker/recipes/tooltool.py /tmp/tooltool.py +# %include taskcluster/docker/recipes/tooltool.py +ADD topsrcdir/taskcluster/docker/recipes/tooltool.py /tmp/tooltool.py # %include testing/mozharness/external_tools/robustcheckout.py ADD topsrcdir/testing/mozharness/external_tools/robustcheckout.py /usr/local/mercurial/robustcheckout.py -# %include testing/docker/recipes/install-mercurial.sh -ADD topsrcdir/testing/docker/recipes/install-mercurial.sh /tmp/install-mercurial.sh +# %include taskcluster/docker/recipes/install-mercurial.sh +ADD topsrcdir/taskcluster/docker/recipes/install-mercurial.sh /tmp/install-mercurial.sh ADD system-setup.sh /tmp/system-setup.sh RUN bash /tmp/system-setup.sh -# %include testing/docker/recipes/run-task -ADD topsrcdir/testing/docker/recipes/run-task /home/worker/bin/run-task +# %include taskcluster/docker/recipes/run-task +ADD topsrcdir/taskcluster/docker/recipes/run-task /home/worker/bin/run-task ENV PATH /home/worker/bin:$PATH ENV SHELL /bin/bash diff --git a/testing/docker/decision/README.md b/taskcluster/docker/decision/README.md similarity index 100% rename from testing/docker/decision/README.md rename to taskcluster/docker/decision/README.md diff --git a/testing/docker/decision/REGISTRY b/taskcluster/docker/decision/REGISTRY similarity index 100% rename from testing/docker/decision/REGISTRY rename to taskcluster/docker/decision/REGISTRY diff --git a/testing/docker/decision/VERSION b/taskcluster/docker/decision/VERSION similarity index 100% rename from testing/docker/decision/VERSION rename to taskcluster/docker/decision/VERSION diff --git a/testing/docker/decision/system-setup.sh b/taskcluster/docker/decision/system-setup.sh similarity index 100% rename from testing/docker/decision/system-setup.sh rename to taskcluster/docker/decision/system-setup.sh diff --git a/testing/docker/desktop-build/Dockerfile b/taskcluster/docker/desktop-build/Dockerfile similarity index 68% rename from testing/docker/desktop-build/Dockerfile rename to taskcluster/docker/desktop-build/Dockerfile index 4ccb4c9856a9..3bbd0f40b4cd 100644 --- a/testing/docker/desktop-build/Dockerfile +++ b/taskcluster/docker/desktop-build/Dockerfile @@ -11,21 +11,21 @@ VOLUME /home/worker/tooltool-cache ADD bin /home/worker/bin RUN chmod +x /home/worker/bin/* -# %include testing/docker/recipes/tooltool.py -ADD topsrcdir/testing/docker/recipes/tooltool.py /builds/tooltool.py -ADD topsrcdir/testing/docker/recipes/tooltool.py /setup/tooltool.py +# %include taskcluster/docker/recipes/tooltool.py +ADD topsrcdir/taskcluster/docker/recipes/tooltool.py /builds/tooltool.py +ADD topsrcdir/taskcluster/docker/recipes/tooltool.py /setup/tooltool.py # %include testing/mozharness/external_tools/robustcheckout.py ADD topsrcdir/testing/mozharness/external_tools/robustcheckout.py /usr/local/mercurial/robustcheckout.py -# %include testing/docker/recipes/common.sh -ADD topsrcdir/testing/docker/recipes/common.sh /setup/common.sh +# %include taskcluster/docker/recipes/common.sh +ADD topsrcdir/taskcluster/docker/recipes/common.sh /setup/common.sh -# %include testing/docker/recipes/install-mercurial.sh -ADD topsrcdir/testing/docker/recipes/install-mercurial.sh /setup/install-mercurial.sh +# %include taskcluster/docker/recipes/install-mercurial.sh +ADD topsrcdir/taskcluster/docker/recipes/install-mercurial.sh /setup/install-mercurial.sh -# %include testing/docker/recipes/centos6-build-system-setup.sh -ADD topsrcdir/testing/docker/recipes/centos6-build-system-setup.sh /setup/system-setup.sh +# %include taskcluster/docker/recipes/centos6-build-system-setup.sh +ADD topsrcdir/taskcluster/docker/recipes/centos6-build-system-setup.sh /setup/system-setup.sh # TODO remove once base image doesn't install Mercurial RUN pip uninstall -y Mercurial @@ -33,11 +33,11 @@ RUN pip uninstall -y Mercurial RUN bash /setup/system-setup.sh # Add wrapper scripts for xvfb allowing tasks to easily retry starting up xvfb -# %include testing/docker/recipes/xvfb.sh -ADD topsrcdir/testing/docker/recipes/xvfb.sh /home/worker/scripts/xvfb.sh +# %include taskcluster/docker/recipes/xvfb.sh +ADD topsrcdir/taskcluster/docker/recipes/xvfb.sh /home/worker/scripts/xvfb.sh -# %include testing/docker/recipes/run-task -ADD topsrcdir/testing/docker/recipes/run-task /home/worker/bin/run-task +# %include taskcluster/docker/recipes/run-task +ADD topsrcdir/taskcluster/docker/recipes/run-task /home/worker/bin/run-task # Add configuration COPY dot-config /home/worker/.config diff --git a/testing/docker/desktop-build/bin/build.sh b/taskcluster/docker/desktop-build/bin/build.sh similarity index 100% rename from testing/docker/desktop-build/bin/build.sh rename to taskcluster/docker/desktop-build/bin/build.sh diff --git a/testing/docker/desktop-build/bin/checkout-script.sh b/taskcluster/docker/desktop-build/bin/checkout-script.sh similarity index 100% rename from testing/docker/desktop-build/bin/checkout-script.sh rename to taskcluster/docker/desktop-build/bin/checkout-script.sh diff --git a/testing/docker/desktop-build/bin/checkout-sources.sh b/taskcluster/docker/desktop-build/bin/checkout-sources.sh similarity index 100% rename from testing/docker/desktop-build/bin/checkout-sources.sh rename to taskcluster/docker/desktop-build/bin/checkout-sources.sh diff --git a/testing/docker/desktop-build/buildprops.json b/taskcluster/docker/desktop-build/buildprops.json similarity index 100% rename from testing/docker/desktop-build/buildprops.json rename to taskcluster/docker/desktop-build/buildprops.json diff --git a/testing/docker/desktop-build/dot-config/pip/pip.conf b/taskcluster/docker/desktop-build/dot-config/pip/pip.conf similarity index 100% rename from testing/docker/desktop-build/dot-config/pip/pip.conf rename to taskcluster/docker/desktop-build/dot-config/pip/pip.conf diff --git a/testing/docker/desktop-build/oauth.txt b/taskcluster/docker/desktop-build/oauth.txt similarity index 100% rename from testing/docker/desktop-build/oauth.txt rename to taskcluster/docker/desktop-build/oauth.txt diff --git a/testing/docker/desktop-test/Dockerfile b/taskcluster/docker/desktop-test/Dockerfile similarity index 83% rename from testing/docker/desktop-test/Dockerfile rename to taskcluster/docker/desktop-test/Dockerfile index 995ff34df523..97bccd75db85 100644 --- a/testing/docker/desktop-test/Dockerfile +++ b/taskcluster/docker/desktop-test/Dockerfile @@ -4,29 +4,29 @@ MAINTAINER Jonas Finnemann Jensen RUN useradd -d /home/worker -s /bin/bash -m worker WORKDIR /home/worker -# %include testing/docker/recipes/tooltool.py -ADD topsrcdir/testing/docker/recipes/tooltool.py /setup/tooltool.py +# %include taskcluster/docker/recipes/tooltool.py +ADD topsrcdir/taskcluster/docker/recipes/tooltool.py /setup/tooltool.py # %include testing/mozharness/external_tools/robustcheckout.py ADD topsrcdir/testing/mozharness/external_tools/robustcheckout.py /usr/local/mercurial/robustcheckout.py -# %include testing/docker/recipes/install-mercurial.sh -ADD topsrcdir/testing/docker/recipes/install-mercurial.sh /tmp/install-mercurial.sh +# %include taskcluster/docker/recipes/install-mercurial.sh +ADD topsrcdir/taskcluster/docker/recipes/install-mercurial.sh /tmp/install-mercurial.sh # Add wrapper scripts for xvfb allowing tasks to easily retry starting up xvfb -# %include testing/docker/recipes/xvfb.sh -ADD topsrcdir/testing/docker/recipes/xvfb.sh /home/worker/scripts/xvfb.sh +# %include taskcluster/docker/recipes/xvfb.sh +ADD topsrcdir/taskcluster/docker/recipes/xvfb.sh /home/worker/scripts/xvfb.sh # Add the tooltool manifest containing the minidump_stackwalk binary. # %include testing/config/tooltool-manifests/linux64/releng.manifest ADD topsrcdir/testing/config/tooltool-manifests/linux64/releng.manifest /tmp/minidump_stackwalk.manifest -# %include testing/docker/recipes/ubuntu1204-test-system-setup.sh -ADD topsrcdir/testing/docker/recipes/ubuntu1204-test-system-setup.sh /setup/system-setup.sh +# %include taskcluster/docker/recipes/ubuntu1204-test-system-setup.sh +ADD topsrcdir/taskcluster/docker/recipes/ubuntu1204-test-system-setup.sh /setup/system-setup.sh RUN bash /setup/system-setup.sh -# %include testing/docker/recipes/run-task -ADD topsrcdir/testing/docker/recipes/run-task /home/worker/bin/run-task +# %include taskcluster/docker/recipes/run-task +ADD topsrcdir/taskcluster/docker/recipes/run-task /home/worker/bin/run-task # %include taskcluster/scripts/tester/test-ubuntu.sh ADD topsrcdir/taskcluster/scripts/tester/test-ubuntu.sh /home/worker/bin/test-linux.sh diff --git a/testing/docker/desktop-test/apport b/taskcluster/docker/desktop-test/apport similarity index 100% rename from testing/docker/desktop-test/apport rename to taskcluster/docker/desktop-test/apport diff --git a/testing/docker/desktop-test/buildprops.json b/taskcluster/docker/desktop-test/buildprops.json similarity index 100% rename from testing/docker/desktop-test/buildprops.json rename to taskcluster/docker/desktop-test/buildprops.json diff --git a/testing/docker/desktop-test/deja-dup-monitor.desktop b/taskcluster/docker/desktop-test/deja-dup-monitor.desktop similarity index 100% rename from testing/docker/desktop-test/deja-dup-monitor.desktop rename to taskcluster/docker/desktop-test/deja-dup-monitor.desktop diff --git a/testing/docker/desktop-test/dot-files/config/pip/pip.conf b/taskcluster/docker/desktop-test/dot-files/config/pip/pip.conf similarity index 100% rename from testing/docker/desktop-test/dot-files/config/pip/pip.conf rename to taskcluster/docker/desktop-test/dot-files/config/pip/pip.conf diff --git a/testing/docker/desktop-test/dot-files/config/user-dirs.dirs b/taskcluster/docker/desktop-test/dot-files/config/user-dirs.dirs similarity index 100% rename from testing/docker/desktop-test/dot-files/config/user-dirs.dirs rename to taskcluster/docker/desktop-test/dot-files/config/user-dirs.dirs diff --git a/testing/docker/desktop-test/dot-files/config/user-dirs.locale b/taskcluster/docker/desktop-test/dot-files/config/user-dirs.locale similarity index 100% rename from testing/docker/desktop-test/dot-files/config/user-dirs.locale rename to taskcluster/docker/desktop-test/dot-files/config/user-dirs.locale diff --git a/testing/docker/desktop-test/dot-files/pulse/default.pa b/taskcluster/docker/desktop-test/dot-files/pulse/default.pa similarity index 100% rename from testing/docker/desktop-test/dot-files/pulse/default.pa rename to taskcluster/docker/desktop-test/dot-files/pulse/default.pa diff --git a/testing/docker/desktop-test/fonts.conf b/taskcluster/docker/desktop-test/fonts.conf similarity index 100% rename from testing/docker/desktop-test/fonts.conf rename to taskcluster/docker/desktop-test/fonts.conf diff --git a/testing/docker/desktop-test/jockey-gtk.desktop b/taskcluster/docker/desktop-test/jockey-gtk.desktop similarity index 100% rename from testing/docker/desktop-test/jockey-gtk.desktop rename to taskcluster/docker/desktop-test/jockey-gtk.desktop diff --git a/testing/docker/desktop-test/motd b/taskcluster/docker/desktop-test/motd similarity index 100% rename from testing/docker/desktop-test/motd rename to taskcluster/docker/desktop-test/motd diff --git a/testing/docker/desktop-test/release-upgrades b/taskcluster/docker/desktop-test/release-upgrades similarity index 100% rename from testing/docker/desktop-test/release-upgrades rename to taskcluster/docker/desktop-test/release-upgrades diff --git a/testing/docker/desktop-test/taskcluster-interactive-shell b/taskcluster/docker/desktop-test/taskcluster-interactive-shell similarity index 100% rename from testing/docker/desktop-test/taskcluster-interactive-shell rename to taskcluster/docker/desktop-test/taskcluster-interactive-shell diff --git a/testing/docker/desktop-test/tc-vcs-config.yml b/taskcluster/docker/desktop-test/tc-vcs-config.yml similarity index 100% rename from testing/docker/desktop-test/tc-vcs-config.yml rename to taskcluster/docker/desktop-test/tc-vcs-config.yml diff --git a/testing/docker/desktop-test/tester.env b/taskcluster/docker/desktop-test/tester.env similarity index 100% rename from testing/docker/desktop-test/tester.env rename to taskcluster/docker/desktop-test/tester.env diff --git a/testing/docker/desktop1604-test/Dockerfile b/taskcluster/docker/desktop1604-test/Dockerfile similarity index 81% rename from testing/docker/desktop1604-test/Dockerfile rename to taskcluster/docker/desktop1604-test/Dockerfile index 3690beaea46d..a2f67edf8735 100644 --- a/testing/docker/desktop1604-test/Dockerfile +++ b/taskcluster/docker/desktop1604-test/Dockerfile @@ -4,32 +4,32 @@ MAINTAINER Joel Maher RUN useradd -d /home/worker -s /bin/bash -m worker WORKDIR /home/worker -# %include testing/docker/recipes/tooltool.py -ADD topsrcdir/testing/docker/recipes/tooltool.py /setup/tooltool.py +# %include taskcluster/docker/recipes/tooltool.py +ADD topsrcdir/taskcluster/docker/recipes/tooltool.py /setup/tooltool.py # %include testing/mozharness/external_tools/robustcheckout.py ADD topsrcdir/testing/mozharness/external_tools/robustcheckout.py /usr/local/mercurial/robustcheckout.py -# %include testing/docker/recipes/common.sh -ADD topsrcdir/testing/docker/recipes/common.sh /setup/common.sh +# %include taskcluster/docker/recipes/common.sh +ADD topsrcdir/taskcluster/docker/recipes/common.sh /setup/common.sh -# %include testing/docker/recipes/install-mercurial.sh -ADD topsrcdir/testing/docker/recipes/install-mercurial.sh /setup/install-mercurial.sh +# %include taskcluster/docker/recipes/install-mercurial.sh +ADD topsrcdir/taskcluster/docker/recipes/install-mercurial.sh /setup/install-mercurial.sh # Add the tooltool manifest containing the minidump_stackwalk binary. # %include testing/config/tooltool-manifests/linux64/releng.manifest ADD topsrcdir/testing/config/tooltool-manifests/linux64/releng.manifest /tmp/minidump_stackwalk.manifest -# %include testing/docker/recipes/ubuntu1604-test-system-setup.sh -ADD topsrcdir/testing/docker/recipes/ubuntu1604-test-system-setup.sh /setup/system-setup.sh +# %include taskcluster/docker/recipes/ubuntu1604-test-system-setup.sh +ADD topsrcdir/taskcluster/docker/recipes/ubuntu1604-test-system-setup.sh /setup/system-setup.sh RUN bash /setup/system-setup.sh # Add wrapper scripts for xvfb allowing tasks to easily retry starting up xvfb -# %include testing/docker/recipes/xvfb.sh -ADD topsrcdir/testing/docker/recipes/xvfb.sh /home/worker/scripts/xvfb.sh +# %include taskcluster/docker/recipes/xvfb.sh +ADD topsrcdir/taskcluster/docker/recipes/xvfb.sh /home/worker/scripts/xvfb.sh -# %include testing/docker/recipes/run-task -ADD topsrcdir/testing/docker/recipes/run-task /home/worker/bin/run-task +# %include taskcluster/docker/recipes/run-task +ADD topsrcdir/taskcluster/docker/recipes/run-task /home/worker/bin/run-task # %include taskcluster/scripts/tester/test-ubuntu.sh ADD topsrcdir/taskcluster/scripts/tester/test-ubuntu.sh /home/worker/bin/test-linux.sh diff --git a/testing/docker/desktop1604-test/apport b/taskcluster/docker/desktop1604-test/apport similarity index 100% rename from testing/docker/desktop1604-test/apport rename to taskcluster/docker/desktop1604-test/apport diff --git a/testing/docker/desktop1604-test/buildprops.json b/taskcluster/docker/desktop1604-test/buildprops.json similarity index 100% rename from testing/docker/desktop1604-test/buildprops.json rename to taskcluster/docker/desktop1604-test/buildprops.json diff --git a/testing/docker/desktop1604-test/deja-dup-monitor.desktop b/taskcluster/docker/desktop1604-test/deja-dup-monitor.desktop similarity index 100% rename from testing/docker/desktop1604-test/deja-dup-monitor.desktop rename to taskcluster/docker/desktop1604-test/deja-dup-monitor.desktop diff --git a/testing/docker/desktop1604-test/dot-files/config/pip/pip.conf b/taskcluster/docker/desktop1604-test/dot-files/config/pip/pip.conf similarity index 100% rename from testing/docker/desktop1604-test/dot-files/config/pip/pip.conf rename to taskcluster/docker/desktop1604-test/dot-files/config/pip/pip.conf diff --git a/testing/docker/desktop1604-test/dot-files/config/user-dirs.dirs b/taskcluster/docker/desktop1604-test/dot-files/config/user-dirs.dirs similarity index 100% rename from testing/docker/desktop1604-test/dot-files/config/user-dirs.dirs rename to taskcluster/docker/desktop1604-test/dot-files/config/user-dirs.dirs diff --git a/testing/docker/desktop1604-test/dot-files/config/user-dirs.locale b/taskcluster/docker/desktop1604-test/dot-files/config/user-dirs.locale similarity index 100% rename from testing/docker/desktop1604-test/dot-files/config/user-dirs.locale rename to taskcluster/docker/desktop1604-test/dot-files/config/user-dirs.locale diff --git a/testing/docker/desktop1604-test/dot-files/pulse/default.pa b/taskcluster/docker/desktop1604-test/dot-files/pulse/default.pa similarity index 100% rename from testing/docker/desktop1604-test/dot-files/pulse/default.pa rename to taskcluster/docker/desktop1604-test/dot-files/pulse/default.pa diff --git a/testing/docker/desktop1604-test/fonts.conf b/taskcluster/docker/desktop1604-test/fonts.conf similarity index 100% rename from testing/docker/desktop1604-test/fonts.conf rename to taskcluster/docker/desktop1604-test/fonts.conf diff --git a/testing/docker/desktop1604-test/jockey-gtk.desktop b/taskcluster/docker/desktop1604-test/jockey-gtk.desktop similarity index 100% rename from testing/docker/desktop1604-test/jockey-gtk.desktop rename to taskcluster/docker/desktop1604-test/jockey-gtk.desktop diff --git a/testing/docker/desktop1604-test/motd b/taskcluster/docker/desktop1604-test/motd similarity index 100% rename from testing/docker/desktop1604-test/motd rename to taskcluster/docker/desktop1604-test/motd diff --git a/testing/docker/desktop1604-test/release-upgrades b/taskcluster/docker/desktop1604-test/release-upgrades similarity index 100% rename from testing/docker/desktop1604-test/release-upgrades rename to taskcluster/docker/desktop1604-test/release-upgrades diff --git a/testing/docker/desktop1604-test/taskcluster-interactive-shell b/taskcluster/docker/desktop1604-test/taskcluster-interactive-shell similarity index 100% rename from testing/docker/desktop1604-test/taskcluster-interactive-shell rename to taskcluster/docker/desktop1604-test/taskcluster-interactive-shell diff --git a/testing/docker/desktop1604-test/tc-vcs-config.yml b/taskcluster/docker/desktop1604-test/tc-vcs-config.yml similarity index 100% rename from testing/docker/desktop1604-test/tc-vcs-config.yml rename to taskcluster/docker/desktop1604-test/tc-vcs-config.yml diff --git a/testing/docker/desktop1604-test/tester.env b/taskcluster/docker/desktop1604-test/tester.env similarity index 100% rename from testing/docker/desktop1604-test/tester.env rename to taskcluster/docker/desktop1604-test/tester.env diff --git a/testing/docker/image_builder/Dockerfile b/taskcluster/docker/image_builder/Dockerfile similarity index 51% rename from testing/docker/image_builder/Dockerfile rename to taskcluster/docker/image_builder/Dockerfile index 9acbafaab7eb..41c718c8c188 100644 --- a/testing/docker/image_builder/Dockerfile +++ b/taskcluster/docker/image_builder/Dockerfile @@ -1,19 +1,19 @@ FROM ubuntu:16.04 -# %include testing/docker/recipes/tooltool.py -ADD topsrcdir/testing/docker/recipes/tooltool.py /setup/tooltool.py +# %include taskcluster/docker/recipes/tooltool.py +ADD topsrcdir/taskcluster/docker/recipes/tooltool.py /setup/tooltool.py -# %include testing/docker/recipes/common.sh -ADD topsrcdir/testing/docker/recipes/common.sh /setup/common.sh +# %include taskcluster/docker/recipes/common.sh +ADD topsrcdir/taskcluster/docker/recipes/common.sh /setup/common.sh -# %include testing/docker/recipes/install-mercurial.sh -ADD topsrcdir/testing/docker/recipes/install-mercurial.sh /setup/install-mercurial.sh +# %include taskcluster/docker/recipes/install-mercurial.sh +ADD topsrcdir/taskcluster/docker/recipes/install-mercurial.sh /setup/install-mercurial.sh -# %include testing/mozharness/external_tools/robustcheckout.py -ADD topsrcdir/testing/mozharness/external_tools/robustcheckout.py /usr/local/mercurial/robustcheckout.py +# %include taskcluster/mozharness/external_tools/robustcheckout.py +ADD topsrcdir/taskcluster/mozharness/external_tools/robustcheckout.py /usr/local/mercurial/robustcheckout.py -# %include testing/docker/recipes/run-task -ADD topsrcdir/testing/docker/recipes/run-task /usr/local/bin/run-task +# %include taskcluster/docker/recipes/run-task +ADD topsrcdir/taskcluster/docker/recipes/run-task /usr/local/bin/run-task # Add and run setup script ADD build-image.sh /usr/local/bin/build-image.sh diff --git a/testing/docker/image_builder/REGISTRY b/taskcluster/docker/image_builder/REGISTRY similarity index 100% rename from testing/docker/image_builder/REGISTRY rename to taskcluster/docker/image_builder/REGISTRY diff --git a/testing/docker/image_builder/VERSION b/taskcluster/docker/image_builder/VERSION similarity index 100% rename from testing/docker/image_builder/VERSION rename to taskcluster/docker/image_builder/VERSION diff --git a/testing/docker/image_builder/build-image.sh b/taskcluster/docker/image_builder/build-image.sh similarity index 100% rename from testing/docker/image_builder/build-image.sh rename to taskcluster/docker/image_builder/build-image.sh diff --git a/testing/docker/image_builder/setup.sh b/taskcluster/docker/image_builder/setup.sh similarity index 100% rename from testing/docker/image_builder/setup.sh rename to taskcluster/docker/image_builder/setup.sh diff --git a/testing/docker/lint/Dockerfile b/taskcluster/docker/lint/Dockerfile similarity index 73% rename from testing/docker/lint/Dockerfile rename to taskcluster/docker/lint/Dockerfile index 7e9b41214cf0..cd625d6a340f 100644 --- a/testing/docker/lint/Dockerfile +++ b/taskcluster/docker/lint/Dockerfile @@ -5,21 +5,21 @@ RUN useradd -d /home/worker -s /bin/bash -m worker WORKDIR /home/worker RUN mkdir /build -# %include testing/docker/recipes/tooltool.py -ADD topsrcdir/testing/docker/recipes/tooltool.py /build/tooltool.py +# %include taskcluster/docker/recipes/tooltool.py +ADD topsrcdir/taskcluster/docker/recipes/tooltool.py /build/tooltool.py # %include testing/mozharness/external_tools/robustcheckout.py ADD topsrcdir/testing/mozharness/external_tools/robustcheckout.py /usr/local/mercurial/robustcheckout.py -# %include testing/docker/recipes/install-mercurial.sh -ADD topsrcdir/testing/docker/recipes/install-mercurial.sh /build/install-mercurial.sh +# %include taskcluster/docker/recipes/install-mercurial.sh +ADD topsrcdir/taskcluster/docker/recipes/install-mercurial.sh /build/install-mercurial.sh ADD system-setup.sh /tmp/system-setup.sh # %include tools/lint/flake8/flake8_requirements.txt ADD topsrcdir/tools/lint/flake8/flake8_requirements.txt /tmp/flake8_requirements.txt RUN bash /tmp/system-setup.sh -# %include testing/docker/recipes/run-task -ADD topsrcdir/testing/docker/recipes/run-task /home/worker/bin/run-task +# %include taskcluster/docker/recipes/run-task +ADD topsrcdir/taskcluster/docker/recipes/run-task /home/worker/bin/run-task RUN chown -R worker:worker /home/worker/bin && chmod 755 /home/worker/bin/* # Set variable normally configured at login, by the shells parent process, these diff --git a/testing/docker/lint/system-setup.sh b/taskcluster/docker/lint/system-setup.sh similarity index 100% rename from testing/docker/lint/system-setup.sh rename to taskcluster/docker/lint/system-setup.sh diff --git a/testing/docker/recipes/centos6-build-system-setup.sh b/taskcluster/docker/recipes/centos6-build-system-setup.sh similarity index 100% rename from testing/docker/recipes/centos6-build-system-setup.sh rename to taskcluster/docker/recipes/centos6-build-system-setup.sh diff --git a/testing/docker/recipes/common.sh b/taskcluster/docker/recipes/common.sh similarity index 100% rename from testing/docker/recipes/common.sh rename to taskcluster/docker/recipes/common.sh diff --git a/testing/docker/recipes/install-mercurial.sh b/taskcluster/docker/recipes/install-mercurial.sh similarity index 100% rename from testing/docker/recipes/install-mercurial.sh rename to taskcluster/docker/recipes/install-mercurial.sh diff --git a/testing/docker/recipes/run-task b/taskcluster/docker/recipes/run-task similarity index 100% rename from testing/docker/recipes/run-task rename to taskcluster/docker/recipes/run-task diff --git a/testing/docker/recipes/tooltool.py b/taskcluster/docker/recipes/tooltool.py similarity index 100% rename from testing/docker/recipes/tooltool.py rename to taskcluster/docker/recipes/tooltool.py diff --git a/testing/docker/recipes/ubuntu1204-test-system-setup.sh b/taskcluster/docker/recipes/ubuntu1204-test-system-setup.sh similarity index 100% rename from testing/docker/recipes/ubuntu1204-test-system-setup.sh rename to taskcluster/docker/recipes/ubuntu1204-test-system-setup.sh diff --git a/testing/docker/recipes/ubuntu1604-test-system-setup.sh b/taskcluster/docker/recipes/ubuntu1604-test-system-setup.sh similarity index 100% rename from testing/docker/recipes/ubuntu1604-test-system-setup.sh rename to taskcluster/docker/recipes/ubuntu1604-test-system-setup.sh diff --git a/testing/docker/recipes/xvfb.sh b/taskcluster/docker/recipes/xvfb.sh similarity index 100% rename from testing/docker/recipes/xvfb.sh rename to taskcluster/docker/recipes/xvfb.sh diff --git a/testing/docker/rust-build/Dockerfile b/taskcluster/docker/rust-build/Dockerfile similarity index 100% rename from testing/docker/rust-build/Dockerfile rename to taskcluster/docker/rust-build/Dockerfile diff --git a/testing/docker/rust-build/README.md b/taskcluster/docker/rust-build/README.md similarity index 100% rename from testing/docker/rust-build/README.md rename to taskcluster/docker/rust-build/README.md diff --git a/testing/docker/rust-build/REGISTRY b/taskcluster/docker/rust-build/REGISTRY similarity index 100% rename from testing/docker/rust-build/REGISTRY rename to taskcluster/docker/rust-build/REGISTRY diff --git a/testing/docker/rust-build/VERSION b/taskcluster/docker/rust-build/VERSION similarity index 100% rename from testing/docker/rust-build/VERSION rename to taskcluster/docker/rust-build/VERSION diff --git a/testing/docker/rust-build/build_cargo.sh b/taskcluster/docker/rust-build/build_cargo.sh similarity index 100% rename from testing/docker/rust-build/build_cargo.sh rename to taskcluster/docker/rust-build/build_cargo.sh diff --git a/testing/docker/rust-build/build_rust.sh b/taskcluster/docker/rust-build/build_rust.sh similarity index 100% rename from testing/docker/rust-build/build_rust.sh rename to taskcluster/docker/rust-build/build_rust.sh diff --git a/testing/docker/rust-build/build_rust_mac.sh b/taskcluster/docker/rust-build/build_rust_mac.sh similarity index 100% rename from testing/docker/rust-build/build_rust_mac.sh rename to taskcluster/docker/rust-build/build_rust_mac.sh diff --git a/testing/docker/rust-build/fetch_cargo.sh b/taskcluster/docker/rust-build/fetch_cargo.sh similarity index 100% rename from testing/docker/rust-build/fetch_cargo.sh rename to taskcluster/docker/rust-build/fetch_cargo.sh diff --git a/testing/docker/rust-build/fetch_rust.sh b/taskcluster/docker/rust-build/fetch_rust.sh similarity index 100% rename from testing/docker/rust-build/fetch_rust.sh rename to taskcluster/docker/rust-build/fetch_rust.sh diff --git a/testing/docker/rust-build/package_rust.sh b/taskcluster/docker/rust-build/package_rust.sh similarity index 100% rename from testing/docker/rust-build/package_rust.sh rename to taskcluster/docker/rust-build/package_rust.sh diff --git a/taskcluster/docker/rust-build/repack_rust.py b/taskcluster/docker/rust-build/repack_rust.py new file mode 100644 index 000000000000..4a7b61a7c53d --- /dev/null +++ b/taskcluster/docker/rust-build/repack_rust.py @@ -0,0 +1,187 @@ +#!/bin/env python +''' +This script downloads and repacks official rust language builds +with the necessary tool and target support for the Firefox +build environment. +''' + +import os.path +import requests +import subprocess +import toml + + +def fetch_file(url): + '''Download a file from the given url if it's not already present.''' + filename = os.path.basename(url) + if os.path.exists(filename): + return + r = requests.get(url, stream=True) + r.raise_for_status() + with open(filename, 'wb') as fd: + for chunk in r.iter_content(4096): + fd.write(chunk) + + +def fetch(url): + '''Download and verify a package url.''' + base = os.path.basename(url) + print('Fetching %s...' % base) + fetch_file(url + '.asc') + fetch_file(url) + fetch_file(url + '.sha256') + fetch_file(url + '.asc.sha256') + print('Verifying %s...' % base) + subprocess.check_call(['shasum', '-c', base + '.sha256']) + subprocess.check_call(['shasum', '-c', base + '.asc.sha256']) + subprocess.check_call(['gpg', '--verify', base + '.asc', base]) + if False: + subprocess.check_call([ + 'keybase', 'pgp', 'verify', '-d', base + '.asc', ' -i', base, + ]) + + +def install(filename, target): + '''Run a package's installer script against the given target directory.''' + print(' Unpacking %s...' % filename) + subprocess.check_call(['tar', 'xf', filename]) + basename = filename.split('.tar')[0] + print(' Installing %s...' % basename) + install_cmd = [os.path.join(basename, 'install.sh')] + install_cmd += ['--prefix=' + os.path.abspath(target)] + install_cmd += ['--disable-ldconfig'] + subprocess.check_call(install_cmd) + print(' Cleaning %s...' % basename) + subprocess.check_call(['rm', '-rf', basename]) + + +def package(manifest, pkg, target): + '''Pull out the package dict for a particular package and target + from the given manifest.''' + version = manifest['pkg'][pkg]['version'] + info = manifest['pkg'][pkg]['target'][target] + return (version, info) + + +def fetch_package(manifest, pkg, host): + version, info = package(manifest, pkg, host) + print('%s %s\n %s\n %s' % (pkg, version, info['url'], info['hash'])) + if not info['available']: + print('%s marked unavailable for %s' % (pkg, host)) + raise AssertionError + fetch(info['url']) + return info + + +def fetch_std(manifest, targets): + stds = [] + for target in targets: + info = fetch_package(manifest, 'rust-std', target) + stds.append(info) + return stds + + +def tar_for_host(host): + if 'linux' in host: + tar_options = 'cJf' + tar_ext = '.tar.xz' + else: + tar_options = 'cjf' + tar_ext = '.tar.bz2' + return tar_options, tar_ext + + +def repack(host, targets, channel='stable', suffix=''): + print("Repacking rust for %s..." % host) + url = 'https://static.rust-lang.org/dist/channel-rust-' + channel + '.toml' + req = requests.get(url) + req.raise_for_status() + manifest = toml.loads(req.content) + if manifest['manifest-version'] != '2': + print('ERROR: unrecognized manifest version %s.' % manifest[ + 'manifest-version']) + return + print('Using manifest for rust %s as of %s.' % (channel, manifest['date'])) + print('Fetching packages...') + rustc = fetch_package(manifest, 'rustc', host) + cargo = fetch_package(manifest, 'cargo', host) + stds = fetch_std(manifest, targets) + print('Installing packages...') + tar_basename = 'rustc-' + host + if suffix: + tar_basename += '-' + suffix + tar_basename += '-repack' + install_dir = 'rustc' + subprocess.check_call(['rm', '-rf', install_dir]) + install(os.path.basename(rustc['url']), install_dir) + install(os.path.basename(cargo['url']), install_dir) + for std in stds: + install(os.path.basename(std['url']), install_dir) + pass + print('Tarring %s...' % tar_basename) + tar_options, tar_ext = tar_for_host(host) + subprocess.check_call( + ['tar', tar_options, tar_basename + tar_ext, install_dir]) + subprocess.check_call(['rm', '-rf', install_dir]) + + +def repack_cargo(host, channel='nightly'): + print("Repacking cargo for %s..." % host) + # Cargo doesn't seem to have a .toml manifest. + base_url = 'https://static.rust-lang.org/cargo-dist/' + req = requests.get(os.path.join(base_url, 'channel-cargo-' + channel)) + req.raise_for_status() + file = '' + for line in req.iter_lines(): + if line.find(host) != -1: + file = line.strip() + if not file: + print('No manifest entry for %s!' % host) + return + manifest = { + 'date': req.headers['Last-Modified'], + 'pkg': { + 'cargo': { + 'version': channel, + 'target': { + host: { + 'url': os.path.join(base_url, file), + 'hash': None, + 'available': True, + }, + }, + }, + }, + } + print('Using manifest for cargo %s.' % channel) + print('Fetching packages...') + cargo = fetch_package(manifest, 'cargo', host) + print('Installing packages...') + install_dir = 'cargo' + subprocess.check_call(['rm', '-rf', install_dir]) + install(os.path.basename(cargo['url']), install_dir) + tar_basename = 'cargo-%s-repack' % host + print('Tarring %s...' % tar_basename) + tar_options, tar_ext = tar_for_host(host) + subprocess.check_call( + ['tar', tar_options, tar_basename + tar_ext, install_dir]) + subprocess.check_call(['rm', '-rf', install_dir]) + + +# rust platform triples +android = "armv7-linux-androideabi" +android_x86 = "i686-linux-android" +linux64 = "x86_64-unknown-linux-gnu" +linux32 = "i686-unknown-linux-gnu" +mac64 = "x86_64-apple-darwin" +mac32 = "i686-apple-darwin" +win64 = "x86_64-pc-windows-msvc" +win32 = "i686-pc-windows-msvc" + +if __name__ == '__main__': + repack(mac64, [mac64, mac32]) + repack(win32, [win32]) + repack(win64, [win64]) + repack(linux64, [linux64, linux32]) + repack(linux64, [linux64, mac64, mac32], suffix='mac-cross') + repack(linux64, [linux64, android, android_x86], suffix='android-cross') diff --git a/testing/docker/rust-build/splat_rust.py b/taskcluster/docker/rust-build/splat_rust.py similarity index 95% rename from testing/docker/rust-build/splat_rust.py rename to taskcluster/docker/rust-build/splat_rust.py index 860ed347cb9b..34032b5883d3 100644 --- a/testing/docker/rust-build/splat_rust.py +++ b/taskcluster/docker/rust-build/splat_rust.py @@ -10,17 +10,20 @@ import sys from collections import OrderedDict + def load_manifest(path): with open(path) as f: return json.load(f, object_pairs_hook=OrderedDict) return None + def save_manifest(manifest, path): with open(path, 'w') as f: json.dump(manifest, f, - indent=0, separators=(',', ': ')) + indent=0, separators=(',', ': ')) f.write('\n') + def replace(manifest, stanza): key = 'rustc' version = stanza.get('version') @@ -34,9 +37,10 @@ def replace(manifest, stanza): s['size'] = stanza['size'] print(' new %s' % s['digest'][:12]) return True - print('Warning: Could not find matching %s filename' %key) + print('Warning: Could not find matching %s filename' % key) return False + def update_manifest(source_manifest, target, target_filename): for stanza in source_manifest: filename = stanza.get('filename') @@ -99,4 +103,4 @@ if __name__ == '__main__': for target, filenames in TARGETS.items(): for target_filename in filenames: update_manifest(updates, target, - os.path.join(base_path, target_filename)) + os.path.join(base_path, target_filename)) diff --git a/testing/docker/rust-build/task.json b/taskcluster/docker/rust-build/task.json similarity index 100% rename from testing/docker/rust-build/task.json rename to taskcluster/docker/rust-build/task.json diff --git a/testing/docker/rust-build/tcbuild.py b/taskcluster/docker/rust-build/tcbuild.py similarity index 85% rename from testing/docker/rust-build/tcbuild.py rename to taskcluster/docker/rust-build/tcbuild.py index 8f99e95bac1e..f96315a7d6aa 100644 --- a/testing/docker/rust-build/tcbuild.py +++ b/taskcluster/docker/rust-build/tcbuild.py @@ -20,18 +20,23 @@ import tempfile import time import tooltool +requests.packages.urllib3.disable_warnings() + + def local_file(filename): ''' Return a path to a file next to this script. ''' return os.path.join(os.path.dirname(__file__), filename) + def read_tc_auth(tc_auth_file): ''' Read taskcluster credentials from tc_auth_file and return them as a dict. ''' return json.load(open(tc_auth_file, 'rb')) + def fill_template_dict(d, keys): for key, val in d.items(): if isinstance(val, basestring) and '{' in val: @@ -39,6 +44,7 @@ def fill_template_dict(d, keys): elif isinstance(val, dict): fill_template_dict(val, keys) + def fill_template(template_file, keys): ''' Take the file object template_file, parse it as JSON, and @@ -48,6 +54,7 @@ def fill_template(template_file, keys): fill_template_dict(template, keys) return template + def spawn_task(queue, args): ''' Spawn a Taskcluster task in queue using args. @@ -57,13 +64,16 @@ def spawn_task(queue, args): keys = vars(args) now = datetime.datetime.utcnow() keys['task_created'] = now.isoformat() + 'Z' - keys['task_deadline'] = (now + datetime.timedelta(hours=2)).isoformat() + 'Z' - keys['artifacts_expires'] = (now + datetime.timedelta(days=1)).isoformat() + 'Z' + keys['task_deadline'] = (now + datetime.timedelta( + hours=2)).isoformat() + 'Z' + keys['artifacts_expires'] = (now + datetime.timedelta( + days=1)).isoformat() + 'Z' payload = fill_template(template, keys) queue.createTask(task_id, payload) print('--- %s task %s submitted ---' % (now, task_id)) return task_id + def wait_for_task(queue, task_id, initial_wait=5): ''' Wait until queue reports that task task_id is completed, and return @@ -81,8 +91,8 @@ def wait_for_task(queue, task_id, initial_wait=5): if state != previous_state: now = datetime.datetime.utcnow() if have_ticks: - sys.stdout.write('\n') - have_ticks = False + sys.stdout.write('\n') + have_ticks = False print('--- %s task %s %s ---' % (now, task_id, state)) previous_state = state if state == 'completed': @@ -94,6 +104,7 @@ def wait_for_task(queue, task_id, initial_wait=5): have_ticks = True time.sleep(10) + def fetch_artifact(queue, task_id, run_id, name, dest_dir): ''' Fetch the artifact with name from task_id and run_id in queue, @@ -114,11 +125,13 @@ def fetch_artifact(queue, task_id, run_id, name, dest_dir): return None return fn + def make_artifact_dir(task_id, run_id): prefix = 'tc-artifacts.%s.%d.' % (task_id, run_id) print('making artifact dir %s' % prefix) return tempfile.mkdtemp(prefix=prefix) + def fetch_artifacts(queue, task_id, run_id): ''' Fetch all artifacts from task_id and run_id in queue, write them to @@ -137,10 +150,11 @@ def fetch_artifacts(queue, task_id, run_id): yield fetch_artifact(queue, task_id, run_id, a['name'], tempdir) finally: if os.path.isdir(tempdir): - #shutil.rmtree(tempdir) + # shutil.rmtree(tempdir) print('Artifacts downloaded to %s' % tempdir) pass + def upload_to_tooltool(tooltool_auth, task_id, artifact): ''' Upload artifact to tooltool using tooltool_auth as the authentication token. @@ -168,6 +182,7 @@ def upload_to_tooltool(tooltool_auth, task_id, artifact): finally: os.chdir(oldcwd) + def update_manifest(artifact, manifest, local_gecko_clone): platform = 'linux' manifest_dir = os.path.join(local_gecko_clone, @@ -178,11 +193,19 @@ def update_manifest(artifact, manifest, local_gecko_clone): print('%s -> %s' % (manifest, tree_manifest)) shutil.copyfile(manifest, tree_manifest) + def main(): parser = argparse.ArgumentParser(description='Build and upload binaries') - parser.add_argument('taskcluster_auth', help='Path to a file containing Taskcluster client ID and authentication token as a JSON file in the form {"clientId": "...", "accessToken": "..."}') - parser.add_argument('--tooltool-auth', help='Path to a file containing a tooltool authentication token valid for uploading files') - parser.add_argument('--local-gecko-clone', help='Path to a local Gecko clone whose tooltool manifests will be updated with the newly-built binaries') + parser.add_argument('taskcluster_auth', + help='Path to a file containing Taskcluster client ' + 'ID and authentication token as a JSON file in ' + 'the form {"clientId": "...", "accessToken": "..."}') + parser.add_argument('--tooltool-auth', + help='Path to a file containing a tooltool ' + 'authentication token valid for uploading files') + parser.add_argument('--local-gecko-clone', + help='Path to a local Gecko clone whose tooltool ' + 'manifests will be updated with the newly-built binaries') parser.add_argument('--rust-branch', default='stable', help='Revision of the rust repository to use') parser.add_argument('--task', help='Use an existing task') @@ -197,9 +220,11 @@ def main(): run_id = wait_for_task(queue, task_id, initial_wait) for artifact in fetch_artifacts(queue, task_id, run_id): if args.tooltool_auth: - manifest = upload_to_tooltool(args.tooltool_auth, task_id, artifact) + manifest = upload_to_tooltool(args.tooltool_auth, task_id, + artifact) if args.local_gecko_clone: update_manifest(artifact, manifest, args.local_gecko_clone) + if __name__ == '__main__': main() diff --git a/testing/docker/rust-build/upload_rust.sh b/taskcluster/docker/rust-build/upload_rust.sh similarity index 100% rename from testing/docker/rust-build/upload_rust.sh rename to taskcluster/docker/rust-build/upload_rust.sh diff --git a/testing/docker/tester/Dockerfile b/taskcluster/docker/tester/Dockerfile similarity index 100% rename from testing/docker/tester/Dockerfile rename to taskcluster/docker/tester/Dockerfile diff --git a/testing/docker/tester/REGISTRY b/taskcluster/docker/tester/REGISTRY similarity index 100% rename from testing/docker/tester/REGISTRY rename to taskcluster/docker/tester/REGISTRY diff --git a/testing/docker/tester/VERSION b/taskcluster/docker/tester/VERSION similarity index 100% rename from testing/docker/tester/VERSION rename to taskcluster/docker/tester/VERSION diff --git a/testing/docker/tester/bin/test.sh b/taskcluster/docker/tester/bin/test.sh similarity index 100% rename from testing/docker/tester/bin/test.sh rename to taskcluster/docker/tester/bin/test.sh diff --git a/testing/docker/tester/dot-config/pip/pip.conf b/taskcluster/docker/tester/dot-config/pip/pip.conf similarity index 100% rename from testing/docker/tester/dot-config/pip/pip.conf rename to taskcluster/docker/tester/dot-config/pip/pip.conf diff --git a/testing/docker/tester/dot-config/user-dirs.dirs b/taskcluster/docker/tester/dot-config/user-dirs.dirs similarity index 100% rename from testing/docker/tester/dot-config/user-dirs.dirs rename to taskcluster/docker/tester/dot-config/user-dirs.dirs diff --git a/testing/docker/tester/dot-config/user-dirs.locale b/taskcluster/docker/tester/dot-config/user-dirs.locale similarity index 100% rename from testing/docker/tester/dot-config/user-dirs.locale rename to taskcluster/docker/tester/dot-config/user-dirs.locale diff --git a/testing/docker/tester/dot-pulse/default.pa b/taskcluster/docker/tester/dot-pulse/default.pa similarity index 100% rename from testing/docker/tester/dot-pulse/default.pa rename to taskcluster/docker/tester/dot-pulse/default.pa diff --git a/testing/docker/tester/tc-vcs-config.yml b/taskcluster/docker/tester/tc-vcs-config.yml similarity index 100% rename from testing/docker/tester/tc-vcs-config.yml rename to taskcluster/docker/tester/tc-vcs-config.yml diff --git a/testing/docker/tester/tester.env b/taskcluster/docker/tester/tester.env similarity index 100% rename from testing/docker/tester/tester.env rename to taskcluster/docker/tester/tester.env diff --git a/testing/docker/upload-symbols/Dockerfile b/taskcluster/docker/upload-symbols/Dockerfile similarity index 100% rename from testing/docker/upload-symbols/Dockerfile rename to taskcluster/docker/upload-symbols/Dockerfile diff --git a/testing/docker/upload-symbols/README.md b/taskcluster/docker/upload-symbols/README.md similarity index 100% rename from testing/docker/upload-symbols/README.md rename to taskcluster/docker/upload-symbols/README.md diff --git a/testing/docker/upload-symbols/bin/checkout-script.sh b/taskcluster/docker/upload-symbols/bin/checkout-script.sh similarity index 100% rename from testing/docker/upload-symbols/bin/checkout-script.sh rename to taskcluster/docker/upload-symbols/bin/checkout-script.sh diff --git a/testing/docker/upload-symbols/bin/upload.sh b/taskcluster/docker/upload-symbols/bin/upload.sh similarity index 100% rename from testing/docker/upload-symbols/bin/upload.sh rename to taskcluster/docker/upload-symbols/bin/upload.sh diff --git a/testing/docker/upload-symbols/test_exports.sh b/taskcluster/docker/upload-symbols/test_exports.sh similarity index 100% rename from testing/docker/upload-symbols/test_exports.sh rename to taskcluster/docker/upload-symbols/test_exports.sh diff --git a/taskcluster/docs/docker-images.rst b/taskcluster/docs/docker-images.rst index 22dea4dead06..582ff93c45be 100644 --- a/taskcluster/docs/docker-images.rst +++ b/taskcluster/docs/docker-images.rst @@ -5,7 +5,7 @@ Docker Images ============= TaskCluster Docker images are defined in the source directory under -``testing/docker``. Each directory therein contains the name of an +``taskcluster/docker``. Each directory therein contains the name of an image used as part of the task graph. Adding Extra Files to Images diff --git a/taskcluster/docs/kinds.rst b/taskcluster/docs/kinds.rst index 0d9e233fd992..3a08a7272b6a 100644 --- a/taskcluster/docs/kinds.rst +++ b/taskcluster/docs/kinds.rst @@ -138,7 +138,7 @@ Docker tasks run. The tasks to generate each docker image have predictable labels: ``build-docker-image-``. -Docker images are built from subdirectories of ``testing/docker``, using +Docker images are built from subdirectories of ``taskcluster/docker``, using ``docker build``. There is currently no capability for one Docker image to depend on another in-tree docker image, without uploading the latter to a Docker repository diff --git a/taskcluster/scripts/builder/build-haz-linux.sh b/taskcluster/scripts/builder/build-haz-linux.sh index 1d5ef52bab4a..8a4654f3f1cd 100755 --- a/taskcluster/scripts/builder/build-haz-linux.sh +++ b/taskcluster/scripts/builder/build-haz-linux.sh @@ -54,7 +54,7 @@ export MOZ_OBJDIR="$WORKSPACE/obj-analyzed" mkdir -p "$MOZ_OBJDIR" if [ -n "$DO_TOOLTOOL" ]; then - ( cd $TOOLTOOL_DIR; python $GECKO_DIR/testing/docker/recipes/tooltool.py --url https://api.pub.build.mozilla.org/tooltool/ -m $GECKO_DIR/$TOOLTOOL_MANIFEST fetch -c $TOOLTOOL_CACHE ) + ( cd $TOOLTOOL_DIR; python $GECKO_DIR/taskcluster/docker/recipes/tooltool.py --url https://api.pub.build.mozilla.org/tooltool/ -m $GECKO_DIR/$TOOLTOOL_MANIFEST fetch -c $TOOLTOOL_CACHE ) fi export NO_MERCURIAL_SETUP_CHECK=1 diff --git a/taskcluster/scripts/builder/sm-tooltool-config.sh b/taskcluster/scripts/builder/sm-tooltool-config.sh index b6a0628580f4..7f9b0d0f12d4 100755 --- a/taskcluster/scripts/builder/sm-tooltool-config.sh +++ b/taskcluster/scripts/builder/sm-tooltool-config.sh @@ -47,4 +47,4 @@ BROWSER_PLATFORM=$PLATFORM_OS$BITS : ${TOOLTOOL_CHECKOUT:=$WORK} export TOOLTOOL_CHECKOUT -(cd $TOOLTOOL_CHECKOUT && python ${SRCDIR}/testing/docker/recipes/tooltool.py --url $TOOLTOOL_SERVER -m $SRCDIR/$TOOLTOOL_MANIFEST fetch ${TOOLTOOL_CACHE:+ -c $TOOLTOOL_CACHE}) +(cd $TOOLTOOL_CHECKOUT && python ${SRCDIR}/taskcluster/docker/recipes/tooltool.py --url $TOOLTOOL_SERVER -m $SRCDIR/$TOOLTOOL_MANIFEST fetch ${TOOLTOOL_CACHE:+ -c $TOOLTOOL_CACHE}) diff --git a/taskcluster/taskgraph/docker.py b/taskcluster/taskgraph/docker.py index e63e4d9650ff..ea2e93e33660 100644 --- a/taskcluster/taskgraph/docker.py +++ b/taskcluster/taskgraph/docker.py @@ -20,13 +20,13 @@ from io import BytesIO from taskgraph.util import docker GECKO = os.path.realpath(os.path.join(__file__, '..', '..', '..')) -IMAGE_DIR = os.path.join(GECKO, 'testing', 'docker') +IMAGE_DIR = os.path.join(GECKO, 'taskcluster', 'docker') INDEX_URL = 'https://index.taskcluster.net/v1/task/' + docker.INDEX_PREFIX + '.{}.{}.hash.{}' ARTIFACT_URL = 'https://queue.taskcluster.net/v1/task/{}/artifacts/{}' def load_image_by_name(image_name, tag=None): - context_path = os.path.join(GECKO, 'testing', 'docker', image_name) + context_path = os.path.join(GECKO, 'taskcluster', 'docker', image_name) context_hash = docker.generate_context_hash(GECKO, context_path, image_name) image_index_url = INDEX_URL.format('level-3', image_name, context_hash) diff --git a/taskcluster/taskgraph/task/docker_image.py b/taskcluster/taskgraph/task/docker_image.py index fd67c48328be..a388e57b435a 100644 --- a/taskcluster/taskgraph/task/docker_image.py +++ b/taskcluster/taskgraph/task/docker_image.py @@ -59,7 +59,7 @@ class DockerImageTask(base.Task): tasks = [] templates = Templates(path) for image_name, image_symbol in config['images'].iteritems(): - context_path = os.path.join('testing', 'docker', image_name) + context_path = os.path.join('taskcluster', 'docker', image_name) context_hash = generate_context_hash(GECKO, context_path, image_name) image_parameters = dict(parameters) diff --git a/taskcluster/taskgraph/transforms/task.py b/taskcluster/taskgraph/transforms/task.py index 538206e30fc7..44ab20215664 100644 --- a/taskcluster/taskgraph/transforms/task.py +++ b/taskcluster/taskgraph/transforms/task.py @@ -141,7 +141,7 @@ task_description_schema = Schema({ Required('docker-image'): Any( # a raw Docker image path (repo/image:tag) basestring, - # an in-tree generated docker image (from `testing/docker/`) + # an in-tree generated docker image (from `taskcluster/docker/`) {'in-tree': basestring} ), diff --git a/taskcluster/taskgraph/transforms/tests/test_description.py b/taskcluster/taskgraph/transforms/tests/test_description.py index 99a095d574eb..ddf088516539 100644 --- a/taskcluster/taskgraph/transforms/tests/test_description.py +++ b/taskcluster/taskgraph/transforms/tests/test_description.py @@ -126,7 +126,7 @@ test_description_schema = Schema({ Required('docker-image', default={'in-tree': 'desktop-test'}): Any( # a raw Docker image path (repo/image:tag) basestring, - # an in-tree generated docker image (from `testing/docker/`) + # an in-tree generated docker image (from `taskcluster/docker/`) {'in-tree': basestring} ), diff --git a/taskcluster/taskgraph/util/docker.py b/taskcluster/taskgraph/util/docker.py index df97e57bcf72..4e9df7e6403e 100644 --- a/taskcluster/taskgraph/util/docker.py +++ b/taskcluster/taskgraph/util/docker.py @@ -17,7 +17,7 @@ from mozpack.archive import ( GECKO = os.path.realpath(os.path.join(__file__, '..', '..', '..', '..')) -DOCKER_ROOT = os.path.join(GECKO, 'testing', 'docker') +DOCKER_ROOT = os.path.join(GECKO, 'taskcluster', 'docker') INDEX_PREFIX = 'docker.images.v2' ARTIFACT_URL = 'https://queue.taskcluster.net/v1/task/{}/artifacts/{}' diff --git a/testing/docker/rust-build/repack_rust.py b/testing/docker/rust-build/repack_rust.py deleted file mode 100644 index 4883a7b76ea2..000000000000 --- a/testing/docker/rust-build/repack_rust.py +++ /dev/null @@ -1,175 +0,0 @@ -#!/bin/env python -''' -This script downloads and repacks official rust language builds -with the necessary tool and target support for the Firefox -build environment. -''' - -import os.path -import requests -import subprocess -import toml - -def fetch_file(url): - '''Download a file from the given url if it's not already present.''' - filename = os.path.basename(url) - if os.path.exists(filename): - return - r = requests.get(url, stream=True) - r.raise_for_status() - with open(filename, 'wb') as fd: - for chunk in r.iter_content(4096): - fd.write(chunk) - -def fetch(url): - '''Download and verify a package url.''' - base = os.path.basename(url) - print('Fetching %s...' % base) - fetch_file(url + '.asc') - fetch_file(url) - fetch_file(url + '.sha256') - fetch_file(url + '.asc.sha256') - print('Verifying %s...' % base) - subprocess.check_call(['shasum', '-c', base + '.sha256']) - subprocess.check_call(['shasum', '-c', base + '.asc.sha256']) - subprocess.check_call(['gpg', '--verify', base + '.asc', base]) - if False: - subprocess.check_call(['keybase', 'pgp', 'verify', - '-d', base + '.asc', - '-i', base, - ]) - -def install(filename, target): - '''Run a package's installer script against the given target directory.''' - print(' Unpacking %s...' % filename) - subprocess.check_call(['tar', 'xf', filename]) - basename = filename.split('.tar')[0] - print(' Installing %s...' % basename) - install_cmd = [os.path.join(basename, 'install.sh')] - install_cmd += ['--prefix=' + os.path.abspath(target)] - install_cmd += ['--disable-ldconfig'] - subprocess.check_call(install_cmd) - print(' Cleaning %s...' % basename) - subprocess.check_call(['rm', '-rf', basename]) - -def package(manifest, pkg, target): - '''Pull out the package dict for a particular package and target - from the given manifest.''' - version = manifest['pkg'][pkg]['version'] - info = manifest['pkg'][pkg]['target'][target] - return (version, info) - -def fetch_package(manifest, pkg, host): - version, info = package(manifest, pkg, host) - print('%s %s\n %s\n %s' % (pkg, version, info['url'], info['hash'])) - if not info['available']: - print('%s marked unavailable for %s' % (pkg, host)) - raise AssertionError - fetch(info['url']) - return info - -def fetch_std(manifest, targets): - stds = [] - for target in targets: - info = fetch_package(manifest, 'rust-std', target) - stds.append(info) - return stds - -def tar_for_host(host): - if 'linux' in host: - tar_options = 'cJf' - tar_ext = '.tar.xz' - else: - tar_options = 'cjf' - tar_ext = '.tar.bz2' - return tar_options, tar_ext - -def repack(host, targets, channel='stable', suffix=''): - print("Repacking rust for %s..." % host) - url = 'https://static.rust-lang.org/dist/channel-rust-' + channel + '.toml' - req = requests.get(url) - req.raise_for_status() - manifest = toml.loads(req.content) - if manifest['manifest-version'] != '2': - print('ERROR: unrecognized manifest version %s.' % manifest['manifest-version']) - return - print('Using manifest for rust %s as of %s.' % (channel, manifest['date'])) - print('Fetching packages...') - rustc = fetch_package(manifest, 'rustc', host) - cargo = fetch_package(manifest, 'cargo', host) - stds = fetch_std(manifest, targets) - print('Installing packages...') - tar_basename = 'rustc-' + host - if suffix: - tar_basename += '-' + suffix - tar_basename += '-repack' - install_dir = 'rustc' - subprocess.check_call(['rm', '-rf', install_dir]) - install(os.path.basename(rustc['url']), install_dir) - install(os.path.basename(cargo['url']), install_dir) - for std in stds: - install(os.path.basename(std['url']), install_dir) - pass - print('Tarring %s...' % tar_basename) - tar_options, tar_ext = tar_for_host(host) - subprocess.check_call(['tar', tar_options, tar_basename + tar_ext, install_dir]) - subprocess.check_call(['rm', '-rf', install_dir]) - -def repack_cargo(host, channel='nightly'): - print("Repacking cargo for %s..." % host) - # Cargo doesn't seem to have a .toml manifest. - base_url = 'https://static.rust-lang.org/cargo-dist/' - req = requests.get(os.path.join(base_url, 'channel-cargo-' + channel)) - req.raise_for_status() - file = '' - for line in req.iter_lines(): - if line.find(host) != -1: - file = line.strip() - if not file: - print('No manifest entry for %s!' % host) - return - manifest = { - 'date': req.headers['Last-Modified'], - 'pkg': { - 'cargo': { - 'version': channel, - 'target': { - host: { - 'url': os.path.join(base_url, file), - 'hash': None, - 'available': True, - }, - }, - }, - }, - } - print('Using manifest for cargo %s.' % channel) - print('Fetching packages...') - cargo = fetch_package(manifest, 'cargo', host) - print('Installing packages...') - install_dir = 'cargo' - subprocess.check_call(['rm', '-rf', install_dir]) - install(os.path.basename(cargo['url']), install_dir) - tar_basename = 'cargo-%s-repack' % host - print('Tarring %s...' % tar_basename) - tar_options, tar_ext = tar_for_host(host) - subprocess.check_call(['tar', tar_options, tar_basename + tar_ext, install_dir]) - subprocess.check_call(['rm', '-rf', install_dir]) - -# rust platform triples -android="armv7-linux-androideabi" -android_x86="i686-linux-android" -linux64="x86_64-unknown-linux-gnu" -linux32="i686-unknown-linux-gnu" -mac64="x86_64-apple-darwin" -mac32="i686-apple-darwin" -win64="x86_64-pc-windows-msvc" -win32="i686-pc-windows-msvc" - -if __name__ == '__main__': - repack(mac64, [mac64, mac32]) - repack(win32, [win32]) - repack(win64, [win64]) - repack(linux64, [linux64, linux32]) - repack(linux64, [linux64, mac64, mac32], suffix='mac-cross') - repack(linux64, [linux64, android, android_x86], suffix='android-cross') From 3e48b6a71d8cdce973b65dfede7eabccbd28294e Mon Sep 17 00:00:00 2001 From: Kevin Wern Date: Fri, 16 Dec 2016 20:33:02 -0500 Subject: [PATCH 03/70] Bug 1324117 - Enable APZ scrollbar dragging on Nightly r=botond MozReview-Commit-ID: EAJEFMGo4WR --HG-- extra : rebase_source : d7d724c6e6b5f5cbd3b33917d689c39e4ab83204 --- modules/libpref/init/all.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index b9c37d702f82..a9cb9c0a90dc 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -631,7 +631,11 @@ pref("apz.axis_lock.breakout_threshold", "0.03125"); // 1/32 inches pref("apz.axis_lock.breakout_angle", "0.3926991"); // PI / 8 (22.5 degrees) pref("apz.axis_lock.direct_pan_angle", "1.047197"); // PI / 3 (60 degrees) pref("apz.content_response_timeout", 400); +#ifdef NIGHTLY_BUILD +pref("apz.drag.enabled", true); +#else pref("apz.drag.enabled", false); +#endif pref("apz.danger_zone_x", 50); pref("apz.danger_zone_y", 100); pref("apz.disable_for_scroll_linked_effects", false); From 010d912f51396cecb1be3608dbe2ac59db2aabe5 Mon Sep 17 00:00:00 2001 From: Milan Sreckovic Date: Wed, 14 Dec 2016 19:10:27 -0500 Subject: [PATCH 04/70] Bug 795627: Allow Skia canvas with accelerated Windows. r=gw280 MozReview-Commit-ID: DKyKC7n3OEM --HG-- extra : rebase_source : 67d8b897d0e2bf520d92b3a617f01ae0fa0bf45d --- gfx/thebes/gfxWindowsPlatform.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gfx/thebes/gfxWindowsPlatform.cpp b/gfx/thebes/gfxWindowsPlatform.cpp index 0a3a664e216f..f597d05633ef 100755 --- a/gfx/thebes/gfxWindowsPlatform.cpp +++ b/gfx/thebes/gfxWindowsPlatform.cpp @@ -473,17 +473,16 @@ gfxWindowsPlatform::HandleDeviceReset() void gfxWindowsPlatform::UpdateBackendPrefs() { - uint32_t canvasMask = BackendTypeBit(BackendType::CAIRO); - uint32_t contentMask = BackendTypeBit(BackendType::CAIRO); + uint32_t canvasMask = BackendTypeBit(BackendType::CAIRO) | + BackendTypeBit(BackendType::SKIA); + uint32_t contentMask = BackendTypeBit(BackendType::CAIRO) | + BackendTypeBit(BackendType::SKIA); BackendType defaultBackend = BackendType::CAIRO; if (gfxConfig::IsEnabled(Feature::DIRECT2D) && Factory::GetD2D1Device()) { contentMask |= BackendTypeBit(BackendType::DIRECT2D1_1); canvasMask |= BackendTypeBit(BackendType::DIRECT2D1_1); defaultBackend = BackendType::DIRECT2D1_1; - } else { - canvasMask |= BackendTypeBit(BackendType::SKIA); } - contentMask |= BackendTypeBit(BackendType::SKIA); InitBackendPrefs(canvasMask, defaultBackend, contentMask, defaultBackend); } From 4174483eb10cee67dc876f5c39f7caeb50ab1a49 Mon Sep 17 00:00:00 2001 From: Gregory Szorc Date: Mon, 12 Dec 2016 10:23:02 -0800 Subject: [PATCH 05/70] Bug 1318044 - Issue sgr0 after printing every line; r=froydnj The sgr0 terminal capabity defines the byte sequence needed to reset terminal text to its default state. For reasons documented inline in this commit, we now print this sequence after every line printed by mach's terminal logger. MozReview-Commit-ID: 3RukP0QXtqy --HG-- extra : rebase_source : 5e4b7d001300ec1059b53423b310ac9fdd514c72 --- python/mach/mach/logging.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/python/mach/mach/logging.py b/python/mach/mach/logging.py index 729e6cb3d934..4ced511adcc9 100644 --- a/python/mach/mach/logging.py +++ b/python/mach/mach/logging.py @@ -93,6 +93,7 @@ class StructuredTerminalFormatter(StructuredHumanFormatter): def set_terminal(self, terminal): self.terminal = terminal + self._sgr0 = blessings.tigetstr('sgr0') if terminal and blessings else '' def format(self, record): f = record.msg.format(**record.params) @@ -102,7 +103,13 @@ class StructuredTerminalFormatter(StructuredHumanFormatter): t = self.terminal.blue(format_seconds(self._time(record))) - return '%s %s' % (t, self._colorize(f)) + # Some processes (notably Clang) don't reset terminal attributes after + # printing newlines. This can lead to terminal attributes getting in a + # wonky state. Work around this by sending the sgr0 sequence after every + # line to reset all attributes. For programs that rely on the next line + # inheriting the same attributes, this will prevent that from happening. + # But that's better than "corrupting" the terminal. + return '%s %s%s' % (t, self._colorize(f), self._sgr0) def _colorize(self, s): if not self.terminal: From f3e89595f18d9c340376e5a35beabdb31cd330a8 Mon Sep 17 00:00:00 2001 From: Sebastian Hengst Date: Mon, 19 Dec 2016 21:15:07 +0100 Subject: [PATCH 06/70] Backed out changeset fe7303de56be (bug 1302763) for failing webdriver tests on Linux x64 debug (geckodriver.manifest fetch failed). r=backout --HG-- rename : taskcluster/docker/README.md => testing/docker/README.md rename : taskcluster/docker/REGISTRY => testing/docker/REGISTRY rename : taskcluster/docker/android-gradle-build/Dockerfile => testing/docker/android-gradle-build/Dockerfile rename : taskcluster/docker/android-gradle-build/README.md => testing/docker/android-gradle-build/README.md rename : taskcluster/docker/android-gradle-build/REGISTRY => testing/docker/android-gradle-build/REGISTRY rename : taskcluster/docker/android-gradle-build/VERSION => testing/docker/android-gradle-build/VERSION rename : taskcluster/docker/android-gradle-build/bin/after.sh => testing/docker/android-gradle-build/bin/after.sh rename : taskcluster/docker/android-gradle-build/bin/before.sh => testing/docker/android-gradle-build/bin/before.sh rename : taskcluster/docker/android-gradle-build/bin/build.sh => testing/docker/android-gradle-build/bin/build.sh rename : taskcluster/docker/android-gradle-build/bin/checkout-script.sh => testing/docker/android-gradle-build/bin/checkout-script.sh rename : taskcluster/docker/android-gradle-build/bin/checkout-sources.sh => testing/docker/android-gradle-build/bin/checkout-sources.sh rename : taskcluster/docker/android-gradle-build/buildprops.json => testing/docker/android-gradle-build/buildprops.json rename : taskcluster/docker/android-gradle-build/dot-config/pip/pip.conf => testing/docker/android-gradle-build/dot-config/pip/pip.conf rename : taskcluster/docker/android-gradle-build/oauth.txt => testing/docker/android-gradle-build/oauth.txt rename : taskcluster/docker/base-build/Dockerfile => testing/docker/base-build/Dockerfile rename : taskcluster/docker/base-build/VERSION => testing/docker/base-build/VERSION rename : taskcluster/docker/base-build/system-setup.sh => testing/docker/base-build/system-setup.sh rename : taskcluster/docker/base-test/Dockerfile => testing/docker/base-test/Dockerfile rename : taskcluster/docker/base-test/REGISTRY => testing/docker/base-test/REGISTRY rename : taskcluster/docker/base-test/VERSION => testing/docker/base-test/VERSION rename : taskcluster/docker/base-test/sources.list => testing/docker/base-test/sources.list rename : taskcluster/docker/centos6-build-upd/Dockerfile => testing/docker/centos6-build-upd/Dockerfile rename : taskcluster/docker/centos6-build-upd/REGISTRY => testing/docker/centos6-build-upd/REGISTRY rename : taskcluster/docker/centos6-build-upd/VERSION => testing/docker/centos6-build-upd/VERSION rename : taskcluster/docker/centos6-build/Dockerfile => testing/docker/centos6-build/Dockerfile rename : taskcluster/docker/centos6-build/REGISTRY => testing/docker/centos6-build/REGISTRY rename : taskcluster/docker/centos6-build/VERSION => testing/docker/centos6-build/VERSION rename : taskcluster/docker/centos6-build/hgrc => testing/docker/centos6-build/hgrc rename : taskcluster/docker/centos6-build/system-setup.sh => testing/docker/centos6-build/system-setup.sh rename : taskcluster/docker/decision/Dockerfile => testing/docker/decision/Dockerfile rename : taskcluster/docker/decision/README.md => testing/docker/decision/README.md rename : taskcluster/docker/decision/REGISTRY => testing/docker/decision/REGISTRY rename : taskcluster/docker/decision/VERSION => testing/docker/decision/VERSION rename : taskcluster/docker/decision/system-setup.sh => testing/docker/decision/system-setup.sh rename : taskcluster/docker/desktop-build/Dockerfile => testing/docker/desktop-build/Dockerfile rename : taskcluster/docker/desktop-build/bin/build.sh => testing/docker/desktop-build/bin/build.sh rename : taskcluster/docker/desktop-build/bin/checkout-script.sh => testing/docker/desktop-build/bin/checkout-script.sh rename : taskcluster/docker/desktop-build/bin/checkout-sources.sh => testing/docker/desktop-build/bin/checkout-sources.sh rename : taskcluster/docker/desktop-build/buildprops.json => testing/docker/desktop-build/buildprops.json rename : taskcluster/docker/desktop-build/dot-config/pip/pip.conf => testing/docker/desktop-build/dot-config/pip/pip.conf rename : taskcluster/docker/desktop-build/oauth.txt => testing/docker/desktop-build/oauth.txt rename : taskcluster/docker/desktop-test/Dockerfile => testing/docker/desktop-test/Dockerfile rename : taskcluster/docker/desktop-test/apport => testing/docker/desktop-test/apport rename : taskcluster/docker/desktop-test/buildprops.json => testing/docker/desktop-test/buildprops.json rename : taskcluster/docker/desktop-test/deja-dup-monitor.desktop => testing/docker/desktop-test/deja-dup-monitor.desktop rename : taskcluster/docker/desktop-test/dot-files/config/pip/pip.conf => testing/docker/desktop-test/dot-files/config/pip/pip.conf rename : taskcluster/docker/desktop-test/dot-files/config/user-dirs.dirs => testing/docker/desktop-test/dot-files/config/user-dirs.dirs rename : taskcluster/docker/desktop-test/dot-files/config/user-dirs.locale => testing/docker/desktop-test/dot-files/config/user-dirs.locale rename : taskcluster/docker/desktop-test/dot-files/pulse/default.pa => testing/docker/desktop-test/dot-files/pulse/default.pa rename : taskcluster/docker/desktop-test/fonts.conf => testing/docker/desktop-test/fonts.conf rename : taskcluster/docker/desktop-test/jockey-gtk.desktop => testing/docker/desktop-test/jockey-gtk.desktop rename : taskcluster/docker/desktop-test/motd => testing/docker/desktop-test/motd rename : taskcluster/docker/desktop-test/release-upgrades => testing/docker/desktop-test/release-upgrades rename : taskcluster/docker/desktop-test/taskcluster-interactive-shell => testing/docker/desktop-test/taskcluster-interactive-shell rename : taskcluster/docker/desktop-test/tc-vcs-config.yml => testing/docker/desktop-test/tc-vcs-config.yml rename : taskcluster/docker/desktop-test/tester.env => testing/docker/desktop-test/tester.env rename : taskcluster/docker/desktop1604-test/Dockerfile => testing/docker/desktop1604-test/Dockerfile rename : taskcluster/docker/desktop1604-test/apport => testing/docker/desktop1604-test/apport rename : taskcluster/docker/desktop1604-test/buildprops.json => testing/docker/desktop1604-test/buildprops.json rename : taskcluster/docker/desktop1604-test/deja-dup-monitor.desktop => testing/docker/desktop1604-test/deja-dup-monitor.desktop rename : taskcluster/docker/desktop1604-test/dot-files/config/pip/pip.conf => testing/docker/desktop1604-test/dot-files/config/pip/pip.conf rename : taskcluster/docker/desktop1604-test/dot-files/config/user-dirs.dirs => testing/docker/desktop1604-test/dot-files/config/user-dirs.dirs rename : taskcluster/docker/desktop1604-test/dot-files/config/user-dirs.locale => testing/docker/desktop1604-test/dot-files/config/user-dirs.locale rename : taskcluster/docker/desktop1604-test/dot-files/pulse/default.pa => testing/docker/desktop1604-test/dot-files/pulse/default.pa rename : taskcluster/docker/desktop1604-test/fonts.conf => testing/docker/desktop1604-test/fonts.conf rename : taskcluster/docker/desktop1604-test/jockey-gtk.desktop => testing/docker/desktop1604-test/jockey-gtk.desktop rename : taskcluster/docker/desktop1604-test/motd => testing/docker/desktop1604-test/motd rename : taskcluster/docker/desktop1604-test/release-upgrades => testing/docker/desktop1604-test/release-upgrades rename : taskcluster/docker/desktop1604-test/taskcluster-interactive-shell => testing/docker/desktop1604-test/taskcluster-interactive-shell rename : taskcluster/docker/desktop1604-test/tc-vcs-config.yml => testing/docker/desktop1604-test/tc-vcs-config.yml rename : taskcluster/docker/desktop1604-test/tester.env => testing/docker/desktop1604-test/tester.env rename : taskcluster/docker/image_builder/Dockerfile => testing/docker/image_builder/Dockerfile rename : taskcluster/docker/image_builder/REGISTRY => testing/docker/image_builder/REGISTRY rename : taskcluster/docker/image_builder/VERSION => testing/docker/image_builder/VERSION rename : taskcluster/docker/image_builder/build-image.sh => testing/docker/image_builder/build-image.sh rename : taskcluster/docker/image_builder/setup.sh => testing/docker/image_builder/setup.sh rename : taskcluster/docker/lint/Dockerfile => testing/docker/lint/Dockerfile rename : taskcluster/docker/lint/system-setup.sh => testing/docker/lint/system-setup.sh rename : taskcluster/docker/recipes/centos6-build-system-setup.sh => testing/docker/recipes/centos6-build-system-setup.sh rename : taskcluster/docker/recipes/common.sh => testing/docker/recipes/common.sh rename : taskcluster/docker/recipes/install-mercurial.sh => testing/docker/recipes/install-mercurial.sh rename : taskcluster/docker/recipes/run-task => testing/docker/recipes/run-task rename : taskcluster/docker/recipes/tooltool.py => testing/docker/recipes/tooltool.py rename : taskcluster/docker/recipes/ubuntu1204-test-system-setup.sh => testing/docker/recipes/ubuntu1204-test-system-setup.sh rename : taskcluster/docker/recipes/ubuntu1604-test-system-setup.sh => testing/docker/recipes/ubuntu1604-test-system-setup.sh rename : taskcluster/docker/recipes/xvfb.sh => testing/docker/recipes/xvfb.sh rename : taskcluster/docker/rust-build/Dockerfile => testing/docker/rust-build/Dockerfile rename : taskcluster/docker/rust-build/README.md => testing/docker/rust-build/README.md rename : taskcluster/docker/rust-build/REGISTRY => testing/docker/rust-build/REGISTRY rename : taskcluster/docker/rust-build/VERSION => testing/docker/rust-build/VERSION rename : taskcluster/docker/rust-build/build_cargo.sh => testing/docker/rust-build/build_cargo.sh rename : taskcluster/docker/rust-build/build_rust.sh => testing/docker/rust-build/build_rust.sh rename : taskcluster/docker/rust-build/build_rust_mac.sh => testing/docker/rust-build/build_rust_mac.sh rename : taskcluster/docker/rust-build/fetch_cargo.sh => testing/docker/rust-build/fetch_cargo.sh rename : taskcluster/docker/rust-build/fetch_rust.sh => testing/docker/rust-build/fetch_rust.sh rename : taskcluster/docker/rust-build/package_rust.sh => testing/docker/rust-build/package_rust.sh rename : taskcluster/docker/rust-build/repack_rust.py => testing/docker/rust-build/repack_rust.py rename : taskcluster/docker/rust-build/splat_rust.py => testing/docker/rust-build/splat_rust.py rename : taskcluster/docker/rust-build/task.json => testing/docker/rust-build/task.json rename : taskcluster/docker/rust-build/tcbuild.py => testing/docker/rust-build/tcbuild.py rename : taskcluster/docker/rust-build/upload_rust.sh => testing/docker/rust-build/upload_rust.sh rename : taskcluster/docker/tester/Dockerfile => testing/docker/tester/Dockerfile rename : taskcluster/docker/tester/REGISTRY => testing/docker/tester/REGISTRY rename : taskcluster/docker/tester/VERSION => testing/docker/tester/VERSION rename : taskcluster/docker/tester/bin/test.sh => testing/docker/tester/bin/test.sh rename : taskcluster/docker/tester/dot-config/pip/pip.conf => testing/docker/tester/dot-config/pip/pip.conf rename : taskcluster/docker/tester/dot-config/user-dirs.dirs => testing/docker/tester/dot-config/user-dirs.dirs rename : taskcluster/docker/tester/dot-config/user-dirs.locale => testing/docker/tester/dot-config/user-dirs.locale rename : taskcluster/docker/tester/dot-pulse/default.pa => testing/docker/tester/dot-pulse/default.pa rename : taskcluster/docker/tester/tc-vcs-config.yml => testing/docker/tester/tc-vcs-config.yml rename : taskcluster/docker/tester/tester.env => testing/docker/tester/tester.env rename : taskcluster/docker/upload-symbols/Dockerfile => testing/docker/upload-symbols/Dockerfile rename : taskcluster/docker/upload-symbols/README.md => testing/docker/upload-symbols/README.md rename : taskcluster/docker/upload-symbols/bin/checkout-script.sh => testing/docker/upload-symbols/bin/checkout-script.sh rename : taskcluster/docker/upload-symbols/bin/upload.sh => testing/docker/upload-symbols/bin/upload.sh rename : taskcluster/docker/upload-symbols/test_exports.sh => testing/docker/upload-symbols/test_exports.sh --- AUTHORS | 1 - taskcluster/ci/android-stuff/kind.yml | 2 +- taskcluster/ci/docker-image/kind.yml | 2 +- taskcluster/ci/source-check/mozlint.yml | 6 +- taskcluster/docker/rust-build/repack_rust.py | 187 ------------------ taskcluster/docs/docker-images.rst | 2 +- taskcluster/docs/kinds.rst | 2 +- .../scripts/builder/build-haz-linux.sh | 2 +- .../scripts/builder/sm-tooltool-config.sh | 2 +- taskcluster/taskgraph/docker.py | 4 +- taskcluster/taskgraph/task/docker_image.py | 2 +- taskcluster/taskgraph/transforms/task.py | 2 +- .../transforms/tests/test_description.py | 2 +- taskcluster/taskgraph/util/docker.py | 2 +- {taskcluster => testing}/docker/README.md | 0 {taskcluster => testing}/docker/REGISTRY | 0 .../docker/android-gradle-build/Dockerfile | 4 +- .../docker/android-gradle-build/README.md | 0 .../docker/android-gradle-build/REGISTRY | 0 .../docker/android-gradle-build/VERSION | 0 .../docker/android-gradle-build/bin/after.sh | 0 .../docker/android-gradle-build/bin/before.sh | 0 .../docker/android-gradle-build/bin/build.sh | 0 .../bin/checkout-script.sh | 0 .../bin/checkout-sources.sh | 0 .../android-gradle-build/buildprops.json | 0 .../dot-config/pip/pip.conf | 0 .../docker/android-gradle-build/oauth.txt | 0 .../docker/base-build/Dockerfile | 0 .../docker/base-build/VERSION | 0 .../docker/base-build/system-setup.sh | 0 .../docker/base-test/Dockerfile | 0 .../docker/base-test/REGISTRY | 0 .../docker/base-test/VERSION | 0 .../docker/base-test/sources.list | 0 .../docker/centos6-build-upd/Dockerfile | 0 .../docker/centos6-build-upd/REGISTRY | 0 .../docker/centos6-build-upd/VERSION | 0 .../docker/centos6-build/Dockerfile | 0 .../docker/centos6-build/REGISTRY | 0 .../docker/centos6-build/VERSION | 0 .../docker/centos6-build/hgrc | 0 .../docker/centos6-build/system-setup.sh | 0 .../docker/decision/Dockerfile | 12 +- .../docker/decision/README.md | 0 .../docker/decision/REGISTRY | 0 .../docker/decision/VERSION | 0 .../docker/decision/system-setup.sh | 0 .../docker/desktop-build/Dockerfile | 26 +-- .../docker/desktop-build/bin/build.sh | 0 .../desktop-build/bin/checkout-script.sh | 0 .../desktop-build/bin/checkout-sources.sh | 0 .../docker/desktop-build/buildprops.json | 0 .../desktop-build/dot-config/pip/pip.conf | 0 .../docker/desktop-build/oauth.txt | 0 .../docker/desktop-test/Dockerfile | 20 +- .../docker/desktop-test/apport | 0 .../docker/desktop-test/buildprops.json | 0 .../desktop-test/deja-dup-monitor.desktop | 0 .../dot-files/config/pip/pip.conf | 0 .../dot-files/config/user-dirs.dirs | 0 .../dot-files/config/user-dirs.locale | 0 .../desktop-test/dot-files/pulse/default.pa | 0 .../docker/desktop-test/fonts.conf | 0 .../docker/desktop-test/jockey-gtk.desktop | 0 .../docker/desktop-test/motd | 0 .../docker/desktop-test/release-upgrades | 0 .../taskcluster-interactive-shell | 0 .../docker/desktop-test/tc-vcs-config.yml | 0 .../docker/desktop-test/tester.env | 0 .../docker/desktop1604-test/Dockerfile | 24 +-- .../docker/desktop1604-test/apport | 0 .../docker/desktop1604-test/buildprops.json | 0 .../desktop1604-test/deja-dup-monitor.desktop | 0 .../dot-files/config/pip/pip.conf | 0 .../dot-files/config/user-dirs.dirs | 0 .../dot-files/config/user-dirs.locale | 0 .../dot-files/pulse/default.pa | 0 .../docker/desktop1604-test/fonts.conf | 0 .../desktop1604-test/jockey-gtk.desktop | 0 .../docker/desktop1604-test/motd | 0 .../docker/desktop1604-test/release-upgrades | 0 .../taskcluster-interactive-shell | 0 .../docker/desktop1604-test/tc-vcs-config.yml | 0 .../docker/desktop1604-test/tester.env | 0 .../docker/image_builder/Dockerfile | 20 +- .../docker/image_builder/REGISTRY | 0 .../docker/image_builder/VERSION | 0 .../docker/image_builder/build-image.sh | 0 .../docker/image_builder/setup.sh | 0 .../docker/lint/Dockerfile | 12 +- .../docker/lint/system-setup.sh | 0 .../recipes/centos6-build-system-setup.sh | 0 .../docker/recipes/common.sh | 0 .../docker/recipes/install-mercurial.sh | 0 .../docker/recipes/run-task | 0 .../docker/recipes/tooltool.py | 0 .../recipes/ubuntu1204-test-system-setup.sh | 0 .../recipes/ubuntu1604-test-system-setup.sh | 0 .../docker/recipes/xvfb.sh | 0 .../docker/rust-build/Dockerfile | 0 .../docker/rust-build/README.md | 0 .../docker/rust-build/REGISTRY | 0 .../docker/rust-build/VERSION | 0 .../docker/rust-build/build_cargo.sh | 0 .../docker/rust-build/build_rust.sh | 0 .../docker/rust-build/build_rust_mac.sh | 0 .../docker/rust-build/fetch_cargo.sh | 0 .../docker/rust-build/fetch_rust.sh | 0 .../docker/rust-build/package_rust.sh | 0 testing/docker/rust-build/repack_rust.py | 175 ++++++++++++++++ .../docker/rust-build/splat_rust.py | 10 +- .../docker/rust-build/task.json | 0 .../docker/rust-build/tcbuild.py | 43 +--- .../docker/rust-build/upload_rust.sh | 0 .../docker/tester/Dockerfile | 0 .../docker/tester/REGISTRY | 0 .../docker/tester/VERSION | 0 .../docker/tester/bin/test.sh | 0 .../docker/tester/dot-config/pip/pip.conf | 0 .../docker/tester/dot-config/user-dirs.dirs | 0 .../docker/tester/dot-config/user-dirs.locale | 0 .../docker/tester/dot-pulse/default.pa | 0 .../docker/tester/tc-vcs-config.yml | 0 .../docker/tester/tester.env | 0 .../docker/upload-symbols/Dockerfile | 0 .../docker/upload-symbols/README.md | 0 .../upload-symbols/bin/checkout-script.sh | 0 .../docker/upload-symbols/bin/upload.sh | 0 .../docker/upload-symbols/test_exports.sh | 0 130 files changed, 261 insertions(+), 303 deletions(-) delete mode 100644 taskcluster/docker/rust-build/repack_rust.py rename {taskcluster => testing}/docker/README.md (100%) rename {taskcluster => testing}/docker/REGISTRY (100%) rename {taskcluster => testing}/docker/android-gradle-build/Dockerfile (96%) rename {taskcluster => testing}/docker/android-gradle-build/README.md (100%) rename {taskcluster => testing}/docker/android-gradle-build/REGISTRY (100%) rename {taskcluster => testing}/docker/android-gradle-build/VERSION (100%) rename {taskcluster => testing}/docker/android-gradle-build/bin/after.sh (100%) rename {taskcluster => testing}/docker/android-gradle-build/bin/before.sh (100%) rename {taskcluster => testing}/docker/android-gradle-build/bin/build.sh (100%) rename {taskcluster => testing}/docker/android-gradle-build/bin/checkout-script.sh (100%) rename {taskcluster => testing}/docker/android-gradle-build/bin/checkout-sources.sh (100%) rename {taskcluster => testing}/docker/android-gradle-build/buildprops.json (100%) rename {taskcluster => testing}/docker/android-gradle-build/dot-config/pip/pip.conf (100%) rename {taskcluster => testing}/docker/android-gradle-build/oauth.txt (100%) rename {taskcluster => testing}/docker/base-build/Dockerfile (100%) rename {taskcluster => testing}/docker/base-build/VERSION (100%) rename {taskcluster => testing}/docker/base-build/system-setup.sh (100%) rename {taskcluster => testing}/docker/base-test/Dockerfile (100%) rename {taskcluster => testing}/docker/base-test/REGISTRY (100%) rename {taskcluster => testing}/docker/base-test/VERSION (100%) rename {taskcluster => testing}/docker/base-test/sources.list (100%) rename {taskcluster => testing}/docker/centos6-build-upd/Dockerfile (100%) rename {taskcluster => testing}/docker/centos6-build-upd/REGISTRY (100%) rename {taskcluster => testing}/docker/centos6-build-upd/VERSION (100%) rename {taskcluster => testing}/docker/centos6-build/Dockerfile (100%) rename {taskcluster => testing}/docker/centos6-build/REGISTRY (100%) rename {taskcluster => testing}/docker/centos6-build/VERSION (100%) rename {taskcluster => testing}/docker/centos6-build/hgrc (100%) rename {taskcluster => testing}/docker/centos6-build/system-setup.sh (100%) rename {taskcluster => testing}/docker/decision/Dockerfile (61%) rename {taskcluster => testing}/docker/decision/README.md (100%) rename {taskcluster => testing}/docker/decision/REGISTRY (100%) rename {taskcluster => testing}/docker/decision/VERSION (100%) rename {taskcluster => testing}/docker/decision/system-setup.sh (100%) rename {taskcluster => testing}/docker/desktop-build/Dockerfile (68%) rename {taskcluster => testing}/docker/desktop-build/bin/build.sh (100%) rename {taskcluster => testing}/docker/desktop-build/bin/checkout-script.sh (100%) rename {taskcluster => testing}/docker/desktop-build/bin/checkout-sources.sh (100%) rename {taskcluster => testing}/docker/desktop-build/buildprops.json (100%) rename {taskcluster => testing}/docker/desktop-build/dot-config/pip/pip.conf (100%) rename {taskcluster => testing}/docker/desktop-build/oauth.txt (100%) rename {taskcluster => testing}/docker/desktop-test/Dockerfile (83%) rename {taskcluster => testing}/docker/desktop-test/apport (100%) rename {taskcluster => testing}/docker/desktop-test/buildprops.json (100%) rename {taskcluster => testing}/docker/desktop-test/deja-dup-monitor.desktop (100%) rename {taskcluster => testing}/docker/desktop-test/dot-files/config/pip/pip.conf (100%) rename {taskcluster => testing}/docker/desktop-test/dot-files/config/user-dirs.dirs (100%) rename {taskcluster => testing}/docker/desktop-test/dot-files/config/user-dirs.locale (100%) rename {taskcluster => testing}/docker/desktop-test/dot-files/pulse/default.pa (100%) rename {taskcluster => testing}/docker/desktop-test/fonts.conf (100%) rename {taskcluster => testing}/docker/desktop-test/jockey-gtk.desktop (100%) rename {taskcluster => testing}/docker/desktop-test/motd (100%) rename {taskcluster => testing}/docker/desktop-test/release-upgrades (100%) rename {taskcluster => testing}/docker/desktop-test/taskcluster-interactive-shell (100%) rename {taskcluster => testing}/docker/desktop-test/tc-vcs-config.yml (100%) rename {taskcluster => testing}/docker/desktop-test/tester.env (100%) rename {taskcluster => testing}/docker/desktop1604-test/Dockerfile (81%) rename {taskcluster => testing}/docker/desktop1604-test/apport (100%) rename {taskcluster => testing}/docker/desktop1604-test/buildprops.json (100%) rename {taskcluster => testing}/docker/desktop1604-test/deja-dup-monitor.desktop (100%) rename {taskcluster => testing}/docker/desktop1604-test/dot-files/config/pip/pip.conf (100%) rename {taskcluster => testing}/docker/desktop1604-test/dot-files/config/user-dirs.dirs (100%) rename {taskcluster => testing}/docker/desktop1604-test/dot-files/config/user-dirs.locale (100%) rename {taskcluster => testing}/docker/desktop1604-test/dot-files/pulse/default.pa (100%) rename {taskcluster => testing}/docker/desktop1604-test/fonts.conf (100%) rename {taskcluster => testing}/docker/desktop1604-test/jockey-gtk.desktop (100%) rename {taskcluster => testing}/docker/desktop1604-test/motd (100%) rename {taskcluster => testing}/docker/desktop1604-test/release-upgrades (100%) rename {taskcluster => testing}/docker/desktop1604-test/taskcluster-interactive-shell (100%) rename {taskcluster => testing}/docker/desktop1604-test/tc-vcs-config.yml (100%) rename {taskcluster => testing}/docker/desktop1604-test/tester.env (100%) rename {taskcluster => testing}/docker/image_builder/Dockerfile (51%) rename {taskcluster => testing}/docker/image_builder/REGISTRY (100%) rename {taskcluster => testing}/docker/image_builder/VERSION (100%) rename {taskcluster => testing}/docker/image_builder/build-image.sh (100%) rename {taskcluster => testing}/docker/image_builder/setup.sh (100%) rename {taskcluster => testing}/docker/lint/Dockerfile (73%) rename {taskcluster => testing}/docker/lint/system-setup.sh (100%) rename {taskcluster => testing}/docker/recipes/centos6-build-system-setup.sh (100%) rename {taskcluster => testing}/docker/recipes/common.sh (100%) rename {taskcluster => testing}/docker/recipes/install-mercurial.sh (100%) rename {taskcluster => testing}/docker/recipes/run-task (100%) rename {taskcluster => testing}/docker/recipes/tooltool.py (100%) rename {taskcluster => testing}/docker/recipes/ubuntu1204-test-system-setup.sh (100%) rename {taskcluster => testing}/docker/recipes/ubuntu1604-test-system-setup.sh (100%) rename {taskcluster => testing}/docker/recipes/xvfb.sh (100%) rename {taskcluster => testing}/docker/rust-build/Dockerfile (100%) rename {taskcluster => testing}/docker/rust-build/README.md (100%) rename {taskcluster => testing}/docker/rust-build/REGISTRY (100%) rename {taskcluster => testing}/docker/rust-build/VERSION (100%) rename {taskcluster => testing}/docker/rust-build/build_cargo.sh (100%) rename {taskcluster => testing}/docker/rust-build/build_rust.sh (100%) rename {taskcluster => testing}/docker/rust-build/build_rust_mac.sh (100%) rename {taskcluster => testing}/docker/rust-build/fetch_cargo.sh (100%) rename {taskcluster => testing}/docker/rust-build/fetch_rust.sh (100%) rename {taskcluster => testing}/docker/rust-build/package_rust.sh (100%) create mode 100644 testing/docker/rust-build/repack_rust.py rename {taskcluster => testing}/docker/rust-build/splat_rust.py (95%) rename {taskcluster => testing}/docker/rust-build/task.json (100%) rename {taskcluster => testing}/docker/rust-build/tcbuild.py (85%) rename {taskcluster => testing}/docker/rust-build/upload_rust.sh (100%) rename {taskcluster => testing}/docker/tester/Dockerfile (100%) rename {taskcluster => testing}/docker/tester/REGISTRY (100%) rename {taskcluster => testing}/docker/tester/VERSION (100%) rename {taskcluster => testing}/docker/tester/bin/test.sh (100%) rename {taskcluster => testing}/docker/tester/dot-config/pip/pip.conf (100%) rename {taskcluster => testing}/docker/tester/dot-config/user-dirs.dirs (100%) rename {taskcluster => testing}/docker/tester/dot-config/user-dirs.locale (100%) rename {taskcluster => testing}/docker/tester/dot-pulse/default.pa (100%) rename {taskcluster => testing}/docker/tester/tc-vcs-config.yml (100%) rename {taskcluster => testing}/docker/tester/tester.env (100%) rename {taskcluster => testing}/docker/upload-symbols/Dockerfile (100%) rename {taskcluster => testing}/docker/upload-symbols/README.md (100%) rename {taskcluster => testing}/docker/upload-symbols/bin/checkout-script.sh (100%) rename {taskcluster => testing}/docker/upload-symbols/bin/upload.sh (100%) rename {taskcluster => testing}/docker/upload-symbols/test_exports.sh (100%) diff --git a/AUTHORS b/AUTHORS index 11aa3471caf0..7e9d1f491248 100644 --- a/AUTHORS +++ b/AUTHORS @@ -879,7 +879,6 @@ Ryan Flint Ryan Jones Ryan VanderMeulen Ryoichi Furukawa -Sanyam Khurana sagdjb@softwareag.com Samir Gehani Sammy Ford diff --git a/taskcluster/ci/android-stuff/kind.yml b/taskcluster/ci/android-stuff/kind.yml index 3ff7bb5c5b5c..32f6864687f9 100644 --- a/taskcluster/ci/android-stuff/kind.yml +++ b/taskcluster/ci/android-stuff/kind.yml @@ -63,7 +63,7 @@ jobs: when: files-changed: - "mobile/android/config/**" - - "taskcluster/docker/android-gradle-build/**" + - "testing/docker/android-gradle-build/**" - "testing/mozharness/configs/builds/releng_sub_android_configs/*gradle_dependencies.py" - "**/*.gradle" diff --git a/taskcluster/ci/docker-image/kind.yml b/taskcluster/ci/docker-image/kind.yml index a990c30f6529..d1c118c8ee74 100644 --- a/taskcluster/ci/docker-image/kind.yml +++ b/taskcluster/ci/docker-image/kind.yml @@ -3,7 +3,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. implementation: 'taskgraph.task.docker_image:DockerImageTask' -images_path: '../../../taskcluster/docker' +images_path: '../../../testing/docker' # make a task for each docker-image we might want. For the moment, since we # write artifacts for each, these are whitelisted, but ideally that will change diff --git a/taskcluster/ci/source-check/mozlint.yml b/taskcluster/ci/source-check/mozlint.yml index 7c700dd4d8b2..fd22a9f8f0d9 100644 --- a/taskcluster/ci/source-check/mozlint.yml +++ b/taskcluster/ci/source-check/mozlint.yml @@ -40,7 +40,7 @@ mozlint-eslint/opt: # Other misc lint related files. - 'python/mozlint/**' - 'tools/lint/**' - - 'taskcluster/docker/lint/**' + - 'testing/docker/lint/**' mozlint-flake8/opt: description: flake8 run over the gecko codebase @@ -66,7 +66,7 @@ mozlint-flake8/opt: - '**/.flake8' - 'python/mozlint/**' - 'tools/lint/**' - - 'taskcluster/docker/lint/**' + - 'testing/docker/lint/**' wptlint-gecko/opt: description: web-platform-tests linter @@ -94,4 +94,4 @@ wptlint-gecko/opt: - 'testing/web-platform/mozilla/meta/MANIFEST.json' - 'python/mozlint/**' - 'tools/lint/**' - - 'taskcluster/docker/lint/**' + - 'testing/docker/lint/**' diff --git a/taskcluster/docker/rust-build/repack_rust.py b/taskcluster/docker/rust-build/repack_rust.py deleted file mode 100644 index 4a7b61a7c53d..000000000000 --- a/taskcluster/docker/rust-build/repack_rust.py +++ /dev/null @@ -1,187 +0,0 @@ -#!/bin/env python -''' -This script downloads and repacks official rust language builds -with the necessary tool and target support for the Firefox -build environment. -''' - -import os.path -import requests -import subprocess -import toml - - -def fetch_file(url): - '''Download a file from the given url if it's not already present.''' - filename = os.path.basename(url) - if os.path.exists(filename): - return - r = requests.get(url, stream=True) - r.raise_for_status() - with open(filename, 'wb') as fd: - for chunk in r.iter_content(4096): - fd.write(chunk) - - -def fetch(url): - '''Download and verify a package url.''' - base = os.path.basename(url) - print('Fetching %s...' % base) - fetch_file(url + '.asc') - fetch_file(url) - fetch_file(url + '.sha256') - fetch_file(url + '.asc.sha256') - print('Verifying %s...' % base) - subprocess.check_call(['shasum', '-c', base + '.sha256']) - subprocess.check_call(['shasum', '-c', base + '.asc.sha256']) - subprocess.check_call(['gpg', '--verify', base + '.asc', base]) - if False: - subprocess.check_call([ - 'keybase', 'pgp', 'verify', '-d', base + '.asc', ' -i', base, - ]) - - -def install(filename, target): - '''Run a package's installer script against the given target directory.''' - print(' Unpacking %s...' % filename) - subprocess.check_call(['tar', 'xf', filename]) - basename = filename.split('.tar')[0] - print(' Installing %s...' % basename) - install_cmd = [os.path.join(basename, 'install.sh')] - install_cmd += ['--prefix=' + os.path.abspath(target)] - install_cmd += ['--disable-ldconfig'] - subprocess.check_call(install_cmd) - print(' Cleaning %s...' % basename) - subprocess.check_call(['rm', '-rf', basename]) - - -def package(manifest, pkg, target): - '''Pull out the package dict for a particular package and target - from the given manifest.''' - version = manifest['pkg'][pkg]['version'] - info = manifest['pkg'][pkg]['target'][target] - return (version, info) - - -def fetch_package(manifest, pkg, host): - version, info = package(manifest, pkg, host) - print('%s %s\n %s\n %s' % (pkg, version, info['url'], info['hash'])) - if not info['available']: - print('%s marked unavailable for %s' % (pkg, host)) - raise AssertionError - fetch(info['url']) - return info - - -def fetch_std(manifest, targets): - stds = [] - for target in targets: - info = fetch_package(manifest, 'rust-std', target) - stds.append(info) - return stds - - -def tar_for_host(host): - if 'linux' in host: - tar_options = 'cJf' - tar_ext = '.tar.xz' - else: - tar_options = 'cjf' - tar_ext = '.tar.bz2' - return tar_options, tar_ext - - -def repack(host, targets, channel='stable', suffix=''): - print("Repacking rust for %s..." % host) - url = 'https://static.rust-lang.org/dist/channel-rust-' + channel + '.toml' - req = requests.get(url) - req.raise_for_status() - manifest = toml.loads(req.content) - if manifest['manifest-version'] != '2': - print('ERROR: unrecognized manifest version %s.' % manifest[ - 'manifest-version']) - return - print('Using manifest for rust %s as of %s.' % (channel, manifest['date'])) - print('Fetching packages...') - rustc = fetch_package(manifest, 'rustc', host) - cargo = fetch_package(manifest, 'cargo', host) - stds = fetch_std(manifest, targets) - print('Installing packages...') - tar_basename = 'rustc-' + host - if suffix: - tar_basename += '-' + suffix - tar_basename += '-repack' - install_dir = 'rustc' - subprocess.check_call(['rm', '-rf', install_dir]) - install(os.path.basename(rustc['url']), install_dir) - install(os.path.basename(cargo['url']), install_dir) - for std in stds: - install(os.path.basename(std['url']), install_dir) - pass - print('Tarring %s...' % tar_basename) - tar_options, tar_ext = tar_for_host(host) - subprocess.check_call( - ['tar', tar_options, tar_basename + tar_ext, install_dir]) - subprocess.check_call(['rm', '-rf', install_dir]) - - -def repack_cargo(host, channel='nightly'): - print("Repacking cargo for %s..." % host) - # Cargo doesn't seem to have a .toml manifest. - base_url = 'https://static.rust-lang.org/cargo-dist/' - req = requests.get(os.path.join(base_url, 'channel-cargo-' + channel)) - req.raise_for_status() - file = '' - for line in req.iter_lines(): - if line.find(host) != -1: - file = line.strip() - if not file: - print('No manifest entry for %s!' % host) - return - manifest = { - 'date': req.headers['Last-Modified'], - 'pkg': { - 'cargo': { - 'version': channel, - 'target': { - host: { - 'url': os.path.join(base_url, file), - 'hash': None, - 'available': True, - }, - }, - }, - }, - } - print('Using manifest for cargo %s.' % channel) - print('Fetching packages...') - cargo = fetch_package(manifest, 'cargo', host) - print('Installing packages...') - install_dir = 'cargo' - subprocess.check_call(['rm', '-rf', install_dir]) - install(os.path.basename(cargo['url']), install_dir) - tar_basename = 'cargo-%s-repack' % host - print('Tarring %s...' % tar_basename) - tar_options, tar_ext = tar_for_host(host) - subprocess.check_call( - ['tar', tar_options, tar_basename + tar_ext, install_dir]) - subprocess.check_call(['rm', '-rf', install_dir]) - - -# rust platform triples -android = "armv7-linux-androideabi" -android_x86 = "i686-linux-android" -linux64 = "x86_64-unknown-linux-gnu" -linux32 = "i686-unknown-linux-gnu" -mac64 = "x86_64-apple-darwin" -mac32 = "i686-apple-darwin" -win64 = "x86_64-pc-windows-msvc" -win32 = "i686-pc-windows-msvc" - -if __name__ == '__main__': - repack(mac64, [mac64, mac32]) - repack(win32, [win32]) - repack(win64, [win64]) - repack(linux64, [linux64, linux32]) - repack(linux64, [linux64, mac64, mac32], suffix='mac-cross') - repack(linux64, [linux64, android, android_x86], suffix='android-cross') diff --git a/taskcluster/docs/docker-images.rst b/taskcluster/docs/docker-images.rst index 582ff93c45be..22dea4dead06 100644 --- a/taskcluster/docs/docker-images.rst +++ b/taskcluster/docs/docker-images.rst @@ -5,7 +5,7 @@ Docker Images ============= TaskCluster Docker images are defined in the source directory under -``taskcluster/docker``. Each directory therein contains the name of an +``testing/docker``. Each directory therein contains the name of an image used as part of the task graph. Adding Extra Files to Images diff --git a/taskcluster/docs/kinds.rst b/taskcluster/docs/kinds.rst index 3a08a7272b6a..0d9e233fd992 100644 --- a/taskcluster/docs/kinds.rst +++ b/taskcluster/docs/kinds.rst @@ -138,7 +138,7 @@ Docker tasks run. The tasks to generate each docker image have predictable labels: ``build-docker-image-``. -Docker images are built from subdirectories of ``taskcluster/docker``, using +Docker images are built from subdirectories of ``testing/docker``, using ``docker build``. There is currently no capability for one Docker image to depend on another in-tree docker image, without uploading the latter to a Docker repository diff --git a/taskcluster/scripts/builder/build-haz-linux.sh b/taskcluster/scripts/builder/build-haz-linux.sh index 8a4654f3f1cd..1d5ef52bab4a 100755 --- a/taskcluster/scripts/builder/build-haz-linux.sh +++ b/taskcluster/scripts/builder/build-haz-linux.sh @@ -54,7 +54,7 @@ export MOZ_OBJDIR="$WORKSPACE/obj-analyzed" mkdir -p "$MOZ_OBJDIR" if [ -n "$DO_TOOLTOOL" ]; then - ( cd $TOOLTOOL_DIR; python $GECKO_DIR/taskcluster/docker/recipes/tooltool.py --url https://api.pub.build.mozilla.org/tooltool/ -m $GECKO_DIR/$TOOLTOOL_MANIFEST fetch -c $TOOLTOOL_CACHE ) + ( cd $TOOLTOOL_DIR; python $GECKO_DIR/testing/docker/recipes/tooltool.py --url https://api.pub.build.mozilla.org/tooltool/ -m $GECKO_DIR/$TOOLTOOL_MANIFEST fetch -c $TOOLTOOL_CACHE ) fi export NO_MERCURIAL_SETUP_CHECK=1 diff --git a/taskcluster/scripts/builder/sm-tooltool-config.sh b/taskcluster/scripts/builder/sm-tooltool-config.sh index 7f9b0d0f12d4..b6a0628580f4 100755 --- a/taskcluster/scripts/builder/sm-tooltool-config.sh +++ b/taskcluster/scripts/builder/sm-tooltool-config.sh @@ -47,4 +47,4 @@ BROWSER_PLATFORM=$PLATFORM_OS$BITS : ${TOOLTOOL_CHECKOUT:=$WORK} export TOOLTOOL_CHECKOUT -(cd $TOOLTOOL_CHECKOUT && python ${SRCDIR}/taskcluster/docker/recipes/tooltool.py --url $TOOLTOOL_SERVER -m $SRCDIR/$TOOLTOOL_MANIFEST fetch ${TOOLTOOL_CACHE:+ -c $TOOLTOOL_CACHE}) +(cd $TOOLTOOL_CHECKOUT && python ${SRCDIR}/testing/docker/recipes/tooltool.py --url $TOOLTOOL_SERVER -m $SRCDIR/$TOOLTOOL_MANIFEST fetch ${TOOLTOOL_CACHE:+ -c $TOOLTOOL_CACHE}) diff --git a/taskcluster/taskgraph/docker.py b/taskcluster/taskgraph/docker.py index ea2e93e33660..e63e4d9650ff 100644 --- a/taskcluster/taskgraph/docker.py +++ b/taskcluster/taskgraph/docker.py @@ -20,13 +20,13 @@ from io import BytesIO from taskgraph.util import docker GECKO = os.path.realpath(os.path.join(__file__, '..', '..', '..')) -IMAGE_DIR = os.path.join(GECKO, 'taskcluster', 'docker') +IMAGE_DIR = os.path.join(GECKO, 'testing', 'docker') INDEX_URL = 'https://index.taskcluster.net/v1/task/' + docker.INDEX_PREFIX + '.{}.{}.hash.{}' ARTIFACT_URL = 'https://queue.taskcluster.net/v1/task/{}/artifacts/{}' def load_image_by_name(image_name, tag=None): - context_path = os.path.join(GECKO, 'taskcluster', 'docker', image_name) + context_path = os.path.join(GECKO, 'testing', 'docker', image_name) context_hash = docker.generate_context_hash(GECKO, context_path, image_name) image_index_url = INDEX_URL.format('level-3', image_name, context_hash) diff --git a/taskcluster/taskgraph/task/docker_image.py b/taskcluster/taskgraph/task/docker_image.py index a388e57b435a..fd67c48328be 100644 --- a/taskcluster/taskgraph/task/docker_image.py +++ b/taskcluster/taskgraph/task/docker_image.py @@ -59,7 +59,7 @@ class DockerImageTask(base.Task): tasks = [] templates = Templates(path) for image_name, image_symbol in config['images'].iteritems(): - context_path = os.path.join('taskcluster', 'docker', image_name) + context_path = os.path.join('testing', 'docker', image_name) context_hash = generate_context_hash(GECKO, context_path, image_name) image_parameters = dict(parameters) diff --git a/taskcluster/taskgraph/transforms/task.py b/taskcluster/taskgraph/transforms/task.py index 44ab20215664..538206e30fc7 100644 --- a/taskcluster/taskgraph/transforms/task.py +++ b/taskcluster/taskgraph/transforms/task.py @@ -141,7 +141,7 @@ task_description_schema = Schema({ Required('docker-image'): Any( # a raw Docker image path (repo/image:tag) basestring, - # an in-tree generated docker image (from `taskcluster/docker/`) + # an in-tree generated docker image (from `testing/docker/`) {'in-tree': basestring} ), diff --git a/taskcluster/taskgraph/transforms/tests/test_description.py b/taskcluster/taskgraph/transforms/tests/test_description.py index ddf088516539..99a095d574eb 100644 --- a/taskcluster/taskgraph/transforms/tests/test_description.py +++ b/taskcluster/taskgraph/transforms/tests/test_description.py @@ -126,7 +126,7 @@ test_description_schema = Schema({ Required('docker-image', default={'in-tree': 'desktop-test'}): Any( # a raw Docker image path (repo/image:tag) basestring, - # an in-tree generated docker image (from `taskcluster/docker/`) + # an in-tree generated docker image (from `testing/docker/`) {'in-tree': basestring} ), diff --git a/taskcluster/taskgraph/util/docker.py b/taskcluster/taskgraph/util/docker.py index 4e9df7e6403e..df97e57bcf72 100644 --- a/taskcluster/taskgraph/util/docker.py +++ b/taskcluster/taskgraph/util/docker.py @@ -17,7 +17,7 @@ from mozpack.archive import ( GECKO = os.path.realpath(os.path.join(__file__, '..', '..', '..', '..')) -DOCKER_ROOT = os.path.join(GECKO, 'taskcluster', 'docker') +DOCKER_ROOT = os.path.join(GECKO, 'testing', 'docker') INDEX_PREFIX = 'docker.images.v2' ARTIFACT_URL = 'https://queue.taskcluster.net/v1/task/{}/artifacts/{}' diff --git a/taskcluster/docker/README.md b/testing/docker/README.md similarity index 100% rename from taskcluster/docker/README.md rename to testing/docker/README.md diff --git a/taskcluster/docker/REGISTRY b/testing/docker/REGISTRY similarity index 100% rename from taskcluster/docker/REGISTRY rename to testing/docker/REGISTRY diff --git a/taskcluster/docker/android-gradle-build/Dockerfile b/testing/docker/android-gradle-build/Dockerfile similarity index 96% rename from taskcluster/docker/android-gradle-build/Dockerfile rename to testing/docker/android-gradle-build/Dockerfile index 7b20edd8454e..b8fb5450f409 100644 --- a/taskcluster/docker/android-gradle-build/Dockerfile +++ b/testing/docker/android-gradle-build/Dockerfile @@ -14,8 +14,8 @@ ADD bin /home/worker/bin RUN chmod +x /home/worker/bin/* # Add wrapper scripts for xvfb allowing tasks to easily retry starting up xvfb -# %include taskcluster/docker/recipes/xvfb.sh -ADD topsrcdir/taskcluster/docker/recipes/xvfb.sh /home/worker/scripts/xvfb.sh +# %include testing/docker/recipes/xvfb.sh +ADD topsrcdir/testing/docker/recipes/xvfb.sh /home/worker/scripts/xvfb.sh # Add configuration COPY dot-config /home/worker/.config diff --git a/taskcluster/docker/android-gradle-build/README.md b/testing/docker/android-gradle-build/README.md similarity index 100% rename from taskcluster/docker/android-gradle-build/README.md rename to testing/docker/android-gradle-build/README.md diff --git a/taskcluster/docker/android-gradle-build/REGISTRY b/testing/docker/android-gradle-build/REGISTRY similarity index 100% rename from taskcluster/docker/android-gradle-build/REGISTRY rename to testing/docker/android-gradle-build/REGISTRY diff --git a/taskcluster/docker/android-gradle-build/VERSION b/testing/docker/android-gradle-build/VERSION similarity index 100% rename from taskcluster/docker/android-gradle-build/VERSION rename to testing/docker/android-gradle-build/VERSION diff --git a/taskcluster/docker/android-gradle-build/bin/after.sh b/testing/docker/android-gradle-build/bin/after.sh similarity index 100% rename from taskcluster/docker/android-gradle-build/bin/after.sh rename to testing/docker/android-gradle-build/bin/after.sh diff --git a/taskcluster/docker/android-gradle-build/bin/before.sh b/testing/docker/android-gradle-build/bin/before.sh similarity index 100% rename from taskcluster/docker/android-gradle-build/bin/before.sh rename to testing/docker/android-gradle-build/bin/before.sh diff --git a/taskcluster/docker/android-gradle-build/bin/build.sh b/testing/docker/android-gradle-build/bin/build.sh similarity index 100% rename from taskcluster/docker/android-gradle-build/bin/build.sh rename to testing/docker/android-gradle-build/bin/build.sh diff --git a/taskcluster/docker/android-gradle-build/bin/checkout-script.sh b/testing/docker/android-gradle-build/bin/checkout-script.sh similarity index 100% rename from taskcluster/docker/android-gradle-build/bin/checkout-script.sh rename to testing/docker/android-gradle-build/bin/checkout-script.sh diff --git a/taskcluster/docker/android-gradle-build/bin/checkout-sources.sh b/testing/docker/android-gradle-build/bin/checkout-sources.sh similarity index 100% rename from taskcluster/docker/android-gradle-build/bin/checkout-sources.sh rename to testing/docker/android-gradle-build/bin/checkout-sources.sh diff --git a/taskcluster/docker/android-gradle-build/buildprops.json b/testing/docker/android-gradle-build/buildprops.json similarity index 100% rename from taskcluster/docker/android-gradle-build/buildprops.json rename to testing/docker/android-gradle-build/buildprops.json diff --git a/taskcluster/docker/android-gradle-build/dot-config/pip/pip.conf b/testing/docker/android-gradle-build/dot-config/pip/pip.conf similarity index 100% rename from taskcluster/docker/android-gradle-build/dot-config/pip/pip.conf rename to testing/docker/android-gradle-build/dot-config/pip/pip.conf diff --git a/taskcluster/docker/android-gradle-build/oauth.txt b/testing/docker/android-gradle-build/oauth.txt similarity index 100% rename from taskcluster/docker/android-gradle-build/oauth.txt rename to testing/docker/android-gradle-build/oauth.txt diff --git a/taskcluster/docker/base-build/Dockerfile b/testing/docker/base-build/Dockerfile similarity index 100% rename from taskcluster/docker/base-build/Dockerfile rename to testing/docker/base-build/Dockerfile diff --git a/taskcluster/docker/base-build/VERSION b/testing/docker/base-build/VERSION similarity index 100% rename from taskcluster/docker/base-build/VERSION rename to testing/docker/base-build/VERSION diff --git a/taskcluster/docker/base-build/system-setup.sh b/testing/docker/base-build/system-setup.sh similarity index 100% rename from taskcluster/docker/base-build/system-setup.sh rename to testing/docker/base-build/system-setup.sh diff --git a/taskcluster/docker/base-test/Dockerfile b/testing/docker/base-test/Dockerfile similarity index 100% rename from taskcluster/docker/base-test/Dockerfile rename to testing/docker/base-test/Dockerfile diff --git a/taskcluster/docker/base-test/REGISTRY b/testing/docker/base-test/REGISTRY similarity index 100% rename from taskcluster/docker/base-test/REGISTRY rename to testing/docker/base-test/REGISTRY diff --git a/taskcluster/docker/base-test/VERSION b/testing/docker/base-test/VERSION similarity index 100% rename from taskcluster/docker/base-test/VERSION rename to testing/docker/base-test/VERSION diff --git a/taskcluster/docker/base-test/sources.list b/testing/docker/base-test/sources.list similarity index 100% rename from taskcluster/docker/base-test/sources.list rename to testing/docker/base-test/sources.list diff --git a/taskcluster/docker/centos6-build-upd/Dockerfile b/testing/docker/centos6-build-upd/Dockerfile similarity index 100% rename from taskcluster/docker/centos6-build-upd/Dockerfile rename to testing/docker/centos6-build-upd/Dockerfile diff --git a/taskcluster/docker/centos6-build-upd/REGISTRY b/testing/docker/centos6-build-upd/REGISTRY similarity index 100% rename from taskcluster/docker/centos6-build-upd/REGISTRY rename to testing/docker/centos6-build-upd/REGISTRY diff --git a/taskcluster/docker/centos6-build-upd/VERSION b/testing/docker/centos6-build-upd/VERSION similarity index 100% rename from taskcluster/docker/centos6-build-upd/VERSION rename to testing/docker/centos6-build-upd/VERSION diff --git a/taskcluster/docker/centos6-build/Dockerfile b/testing/docker/centos6-build/Dockerfile similarity index 100% rename from taskcluster/docker/centos6-build/Dockerfile rename to testing/docker/centos6-build/Dockerfile diff --git a/taskcluster/docker/centos6-build/REGISTRY b/testing/docker/centos6-build/REGISTRY similarity index 100% rename from taskcluster/docker/centos6-build/REGISTRY rename to testing/docker/centos6-build/REGISTRY diff --git a/taskcluster/docker/centos6-build/VERSION b/testing/docker/centos6-build/VERSION similarity index 100% rename from taskcluster/docker/centos6-build/VERSION rename to testing/docker/centos6-build/VERSION diff --git a/taskcluster/docker/centos6-build/hgrc b/testing/docker/centos6-build/hgrc similarity index 100% rename from taskcluster/docker/centos6-build/hgrc rename to testing/docker/centos6-build/hgrc diff --git a/taskcluster/docker/centos6-build/system-setup.sh b/testing/docker/centos6-build/system-setup.sh similarity index 100% rename from taskcluster/docker/centos6-build/system-setup.sh rename to testing/docker/centos6-build/system-setup.sh diff --git a/taskcluster/docker/decision/Dockerfile b/testing/docker/decision/Dockerfile similarity index 61% rename from taskcluster/docker/decision/Dockerfile rename to testing/docker/decision/Dockerfile index 6226c1e70621..3f58399fd69c 100644 --- a/taskcluster/docker/decision/Dockerfile +++ b/testing/docker/decision/Dockerfile @@ -5,20 +5,20 @@ MAINTAINER Greg Arndt RUN useradd -d /home/worker -s /bin/bash -m worker RUN mkdir /home/worker/artifacts && chown worker:worker /home/worker/artifacts -# %include taskcluster/docker/recipes/tooltool.py -ADD topsrcdir/taskcluster/docker/recipes/tooltool.py /tmp/tooltool.py +# %include testing/docker/recipes/tooltool.py +ADD topsrcdir/testing/docker/recipes/tooltool.py /tmp/tooltool.py # %include testing/mozharness/external_tools/robustcheckout.py ADD topsrcdir/testing/mozharness/external_tools/robustcheckout.py /usr/local/mercurial/robustcheckout.py -# %include taskcluster/docker/recipes/install-mercurial.sh -ADD topsrcdir/taskcluster/docker/recipes/install-mercurial.sh /tmp/install-mercurial.sh +# %include testing/docker/recipes/install-mercurial.sh +ADD topsrcdir/testing/docker/recipes/install-mercurial.sh /tmp/install-mercurial.sh ADD system-setup.sh /tmp/system-setup.sh RUN bash /tmp/system-setup.sh -# %include taskcluster/docker/recipes/run-task -ADD topsrcdir/taskcluster/docker/recipes/run-task /home/worker/bin/run-task +# %include testing/docker/recipes/run-task +ADD topsrcdir/testing/docker/recipes/run-task /home/worker/bin/run-task ENV PATH /home/worker/bin:$PATH ENV SHELL /bin/bash diff --git a/taskcluster/docker/decision/README.md b/testing/docker/decision/README.md similarity index 100% rename from taskcluster/docker/decision/README.md rename to testing/docker/decision/README.md diff --git a/taskcluster/docker/decision/REGISTRY b/testing/docker/decision/REGISTRY similarity index 100% rename from taskcluster/docker/decision/REGISTRY rename to testing/docker/decision/REGISTRY diff --git a/taskcluster/docker/decision/VERSION b/testing/docker/decision/VERSION similarity index 100% rename from taskcluster/docker/decision/VERSION rename to testing/docker/decision/VERSION diff --git a/taskcluster/docker/decision/system-setup.sh b/testing/docker/decision/system-setup.sh similarity index 100% rename from taskcluster/docker/decision/system-setup.sh rename to testing/docker/decision/system-setup.sh diff --git a/taskcluster/docker/desktop-build/Dockerfile b/testing/docker/desktop-build/Dockerfile similarity index 68% rename from taskcluster/docker/desktop-build/Dockerfile rename to testing/docker/desktop-build/Dockerfile index 3bbd0f40b4cd..4ccb4c9856a9 100644 --- a/taskcluster/docker/desktop-build/Dockerfile +++ b/testing/docker/desktop-build/Dockerfile @@ -11,21 +11,21 @@ VOLUME /home/worker/tooltool-cache ADD bin /home/worker/bin RUN chmod +x /home/worker/bin/* -# %include taskcluster/docker/recipes/tooltool.py -ADD topsrcdir/taskcluster/docker/recipes/tooltool.py /builds/tooltool.py -ADD topsrcdir/taskcluster/docker/recipes/tooltool.py /setup/tooltool.py +# %include testing/docker/recipes/tooltool.py +ADD topsrcdir/testing/docker/recipes/tooltool.py /builds/tooltool.py +ADD topsrcdir/testing/docker/recipes/tooltool.py /setup/tooltool.py # %include testing/mozharness/external_tools/robustcheckout.py ADD topsrcdir/testing/mozharness/external_tools/robustcheckout.py /usr/local/mercurial/robustcheckout.py -# %include taskcluster/docker/recipes/common.sh -ADD topsrcdir/taskcluster/docker/recipes/common.sh /setup/common.sh +# %include testing/docker/recipes/common.sh +ADD topsrcdir/testing/docker/recipes/common.sh /setup/common.sh -# %include taskcluster/docker/recipes/install-mercurial.sh -ADD topsrcdir/taskcluster/docker/recipes/install-mercurial.sh /setup/install-mercurial.sh +# %include testing/docker/recipes/install-mercurial.sh +ADD topsrcdir/testing/docker/recipes/install-mercurial.sh /setup/install-mercurial.sh -# %include taskcluster/docker/recipes/centos6-build-system-setup.sh -ADD topsrcdir/taskcluster/docker/recipes/centos6-build-system-setup.sh /setup/system-setup.sh +# %include testing/docker/recipes/centos6-build-system-setup.sh +ADD topsrcdir/testing/docker/recipes/centos6-build-system-setup.sh /setup/system-setup.sh # TODO remove once base image doesn't install Mercurial RUN pip uninstall -y Mercurial @@ -33,11 +33,11 @@ RUN pip uninstall -y Mercurial RUN bash /setup/system-setup.sh # Add wrapper scripts for xvfb allowing tasks to easily retry starting up xvfb -# %include taskcluster/docker/recipes/xvfb.sh -ADD topsrcdir/taskcluster/docker/recipes/xvfb.sh /home/worker/scripts/xvfb.sh +# %include testing/docker/recipes/xvfb.sh +ADD topsrcdir/testing/docker/recipes/xvfb.sh /home/worker/scripts/xvfb.sh -# %include taskcluster/docker/recipes/run-task -ADD topsrcdir/taskcluster/docker/recipes/run-task /home/worker/bin/run-task +# %include testing/docker/recipes/run-task +ADD topsrcdir/testing/docker/recipes/run-task /home/worker/bin/run-task # Add configuration COPY dot-config /home/worker/.config diff --git a/taskcluster/docker/desktop-build/bin/build.sh b/testing/docker/desktop-build/bin/build.sh similarity index 100% rename from taskcluster/docker/desktop-build/bin/build.sh rename to testing/docker/desktop-build/bin/build.sh diff --git a/taskcluster/docker/desktop-build/bin/checkout-script.sh b/testing/docker/desktop-build/bin/checkout-script.sh similarity index 100% rename from taskcluster/docker/desktop-build/bin/checkout-script.sh rename to testing/docker/desktop-build/bin/checkout-script.sh diff --git a/taskcluster/docker/desktop-build/bin/checkout-sources.sh b/testing/docker/desktop-build/bin/checkout-sources.sh similarity index 100% rename from taskcluster/docker/desktop-build/bin/checkout-sources.sh rename to testing/docker/desktop-build/bin/checkout-sources.sh diff --git a/taskcluster/docker/desktop-build/buildprops.json b/testing/docker/desktop-build/buildprops.json similarity index 100% rename from taskcluster/docker/desktop-build/buildprops.json rename to testing/docker/desktop-build/buildprops.json diff --git a/taskcluster/docker/desktop-build/dot-config/pip/pip.conf b/testing/docker/desktop-build/dot-config/pip/pip.conf similarity index 100% rename from taskcluster/docker/desktop-build/dot-config/pip/pip.conf rename to testing/docker/desktop-build/dot-config/pip/pip.conf diff --git a/taskcluster/docker/desktop-build/oauth.txt b/testing/docker/desktop-build/oauth.txt similarity index 100% rename from taskcluster/docker/desktop-build/oauth.txt rename to testing/docker/desktop-build/oauth.txt diff --git a/taskcluster/docker/desktop-test/Dockerfile b/testing/docker/desktop-test/Dockerfile similarity index 83% rename from taskcluster/docker/desktop-test/Dockerfile rename to testing/docker/desktop-test/Dockerfile index 97bccd75db85..995ff34df523 100644 --- a/taskcluster/docker/desktop-test/Dockerfile +++ b/testing/docker/desktop-test/Dockerfile @@ -4,29 +4,29 @@ MAINTAINER Jonas Finnemann Jensen RUN useradd -d /home/worker -s /bin/bash -m worker WORKDIR /home/worker -# %include taskcluster/docker/recipes/tooltool.py -ADD topsrcdir/taskcluster/docker/recipes/tooltool.py /setup/tooltool.py +# %include testing/docker/recipes/tooltool.py +ADD topsrcdir/testing/docker/recipes/tooltool.py /setup/tooltool.py # %include testing/mozharness/external_tools/robustcheckout.py ADD topsrcdir/testing/mozharness/external_tools/robustcheckout.py /usr/local/mercurial/robustcheckout.py -# %include taskcluster/docker/recipes/install-mercurial.sh -ADD topsrcdir/taskcluster/docker/recipes/install-mercurial.sh /tmp/install-mercurial.sh +# %include testing/docker/recipes/install-mercurial.sh +ADD topsrcdir/testing/docker/recipes/install-mercurial.sh /tmp/install-mercurial.sh # Add wrapper scripts for xvfb allowing tasks to easily retry starting up xvfb -# %include taskcluster/docker/recipes/xvfb.sh -ADD topsrcdir/taskcluster/docker/recipes/xvfb.sh /home/worker/scripts/xvfb.sh +# %include testing/docker/recipes/xvfb.sh +ADD topsrcdir/testing/docker/recipes/xvfb.sh /home/worker/scripts/xvfb.sh # Add the tooltool manifest containing the minidump_stackwalk binary. # %include testing/config/tooltool-manifests/linux64/releng.manifest ADD topsrcdir/testing/config/tooltool-manifests/linux64/releng.manifest /tmp/minidump_stackwalk.manifest -# %include taskcluster/docker/recipes/ubuntu1204-test-system-setup.sh -ADD topsrcdir/taskcluster/docker/recipes/ubuntu1204-test-system-setup.sh /setup/system-setup.sh +# %include testing/docker/recipes/ubuntu1204-test-system-setup.sh +ADD topsrcdir/testing/docker/recipes/ubuntu1204-test-system-setup.sh /setup/system-setup.sh RUN bash /setup/system-setup.sh -# %include taskcluster/docker/recipes/run-task -ADD topsrcdir/taskcluster/docker/recipes/run-task /home/worker/bin/run-task +# %include testing/docker/recipes/run-task +ADD topsrcdir/testing/docker/recipes/run-task /home/worker/bin/run-task # %include taskcluster/scripts/tester/test-ubuntu.sh ADD topsrcdir/taskcluster/scripts/tester/test-ubuntu.sh /home/worker/bin/test-linux.sh diff --git a/taskcluster/docker/desktop-test/apport b/testing/docker/desktop-test/apport similarity index 100% rename from taskcluster/docker/desktop-test/apport rename to testing/docker/desktop-test/apport diff --git a/taskcluster/docker/desktop-test/buildprops.json b/testing/docker/desktop-test/buildprops.json similarity index 100% rename from taskcluster/docker/desktop-test/buildprops.json rename to testing/docker/desktop-test/buildprops.json diff --git a/taskcluster/docker/desktop-test/deja-dup-monitor.desktop b/testing/docker/desktop-test/deja-dup-monitor.desktop similarity index 100% rename from taskcluster/docker/desktop-test/deja-dup-monitor.desktop rename to testing/docker/desktop-test/deja-dup-monitor.desktop diff --git a/taskcluster/docker/desktop-test/dot-files/config/pip/pip.conf b/testing/docker/desktop-test/dot-files/config/pip/pip.conf similarity index 100% rename from taskcluster/docker/desktop-test/dot-files/config/pip/pip.conf rename to testing/docker/desktop-test/dot-files/config/pip/pip.conf diff --git a/taskcluster/docker/desktop-test/dot-files/config/user-dirs.dirs b/testing/docker/desktop-test/dot-files/config/user-dirs.dirs similarity index 100% rename from taskcluster/docker/desktop-test/dot-files/config/user-dirs.dirs rename to testing/docker/desktop-test/dot-files/config/user-dirs.dirs diff --git a/taskcluster/docker/desktop-test/dot-files/config/user-dirs.locale b/testing/docker/desktop-test/dot-files/config/user-dirs.locale similarity index 100% rename from taskcluster/docker/desktop-test/dot-files/config/user-dirs.locale rename to testing/docker/desktop-test/dot-files/config/user-dirs.locale diff --git a/taskcluster/docker/desktop-test/dot-files/pulse/default.pa b/testing/docker/desktop-test/dot-files/pulse/default.pa similarity index 100% rename from taskcluster/docker/desktop-test/dot-files/pulse/default.pa rename to testing/docker/desktop-test/dot-files/pulse/default.pa diff --git a/taskcluster/docker/desktop-test/fonts.conf b/testing/docker/desktop-test/fonts.conf similarity index 100% rename from taskcluster/docker/desktop-test/fonts.conf rename to testing/docker/desktop-test/fonts.conf diff --git a/taskcluster/docker/desktop-test/jockey-gtk.desktop b/testing/docker/desktop-test/jockey-gtk.desktop similarity index 100% rename from taskcluster/docker/desktop-test/jockey-gtk.desktop rename to testing/docker/desktop-test/jockey-gtk.desktop diff --git a/taskcluster/docker/desktop-test/motd b/testing/docker/desktop-test/motd similarity index 100% rename from taskcluster/docker/desktop-test/motd rename to testing/docker/desktop-test/motd diff --git a/taskcluster/docker/desktop-test/release-upgrades b/testing/docker/desktop-test/release-upgrades similarity index 100% rename from taskcluster/docker/desktop-test/release-upgrades rename to testing/docker/desktop-test/release-upgrades diff --git a/taskcluster/docker/desktop-test/taskcluster-interactive-shell b/testing/docker/desktop-test/taskcluster-interactive-shell similarity index 100% rename from taskcluster/docker/desktop-test/taskcluster-interactive-shell rename to testing/docker/desktop-test/taskcluster-interactive-shell diff --git a/taskcluster/docker/desktop-test/tc-vcs-config.yml b/testing/docker/desktop-test/tc-vcs-config.yml similarity index 100% rename from taskcluster/docker/desktop-test/tc-vcs-config.yml rename to testing/docker/desktop-test/tc-vcs-config.yml diff --git a/taskcluster/docker/desktop-test/tester.env b/testing/docker/desktop-test/tester.env similarity index 100% rename from taskcluster/docker/desktop-test/tester.env rename to testing/docker/desktop-test/tester.env diff --git a/taskcluster/docker/desktop1604-test/Dockerfile b/testing/docker/desktop1604-test/Dockerfile similarity index 81% rename from taskcluster/docker/desktop1604-test/Dockerfile rename to testing/docker/desktop1604-test/Dockerfile index a2f67edf8735..3690beaea46d 100644 --- a/taskcluster/docker/desktop1604-test/Dockerfile +++ b/testing/docker/desktop1604-test/Dockerfile @@ -4,32 +4,32 @@ MAINTAINER Joel Maher RUN useradd -d /home/worker -s /bin/bash -m worker WORKDIR /home/worker -# %include taskcluster/docker/recipes/tooltool.py -ADD topsrcdir/taskcluster/docker/recipes/tooltool.py /setup/tooltool.py +# %include testing/docker/recipes/tooltool.py +ADD topsrcdir/testing/docker/recipes/tooltool.py /setup/tooltool.py # %include testing/mozharness/external_tools/robustcheckout.py ADD topsrcdir/testing/mozharness/external_tools/robustcheckout.py /usr/local/mercurial/robustcheckout.py -# %include taskcluster/docker/recipes/common.sh -ADD topsrcdir/taskcluster/docker/recipes/common.sh /setup/common.sh +# %include testing/docker/recipes/common.sh +ADD topsrcdir/testing/docker/recipes/common.sh /setup/common.sh -# %include taskcluster/docker/recipes/install-mercurial.sh -ADD topsrcdir/taskcluster/docker/recipes/install-mercurial.sh /setup/install-mercurial.sh +# %include testing/docker/recipes/install-mercurial.sh +ADD topsrcdir/testing/docker/recipes/install-mercurial.sh /setup/install-mercurial.sh # Add the tooltool manifest containing the minidump_stackwalk binary. # %include testing/config/tooltool-manifests/linux64/releng.manifest ADD topsrcdir/testing/config/tooltool-manifests/linux64/releng.manifest /tmp/minidump_stackwalk.manifest -# %include taskcluster/docker/recipes/ubuntu1604-test-system-setup.sh -ADD topsrcdir/taskcluster/docker/recipes/ubuntu1604-test-system-setup.sh /setup/system-setup.sh +# %include testing/docker/recipes/ubuntu1604-test-system-setup.sh +ADD topsrcdir/testing/docker/recipes/ubuntu1604-test-system-setup.sh /setup/system-setup.sh RUN bash /setup/system-setup.sh # Add wrapper scripts for xvfb allowing tasks to easily retry starting up xvfb -# %include taskcluster/docker/recipes/xvfb.sh -ADD topsrcdir/taskcluster/docker/recipes/xvfb.sh /home/worker/scripts/xvfb.sh +# %include testing/docker/recipes/xvfb.sh +ADD topsrcdir/testing/docker/recipes/xvfb.sh /home/worker/scripts/xvfb.sh -# %include taskcluster/docker/recipes/run-task -ADD topsrcdir/taskcluster/docker/recipes/run-task /home/worker/bin/run-task +# %include testing/docker/recipes/run-task +ADD topsrcdir/testing/docker/recipes/run-task /home/worker/bin/run-task # %include taskcluster/scripts/tester/test-ubuntu.sh ADD topsrcdir/taskcluster/scripts/tester/test-ubuntu.sh /home/worker/bin/test-linux.sh diff --git a/taskcluster/docker/desktop1604-test/apport b/testing/docker/desktop1604-test/apport similarity index 100% rename from taskcluster/docker/desktop1604-test/apport rename to testing/docker/desktop1604-test/apport diff --git a/taskcluster/docker/desktop1604-test/buildprops.json b/testing/docker/desktop1604-test/buildprops.json similarity index 100% rename from taskcluster/docker/desktop1604-test/buildprops.json rename to testing/docker/desktop1604-test/buildprops.json diff --git a/taskcluster/docker/desktop1604-test/deja-dup-monitor.desktop b/testing/docker/desktop1604-test/deja-dup-monitor.desktop similarity index 100% rename from taskcluster/docker/desktop1604-test/deja-dup-monitor.desktop rename to testing/docker/desktop1604-test/deja-dup-monitor.desktop diff --git a/taskcluster/docker/desktop1604-test/dot-files/config/pip/pip.conf b/testing/docker/desktop1604-test/dot-files/config/pip/pip.conf similarity index 100% rename from taskcluster/docker/desktop1604-test/dot-files/config/pip/pip.conf rename to testing/docker/desktop1604-test/dot-files/config/pip/pip.conf diff --git a/taskcluster/docker/desktop1604-test/dot-files/config/user-dirs.dirs b/testing/docker/desktop1604-test/dot-files/config/user-dirs.dirs similarity index 100% rename from taskcluster/docker/desktop1604-test/dot-files/config/user-dirs.dirs rename to testing/docker/desktop1604-test/dot-files/config/user-dirs.dirs diff --git a/taskcluster/docker/desktop1604-test/dot-files/config/user-dirs.locale b/testing/docker/desktop1604-test/dot-files/config/user-dirs.locale similarity index 100% rename from taskcluster/docker/desktop1604-test/dot-files/config/user-dirs.locale rename to testing/docker/desktop1604-test/dot-files/config/user-dirs.locale diff --git a/taskcluster/docker/desktop1604-test/dot-files/pulse/default.pa b/testing/docker/desktop1604-test/dot-files/pulse/default.pa similarity index 100% rename from taskcluster/docker/desktop1604-test/dot-files/pulse/default.pa rename to testing/docker/desktop1604-test/dot-files/pulse/default.pa diff --git a/taskcluster/docker/desktop1604-test/fonts.conf b/testing/docker/desktop1604-test/fonts.conf similarity index 100% rename from taskcluster/docker/desktop1604-test/fonts.conf rename to testing/docker/desktop1604-test/fonts.conf diff --git a/taskcluster/docker/desktop1604-test/jockey-gtk.desktop b/testing/docker/desktop1604-test/jockey-gtk.desktop similarity index 100% rename from taskcluster/docker/desktop1604-test/jockey-gtk.desktop rename to testing/docker/desktop1604-test/jockey-gtk.desktop diff --git a/taskcluster/docker/desktop1604-test/motd b/testing/docker/desktop1604-test/motd similarity index 100% rename from taskcluster/docker/desktop1604-test/motd rename to testing/docker/desktop1604-test/motd diff --git a/taskcluster/docker/desktop1604-test/release-upgrades b/testing/docker/desktop1604-test/release-upgrades similarity index 100% rename from taskcluster/docker/desktop1604-test/release-upgrades rename to testing/docker/desktop1604-test/release-upgrades diff --git a/taskcluster/docker/desktop1604-test/taskcluster-interactive-shell b/testing/docker/desktop1604-test/taskcluster-interactive-shell similarity index 100% rename from taskcluster/docker/desktop1604-test/taskcluster-interactive-shell rename to testing/docker/desktop1604-test/taskcluster-interactive-shell diff --git a/taskcluster/docker/desktop1604-test/tc-vcs-config.yml b/testing/docker/desktop1604-test/tc-vcs-config.yml similarity index 100% rename from taskcluster/docker/desktop1604-test/tc-vcs-config.yml rename to testing/docker/desktop1604-test/tc-vcs-config.yml diff --git a/taskcluster/docker/desktop1604-test/tester.env b/testing/docker/desktop1604-test/tester.env similarity index 100% rename from taskcluster/docker/desktop1604-test/tester.env rename to testing/docker/desktop1604-test/tester.env diff --git a/taskcluster/docker/image_builder/Dockerfile b/testing/docker/image_builder/Dockerfile similarity index 51% rename from taskcluster/docker/image_builder/Dockerfile rename to testing/docker/image_builder/Dockerfile index 41c718c8c188..9acbafaab7eb 100644 --- a/taskcluster/docker/image_builder/Dockerfile +++ b/testing/docker/image_builder/Dockerfile @@ -1,19 +1,19 @@ FROM ubuntu:16.04 -# %include taskcluster/docker/recipes/tooltool.py -ADD topsrcdir/taskcluster/docker/recipes/tooltool.py /setup/tooltool.py +# %include testing/docker/recipes/tooltool.py +ADD topsrcdir/testing/docker/recipes/tooltool.py /setup/tooltool.py -# %include taskcluster/docker/recipes/common.sh -ADD topsrcdir/taskcluster/docker/recipes/common.sh /setup/common.sh +# %include testing/docker/recipes/common.sh +ADD topsrcdir/testing/docker/recipes/common.sh /setup/common.sh -# %include taskcluster/docker/recipes/install-mercurial.sh -ADD topsrcdir/taskcluster/docker/recipes/install-mercurial.sh /setup/install-mercurial.sh +# %include testing/docker/recipes/install-mercurial.sh +ADD topsrcdir/testing/docker/recipes/install-mercurial.sh /setup/install-mercurial.sh -# %include taskcluster/mozharness/external_tools/robustcheckout.py -ADD topsrcdir/taskcluster/mozharness/external_tools/robustcheckout.py /usr/local/mercurial/robustcheckout.py +# %include testing/mozharness/external_tools/robustcheckout.py +ADD topsrcdir/testing/mozharness/external_tools/robustcheckout.py /usr/local/mercurial/robustcheckout.py -# %include taskcluster/docker/recipes/run-task -ADD topsrcdir/taskcluster/docker/recipes/run-task /usr/local/bin/run-task +# %include testing/docker/recipes/run-task +ADD topsrcdir/testing/docker/recipes/run-task /usr/local/bin/run-task # Add and run setup script ADD build-image.sh /usr/local/bin/build-image.sh diff --git a/taskcluster/docker/image_builder/REGISTRY b/testing/docker/image_builder/REGISTRY similarity index 100% rename from taskcluster/docker/image_builder/REGISTRY rename to testing/docker/image_builder/REGISTRY diff --git a/taskcluster/docker/image_builder/VERSION b/testing/docker/image_builder/VERSION similarity index 100% rename from taskcluster/docker/image_builder/VERSION rename to testing/docker/image_builder/VERSION diff --git a/taskcluster/docker/image_builder/build-image.sh b/testing/docker/image_builder/build-image.sh similarity index 100% rename from taskcluster/docker/image_builder/build-image.sh rename to testing/docker/image_builder/build-image.sh diff --git a/taskcluster/docker/image_builder/setup.sh b/testing/docker/image_builder/setup.sh similarity index 100% rename from taskcluster/docker/image_builder/setup.sh rename to testing/docker/image_builder/setup.sh diff --git a/taskcluster/docker/lint/Dockerfile b/testing/docker/lint/Dockerfile similarity index 73% rename from taskcluster/docker/lint/Dockerfile rename to testing/docker/lint/Dockerfile index cd625d6a340f..7e9b41214cf0 100644 --- a/taskcluster/docker/lint/Dockerfile +++ b/testing/docker/lint/Dockerfile @@ -5,21 +5,21 @@ RUN useradd -d /home/worker -s /bin/bash -m worker WORKDIR /home/worker RUN mkdir /build -# %include taskcluster/docker/recipes/tooltool.py -ADD topsrcdir/taskcluster/docker/recipes/tooltool.py /build/tooltool.py +# %include testing/docker/recipes/tooltool.py +ADD topsrcdir/testing/docker/recipes/tooltool.py /build/tooltool.py # %include testing/mozharness/external_tools/robustcheckout.py ADD topsrcdir/testing/mozharness/external_tools/robustcheckout.py /usr/local/mercurial/robustcheckout.py -# %include taskcluster/docker/recipes/install-mercurial.sh -ADD topsrcdir/taskcluster/docker/recipes/install-mercurial.sh /build/install-mercurial.sh +# %include testing/docker/recipes/install-mercurial.sh +ADD topsrcdir/testing/docker/recipes/install-mercurial.sh /build/install-mercurial.sh ADD system-setup.sh /tmp/system-setup.sh # %include tools/lint/flake8/flake8_requirements.txt ADD topsrcdir/tools/lint/flake8/flake8_requirements.txt /tmp/flake8_requirements.txt RUN bash /tmp/system-setup.sh -# %include taskcluster/docker/recipes/run-task -ADD topsrcdir/taskcluster/docker/recipes/run-task /home/worker/bin/run-task +# %include testing/docker/recipes/run-task +ADD topsrcdir/testing/docker/recipes/run-task /home/worker/bin/run-task RUN chown -R worker:worker /home/worker/bin && chmod 755 /home/worker/bin/* # Set variable normally configured at login, by the shells parent process, these diff --git a/taskcluster/docker/lint/system-setup.sh b/testing/docker/lint/system-setup.sh similarity index 100% rename from taskcluster/docker/lint/system-setup.sh rename to testing/docker/lint/system-setup.sh diff --git a/taskcluster/docker/recipes/centos6-build-system-setup.sh b/testing/docker/recipes/centos6-build-system-setup.sh similarity index 100% rename from taskcluster/docker/recipes/centos6-build-system-setup.sh rename to testing/docker/recipes/centos6-build-system-setup.sh diff --git a/taskcluster/docker/recipes/common.sh b/testing/docker/recipes/common.sh similarity index 100% rename from taskcluster/docker/recipes/common.sh rename to testing/docker/recipes/common.sh diff --git a/taskcluster/docker/recipes/install-mercurial.sh b/testing/docker/recipes/install-mercurial.sh similarity index 100% rename from taskcluster/docker/recipes/install-mercurial.sh rename to testing/docker/recipes/install-mercurial.sh diff --git a/taskcluster/docker/recipes/run-task b/testing/docker/recipes/run-task similarity index 100% rename from taskcluster/docker/recipes/run-task rename to testing/docker/recipes/run-task diff --git a/taskcluster/docker/recipes/tooltool.py b/testing/docker/recipes/tooltool.py similarity index 100% rename from taskcluster/docker/recipes/tooltool.py rename to testing/docker/recipes/tooltool.py diff --git a/taskcluster/docker/recipes/ubuntu1204-test-system-setup.sh b/testing/docker/recipes/ubuntu1204-test-system-setup.sh similarity index 100% rename from taskcluster/docker/recipes/ubuntu1204-test-system-setup.sh rename to testing/docker/recipes/ubuntu1204-test-system-setup.sh diff --git a/taskcluster/docker/recipes/ubuntu1604-test-system-setup.sh b/testing/docker/recipes/ubuntu1604-test-system-setup.sh similarity index 100% rename from taskcluster/docker/recipes/ubuntu1604-test-system-setup.sh rename to testing/docker/recipes/ubuntu1604-test-system-setup.sh diff --git a/taskcluster/docker/recipes/xvfb.sh b/testing/docker/recipes/xvfb.sh similarity index 100% rename from taskcluster/docker/recipes/xvfb.sh rename to testing/docker/recipes/xvfb.sh diff --git a/taskcluster/docker/rust-build/Dockerfile b/testing/docker/rust-build/Dockerfile similarity index 100% rename from taskcluster/docker/rust-build/Dockerfile rename to testing/docker/rust-build/Dockerfile diff --git a/taskcluster/docker/rust-build/README.md b/testing/docker/rust-build/README.md similarity index 100% rename from taskcluster/docker/rust-build/README.md rename to testing/docker/rust-build/README.md diff --git a/taskcluster/docker/rust-build/REGISTRY b/testing/docker/rust-build/REGISTRY similarity index 100% rename from taskcluster/docker/rust-build/REGISTRY rename to testing/docker/rust-build/REGISTRY diff --git a/taskcluster/docker/rust-build/VERSION b/testing/docker/rust-build/VERSION similarity index 100% rename from taskcluster/docker/rust-build/VERSION rename to testing/docker/rust-build/VERSION diff --git a/taskcluster/docker/rust-build/build_cargo.sh b/testing/docker/rust-build/build_cargo.sh similarity index 100% rename from taskcluster/docker/rust-build/build_cargo.sh rename to testing/docker/rust-build/build_cargo.sh diff --git a/taskcluster/docker/rust-build/build_rust.sh b/testing/docker/rust-build/build_rust.sh similarity index 100% rename from taskcluster/docker/rust-build/build_rust.sh rename to testing/docker/rust-build/build_rust.sh diff --git a/taskcluster/docker/rust-build/build_rust_mac.sh b/testing/docker/rust-build/build_rust_mac.sh similarity index 100% rename from taskcluster/docker/rust-build/build_rust_mac.sh rename to testing/docker/rust-build/build_rust_mac.sh diff --git a/taskcluster/docker/rust-build/fetch_cargo.sh b/testing/docker/rust-build/fetch_cargo.sh similarity index 100% rename from taskcluster/docker/rust-build/fetch_cargo.sh rename to testing/docker/rust-build/fetch_cargo.sh diff --git a/taskcluster/docker/rust-build/fetch_rust.sh b/testing/docker/rust-build/fetch_rust.sh similarity index 100% rename from taskcluster/docker/rust-build/fetch_rust.sh rename to testing/docker/rust-build/fetch_rust.sh diff --git a/taskcluster/docker/rust-build/package_rust.sh b/testing/docker/rust-build/package_rust.sh similarity index 100% rename from taskcluster/docker/rust-build/package_rust.sh rename to testing/docker/rust-build/package_rust.sh diff --git a/testing/docker/rust-build/repack_rust.py b/testing/docker/rust-build/repack_rust.py new file mode 100644 index 000000000000..4883a7b76ea2 --- /dev/null +++ b/testing/docker/rust-build/repack_rust.py @@ -0,0 +1,175 @@ +#!/bin/env python +''' +This script downloads and repacks official rust language builds +with the necessary tool and target support for the Firefox +build environment. +''' + +import os.path +import requests +import subprocess +import toml + +def fetch_file(url): + '''Download a file from the given url if it's not already present.''' + filename = os.path.basename(url) + if os.path.exists(filename): + return + r = requests.get(url, stream=True) + r.raise_for_status() + with open(filename, 'wb') as fd: + for chunk in r.iter_content(4096): + fd.write(chunk) + +def fetch(url): + '''Download and verify a package url.''' + base = os.path.basename(url) + print('Fetching %s...' % base) + fetch_file(url + '.asc') + fetch_file(url) + fetch_file(url + '.sha256') + fetch_file(url + '.asc.sha256') + print('Verifying %s...' % base) + subprocess.check_call(['shasum', '-c', base + '.sha256']) + subprocess.check_call(['shasum', '-c', base + '.asc.sha256']) + subprocess.check_call(['gpg', '--verify', base + '.asc', base]) + if False: + subprocess.check_call(['keybase', 'pgp', 'verify', + '-d', base + '.asc', + '-i', base, + ]) + +def install(filename, target): + '''Run a package's installer script against the given target directory.''' + print(' Unpacking %s...' % filename) + subprocess.check_call(['tar', 'xf', filename]) + basename = filename.split('.tar')[0] + print(' Installing %s...' % basename) + install_cmd = [os.path.join(basename, 'install.sh')] + install_cmd += ['--prefix=' + os.path.abspath(target)] + install_cmd += ['--disable-ldconfig'] + subprocess.check_call(install_cmd) + print(' Cleaning %s...' % basename) + subprocess.check_call(['rm', '-rf', basename]) + +def package(manifest, pkg, target): + '''Pull out the package dict for a particular package and target + from the given manifest.''' + version = manifest['pkg'][pkg]['version'] + info = manifest['pkg'][pkg]['target'][target] + return (version, info) + +def fetch_package(manifest, pkg, host): + version, info = package(manifest, pkg, host) + print('%s %s\n %s\n %s' % (pkg, version, info['url'], info['hash'])) + if not info['available']: + print('%s marked unavailable for %s' % (pkg, host)) + raise AssertionError + fetch(info['url']) + return info + +def fetch_std(manifest, targets): + stds = [] + for target in targets: + info = fetch_package(manifest, 'rust-std', target) + stds.append(info) + return stds + +def tar_for_host(host): + if 'linux' in host: + tar_options = 'cJf' + tar_ext = '.tar.xz' + else: + tar_options = 'cjf' + tar_ext = '.tar.bz2' + return tar_options, tar_ext + +def repack(host, targets, channel='stable', suffix=''): + print("Repacking rust for %s..." % host) + url = 'https://static.rust-lang.org/dist/channel-rust-' + channel + '.toml' + req = requests.get(url) + req.raise_for_status() + manifest = toml.loads(req.content) + if manifest['manifest-version'] != '2': + print('ERROR: unrecognized manifest version %s.' % manifest['manifest-version']) + return + print('Using manifest for rust %s as of %s.' % (channel, manifest['date'])) + print('Fetching packages...') + rustc = fetch_package(manifest, 'rustc', host) + cargo = fetch_package(manifest, 'cargo', host) + stds = fetch_std(manifest, targets) + print('Installing packages...') + tar_basename = 'rustc-' + host + if suffix: + tar_basename += '-' + suffix + tar_basename += '-repack' + install_dir = 'rustc' + subprocess.check_call(['rm', '-rf', install_dir]) + install(os.path.basename(rustc['url']), install_dir) + install(os.path.basename(cargo['url']), install_dir) + for std in stds: + install(os.path.basename(std['url']), install_dir) + pass + print('Tarring %s...' % tar_basename) + tar_options, tar_ext = tar_for_host(host) + subprocess.check_call(['tar', tar_options, tar_basename + tar_ext, install_dir]) + subprocess.check_call(['rm', '-rf', install_dir]) + +def repack_cargo(host, channel='nightly'): + print("Repacking cargo for %s..." % host) + # Cargo doesn't seem to have a .toml manifest. + base_url = 'https://static.rust-lang.org/cargo-dist/' + req = requests.get(os.path.join(base_url, 'channel-cargo-' + channel)) + req.raise_for_status() + file = '' + for line in req.iter_lines(): + if line.find(host) != -1: + file = line.strip() + if not file: + print('No manifest entry for %s!' % host) + return + manifest = { + 'date': req.headers['Last-Modified'], + 'pkg': { + 'cargo': { + 'version': channel, + 'target': { + host: { + 'url': os.path.join(base_url, file), + 'hash': None, + 'available': True, + }, + }, + }, + }, + } + print('Using manifest for cargo %s.' % channel) + print('Fetching packages...') + cargo = fetch_package(manifest, 'cargo', host) + print('Installing packages...') + install_dir = 'cargo' + subprocess.check_call(['rm', '-rf', install_dir]) + install(os.path.basename(cargo['url']), install_dir) + tar_basename = 'cargo-%s-repack' % host + print('Tarring %s...' % tar_basename) + tar_options, tar_ext = tar_for_host(host) + subprocess.check_call(['tar', tar_options, tar_basename + tar_ext, install_dir]) + subprocess.check_call(['rm', '-rf', install_dir]) + +# rust platform triples +android="armv7-linux-androideabi" +android_x86="i686-linux-android" +linux64="x86_64-unknown-linux-gnu" +linux32="i686-unknown-linux-gnu" +mac64="x86_64-apple-darwin" +mac32="i686-apple-darwin" +win64="x86_64-pc-windows-msvc" +win32="i686-pc-windows-msvc" + +if __name__ == '__main__': + repack(mac64, [mac64, mac32]) + repack(win32, [win32]) + repack(win64, [win64]) + repack(linux64, [linux64, linux32]) + repack(linux64, [linux64, mac64, mac32], suffix='mac-cross') + repack(linux64, [linux64, android, android_x86], suffix='android-cross') diff --git a/taskcluster/docker/rust-build/splat_rust.py b/testing/docker/rust-build/splat_rust.py similarity index 95% rename from taskcluster/docker/rust-build/splat_rust.py rename to testing/docker/rust-build/splat_rust.py index 34032b5883d3..860ed347cb9b 100644 --- a/taskcluster/docker/rust-build/splat_rust.py +++ b/testing/docker/rust-build/splat_rust.py @@ -10,20 +10,17 @@ import sys from collections import OrderedDict - def load_manifest(path): with open(path) as f: return json.load(f, object_pairs_hook=OrderedDict) return None - def save_manifest(manifest, path): with open(path, 'w') as f: json.dump(manifest, f, - indent=0, separators=(',', ': ')) + indent=0, separators=(',', ': ')) f.write('\n') - def replace(manifest, stanza): key = 'rustc' version = stanza.get('version') @@ -37,10 +34,9 @@ def replace(manifest, stanza): s['size'] = stanza['size'] print(' new %s' % s['digest'][:12]) return True - print('Warning: Could not find matching %s filename' % key) + print('Warning: Could not find matching %s filename' %key) return False - def update_manifest(source_manifest, target, target_filename): for stanza in source_manifest: filename = stanza.get('filename') @@ -103,4 +99,4 @@ if __name__ == '__main__': for target, filenames in TARGETS.items(): for target_filename in filenames: update_manifest(updates, target, - os.path.join(base_path, target_filename)) + os.path.join(base_path, target_filename)) diff --git a/taskcluster/docker/rust-build/task.json b/testing/docker/rust-build/task.json similarity index 100% rename from taskcluster/docker/rust-build/task.json rename to testing/docker/rust-build/task.json diff --git a/taskcluster/docker/rust-build/tcbuild.py b/testing/docker/rust-build/tcbuild.py similarity index 85% rename from taskcluster/docker/rust-build/tcbuild.py rename to testing/docker/rust-build/tcbuild.py index f96315a7d6aa..8f99e95bac1e 100644 --- a/taskcluster/docker/rust-build/tcbuild.py +++ b/testing/docker/rust-build/tcbuild.py @@ -20,23 +20,18 @@ import tempfile import time import tooltool -requests.packages.urllib3.disable_warnings() - - def local_file(filename): ''' Return a path to a file next to this script. ''' return os.path.join(os.path.dirname(__file__), filename) - def read_tc_auth(tc_auth_file): ''' Read taskcluster credentials from tc_auth_file and return them as a dict. ''' return json.load(open(tc_auth_file, 'rb')) - def fill_template_dict(d, keys): for key, val in d.items(): if isinstance(val, basestring) and '{' in val: @@ -44,7 +39,6 @@ def fill_template_dict(d, keys): elif isinstance(val, dict): fill_template_dict(val, keys) - def fill_template(template_file, keys): ''' Take the file object template_file, parse it as JSON, and @@ -54,7 +48,6 @@ def fill_template(template_file, keys): fill_template_dict(template, keys) return template - def spawn_task(queue, args): ''' Spawn a Taskcluster task in queue using args. @@ -64,16 +57,13 @@ def spawn_task(queue, args): keys = vars(args) now = datetime.datetime.utcnow() keys['task_created'] = now.isoformat() + 'Z' - keys['task_deadline'] = (now + datetime.timedelta( - hours=2)).isoformat() + 'Z' - keys['artifacts_expires'] = (now + datetime.timedelta( - days=1)).isoformat() + 'Z' + keys['task_deadline'] = (now + datetime.timedelta(hours=2)).isoformat() + 'Z' + keys['artifacts_expires'] = (now + datetime.timedelta(days=1)).isoformat() + 'Z' payload = fill_template(template, keys) queue.createTask(task_id, payload) print('--- %s task %s submitted ---' % (now, task_id)) return task_id - def wait_for_task(queue, task_id, initial_wait=5): ''' Wait until queue reports that task task_id is completed, and return @@ -91,8 +81,8 @@ def wait_for_task(queue, task_id, initial_wait=5): if state != previous_state: now = datetime.datetime.utcnow() if have_ticks: - sys.stdout.write('\n') - have_ticks = False + sys.stdout.write('\n') + have_ticks = False print('--- %s task %s %s ---' % (now, task_id, state)) previous_state = state if state == 'completed': @@ -104,7 +94,6 @@ def wait_for_task(queue, task_id, initial_wait=5): have_ticks = True time.sleep(10) - def fetch_artifact(queue, task_id, run_id, name, dest_dir): ''' Fetch the artifact with name from task_id and run_id in queue, @@ -125,13 +114,11 @@ def fetch_artifact(queue, task_id, run_id, name, dest_dir): return None return fn - def make_artifact_dir(task_id, run_id): prefix = 'tc-artifacts.%s.%d.' % (task_id, run_id) print('making artifact dir %s' % prefix) return tempfile.mkdtemp(prefix=prefix) - def fetch_artifacts(queue, task_id, run_id): ''' Fetch all artifacts from task_id and run_id in queue, write them to @@ -150,11 +137,10 @@ def fetch_artifacts(queue, task_id, run_id): yield fetch_artifact(queue, task_id, run_id, a['name'], tempdir) finally: if os.path.isdir(tempdir): - # shutil.rmtree(tempdir) + #shutil.rmtree(tempdir) print('Artifacts downloaded to %s' % tempdir) pass - def upload_to_tooltool(tooltool_auth, task_id, artifact): ''' Upload artifact to tooltool using tooltool_auth as the authentication token. @@ -182,7 +168,6 @@ def upload_to_tooltool(tooltool_auth, task_id, artifact): finally: os.chdir(oldcwd) - def update_manifest(artifact, manifest, local_gecko_clone): platform = 'linux' manifest_dir = os.path.join(local_gecko_clone, @@ -193,19 +178,11 @@ def update_manifest(artifact, manifest, local_gecko_clone): print('%s -> %s' % (manifest, tree_manifest)) shutil.copyfile(manifest, tree_manifest) - def main(): parser = argparse.ArgumentParser(description='Build and upload binaries') - parser.add_argument('taskcluster_auth', - help='Path to a file containing Taskcluster client ' - 'ID and authentication token as a JSON file in ' - 'the form {"clientId": "...", "accessToken": "..."}') - parser.add_argument('--tooltool-auth', - help='Path to a file containing a tooltool ' - 'authentication token valid for uploading files') - parser.add_argument('--local-gecko-clone', - help='Path to a local Gecko clone whose tooltool ' - 'manifests will be updated with the newly-built binaries') + parser.add_argument('taskcluster_auth', help='Path to a file containing Taskcluster client ID and authentication token as a JSON file in the form {"clientId": "...", "accessToken": "..."}') + parser.add_argument('--tooltool-auth', help='Path to a file containing a tooltool authentication token valid for uploading files') + parser.add_argument('--local-gecko-clone', help='Path to a local Gecko clone whose tooltool manifests will be updated with the newly-built binaries') parser.add_argument('--rust-branch', default='stable', help='Revision of the rust repository to use') parser.add_argument('--task', help='Use an existing task') @@ -220,11 +197,9 @@ def main(): run_id = wait_for_task(queue, task_id, initial_wait) for artifact in fetch_artifacts(queue, task_id, run_id): if args.tooltool_auth: - manifest = upload_to_tooltool(args.tooltool_auth, task_id, - artifact) + manifest = upload_to_tooltool(args.tooltool_auth, task_id, artifact) if args.local_gecko_clone: update_manifest(artifact, manifest, args.local_gecko_clone) - if __name__ == '__main__': main() diff --git a/taskcluster/docker/rust-build/upload_rust.sh b/testing/docker/rust-build/upload_rust.sh similarity index 100% rename from taskcluster/docker/rust-build/upload_rust.sh rename to testing/docker/rust-build/upload_rust.sh diff --git a/taskcluster/docker/tester/Dockerfile b/testing/docker/tester/Dockerfile similarity index 100% rename from taskcluster/docker/tester/Dockerfile rename to testing/docker/tester/Dockerfile diff --git a/taskcluster/docker/tester/REGISTRY b/testing/docker/tester/REGISTRY similarity index 100% rename from taskcluster/docker/tester/REGISTRY rename to testing/docker/tester/REGISTRY diff --git a/taskcluster/docker/tester/VERSION b/testing/docker/tester/VERSION similarity index 100% rename from taskcluster/docker/tester/VERSION rename to testing/docker/tester/VERSION diff --git a/taskcluster/docker/tester/bin/test.sh b/testing/docker/tester/bin/test.sh similarity index 100% rename from taskcluster/docker/tester/bin/test.sh rename to testing/docker/tester/bin/test.sh diff --git a/taskcluster/docker/tester/dot-config/pip/pip.conf b/testing/docker/tester/dot-config/pip/pip.conf similarity index 100% rename from taskcluster/docker/tester/dot-config/pip/pip.conf rename to testing/docker/tester/dot-config/pip/pip.conf diff --git a/taskcluster/docker/tester/dot-config/user-dirs.dirs b/testing/docker/tester/dot-config/user-dirs.dirs similarity index 100% rename from taskcluster/docker/tester/dot-config/user-dirs.dirs rename to testing/docker/tester/dot-config/user-dirs.dirs diff --git a/taskcluster/docker/tester/dot-config/user-dirs.locale b/testing/docker/tester/dot-config/user-dirs.locale similarity index 100% rename from taskcluster/docker/tester/dot-config/user-dirs.locale rename to testing/docker/tester/dot-config/user-dirs.locale diff --git a/taskcluster/docker/tester/dot-pulse/default.pa b/testing/docker/tester/dot-pulse/default.pa similarity index 100% rename from taskcluster/docker/tester/dot-pulse/default.pa rename to testing/docker/tester/dot-pulse/default.pa diff --git a/taskcluster/docker/tester/tc-vcs-config.yml b/testing/docker/tester/tc-vcs-config.yml similarity index 100% rename from taskcluster/docker/tester/tc-vcs-config.yml rename to testing/docker/tester/tc-vcs-config.yml diff --git a/taskcluster/docker/tester/tester.env b/testing/docker/tester/tester.env similarity index 100% rename from taskcluster/docker/tester/tester.env rename to testing/docker/tester/tester.env diff --git a/taskcluster/docker/upload-symbols/Dockerfile b/testing/docker/upload-symbols/Dockerfile similarity index 100% rename from taskcluster/docker/upload-symbols/Dockerfile rename to testing/docker/upload-symbols/Dockerfile diff --git a/taskcluster/docker/upload-symbols/README.md b/testing/docker/upload-symbols/README.md similarity index 100% rename from taskcluster/docker/upload-symbols/README.md rename to testing/docker/upload-symbols/README.md diff --git a/taskcluster/docker/upload-symbols/bin/checkout-script.sh b/testing/docker/upload-symbols/bin/checkout-script.sh similarity index 100% rename from taskcluster/docker/upload-symbols/bin/checkout-script.sh rename to testing/docker/upload-symbols/bin/checkout-script.sh diff --git a/taskcluster/docker/upload-symbols/bin/upload.sh b/testing/docker/upload-symbols/bin/upload.sh similarity index 100% rename from taskcluster/docker/upload-symbols/bin/upload.sh rename to testing/docker/upload-symbols/bin/upload.sh diff --git a/taskcluster/docker/upload-symbols/test_exports.sh b/testing/docker/upload-symbols/test_exports.sh similarity index 100% rename from taskcluster/docker/upload-symbols/test_exports.sh rename to testing/docker/upload-symbols/test_exports.sh From a2a8f735304720919134da66594b972877e127df Mon Sep 17 00:00:00 2001 From: Henrik Skupin Date: Thu, 15 Dec 2016 17:00:20 +0100 Subject: [PATCH 07/70] Bug 1323451 - Fix test failures in test_navigation.py for Fennec. r=ato MozReview-Commit-ID: 9YmBJIp0vAJ --HG-- extra : rebase_source : d58536432a9271ac197ec6838e08785a42d8ecf6 --- testing/marionette/driver.js | 37 +------------------ .../tests/unit/test_navigation.py | 13 ++++--- 2 files changed, 9 insertions(+), 41 deletions(-) diff --git a/testing/marionette/driver.js b/testing/marionette/driver.js index c722b6644451..a6f924501d89 100644 --- a/testing/marionette/driver.js +++ b/testing/marionette/driver.js @@ -1023,46 +1023,11 @@ GeckoDriver.prototype.get = function*(cmd, resp) { break; case Context.CHROME: - // At least on desktop, navigating in chrome scope does not - // correspond to something a user can do, and leaves marionette - // and the browser in an unusable state. Return a generic error insted. - // TODO: Error codes need to be refined as a part of bug 1100545 and - // bug 945729. - if (this.appName == "Firefox") { - throw new UnknownError("Cannot navigate in chrome context"); - } - - this.getCurrentWindow().location.href = url; - yield this.pageLoadPromise(); + throw new UnsupportedOperationError("Cannot navigate in chrome context"); break; } }; -GeckoDriver.prototype.pageLoadPromise = function() { - let win = this.getCurrentWindow(); - let timeout = this.pageTimeout; - let checkTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer); - let start = new Date().getTime(); - let end = null; - - return new Promise((resolve) => { - let checkLoad = function() { - end = new Date().getTime(); - let elapse = end - start; - if (timeout === null || elapse <= timeout) { - if (win.document.readyState == "complete") { - resolve(); - } else { - checkTimer.initWithCallback(checkLoad, 100, Ci.nsITimer.TYPE_ONE_SHOT); - } - } else { - throw new UnknownError("Error loading page"); - } - }; - checkTimer.initWithCallback(checkLoad, 100, Ci.nsITimer.TYPE_ONE_SHOT); - }); -}; - /** * Get a string representing the current URL. * diff --git a/testing/marionette/harness/marionette_harness/tests/unit/test_navigation.py b/testing/marionette/harness/marionette_harness/tests/unit/test_navigation.py index bfba853c4f0b..3d2821b46e3f 100644 --- a/testing/marionette/harness/marionette_harness/tests/unit/test_navigation.py +++ b/testing/marionette/harness/marionette_harness/tests/unit/test_navigation.py @@ -2,13 +2,15 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. +from unittest import skip + import contextlib import time import urllib from marionette_driver import errors, By, Wait -from marionette_harness import MarionetteTestCase, WindowManagerMixin +from marionette_harness import MarionetteTestCase, skip_if_mobile, WindowManagerMixin def inline(doc): @@ -48,8 +50,8 @@ class TestNavigate(WindowManagerMixin, MarionetteTestCase): def test_navigate_chrome_error(self): with self.marionette.using_context("chrome"): self.assertRaisesRegexp( - errors.MarionetteException, "Cannot navigate in chrome context", - self.marionette.navigate, "about:blank") + errors.UnsupportedOperationException, "Cannot navigate in chrome context", + self.marionette.navigate, "about:blank") def test_get_current_url_returns_top_level_browsing_context_url(self): self.marionette.navigate(self.iframe_doc) @@ -101,7 +103,7 @@ class TestNavigate(WindowManagerMixin, MarionetteTestCase): self.assertTrue(self.marionette.execute_script( "return window.document.getElementById('someDiv') == undefined")) - """ Disabled due to Bug 977899 + @skip("Disabled due to Bug 977899") def test_navigate_frame(self): self.marionette.navigate(self.marionette.absolute_url("test_iframe.html")) self.marionette.switch_to_frame(0) @@ -109,8 +111,8 @@ class TestNavigate(WindowManagerMixin, MarionetteTestCase): self.assertTrue('empty.html' in self.marionette.get_url()) self.marionette.switch_to_frame() self.assertTrue('test_iframe.html' in self.marionette.get_url()) - """ + @skip_if_mobile # Bug 1323755 - Socket timeout def test_invalid_protocol(self): with self.assertRaises(errors.MarionetteException): self.marionette.navigate("thisprotocoldoesnotexist://") @@ -148,6 +150,7 @@ class TestNavigate(WindowManagerMixin, MarionetteTestCase): self.assertTrue(self.marionette.execute_script( "return window.visited", sandbox=None)) + @skip_if_mobile # Fennec doesn't support other chrome windows def test_about_blank_for_new_docshell(self): """ Bug 1312674 - Hang when loading about:blank for a new docshell.""" # Open a window to get a new docshell created for the first tab From 5e9085a5a7bc538eeb5584638037d62377d1ea7d Mon Sep 17 00:00:00 2001 From: Wes Kocher Date: Mon, 19 Dec 2016 13:09:22 -0800 Subject: [PATCH 08/70] Backed out changeset 8615f78ac4f4 (bug 1324117) for scrolling bustage a=backout CLOSED TREE --- modules/libpref/init/all.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index a9cb9c0a90dc..b9c37d702f82 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -631,11 +631,7 @@ pref("apz.axis_lock.breakout_threshold", "0.03125"); // 1/32 inches pref("apz.axis_lock.breakout_angle", "0.3926991"); // PI / 8 (22.5 degrees) pref("apz.axis_lock.direct_pan_angle", "1.047197"); // PI / 3 (60 degrees) pref("apz.content_response_timeout", 400); -#ifdef NIGHTLY_BUILD -pref("apz.drag.enabled", true); -#else pref("apz.drag.enabled", false); -#endif pref("apz.danger_zone_x", 50); pref("apz.danger_zone_y", 100); pref("apz.disable_for_scroll_linked_effects", false); From c34f7dfa1bab00df42b4824bfdf70075eaced9f2 Mon Sep 17 00:00:00 2001 From: DimiL Date: Mon, 19 Dec 2016 09:43:02 +0800 Subject: [PATCH 09/70] Bug 1311910 - Add telemetry to measure update error and update timeout rate for V2 and V4. r=francois,henry MozReview-Commit-ID: JL4aZrUOGH7 --HG-- extra : rebase_source : 6945d007bc3e317903837e6cf546935346925433 --- toolkit/components/telemetry/Histograms.json | 18 +++++++++------- .../url-classifier/LookupCacheV4.cpp | 21 ++++++------------- .../components/url-classifier/LookupCacheV4.h | 8 ------- .../nsUrlClassifierDBService.cpp | 16 ++++++++++++++ .../nsUrlClassifierStreamUpdater.cpp | 15 +++++++++---- xpcom/base/ErrorList.h | 12 +++++++++++ xpcom/base/nsError.h | 1 + 7 files changed, 56 insertions(+), 35 deletions(-) diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index 006bfd216f7a..c0639b2c3e2f 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -4145,13 +4145,14 @@ "n_buckets": 10, "description": "Size of the completion cache in entries" }, - "URLCLASSIFIER_UPDATE_REMOTE_STATUS": { + "URLCLASSIFIER_UPDATE_REMOTE_STATUS2": { "alert_emails": ["safebrowsing-telemetry@mozilla.org"], "expires_in_version": "never", "kind": "enumerated", + "keyed": true, "n_values": 16, - "bug_numbers": [1150921], - "description": "Server HTTP status code from SafeBrowsing database updates. (0=1xx, 1=200, 2=2xx, 3=204, 4=3xx, 5=400, 6=4xx, 7=403, 8=404, 9=408, 10=413, 11=5xx, 12=502|504|511, 13=503, 14=505, 15=Other)" + "bug_numbers": [1311910], + "description": "Server HTTP status code from SafeBrowsing database updates. (0=1xx, 1=200, 2=2xx, 3=204, 4=3xx, 5=400, 6=4xx, 7=403, 8=404, 9=408, 10=413, 11=5xx, 12=502|504|511, 13=503, 14=505, 15=Other). Keyed by provider" }, "URLCLASSIFIER_COMPLETE_REMOTE_STATUS": { "alert_emails": ["safebrowsing-telemetry@mozilla.org"], @@ -4176,13 +4177,14 @@ "bug_numbers": [1172688], "description": "This metric is recorded every time a gethash lookup is performed, `true` is recorded if the lookup times out." }, - "URLCLASSIFIER_UPDATE_ERROR_TYPE": { + "URLCLASSIFIER_UPDATE_ERROR": { "alert_emails": ["safebrowsing-telemetry@mozilla.org"], - "expires_in_version": "58", + "expires_in_version": "59", "kind": "enumerated", - "n_values": 10, - "bug_numbers": [1305801], - "description": "An error was encountered while parsing a partial update returned by a Safe Browsing V4 server (0 = addition of an already existing prefix, 1 = parser got into an infinite loop, 2 = removal index out of bounds, 3 = checksum mismatch, 4 = missing checksum)" + "keyed": true, + "n_values": 16, + "bug_numbers": [1311910], + "description": "Whether or not an error was encountered while processing a Safe Browsing update (0 = success, 1 = unspecified error, 2 = addition of an already existing prefix, 3 = parser got into an infinite loop, 4 = removal index out of bounds, 5 = checksum mismatch, 6 = missing checksum). Keyed by provider" }, "URLCLASSIFIER_PREFIX_MATCH": { "alert_emails": ["safebrowsing-telemetry@mozilla.org"], diff --git a/toolkit/components/url-classifier/LookupCacheV4.cpp b/toolkit/components/url-classifier/LookupCacheV4.cpp index b96b02d3f593..ca949117a314 100644 --- a/toolkit/components/url-classifier/LookupCacheV4.cpp +++ b/toolkit/components/url-classifier/LookupCacheV4.cpp @@ -234,9 +234,7 @@ LookupCacheV4::ApplyUpdate(TableUpdateV4* aTableUpdate, if (!isOldMapEmpty && !isAddMapEmpty) { if (smallestOldPrefix == smallestAddPrefix) { LOG(("Add prefix should not exist in the original prefix set.")); - Telemetry::Accumulate(Telemetry::URLCLASSIFIER_UPDATE_ERROR_TYPE, - DUPLICATE_PREFIX); - return NS_ERROR_FAILURE; + return NS_ERROR_UC_UPDATE_DUPLICATE_PREFIX; } // Compare the smallest string in old prefix set and add prefix set, @@ -277,35 +275,28 @@ LookupCacheV4::ApplyUpdate(TableUpdateV4* aTableUpdate, // the number of original prefix plus add prefix. if (index <= 0) { LOG(("There are still prefixes remaining after reaching maximum runs.")); - Telemetry::Accumulate(Telemetry::URLCLASSIFIER_UPDATE_ERROR_TYPE, - INFINITE_LOOP); - return NS_ERROR_FAILURE; + return NS_ERROR_UC_UPDATE_INFINITE_LOOP; } if (removalIndex < removalArray.Length()) { LOG(("There are still prefixes to remove after exhausting the old PrefixSet.")); - Telemetry::Accumulate(Telemetry::URLCLASSIFIER_UPDATE_ERROR_TYPE, - WRONG_REMOVAL_INDICES); - return NS_ERROR_FAILURE; + return NS_ERROR_UC_UPDATE_WRONG_REMOVAL_INDICES; } nsAutoCString checksum; crypto->Finish(false, checksum); if (aTableUpdate->Checksum().IsEmpty()) { LOG(("Update checksum missing.")); - Telemetry::Accumulate(Telemetry::URLCLASSIFIER_UPDATE_ERROR_TYPE, - MISSING_CHECKSUM); + Telemetry::Accumulate(Telemetry::URLCLASSIFIER_UPDATE_ERROR, mProvider, + NS_ERROR_GET_CODE(NS_ERROR_UC_UPDATE_MISSING_CHECKSUM)); // Generate our own checksum to tableUpdate to ensure there is always // checksum in .metadata std::string stdChecksum(checksum.BeginReading(), checksum.Length()); aTableUpdate->NewChecksum(stdChecksum); - } else if (aTableUpdate->Checksum() != checksum){ LOG(("Checksum mismatch after applying partial update")); - Telemetry::Accumulate(Telemetry::URLCLASSIFIER_UPDATE_ERROR_TYPE, - CHECKSUM_MISMATCH); - return NS_ERROR_FAILURE; + return NS_ERROR_UC_UPDATE_CHECKSUM_MISMATCH; } return NS_OK; diff --git a/toolkit/components/url-classifier/LookupCacheV4.h b/toolkit/components/url-classifier/LookupCacheV4.h index 31c287f5a131..43464eea49e1 100644 --- a/toolkit/components/url-classifier/LookupCacheV4.h +++ b/toolkit/components/url-classifier/LookupCacheV4.h @@ -54,14 +54,6 @@ private: nsresult InitCrypto(nsCOMPtr& aCrypto); nsresult VerifyChecksum(const nsACString& aChecksum); - enum UPDATE_ERROR_TYPES { - DUPLICATE_PREFIX = 0, - INFINITE_LOOP = 1, - WRONG_REMOVAL_INDICES = 2, - CHECKSUM_MISMATCH = 3, - MISSING_CHECKSUM = 4, - }; - RefPtr mVLPrefixSet; }; diff --git a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp index 856a8269e9f8..5c74a0929608 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp @@ -606,6 +606,22 @@ nsUrlClassifierDBServiceWorker::FinishUpdate() "ApplyUpdate() since the update has already failed.")); } + nsCOMPtr urlUtil = + do_GetService(NS_URLCLASSIFIERUTILS_CONTRACTID); + + nsCString provider; + // Assume that all the tables in update should have the same provider. + urlUtil->GetTelemetryProvider(mUpdateTables.SafeElementAt(0, EmptyCString()), provider); + + nsresult updateStatus = mUpdateStatus; + if (NS_FAILED(mUpdateStatus)) { + updateStatus = NS_ERROR_GET_MODULE(mUpdateStatus) == NS_ERROR_MODULE_URL_CLASSIFIER ? + mUpdateStatus : NS_ERROR_UC_UPDATE_UNKNOWN; + } + + Telemetry::Accumulate(Telemetry::URLCLASSIFIER_UPDATE_ERROR, provider, + NS_ERROR_GET_CODE(updateStatus)); + mMissCache.Clear(); if (NS_SUCCEEDED(mUpdateStatus)) { diff --git a/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp b/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp index 554bff3422d2..af7d87b1b9e5 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp @@ -10,6 +10,7 @@ #include "nsIUploadChannel.h" #include "nsIURI.h" #include "nsIUrlClassifierDBService.h" +#include "nsUrlClassifierUtils.h" #include "nsNetUtil.h" #include "nsStreamUtils.h" #include "nsStringStream.h" @@ -643,11 +644,17 @@ nsUrlClassifierStreamUpdater::OnStartRequest(nsIRequest *request, spec.get(), this)); } + nsCOMPtr urlUtil = + do_GetService(NS_URLCLASSIFIERUTILS_CONTRACTID); + + nsCString provider; + urlUtil->GetTelemetryProvider(mStreamTable, provider); + if (NS_FAILED(status)) { // Assume we're overloading the server and trigger backoff. downloadError = true; - mozilla::Telemetry::Accumulate(mozilla::Telemetry::URLCLASSIFIER_UPDATE_REMOTE_STATUS, - 15 /* unknown response code */); + mozilla::Telemetry::Accumulate(mozilla::Telemetry::URLCLASSIFIER_UPDATE_REMOTE_STATUS2, + provider, 15 /* unknown response code */); } else { bool succeeded = false; @@ -657,8 +664,8 @@ nsUrlClassifierStreamUpdater::OnStartRequest(nsIRequest *request, uint32_t requestStatus; rv = httpChannel->GetResponseStatus(&requestStatus); NS_ENSURE_SUCCESS(rv, rv); - mozilla::Telemetry::Accumulate(mozilla::Telemetry::URLCLASSIFIER_UPDATE_REMOTE_STATUS, - HTTPStatusToBucket(requestStatus)); + mozilla::Telemetry::Accumulate(mozilla::Telemetry::URLCLASSIFIER_UPDATE_REMOTE_STATUS2, + provider, HTTPStatusToBucket(requestStatus)); LOG(("nsUrlClassifierStreamUpdater::OnStartRequest %s (%d)", succeeded ? "succeeded" : "failed", requestStatus)); if (!succeeded) { diff --git a/xpcom/base/ErrorList.h b/xpcom/base/ErrorList.h index cfa461fe402c..e76b1cdaed51 100644 --- a/xpcom/base/ErrorList.h +++ b/xpcom/base/ErrorList.h @@ -988,6 +988,18 @@ ERROR(NS_ERROR_DOM_MEDIA_CUBEB_INITIALIZATION_ERR, FAILURE(101)), #undef MODULE + /* ======================================================================= */ + /* 42: NS_ERROR_MODULE_URL_CLASSIFIER */ + /* ======================================================================= */ +#define MODULE NS_ERROR_MODULE_URL_CLASSIFIER + ERROR(NS_ERROR_UC_UPDATE_UNKNOWN, FAILURE(1)), + ERROR(NS_ERROR_UC_UPDATE_DUPLICATE_PREFIX, FAILURE(2)), + ERROR(NS_ERROR_UC_UPDATE_INFINITE_LOOP, FAILURE(3)), + ERROR(NS_ERROR_UC_UPDATE_WRONG_REMOVAL_INDICES, FAILURE(4)), + ERROR(NS_ERROR_UC_UPDATE_CHECKSUM_MISMATCH, FAILURE(5)), + ERROR(NS_ERROR_UC_UPDATE_MISSING_CHECKSUM, FAILURE(6)), +#undef MODULE + /* ======================================================================= */ /* 51: NS_ERROR_MODULE_GENERAL */ /* ======================================================================= */ diff --git a/xpcom/base/nsError.h b/xpcom/base/nsError.h index b9e5d23f6a11..3a088fd68503 100644 --- a/xpcom/base/nsError.h +++ b/xpcom/base/nsError.h @@ -80,6 +80,7 @@ #define NS_ERROR_MODULE_DOM_ANIM 39 #define NS_ERROR_MODULE_DOM_PUSH 40 #define NS_ERROR_MODULE_DOM_MEDIA 41 +#define NS_ERROR_MODULE_URL_CLASSIFIER 42 /* NS_ERROR_MODULE_GENERAL should be used by modules that do not * care if return code values overlap. Callers of methods that From 65131ad631dfdc6b8b95ed675ef04617f4d1d165 Mon Sep 17 00:00:00 2001 From: Steve Chung Date: Fri, 4 Nov 2016 10:17:32 +0800 Subject: [PATCH 10/70] Bug 1308697 - Implement UI for performance statistics. r=rickychien MozReview-Commit-ID: IwnLPNlKIup --HG-- rename : devtools/client/netmonitor/performance-statistics-view.js => devtools/client/netmonitor/statistics-view.js extra : rebase_source : e0571bdf7d4a773860cb32ae0a96322468cb9f4f --- devtools/client/netmonitor/actions/ui.js | 30 +++++++++++-- .../components/request-list-empty.js | 3 +- .../netmonitor/components/summary-button.js | 5 +-- devtools/client/netmonitor/constants.js | 19 ++++---- devtools/client/netmonitor/moz.build | 2 +- devtools/client/netmonitor/netmonitor-view.js | 37 +++++++++++++--- devtools/client/netmonitor/netmonitor.xul | 14 +++--- devtools/client/netmonitor/reducers/ui.js | 16 +++++-- .../client/netmonitor/requests-menu-view.js | 7 --- ...-statistics-view.js => statistics-view.js} | 44 ++++++++++++++----- .../test/browser_net_statistics-01.js | 10 +++-- .../test/browser_net_statistics-02.js | 5 ++- .../test/browser_net_statistics-03.js | 5 ++- devtools/client/themes/netmonitor.css | 4 ++ 14 files changed, 138 insertions(+), 63 deletions(-) rename devtools/client/netmonitor/{performance-statistics-view.js => statistics-view.js} (85%) diff --git a/devtools/client/netmonitor/actions/ui.js b/devtools/client/netmonitor/actions/ui.js index 31539518fb72..ed77d42c24f7 100644 --- a/devtools/client/netmonitor/actions/ui.js +++ b/devtools/client/netmonitor/actions/ui.js @@ -6,6 +6,7 @@ const { OPEN_SIDEBAR, + OPEN_STATISTICS, WATERFALL_RESIZE, } = require("../constants"); @@ -22,10 +23,15 @@ function openSidebar(open) { } /** - * Toggle sidebar open state. + * Change performance statistics view open state. + * + * @param {boolean} visible - expected sidebar open state */ -function toggleSidebar() { - return (dispatch, getState) => dispatch(openSidebar(!getState().ui.sidebarOpen)); +function openStatistics(open) { + return { + type: OPEN_STATISTICS, + open, + }; } /** @@ -38,8 +44,24 @@ function resizeWaterfall(width) { }; } +/** + * Toggle sidebar open state. + */ +function toggleSidebar() { + return (dispatch, getState) => dispatch(openSidebar(!getState().ui.sidebarOpen)); +} + +/** + * Toggle to show/hide performance statistics view. + */ +function toggleStatistics() { + return (dispatch, getState) => dispatch(openStatistics(!getState().ui.statisticsOpen)); +} + module.exports = { openSidebar, - toggleSidebar, + openStatistics, resizeWaterfall, + toggleSidebar, + toggleStatistics, }; diff --git a/devtools/client/netmonitor/components/request-list-empty.js b/devtools/client/netmonitor/components/request-list-empty.js index f4fe56bc1c70..f79e7daaa20d 100644 --- a/devtools/client/netmonitor/components/request-list-empty.js +++ b/devtools/client/netmonitor/components/request-list-empty.js @@ -9,6 +9,7 @@ const { createClass, PropTypes, DOM } = require("devtools/client/shared/vendor/r const { L10N } = require("../l10n"); const { div, span, button } = DOM; const { connect } = require("devtools/client/shared/vendor/react-redux"); +const Actions = require("../actions/index"); /** * UI displayed when the request list is empty. Contains instructions on reloading @@ -59,7 +60,7 @@ const RequestListEmptyNotice = createClass({ module.exports = connect( undefined, dispatch => ({ - onPerfClick: e => NetMonitorView.toggleFrontendMode(), + onPerfClick: e => dispatch(Actions.openStatistics(true)), onReloadClick: e => NetMonitorView.reloadPage(), }) )(RequestListEmptyNotice); diff --git a/devtools/client/netmonitor/components/summary-button.js b/devtools/client/netmonitor/components/summary-button.js index 7b8980d4ec5c..282567648e28 100644 --- a/devtools/client/netmonitor/components/summary-button.js +++ b/devtools/client/netmonitor/components/summary-button.js @@ -2,8 +2,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -/* globals NetMonitorView */ - "use strict"; const { @@ -15,6 +13,7 @@ const { connect } = require("devtools/client/shared/vendor/react-redux"); const { PluralForm } = require("devtools/shared/plural-form"); const { L10N } = require("../l10n"); const { getDisplayedRequestsSummary } = require("../selectors/index"); +const Actions = require("../actions/index"); const { button, span } = DOM; @@ -49,7 +48,7 @@ module.exports = connect( }), (dispatch) => ({ triggerSummary: () => { - NetMonitorView.toggleFrontendMode(); + dispatch(Actions.openStatistics(true)); }, }) )(SummaryButton); diff --git a/devtools/client/netmonitor/constants.js b/devtools/client/netmonitor/constants.js index de98cf7c29d0..97949380aa59 100644 --- a/devtools/client/netmonitor/constants.js +++ b/devtools/client/netmonitor/constants.js @@ -5,28 +5,29 @@ "use strict"; const general = { - FREETEXT_FILTER_SEARCH_DELAY: 200, CONTENT_SIZE_DECIMALS: 2, + FREETEXT_FILTER_SEARCH_DELAY: 200, REQUEST_TIME_DECIMALS: 2, }; const actionTypes = { + ADD_REQUEST: "ADD_REQUEST", + ADD_TIMING_MARKER: "ADD_TIMING_MARKER", BATCH_ACTIONS: "BATCH_ACTIONS", BATCH_ENABLE: "BATCH_ENABLE", - ADD_TIMING_MARKER: "ADD_TIMING_MARKER", - CLEAR_TIMING_MARKERS: "CLEAR_TIMING_MARKERS", - ADD_REQUEST: "ADD_REQUEST", - UPDATE_REQUEST: "UPDATE_REQUEST", CLEAR_REQUESTS: "CLEAR_REQUESTS", + CLEAR_TIMING_MARKERS: "CLEAR_TIMING_MARKERS", CLONE_SELECTED_REQUEST: "CLONE_SELECTED_REQUEST", + ENABLE_FILTER_TYPE_ONLY: "ENABLE_FILTER_TYPE_ONLY", + OPEN_SIDEBAR: "OPEN_SIDEBAR", + OPEN_STATISTICS: "OPEN_STATISTICS", + PRESELECT_REQUEST: "PRESELECT_REQUEST", REMOVE_SELECTED_CUSTOM_REQUEST: "REMOVE_SELECTED_CUSTOM_REQUEST", SELECT_REQUEST: "SELECT_REQUEST", - PRESELECT_REQUEST: "PRESELECT_REQUEST", + SET_FILTER_TEXT: "SET_FILTER_TEXT", SORT_BY: "SORT_BY", TOGGLE_FILTER_TYPE: "TOGGLE_FILTER_TYPE", - ENABLE_FILTER_TYPE_ONLY: "ENABLE_FILTER_TYPE_ONLY", - SET_FILTER_TEXT: "SET_FILTER_TEXT", - OPEN_SIDEBAR: "OPEN_SIDEBAR", + UPDATE_REQUEST: "UPDATE_REQUEST", WATERFALL_RESIZE: "WATERFALL_RESIZE", }; diff --git a/devtools/client/netmonitor/moz.build b/devtools/client/netmonitor/moz.build index 1f8d23a2574d..31308ae51f36 100644 --- a/devtools/client/netmonitor/moz.build +++ b/devtools/client/netmonitor/moz.build @@ -23,13 +23,13 @@ DevToolsModules( 'netmonitor-controller.js', 'netmonitor-view.js', 'panel.js', - 'performance-statistics-view.js', 'prefs.js', 'request-list-context-menu.js', 'request-utils.js', 'requests-menu-view.js', 'sidebar-view.js', 'sort-predicates.js', + 'statistics-view.js', 'store.js', 'toolbar-view.js', 'waterfall-background.js', diff --git a/devtools/client/netmonitor/netmonitor-view.js b/devtools/client/netmonitor/netmonitor-view.js index 84461e406021..7825522adab0 100644 --- a/devtools/client/netmonitor/netmonitor-view.js +++ b/devtools/client/netmonitor/netmonitor-view.js @@ -17,7 +17,7 @@ const { CustomRequestView } = require("./custom-request-view"); const { ToolbarView } = require("./toolbar-view"); const { SidebarView } = require("./sidebar-view"); const { DetailsView } = require("./details-view"); -const { PerformanceStatisticsView } = require("./performance-statistics-view"); +const { StatisticsView } = require("./statistics-view"); const { ACTIVITY_TYPE } = require("./constants"); const Actions = require("./actions/index"); const { Prefs } = require("./prefs"); @@ -52,7 +52,15 @@ var NetMonitorView = { this.RequestsMenu.initialize(gStore); this.NetworkDetails.initialize(gStore); this.CustomRequest.initialize(); - this.PerformanceStatistics.initialize(gStore); + this.Statistics.initialize(gStore); + + // Store watcher here is for observing the statisticsOpen state change. + // It should be removed once we migrate to react and apply react/redex binding. + this.unsubscribeStore = gStore.subscribe(storeWatcher( + false, + () => gStore.getState().ui.statisticsOpen, + this.toggleFrontendMode.bind(this) + )); }, /** @@ -64,6 +72,8 @@ var NetMonitorView = { this.RequestsMenu.destroy(); this.NetworkDetails.destroy(); this.CustomRequest.destroy(); + this.Statistics.destroy(); + this.unsubscribeStore(); this._destroyPanes(); }, @@ -151,10 +161,10 @@ var NetMonitorView = { * Toggles between the frontend view modes ("Inspector" vs. "Statistics"). */ toggleFrontendMode: function () { - if (this.currentFrontendMode != "network-inspector-view") { - this.showNetworkInspectorView(); - } else { + if (gStore.getState().ui.statisticsOpen) { this.showNetworkStatisticsView(); + } else { + this.showNetworkInspectorView(); } }, @@ -173,7 +183,7 @@ var NetMonitorView = { let controller = NetMonitorController; let requestsView = this.RequestsMenu; - let statisticsView = this.PerformanceStatistics; + let statisticsView = this.Statistics; Task.spawn(function* () { statisticsView.displayPlaceholderCharts(); @@ -270,6 +280,19 @@ function whenDataAvailable(dataStore, mandatoryFields) { }); } +// A smart store watcher to notify store changes as necessary +function storeWatcher(initialValue, reduceValue, onChange) { + let currentValue = initialValue; + + return () => { + const newValue = reduceValue(); + if (newValue !== currentValue) { + onChange(); + currentValue = newValue; + } + }; +} + /** * Preliminary setup for the NetMonitorView object. */ @@ -278,6 +301,6 @@ NetMonitorView.Sidebar = new SidebarView(); NetMonitorView.NetworkDetails = new DetailsView(); NetMonitorView.RequestsMenu = new RequestsMenuView(); NetMonitorView.CustomRequest = new CustomRequestView(); -NetMonitorView.PerformanceStatistics = new PerformanceStatisticsView(); +NetMonitorView.Statistics = new StatisticsView(); exports.NetMonitorView = NetMonitorView; diff --git a/devtools/client/netmonitor/netmonitor.xul b/devtools/client/netmonitor/netmonitor.xul index a16e26abde8d..46a2bb4cb9eb 100644 --- a/devtools/client/netmonitor/netmonitor.xul +++ b/devtools/client/netmonitor/netmonitor.xul @@ -282,13 +282,12 @@ - - + - + + + + +
+
+
+ + +
+ + +
+ + + + +
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+
+ + + + + + + + + Current View + + +
+ + +
+
+
+
+ +
+ +
+ + + +
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+ + +
+ + + + +
+ + diff --git a/browser/extensions/mortar/host/pdf/install.rdf b/browser/extensions/mortar/host/pdf/install.rdf new file mode 100644 index 000000000000..b918ac02030d --- /dev/null +++ b/browser/extensions/mortar/host/pdf/install.rdf @@ -0,0 +1,25 @@ + + + + + + ppapipdf.js@mozilla.org + ppapipdf.js + ppapipdf.js + 0.1 + 2 + true + true + + + {ec8030f7-c20a-464f-9b0e-13a3a9e97384} + 37.0 + 45.* + + + false + + diff --git a/browser/extensions/mortar/host/pdf/ppapi-content-sandbox.js b/browser/extensions/mortar/host/pdf/ppapi-content-sandbox.js new file mode 100644 index 000000000000..0d380fb84992 --- /dev/null +++ b/browser/extensions/mortar/host/pdf/ppapi-content-sandbox.js @@ -0,0 +1,95 @@ +/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/** + * This code runs in the sandbox in the content process where the page that + * loaded the plugin lives. It communicates with the process where the PPAPI + * implementation lives. + */ +const { utils: Cu } = Components; + +let mm = pluginElement.frameLoader.messageManager; +let containerWindow = pluginElement.ownerDocument.defaultView; +// Prevent the drag event's default action on the element, to avoid dragging of +// that element while the user selects text. +pluginElement.addEventListener("dragstart", + function(event) { event.preventDefault(); }); +// For synthetic documents only, prevent the select event's default action on +// the element, to avoid selecting the element and the copying of an empty +// string into the clipboard. Don't do this for non-synthetic documents, as +// users still need to be able to select text outside the plugin. +let isSynthetic = pluginElement.ownerDocument.mozSyntheticDocument; +if (isSynthetic) { + pluginElement.ownerDocument.body.addEventListener( + "selectstart", function(event) { event.preventDefault(); }); +} + +function mapValue(v, instance) { + return instance.rt.toPP_Var(v, instance); +} + +dump("<>>>>>>>>>>>>>>>>>>>> AHA <<<<<<<<<<<<<<<<<<<<<>\n"); +dump(`pluginElement: ${pluginElement.toSource()}\n`); +dump(`pluginElement.frameLoader: ${pluginElement.frameLoader.toSource()}\n`); +dump(`pluginElement.frameLoader.messageManager: ${pluginElement.frameLoader.messageManager.toSource()}\n`); +dump("<>>>>>>>>>>>>>>>>>>>> AHA2 <<<<<<<<<<<<<<<<<<<<<>\n"); + +mm.addMessageListener("ppapi.js:frameLoaded", ({ target }) => { + let tagName = pluginElement.nodeName; + + // Getting absolute URL from the EMBED tag + let url = pluginElement.srcURI.spec; + let objectParams = new Map(); + for (let i = 0; i < pluginElement.attributes.length; ++i) { + let paramName = pluginElement.attributes[i].localName; + objectParams.set(paramName, pluginElement.attributes[i].value); + } + if (tagName == "OBJECT") { + let params = pluginElement.getElementsByTagName("param"); + Array.prototype.forEach.call(params, (p) => { + var paramName = p.getAttribute("name").toLowerCase(); + objectParams.set(paramName, p.getAttribute("value")); + }); + } + + let documentURL = pluginElement.ownerDocument.location.href; + let baseUrl = documentURL; + if (objectParams.base) { + try { + let parsedDocumentUrl = Services.io.newURI(documentURL); + baseUrl = Services.io.newURI(objectParams.base, null, parsedDocumentUrl).spec; + } catch (e) { /* ignore */ } + } + + let info = { + documentURL: "chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai", + url, + setupJSInstanceObject: false, + isFullFrame: false, //pluginElement.ownerDocument.mozSyntheticDocument, + arguments: { + keys: ["src", "full-frame", "top-level-url"], + values: [url, "", documentURL], + }, + }; + + mm.sendAsyncMessage("ppapi.js:createInstance", { type: "pdf", info }, + { pluginWindow: containerWindow }); + + containerWindow.document.addEventListener("fullscreenchange", () => { + let fullscreen = (containerWindow.document.fullscreenElement == pluginElement); + mm.sendAsyncMessage("ppapi.js:fullscreenchange", { fullscreen }); + }); +}); + +mm.addMessageListener("ppapi.js:setFullscreen", ({ data }) => { + if (data) { + pluginElement.requestFullscreen(); + } else { + containerWindow.document.exitFullscreen(); + } +}); + +mm.loadFrameScript("resource://ppapi.js/ppapi-instance.js", true); diff --git a/browser/extensions/mortar/host/rpc.cc b/browser/extensions/mortar/host/rpc.cc new file mode 100644 index 000000000000..647437549b8e --- /dev/null +++ b/browser/extensions/mortar/host/rpc.cc @@ -0,0 +1,187 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "../ppapi/out/rpc.cc" + +typedef void (*RpcFromPlugin)(const char*, bool, char**); +RpcFromPlugin gRpcFromPlugin; +PP_GetInterface_Func gGetInterface; + +void ToHost(std::stringstream &s, bool abortIfNonMainThread) { + gRpcFromPlugin(s.str().c_str(), abortIfNonMainThread, nullptr); +} + +std::string ToHostWithResult(std::stringstream &s, bool abortIfNonMainThread) { + char* result; + gRpcFromPlugin(s.str().c_str(), abortIfNonMainThread, &result); + return result; +} + +static const void* GetInterfaceForRPC(const char* interfaceName) { + const void* _interface = gInterfaces[interfaceName]; + if (!_interface) { + printf("MISSING INTERFACE %s\n", interfaceName); + } + return _interface; +} + +void +Fail(const char *reason, const char *data) +{ + fprintf(stdout, reason, data); + fflush(stdout); + exit(-1); +} + +char* +CallFromJSON(JSONIterator& iterator) +{ + iterator.expectObjectAndGotoFirstProperty(); + const Token& propertyName = iterator.getCurrentStringAndGotoNext(); + if (!propertyName.value().compare("__interface")) { + const Token& interfaceNameToken = iterator.getCurrentStringAndGotoNext(); + string interfaceName = interfaceNameToken.value(); + const Token& instanceToken = iterator; + const void* _interface; + if (!instanceToken.value().compare("__instance")) { + iterator.skip(); + void* instance; + FromJSON_mem_t(iterator, instance); + _interface = instance; + } else { + _interface = gGetInterface(interfaceName.c_str()); + } + if (!_interface) { + printf("Missing interface %s\n", interfaceName.c_str()); + return nullptr; + } + return gInterfaceMemberCallers[interfaceName](_interface, iterator); + } + + if (!propertyName.value().compare("__callback")) { + const Token& callbackNameToken = iterator.getCurrentAndGotoNext(); + if (!callbackNameToken.isString()) { + return nullptr; + } + if (!callbackNameToken.value().compare("PP_CompletionCallback")) { + iterator.skip(); + PP_CompletionCallback callback; + FromJSON_PP_CompletionCallback(iterator, callback); + iterator.skip(); + int32_t result; + FromJSON_int32_t(iterator, result); + PP_RunCompletionCallback(&callback, result); + return nullptr; + } + if (!callbackNameToken.value().compare("PPB_Audio_Callback_1_0")) { + iterator.skip(); + PPB_Audio_Callback_1_0 callback; + FromJSON_PPB_Audio_Callback(iterator, callback); + iterator.skip(); + void* sample_buffer; + FromJSON_mem_t(iterator, sample_buffer); + iterator.skip(); + uint32_t buffer_size_in_bytes; + FromJSON_uint32_t(iterator, buffer_size_in_bytes); + iterator.skip(); + void* user_data; + FromJSON_mem_t(iterator, user_data); + callback(sample_buffer, buffer_size_in_bytes, user_data); + return nullptr; + } + + Fail("Don't have code for callback ", callbackNameToken.value().c_str()); + return nullptr; + } + + Fail("Don't know what to do with a call for ", propertyName.value().c_str()); + return nullptr; +} + +#ifdef __cplusplus +extern "C" { +#endif + +PP_EXPORT char* +CallFromJSON(const char* json) +{ + JSONIterator iterator(json); + + const Token& item = iterator; + if (item.isArray()) { + iterator.skip(); + std::string result("["); + for (size_t i = 0; i < item.children(); ++i) { + const char* r = CallFromJSON(iterator); + if (!r) { + result.append("null"); + } else { + result.append(r); + delete r; + } + if (i + 1 != item.children()) { + result.append(", "); + } + } + result.append("]"); + return strdup(result.c_str()); + } + + return CallFromJSON(iterator); +} + +PP_EXPORT void +Initialize(RpcFromPlugin aRpcFromPlugin, + PP_GetInterface_Func aGetInterface, + PP_InitializeModule_Func aInitializeModule) { + gRpcFromPlugin = aRpcFromPlugin; + gGetInterface = aGetInterface; + InitializeInterfaceList(); + aInitializeModule(1, GetInterfaceForRPC); +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +void FromJSON_PP_Flash_Menu(JSONIterator& iterator, PP_Flash_Menu *&value) { + const JSON::Token& pointer = iterator.getCurrentAndGotoNext(); + if (!pointer.isObject()) { + if (!pointer.isPrimitive() || !pointer.value().compare("null")) { + Fail("Not a pointer value!", ""); + } + value = nullptr; + } else { + value = new PP_Flash_Menu(); + FromJSON_PP_Flash_Menu(iterator, *value); + } +} + +void FromJSON_PP_DirContents_Dev(JSONIterator& iterator, PP_DirContents_Dev *&value) +{ + value = new PP_DirContents_Dev(); + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + + if (!current.isObject()) { + Fail("Expected object!", ""); + } + + iterator.skip(); + FromJSON_int32_t(iterator, value->count); + + iterator.skip(); + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > value->count) { + Fail("Too many items in array\n", ""); + } + + value->entries = new PP_DirEntry_Dev[value->count]; + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_PP_DirEntry_Dev(iterator, value->entries[_n]); + } + // FIXME Null out remaining items? +} diff --git a/browser/extensions/mortar/host/rpc.h b/browser/extensions/mortar/host/rpc.h new file mode 100644 index 000000000000..7a7eccb8c1fb --- /dev/null +++ b/browser/extensions/mortar/host/rpc.h @@ -0,0 +1,606 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef __rpc_h__ +#define __rpc_h__ + +#include +#include +#include +#include +#include +#include + +#include "json/json.h" + +extern void Fail(const char *reason, const char *data); + +#ifdef INTERPOSE +const void* RealGetInterface(const char* interfaceName); +void Logging_PP_CompletionCallback(void* user_data, int32_t result); +void Logging_PPB_Audio_Callback_1_0(void* sample_buffer, + uint32_t buffer_size_in_bytes, + void* user_data); +struct Logging_PPB_Audio_Callback_1_0_holder { + PPB_Audio_Callback_1_0 func; + void* user_data; +}; +struct Logging_PPP_Class_Deprecated_holder { + const PPP_Class_Deprecated* _real_PPP_Class_Deprecated; + const void* object; +}; +extern const PPP_Class_Deprecated _interpose_PPP_Class_Deprecated_1_0; +#else // INTERPOSE +void ToHost(std::stringstream &s, bool abortIfNonMainThread); +std::string ToHostWithResult(std::stringstream &s, bool abortIfNonMainThread); + +enum RPCType { + WithResult, + NoResult +}; +enum RPCThread { + MainThreadOnly, + MaybeNonMainThread +}; +template +void RPC(std::stringstream &s) { + return ToHost(s, rpcThread == MainThreadOnly); +} +template +std::string RPCWithResult(std::stringstream &s) { + return ToHostWithResult(s, rpcThread == MainThreadOnly); +} +#endif // INTERPOSE + +typedef float float_t; +typedef double double_t; +typedef const void* mem_t; +typedef void* const * mem_ptr_t; +typedef const char* str_t; +typedef const char* cstr_t; +typedef int GLint; +typedef unsigned int GLuint; +typedef unsigned int GLenum; +typedef unsigned int GLbitfield; +typedef unsigned char GLboolean; +typedef float GLclampf; +typedef float GLfloat; +typedef long int GLintptr; +typedef int GLsizei; +typedef long int GLsizeiptr; +typedef const GLint * GLint_ptr_t; +typedef const GLuint * GLuint_ptr_t; +typedef const GLenum * GLenum_ptr_t; +typedef const GLboolean * GLboolean_ptr_t; +typedef const GLfloat * GLfloat_ptr_t; +typedef const GLsizei * GLsizei_ptr_t; +typedef const GLubyte * GLubyte_ptr_t; + +#ifdef _WIN32 +#include +typedef HANDLE PP_FileHandle; +#else +typedef int PP_FileHandle; +#endif + +struct PPP_MessageHandler_0_2; + +static void BeginProps(std::stringstream &s) { + s << '{'; +} + +static void EndProps(std::stringstream &s) { + s << '}'; +} + +static void BeginProp(std::stringstream &s, const std::string &key) { + if (s.str().back() != '{') + s << ','; + s << '"' << key << "\":"; +} + +static void AddProp(std::stringstream &s, const std::string &key, const std::string &value) { + BeginProp(s, key); + s << value; +} + +static void BeginElements(std::stringstream &s) { + s << '['; +} + +static void EndElements(std::stringstream &s) { + s << ']'; +} + +static void BeginElement(std::stringstream &s) { + if (s.str().back() != '[') + s << ','; +} + +static void AddElement(std::stringstream &s, const std::string &value) { + BeginElement(s); + s << value; +} + +// Define how to send certain primitive types to the browser. + +template +static const std::string ToString(const T *value) { + std::stringstream x; + x << *value; + return x.str(); +} + +static void WriteEscapedChar(std::stringstream& x, const char value) +{ + switch (value) { + case '\\': + x << "\\\\"; + return; + case '"': + x << "\\" << value; + return; + } + unsigned int v = (unsigned int)value; + if (v <= 0x001f) { + x << "\\u" << std::setw(4) << std::setfill('0') << std::hex << v; + } else { + x << value; + } +} + +template +static void WriteString(std::stringstream& x, const T *value, size_t length) { + const char* start = *value; + const char* end = start + length; + size_t pos = 0; + while (start != end) { + WriteEscapedChar(x, *(start++)); + } +} + +template +static const std::string StringToQuotedString(const T *value, size_t length) { + std::stringstream x; + x << '"'; + WriteString(x, value, length); + x << '"'; + return x.str(); +} + +template +static const std::string StringToQuotedString(const T *value) { + return StringToQuotedString(value, strlen(*value)); +} + +static const std::string StringToQuotedString(const char *value) { + return StringToQuotedString(&value, 1); +} + +template +static const std::string PointerToString(T *value) { + std::stringstream x; + if (!value) { + x << "null"; + } else { + x << (std::intptr_t)value; + } + return x.str(); +} + +#define DEFINE_TOSTRING_FORWARD_REF_TO_POINTER(T) \ + static const std::string ToString_##T(const T &value) { \ + return ToString_##T(&value); \ + } +#define DEFINE_TOSTRING(T) \ + static const std::string ToString_##T(const T *value) { \ + return ToString(value); \ + } \ + DEFINE_TOSTRING_FORWARD_REF_TO_POINTER(T) +#define DEFINE_INT_TOSTRING(T) \ + static const std::string ToString_##T(const T *value) { \ + std::stringstream x; \ + x << std::dec << (int)*value; \ + return x.str(); \ + } \ + DEFINE_TOSTRING_FORWARD_REF_TO_POINTER(T) +#define DEFINE_UNSIGNED_INT_TOSTRING(T) \ + static const std::string ToString_##T(const T *value) { \ + std::stringstream x; \ + x << std::dec << (unsigned int)*value; \ + return x.str(); \ + } \ + DEFINE_TOSTRING_FORWARD_REF_TO_POINTER(T) +#define DEFINE_FLOAT_TOSTRING(T) \ + static const std::string ToString_##T(const T *value) { \ + switch (std::fpclassify(*value)) { \ + case FP_INFINITE: \ + case FP_NAN: \ + return "null"; \ + default: \ + return ToString(value); \ + } \ + } \ + DEFINE_TOSTRING_FORWARD_REF_TO_POINTER(T) +#define DEFINE_POINTER_TOSTRING(T) \ + static const std::string ToString_##T(const T *value) { \ + return PointerToString(*value); \ + } \ + DEFINE_TOSTRING_FORWARD_REF_TO_POINTER(T) +#define DEFINE_STRING_TOSTRING(T) \ + static const std::string ToString_##T(const T *value) { \ + return StringToQuotedString(value); \ + } \ + DEFINE_TOSTRING_FORWARD_REF_TO_POINTER(T) + +DEFINE_STRING_TOSTRING(char) +DEFINE_INT_TOSTRING(int8_t) +DEFINE_INT_TOSTRING(int32_t) +DEFINE_INT_TOSTRING(int64_t) +DEFINE_UNSIGNED_INT_TOSTRING(uint8_t) +DEFINE_UNSIGNED_INT_TOSTRING(uint16_t) +DEFINE_UNSIGNED_INT_TOSTRING(uint32_t) +DEFINE_UNSIGNED_INT_TOSTRING(uint64_t) +DEFINE_FLOAT_TOSTRING(float_t) +DEFINE_FLOAT_TOSTRING(double_t) +DEFINE_POINTER_TOSTRING(mem_t) +DEFINE_TOSTRING(mem_ptr_t) +DEFINE_STRING_TOSTRING(str_t) +static const std::string ToString_str_t(const str_t *value, size_t length) { + return StringToQuotedString(value, length); +} +static const std::string ToString_str_t(const str_t &value, size_t length) { + return StringToQuotedString(&value, length); +} +DEFINE_STRING_TOSTRING(cstr_t) +DEFINE_TOSTRING(GLint) +DEFINE_TOSTRING(GLuint) +DEFINE_TOSTRING(GLenum) +DEFINE_TOSTRING(GLbitfield) +static const std::string ToString_GLboolean(const GLboolean *value) { + std::stringstream x; + x << (*value ? "true" : "false"); + return x.str(); +} +DEFINE_TOSTRING_FORWARD_REF_TO_POINTER(GLboolean) +DEFINE_TOSTRING(GLfloat) +DEFINE_TOSTRING(GLclampf) +DEFINE_TOSTRING(GLintptr) +DEFINE_TOSTRING(GLsizei) +DEFINE_TOSTRING(GLsizeiptr) +DEFINE_TOSTRING(GLuint_ptr_t) +DEFINE_TOSTRING(GLenum_ptr_t) +DEFINE_TOSTRING(GLboolean_ptr_t) +DEFINE_POINTER_TOSTRING(GLint_ptr_t) +DEFINE_POINTER_TOSTRING(GLfloat_ptr_t) +DEFINE_TOSTRING(GLsizei_ptr_t) +DEFINE_TOSTRING(PP_FileHandle) + +#ifdef INTERPOSE +static const std::string ToString_GLubyte_ptr_t(const GLubyte *value) { + std::stringstream x; + x << (const char*)value; + return x.str(); +} +static const std::string ToString_uint16_ptr_t(const uint16_ptr_t value) { + return ""; +} +extern const std::string ToString_PP_DirContents_Dev(const PP_DirContents_Dev *v); +static const std::string ToString_PP_DirContents_Dev(PP_DirContents_Dev **value) { + if (!value && !*value) { + return "{}"; + } + return ToString_PP_DirContents_Dev(*value); +} +#endif + +// Define how to emit client objects that the client sends to the host. We just want +// to send a pointer value here, not actually unpack the struct. + +static const std::string ToString_PPP_MessageHandler(const PPP_MessageHandler_0_2 *value) { + std::stringstream x; + x << value; + return x.str(); +} + +static const std::string ToString_PPP_Class_Deprecated(const PPP_Class_Deprecated *value) { + return PointerToString(value); +} + + +class JSONIterator { + JSON::Parser parser; + JSON::Parser::iterator iterator; + JSON::Parser::iterator end; + +public: + JSONIterator(const std::string& json) + { + if (parser.parse(json) <= 0) { + Fail("Fatal: failed to parse '%s'\n", json.c_str()); + } + iterator = parser.begin(); + end = parser.end(); + } + + bool isValid() const { + return iterator != end; + } + operator const JSON::Token&() const { + return *iterator; + } + + void skip() { + ++iterator; + } + const JSON::Token& getCurrentAndGotoNext() { + const JSON::Token& token = *iterator; + ++iterator; + return token; + } + + const JSON::Token& getCurrentPrimitiveAndGotoNext() + { + const JSON::Token& token = getCurrentAndGotoNext(); + if (!token.isPrimitive()) { + Fail("Expected primitive", ""); + }; + return token; + } + const JSON::Token& getCurrentStringAndGotoNext() + { + const JSON::Token& token = getCurrentAndGotoNext(); + if (!token.isString()) { + Fail("Expected string", ""); + }; + return token; + } + + const void expectObjectAndGotoFirstProperty() + { + if (!getCurrentAndGotoNext().isObject()) { + Fail("Expected object", ""); + } + if (!iterator->isString()) { + Fail("Expected string", ""); + } + } + const size_t expectArrayAndGotoFirstItem() + { + const JSON::Token& token = getCurrentAndGotoNext(); + if (!token.isArray()) { + Fail("Expected array", ""); + } + return token.children(); + } +}; + +template +struct OutParam +{ + typedef typename std::conditional::value, typename std::remove_pointer::type, T>::type nopointer; + typedef typename std::remove_const::type noconst; + typedef typename std::conditional::value, typename std::add_pointer::type, noconst>::type type; +}; + +static void FromJSON_int(JSONIterator& iterator, long int& value) +{ + value = atol(iterator.getCurrentPrimitiveAndGotoNext().value().c_str()); +} + +static void FromJSON_uintptr(JSONIterator& iterator, std::uintptr_t& value) +{ + long long pointer = std::atoll(iterator.getCurrentPrimitiveAndGotoNext().value().c_str()); + value = static_cast(pointer); +} + +template +static void PointerValueFromJSON(JSONIterator& iterator, T*& value) { + std::uintptr_t pointer; + FromJSON_uintptr(iterator, pointer); + value = (T*)pointer; +} + +static void FromJSON_charArray(JSONIterator& iterator, char* value, size_t count) +{ + const JSON::Token& token = iterator.getCurrentStringAndGotoNext(); + std::strncpy(value, token.value().c_str(), count); +} + +// FIXME Check range? +#define DEFINE_FROMJSON_INT(T) \ + static void FromJSON_##T(JSONIterator& iterator, OutParam::type& value) { \ + long int v; \ + FromJSON_int(iterator, v); \ + value = v; \ + } + +#define DEFINE_FROMJSON_FLOAT(T) \ +static void FromJSON_##T(JSONIterator& iterator, OutParam::type& value) \ + { \ + value = atof(iterator.getCurrentPrimitiveAndGotoNext().value().c_str()); \ + } + +DEFINE_FROMJSON_INT(int8_t) +DEFINE_FROMJSON_INT(int32_t) +DEFINE_FROMJSON_INT(int64_t) +DEFINE_FROMJSON_INT(uint8_t) +DEFINE_FROMJSON_INT(uint16_t) +DEFINE_FROMJSON_INT(uint32_t) +DEFINE_FROMJSON_INT(uint64_t) +DEFINE_FROMJSON_FLOAT(float_t) +DEFINE_FROMJSON_FLOAT(double_t) +static void FromJSON_mem_t(JSONIterator& iterator, OutParam::type& value) +{ + PointerValueFromJSON(iterator, value); +} +static void FromJSON_mem_ptr_t(JSONIterator& iterator, OutParam::type& value) +{ + const JSON::Token& token = iterator.getCurrentAndGotoNext(); + Fail("UNIMPLEMENTED: %s\n", "FromJSON_mem_ptr_t"); +} +static void FromJSON_str_t(JSONIterator& iterator, OutParam::type& value) +{ + const JSON::Token& token = iterator.getCurrentAndGotoNext(); + if (token.isString()) { + size_t length = 0; + std::string tokenValue = token.value(); + for (std::string::iterator it = tokenValue.begin(); it != tokenValue.cend(); ++it) { + ++length; + if (*it == '\\' && it + 1 != tokenValue.cend()) { + std::string::iterator next = it + 1; + switch (*next) { + case '\"': + case '/': + case '\\': + tokenValue.erase(it); + break; + case 'b': + tokenValue.replace(it, next + 1, "\b"); + break; + case 'f': + tokenValue.replace(it, next + 1, "\f"); + break; + case 'r': + tokenValue.replace(it, next + 1, "\r"); + break; + case 'n': + tokenValue.replace(it, next + 1, "\n"); + break; + case 't': + tokenValue.replace(it, next + 1, "\t"); + break; + case 'u': + if (tokenValue.cend() - next >= 5) { + if (*(next + 1) == '0' && + *(next + 2) == '0' && + *(next + 3) == '0' && + *(next + 4) == '0') { + tokenValue.replace(it, next + 5, 1, '\0'); + break; + } + Fail("Need to handle unicode escapes in strings: %s.", + tokenValue.c_str()); + } + } + } + } + value = (char*) malloc(length + 1); + std::memcpy(value, tokenValue.c_str(), length + 1); + return; + } + + if (!token.isArray()) { + Fail("Expected array", ""); + return; + } + + size_t size = token.children(); + char* buff = new char[size]; + for (size_t i = 0; i < size; ++i) { + buff[i] = iterator.getCurrentAndGotoNext().value()[0]; + } + value = buff; +} +static void FromJSON_str_t(JSONIterator& iterator, str_t& value) +{ + return FromJSON_str_t(iterator, const_cast::type&>(value)); +} +static void FromJSON_cstr_t(JSONIterator& iterator, cstr_t& value) +{ + value = strdup(iterator.getCurrentStringAndGotoNext().value().c_str()); +} +DEFINE_FROMJSON_INT(GLint) +DEFINE_FROMJSON_INT(GLuint) +static void FromJSON_GLenum(JSONIterator& iterator, OutParam::type& value) +{ + const JSON::Token& token = iterator.getCurrentAndGotoNext(); + Fail("UNIMPLEMENTED: %s\n", "FromJSON_GLenum"); +} +static void FromJSON_GLbitfield(JSONIterator& iterator, OutParam::type& value) +{ + const JSON::Token& token = iterator.getCurrentAndGotoNext(); + Fail("UNIMPLEMENTED: %s\n", "FromJSON_GLbitfield"); +} +DEFINE_FROMJSON_INT(GLboolean) +static void FromJSON_GLfloat(JSONIterator& iterator, OutParam::type& value) +{ + const JSON::Token& token = iterator.getCurrentAndGotoNext(); + Fail("UNIMPLEMENTED: %s\n", "FromJSON_GLfloat"); +} +static void FromJSON_GLclampf(JSONIterator& iterator, OutParam::type& value) +{ + const JSON::Token& token = iterator.getCurrentAndGotoNext(); + Fail("UNIMPLEMENTED: %s\n", "FromJSON_GLclampf"); +} +static void FromJSON_GLintptr(JSONIterator& iterator, OutParam::type& value) +{ + const JSON::Token& token = iterator.getCurrentAndGotoNext(); + Fail("UNIMPLEMENTED: %s\n", "FromJSON_GLintptr"); +} +DEFINE_FROMJSON_INT(GLsizei) +static void FromJSON_GLboolean_ptr_t(JSONIterator& iterator, OutParam::type& value) +{ + const JSON::Token& token = iterator.getCurrentAndGotoNext(); + Fail("UNIMPLEMENTED: %s\n", "FromJSON_GLboolean_ptr_t"); +} +static void FromJSON_GLenum_ptr_t(JSONIterator& iterator, OutParam::type& value) +{ + const JSON::Token& token = iterator.getCurrentAndGotoNext(); + Fail("UNIMPLEMENTED: %s\n", "FromJSON_GLenum_ptr_t"); +} +static void FromJSON_GLfloat_ptr_t(JSONIterator& iterator,OutParam::type& value) +{ + const JSON::Token& token = iterator.getCurrentAndGotoNext(); + Fail("UNIMPLEMENTED: %s\n", "FromJSON_GLfloat_ptr_t"); +} +static void FromJSON_GLint_ptr_t(JSONIterator& iterator, OutParam::type& value) +{ + return FromJSON_GLint(iterator, *value); + Fail("UNIMPLEMENTED: %s\n", "FromJSON_GLint_ptr_t"); +} +static void FromJSON_GLsizei_ptr_t(JSONIterator& iterator, OutParam::type& value) +{ + if (!value) { + iterator.skip(); + } else { + FromJSON_GLsizei(iterator, *value); + } +} +static void FromJSON_GLubyte_ptr_t(JSONIterator& iterator, OutParam::type& value) +{ + const JSON::Token& token = iterator.getCurrentStringAndGotoNext(); + std::string tokenValue = token.value(); + size_t size = tokenValue.size(); + value = new GLubyte[size]; + std::memcpy(value, tokenValue.data(), size); +} +static void FromJSON_GLuint_ptr_t(JSONIterator& iterator, OutParam::type& value) +{ + const JSON::Token& token = iterator.getCurrentAndGotoNext(); + Fail("UNIMPLEMENTED: %s\n", "FromJSON_GLuint_ptr_t"); +} +#ifdef _WIN32 +static void FromJSON_PP_FileHandle(JSONIterator& iterator, PP_FileHandle& value) +{ + PointerValueFromJSON(iterator, value); +} +#else +DEFINE_FROMJSON_INT(PP_FileHandle) +#endif +static void FromJSON_uint16_ptr_t(JSONIterator& iterator, uint16_ptr_t& value) +{ + PointerValueFromJSON(iterator, value); +} + +struct PP_Flash_Menu; +void FromJSON_PP_Flash_Menu(JSONIterator& iterator, PP_Flash_Menu &value); +void FromJSON_PP_Flash_Menu(JSONIterator& iterator, PP_Flash_Menu *&value); + +struct PP_DirEntry_Dev; +struct PP_DirContents_Dev; +void FromJSON_PP_DirEntry_Dev(JSONIterator& iterator, PP_DirEntry_Dev &value); +void FromJSON_PP_DirContents_Dev(JSONIterator& iterator, PP_DirContents_Dev *&value); + +#endif diff --git a/browser/extensions/mortar/json/json.cpp b/browser/extensions/mortar/json/json.cpp new file mode 100644 index 000000000000..edd68eb2a6a5 --- /dev/null +++ b/browser/extensions/mortar/json/json.cpp @@ -0,0 +1,201 @@ +/* +Copyright (c) 2010 Serge A. Zaitsev +Copyright (c) 2015 Andreas Gal + +Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +#include +#include "json.h" + +using namespace std; + +namespace JSON { + +enum { + PRIMITIVE = 0, // number, boolean, true, false, null + OBJECT = 1, + ARRAY = 2, + STRING = 3 +}; + +Token::Token(int _type, const string& _v) { + type = _type; + size = 0; + v = _v; +} + +bool Token::isPrimitive() const { + return type == PRIMITIVE; +} + +bool Token::isString() const { + return type == STRING; +} + +bool Token::isObject() const { + return type == OBJECT; +} + +bool Token::isArray() const { + return type == ARRAY; +} + +void Parser::addToken(int type, const string& value, stack& parents) { + tokens.push_back(Token(type, value)); + if (!parents.empty()) { + // Add this token to the enclosing value. + Token *t = &tokens[parents.top()]; + t->size++; + // String keys only have one child value, so we pop the parent here. + if (t->type == STRING) + parents.pop(); + } +} + +int Parser::parsePrimitive(const string& js, string::const_iterator& pos, stack& parents) { + string::const_iterator start = pos; + + for (; pos != js.cend(); pos++) { + if (isspace(*pos) || *pos == ',' || *pos == ']' || *pos == '}') { + addToken(PRIMITIVE, string(start, pos), parents); + pos--; + return OK; + } + if (*pos < 32 || *pos >= 127) { + pos = start; + return ERROR_INVAL; + } + } + pos = start; + return ERROR_PART; +} + +int Parser::parseString(const string& js, string::const_iterator& pos, stack& parents) { + string::const_iterator start = pos; + + pos++; // skip starting quote + + for (; pos != js.cend(); pos++) { + // Quote: end of string + if (*pos == '\"') { + addToken(STRING, string(start + 1, pos), parents); + return OK; + } + + // Backslash: Quoted symbol expected + if (*pos == '\\' && pos + 1 < js.cend()) { + pos++; + switch (*pos) { + // Allowed escaped symbols + case '\"': case '/' : case '\\' : case 'b' : + case 'f' : case 'r' : case 'n' : case 't' : + break; + // Allows escaped symbol \uXXXX + case 'u': + pos++; + for (int i = 0; i < 4 && pos < js.cend(); i++) { + if (!isxdigit(*pos)) { + pos = start; + return ERROR_INVAL; + } + pos++; + } + pos--; + break; + // Unexpected symbol + default: + pos = start; + return ERROR_INVAL; + } + } + } + pos = start; + return ERROR_PART; +} + +int Parser::parse(const std::string& js) { + stack parents; + string::const_iterator pos = js.cbegin(); + + tokens.clear(); + + for (; pos != js.cend(); pos++) { + if (isspace(*pos)) + continue; + switch (*pos) { + case '{': case '[': { + int type = (*pos == '{' ? OBJECT : ARRAY); + addToken(type, string(), parents); + parents.push(tokens.size() - 1); + break; + } + case '}': case ']': { + if (parents.empty()) + return ERROR_INVAL; + int type = (*pos == '}' ? OBJECT : ARRAY); + Token* t = &tokens[parents.top()]; + parents.pop(); + if (t->type != type) + return ERROR_INVAL; + break; + } + case '\"': { + int r = parseString(js, pos, parents); + if (r < 0) return r; + break; + } + case ':': { + if (tokens.empty() || tokens.back().type != STRING) + return ERROR_INVAL; + parents.push(tokens.size() - 1); + break; + } + case ',': { + if (parents.empty()) + return ERROR_INVAL; + break; + } + case '-': case '0': case '1' : case '2': case '3' : case '4': + case '5': case '6': case '7' : case '8': case '9': + case 't': case 'f': case 'n' : { + if (parents.empty()) + return ERROR_INVAL; + Token *t = &tokens[parents.top()]; + if (t->type == OBJECT || + (t->type == STRING && t->size != 0)) { + return ERROR_INVAL; + } + int r = parsePrimitive(js, pos, parents); + if (r < 0) return r; + break; + } + default: + // Unexpected character + return ERROR_INVAL; + } + } + + if (!parents.empty()) + return ERROR_PART; + + return tokens.size(); +} + +} diff --git a/browser/extensions/mortar/json/json.h b/browser/extensions/mortar/json/json.h new file mode 100644 index 000000000000..0b6b0127e86e --- /dev/null +++ b/browser/extensions/mortar/json/json.h @@ -0,0 +1,67 @@ +#ifndef __JSON_H_ +#define __JSON_H_ + +#include +#include +#include +#include + +namespace JSON { + +enum { + OK = 0, + ERROR_INVAL = -1, /* Invalid character inside JSON string */ + ERROR_PART = -2 /* The string is not a full JSON packet, more bytes expected */ +}; + +class Token { + friend class Parser; + +protected: + int type; + int size; + std::string v; + +public: + Token(int _type, const std::string& _v); + + bool isPrimitive() const; + bool isString() const; + bool isObject() const; + bool isArray() const; + + std::string value() const { + return v; + } + + size_t children() const { + return size; + } +}; + +class Parser { + std::vector tokens; + + void addToken(int type, const std::string& value, std::stack& parents); + int parsePrimitive(const std::string& js, std::string::const_iterator& pos, std::stack& parents); + int parseString(const std::string& js, std::string::const_iterator& pos, std::stack& parents); +public: + int parse(const std::string& js); + + typedef std::vector::const_iterator iterator; + + iterator begin() const { return tokens.cbegin(); } + iterator end() const { return tokens.cend(); } + + const Token& operator[](int index) const { + return tokens[index]; + } + + size_t size() const { + return tokens.size(); + } +}; + +} + +#endif /* __JSON_H_ */ diff --git a/browser/extensions/mortar/json/test.cpp b/browser/extensions/mortar/json/test.cpp new file mode 100644 index 000000000000..5d148e5dd268 --- /dev/null +++ b/browser/extensions/mortar/json/test.cpp @@ -0,0 +1,433 @@ +#include +#include +#include + +static int test_passed = 0; +static int test_failed = 0; + +/* Terminate current test with error */ +#define fail() return __LINE__ + +/* Successfull end of the test case */ +#define done() return 0 + +/* Check single condition */ +#define check(cond) do { if (!(cond)) fail(); } while (0) + +/* Test runner */ +static void test(int (*func)(void), const char *name) { + int r = func(); + if (r == 0) { + test_passed++; + } else { + test_failed++; + printf("FAILED: %s (at line %d)\n", name, r); + } +} + +#include "json.cpp" + +using namespace std; +using namespace JSON; + +static bool TOKEN_STRING(const Token& t, const char *s) { + return !t.value().compare(string(s)); +} + +static bool isObject(const Token& t, int children) { + return t.isObject() && t.children() == children; +} + +static bool isArray(const Token& t, int children) { + return t.isArray() && t.children() == children; +} + +static bool isKey(const Token& t, const char* v) { + return t.isString() && t.children() == 1 && t.value() == v; +} + +static bool isPrimitive(const Token& t, const char* v) { + return t.isPrimitive() && t.children() == 0 && t.value() == v; +} + +int test_empty() { + const char *js; + int r; + Parser p; + + js = "{}"; + r = p.parse(string(js)); + check(r == 1); + check(isObject(p[0], 0)); + + js = "[]"; + r = p.parse(string(js)); + check(r == 1); + check(isArray(p[0], 0)); + + js = "{\"a\":[]}"; + r = p.parse(string(js)); + check(r == 3); + check(isObject(p[0], 1)); + check(isKey(p[1], "a")); + check(isArray(p[2], 0)); + + js = "[{},{}]"; + r = p.parse(string(js)); + check(r >= 0); + check(isArray(p[0], 2)); + check(isObject(p[1], 0)); + check(isObject(p[2], 0)); + return 0; +} + +int test_simple() { + const char *js; + int r; + Parser p; + + js = "{\"a\": 0}"; + + r = p.parse(string(js)); + check(r == 3); + check(isObject(p[0], 1)); + check(isKey(p[1], "a")); + check(isPrimitive(p[2], "0")); + + js = "[\"a\":{},\"b\":{}]"; + r = p.parse(string(js)); + check(r == 5); + check(isArray(p[0], 2)); + check(isKey(p[1], "a")); + check(isObject(p[2], 0)); + check(isKey(p[3], "b")); + check(isObject(p[4], 0)); + + js = "{\n \"Day\": 26,\n \"Month\": 9,\n \"Year\": 12\n }"; + r = p.parse(string(js)); + check(r == 7); + + return 0; +} + +int test_primitive() { + int r; + Parser p; + const char *js; + js = "{\"boolVar\" : true}"; + r = p.parse(string(js)); + check(r == 3); + check(p[0].isObject() && p[1].isString() && p[2].isPrimitive()); + check(TOKEN_STRING(p[1], "boolVar")); + check(TOKEN_STRING(p[2], "true")); + + js = "{\"boolVar\" : false}"; + r = p.parse(string(js)); + check(r == 3); + check(p[0].isObject() && p[1].isString() && p[2].isPrimitive()); + check(TOKEN_STRING(p[1], "boolVar")); + check(TOKEN_STRING(p[2], "false")); + + js = "{\"intVar\" : 12345}"; + r = p.parse(string(js)); + check(r == 3); + check(p[0].isObject() && p[1].isString() && p[2].isPrimitive()); + check(TOKEN_STRING(p[1], "intVar")); + check(TOKEN_STRING(p[2], "12345")); + + js = "{\"floatVar\" : 12.345}"; + r = p.parse(string(js)); + check(r == 3); + check(p[0].isObject() && p[1].isString() && p[2].isPrimitive()); + check(TOKEN_STRING(p[1], "floatVar")); + check(TOKEN_STRING(p[2], "12.345")); + + js = "{\"nullVar\" : null}"; + r = p.parse(string(js)); + check(r == 3); + check(p[0].isObject() && p[1].isString() && p[2].isPrimitive()); + check(TOKEN_STRING(p[1], "nullVar")); + check(TOKEN_STRING(p[2], "null")); + + return 0; +} + +int test_string() { + int r; + Parser p; + const char *js; + + js = "\"strVar\" : \"hello world\""; + r = p.parse(string(js)); + check(r >= 0 && p[0].isString() + && p[1].isString()); + check(TOKEN_STRING(p[0], "strVar")); + check(TOKEN_STRING(p[1], "hello world")); + + js = "\"strVar\" : \"escapes: \\/\\r\\n\\t\\b\\f\\\"\\\\\""; + r = p.parse(string(js)); + check(r >= 0 && p[0].isString() + && p[1].isString()); + check(TOKEN_STRING(p[0], "strVar")); + check(TOKEN_STRING(p[1], "escapes: \\/\\r\\n\\t\\b\\f\\\"\\\\")); + + js = "\"strVar\" : \"\""; + r = p.parse(string(js)); + check(r >= 0 && p[0].isString() + && p[1].isString()); + check(TOKEN_STRING(p[0], "strVar")); + check(TOKEN_STRING(p[1], "")); + + return 0; +} + +int test_partial_string() { + int r; + Parser p; + const char *js; + + js = "\"x\": \"va"; + r = p.parse(string(js)); + check(r == ERROR_PART && p[0].isString()); + check(TOKEN_STRING(p[0], "x")); + check(p.size() == 1); + + char js_slash[] = "\"x\": \"va\\"; + r = p.parse(string(js_slash)); // intentionally not sizeof(js_slash) + check(r == ERROR_PART); + + char js_unicode[] = "\"x\": \"va\\u"; + r = p.parse(string(js_unicode)); // intentionally not sizeof(js_unicode) + check(r == ERROR_PART); + + js = "\"x\": \"valu"; + r = p.parse(string(js)); + check(r == ERROR_PART && p[0].isString()); + check(TOKEN_STRING(p[0], "x")); + check(p.size() == 1); + + js = "\"x\": \"value\""; + r = p.parse(string(js)); + check(r >= 0 && p[0].isString() + && p[1].isString()); + check(TOKEN_STRING(p[0], "x")); + check(TOKEN_STRING(p[1], "value")); + + js = "{\"x\": \"value\", \"y\": \"value y\"}"; + r = p.parse(string(js)); + check(r >= 0 + && p[0].isObject() + && p[1].isString() + && p[2].isString() + && p[3].isString() + && p[4].isString()); + check(TOKEN_STRING(p[1], "x")); + check(TOKEN_STRING(p[2], "value")); + check(TOKEN_STRING(p[3], "y")); + check(TOKEN_STRING(p[4], "value y")); + + return 0; +} + +int test_partial_array() { + int r; + Parser p; + const char *js; + + js = " [ 1, true, "; + r = p.parse(string(js)); + check(r == ERROR_PART && p[0].isArray() + && p[1].isPrimitive() && p[2].isPrimitive()); + + js = " [ 1, true, [123, \"hello"; + r = p.parse(string(js)); + check(r == ERROR_PART && p[0].isArray() + && p[1].isPrimitive() && p[2].isPrimitive() + && p[3].isArray() && p[4].isPrimitive()); + + js = " [ 1, true, [123, \"hello\"]"; + r = p.parse(string(js)); + check(r == ERROR_PART && p[0].isArray() + && p[1].isPrimitive() && p[2].isPrimitive() + && p[3].isArray() && p[4].isPrimitive() + && p[5].isString()); + /* check child nodes of the 2nd array */ + check(p[3].children() == 2); + + js = " [ 1, true, [123, \"hello\"]]"; + r = p.parse(string(js)); + check(r >= 0 && p[0].isArray() + && p[1].isPrimitive() && p[2].isPrimitive() + && p[3].isArray() && p[4].isPrimitive() + && p[5].isString()); + check(p[3].children() == 2); + check(p[0].children() == 3); + return 0; +} + +int test_objects_arrays() { + int r; + Parser p; + const char *js; + + js = "[10}"; + r = p.parse(string(js)); + check(r == ERROR_INVAL); + + js = "[10]"; + r = p.parse(string(js)); + check(r >= 0); + + js = "{\"a\": 1]"; + r = p.parse(string(js)); + check(r == ERROR_INVAL); + + js = "{\"a\": 1}"; + r = p.parse(string(js)); + check(r >= 0); + + return 0; +} + +int test_issue_22() { + int r; + Parser p; + const char *js; + + js = "{ \"height\":10, \"layers\":[ { \"data\":[6,6], \"height\":10, " + "\"name\":\"Calque de Tile 1\", \"opacity\":1, \"type\":\"tilelayer\", " + "\"visible\":true, \"width\":10, \"x\":0, \"y\":0 }], " + "\"orientation\":\"orthogonal\", \"properties\": { }, \"tileheight\":32, " + "\"tilesets\":[ { \"firstgid\":1, \"image\":\"..\\/images\\/tiles.png\", " + "\"imageheight\":64, \"imagewidth\":160, \"margin\":0, \"name\":\"Tiles\", " + "\"properties\":{}, \"spacing\":0, \"tileheight\":32, \"tilewidth\":32 }], " + "\"tilewidth\":32, \"version\":1, \"width\":10 }"; + r = p.parse(string(js)); + check(r >= 0); + return 0; +} + +int test_unicode_characters() { + Parser p; + const char *js; + + int r; + js = "{\"a\":\"\\uAbcD\"}"; + r = p.parse(string(js)); + check(r >= 0); + + js = "{\"a\":\"str\\u0000\"}"; + r = p.parse(string(js)); + check(r >= 0); + + js = "{\"a\":\"\\uFFFFstr\"}"; + r = p.parse(string(js)); + check(r >= 0); + + js = "{\"a\":\"str\\uFFGFstr\"}"; + r = p.parse(string(js)); + check(r == ERROR_INVAL); + + js = "{\"a\":\"str\\u@FfF\"}"; + r = p.parse(string(js)); + check(r == ERROR_INVAL); + + js = "{\"a\":[\"\\u028\"]}"; + r = p.parse(string(js)); + check(r == ERROR_INVAL); + + js = "{\"a\":[\"\\u0280\"]}"; + r = p.parse(string(js)); + check(r >= 0); + + return 0; +} + +int test_count() { + Parser p; + const char *js; + + js = "{}"; + check(p.parse(string(js)) == 1); + + js = "[]"; + check(p.parse(string(js)) == 1); + + js = "[[]]"; + check(p.parse(string(js)) == 2); + + js = "[[], []]"; + check(p.parse(string(js)) == 3); + + js = "[[], []]"; + check(p.parse(string(js)) == 3); + + js = "[[], [[]], [[], []]]"; + check(p.parse(string(js)) == 7); + + js = "[\"a\", [[], []]]"; + check(p.parse(string(js)) == 5); + + js = "[[], \"[], [[]]\", [[]]]"; + check(p.parse(string(js)) == 5); + + js = "[1, 2, 3]"; + check(p.parse(string(js)) == 4); + + js = "[1, 2, [3, \"a\"], null]"; + check(p.parse(string(js)) == 7); + + return 0; +} + +int test_keyvalue() { + const char *js; + int r; + Parser p; + vector tokens; + + js = "{\"a\": 0, \"b\": \"c\"}"; + + r = p.parse(string(js)); + check(r == 5); + check(p[0].children() == 2); /* two keys */ + check(p[1].children() == 1 && p[3].children() == 1); /* one value per key */ + check(p[2].children() == 0 && p[4].children() == 0); /* values have zero size */ + + js = "{\"a\"\n0}"; + r = p.parse(string(js)); + check(r == ERROR_INVAL); + + js = "{\"a\", 0}"; + r = p.parse(string(js)); + check(r == ERROR_INVAL); + + js = "{\"a\": {2}}"; + r = p.parse(string(js)); + check(r == ERROR_INVAL); + + js = "{\"a\": {2: 3}}"; + r = p.parse(string(js)); + check(r == ERROR_INVAL); + + js = "{\"a\": {\"a\": 2 3}}"; + r = p.parse(string(js)); + check(r == ERROR_INVAL); + return 0; +} + +int main() { + test(test_empty, "general test for a empty JSON objects/arrays"); + test(test_simple, "general test for a simple JSON string"); + test(test_primitive, "test primitive JSON data types"); + test(test_string, "test string JSON data types"); + test(test_partial_string, "test partial JSON string parsing"); + test(test_partial_array, "test partial array reading"); + test(test_objects_arrays, "test objects and arrays"); + test(test_unicode_characters, "test unicode characters"); + test(test_issue_22, "test issue #22"); + test(test_count, "test tokens count estimation"); + test(test_keyvalue, "test for keys/values"); + printf("PASSED: %d\nFAILED: %d\n", test_passed, test_failed); + return 0; +} diff --git a/browser/extensions/mortar/ppapi/LICENSE b/browser/extensions/mortar/ppapi/LICENSE new file mode 100644 index 000000000000..dd8b4c462eb5 --- /dev/null +++ b/browser/extensions/mortar/ppapi/LICENSE @@ -0,0 +1,51 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +/* +** Copyright (c) 2007-2010 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ diff --git a/browser/extensions/mortar/ppapi/api/dev/pp_cursor_type_dev.idl b/browser/extensions/mortar/ppapi/api/dev/pp_cursor_type_dev.idl new file mode 100644 index 000000000000..08abec3b224c --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/dev/pp_cursor_type_dev.idl @@ -0,0 +1,56 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines enumerations for cursor types. + */ + +[assert_size(4),notypedef] enum PP_CursorType_Dev { + PP_CURSORTYPE_CUSTOM = -1, + PP_CURSORTYPE_POINTER = 0, + PP_CURSORTYPE_CROSS = 1, + PP_CURSORTYPE_HAND = 2, + PP_CURSORTYPE_IBEAM = 3, + PP_CURSORTYPE_WAIT = 4, + PP_CURSORTYPE_HELP = 5, + PP_CURSORTYPE_EASTRESIZE = 6, + PP_CURSORTYPE_NORTHRESIZE = 7, + PP_CURSORTYPE_NORTHEASTRESIZE = 8, + PP_CURSORTYPE_NORTHWESTRESIZE = 9, + PP_CURSORTYPE_SOUTHRESIZE = 10, + PP_CURSORTYPE_SOUTHEASTRESIZE = 11, + PP_CURSORTYPE_SOUTHWESTRESIZE = 12, + PP_CURSORTYPE_WESTRESIZE = 13, + PP_CURSORTYPE_NORTHSOUTHRESIZE = 14, + PP_CURSORTYPE_EASTWESTRESIZE = 15, + PP_CURSORTYPE_NORTHEASTSOUTHWESTRESIZE = 16, + PP_CURSORTYPE_NORTHWESTSOUTHEASTRESIZE = 17, + PP_CURSORTYPE_COLUMNRESIZE = 18, + PP_CURSORTYPE_ROWRESIZE = 19, + PP_CURSORTYPE_MIDDLEPANNING = 20, + PP_CURSORTYPE_EASTPANNING = 21, + PP_CURSORTYPE_NORTHPANNING = 22, + PP_CURSORTYPE_NORTHEASTPANNING = 23, + PP_CURSORTYPE_NORTHWESTPANNING = 24, + PP_CURSORTYPE_SOUTHPANNING = 25, + PP_CURSORTYPE_SOUTHEASTPANNING = 26, + PP_CURSORTYPE_SOUTHWESTPANNING = 27, + PP_CURSORTYPE_WESTPANNING = 28, + PP_CURSORTYPE_MOVE = 29, + PP_CURSORTYPE_VERTICALTEXT = 30, + PP_CURSORTYPE_CELL = 31, + PP_CURSORTYPE_CONTEXTMENU = 32, + PP_CURSORTYPE_ALIAS = 33, + PP_CURSORTYPE_PROGRESS = 34, + PP_CURSORTYPE_NODROP = 35, + PP_CURSORTYPE_COPY = 36, + PP_CURSORTYPE_NONE = 37, + PP_CURSORTYPE_NOTALLOWED = 38, + PP_CURSORTYPE_ZOOMIN = 39, + PP_CURSORTYPE_ZOOMOUT = 40, + PP_CURSORTYPE_GRAB = 41, + PP_CURSORTYPE_GRABBING = 42 +}; + diff --git a/browser/extensions/mortar/ppapi/api/dev/pp_print_settings_dev.idl b/browser/extensions/mortar/ppapi/api/dev/pp_print_settings_dev.idl new file mode 100644 index 000000000000..fafcc08b28bc --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/dev/pp_print_settings_dev.idl @@ -0,0 +1,45 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the struct for PrintSettings. + */ + +[assert_size(4)] +enum PP_PrintOrientation_Dev { + PP_PRINTORIENTATION_NORMAL = 0, + PP_PRINTORIENTATION_ROTATED_90_CW = 1, + PP_PRINTORIENTATION_ROTATED_180 = 2, + PP_PRINTORIENTATION_ROTATED_90_CCW = 3 +}; + +[assert_size(4)] +enum PP_PrintOutputFormat_Dev { + PP_PRINTOUTPUTFORMAT_RASTER = 1u << 0, + PP_PRINTOUTPUTFORMAT_PDF = 1u << 1, + PP_PRINTOUTPUTFORMAT_POSTSCRIPT = 1u << 2, + PP_PRINTOUTPUTFORMAT_EMF = 1u << 3 +}; + +[assert_size(4)] +enum PP_PrintScalingOption_Dev { + PP_PRINTSCALINGOPTION_NONE = 0, + PP_PRINTSCALINGOPTION_FIT_TO_PRINTABLE_AREA = 1, + PP_PRINTSCALINGOPTION_SOURCE_SIZE = 2 +}; + +[assert_size(60)] +struct PP_PrintSettings_Dev { + /** This is the size of the printable area in points (1/72 of an inch). */ + PP_Rect printable_area; + PP_Rect content_area; + PP_Size paper_size; + int32_t dpi; + PP_PrintOrientation_Dev orientation; + PP_PrintScalingOption_Dev print_scaling_option; + PP_Bool grayscale; + /** Note that Chrome currently only supports PDF printing. */ + PP_PrintOutputFormat_Dev format; +}; diff --git a/browser/extensions/mortar/ppapi/api/dev/pp_video_capture_dev.idl b/browser/extensions/mortar/ppapi/api/dev/pp_video_capture_dev.idl new file mode 100644 index 000000000000..7acee8906805 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/dev/pp_video_capture_dev.idl @@ -0,0 +1,47 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * Structs for dealing with video capture. + */ + +/** + * PP_VideoCaptureDeviceInfo_Dev is a structure that represent a video capture + * configuration, such as resolution and frame rate. + */ +[assert_size(12)] +struct PP_VideoCaptureDeviceInfo_Dev { + uint32_t width; + uint32_t height; + uint32_t frames_per_second; +}; + +/** + * PP_VideoCaptureStatus_Dev is an enumeration that defines the various possible + * states of a VideoCapture. + */ +[assert_size(4)] +enum PP_VideoCaptureStatus_Dev { + /** + * Initial state, capture is stopped. + */ + PP_VIDEO_CAPTURE_STATUS_STOPPED = 0, + /** + * StartCapture has been called, but capture hasn't started yet. + */ + PP_VIDEO_CAPTURE_STATUS_STARTING = 1, + /** + * Capture has been started. + */ + PP_VIDEO_CAPTURE_STATUS_STARTED = 2, + /** + * Capture has been started, but is paused because no buffer is available. + */ + PP_VIDEO_CAPTURE_STATUS_PAUSED = 3, + /** + * StopCapture has been called, but capture hasn't stopped yet. + */ + PP_VIDEO_CAPTURE_STATUS_STOPPING = 4 +}; diff --git a/browser/extensions/mortar/ppapi/api/dev/pp_video_dev.idl b/browser/extensions/mortar/ppapi/api/dev/pp_video_dev.idl new file mode 100644 index 000000000000..1c70342effcf --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/dev/pp_video_dev.idl @@ -0,0 +1,126 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * NOTE: these must be kept in sync with the versions in media/! + */ + + +/** + * Video format. + * + * Keep the values in this enum unique, as they imply format (h.264 vs. VP8, + * for example), and keep the values for a particular format grouped together + * for clarity. + * Note: Keep these in sync with media::VideoCodecProfile. + */ +[assert_size(4)] +enum PP_VideoDecoder_Profile { + PP_VIDEODECODER_PROFILE_UNKNOWN = -1, + PP_VIDEODECODER_H264PROFILE_NONE = 0, + PP_VIDEODECODER_H264PROFILE_BASELINE = 1, + PP_VIDEODECODER_H264PROFILE_MAIN = 2, + PP_VIDEODECODER_H264PROFILE_EXTENDED = 3, + PP_VIDEODECODER_H264PROFILE_HIGH = 4, + PP_VIDEODECODER_H264PROFILE_HIGH10PROFILE = 5, + PP_VIDEODECODER_H264PROFILE_HIGH422PROFILE = 6, + PP_VIDEODECODER_H264PROFILE_HIGH444PREDICTIVEPROFILE = 7, + PP_VIDEODECODER_H264PROFILE_SCALABLEBASELINE = 8, + PP_VIDEODECODER_H264PROFILE_SCALABLEHIGH = 9, + PP_VIDEODECODER_H264PROFILE_STEREOHIGH = 10, + PP_VIDEODECODER_H264PROFILE_MULTIVIEWHIGH = 11, + PP_VIDEODECODER_VP8PROFILE_ANY = 12 +}; + +/** + * The data structure for video bitstream buffer. + */ +[assert_size(12)] +struct PP_VideoBitstreamBuffer_Dev { + /** + * Client-specified identifier for the bitstream buffer. Valid values are + * non-negative. + */ + int32_t id; + + /** + * Buffer to hold the bitstream data. Should be allocated using the + * PPB_Buffer interface for consistent interprocess behaviour. + */ + PP_Resource data; + + /** + * Size of the bitstream contained in buffer (in bytes). + */ + uint32_t size; +}; + +/** + * Struct for specifying texture-backed picture data. + */ +[assert_size(16)] +struct PP_PictureBuffer_Dev { + /** + * Client-specified id for the picture buffer. By using this value client can + * keep track of the buffers it has assigned to the video decoder and how they + * are passed back to it. Valid values are non-negative. + */ + int32_t id; + + /** + * Dimensions of the buffer. + */ + PP_Size size; + + /** + * Texture ID in the given context where picture is stored. + */ + uint32_t texture_id; +}; + +/** + * Structure to describe a decoded output frame. + */ +[assert_size(8)] +struct PP_Picture_Dev { + /** + * ID of the picture buffer where the picture is stored. + */ + int32_t picture_buffer_id; + + /** + * ID of the bitstream from which this data was decoded. + */ + int32_t bitstream_buffer_id; +}; + +/** + * Decoder error codes reported to the plugin. A reasonable naive + * error handling policy is for the plugin to Destroy() the decoder on error. + */ +[assert_size(4)] +enum PP_VideoDecodeError_Dev { + /** + * An operation was attempted during an incompatible decoder state. + */ + PP_VIDEODECODERERROR_ILLEGAL_STATE = 1, + + /** + * Invalid argument was passed to an API method. + */ + PP_VIDEODECODERERROR_INVALID_ARGUMENT = 2, + + /** + * Encoded input is unreadable. + */ + PP_VIDEODECODERERROR_UNREADABLE_INPUT = 3, + + /** + * A failure occurred at the browser layer or lower. Examples of such + * failures include GPU hardware failures, GPU driver failures, GPU library + * failures, browser programming errors, and so on. + */ + PP_VIDEODECODERERROR_PLATFORM_FAILURE = 4 +}; diff --git a/browser/extensions/mortar/ppapi/api/dev/ppb_audio_input_dev.idl b/browser/extensions/mortar/ppapi/api/dev/ppb_audio_input_dev.idl new file mode 100644 index 000000000000..71ce6eb7525f --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/dev/ppb_audio_input_dev.idl @@ -0,0 +1,198 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_AudioInput_Dev interface, which + * provides realtime audio input capture. + */ + +label Chrome { + M25 = 0.3, + M30 = 0.4 +}; + +/** + * PPB_AudioInput_Callback defines the type of an audio callback + * function used to provide the audio buffer with data. This callback will be + * called on a separate thread from the creation thread. + * + * @param[in] sample_buffer A buffer providing audio input data. + * @param[in] buffer_size_in_bytes The size of the buffer in bytes. + * @param[in] latency The time that has elapsed since the data was recorded. + * @param[inout] user_data An opaque pointer that was passed into + * PPB_AudioInput_Dev.Open(). + */ +typedef void PPB_AudioInput_Callback([in] mem_t sample_buffer, + [in] uint32_t buffer_size_in_bytes, + [in, version=0.4] PP_TimeDelta latency, + [inout] mem_t user_data); + +/** + * The PPB_AudioInput_Dev interface contains pointers to several + * functions for handling audio input resources. + * + * TODO(brettw) before moving out of dev, we need to resolve the issue of + * the mismatch between the current audio config interface and this one. + * + * In particular, the params for input assume stereo, but this class takes + * everything as mono. We either need to not use an audio config resource, or + * add mono support. + * + * In addition, RecommendSampleFrameCount is completely wrong for audio input. + * RecommendSampleFrameCount returns the frame count for the current + * low-latency output device, which is likely inappropriate for a random input + * device. We may want to move the "recommend" functions to the input or output + * classes rather than the config. + */ +[macro="PPB_AUDIO_INPUT_DEV_INTERFACE"] +interface PPB_AudioInput_Dev { + /** + * Creates an audio input resource. + * + * @param[in] instance A PP_Instance identifying one instance of + * a module. + * + * @return A PP_Resource corresponding to an audio input resource + * if successful, 0 if failed. + */ + PP_Resource Create( + [in] PP_Instance instance); + + /** + * Determines if the given resource is an audio input resource. + * + * @param[in] resource A PP_Resource containing a resource. + * + * @return A PP_Bool containing PP_TRUE if the given + * resource is an audio input resource, otherwise PP_FALSE. + */ + PP_Bool IsAudioInput( + [in] PP_Resource resource); + + /** + * Enumerates audio input devices. + * + * @param[in] audio_input A PP_Resource corresponding to an audio + * input resource. + * @param[in] output An output array which will receive + * PPB_DeviceRef_Dev resources on success. Please note that the + * ref count of those resources has already been increased by 1 for the + * caller. + * @param[in] callback A PP_CompletionCallback to run on + * completion. + * + * @return An error code from pp_errors.h. + */ + [version=0.3] + int32_t EnumerateDevices( + [in] PP_Resource audio_input, + [in] PP_ArrayOutput output, + [in] PP_CompletionCallback callback); + + /** + * Requests device change notifications. + * + * @param[in] audio_input A PP_Resource corresponding to an audio + * input resource. + * @param[in] callback The callback to receive notifications. If not NULL, it + * will be called once for the currently available devices, and then every + * time the list of available devices changes. All calls will happen on the + * same thread as the one on which MonitorDeviceChange() is called. It will + * receive notifications until audio_input is destroyed or + * MonitorDeviceChange() is called to set a new callback for + * audio_input. You can pass NULL to cancel sending + * notifications. + * @param[inout] user_data An opaque pointer that will be passed to + * callback. + * + * @return An error code from pp_errors.h. + */ + [version=0.3] + int32_t MonitorDeviceChange( + [in] PP_Resource audio_input, + [in] PP_MonitorDeviceChangeCallback callback, + [inout] mem_t user_data); + + /** + * Opens an audio input device. No sound will be captured until + * StartCapture() is called. + * + * @param[in] audio_input A PP_Resource corresponding to an audio + * input resource. + * @param[in] device_ref Identifies an audio input device. It could be one of + * the resource in the array returned by EnumerateDevices(), or 0 which means + * the default device. + * @param[in] config A PPB_AudioConfig audio configuration + * resource. + * @param[in] audio_input_callback A PPB_AudioInput_Callback + * function that will be called when data is available. + * @param[inout] user_data An opaque pointer that will be passed into + * audio_input_callback. + * @param[in] callback A PP_CompletionCallback to run when this + * open operation is completed. + * + * @return An error code from pp_errors.h. + */ + int32_t Open( + [in] PP_Resource audio_input, + [in] PP_Resource device_ref, + [in] PP_Resource config, + [in] PPB_AudioInput_Callback audio_input_callback, + [inout] mem_t user_data, + [in] PP_CompletionCallback callback); + + /** + * Returns an audio config resource for the given audio input resource. + * + * @param[in] audio_input A PP_Resource corresponding to an audio + * input resource. + * + * @return A PP_Resource containing the audio config resource if + * successful. + */ + PP_Resource GetCurrentConfig( + [in] PP_Resource audio_input); + + /** + * Starts the capture of the audio input resource and begins periodically + * calling the callback. + * + * @param[in] audio_input A PP_Resource corresponding to an audio + * input resource. + * + * @return A PP_Bool containing PP_TRUE if + * successful, otherwise PP_FALSE. + * Also returns PP_TRUE (and is a no-op) if called while capture + * is already started. + */ + PP_Bool StartCapture( + [in] PP_Resource audio_input); + + /** + * Stops the capture of the audio input resource. + * + * @param[in] audio_input A PP_Resource containing the audio input resource. + * + * @return A PP_Bool containing PP_TRUE if + * successful, otherwise PP_FALSE. + * Also returns PP_TRUE (and is a no-op) if called while capture + * is already stopped. If a buffer is being captured, StopCapture will block + * until the call completes. + */ + PP_Bool StopCapture( + [in] PP_Resource audio_input); + + /** + * Closes the audio input device, and stops capturing if necessary. It is + * not valid to call Open() again after a call to this method. + * If an audio input resource is destroyed while a device is still open, then + * it will be implicitly closed, so you are not required to call this method. + * + * @param[in] audio_input A PP_Resource corresponding to an audio + * input resource. + */ + void Close( + [in] PP_Resource audio_input); +}; diff --git a/browser/extensions/mortar/ppapi/api/dev/ppb_buffer_dev.idl b/browser/extensions/mortar/ppapi/api/dev/ppb_buffer_dev.idl new file mode 100644 index 000000000000..0fbc5b8fceba --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/dev/ppb_buffer_dev.idl @@ -0,0 +1,51 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_Buffer_Dev interface. + */ + +label Chrome { + M14 = 0.4 +}; + +interface PPB_Buffer_Dev { + /** + * Allocates a buffer of the given size in bytes. The return value will have + * a non-zero ID on success, or zero on failure. Failure means the module + * handle was invalid. The buffer will be initialized to contain zeroes. + */ + PP_Resource Create( + [in] PP_Instance instance, + [in] uint32_t size_in_bytes); + + /** + * Returns PP_TRUE if the given resource is a Buffer. Returns PP_FALSE if the + * resource is invalid or some type other than a Buffer. + */ + PP_Bool IsBuffer( + [in] PP_Resource resource); + + /** + * Gets the size of the buffer. Returns PP_TRUE on success, PP_FALSE + * if the resource is not a buffer. On failure, |*size_in_bytes| is not set. + */ + PP_Bool Describe( + [in] PP_Resource resource, + [out] uint32_t size_in_bytes); + + /** + * Maps this buffer into the plugin address space and returns a pointer to + * the beginning of the data. + */ + mem_t Map( + [in] PP_Resource resource); + + /** + * Unmaps this buffer. + */ + void Unmap( + [in] PP_Resource resource); +}; diff --git a/browser/extensions/mortar/ppapi/api/dev/ppb_char_set_dev.idl b/browser/extensions/mortar/ppapi/api/dev/ppb_char_set_dev.idl new file mode 100644 index 000000000000..1e63ecc97cb6 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/dev/ppb_char_set_dev.idl @@ -0,0 +1,106 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_CharSet_Dev interface. + */ + +label Chrome { + M14 = 0.4 +}; + +[assert_size(4)] enum PP_CharSet_ConversionError { + /** + * Causes the entire conversion to fail if an error is encountered. The + * conversion function will return NULL. + */ + PP_CHARSET_CONVERSIONERROR_FAIL, + + /** + * Silently skips over errors. Unrepresentable characters and input encoding + * errors will be removed from the output. + */ + PP_CHARSET_CONVERSIONERROR_SKIP, + + /** + * Replaces the error or unrepresentable character with a substitution + * character. When converting to a Unicode character set (UTF-8 or UTF-16) it + * will use the unicode "substitution character" U+FFFD. When converting to + * another character set, the character will be charset-specific. For many + * languages this will be the representation of the '?' character. + */ + PP_CHARSET_CONVERSIONERROR_SUBSTITUTE +}; + +[version=0.0] +describe { + uint16_ptr_t; +}; + +#inline c + +typedef uint16_t* uint16_ptr_t; + +#endinl + +/** + * The PPB_CharSet_Trusted interface provides functions for + * converting between character sets. + * + * This inteface is provided for trusted plugins only since in Native Client it + * would require an expensive out-of-process IPC call for each conversion, + * which makes performance unacceptable. Native Client plugins should include + * ICU or some other library if they need this feature. + */ +interface PPB_CharSet_Dev { + /** + * Converts the UTF-16 string pointed to by |*utf16| to an 8-bit string in + * the specified code page. |utf16_len| is measured in UTF-16 units, not + * bytes. This value may not be NULL. + * + * The given output buffer will be filled up to output_length bytes with the + * result. output_length will be updated with the number of bytes required + * for the given string. The output buffer may be null to just retrieve the + * required buffer length. + * + * This function will return PP_FALSE if there was an error converting the + * string and you requested PP_CHARSET_CONVERSIONERROR_FAIL, or the output + * character set was unknown. Otherwise, it will return PP_TRUE. + */ + str_t UTF16ToCharSet([in] PP_Instance instance, + [in, size_as=utf16_len] uint16_t[] utf16, + [in] uint32_t utf16_len, + [in] str_t output_char_set, + [in] PP_CharSet_ConversionError on_error, + [out] uint32_t output_length); + + /** + * Same as UTF16ToCharSet except converts in the other direction. The input + * is in the given charset, and the |input_len| is the number of bytes in + * the |input| string. + * + * Note that the output_utf16_length is measured in UTF-16 characters. + * + * Since UTF16 can represent every Unicode character, the only time the + * replacement character will be used is if the encoding in the input string + * is incorrect. + */ + uint16_ptr_t CharSetToUTF16([in] PP_Instance instance, + [in] str_t input, + [in] uint32_t input_len, + [in] str_t input_char_set, + [in] PP_CharSet_ConversionError on_error, + [out] uint32_t output_utf16_length); + + /** + * Returns a string var representing the current multi-byte character set of + * the current system. + * + * WARNING: You really shouldn't be using this function unless you're dealing + * with legacy data. You should be using UTF-8 or UTF-16 and you don't have + * to worry about the character sets. + */ + PP_Var GetDefaultCharSet([in] PP_Instance instance); +}; diff --git a/browser/extensions/mortar/ppapi/api/dev/ppb_crypto_dev.idl b/browser/extensions/mortar/ppapi/api/dev/ppb_crypto_dev.idl new file mode 100644 index 000000000000..51b2baec334c --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/dev/ppb_crypto_dev.idl @@ -0,0 +1,20 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_Crypto_Dev interface. + */ + +label Chrome { + M13 = 0.1 +}; + +interface PPB_Crypto_Dev { + /** + * Fills the given buffer with random bytes. This is potentially slow so only + * request the amount of data you need. + */ + void GetRandomBytes([out] str_t buffer, [in] uint32_t num_bytes); +}; diff --git a/browser/extensions/mortar/ppapi/api/dev/ppb_cursor_control_dev.idl b/browser/extensions/mortar/ppapi/api/dev/ppb_cursor_control_dev.idl new file mode 100644 index 000000000000..8f5a107615dc --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/dev/ppb_cursor_control_dev.idl @@ -0,0 +1,65 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_CursorControl_Dev interface + * implemented by the browser for controlling the cursor. + */ + +label Chrome { + M14 = 0.4 +}; + +[macro="PPB_CURSOR_CONTROL_DEV_INTERFACE"] +interface PPB_CursorControl_Dev { + /** + * Set a cursor. If "type" is PP_CURSORTYPE_CUSTOM, then "custom_image" + * must be an ImageData resource containing the cursor and "hot_spot" must + * contain the offset within that image that refers to the cursor's position. + */ + PP_Bool SetCursor([in] PP_Instance instance, + [in] PP_CursorType_Dev type, + [in] PP_Resource custom_image, + [in] PP_Point hot_spot); + + /** + * This method causes the cursor to be moved to the center of the + * instance and be locked, preventing the user from moving it. + * The cursor is implicitly hidden from the user while locked. + * Cursor lock may only be requested in response to a + * PP_InputEvent_MouseDown, and then only if the event was generated via + * user gesture. + * + * While the cursor is locked, any movement of the mouse will + * generate a PP_InputEvent_Type_MouseMove, whose x and y values + * indicate the position the cursor would have been moved to had + * the cursor not been locked, and had the screen been infinite in size. + * + * The browser may revoke cursor lock for reasons including but not + * limited to the user pressing the ESC key, the user activating + * another program via a reserved keystroke (e.g., ALT+TAB), or + * some other system event. + * + * Returns PP_TRUE if the cursor could be locked, PP_FALSE otherwise. + */ + PP_Bool LockCursor([in] PP_Instance instance); + + /** + * Causes the cursor to be unlocked, allowing it to track user + * movement again. + */ + PP_Bool UnlockCursor([in] PP_Instance instance); + + /** + * Returns PP_TRUE if the cursor is locked, PP_FALSE otherwise. + */ + PP_Bool HasCursorLock([in] PP_Instance instance); + + /** + * Returns PP_TRUE if the cursor can be locked, PP_FALSE otherwise. + */ + PP_Bool CanLockCursor([in] PP_Instance instance); +}; + diff --git a/browser/extensions/mortar/ppapi/api/dev/ppb_device_ref_dev.idl b/browser/extensions/mortar/ppapi/api/dev/ppb_device_ref_dev.idl new file mode 100644 index 000000000000..98d127234f4b --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/dev/ppb_device_ref_dev.idl @@ -0,0 +1,76 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_DeviceRef_Dev interface. + */ + +[generate_thunk] + +label Chrome { + M18 = 0.1 +}; + +/** + * Defines the callback type to receive device change notifications for + * PPB_AudioInput_Dev.MonitorDeviceChange() and + * PPB_VideoCapture_Dev.MonitorDeviceChange(). + * + * @param[inout] user_data The opaque pointer that the caller passed into + * MonitorDeviceChange(). + * @param[in] device_count How many devices in the array. + * @param[in] devices An array of PPB_DeviceRef_Dev. Please note + * that the ref count of the elements is not increased on behalf of the plugin. + */ +typedef void PP_MonitorDeviceChangeCallback( + [inout] mem_t user_data, + [in] uint32_t device_count, + [in, size_is(device_count)] PP_Resource[] devices); + +/** + * Device types. + */ +[assert_size(4)] +enum PP_DeviceType_Dev { + PP_DEVICETYPE_DEV_INVALID = 0, + PP_DEVICETYPE_DEV_AUDIOCAPTURE = 1, + PP_DEVICETYPE_DEV_VIDEOCAPTURE = 2 +}; + +interface PPB_DeviceRef_Dev { + /** + * Determines if the provided resource is a device reference. + * + * @param[in] resource A PP_Resource corresponding to a generic + * resource. + * + * @return A PP_Bool that is PP_TRUE if the given + * resource is a device reference, otherwise PP_FALSE. + */ + PP_Bool IsDeviceRef([in] PP_Resource resource); + + /** + * Gets the device type. + * + * @param[in] device_ref A PP_Resource corresponding to a device + * reference. + * + * @return A PP_DeviceType_Dev value. + */ + [on_failure=PP_DEVICETYPE_DEV_INVALID] + PP_DeviceType_Dev GetType([in] PP_Resource device_ref); + + /** + * Gets the device name. + * + * @param[in] device_ref A PP_Resource corresponding to a device + * reference. + * + * @return A PP_Var of type PP_VARTYPE_STRING + * containing the name of the device if successful; a PP_Var of + * type PP_VARTYPE_UNDEFINED if failed. + */ + PP_Var GetName([in] PP_Resource device_ref); +}; diff --git a/browser/extensions/mortar/ppapi/api/dev/ppb_file_chooser_dev.idl b/browser/extensions/mortar/ppapi/api/dev/ppb_file_chooser_dev.idl new file mode 100644 index 000000000000..594ba3e0d7b2 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/dev/ppb_file_chooser_dev.idl @@ -0,0 +1,155 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + + +/** + * This file defines the PPB_FileChooser_Dev interface. + */ + +[generate_thunk] + +label Chrome { + M16 = 0.5, + M19 = 0.6 +}; + +/** + * This enumeration contains constants to control the behavior of the file + * chooser dialog. + */ +[assert_size(4)] +enum PP_FileChooserMode_Dev { + /** + * Mode for choosing a single existing file. + */ + PP_FILECHOOSERMODE_OPEN = 0, + /** + * Mode for choosing multiple existing files. + */ + PP_FILECHOOSERMODE_OPENMULTIPLE = 1 +}; + +interface PPB_FileChooser_Dev { + /** + * This function creates a file chooser dialog resource. The chooser is + * associated with a particular instance, so that it may be positioned on the + * screen relative to the tab containing the instance. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * @param[in] mode A PP_FileChooserMode_Dev value that controls + * the behavior of the file chooser dialog. + * @param[in] accept_types A comma-separated list of MIME types and file + * extensions such as "audio/ *,text/plain,.html" (note there should be no + * space between the '/' and the '*', but one is added to avoid confusing C++ + * comments). The dialog may restrict selectable files to the specified MIME + * types and file extensions. If a string in the comma-separated list begins + * with a period (.) then the string is interpreted as a file extension, + * otherwise it is interpreted as a MIME-type. An empty string or an undefined + * var may be given to indicate that all types should be accepted. + * + * @return A PP_Resource containing the file chooser if + * successful or 0 if it could not be created. + */ + PP_Resource Create( + [in] PP_Instance instance, + [in] PP_FileChooserMode_Dev mode, + [in] PP_Var accept_types); + + /** + * Determines if the provided resource is a file chooser. + * + * @param[in] resource A PP_Resource corresponding to a generic + * resource. + * + * @return A PP_Bool that is PP_TRUE if the given + * resource is a file chooser resource, otherwise PP_FALSE. + */ + PP_Bool IsFileChooser( + [in] PP_Resource resource); + + /** + * This function displays a previously created file chooser resource as a + * dialog box, prompting the user to choose a file or files. This function + * must be called in response to a user gesture, such as a mouse click or + * touch event. The callback is called with PP_OK on successful completion + * with a file (or files) selected, PP_ERROR_USERCANCEL if the user selected + * no file, or another error code from pp_errors.h on failure. + * + * Subtle note: This function will only work when the tab containing + * the plugin is visible. Show will fail if the tab is in the background. + * Since it's not normally possible to get input events while invisible, this + * is not an issue. But there is a race condition because events are + * processed asynchronously that authors should be aware of. If the user + * clicks and switches tabs very quickly, a plugin could believe the tab is + * visible while Chrome believes it is invisible and the Show() call will + * fail. This will not generally cause user confusion since the user will + * have switched tabs and will not want to see a file chooser from a + * different tab. + * + * @param[in] chooser The file chooser resource. + * @param[in] callback A CompletionCallback to be called after + * the user has closed the file chooser dialog. + * + * @return PP_OK_COMPLETIONPENDING if request to show the dialog was + * successful, another error code from pp_errors.h on failure. + */ + [deprecate=0.6] + int32_t Show( + [in] PP_Resource chooser, + [in] PP_CompletionCallback callback); + + /** + * After a successful completion callback call from Show, this method may be + * used to query the chosen files. It should be called in a loop until it + * returns 0. Their file system type will be PP_FileSystemType_External. If + * the user chose no files or canceled the dialog, then this method will + * simply return 0 the first time it is called. + * + * @param[in] chooser The file chooser resource. + * + * @return A PP_Resource containing the next file chosen by the + * user, or 0 if there are no more files. + */ + [deprecate=0.6] + PP_Resource GetNextChosenFile( + [in] PP_Resource chooser); + + /** + * This function displays a previously created file chooser resource as a + * dialog box, prompting the user to choose a file or files. This function + * must be called in response to a user gesture, such as a mouse click or + * touch event. The callback is called with PP_OK on successful completion + * with a file (or files) selected, PP_ERROR_USERCANCEL if the user selected + * no file, or another error code from pp_errors.h on failure. + * + * Subtle note: This function will only work when the tab containing + * the plugin is visible. Show() will fail if the tab is in the background. + * Since it's not normally possible to get input events while invisible, this + * is not normally an issue. But there is a race condition because events are + * processed asynchronously. If the user clicks and switches tabs very + * quickly, a plugin could believe the tab is visible while Chrome believes + * it is invisible and the Show() call will fail. This will not generally + * cause user confusion since the user will have switched tabs and will not + * want to see a file chooser from a different tab. + * + * @param[in] chooser The file chooser resource. + * + * @param[in] output An output array which will receive PP_Resource(s) + * identifying the PPB_FileRef objects that the user selected on + * success. + * + * @param[in] callback A CompletionCallback to be called after + * the user has closed the file chooser dialog. + * + * @return PP_OK_COMPLETIONPENDING if request to show the dialog was + * successful, another error code from pp_errors.h on failure. + */ + [version=0.6] + int32_t Show([in] PP_Resource chooser, + [in] PP_ArrayOutput output, + [in] PP_CompletionCallback callback); +}; + diff --git a/browser/extensions/mortar/ppapi/api/dev/ppb_font_dev.idl b/browser/extensions/mortar/ppapi/api/dev/ppb_font_dev.idl new file mode 100644 index 000000000000..d2051a0be45c --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/dev/ppb_font_dev.idl @@ -0,0 +1,261 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_Font_Dev interface. + */ +label Chrome { + M14 = 0.6 +}; + +[assert_size(4)] +enum PP_FontFamily_Dev { + /** + * Uses the user's default web page font (normally either the default serif + * or sans serif font). + */ + PP_FONTFAMILY_DEFAULT = 0, + + /** + * These families will use the default web page font corresponding to the + * given family. + */ + PP_FONTFAMILY_SERIF = 1, + PP_FONTFAMILY_SANSSERIF = 2, + PP_FONTFAMILY_MONOSPACE = 3 +}; + +/** + * Specifies the font weight. Normally users will only use NORMAL or BOLD. + */ +[assert_size(4)] +enum PP_FontWeight_Dev { + PP_FONTWEIGHT_100 = 0, + PP_FONTWEIGHT_200 = 1, + PP_FONTWEIGHT_300 = 2, + PP_FONTWEIGHT_400 = 3, + PP_FONTWEIGHT_500 = 4, + PP_FONTWEIGHT_600 = 5, + PP_FONTWEIGHT_700 = 6, + PP_FONTWEIGHT_800 = 7, + PP_FONTWEIGHT_900 = 8, + PP_FONTWEIGHT_NORMAL = PP_FONTWEIGHT_400, + PP_FONTWEIGHT_BOLD = PP_FONTWEIGHT_700 +}; + +[assert_size(48)] +struct PP_FontDescription_Dev { + /** + * Font face name as a string. This can also be an undefined var, in which + * case the generic family will be obeyed. If the face is not available on + * the system, the browser will attempt to do font fallback or pick a default + * font. + */ + PP_Var face; + + /** + * When Create()ing a font and the face is an undefined var, the family + * specifies the generic font family type to use. If the face is specified, + * this will be ignored. + * + * When Describe()ing a font, the family will be the value you passed in when + * the font was created. In other words, if you specify a face name, the + * family will not be updated to reflect whether the font name you requested + * is serif or sans serif. + */ + PP_FontFamily_Dev family; + + /** + * Size in pixels. + * + * You can specify 0 to get the default font size. The default font size + * may vary depending on the requested font. The typical example is that + * the user may have a different font size for the default monospace font to + * give it a similar optical size to the proportionally spaced fonts. + */ + uint32_t size; + + /** + * Normally you will use either PP_FONTWEIGHT_NORMAL or PP_FONTWEIGHT_BOLD. + */ + PP_FontWeight_Dev weight; + + PP_Bool italic; + PP_Bool small_caps; + + /** + * Adjustment to apply to letter and word spacing, respectively. Initialize + * to 0 to get normal spacing. Negative values bring letters/words closer + * together, positive values separate them. + */ + int32_t letter_spacing; + int32_t word_spacing; + + /** + * Ensure that this struct is 48-bytes wide by padding the end. In some + * compilers, PP_Var is 8-byte aligned, so those compilers align this struct + * on 8-byte boundaries as well and pad it to 16 bytes even without this + * padding attribute. This padding makes its size consistent across + * compilers. + */ + int32_t padding; +}; + +[assert_size(20)] +struct PP_FontMetrics_Dev { + int32_t height; + int32_t ascent; + int32_t descent; + int32_t line_spacing; + int32_t x_height; +}; + +[assert_size(24)] +struct PP_TextRun_Dev { + /** + * This var must either be a string or a null/undefined var (which will be + * treated as a 0-length string). + */ + PP_Var text; + + /** + * Set to PP_TRUE if the text is right-to-left. + * + * When override_direction is false, the browser will perform + * the Unicode Bidirectional Algorithm (http://unicode.org/reports/tr9/) on + * the text. The value of the rtl flag specifies the + * directionality of the surrounding environment. This means that Hebrew + * word will always display right to left, even if rtl is false. + * + * When override_direction is true, no autodetection will be done + * and rtl specifies the direction of the text. + * + * TODO(brettw) note that autodetection with rtl = true is currently + * unimplemented. + */ + PP_Bool rtl; + + /** + * Set to PP_TRUE to force the directionality of the text regardless of + * content. + * + * If this flag is set, the browser will skip autodetection of the content + * and will display all text in the direction specified by the + * rtl flag. + */ + PP_Bool override_direction; +}; + +interface PPB_Font_Dev { + /** + * Returns a list of all available font families on the system. You can use + * this list to decide whether to Create() a font. + * + * The return value will be a single string with null characters delimiting + * the end of each font name. For example: "Arial\0Courier\0Times\0". + * + * Returns an undefined var on failure (this typically means you passed an + * invalid instance). + */ + PP_Var GetFontFamilies( + [in] PP_Instance instance); + + /** + * Returns a font which best matches the given description. The return value + * will have a non-zero ID on success, or zero on failure. + */ + PP_Resource Create( + [in] PP_Instance instance, + [in] PP_FontDescription_Dev description); + + /** + * Returns PP_TRUE if the given resource is a Font. Returns PP_FALSE if the + * resource is invalid or some type other than a Font. + */ + PP_Bool IsFont( + [in] PP_Resource resource); + + /** + * Loads the description and metrics of the font into the given structures. + * The description will be different than the description the font was + * created with since it will be filled with the real values from the font + * that was actually selected. + * + * The PP_Var in the description should be of type Void on input. On output, + * this will contain the string and will have a reference count of 1. The + * plugin is responsible for calling Release on this var. + * + * Returns PP_TRUE on success, PP_FALSE if the font is invalid or if the Var + * in the description isn't Null (to prevent leaks). + */ + PP_Bool Describe( + [in] PP_Resource font, + [out] PP_FontDescription_Dev description, + [out] PP_FontMetrics_Dev metrics); + + /** + * Draws the text to the image buffer. + * + * The given point represents the baseline of the left edge of the font, + * regardless of whether it is left-to-right or right-to-left (in the case of + * RTL text, this will actually represent the logical end of the text). + * + * The clip is optional and may be NULL. In this case, the text will be + * clipped to the image. + * + * The image_data_is_opaque flag indicates whether subpixel antialiasing can + * be performed, if it is supported. When the image below the text is + * opaque, subpixel antialiasing is supported and you should set this to + * PP_TRUE to pick up the user's default preferences. If your plugin is + * partially transparent, then subpixel antialiasing is not possible and + * grayscale antialiasing will be used instead (assuming the user has + * antialiasing enabled at all). + */ + PP_Bool DrawTextAt( + [in] PP_Resource font, + [in] PP_Resource image_data, + [in] PP_TextRun_Dev text, + [in] PP_Point position, + [in] uint32_t color, + [in] PP_Rect clip, + [in] PP_Bool image_data_is_opaque); + + /** + * Returns the width of the given string. If the font is invalid or the var + * isn't a valid string, this will return -1. + * + * Note that this function handles complex scripts such as Arabic, combining + * accents, etc. so that adding the width of substrings won't necessarily + * produce the correct width of the entire string. + * + * Returns -1 on failure. + */ + int32_t MeasureText( + [in] PP_Resource font, + [in] PP_TextRun_Dev text); + + /** + * Returns the character at the given pixel X position from the beginning of + * the string. This handles complex scripts such as Arabic, where characters + * may be combined or replaced depending on the context. Returns (uint32)-1 + * on failure. + */ + uint32_t CharacterOffsetForPixel( + [in] PP_Resource font, + [in] PP_TextRun_Dev text, + [in] int32_t pixel_position); + + /** + * Returns the horizontal advance to the given character if the string was + * placed at the given position. This handles complex scripts such as Arabic, + * where characters may be combined or replaced depending on context. Returns + * -1 on error. + */ + int32_t PixelOffsetForCharacter( + [in] PP_Resource font, + [in] PP_TextRun_Dev text, + [in] uint32_t char_offset); +}; + diff --git a/browser/extensions/mortar/ppapi/api/dev/ppb_ime_input_event_dev.idl b/browser/extensions/mortar/ppapi/api/dev/ppb_ime_input_event_dev.idl new file mode 100644 index 000000000000..9e728d6ed049 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/dev/ppb_ime_input_event_dev.idl @@ -0,0 +1,143 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_IMEInputEvent_Dev interface. + */ + +label Chrome { + M16 = 0.1, + M21 = 0.2 +}; + +[macro="PPB_IME_INPUT_EVENT_DEV_INTERFACE"] +interface PPB_IMEInputEvent_Dev { + /** + * Create() creates an IME input event with the given parameters. Normally + * you will get an IME event passed through the HandleInputEvent + * and will not need to create them, but some applications may want to create + * their own for internal use. + * + * @param[in] instance The instance for which this event occurred. + * + * @param[in] type A PP_InputEvent_Type identifying the type of + * input event. The type must be one of the IME event types. + * + * @param[in] time_stamp A PP_TimeTicks indicating the time + * when the event occurred. + * + * @param[in] text The string returned by GetText. + * + * @param[in] segment_number The number returned by + * GetSegmentNumber. + * + * @param[in] segment_offsets The array of numbers returned by + * GetSegmentOffset. If segment_number is zero, + * the number of elements of the array should be zero. If + * segment_number is non-zero, the length of the array must be + * segment_number + 1. + * + * @param[in] target_segment The number returned by + * GetTargetSegment. + * + * @param[in] selection_start The start index returned by + * GetSelection. + * + * @param[in] selection_end The end index returned by + * GetSelection. + * + * @return A PP_Resource containing the new IME input event. + */ + [version=0.2] + PP_Resource Create([in] PP_Instance instance, + [in] PP_InputEvent_Type type, + [in] PP_TimeTicks time_stamp, + [in] PP_Var text, + [in] uint32_t segment_number, + [in] uint32_t[] segment_offsets, + [in] int32_t target_segment, + [in] uint32_t selection_start, + [in] uint32_t selection_end); + + /** + * IsIMEInputEvent() determines if a resource is an IME event. + * + * @param[in] resource A PP_Resource corresponding to an event. + * + * @return PP_TRUE if the given resource is a valid input event. + */ + PP_Bool IsIMEInputEvent([in] PP_Resource resource); + + /** + * GetText() returns the composition text as a UTF-8 string for the given IME + * event. + * + * @param[in] ime_event A PP_Resource corresponding to an IME + * event. + * + * @return A string var representing the composition text. For non-IME input + * events the return value will be an undefined var. + */ + PP_Var GetText([in] PP_Resource ime_event); + + /** + * GetSegmentNumber() returns the number of segments in the composition text. + * + * @param[in] ime_event A PP_Resource corresponding to an IME + * event. + * + * @return The number of segments. For events other than COMPOSITION_UPDATE, + * returns 0. + */ + uint32_t GetSegmentNumber([in] PP_Resource ime_event); + + /** + * GetSegmentOffset() returns the position of the index-th segmentation point + * in the composition text. The position is given by a byte-offset (not a + * character-offset) of the string returned by GetText(). It always satisfies + * 0=GetSegmentOffset(0) < ... < GetSegmentOffset(i) < GetSegmentOffset(i+1) + * < ... < GetSegmentOffset(GetSegmentNumber())=(byte-length of GetText()). + * Note that [GetSegmentOffset(i), GetSegmentOffset(i+1)) represents the range + * of the i-th segment, and hence GetSegmentNumber() can be a valid argument + * to this function instead of an off-by-1 error. + * + * @param[in] ime_event A PP_Resource corresponding to an IME + * event. + * + * @param[in] index An integer indicating a segment. + * + * @return The byte-offset of the segmentation point. If the event is not + * COMPOSITION_UPDATE or index is out of range, returns 0. + */ + uint32_t GetSegmentOffset([in] PP_Resource ime_event, + [in] uint32_t index); + + /** + * GetTargetSegment() returns the index of the current target segment of + * composition. + * + * @param[in] ime_event A PP_Resource corresponding to an IME + * event. + * + * @return An integer indicating the index of the target segment. When there + * is no active target segment, or the event is not COMPOSITION_UPDATE, + * returns -1. + */ + int32_t GetTargetSegment([in] PP_Resource ime_event); + + /** + * GetSelection() returns the range selected by caret in the composition text. + * + * @param[in] ime_event A PP_Resource corresponding to an IME + * event. + * + * @param[out] start The start position of the current selection. + * + * @param[out] end The end position of the current selection. + */ + void GetSelection([in] PP_Resource ime_event, + [out] uint32_t start, + [out] uint32_t end); +}; diff --git a/browser/extensions/mortar/ppapi/api/dev/ppb_memory_dev.idl b/browser/extensions/mortar/ppapi/api/dev/ppb_memory_dev.idl new file mode 100644 index 000000000000..e77c1d2891d6 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/dev/ppb_memory_dev.idl @@ -0,0 +1,37 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_Memory interface for functions + * related to memory management. + */ + +label Chrome { + M14 = 0.1 +}; + +/** + * The PPB_Memory_Dev interface contains pointers to functions related to memory + * management. + * + */ +interface PPB_Memory_Dev { + /** + * MemAlloc is a pointer to a function that allocate memory. + * + * @param[in] num_bytes A number of bytes to allocate. + * @return A pointer to the memory if successful, NULL If the + * allocation fails. + */ + mem_t MemAlloc([in] uint32_t num_bytes); + + /** + * MemFree is a pointer to a function that deallocates memory. + * + * @param[in] ptr A pointer to the memory to deallocate. It is safe to + * pass NULL to this function. + */ + void MemFree([inout] mem_t ptr); +}; diff --git a/browser/extensions/mortar/ppapi/api/dev/ppb_opengles2ext_dev.idl b/browser/extensions/mortar/ppapi/api/dev/ppb_opengles2ext_dev.idl new file mode 100644 index 000000000000..7d1b5d1ab6a7 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/dev/ppb_opengles2ext_dev.idl @@ -0,0 +1,27 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// This file is auto-generated from +// gpu/command_buffer/build_gles2_cmd_buffer.py +// It's formatted by clang-format using chromium coding style: +// clang-format -i -style=chromium filename +// DO NOT EDIT! + +label Chrome { + M39 = 1.0 +}; + +#inline c +#include "ppapi/c/pp_resource.h" +#include "ppapi/c/ppb_opengles2.h" + +#endinl + +[macro="PPB_OPENGLES2_DRAWBUFFERS_DEV_INTERFACE", force_struct_namespace] +interface PPB_OpenGLES2DrawBuffers_Dev { + void DrawBuffersEXT([in] PP_Resource context, + [in] GLsizei count, + [in] GLenum_ptr_t bufs); +}; + diff --git a/browser/extensions/mortar/ppapi/api/dev/ppb_printing_dev.idl b/browser/extensions/mortar/ppapi/api/dev/ppb_printing_dev.idl new file mode 100644 index 000000000000..60239d2f7d88 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/dev/ppb_printing_dev.idl @@ -0,0 +1,44 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * Definition of the PPB_Printing interface. + */ + +[generate_thunk] + +// Note: This version should always match the PPP_Printing_Dev interface. +label Chrome { + M23 = 0.7 +}; + +interface PPB_Printing_Dev { + /** Create a resource for accessing printing functionality. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * + * @return A PP_Resource containing the printing resource if + * successful or 0 if it could not be created. + */ + PP_Resource Create([in] PP_Instance instance); + + /** + * Outputs the default print settings for the default printer into + * print_settings. The callback is called with + * PP_OK when the settings have been retrieved successfully. + * + * @param[in] resource The printing resource. + * + * @param[in] callback A CompletionCallback to be called when + * print_settings have been retrieved. + * + * @return PP_OK_COMPLETIONPENDING if request for the default print settings + * was successful, another error code from pp_errors.h on failure. + */ + int32_t GetDefaultPrintSettings([in] PP_Resource resource, + [out] PP_PrintSettings_Dev print_settings, + [in] PP_CompletionCallback callback); +}; diff --git a/browser/extensions/mortar/ppapi/api/dev/ppb_text_input_dev.idl b/browser/extensions/mortar/ppapi/api/dev/ppb_text_input_dev.idl new file mode 100644 index 000000000000..7ea49013356d --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/dev/ppb_text_input_dev.idl @@ -0,0 +1,109 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_TextInput_Dev interface. + */ + +label Chrome { + M16 = 0.1, + M19 = 0.2 +}; + +/** + * PP_TextInput_Type is used to indicate the status of a plugin in regard to + * text input. + */ +[assert_size(4)] +enum PP_TextInput_Type_Dev { + /** + * Input caret is not in an editable mode, no input method shall be used. + */ + PP_TEXTINPUT_TYPE_DEV_NONE = 0, + /** + * Input caret is in a normal editable mode, any input method can be used. + */ + PP_TEXTINPUT_TYPE_DEV_TEXT = 1, + /** + * Input caret is in a password box, an input method may be used only if + * it's suitable for password input. + */ + PP_TEXTINPUT_TYPE_DEV_PASSWORD = 2, + PP_TEXTINPUT_TYPE_DEV_SEARCH = 3, + PP_TEXTINPUT_TYPE_DEV_EMAIL = 4, + PP_TEXTINPUT_TYPE_DEV_NUMBER = 5, + PP_TEXTINPUT_TYPE_DEV_TELEPHONE = 6, + PP_TEXTINPUT_TYPE_DEV_URL = 7 +}; + +/** + * PPB_TextInput_Dev provides a set of functions for giving hints + * to the browser about the text input status of plugins, and functions for + * controlling input method editors (IMEs). + */ +interface PPB_TextInput_Dev { + /** + * Informs the browser about the current text input mode of the plugin. + * Typical use of this information in the browser is to properly + * display/suppress tools for supporting text inputs (such as virtual + * keyboards in touch screen based devices, or input method editors often + * used for composing East Asian characters). + */ + void SetTextInputType([in] PP_Instance instance, + [in] PP_TextInput_Type_Dev type); + + /** + * Informs the browser about the coordinates of the text input caret and the + * bounding box of the text input area. Typical use of this information in + * the browser is to layout IME windows etc. + */ + void UpdateCaretPosition([in] PP_Instance instance, + [in] PP_Rect caret, + [in] PP_Rect bounding_box); + + /** + * Cancels the current composition in IME. + */ + void CancelCompositionText([in] PP_Instance instance); + + /** + * In response to the PPP_TextInput_Dev::RequestSurroundingText + * call, informs the browser about the current text selection and surrounding + * text. text is a UTF-8 string that contains the current range + * of text selection in the plugin. caret is the byte-index of + * the caret position within text. anchor is the + * byte-index of the anchor position (i.e., if a range of text is selected, + * it is the other edge of selection different from caret. If + * there are no selection, anchor is equal to caret. + * + * Typical use of this information in the browser is to enable "reconversion" + * features of IME that puts back the already committed text into the + * pre-commit composition state. Another use is to improve the precision + * of suggestion of IME by taking the context into account (e.g., if the caret + * looks to be on the beginning of a sentence, suggest capital letters in a + * virtual keyboard). + * + * When the focus is not on text, call this function setting text + * to an empty string and caret and anchor to zero. + * Also, the plugin should send the empty text when it does not want to reveal + * the selection to IME (e.g., when the surrounding text is containing + * password text). + */ + [version=0.2] + void UpdateSurroundingText([in] PP_Instance instance, + [in] str_t text, + [in] uint32_t caret, + [in] uint32_t anchor); + + /** + * Informs the browser when a range of text selection is changed in a plugin. + * When the browser needs to know the content of the updated selection, it + * pings back by PPP_TextInput_Dev::RequestSurroundingText. The + * plugin then should send the information with + * UpdateSurroundingText. + */ + [version=0.2] + void SelectionChanged([in] PP_Instance instance); +}; diff --git a/browser/extensions/mortar/ppapi/api/dev/ppb_trace_event_dev.idl b/browser/extensions/mortar/ppapi/api/dev/ppb_trace_event_dev.idl new file mode 100644 index 000000000000..8e483cd6e824 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/dev/ppb_trace_event_dev.idl @@ -0,0 +1,84 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_Trace_Event interface. It is meant + * to be used in plugins as the API that trace macros from trace_event.h use. + */ + +label Chrome { + M25 = 0.1, + M29 = 0.2 +}; + +/** + * A trace event timestamp. + */ +typedef int64_t PP_TraceEventTime; + +interface PPB_Trace_Event_Dev { + /** + * Gets a pointer to a character for identifying a category name in the + * tracing system as well as for being able to early exit in client-side + * tracing code. + * + * NB: This mem_t return value should technically be const, but return values + * for Pepper IDL of mem_t type are not const. The same is true for the arg + * |category_enabled| for AddTraceEvent. + */ + mem_t GetCategoryEnabled([in] cstr_t category_name); + + /** + * Adds a trace event to the platform tracing system. This function call is + * usually the result of a TRACE_* macro from trace_event.h when tracing and + * the category of the particular trace are enabled. It is not advisable to + * call this function on its own; it is really only meant to be used by the + * trace macros. + */ + void AddTraceEvent( + [in] int8_t phase, + [in] mem_t category_enabled, + [in] cstr_t name, + [in] uint64_t id, + [in] uint32_t num_args, + [in, size_as=num_args] str_t[] arg_names, + [in, size_as=num_args] uint8_t[] arg_types, + [in, size_as=num_args] uint64_t[] arg_values, + [in] uint8_t flags); + + /** + * Version of the above interface that allows specifying a custom thread id + * and timestamp. This is useful for when tracing data cannot be registered + * in real time. For example, this could be used by storing timestamps + * internally and then registering the events retroactively. + */ + [version=0.2] + void AddTraceEventWithThreadIdAndTimestamp( + [in] int8_t phase, + [in] mem_t category_enabled, + [in] cstr_t name, + [in] uint64_t id, + [in] int32_t thread_id, + [in] PP_TraceEventTime timestamp, + [in] uint32_t num_args, + [in, size_as=num_args] str_t[] arg_names, + [in, size_as=num_args] uint8_t[] arg_types, + [in, size_as=num_args] uint64_t[] arg_values, + [in] uint8_t flags); + + /** + * Get the current clock value. Since this uses the same function as the trace + * events use internally, it can be used to create events with explicit time + * stamps. + */ + [version=0.2] + PP_TraceEventTime Now(); + + /** + * Sets the thread name of the calling thread in the tracing system so it will + * show up properly in chrome://tracing. + */ + void SetThreadName([in] cstr_t thread_name); +}; diff --git a/browser/extensions/mortar/ppapi/api/dev/ppb_truetype_font_dev.idl b/browser/extensions/mortar/ppapi/api/dev/ppb_truetype_font_dev.idl new file mode 100644 index 000000000000..8a3ff2b0f0ac --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/dev/ppb_truetype_font_dev.idl @@ -0,0 +1,270 @@ +/* Copyright (c) 2013 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_TrueTypeFont_Dev interface. This + * interface exposes font table data for 'sfnt' fonts on the host system. These + * include TrueType and OpenType fonts. + */ + +[generate_thunk,thunk_include="ppapi/thunk/ppb_truetype_font_singleton_api.h"] + +label Chrome { + M26 = 0.1 +}; + +/** + * The PP_TrueTypeFontFamily_Dev defines generic font families. These can be + * used to create generic fonts consistent with the user's browser settings. + */ +[assert_size(4)] +enum PP_TrueTypeFontFamily_Dev { + /** + * For a description of these default families, see the + * + * 3.1.1 Generic font families documentation. + */ + PP_TRUETYPEFONTFAMILY_SERIF = 0, + PP_TRUETYPEFONTFAMILY_SANSSERIF = 1, + PP_TRUETYPEFONTFAMILY_CURSIVE = 2, + PP_TRUETYPEFONTFAMILY_FANTASY = 3, + PP_TRUETYPEFONTFAMILY_MONOSPACE = 4 +}; + +/** + * The PP_TrueTypeFontStyle_Dev enum defines font styles. + */ +[assert_size(4)] +enum PP_TrueTypeFontStyle_Dev { + PP_TRUETYPEFONTSTYLE_NORMAL = 0, + PP_TRUETYPEFONTSTYLE_ITALIC = 1 +}; + +/** + * The PP_TrueTypeFontWeight_Dev enum defines font weights. + */ +[assert_size(4)] +enum PP_TrueTypeFontWeight_Dev { + PP_TRUETYPEFONTWEIGHT_THIN = 100, + PP_TRUETYPEFONTWEIGHT_ULTRALIGHT = 200, + PP_TRUETYPEFONTWEIGHT_LIGHT = 300, + PP_TRUETYPEFONTWEIGHT_NORMAL = 400, + PP_TRUETYPEFONTWEIGHT_MEDIUM = 500, + PP_TRUETYPEFONTWEIGHT_SEMIBOLD = 600, + PP_TRUETYPEFONTWEIGHT_BOLD = 700, + PP_TRUETYPEFONTWEIGHT_ULTRABOLD = 800, + PP_TRUETYPEFONTWEIGHT_HEAVY = 900 +}; + +/** + * The PP_TrueTypeFontWidth_Dev enum defines font widths. + */ +[assert_size(4)] +enum PP_TrueTypeFontWidth_Dev { + PP_TRUETYPEFONTWIDTH_ULTRACONDENSED = 0, + PP_TRUETYPEFONTWIDTH_EXTRACONDENSED = 1, + PP_TRUETYPEFONTWIDTH_CONDENSED = 2, + PP_TRUETYPEFONTWIDTH_SEMICONDENSED = 3, + PP_TRUETYPEFONTWIDTH_NORMAL = 4, + PP_TRUETYPEFONTWIDTH_SEMIEXPANDED = 5, + PP_TRUETYPEFONTWIDTH_EXPANDED = 6, + PP_TRUETYPEFONTWIDTH_EXTRAEXPANDED = 7, + PP_TRUETYPEFONTWIDTH_ULTRAEXPANDED = 8 +}; + +/** + * The PP_TrueTypeFontCharset enum defines font character sets. + */ +[assert_size(4)] +enum PP_TrueTypeFontCharset_Dev { + PP_TRUETYPEFONTCHARSET_ANSI = 0, + PP_TRUETYPEFONTCHARSET_DEFAULT = 1, + PP_TRUETYPEFONTCHARSET_SYMBOL = 2, + PP_TRUETYPEFONTCHARSET_MAC = 77, + PP_TRUETYPEFONTCHARSET_SHIFTJIS = 128, + PP_TRUETYPEFONTCHARSET_HANGUL = 129, + PP_TRUETYPEFONTCHARSET_JOHAB = 130, + PP_TRUETYPEFONTCHARSET_GB2312 =134, + PP_TRUETYPEFONTCHARSET_CHINESEBIG5 = 136, + PP_TRUETYPEFONTCHARSET_GREEK = 161, + PP_TRUETYPEFONTCHARSET_TURKISH = 162, + PP_TRUETYPEFONTCHARSET_VIETNAMESE = 163, + PP_TRUETYPEFONTCHARSET_HEBREW = 177, + PP_TRUETYPEFONTCHARSET_ARABIC = 178, + PP_TRUETYPEFONTCHARSET_BALTIC = 186, + PP_TRUETYPEFONTCHARSET_RUSSIAN = 204, + PP_TRUETYPEFONTCHARSET_THAI = 222, + PP_TRUETYPEFONTCHARSET_EASTEUROPE = 238, + PP_TRUETYPEFONTCHARSET_OEM = 255 +}; + +/** + * The PP_TrueTypeFontDesc struct describes a TrueType font. It is + * passed to Create(), and returned by Describe(). + */ +[assert_size(40)] +struct PP_TrueTypeFontDesc_Dev { + /** + * Font family name as a string. This can also be an undefined var, in which + * case the generic family will be obeyed. If the face is not available on + * the system, the browser will attempt to do font fallback or pick a default + * font. + */ + PP_Var family; + + /** This value specifies a generic font family. If a family name string is + * provided when creating a font, this is ignored. */ + PP_TrueTypeFontFamily_Dev generic_family; + + /** This value specifies the font style. */ + PP_TrueTypeFontStyle_Dev style; + + /** This value specifies the font weight. */ + PP_TrueTypeFontWeight_Dev weight; + + /** This value specifies the font width, for condensed or expanded fonts */ + PP_TrueTypeFontWidth_Dev width; + + /** This value specifies a character set. */ + PP_TrueTypeFontCharset_Dev charset; + + /** + * Ensure that this struct is 40-bytes wide by padding the end. In some + * compilers, PP_Var is 8-byte aligned, so those compilers align this struct + * on 8-byte boundaries as well and pad it to 16 bytes even without this + * padding attribute. This padding makes its size consistent across + * compilers. + */ + int32_t padding; +}; + +interface PPB_TrueTypeFont_Dev { + /** + * Gets an array of TrueType font family names available on the host. + * These names can be used to create a font from a specific family. + * + * @param[in] instance A PP_Instance requesting the family names. + * @param[in] output A PP_ArrayOutput to hold the names. + * The output is an array of PP_Vars, each holding a family name. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of GetFontFamilies. + * + * @return If >= 0, the number of family names returned, otherwise an error + * code from pp_errors.h. + */ + [singleton,api=PPB_TrueTypeFont_Singleton_API] + int32_t GetFontFamilies([in] PP_Instance instance, + [in] PP_ArrayOutput output, + [in] PP_CompletionCallback callback); + + /** + * Gets an array of TrueType font descriptors for a given font family. These + * descriptors can be used to create a font in that family and matching the + * descriptor attributes. + * + * @param[in] instance A PP_Instance requesting the font + * descriptors. + * @param[in] family A PP_Var holding a string specifying the + * font family. + * @param[in] output A PP_ArrayOutput to hold the descriptors. + * The output is an array of PP_TrueTypeFontDesc structs. Each + * desc contains a PP_Var for the family name which must be released. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of GetFontsInFamily. + * + * @return If >= 0, the number of font descriptors returned, otherwise an + * error code from pp_errors.h. + */ + [singleton,api=PPB_TrueTypeFont_Singleton_API] + int32_t GetFontsInFamily([in] PP_Instance instance, + [in] PP_Var family, + [in] PP_ArrayOutput output, + [in] PP_CompletionCallback callback); + + /** + * Creates a font resource matching the given font characteristics. The + * resource id will be non-zero on success, or zero on failure. + * + * @param[in] instance A PP_Instance to own the font. + * @param[in] desc A pointer to a PP_TrueTypeFontDesc describing + * the font. + */ + PP_Resource Create([in] PP_Instance instance, + [in] PP_TrueTypeFontDesc_Dev desc); + + /** + * Determines if the given resource is a TrueType font. + * + * @param[in] resource A PP_Resource corresponding to a resource. + * + * @return PP_TRUE if the resource is a + * PPB_TrueTypeFont_Dev, PP_FALSE otherwise. + */ + PP_Bool IsTrueTypeFont([in] PP_Resource resource); + + /** + * Returns a description of the given font resource. This description may + * differ from the description passed to Create, reflecting the host's font + * matching and fallback algorithm. + * + * @param[in] font A PP_Resource corresponding to a font. + * @param[out] desc A pointer to a PP_TrueTypeFontDesc to hold + * the description. The internal 'family' PP_Var should be set to undefined, + * since this function overwrites the PP_TrueTypeFontDesc. After + * successful completion, the family will be set to a PP_Var with a single + * reference, which the caller must release after use. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Describe. + * + * @return A return code from pp_errors.h. If an error code is + * returned, the PP_TrueTypeFontDesc will be unchanged. + */ + int32_t Describe([in] PP_Resource font, + [out] PP_TrueTypeFontDesc_Dev desc, + [in] PP_CompletionCallback callback); + + /** + * Gets an array of identifying tags for each table in the font. These tags + * can be used to request specific tables using GetTable. + * + * @param[in] font A PP_Resource corresponding to a font. + * @param[in] output A PP_ArrayOutput to hold the tags. + * The output is an array of 4 byte integers, each representing a table tag. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of GetTableTags. + * + * @return If >= 0, the number of table tags returned, otherwise an error + * code from pp_errors.h. + */ + int32_t GetTableTags([in] PP_Resource font, + [in] PP_ArrayOutput output, + [in] PP_CompletionCallback callback); + + /** + * Copies the given font table into client memory. + * + * @param[in] font A PP_Resource corresponding to a font. + * @param[in] table A 4 byte value indicating which table to copy. + * For example, 'glyf' will cause the outline table to be copied into the + * output array. A zero tag value will cause the entire font to be copied. + * @param[in] offset The offset into the font table. Passing an offset + * greater than or equal to the table size will succeed with 0 bytes copied. + * @param[in] max_data_length The maximum number of bytes to transfer from + * offset. + * @param[in] output A PP_ArrayOutput to hold the font data. + * The output is an array of bytes. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of GetTable. + * + * @return If >= 0, the table size in bytes, otherwise an error code from + * pp_errors.h. + */ + int32_t GetTable([in] PP_Resource font, + [in] uint32_t table, + [in] int32_t offset, + [in] int32_t max_data_length, + [in] PP_ArrayOutput output, + [in] PP_CompletionCallback callback); +}; diff --git a/browser/extensions/mortar/ppapi/api/dev/ppb_url_util_dev.idl b/browser/extensions/mortar/ppapi/api/dev/ppb_url_util_dev.idl new file mode 100644 index 000000000000..f3eb66f90f15 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/dev/ppb_url_util_dev.idl @@ -0,0 +1,162 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_URLUtil_Dev interface. + */ + +label Chrome { + M17 = 0.6, + M31 = 0.7 +}; + +/* + * A component specifies the range of the part of the URL. The begin specifies + * the index into the string of the first character of that component. The len + * specifies the length of that component. + * + * This range does not include any special delimiter for that component, so + * the scheme doesn't include the trailing colon, the username and password + * don't include the @ and :, the port doesn't include the colon, the query + * doesn't include the ?, and the ref doesn't include the #. + * + * The exception is that the path *does* include the first /, since that's an + * integral part of the path. + * + * If the component is not present at all, begin will be 0 and len will be -1. + * If the component is present but empty, the length will be 0 instead. Example: + * http://foo/search -> query = (0, -1) + * http://foo/search? -> query = (18, 0) + */ +[assert_size(8)] +struct PP_URLComponent_Dev { + int32_t begin; + int32_t len; +}; + +[assert_size(64)] +struct PP_URLComponents_Dev { + PP_URLComponent_Dev scheme; + PP_URLComponent_Dev username; + PP_URLComponent_Dev password; + PP_URLComponent_Dev host; + PP_URLComponent_Dev port; + PP_URLComponent_Dev path; + PP_URLComponent_Dev query; + PP_URLComponent_Dev ref; +}; + +/* + * URL encoding: URLs are supplied to this interface as NULL-terminated 8-bit + * strings. You can pass non-ASCII characters which will be interpreted as + * UTF-8. Canonicalized URL strings returned by these functions will be ASCII + * except for the reference fragment (stuff after the '#') which will be + * encoded as UTF-8. + */ +interface PPB_URLUtil_Dev { + /* + * Canonicalizes the given URL string according to the rules of the host + * browser. If the URL is invalid or the var is not a string, this will + * return a Null var and the components structure will be unchanged. + * + * The components pointer, if non-NULL and the canonicalized URL is valid, + * will identify the components of the resulting URL. Components may be NULL + * to specify that no component information is necessary. + */ + PP_Var Canonicalize([in] PP_Var url, [out] PP_URLComponents_Dev components); + + /* + * Resolves the given URL relative to the given base URL. The resulting URL + * is returned as a string. If the resolution is invalid or either of the + * inputs are not strings, a Null var will be returned. The resulting URL + * will also be canonicalized according to the rules of the browser. + * + * Note that the "relative" URL may in fact be absolute, in which case it + * will be returned. This function is identical to resolving the full URL + * for an on a web page. Attempting to resolve a relative URL + * on a base URL that doesn't support this (e.g. "data") will fail and will + * return a Null var, unless the relative URL is itself absolute. + * + * The components pointer, if non-NULL and the canonicalized URL is valid, + * will identify the components of the resulting URL. Components may be NULL + * to specify that no component information is necessary. + */ + PP_Var ResolveRelativeToURL( + [in] PP_Var base_url, + [in] PP_Var relative_string, + [out] PP_URLComponents_Dev components); + + /* + * Identical to ResolveRelativeToURL except that the base URL is the base + * URL of the document containing the given plugin instance. + * + * Danger: This will be identical to resolving a relative URL on the page, + * and might be overridden by the page to something different than its actual + * URL via the tag. Therefore, resolving a relative URL of "" won't + * necessarily give you the URL of the page! + */ + PP_Var ResolveRelativeToDocument( + [in] PP_Instance instance, + [in] PP_Var relative_string, + [out] PP_URLComponents_Dev components); + + /* + * Checks whether the given two URLs are in the same security origin. Returns + * FALSE if either of the URLs are invalid. + */ + PP_Bool IsSameSecurityOrigin([in] PP_Var url_a, [in] PP_Var url_b); + + /* + * Checks whether the document hosting the given plugin instance can access + * the given URL according to the same origin policy of the browser. Returns + * PP_FALSE if the instance or the URL is invalid. + */ + PP_Bool DocumentCanRequest([in] PP_Instance instance, [in] PP_Var url); + + /* + * Checks whether the document containing the |active| plugin instance can + * access the document containing the |target| plugin instance according to + * the security policy of the browser. This includes the same origin policy + * and any cross-origin capabilities enabled by the document. If either of + * the plugin instances are invalid, returns PP_FALSE. + */ + PP_Bool DocumentCanAccessDocument([in] PP_Instance active, + [in] PP_Instance target); + + /* + * Returns the URL for the document. This is a safe way to retrieve + * window.location.href. + * The components pointer, if non-NULL and the canonicalized URL is valid, + * will identify the components of the resulting URL. Components may be NULL + * to specify that no component information is necessary. + */ + PP_Var GetDocumentURL([in] PP_Instance instance, + [out] PP_URLComponents_Dev components); + + /* + * Returns the Source URL for the plugin. This returns the URL that would be + * streamed to the plugin if it were a NPAPI plugin. This is usually the src + * attribute on the element, but the rules are obscure and different + * based on whether the plugin is loaded from an element or an + * element. + * The components pointer, if non-NULL and the canonicalized URL is valid, + * will identify the components of the resulting URL. Components may be NULL + * to specify that no component information is necessary. + */ + PP_Var GetPluginInstanceURL([in] PP_Instance instance, + [out] PP_URLComponents_Dev components); + + /* + * Returns the Referrer URL of the HTTP request that loaded the plugin. This + * is the value of the 'Referer' header of the request. An undefined value + * means the 'Referer' header was absent. + * The components pointer, if non-NULL and the canonicalized URL is valid, + * will identify the components of the resulting URL. Components may be NULL + * to specify that no component information is necessary. + */ + [version=0.7] + PP_Var GetPluginReferrerURL([in] PP_Instance instance, + [out] PP_URLComponents_Dev components); +}; diff --git a/browser/extensions/mortar/ppapi/api/dev/ppb_var_deprecated.idl b/browser/extensions/mortar/ppapi/api/dev/ppb_var_deprecated.idl new file mode 100644 index 000000000000..25fee857770a --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/dev/ppb_var_deprecated.idl @@ -0,0 +1,234 @@ +/* Copyright (c) 2010 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * Defines the PPB_Var_Deprecated struct. + * See http://code.google.com/p/ppapi/wiki/InterfacingWithJavaScript + * for general information on using this interface. + * {PENDING: Should the generated doc really be pointing to methods?} + */ + +label Chrome { + M39 = 0.3 +}; + +[iname="PPB_Var(Deprecated)"] +interface PPB_Var_Deprecated { + /** + * Adds a reference to the given var. If this is not a refcounted object, + * this function will do nothing so you can always call it no matter what the + * type. + */ + void AddRef([in] PP_Var var); + + /** + * Removes a reference to given var, deleting it if the internal refcount + * becomes 0. If the given var is not a refcounted object, this function will + * do nothing so you can always call it no matter what the type. + */ + void Release([in] PP_Var var); + + /** + * Creates a string var from a string. The string must be encoded in valid + * UTF-8 and is NOT NULL-terminated, the length must be specified in |len|. + * It is an error if the string is not valid UTF-8. + * + * If the length is 0, the |data| pointer will not be dereferenced and may + * be NULL. Note, however, that if you do this, the "NULL-ness" will not be + * preserved, as VarToUtf8 will never return NULL on success, even for empty + * strings. + * + * The resulting object will be a refcounted string object. It will be + * AddRef()ed for the caller. When the caller is done with it, it should be + * Release()d. + * + * On error (basically out of memory to allocate the string, or input that + * is not valid UTF-8), this function will return a Null var. + */ + PP_Var VarFromUtf8([in] PP_Module module, [in] str_t data, [in] uint32_t len); + + /** + * Converts a string-type var to a char* encoded in UTF-8. This string is NOT + * NULL-terminated. The length will be placed in |*len|. If the string is + * valid but empty the return value will be non-NULL, but |*len| will still + * be 0. + * + * If the var is not a string, this function will return NULL and |*len| will + * be 0. + * + * The returned buffer will be valid as long as the underlying var is alive. + * If the plugin frees its reference, the string will be freed and the pointer + * will be to random memory. + */ + str_t VarToUtf8([in] PP_Var var, [out] uint32_t len); + + /** + * Returns true if the property with the given name exists on the given + * object, false if it does not. Methods are also counted as properties. + * + * The name can either be a string or an integer var. It is an error to pass + * another type of var as the name. + * + * If you pass an invalid name or object, the exception will be set (if it is + * non-NULL, and the return value will be false). + */ + PP_Bool HasProperty([in] PP_Var object, + [in] PP_Var name, + [out] PP_Var exception); + + /** + * Identical to HasProperty, except that HasMethod additionally checks if the + * property is a function. + */ + PP_Bool HasMethod([in] PP_Var object, + [in] PP_Var name, + [out] PP_Var exception); + + /** + * Returns the value of the given property. If the property doesn't exist, the + * exception (if non-NULL) will be set and a "Void" var will be returned. + */ + PP_Var GetProperty([in] PP_Var object, + [in] PP_Var name, + [out] PP_Var exception); + + /** + * Retrieves all property names on the given object. Property names include + * methods. + * + * If there is a failure, the given exception will be set (if it is non-NULL). + * On failure, |*properties| will be set to NULL and |*property_count| will be + * set to 0. + * + * A pointer to the array of property names will be placesd in |*properties|. + * The caller is responsible for calling Release() on each of these properties + * (as per normal refcounted memory management) as well as freeing the array + * pointer with PPB_Core.MemFree(). + * + * This function returns all "enumerable" properties. Some JavaScript + * properties are "hidden" and these properties won't be retrieved by this + * function, yet you can still set and get them. + * + * Example: + *
  uint32_t count;
+   *   PP_Var* properties;
+   *   ppb_var.GetAllPropertyNames(object, &count, &properties);
+   *
+   *   ...use the properties here...
+   *
+   *   for (uint32_t i = 0; i < count; i++)
+   *     ppb_var.Release(properties[i]);
+   *   ppb_core.MemFree(properties); 
+ */ + void GetAllPropertyNames([in] PP_Var object, + [out] uint32_t property_count, + [out, size_is(property_count)] PP_Var[] properties, + [out] PP_Var exception); + + /** + * Sets the property with the given name on the given object. The exception + * will be set, if it is non-NULL, on failure. + */ + void SetProperty([in] PP_Var object, + [in] PP_Var name, + [in] PP_Var value, + [out] PP_Var exception); + + /** + * Removes the given property from the given object. The property name must + * be an string or integer var, using other types will throw an exception + * (assuming the exception pointer is non-NULL). + */ + void RemoveProperty([in] PP_Var object, + [in] PP_Var name, + [out] PP_Var exception); + + // TODO(brettw) need native array access here. + + /** + * Invoke the function |method_name| on the given object. If |method_name| + * is a Null var, the default method will be invoked, which is how you can + * invoke function objects. + * + * Unless it is type Null, |method_name| must be a string. Unlike other + * Var functions, integer lookup is not supported since you can't call + * functions on integers in JavaScript. + * + * Pass the arguments to the function in order in the |argv| array, and the + * number of arguments in the |argc| parameter. |argv| can be NULL if |argc| + * is zero. + * + * Example: + * Call(obj, VarFromUtf8("DoIt"), 0, NULL, NULL) = obj.DoIt() in JavaScript. + * Call(obj, PP_MakeNull(), 0, NULL, NULL) = obj() in JavaScript. + */ + PP_Var Call([in] PP_Var object, + [in] PP_Var method_name, + [in] uint32_t argc, + [in, size_is(argc)] PP_Var[] argv, + [out] PP_Var exception); + + /** + * Invoke the object as a constructor. + * + * For example, if |object| is |String|, this is like saying |new String| in + * JavaScript. + */ + PP_Var Construct([in] PP_Var object, + [in] uint32_t argc, + [in, size_is(argc)] PP_Var[] argv, + [out] PP_Var exception); + + /** + * If the object is an instance of the given class, then this method returns + * true and sets *object_data to the value passed to CreateObject provided + * object_data is non-NULL. Otherwise, this method returns false. + */ + PP_Bool IsInstanceOf([in] PP_Var var, + [in, ref] PPP_Class_Deprecated object_class, + [out] mem_t object_data); + + /** + * Creates an object that the plugin implements. The plugin supplies a + * pointer to the class interface it implements for that object, and its + * associated internal data that represents that object. This object data + * must be unique among all "live" objects. + * + * The returned object will have a reference count of 1. When the reference + * count reached 0, the class' Destruct function wlil be called. + * + * On failure, this will return a null var. This probably means the module + * was invalid. + * + * Example: Say we're implementing a "Point" object. + *
  void PointDestruct(void* object) {
+   *     delete (Point*)object;
+   *   }
+   *
+   *   const PPP_Class_Deprecated point_class = {
+   *     ... all the other class functions go here ...
+   *     &PointDestruct
+   *   };
+   *
+   *    * The plugin's internal object associated with the point.
+   *   class Point {
+   *     ...
+   *   };
+   *
+   *   PP_Var MakePoint(int x, int y) {
+   *     return CreateObject(&point_class, new Point(x, y));
+   *   }
+ */ + PP_Var CreateObject([in] PP_Instance instance, + [in, ref] PPP_Class_Deprecated object_class, + [inout] mem_t object_data); + + // Like CreateObject but takes a module. This will be deleted when all callers + // can be changed to use the PP_Instance CreateObject one. + PP_Var CreateObjectWithModuleDeprecated( + [in] PP_Module module, + [in, ref] PPP_Class_Deprecated object_class, + [inout] mem_t object_data); +}; diff --git a/browser/extensions/mortar/ppapi/api/dev/ppb_video_capture_dev.idl b/browser/extensions/mortar/ppapi/api/dev/ppb_video_capture_dev.idl new file mode 100644 index 000000000000..a05374a41074 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/dev/ppb_video_capture_dev.idl @@ -0,0 +1,158 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_VideoCapture_Dev interface. + */ +label Chrome { + M25 = 0.3 +}; + +/** + * Video capture interface. It goes hand-in-hand with PPP_VideoCapture_Dev. + * + * Theory of operation: + * 1- Create a VideoCapture resource using Create. + * 2- Find available video capture devices using EnumerateDevices. + * 3- Open a video capture device. In addition to a device reference (0 can be + * used to indicate the default device), you pass in the requested info + * (resolution, frame rate), as well as suggest a number of buffers you will + * need. + * 4- Start the capture using StartCapture. + * 5- Receive the OnDeviceInfo callback, in PPP_VideoCapture_Dev, which will + * give you the actual capture info (the requested one is not guaranteed), as + * well as an array of buffers allocated by the browser. + * 6- On every frame captured by the browser, OnBufferReady (in + * PPP_VideoCapture_Dev) is called with the index of the buffer from the array + * containing the new frame. The buffer is now "owned" by the plugin, and the + * browser won't reuse it until ReuseBuffer is called. + * 7- When the plugin is done with the buffer, call ReuseBuffer. + * 8- Stop the capture using StopCapture. + * 9- Close the device. + * + * The browser may change the resolution based on the constraints of the system, + * in which case OnDeviceInfo will be called again, with new buffers. + * + * The buffers contain the pixel data for a frame. The format is planar YUV + * 4:2:0, one byte per pixel, tightly packed (width x height Y values, then + * width/2 x height/2 U values, then width/2 x height/2 V values). + */ +interface PPB_VideoCapture_Dev { + /** + * Creates a new VideoCapture. + */ + PP_Resource Create( + [in] PP_Instance instance); + + /** + * Returns PP_TRUE if the given resource is a VideoCapture. + */ + PP_Bool IsVideoCapture( + [in] PP_Resource video_capture); + + /** + * Enumerates video capture devices. + * + * @param[in] video_capture A PP_Resource corresponding to a + * video capture resource. + * @param[in] output An output array which will receive + * PPB_DeviceRef_Dev resources on success. Please note that the + * ref count of those resources has already been increased by 1 for the + * caller. + * @param[in] callback A PP_CompletionCallback to run on + * completion. + * + * @return An error code from pp_errors.h. + */ + [version=0.3] + int32_t EnumerateDevices( + [in] PP_Resource video_capture, + [in] PP_ArrayOutput output, + [in] PP_CompletionCallback callback); + + /** + * Requests device change notifications. + * + * @param[in] video_capture A PP_Resource corresponding to a + * video capture resource. + * @param[in] callback The callback to receive notifications. If not NULL, it + * will be called once for the currently available devices, and then every + * time the list of available devices changes. All calls will happen on the + * same thread as the one on which MonitorDeviceChange() is called. It will + * receive notifications until video_capture is destroyed or + * MonitorDeviceChange() is called to set a new callback for + * video_capture. You can pass NULL to cancel sending + * notifications. + * @param[inout] user_data An opaque pointer that will be passed to + * callback. + * + * @return An error code from pp_errors.h. + */ + [version=0.3] + int32_t MonitorDeviceChange( + [in] PP_Resource video_capture, + [in] PP_MonitorDeviceChangeCallback callback, + [inout] mem_t user_data); + + /** + * Opens a video capture device. |device_ref| identifies a video capture + * device. It could be one of the resource in the array returned by + * |EnumerateDevices()|, or 0 which means the default device. + * |requested_info| is a pointer to a structure containing the requested + * resolution and frame rate. |buffer_count| is the number of buffers + * requested by the plugin. Note: it is only used as advisory, the browser may + * allocate more or fewer based on available resources. How many buffers + * depends on usage. At least 2 to make sure latency doesn't cause lost + * frames. If the plugin expects to hold on to more than one buffer at a time + * (e.g. to do multi-frame processing, like video encoding), it should request + * that many more. + */ + int32_t Open( + [in] PP_Resource video_capture, + [in] PP_Resource device_ref, + [in] PP_VideoCaptureDeviceInfo_Dev requested_info, + [in] uint32_t buffer_count, + [in] PP_CompletionCallback callback); + + /** + * Starts the capture. + * + * Returns PP_ERROR_FAILED if called when the capture was already started, or + * PP_OK on success. + */ + int32_t StartCapture( + [in] PP_Resource video_capture); + + /** + * Allows the browser to reuse a buffer that was previously sent by + * PPP_VideoCapture_Dev.OnBufferReady. |buffer| is the index of the buffer in + * the array returned by PPP_VideoCapture_Dev.OnDeviceInfo. + * + * Returns PP_ERROR_BADARGUMENT if buffer is out of range (greater than the + * number of buffers returned by PPP_VideoCapture_Dev.OnDeviceInfo), or if it + * is not currently owned by the plugin. Returns PP_OK otherwise. + */ + int32_t ReuseBuffer( + [in] PP_Resource video_capture, + [in] uint32_t buffer); + + /** + * Stops the capture. + * + * Returns PP_ERROR_FAILED if the capture wasn't already started, or PP_OK on + * success. + */ + int32_t StopCapture( + [in] PP_Resource video_capture); + + /** + * Closes the video capture device, and stops capturing if necessary. It is + * not valid to call |Open()| again after a call to this method. + * If a video capture resource is destroyed while a device is still open, then + * it will be implicitly closed, so you are not required to call this method. + */ + void Close( + [in] PP_Resource video_capture); +}; diff --git a/browser/extensions/mortar/ppapi/api/dev/ppb_video_decoder_dev.idl b/browser/extensions/mortar/ppapi/api/dev/ppb_video_decoder_dev.idl new file mode 100644 index 000000000000..da408c94fcec --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/dev/ppb_video_decoder_dev.idl @@ -0,0 +1,155 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_VideoDecoder_Dev interface. + */ +label Chrome { + M14 = 0.16 +}; + +/** + * Video decoder interface. + * + * Typical usage: + * - Use Create() to create & configure a new PPB_VideoDecoder_Dev resource. + * - Call Decode() to decode some video data. + * - Receive ProvidePictureBuffers callback + * - Supply the decoder with textures using AssignPictureBuffers. + * - Receive PictureReady callbacks + * - Hand the textures back to the decoder using ReusePictureBuffer. + * - To signal EOS to the decoder: call Flush() and wait for NotifyFlushDone + * callback. + * - To reset the decoder (e.g. to implement Seek): call Reset() and wait for + * NotifyResetDone callback. + * - To tear down the decoder call Destroy(). + * + * See PPP_VideoDecoder_Dev for the notifications the decoder may send the + * plugin. + */ +interface PPB_VideoDecoder_Dev { + /** + * Creates & initializes a video decoder. + * + * Parameters: + * |instance| pointer to the plugin instance. + * |context| a PPB_Graphics3D resource in which decoding will happen. + * |profile| the video stream's format profile. + * + * The created decoder is returned as PP_Resource. 0 means failure. + */ + PP_Resource Create( + [in] PP_Instance instance, + [in] PP_Resource context, + [in] PP_VideoDecoder_Profile profile); + + /** + * Tests whether |resource| is a video decoder created through Create + * function of this interface. + * + * Parameters: + * |resource| is handle to resource to test. + * + * Returns true if is a video decoder, false otherwise. + */ + PP_Bool IsVideoDecoder( + [in] PP_Resource resource); + + /** + * Dispatches bitstream buffer to the decoder. + * + * Parameters: + * |video_decoder| is the previously created handle to the decoder resource. + * |bitstream_buffer| is the bitstream buffer that contains at most one + * input frame. + * |callback| will be called when |bitstream_buffer| has been processed by + * the decoder. + * + * Returns an error code from pp_errors.h. + */ + int32_t Decode( + [in] PP_Resource video_decoder, + [in] PP_VideoBitstreamBuffer_Dev bitstream_buffer, + [in] PP_CompletionCallback callback); + + /** + * Provides the decoder with texture-backed picture buffers for video + * decoding. + * + * This function should be called when the plugin has its + * ProvidePictureBuffers method called. The decoder will stall until it has + * received all the buffers it's asked for. + * + * Parameters: + * |video_decoder| is the previously created handle to the decoder resource. + * |no_of_buffers| how many buffers are behind picture buffer pointer. + * |buffers| contains the reference to the picture buffer that was + * allocated. + */ + void AssignPictureBuffers( + [in] PP_Resource video_decoder, + [in] uint32_t no_of_buffers, + [in, size_as=no_of_buffers] PP_PictureBuffer_Dev[] buffers); + + /** + * Tells the decoder to reuse the given picture buffer. Typical use of this + * function is to call from PictureReady callback to recycle picture buffer + * back to the decoder after blitting the image so that decoder can use the + * image for output again. + * + * Parameters: + * |video_decoder| is the previously created handle to the decoder resource. + * |picture_buffer_id| contains the id of the picture buffer that was + * processed. + */ + void ReusePictureBuffer( + [in] PP_Resource video_decoder, + [in] int32_t picture_buffer_id); + + /** + * Flush input and output buffers in the decoder. Any pending inputs are + * decoded and pending outputs are delivered to the plugin. Once done + * flushing, the decoder will call |callback|. + * + * Parameters: + * |video_decoder| is the previously created handle to the decoder resource. + * |callback| is one-time callback that will be called once the flushing + * request has been completed. + * + * Returns an error code from pp_errors.h. + */ + int32_t Flush( + [in] PP_Resource video_decoder, + [in] PP_CompletionCallback callback); + + /** + * Reset the decoder as quickly as possible. Pending inputs and outputs are + * dropped and the decoder is put back into a state ready to receive further + * Decode() calls. |callback| will be called when the reset is done. + * + * Parameters: + * |video_decoder| is the previously created handle to the decoder resource. + * |callback| is one-time callback that will be called once the reset + * request has been completed. + * + * Returns an error code from pp_errors.h. + */ + int32_t Reset( + [in] PP_Resource video_decoder, + [in] PP_CompletionCallback callback); + + /** + * Tear down the decoder as quickly as possible. Pending inputs and outputs + * are dropped and the decoder frees all of its resources. Although resources + * may be freed asynchronously, after this method returns no more callbacks + * will be made on the client. Any resources held by the client at that point + * may be freed. + * + * Parameters: + * |video_decoder| is the previously created handle to the decoder resource. + */ + void Destroy( + [in] PP_Resource video_decoder); +}; diff --git a/browser/extensions/mortar/ppapi/api/dev/ppb_view_dev.idl b/browser/extensions/mortar/ppapi/api/dev/ppb_view_dev.idl new file mode 100644 index 000000000000..0846bd819f81 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/dev/ppb_view_dev.idl @@ -0,0 +1,46 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* This file contains the PPB_View_Dev interface. */ + +[generate_thunk] + +label Chrome { + M22 = 0.1 +}; + +/* PPB_View_Dev interface */ +interface PPB_View_Dev { + /** + * GetDeviceScale returns the scale factor between device pixels and DIPs + * (also known as logical pixels or UI pixels on some platforms). This allows + * the developer to render their contents at device resolution, even as + * coordinates / sizes are given in DIPs through the API. + * + * Note that the coordinate system for Pepper APIs is DIPs. Also note that + * one DIP might not equal one CSS pixel - when page scale/zoom is in effect. + * + * @param[in] resource A PP_Resource corresponding to a + * PPB_View resource. + * + * @return A float value representing the number of device pixels + * per DIP. If the resource is invalid, the value will be 0.0. + */ + float_t GetDeviceScale([in] PP_Resource resource); + + /** + * GetCSSScale returns the scale factor between DIPs and CSS pixels. This + * allows proper scaling between DIPs - as sent via the Pepper API - and CSS + * pixel coordinates used for Web content. + * + * @param[in] resource A PP_Resource corresponding to a + * PPB_View resource. + * + * @return css_scale A float value representing the number of + * DIPs per CSS pixel. If the resource is invalid, the value will be 0.0. + */ + float_t GetCSSScale([in] PP_Resource resource); +}; + diff --git a/browser/extensions/mortar/ppapi/api/dev/ppp_class_deprecated.idl b/browser/extensions/mortar/ppapi/api/dev/ppp_class_deprecated.idl new file mode 100644 index 000000000000..5a184ad8a8bd --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/dev/ppp_class_deprecated.idl @@ -0,0 +1,119 @@ +/* Copyright (c) 2010 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * Defines the PPP_Class_Deprecated struct. + */ +label Chrome { + M39 = 1.0 +}; + +/** + * Interface for the plugin to implement JavaScript-accessible objects. + * + * This interface has no interface name. Instead, the plugin passes a pointer + * to this interface to PPB_Var_Deprecated.CreateObject that corresponds to the + * object being implemented. + * + * See the PPB_Var_Deprecated interface for more information on these functions. + * This interface just allows you to implement the "back end" of those + * functions, so most of the contract is specified in that interface. + * + * See + * http://code.google.com/p/ppapi/wiki/InterfacingWithJavaScript + * for general information on using and implementing vars. + */ +interface PPP_Class_Deprecated { + /** + * |name| is guaranteed to be an integer or string type var. Exception is + * guaranteed non-NULL. An integer is used for |name| when implementing + * array access into the object. This test should only return true for + * properties that are not methods. Use HasMethod() to handle methods. + */ + PP_Bool HasProperty([in] mem_t object, + [in] PP_Var name, + [out] PP_Var exception); + + /** + * |name| is guaranteed to be a string-type. Exception is guaranteed non-NULL. + * If the method does not exist, return false and don't set the exception. + * Errors in this function will probably not occur in general usage, but + * if you need to throw an exception, still return false. + */ + PP_Bool HasMethod([in] mem_t object, + [in] PP_Var name, + [out] PP_Var exception); + + /** + * |name| is guaranteed to be a string-type or an integer-type var. Exception + * is guaranteed non-NULL. An integer is used for |name| when implementing + * array access into the object. If the property does not exist, set the + * exception and return a var of type Void. A property does not exist if + * a call HasProperty() for the same |name| would return false. + */ + PP_Var GetProperty([in] mem_t object, + [in] PP_Var name, + [out] PP_Var exception); + + /** + * Exception is guaranteed non-NULL. + * + * This should include all enumerable properties, including methods. Be sure + * to set |*property_count| to 0 and |properties| to NULL in all failure + * cases, these should never be unset when calling this function. The + * pointers passed in are guaranteed not to be NULL, so you don't have to + * NULL check them. + * + * If you have any properties, allocate the property array with + * PPB_Core.MemAlloc(sizeof(PP_Var) * property_count) and add a reference + * to each property on behalf of the caller. The caller is responsible for + * Release()ing each var and calling PPB_Core.MemFree on the property pointer. + */ + void GetAllPropertyNames([in] mem_t object, + [out] uint32_t property_count, + [out, size_is(property_count)] PP_Var[] properties, + [out] PP_Var exception); + + /** + * |name| is guaranteed to be an integer or string type var. Exception is + * guaranteed non-NULL. + */ + void SetProperty([in] mem_t object, + [in] PP_Var name, + [in] PP_Var value, + [out] PP_Var exception); + + /** + * |name| is guaranteed to be an integer or string type var. Exception is + * guaranteed non-NULL. + */ + void RemoveProperty([in] mem_t object, + [in] PP_Var name, + [out] PP_Var exception); + + // TODO(brettw) need native array access here. + + /** + * |name| is guaranteed to be a string type var. Exception is guaranteed + * non-NULL + */ + PP_Var Call([in] mem_t object, + [in] PP_Var method_name, + [in] uint32_t argc, + [in, size_is(argc)] PP_Var[] argv, + [out] PP_Var exception); + + /** Exception is guaranteed non-NULL. */ + PP_Var Construct([in] mem_t object, + [in] uint32_t argc, + [in, size_is(argc)] PP_Var[] argv, + [out] PP_Var exception); + + /** + * Called when the reference count of the object reaches 0. Normally, plugins + * would free their internal data pointed to by the |object| pointer. + */ + void Deallocate([in] mem_t object); +}; diff --git a/browser/extensions/mortar/ppapi/api/dev/ppp_network_state_dev.idl b/browser/extensions/mortar/ppapi/api/dev/ppp_network_state_dev.idl new file mode 100644 index 000000000000..86df33d98ef9 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/dev/ppp_network_state_dev.idl @@ -0,0 +1,25 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPP_NetworkState interface. + */ + +label Chrome { + M14 = 0.1 +}; + +[macro="PPP_NETWORK_STATE_DEV_INTERFACE"] +interface PPP_NetworkState_Dev { + /** + * Notification that the online state has changed for the user's network. + * This will change as a result of a network cable being plugged or + * unplugged, WiFi connections going up and down, or other events. + * + * Note that being "online" isn't a guarantee that any particular connections + * will succeed. + */ + void SetOnLine([in] PP_Bool is_online); +}; diff --git a/browser/extensions/mortar/ppapi/api/dev/ppp_printing_dev.idl b/browser/extensions/mortar/ppapi/api/dev/ppp_printing_dev.idl new file mode 100644 index 000000000000..df107abe009b --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/dev/ppp_printing_dev.idl @@ -0,0 +1,60 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * Definition of the PPP_Printing interface. + */ + +// Note: This version should always match the PPB_Printing_Dev interface. +label Chrome { + M21 = 0.6 +}; + +/** + * Specifies a contiguous range of page numbers to be printed. + * The page numbers use a zero-based index. + */ +[assert_size(8)] +struct PP_PrintPageNumberRange_Dev { + uint32_t first_page_number; + uint32_t last_page_number; +}; + +interface PPP_Printing_Dev { + /** + * Returns a bit field representing the supported print output formats. For + * example, if only PDF and PostScript are supported, + * QuerySupportedFormats returns a value equivalent to: + * (PP_PRINTOUTPUTFORMAT_PDF | PP_PRINTOUTPUTFORMAT_POSTSCRIPT) + */ + uint32_t QuerySupportedFormats([in] PP_Instance instance); + + /** + * Begins a print session with the given print settings. Calls to PrintPages + * can only be made after a successful call to Begin. Returns the number of + * pages required for the print output at the given page size (0 indicates + * a failure). + */ + int32_t Begin([in] PP_Instance instance, + [in] PP_PrintSettings_Dev print_settings); + + /** + * Prints the specified pages using the format specified in Begin. + * Returns a PPB_Buffer resource that represents the printed output. Returns + * 0 on failure. + */ + PP_Resource PrintPages([in] PP_Instance instance, + [in] PP_PrintPageNumberRange_Dev page_ranges, + [in] uint32_t page_range_count); + + /** Ends the print session. Further calls to PrintPages will fail. */ + void End([in] PP_Instance instance); + + /** + * Returns true if the current content should be printed into the full page + * and not scaled down to fit within the printer's printable area. + */ + PP_Bool IsScalingDisabled([in] PP_Instance instance); +}; diff --git a/browser/extensions/mortar/ppapi/api/dev/ppp_text_input_dev.idl b/browser/extensions/mortar/ppapi/api/dev/ppp_text_input_dev.idl new file mode 100644 index 000000000000..b6bdd88671cd --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/dev/ppp_text_input_dev.idl @@ -0,0 +1,27 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPP_TextInput_Dev interface. + */ + +label Chrome { + M19 = 0.1 +}; + +/** + * PPP_TextInput_Dev is a set of function pointers that the + * plugin has to implement to provide hints for text input system (IME). + */ +interface PPP_TextInput_Dev { + /** + * Requests the plugin to send back the text around the current caret or + * selection by PPB_TextInput_Dev::UpdateSurroundingText. + * It is recommended to include the desired_number_of_characters + * characters before and after the selection, but not mandatory. + */ + void RequestSurroundingText([in] PP_Instance instance, + [in] uint32_t desired_number_of_characters); +}; diff --git a/browser/extensions/mortar/ppapi/api/dev/ppp_video_capture_dev.idl b/browser/extensions/mortar/ppapi/api/dev/ppp_video_capture_dev.idl new file mode 100644 index 000000000000..007870fd8f16 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/dev/ppp_video_capture_dev.idl @@ -0,0 +1,64 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPP_VideoCapture_Dev interface. + */ +label Chrome { + M15 = 0.1 +}; + +/** + * Video Capture client interface. See |PPB_VideoCapture_Dev| for general theory + * of operation. + */ +[macro="PPP_VIDEO_CAPTURE_DEV_INTERFACE"] +interface PPP_VideoCapture_Dev { + /** + * Signals the capture device information, such as resolution and frame rate, + * and the array of buffers that the browser will use to send pixel data. + * + * |info| is a pointer to the PP_VideoCaptureDeviceInfo_Dev structure + * containing resolution and frame rate. + * |buffer_count| is the number of buffers, and |buffers| is the array of + * PPB_Buffer_Dev buffers. + * + * Note: the buffers are passed without an extra reference. The plugin is + * expected to add its own references to the buffers. + */ + void OnDeviceInfo([in] PP_Instance instance, + [in] PP_Resource video_capture, + [in] PP_VideoCaptureDeviceInfo_Dev info, + [in] uint32_t buffer_count, + [in, size_is(buffer_count)] PP_Resource[] buffers); + + /** + * Signals status changes on the VideoCapture. |status| is a + * one of the values from PP_VideoCaptureStatus_Dev; + */ + void OnStatus([in] PP_Instance instance, + [in] PP_Resource video_capture, + [in] uint32_t status); + + /** + * Signals an error from the video capture system. + * + * Errors that can be generated: + * - PP_ERROR_NOMEMORY: not enough memory was available to allocate buffers. + * - PP_ERROR_FAILED: video capture could not start. + */ + void OnError([in] PP_Instance instance, + [in] PP_Resource video_capture, + [in] uint32_t error_code); + + /** + * Signals that a buffer is available for consumption by the plugin. + * + * |buffer| is the index of the buffer, in the array returned by OnDeviceInfo. + */ + void OnBufferReady([in] PP_Instance instance, + [in] PP_Resource video_capture, + [in] uint32_t buffer); +}; diff --git a/browser/extensions/mortar/ppapi/api/dev/ppp_video_decoder_dev.idl b/browser/extensions/mortar/ppapi/api/dev/ppp_video_decoder_dev.idl new file mode 100644 index 000000000000..42546ec18d82 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/dev/ppp_video_decoder_dev.idl @@ -0,0 +1,87 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPP_VideoDecoder_Dev interface. + */ +label Chrome { + M21 = 0.11 +}; + +/** + * PPP_VideoDecoder_Dev structure contains the function pointers that the + * plugin MUST implement to provide services needed by the video decoder + * implementation. + * + * See PPB_VideoDecoder_Dev for general usage tips. + */ +interface PPP_VideoDecoder_Dev { + /** + * Callback function to provide buffers for the decoded output pictures. If + * succeeds plugin must provide buffers through AssignPictureBuffers function + * to the API. If |req_num_of_bufs| matching exactly the specification + * given in the parameters cannot be allocated decoder should be destroyed. + * + * Decoding will not proceed until buffers have been provided. + * + * Parameters: + * |instance| the plugin instance to which the callback is responding. + * |decoder| the PPB_VideoDecoder_Dev resource. + * |req_num_of_bufs| tells how many buffers are needed by the decoder. + * |dimensions| tells the dimensions of the buffer to allocate. + * |texture_target| the type of texture used. Sample targets in use are + * TEXTURE_2D (most platforms) and TEXTURE_EXTERNAL_OES (on ARM). + */ + [version=0.11] + void ProvidePictureBuffers( + [in] PP_Instance instance, + [in] PP_Resource decoder, + [in] uint32_t req_num_of_bufs, + [in] PP_Size dimensions, + [in] uint32_t texture_target); + + /** + * Callback function for decoder to deliver unneeded picture buffers back to + * the plugin. + * + * Parameters: + * |instance| the plugin instance to which the callback is responding. + * |decoder| the PPB_VideoDecoder_Dev resource. + * |picture_buffer| points to the picture buffer that is no longer needed. + */ + void DismissPictureBuffer( + [in] PP_Instance instance, + [in] PP_Resource decoder, + [in] int32_t picture_buffer_id); + + /** + * Callback function for decoder to deliver decoded pictures ready to be + * displayed. Decoder expects the plugin to return the buffer back to the + * decoder through ReusePictureBuffer function in PPB Video Decoder API. + * + * Parameters: + * |instance| the plugin instance to which the callback is responding. + * |decoder| the PPB_VideoDecoder_Dev resource. + * |picture| is the picture that is ready. + */ + void PictureReady( + [in] PP_Instance instance, + [in] PP_Resource decoder, + [in] PP_Picture_Dev picture); + + /** + * Error handler callback for decoder to deliver information about detected + * errors to the plugin. + * + * Parameters: + * |instance| the plugin instance to which the callback is responding. + * |decoder| the PPB_VideoDecoder_Dev resource. + * |error| error is the enumeration specifying the error. + */ + void NotifyError( + [in] PP_Instance instance, + [in] PP_Resource decoder, + [in] PP_VideoDecodeError_Dev error); +}; diff --git a/browser/extensions/mortar/ppapi/api/pp_array_output.idl b/browser/extensions/mortar/ppapi/api/pp_array_output.idl new file mode 100644 index 000000000000..8e04a4cc9d79 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/pp_array_output.idl @@ -0,0 +1,93 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * PP_ArrayOutput_GetDataBuffer is a callback function to allocate plugin + * memory for an array. It returns the allocated memory or null on failure. + * + * This function will be called reentrantly. This means that if you call a + * function PPB_Foo.GetData(&array_output), GetData will call your + * GetDataBuffer function before it returns. + * + * This function will be called even when returning 0-length arrays, so be sure + * your implementation can support that. You can return NULL for 0 length + * arrays and it will not be treated as a failure. + + * You should not perform any processing in this callback, including calling + * other PPAPI functions, outside of allocating memory. You should not throw + * any exceptions. In C++, this means using "new (nothrow)" or being sure to + * catch any exceptions before returning. + * + * The C++ wrapper provides a convenient templatized implementation around + * std::vector which you should generally use instead of coding this + * specifically. + * + * @param user_data The pointer provided in the PP_ArrayOutput structure. This + * has no meaning to the browser, it is intended to be used by the + * implementation to figure out where to put the data. + * + * @param element_count The number of elements in the array. This will be 0 + * if there is no data to return. + * + * @param element_size The size of each element in bytes. + * + * @return Returns a pointer to the allocated memory. On failure, returns null. + * You can also return null if the element_count is 0. When a non-null value is + * returned, the buffer must remain valid until after the callback runs. If used + * with a blocking callback, the buffer must remain valid until after the + * function returns. The plugin can then free any memory that it allocated. + */ +typedef mem_t PP_ArrayOutput_GetDataBuffer([inout] mem_t user_data, + [in] uint32_t element_count, + [in] uint32_t element_size); + +/** + * A structure that defines a way for the browser to return arrays of data + * to the plugin. The browser can not allocate memory on behalf of the plugin + * because the plugin and browser may have different allocators. + * + * Array output works by having the browser call to the plugin to allocate a + * buffer, and then the browser will copy the contents of the array into that + * buffer. + * + * In C, you would typically implement this as follows: + * + * @code + * struct MyArrayOutput { + * void* data; + * int element_count; + * }; + * void* MyGetDataBuffer(void* user_data, uint32_t count, uint32_t size) { + * MyArrayOutput* output = (MyArrayOutput*)user_data; + * output->element_count = count; + * if (size) { + * output->data = malloc(count * size); + * if (!output->data) // Be careful to set size properly on malloc failure. + * output->element_count = 0; + * } else { + * output->data = NULL; + * } + * return output->data; + * } + * void MyFunction() { + * MyArrayOutput array = { NULL, 0 }; + * PP_ArrayOutput output = { &MyGetDataBuffer, &array }; + * ppb_foo->GetData(&output); + * } + * @endcode + */ +[passByValue] +struct PP_ArrayOutput { + /** + * A pointer to the allocation function that the browser will call. + */ + PP_ArrayOutput_GetDataBuffer GetDataBuffer; + + /** + * Data that is passed to the allocation function. Typically, this is used + * to communicate how the data should be stored. + */ + mem_t user_data; +}; diff --git a/browser/extensions/mortar/ppapi/api/pp_bool.idl b/browser/extensions/mortar/ppapi/api/pp_bool.idl new file mode 100644 index 000000000000..1f8137b96350 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/pp_bool.idl @@ -0,0 +1,44 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PP_Bool enumeration for use in PPAPI C + * headers. + */ + +/** + * The PP_Bool enum is a boolean value for use in PPAPI C headers. + * The standard bool type is not available to pre-C99 compilers, and is not + * guaranteed to be compatible between C and C++, whereas the PPAPI C headers + * can be included from C or C++ code. + */ +[assert_size(4)] enum PP_Bool { + PP_FALSE = 0, + PP_TRUE = 1 +}; + +#inline cc +/** + * Converts a C++ "bool" type to a PP_Bool. + * + * @param[in] b A C++ "bool" type. + * + * @return A PP_Bool. + */ +inline PP_Bool PP_FromBool(bool b) { + return b ? PP_TRUE : PP_FALSE; +} + +/** + * Converts a PP_Bool to a C++ "bool" type. + * + * @param[in] b A PP_Bool. + * + * @return A C++ "bool" type. + */ +inline bool PP_ToBool(PP_Bool b) { + return (b != PP_FALSE); +} +#endinl diff --git a/browser/extensions/mortar/ppapi/api/pp_codecs.idl b/browser/extensions/mortar/ppapi/api/pp_codecs.idl new file mode 100644 index 000000000000..8699ec9853d9 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/pp_codecs.idl @@ -0,0 +1,254 @@ +/* Copyright (c) 2014 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * Video profiles. + */ +enum PP_VideoProfile { + PP_VIDEOPROFILE_H264BASELINE = 0, + PP_VIDEOPROFILE_H264MAIN = 1, + PP_VIDEOPROFILE_H264EXTENDED = 2, + PP_VIDEOPROFILE_H264HIGH = 3, + PP_VIDEOPROFILE_H264HIGH10PROFILE = 4, + PP_VIDEOPROFILE_H264HIGH422PROFILE = 5, + PP_VIDEOPROFILE_H264HIGH444PREDICTIVEPROFILE = 6, + PP_VIDEOPROFILE_H264SCALABLEBASELINE = 7, + PP_VIDEOPROFILE_H264SCALABLEHIGH = 8, + PP_VIDEOPROFILE_H264STEREOHIGH = 9, + PP_VIDEOPROFILE_H264MULTIVIEWHIGH = 10, + PP_VIDEOPROFILE_VP8_ANY = 11, + PP_VIDEOPROFILE_VP9_ANY = 12, + PP_VIDEOPROFILE_MAX = PP_VIDEOPROFILE_VP9_ANY +}; + +/** + * Audio profiles. + */ +enum PP_AudioProfile { + PP_AUDIOPROFILE_OPUS = 0, + PP_AUDIOPROFILE_MAX = PP_AUDIOPROFILE_OPUS +}; + +/** + * Hardware acceleration options. + */ +enum PP_HardwareAcceleration { + /** Create a hardware accelerated resource only. */ + PP_HARDWAREACCELERATION_ONLY = 0, + + /** + * Create a hardware accelerated resource if possible. Otherwise, fall back + * to the software implementation. + */ + PP_HARDWAREACCELERATION_WITHFALLBACK = 1, + + /** Create the software implementation only. */ + PP_HARDWAREACCELERATION_NONE = 2, + + PP_HARDWAREACCELERATION_LAST = PP_HARDWAREACCELERATION_NONE +}; + +/** + * Struct describing a decoded video picture. The decoded picture data is stored + * in the GL texture corresponding to |texture_id|. The plugin can determine + * which Decode call generated the picture using |decode_id|. + */ +struct PP_VideoPicture { + /** + * |decode_id| parameter of the Decode call which generated this picture. + * See the PPB_VideoDecoder function Decode() for more details. + */ + uint32_t decode_id; + + /** + * Texture ID in the plugin's GL context. The plugin can use this to render + * the decoded picture. + */ + uint32_t texture_id; + + /** + * The GL texture target for the decoded picture. Possible values are: + * GL_TEXTURE_2D + * GL_TEXTURE_RECTANGLE_ARB + * GL_TEXTURE_EXTERNAL_OES + * + * The pixel format of the texture is GL_RGBA. + */ + uint32_t texture_target; + + /** + * Dimensions of the texture holding the decoded picture. + */ + PP_Size texture_size; + + /** + * The visible subrectangle of the picture. The plugin should display only + * this part of the picture. + */ + PP_Rect visible_rect; +}; + +/** + * Struct describing a decoded video picture. The decoded picture data is stored + * in the GL texture corresponding to |texture_id|. The plugin can determine + * which Decode call generated the picture using |decode_id|. + */ +struct PP_VideoPicture_0_1 { + /** + * |decode_id| parameter of the Decode call which generated this picture. + * See the PPB_VideoDecoder function Decode() for more details. + */ + uint32_t decode_id; + + /** + * Texture ID in the plugin's GL context. The plugin can use this to render + * the decoded picture. + */ + uint32_t texture_id; + + /** + * The GL texture target for the decoded picture. Possible values are: + * GL_TEXTURE_2D + * GL_TEXTURE_RECTANGLE_ARB + * GL_TEXTURE_EXTERNAL_OES + * + * The pixel format of the texture is GL_RGBA. + */ + uint32_t texture_target; + + /** + * Dimensions of the texture holding the decoded picture. + */ + PP_Size texture_size; +}; + +/** + * Supported video profile information. See the PPB_VideoEncoder function + * GetSupportedProfiles() for more details. + */ +struct PP_VideoProfileDescription { + /** + * The codec profile. + */ + PP_VideoProfile profile; + + /** + * Dimensions of the maximum resolution of video frames, in pixels. + */ + PP_Size max_resolution; + + /** + * The numerator of the maximum frame rate. + */ + uint32_t max_framerate_numerator; + + /** + * The denominator of the maximum frame rate. + */ + uint32_t max_framerate_denominator; + + /** + * Whether the profile is hardware accelerated. + */ + PP_Bool hardware_accelerated; +}; + +/** + * Supported video profile information. See the PPB_VideoEncoder function + * GetSupportedProfiles() for more details. + */ +struct PP_VideoProfileDescription_0_1 { + /** + * The codec profile. + */ + PP_VideoProfile profile; + + /** + * Dimensions of the maximum resolution of video frames, in pixels. + */ + PP_Size max_resolution; + + /** + * The numerator of the maximum frame rate. + */ + uint32_t max_framerate_numerator; + + /** + * The denominator of the maximum frame rate. + */ + uint32_t max_framerate_denominator; + + /** + * A value indicating if the profile is available in hardware, software, or + * both. + */ + PP_HardwareAcceleration acceleration; +}; + +/** + * Supported audio profile information. See the PPB_AudioEncoder function + * GetSupportedProfiles() for more details. + */ +struct PP_AudioProfileDescription { + /** + * The codec profile. + */ + PP_AudioProfile profile; + + /** + * Maximum number of channels that can be encoded. + */ + uint32_t max_channels; + + /** + * Sample size. + */ + uint32_t sample_size; + + /** + * Sampling rate that can be encoded + */ + uint32_t sample_rate; + + /** + * Whether the profile is hardware accelerated. + */ + PP_Bool hardware_accelerated; +}; + +/** + * Struct describing a bitstream buffer. + */ +struct PP_BitstreamBuffer { + /** + * The size, in bytes, of the bitstream data. + */ + uint32_t size; + + /** + * The base address of the bitstream data. + */ + mem_t buffer; + + /** + * Whether the buffer represents a key frame. + */ + PP_Bool key_frame; +}; + +/** + * Struct describing an audio bitstream buffer. + */ +struct PP_AudioBitstreamBuffer { + /** + * The size, in bytes, of the bitstream data. + */ + uint32_t size; + + /** + * The base address of the bitstream data. + */ + mem_t buffer; +}; diff --git a/browser/extensions/mortar/ppapi/api/pp_completion_callback.idl b/browser/extensions/mortar/ppapi/api/pp_completion_callback.idl new file mode 100644 index 000000000000..72aed837704b --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/pp_completion_callback.idl @@ -0,0 +1,262 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the API to create and run a callback. + */ + +/** + * This typedef defines the signature that you implement to receive callbacks + * on asynchronous completion of an operation. + * + * @param[in] user_data A pointer to user data passed to a callback function. + * @param[in] result If result is 0 (PP_OK), the operation succeeded. Negative + * values (other than -1 or PP_OK_COMPLETE) indicate error and are specified + * in pp_errors.h. Positive values for result usually indicate success and have + * some operation-dependent meaning (such as bytes read). + */ +typedef void PP_CompletionCallback_Func([inout] mem_t user_data, + [in] int32_t result); + +/** + * This enumeration contains flags used to control how non-NULL callbacks are + * scheduled by asynchronous methods. + */ +[assert_size(4)] +enum PP_CompletionCallback_Flag { + /** + * By default any non-NULL callback will always invoked asynchronously, + * on success or error, even if the operation could complete synchronously + * without blocking. + * + * The method taking such callback will always return PP_OK_COMPLETIONPENDING. + * The callback will be invoked on the same thread on which the method was + * invoked. + * + * NOTE: If the method taking the callback is invoked on a background + * thread that has no valid PPB_MessageLoop resource attached, the system has + * no way to run the callback on the correct thread. In this case, a log + * message will be emitted and the plugin will be made to crash. + */ + PP_COMPLETIONCALLBACK_FLAG_NONE = 0 << 0, + /** + * This flag allows any method taking such callback to complete synchronously + * and not call the callback if the operation would not block. This is useful + * when performance is an issue, and the operation bandwidth should not be + * limited to the processing speed of the message loop. + * + * On synchronous method completion, the completion result will be returned + * by the method itself. Otherwise, the method will return + * PP_OK_COMPLETIONPENDING, and the callback will be invoked asynchronously on + * the same thread on which the method was invoked. If there is no valid + * PPB_MessageLoop attached to that thread, and the callback would normally + * run asynchronously, the invoked method will return + * PP_ERROR_NO_MESSAGE_LOOP. + */ + PP_COMPLETIONCALLBACK_FLAG_OPTIONAL = 1 << 0 +}; + + +/** + * PP_CompletionCallback is a common mechanism for supporting + * potentially asynchronous calls in browser interfaces. Any method that takes a + * PP_CompletionCallback can be used in one of three different + * ways: + * - Required: The callback will always be invoked asynchronously on the + * thread where the associated PPB method was invoked. The method + * will always return PP_OK_COMPLETIONPENDING when a required + * callback, and the callback will be invoked later (barring + * system or thread shutdown; see PPB_MessageLoop for details). + * Required callbacks are the default. + *

+ * NOTE: If you use a required callback on a background thread, + * you must have created and attached a PPB_MessageLoop. + * Otherwise, the system can not run your callback on that thread, + * and will instead emit a log message and crash your plugin to + * make the problem more obvious. + * + * - Optional: The callback may be invoked asynchronously, or the PPB method + * may complete synchronously if it can do so without blocking. + * If the method will complete asynchronously, it will return + * PP_OK_COMPLETIONPENDING. Otherwise, it will complete + * synchronously and return an appropriate code (see below for + * more information on the return code). Optional callbacks are + * generally more difficult to use correctly than Required + * callbacks, but can provide better performance for some APIs + * (especially APIs with buffered reads, such as PPB_URLLoader or + * PPB_FileIO). + *

+ * NOTE: If you use an optional callback on a background thread, + * and you have not created and attached a PPB_MessageLoop, then + * the method you invoke will fail without running and return + * PP_ERROR_NO_MESSAGE_LOOP. + * + * - Blocking: In this case, the callback's function pointer is NULL, and the + * invoked method must complete synchronously. The method will + * run to completion and return an appropriate code when finished + * (see below for more information). Blocking completion + * callbacks are only supported on background threads. + *

+ * PP_BlockUntilComplete() provides a convenient way + * to specify blocking behavior. Refer to + * PP_BlockUntilComplete for more information. + * + * When the callback is run asynchronously, the result parameter passed to + * func is an int32_t that, if negative indicates an error code + * whose meaning is specific to the calling method (refer to + * pp_error.h for further information). A positive or 0 value is a + * return result indicating success whose meaning depends on the calling method + * (e.g. number of bytes read). + */ +[passByValue] struct PP_CompletionCallback { + /** + * This value is a callback function that will be called, or NULL if this is + * a blocking completion callback. + */ + PP_CompletionCallback_Func func; + /** + * This value is a pointer to user data passed to a callback function. + */ + mem_t user_data; + + /** + * Flags used to control how non-NULL callbacks are scheduled by + * asynchronous methods. + */ + int32_t flags; +}; + +#inline c +#include + +/** + * @addtogroup Functions + * @{ + */ +/** + * PP_MakeCompletionCallback() is used to create a + * PP_CompletionCallback. + * + * Example, creating a Required callback: + * + * @code + * struct PP_CompletionCallback cc = PP_MakeCompletionCallback(Foo, NULL); + * @endcode + * + * Example, creating an Optional callback: + * + * @code + * struct PP_CompletionCallback cc = PP_MakeCompletionCallback(Foo, NULL); + * cc.flags = cc.flags | PP_COMPLETIONCALLBACK_FLAG_OPTIONAL; + * @endcode + * + * @param[in] func A PP_CompletionCallback_Func that will be + * called. + * @param[in] user_data A pointer to user data passed to your callback + * function. This is optional and is typically used to help track state + * when you may have multiple callbacks pending. + * + * @return A PP_CompletionCallback structure. + */ +PP_INLINE struct PP_CompletionCallback PP_MakeCompletionCallback( + PP_CompletionCallback_Func func, + void* user_data) { + struct PP_CompletionCallback cc; + cc.func = func; + cc.user_data = user_data; + cc.flags = PP_COMPLETIONCALLBACK_FLAG_NONE; + return cc; +} + +/** + * PP_MakeOptionalCompletionCallback() is used to create a PP_CompletionCallback + * with PP_COMPLETIONCALLBACK_FLAG_OPTIONAL set. + * + * @param[in] func A PP_CompletionCallback_Func to be called on completion. + * @param[in] user_data A pointer to user data passed to be passed to the + * callback function. This is optional and is typically used to help track state + * in case of multiple pending callbacks. + * + * @return A PP_CompletionCallback structure. + */ +PP_INLINE struct PP_CompletionCallback PP_MakeOptionalCompletionCallback( + PP_CompletionCallback_Func func, + void* user_data) { + struct PP_CompletionCallback cc = PP_MakeCompletionCallback(func, user_data); + cc.flags = cc.flags | PP_COMPLETIONCALLBACK_FLAG_OPTIONAL; + return cc; +} +/** + * @} + */ + +/** + * @addtogroup Functions + * @{ + */ + +/** + * PP_RunCompletionCallback() is used to run a callback. It invokes + * the callback function passing it user data specified on creation and + * completion |result|. + * + * @param[in] cc A pointer to a PP_CompletionCallback that will be + * run. + * @param[in] result The result of the operation. Non-positive values correspond + * to the error codes from pp_errors.h (excluding PP_OK_COMPLETIONPENDING). + * Positive values indicate additional information such as bytes read. + */ +PP_INLINE void PP_RunCompletionCallback(struct PP_CompletionCallback* cc, + int32_t result) { + cc->func(cc->user_data, result); +} + +/** + * @} + */ + +/** + * @addtogroup Functions + * @{ + */ + + /** + * PP_BlockUntilComplete() is used in place of an actual completion callback + * to request blocking behavior. If specified, the calling thread will block + * until the function completes. Blocking completion callbacks are only allowed + * from background threads. + * + * @return A PP_CompletionCallback structure. + */ +PP_INLINE struct PP_CompletionCallback PP_BlockUntilComplete(void) { + return PP_MakeCompletionCallback(NULL, NULL); +} + +/** + * PP_RunAndClearCompletionCallback() runs a callback and clears the reference + * to that callback. + * + * This function is used when the null-ness of a completion callback is used as + * a signal for whether a completion callback has been registered. In this + * case, after the execution of the callback, it should be cleared. However, + * this introduces a conflict if the completion callback wants to schedule more + * work that involves the same completion callback again (for example, when + * reading data from an URLLoader, one would typically queue up another read + * callback). As a result, this function clears the pointer + * before the provided callback is executed. + */ +PP_INLINE void PP_RunAndClearCompletionCallback( + struct PP_CompletionCallback* cc, + int32_t res) { + struct PP_CompletionCallback temp = *cc; + *cc = PP_BlockUntilComplete(); + PP_RunCompletionCallback(&temp, res); +} +/** + * @} + */ + +#endinl + diff --git a/browser/extensions/mortar/ppapi/api/pp_directory_entry.idl b/browser/extensions/mortar/ppapi/api/pp_directory_entry.idl new file mode 100644 index 000000000000..4b12c34b2499 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/pp_directory_entry.idl @@ -0,0 +1,14 @@ +/* Copyright (c) 2013 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* + * This file defines the PP_DirectoryEntry struct. + */ + +[assert_size(8)] +struct PP_DirectoryEntry { + PP_Resource file_ref; + PP_FileType file_type; +}; diff --git a/browser/extensions/mortar/ppapi/api/pp_errors.idl b/browser/extensions/mortar/ppapi/api/pp_errors.idl new file mode 100644 index 000000000000..b17e87c73ee1 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/pp_errors.idl @@ -0,0 +1,202 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines an enumeration of all PPAPI error codes. + */ + +/** + * This enumeration contains enumerators of all PPAPI error codes. + * + * Errors are negative valued. Callers should treat all negative values as a + * failure, even if it's not in the list, since the possible errors are likely + * to expand and change over time. + */ +[unnamed] enum PP_Error { + /** + * This value is returned by a function on successful synchronous completion + * or is passed as a result to a PP_CompletionCallback_Func on successful + * asynchronous completion. + */ + PP_OK = 0, + /** + * This value is returned by a function that accepts a PP_CompletionCallback + * and cannot complete synchronously. This code indicates that the given + * callback will be asynchronously notified of the final result once it is + * available. + */ + PP_OK_COMPLETIONPENDING = -1, + + /**This value indicates failure for unspecified reasons. */ + PP_ERROR_FAILED = -2, + + /** + * This value indicates failure due to an asynchronous operation being + * interrupted. The most common cause of this error code is destroying a + * resource that still has a callback pending. All callbacks are guaranteed + * to execute, so any callbacks pending on a destroyed resource will be + * issued with PP_ERROR_ABORTED. + * + * If you get an aborted notification that you aren't expecting, check to + * make sure that the resource you're using is still in scope. A common + * mistake is to create a resource on the stack, which will destroy the + * resource as soon as the function returns. + */ + PP_ERROR_ABORTED = -3, + + /** This value indicates failure due to an invalid argument. */ + PP_ERROR_BADARGUMENT = -4, + + /** This value indicates failure due to an invalid PP_Resource. */ + PP_ERROR_BADRESOURCE = -5, + + /** This value indicates failure due to an unavailable PPAPI interface. */ + PP_ERROR_NOINTERFACE = -6, + + /** This value indicates failure due to insufficient privileges. */ + PP_ERROR_NOACCESS = -7, + + /** This value indicates failure due to insufficient memory. */ + PP_ERROR_NOMEMORY = -8, + + /** This value indicates failure due to insufficient storage space. */ + PP_ERROR_NOSPACE = -9, + + /** This value indicates failure due to insufficient storage quota. */ + PP_ERROR_NOQUOTA = -10, + + /** + * This value indicates failure due to an action already being in + * progress. + */ + PP_ERROR_INPROGRESS = -11, + + /** + * The requested command is not supported by the browser. + */ + PP_ERROR_NOTSUPPORTED = -12, + + /** + * Returned if you try to use a null completion callback to "block until + * complete" on the main thread. Blocking the main thread is not permitted + * to keep the browser responsive (otherwise, you may not be able to handle + * input events, and there are reentrancy and deadlock issues). + */ + PP_ERROR_BLOCKS_MAIN_THREAD = -13, + /** + * This value indicates that the plugin sent bad input data to a resource, + * leaving it in an invalid state. The resource can't be used after returning + * this error and should be released. + */ + PP_ERROR_MALFORMED_INPUT = -14, + /** + * This value indicates that a resource has failed. The resource can't be + * used after returning this error and should be released. + */ + PP_ERROR_RESOURCE_FAILED = -15, + + /** This value indicates failure due to a file that does not exist. */ + PP_ERROR_FILENOTFOUND = -20, + /** This value indicates failure due to a file that already exists. */ + PP_ERROR_FILEEXISTS = -21, + /** This value indicates failure due to a file that is too big. */ + PP_ERROR_FILETOOBIG = -22, + /** + * This value indicates failure due to a file having been modified + * unexpectedly. + */ + PP_ERROR_FILECHANGED = -23, + /** This value indicates that the pathname does not reference a file. */ + PP_ERROR_NOTAFILE = -24, + /** This value indicates failure due to a time limit being exceeded. */ + PP_ERROR_TIMEDOUT = -30, + /** + * This value indicates that the user cancelled rather than providing + * expected input. + */ + PP_ERROR_USERCANCEL = -40, + /** + * This value indicates failure due to lack of a user gesture such as a + * mouse click or key input event. Examples of actions requiring a user + * gesture are showing the file chooser dialog and going into fullscreen + * mode. + */ + PP_ERROR_NO_USER_GESTURE = -41, + /** + * This value indicates that the graphics context was lost due to a + * power management event. + */ + PP_ERROR_CONTEXT_LOST = -50, + /** + * Indicates an attempt to make a PPAPI call on a thread without previously + * registering a message loop via PPB_MessageLoop.AttachToCurrentThread. + * Without this registration step, no PPAPI calls are supported. + */ + PP_ERROR_NO_MESSAGE_LOOP = -51, + /** + * Indicates that the requested operation is not permitted on the current + * thread. + */ + PP_ERROR_WRONG_THREAD = -52, + /** + * Indicates that a null completion callback was used on a thread handling a + * blocking message from JavaScript. Null completion callbacks "block until + * complete", which could cause the main JavaScript thread to be blocked + * excessively. + */ + PP_ERROR_WOULD_BLOCK_THREAD = -53, + + /** + * This value indicates that the connection was closed. For TCP sockets, it + * corresponds to a TCP FIN. + */ + PP_ERROR_CONNECTION_CLOSED = -100, + /** + * This value indicates that the connection was reset. For TCP sockets, it + * corresponds to a TCP RST. + */ + PP_ERROR_CONNECTION_RESET = -101, + /** + * This value indicates that the connection attempt was refused. + */ + PP_ERROR_CONNECTION_REFUSED = -102, + /** + * This value indicates that the connection was aborted. For TCP sockets, it + * means the connection timed out as a result of not receiving an ACK for data + * sent. This can include a FIN packet that did not get ACK'd. + */ + PP_ERROR_CONNECTION_ABORTED = -103, + /** + * This value indicates that the connection attempt failed. + */ + PP_ERROR_CONNECTION_FAILED = -104, + /** + * This value indicates that the connection attempt timed out. + */ + PP_ERROR_CONNECTION_TIMEDOUT = -105, + /** + * This value indicates that the IP address or port number is invalid. + */ + PP_ERROR_ADDRESS_INVALID = -106, + /** + * This value indicates that the IP address is unreachable. This usually means + * that there is no route to the specified host or network. + */ + PP_ERROR_ADDRESS_UNREACHABLE = -107, + /** + * This value is returned when attempting to bind an address that is already + * in use. + */ + PP_ERROR_ADDRESS_IN_USE = -108, + /** + * This value indicates that the message was too large for the transport. + */ + PP_ERROR_MESSAGE_TOO_BIG = -109, + /** + * This value indicates that the host name could not be resolved. + */ + PP_ERROR_NAME_NOT_RESOLVED = -110 +}; + diff --git a/browser/extensions/mortar/ppapi/api/pp_file_info.idl b/browser/extensions/mortar/ppapi/api/pp_file_info.idl new file mode 100644 index 000000000000..9cccc8948e70 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/pp_file_info.idl @@ -0,0 +1,76 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines three enumerations for use in the PPAPI C file IO APIs. + */ + +/** + * The PP_FileType enum contains file type constants. + */ +[assert_size(4)] +enum PP_FileType { + /** A regular file type */ + PP_FILETYPE_REGULAR = 0, + /** A directory */ + PP_FILETYPE_DIRECTORY = 1, + /** A catch-all for unidentified types */ + PP_FILETYPE_OTHER = 2 +}; + +/** + * The PP_FileSystemType enum contains file system type constants. + */ +[assert_size(4)] +enum PP_FileSystemType { + /** For identified invalid return values */ + PP_FILESYSTEMTYPE_INVALID = 0, + /** For external file system types */ + PP_FILESYSTEMTYPE_EXTERNAL = 1, + /** For local persistent file system types */ + PP_FILESYSTEMTYPE_LOCALPERSISTENT = 2, + /** For local temporary file system types */ + PP_FILESYSTEMTYPE_LOCALTEMPORARY = 3, + /** For isolated file system types */ + PP_FILESYSTEMTYPE_ISOLATED = 4 +}; + +/** + * The PP_FileInfo struct represents all information about a file, + * such as size, type, and creation time. + */ +[assert_size(40)] +struct PP_FileInfo { + /** This value represents the size of the file measured in bytes */ + int64_t size; + + /** + * This value represents the type of file as defined by the + * PP_FileType enum + */ + PP_FileType type; + + /** + * This value represents the file system type of the file as defined by the + * PP_FileSystemType enum. + */ + PP_FileSystemType system_type; + + /** + * This value represents the creation time of the file. + */ + PP_Time creation_time; + + /** + * This value represents the last time the file was accessed. + */ + PP_Time last_access_time; + + /** + * This value represents the last time the file was modified. + */ + PP_Time last_modified_time; +}; + diff --git a/browser/extensions/mortar/ppapi/api/pp_graphics_3d.idl b/browser/extensions/mortar/ppapi/api/pp_graphics_3d.idl new file mode 100644 index 000000000000..86dc6ae5d694 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/pp_graphics_3d.idl @@ -0,0 +1,83 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PP_Graphics3DAttrib enumeration for use in + * PPAPI C headers. + */ + +[assert_size(4)] enum PP_Graphics3DAttrib { + /** + * Bits of Alpha in the color buffer. + */ + PP_GRAPHICS3DATTRIB_ALPHA_SIZE = 0x3021, + /** + * Bits of Blue in the color buffer. + */ + PP_GRAPHICS3DATTRIB_BLUE_SIZE = 0x3022, + /** + * Bits of Green in the color buffer. + */ + PP_GRAPHICS3DATTRIB_GREEN_SIZE = 0x3023, + /** + * Bits of Red in the color buffer. + */ + PP_GRAPHICS3DATTRIB_RED_SIZE = 0x3024, + /** + * Bits of Z in the depth buffer. + */ + PP_GRAPHICS3DATTRIB_DEPTH_SIZE = 0x3025, + /** + * Bits of Stencil in the stencil buffer. + */ + PP_GRAPHICS3DATTRIB_STENCIL_SIZE = 0x3026, + /** + * Number of samples per pixel. + */ + PP_GRAPHICS3DATTRIB_SAMPLES = 0x3031, + /** + * Number of multisample buffers. + */ + PP_GRAPHICS3DATTRIB_SAMPLE_BUFFERS = 0x3032, + /** + * Attrib list terminator. + */ + PP_GRAPHICS3DATTRIB_NONE = 0x3038, + /** + * Height of surface in pixels. + */ + PP_GRAPHICS3DATTRIB_HEIGHT = 0x3056, + /** + * Width of surface in pixels. + */ + PP_GRAPHICS3DATTRIB_WIDTH = 0x3057, + /** + * Specifies the effect on the color buffer of posting a surface + * with SwapBuffers. The initial value is chosen by the implementation. + */ + PP_GRAPHICS3DATTRIB_SWAP_BEHAVIOR = 0x3093, + /** + * Indicates that color buffer contents are unaffected. + */ + PP_GRAPHICS3DATTRIB_BUFFER_PRESERVED = 0x3094, + /** + * Indicates that color buffer contents may be destroyed or changed. + */ + PP_GRAPHICS3DATTRIB_BUFFER_DESTROYED = 0x3095, + /** + * Specifies whether the context is intended to be low-power or + * high-performance. The initial value is + * PP_GRAPHICS3DATTRIB_GPU_PREFERENCE_PERFORMANCE. + */ + PP_GRAPHICS3DATTRIB_GPU_PREFERENCE = 0x11000, + /** + * The context should be low-power, and may be created on an integrated gpu. + */ + PP_GRAPHICS3DATTRIB_GPU_PREFERENCE_LOW_POWER = 0x11001, + /** + * The context may be high-power and may be created on a discrete gpu. + */ + PP_GRAPHICS3DATTRIB_GPU_PREFERENCE_PERFORMANCE = 0x11002 +}; diff --git a/browser/extensions/mortar/ppapi/api/pp_input_event.idl b/browser/extensions/mortar/ppapi/api/pp_input_event.idl new file mode 100644 index 000000000000..6a76cb4cce09 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/pp_input_event.idl @@ -0,0 +1,201 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the API used to handle mouse and keyboard input events. + */ + +/** + * The PP_InputEvent_Key struct represents a key up or key down + * event. + * + * Key up and key down events correspond to physical keys on the keyboard. The + * actual character that the user typed (if any) will be delivered in a + * "character" event. + * + * If the user loses focus on the module while a key is down, a key up + * event might not occur. For example, if the module has focus and the user + * presses and holds the shift key, the module will see a "shift down" message. + * Then if the user clicks elsewhere on the web page, the module's focus will + * be lost and no more input events will be delivered. + * + * If your module depends on receiving key up events, it should also handle + * "lost focus" as the equivalent of "all keys up." + */ +[assert_size(8)] +struct PP_InputEvent_Key { + /** This value is a bit field combination of the EVENT_MODIFIER flags. */ + uint32_t modifier; + + /** + * This value reflects the DOM KeyboardEvent keyCode field. + * Chrome populates this with the Windows-style Virtual Key code of the key. + */ + + uint32_t key_code; +}; + +/** + * The PP_InputEvent_Character struct represents a typed character + * event. + * + * Normally, the program will receive a key down event, followed by a character + * event, followed by a key up event. The character event will have any + * modifier keys applied. Obvious examples are symbols, where Shift-5 gives you + * a '%'. The key down and up events will give you the scan code for the "5" + * key, and the character event will give you the '%' character. + * + * You may not get a character event for all key down events if the key doesn't + * generate a character. Likewise, you may actually get multiple character + * events in a row. For example, some locales have an accent key that modifies + * the next character typed. You might get this stream of events: accent down, + * accent up (it didn't generate a character), letter key down, letter with + * accent character event (it was modified by the previous accent key), letter + * key up. If the letter can't be combined with the accent, like an umlaut and + * an 'R', the system might send umlaut down, umlaut up, 'R' key down, umlaut + * character (can't combine it with 'R', so just send the raw umlaut so it + * isn't lost"), 'R' character event, 'R' key up. + */ +[assert_size(12)] +struct PP_InputEvent_Character { + /** A combination of the PP_InputEvent_Modifier flags. */ + uint32_t modifier; + + /** + * This value represents the typed character as a single null-terminated UTF-8 + * character. Any unused bytes will be filled with null bytes. Since the + * maximum UTF-8 character is 4 bytes, there will always be at least one null + * at the end so you can treat this as a null-terminated UTF-8 string. + */ + int8_t[5] text; +}; + +/** + * The PP_InputEvent_Mouse struct represents all mouse events + * except mouse wheel events. + */ +[assert_size(20)] +struct PP_InputEvent_Mouse { + /** + * This value is a bit field combination of the + * PP_InputEvent_Modifier flags. + */ + uint32_t modifier; + + /** + * This value represents the button that changed for mouse down or up events. + * This value will be PP_EVENT_MOUSEBUTTON_NONE for mouse move, + * enter, and leave events. + */ + PP_InputEvent_MouseButton button; + + /** + * This values represents the x coordinate of the mouse when the event + * occurred. + * + * In most, but not all, cases these coordinates will just be integers. + * For example, the plugin element might be arbitrarily scaled or transformed + * in the DOM, and translating a mouse event into the coordinate space of the + * plugin will give non-integer values. + */ + float_t x; + /** + * This values represents the y coordinate of the mouse when the event + * occurred. + * + * In most, but not all, cases these coordinates will just be integers. + * For example, the plugin element might be arbitrarily scaled or transformed + * in the DOM, and translating a mouse event into the coordinate space of the + * plugin will give non-integer values. + */ + float_t y; + int32_t click_count; +}; + +/** + * The PP_InputEvent_Wheel struct represents all mouse wheel + * events. + */ +[assert_size(24)] struct PP_InputEvent_Wheel { + /** + * This value represents a combination of the EVENT_MODIFIER + * flags. + */ + uint32_t modifier; + + /** + * The mouse wheel's horizontal scroll amount. A scroll to the right + * (where the content moves left) is represented as positive values, + * and a scroll to the left (where the content moves right) is + * represented as negative values. + * + * The units are either in pixels (when scroll_by_page is false) or pages + * (when scroll_by_page is true). For example, delta_y = -3 means scroll up 3 + * pixels when scroll_by_page is false, and scroll up 3 pages when + * scroll_by_page is true. + * + * This amount is system dependent and will take into account the user's + * preferred scroll sensitivity and potentially also nonlinear acceleration + * based on the speed of the scrolling. + * + * Devices will be of varying resolution. Some mice with large detents will + * only generate integer scroll amounts. But fractional values are also + * possible, for example, on some trackpads and newer mice that don't have + * "clicks". + */ + float_t delta_x; + + /** + * The mouse wheel's vertical scroll amount. A scroll down (where the + * content moves up) is represented as positive values, and a scroll up + * (where the content moves down) is represented as negative values. + * + * The units are either in pixels (when scroll_by_page is false) or pages + * (when scroll_by_page is true). For example, delta_y = -3 means scroll up 3 + * pixels when scroll_by_page is false, and scroll up 3 pages when + * scroll_by_page is true. + * + * This amount is system dependent and will take into account the user's + * preferred scroll sensitivity and potentially also nonlinear acceleration + * based on the speed of the scrolling. + * + * Devices will be of varying resolution. Some mice with large detents will + * only generate integer scroll amounts. But fractional values are also + * possible, for example, on some trackpads and newer mice that don't have + * "clicks". + */ + float_t delta_y; + + /** + * The number of "clicks" of the scroll wheel that have produced the + * event. The value may have system-specific acceleration applied to it, + * depending on the device. The positive and negative meanings are the same + * as for delta_x and delta_y. + * + * If you are scrolling, you probably want to use the delta values above. + * These tick events can be useful if you aren't doing actual scrolling and + * don't want or pixel values. An example may be cycling between different + * items in a game. + * + * You may receive fractional values for the wheel ticks if the mouse wheel + * is high resolution or doesn't have "clicks". If your program wants + * discrete events (as in the "picking items" example) you should accumulate + * fractional click values from multiple messages until the total value + * reaches positive or negative one. This should represent a similar amount + * of scrolling as for a mouse that has a discrete mouse wheel. + */ + float_t wheel_ticks_x; + + /** This value represents */ + float_t wheel_ticks_y; + + /** + * Indicates if the scroll delta_x/delta_y + * indicates pages or lines to scroll by. When true, the user is requesting + * to scroll by pages. + */ + PP_Bool scroll_by_page; +}; + diff --git a/browser/extensions/mortar/ppapi/api/pp_instance.idl b/browser/extensions/mortar/ppapi/api/pp_instance.idl new file mode 100644 index 000000000000..569fb252ba4b --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/pp_instance.idl @@ -0,0 +1,21 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PP_Instance type which uniquely identifies one module + * instance. + */ + +/** + * The PP_Instance value uniquely identifies one instance of a + * module (.nexe/PP_Module). There will be one module instance for every + * \ tag on a page. + * + * This identifier is an opaque handle assigned by the browser to the module. + * It is guaranteed never to be 0, so a module can initialize it to 0 to + * indicate a "NULL handle." + */ +[assert_size(4)] typedef int32_t PP_Instance; + diff --git a/browser/extensions/mortar/ppapi/api/pp_macros.idl b/browser/extensions/mortar/ppapi/api/pp_macros.idl new file mode 100644 index 000000000000..9f02c2749853 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/pp_macros.idl @@ -0,0 +1,94 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * Defines the common macros such as assert, inline, ... + */ + +#inline c + +/* + * @addtogroup PP + * @{ + */ + +/* Use PP_INLINE to tell the compiler to inline functions. The main purpose of + * inline functions in ppapi is to allow us to define convenience functions in + * the ppapi header files, without requiring clients or implementers to link a + * PPAPI C library. The "inline" keyword is not supported by pre-C99 C + * compilers (such as MS Visual Studio 2008 and older versions of GCC). MSVS + * supports __forceinline and GCC supports __inline__. Use of the static + * keyword ensures (in C) that the function is not compiled on its own, which + * could cause multiple definition errors. + * http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx + * http://gcc.gnu.org/onlinedocs/gcc/Inline.html + */ +#if defined(__cplusplus) +/* The inline keyword is part of C++ and guarantees we won't get multiple + * definition errors. + */ +# define PP_INLINE inline +#else +# if defined(_MSC_VER) +# define PP_INLINE static __forceinline +# else +# define PP_INLINE static __inline__ +# endif +#endif + +/* This is a compile-time assertion useful for ensuring that a given type is + a given number of bytes wide. The size of the array is designed to be 1 + (which should always be valid) if the enum's size is SIZE, and otherwise the + size of the array will be -1 (which all/most compilers should flag as an + error). This is wrapped inside a struct, because if it is a simple global + we get multiple definition errors at link time. + + NAME is the name of the type without any spaces or the struct or enum + keywords. + + CTYPENAME is the typename required by C. I.e., for a struct or enum, the + appropriate keyword must be included. + + SIZE is the expected size in bytes. + */ +#define PP_COMPILE_ASSERT_SIZE_IN_BYTES_IMPL(NAME, CTYPENAME, SIZE) \ +struct PP_Dummy_Struct_For_##NAME { \ +char _COMPILE_ASSERT_FAILED_The_type_named_ \ +## NAME ## _is_not_ ## SIZE ## \ +_bytes_wide[(sizeof(CTYPENAME) == SIZE) ? 1 : -1]; } + +/* PP_COMPILE_ASSERT_SIZE_IN_BYTES is for typenames that contain no spaces. + E.g.: + PP_COMPILE_ASSERT_SIZE_IN_BYTES(int, 4); + typedef struct { int a; } Foo; + PP_COMPILE_ASSERT_SIZE_IN_BYTES(Foo, 4); + */ +#define PP_COMPILE_ASSERT_SIZE_IN_BYTES(NAME, SIZE) \ +PP_COMPILE_ASSERT_SIZE_IN_BYTES_IMPL(NAME, NAME, SIZE) + +/* PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES is for typenames that contain 'struct' + in C. That is, struct names that are not typedefs. + E.g.: + struct Foo { int a; }; + PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(Foo, 4); + */ +#define PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(NAME, SIZE) \ +PP_COMPILE_ASSERT_SIZE_IN_BYTES_IMPL(NAME, struct NAME, SIZE) + +/* PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES is for typenames that contain 'enum' + in C. That is, enum names that are not typedefs. + E.g.: + enum Bar { A = 0, B = 1 }; + PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(Foo, 4); + */ +#define PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(NAME, SIZE) \ +PP_COMPILE_ASSERT_SIZE_IN_BYTES_IMPL(NAME, enum NAME, SIZE) + +/** + * @} + * End of addtogroup PP + */ + +#endinl diff --git a/browser/extensions/mortar/ppapi/api/pp_module.idl b/browser/extensions/mortar/ppapi/api/pp_module.idl new file mode 100644 index 000000000000..d96d60a76ab3 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/pp_module.idl @@ -0,0 +1,20 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PP_Module type which uniquely identifies the module + * or .nexe. + */ + +/** + * The PP_Module value uniquely identifies the module or .nexe. + * + * This identifier is an opaque handle assigned by the browser to the module. It + * is guaranteed never to be 0, so a module can initialize it to 0 to + * indicate a "NULL handle." + */ +[assert_size(4)] +typedef int32_t PP_Module; + diff --git a/browser/extensions/mortar/ppapi/api/pp_point.idl b/browser/extensions/mortar/ppapi/api/pp_point.idl new file mode 100644 index 000000000000..7be466f0ef0d --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/pp_point.idl @@ -0,0 +1,74 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the API to create a 2 dimensional point. + * 0,0 is the upper-left starting coordinate. + */ + +/** + * The PP_Point structure defines the integer x and y coordinates of a point. + */ +[assert_size(8), returnByValue] +struct PP_Point { + /** + * This value represents the horizontal coordinate of a point, starting with 0 + * as the left-most coordinate. + */ + int32_t x; + + /** + * This value represents the vertical coordinate of a point, starting with 0 + * as the top-most coordinate. + */ + int32_t y; +}; + +/** + * The PP_FloatPoint structure defines the floating-point x and y coordinates + * of a point. + */ +[assert_size(8), returnByValue] +struct PP_FloatPoint { + float_t x; + float_t y; +}; + +#inline c +/** + * @addtogroup Functions + * @{ + */ + +/** + * PP_MakePoint() creates a PP_Point given the x and y coordinates + * as int32_t values. + * + * @param[in] x An int32_t value representing a horizontal coordinate of a + * point, starting with 0 as the left-most coordinate. + * @param[in] y An int32_t value representing a vertical coordinate of a point, + * starting with 0 as the top-most coordinate. + * + * @return A PP_Point structure. + */ +PP_INLINE struct PP_Point PP_MakePoint(int32_t x, int32_t y) { + struct PP_Point ret; + ret.x = x; + ret.y = y; + return ret; +} + +PP_INLINE struct PP_FloatPoint PP_MakeFloatPoint(float x, float y) { + struct PP_FloatPoint ret; + ret.x = x; + ret.y = y; + return ret; +} +/** + * @} + */ + +#endinl + diff --git a/browser/extensions/mortar/ppapi/api/pp_rect.idl b/browser/extensions/mortar/ppapi/api/pp_rect.idl new file mode 100644 index 000000000000..b83e3cdb5a1a --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/pp_rect.idl @@ -0,0 +1,99 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the APIs for creating a 2 dimensional rectangle. + */ + +/** + * The PP_Rect struct contains the size and location of a 2D + * rectangle. + */ +[assert_size(16)] +struct PP_Rect { + /** + * This value represents the x and y coordinates of the upper-left corner of + * the rectangle. + */ + PP_Point point; + + /** This value represents the width and height of the rectangle. */ + PP_Size size; +}; + +/** + * The PP_FloatRect struct contains the size and location of a 2D + * rectangle. + */ +struct PP_FloatRect { + /** + * This value represents the x and y coordinates of the upper-left corner of + * the rectangle. + */ + PP_FloatPoint point; + + /** This value represents the width and height of the rectangle. */ + PP_FloatSize size; +}; + +#inline c + +/** + * @addtogroup Functions + * @{ + */ + +/** + * PP_MakeRectFromXYWH() creates a PP_Rect given x and y + * coordinates and width and height dimensions as int32_t values. + * + * @param[in] x An int32_t value representing a horizontal coordinate of a + * point, starting with 0 as the left-most coordinate. + * @param[in] y An int32_t value representing a vertical coordinate of a point, + * starting with 0 as the top-most coordinate. + * @param[in] w An int32_t value representing a width. + * @param[in] h An int32_t value representing a height. + * + * @return A PP_Rect structure. + */ +PP_INLINE struct PP_Rect PP_MakeRectFromXYWH(int32_t x, int32_t y, + int32_t w, int32_t h) { + struct PP_Rect ret; + ret.point.x = x; + ret.point.y = y; + ret.size.width = w; + ret.size.height = h; + return ret; +} + +/** + * PP_MakeFloatRectFromXYWH() creates a PP_FloatRect given x and y + * coordinates and width and height dimensions as float values. + * + * @param[in] x An float value representing a horizontal coordinate of a + * point, starting with 0 as the left-most coordinate. + * @param[in] y An float value representing a vertical coordinate of a point, + * starting with 0 as the top-most coordinate. + * @param[in] w An float value representing a width. + * @param[in] h An float value representing a height. + * + * @return A PP_FloatRect structure. + */ +PP_INLINE struct PP_FloatRect PP_MakeFloatRectFromXYWH(float x, float y, + float w, float h) { + struct PP_FloatRect ret; + ret.point.x = x; + ret.point.y = y; + ret.size.width = w; + ret.size.height = h; + return ret; +} + +/** + * @} + */ + +#endinl + diff --git a/browser/extensions/mortar/ppapi/api/pp_resource.idl b/browser/extensions/mortar/ppapi/api/pp_resource.idl new file mode 100644 index 000000000000..7f09d29db99e --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/pp_resource.idl @@ -0,0 +1,27 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PP_Resource type which represents data + * associated with the module. + */ + +/** + * This typedef represents an opaque handle assigned by the browser to the + * resource. The handle is guaranteed never to be 0 for a valid resource, so a + * module can initialize it to 0 to indicate a "NULL handle." Some interfaces + * may return a NULL resource to indicate failure. + * + * While a Var represents something callable to JS or from the module to + * the DOM, a resource has no meaning or visibility outside of the module + * interface. + * + * Resources are reference counted. Use AddRefResource() + * and ReleaseResource() in ppb_core.h to manage the + * reference count of a resource. The data will be automatically destroyed when + * the internal reference count reaches 0. + */ +[assert_size(4)] typedef int32_t PP_Resource; + diff --git a/browser/extensions/mortar/ppapi/api/pp_size.idl b/browser/extensions/mortar/ppapi/api/pp_size.idl new file mode 100644 index 000000000000..e320fadee61c --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/pp_size.idl @@ -0,0 +1,72 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the width and height of a 2D rectangle. + */ + +/** + * The PP_Size struct contains the size of a 2D rectangle. + */ +[assert_size(8)] +struct PP_Size { + /** This value represents the width of the rectangle. */ + int32_t width; + /** This value represents the height of the rectangle. */ + int32_t height; +}; + +/** + * The PP_FloatSize struct contains the size of a 2D rectangle. + */ +struct PP_FloatSize { + /** This value represents the width of the rectangle. */ + float_t width; + /** This value represents the height of the rectangle. */ + float_t height; +}; + +#inline c +/** + * @addtogroup Functions + * @{ + */ + +/** + * PP_MakeSize() creates a PP_Size given a width and height as + * int32_t values. + * + * @param[in] w An int32_t value representing a width. + * @param[in] h An int32_t value representing a height. + * + * @return A PP_Size structure. + */ +PP_INLINE struct PP_Size PP_MakeSize(int32_t w, int32_t h) { + struct PP_Size ret; + ret.width = w; + ret.height = h; + return ret; +} + +/** + * PP_MakeFloatSize() creates a PP_FloatSize given a + * width and height as float values. + * + * @param[in] w An float value representing a width. + * @param[in] h An float value representing a height. + * + * @return A PP_FloatSize structure. + */ +PP_INLINE struct PP_FloatSize PP_MakeFloatSize(float w, float h) { + struct PP_FloatSize ret; + ret.width = w; + ret.height = h; + return ret; +} +/** + * @} + */ +#endinl + diff --git a/browser/extensions/mortar/ppapi/api/pp_stdint.idl b/browser/extensions/mortar/ppapi/api/pp_stdint.idl new file mode 100644 index 000000000000..9f54d63bad31 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/pp_stdint.idl @@ -0,0 +1,100 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file provides a definition of C99 sized types + * for Microsoft compilers. These definitions only apply + * for trusted modules. + */ + +label Chrome { + M13 = 0.0 +}; + +[version=0.0] +describe { + /** Standard Ints. */ + int8_t; + int16_t; + int32_t; + int64_t; + uint8_t; + uint16_t; + uint32_t; + uint64_t; + /** Small and large floats. */ + double_t; + float_t; + + /** Native file handle (int). */ + handle_t; + + /** Interface object (void *). */ + interface_t; + + /** Used for padding, should be (u)int8_t */ + char; + + /** Pointer to memory (void *). */ + mem_t; + + /** Pointer to pointer to memory (void **). */ + mem_ptr_t; + + /** Pointer to null terminated string (char *). */ + str_t; + + /** Pointer to constant null terminated string (const char *). */ + cstr_t; + + /** No return value. */ + void; + + /** Platform-specific file handle */ + PP_FileHandle; +}; + +#inline c + +/** + * + * @addtogroup Typedefs + * @{ + */ +#if defined(_MSC_VER) + +/** This value represents a guaranteed unsigned 8 bit integer. */ +typedef unsigned char uint8_t; + +/** This value represents a guaranteed signed 8 bit integer. */ +typedef signed char int8_t; + +/** This value represents a guaranteed unsigned 16 bit short. */ +typedef unsigned short uint16_t; + +/** This value represents a guaranteed signed 16 bit short. */ +typedef short int16_t; + +/** This value represents a guaranteed unsigned 32 bit integer. */ +typedef unsigned int uint32_t; + +/** This value represents a guaranteed signed 32 bit integer. */ +typedef int int32_t; + +/** This value represents a guaranteed signed 64 bit integer. */ +typedef __int64 int64_t; + +/** This value represents a guaranteed unsigned 64 bit integer. */ +typedef unsigned __int64 uint64_t; + +#else +#include +#endif +/** + * @} + */ + +#endinl + diff --git a/browser/extensions/mortar/ppapi/api/pp_time.idl b/browser/extensions/mortar/ppapi/api/pp_time.idl new file mode 100644 index 000000000000..fdcac59be40b --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/pp_time.idl @@ -0,0 +1,37 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines time, time ticks and time delta types. + */ + + +/** + * The PP_Time type represents the "wall clock time" according + * to the browser and is defined as the number of seconds since the Epoch + * (00:00:00 UTC, January 1, 1970). + */ +[assert_size(8)] +typedef double_t PP_Time; + +/** + * A PP_TimeTicks value represents time ticks which are measured + * in seconds and are used for indicating the time that certain messages were + * received. In contrast to PP_Time, PP_TimeTicks + * does not correspond to any actual wall clock time and will not change + * discontinuously if the user changes their computer clock. + * + * The units are in seconds, but are not measured relative to any particular + * epoch, so the most you can do is compare two values. + */ +[assert_size(8)] +typedef double_t PP_TimeTicks; + +/** + * A PP_TimeDelta value represents a duration of time which is + * measured in seconds. + */ +[assert_size(8)] +typedef double_t PP_TimeDelta; diff --git a/browser/extensions/mortar/ppapi/api/pp_touch_point.idl b/browser/extensions/mortar/ppapi/api/pp_touch_point.idl new file mode 100644 index 000000000000..42c08097df2f --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/pp_touch_point.idl @@ -0,0 +1,74 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + + +/** + * This file defines the API to create a touch point or position where fingers + * makes contact with touch screen device. + */ + +/** + * The PP_TouchPoint struct represents all information about a + * single touch point, such as position, id, rotation angle, and pressure. + */ +[assert_size(28), returnByValue] +struct PP_TouchPoint { + /** + * This value represents the identifier for this TouchPoint. The id + * corresponds to the order in which the points were pressed. For example, + * the first point to be pressed has an id of 0, the second has an id of 1, + * and so on. An id can be reused when a touch point is released. For + * example, if two fingers are down, with id 0 and 1, and finger 0 releases, + * the next finger to be pressed can be assigned to id 0. + */ + uint32_t id; + + /** + * This value represents the x and y pixel position of this TouchPoint + * relative to the upper-left of the module instance receiving the event. + */ + PP_FloatPoint position; + + /** + * This value represents the elliptical radii, in screen pixels, in the x + * and y direction of this TouchPoint. + */ + PP_FloatPoint radius; + + /** + * This value represents the angle of rotation in degrees of the elliptical + * model of this TouchPoint clockwise from "up." + */ + float_t rotation_angle; + + /** + * This value represents the pressure applied to this TouchPoint. This value + * is typically between 0 and 1, with 0 indicating no pressure and 1 + * indicating some maximum pressure. Scaling differs depending on the + * hardware and the value is not guaranteed to stay within that range. + */ + float_t pressure; +}; + +#inline c +/** + * @addtogroup Functions + * @{ + */ + +/** + * PP_MakeTouchPoint() creates a PP_TouchPoint. + * + * @return A PP_TouchPoint structure. + */ +PP_INLINE struct PP_TouchPoint PP_MakeTouchPoint(void) { + struct PP_TouchPoint result = { 0, {0, 0}, {0, 0}, 0, 0 }; + return result; +} +/** + * @} + */ + +#endinl diff --git a/browser/extensions/mortar/ppapi/api/pp_var.idl b/browser/extensions/mortar/ppapi/api/pp_var.idl new file mode 100644 index 000000000000..545585d14ea8 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/pp_var.idl @@ -0,0 +1,254 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the API for handling the passing of data types between + * your module and the page. + */ + +/** + * The PP_VarType is an enumeration of the different types that + * can be contained within a PP_Var structure. + */ +[assert_size(4)] +enum PP_VarType { + /** + * An undefined value. + */ + PP_VARTYPE_UNDEFINED = 0, + + /** + * A NULL value. This is similar to undefined, but JavaScript differentiates + * the two so it is exposed here as well. + */ + PP_VARTYPE_NULL = 1, + + /** + * A boolean value, use the as_bool member of the var. + */ + PP_VARTYPE_BOOL = 2, + + /** + * A 32-bit integer value. Use the as_int member of the var. + */ + PP_VARTYPE_INT32 = 3, + + /** + * A double-precision floating point value. Use the as_double + * member of the var. + */ + PP_VARTYPE_DOUBLE = 4, + + /** + * The Var represents a string. The as_id field is used to + * identify the string, which may be created and retrieved from the + * PPB_Var interface. These objects are reference counted, so + * AddRef() and Release() must be used properly to avoid memory leaks. + */ + PP_VARTYPE_STRING = 5, + + /** + * Represents a JavaScript object. This vartype is not currently usable + * from modules, although it is used internally for some tasks. These objects + * are reference counted, so AddRef() and Release() must be used properly to + * avoid memory leaks. + */ + PP_VARTYPE_OBJECT = 6, + + /** + * Represents an array of Vars. The as_id field is used to + * identify the array, which may be created and manipulated from the + * PPB_VarArray interface. These objects are reference counted, + * so AddRef() and Release() must be used properly to avoid memory leaks. + */ + PP_VARTYPE_ARRAY = 7, + + /** + * Represents a mapping from strings to Vars. The as_id field is + * used to identify the dictionary, which may be created and manipulated from + * the PPB_VarDictionary interface. These objects are reference + * counted, so AddRef() and Release() must be used properly to avoid memory + * leaks. + */ + PP_VARTYPE_DICTIONARY = 8, + + /** + * ArrayBuffer represents a JavaScript ArrayBuffer. This is the type which + * represents Typed Arrays in JavaScript. Unlike JavaScript 'Array', it is + * only meant to contain basic numeric types, and is always stored + * contiguously. See PPB_VarArrayBuffer_Dev for functions special to + * ArrayBuffer vars. These objects are reference counted, so AddRef() and + * Release() must be used properly to avoid memory leaks. + */ + PP_VARTYPE_ARRAY_BUFFER = 9, + + /** + * This type allows the PP_Var to wrap a PP_Resource + * . This can be useful for sending or receiving some types of + * PP_Resource using PPB_Messaging or + * PPP_Messaging. + * + * These objects are reference counted, so AddRef() and Release() must be used + * properly to avoid memory leaks. Under normal circumstances, the + * PP_Var will implicitly hold a reference count on the + * PP_Resource on your behalf. For example, if you call + * VarFromResource(), it implicitly calls PPB_Core::AddRefResource() on the + * PP_Resource. Likewise, PPB_Var::Release() on a Resource + * PP_Var will invoke PPB_Core::ReleaseResource() when the Var + * reference count goes to zero. + */ + PP_VARTYPE_RESOURCE = 10 +}; + + +/** + * The PP_VarValue union stores the data for any one of the types listed + * in the PP_VarType enum. + */ +[union] struct PP_VarValue { + /** + * If type is PP_VARTYPE_BOOL, + * as_bool represents the value of this PP_Var as + * PP_Bool. + */ + PP_Bool as_bool; + + /** + * If type is PP_VARTYPE_INT32, + * as_int represents the value of this PP_Var as + * int32_t. + */ + int32_t as_int; + + /** + * If type is PP_VARTYPE_DOUBLE, + * as_double represents the value of this PP_Var + * as double. + */ + double_t as_double; + + /** + * If type is PP_VARTYPE_STRING, + * PP_VARTYPE_OBJECT, PP_VARTYPE_ARRAY, + * PP_VARTYPE_DICTIONARY, PP_VARTYPE_ARRAY_BUFFER, + * or PP_VARTYPE_RESOURCE, as_id represents the + * value of this PP_Var as an opaque handle assigned by the + * browser. This handle is guaranteed never to be 0, so a module can + * initialize this ID to 0 to indicate a "NULL handle." + */ + int64_t as_id; +}; + +/** + * The PP_VAR struct is a variant data type and can contain any + * value of one of the types named in the PP_VarType enum. This + * structure is for passing data between native code which can be strongly + * typed and the browser (JavaScript) which isn't strongly typed. + * + * JavaScript has a "number" type for holding a number, and does not + * differentiate between floating point and integer numbers. The + * JavaScript operations will try to optimize operations by using + * integers when possible, but could end up with doubles. Therefore, + * you can't assume a numeric PP_Var will be the type you expect. + * Your code should be capable of handling either int32_t or double for numeric + * PP_Vars sent from JavaScript. + */ +[passByValue, returnByValue, assert_size(16)] +struct PP_Var { + PP_VarType type; + + /** + * The padding ensures value is aligned on an + * 8-byte boundary relative to the start of the struct. Some compilers + * align doubles on 8-byte boundaries for 32-bit x86, and some align on + * 4-byte boundaries. + */ + int32_t padding; + + /** + * This value represents the contents of the PP_Var. Only one of + * the fields of value is valid at a time based upon + * type. + */ + PP_VarValue value; +}; + + +#inline c +/** + * @addtogroup Functions + * @{ + */ + +/** + * PP_MakeUndefined() is used to wrap an undefined value into a + * PP_Var struct for passing to the browser. + * + * @return A PP_Var structure. + */ +PP_INLINE struct PP_Var PP_MakeUndefined(void) { + struct PP_Var result = { PP_VARTYPE_UNDEFINED, 0, {PP_FALSE} }; + return result; +} + +/** + * PP_MakeNull() is used to wrap a null value into a + * PP_Var struct for passing to the browser. + * + * @return A PP_Var structure, + */ +PP_INLINE struct PP_Var PP_MakeNull(void) { + struct PP_Var result = { PP_VARTYPE_NULL, 0, {PP_FALSE} }; + return result; +} + +/** + * PP_MakeBool() is used to wrap a boolean value into a + * PP_Var struct for passing to the browser. + * + * @param[in] value A PP_Bool enumeration to + * wrap. + * + * @return A PP_Var structure. + */ +PP_INLINE struct PP_Var PP_MakeBool(PP_Bool value) { + struct PP_Var result = { PP_VARTYPE_BOOL, 0, {PP_FALSE} }; + result.value.as_bool = value; + return result; +} + +/** + * PP_MakeInt32() is used to wrap a 32 bit integer value + * into a PP_Var struct for passing to the browser. + * + * @param[in] value An int32 to wrap. + * + * @return A PP_Var structure. + */ +PP_INLINE struct PP_Var PP_MakeInt32(int32_t value) { + struct PP_Var result = { PP_VARTYPE_INT32, 0, {PP_FALSE} }; + result.value.as_int = value; + return result; +} + +/** + * PP_MakeDouble() is used to wrap a double value into a + * PP_Var struct for passing to the browser. + * + * @param[in] value A double to wrap. + * + * @return A PP_Var structure. + */ +PP_INLINE struct PP_Var PP_MakeDouble(double value) { + struct PP_Var result = { PP_VARTYPE_DOUBLE, 0, {PP_FALSE} }; + result.value.as_double = value; + return result; +} +/** + * @} + */ + +#endinl + diff --git a/browser/extensions/mortar/ppapi/api/ppb.idl b/browser/extensions/mortar/ppapi/api/ppb.idl new file mode 100644 index 000000000000..76d80b31900b --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb.idl @@ -0,0 +1,29 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines a function pointer type for the + * PPB_GetInterface function. + */ + +/** + * This function pointer type defines the signature for the + * PPB_GetInterface function. A generic + * PPB_GetInterface pointer is passed to + * PPP_InitializedModule when your module is loaded. You can use + * this pointer to request a pointer to a specific browser interface. Browser + * interface names are ASCII strings and are generally defined in the header + * file for the interface, such as PPB_AUDIO_INTERFACE found in + * ppb.audio.h or + * PPB_GRAPHICS_2D_INTERFACE in ppb_graphics_2d.h. + * Click + * here for a complete list of interface + * names. + * + * This value will be NULL if the interface is not supported on the browser. + */ +typedef interface_t PPB_GetInterface([in] str_t interface_name); + diff --git a/browser/extensions/mortar/ppapi/api/ppb_audio.idl b/browser/extensions/mortar/ppapi/api/ppb_audio.idl new file mode 100644 index 000000000000..d79ca97739ef --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_audio.idl @@ -0,0 +1,153 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_Audio interface, which provides + * realtime stereo audio streaming capabilities. + */ + +label Chrome { + M14 = 1.0, + M31 = 1.1 +}; + +/** + * PPB_Audio_Callback defines the type of an audio callback + * function used to fill the audio buffer with data. Please see the + * Create() function in the PPB_Audio interface for + * more details on this callback. + * + * @param[in] sample_buffer A buffer to fill with audio data. + * @param[in] buffer_size_in_bytes The size of the buffer in bytes. + * @param[in] latency How long before the audio data is to be presented. + * @param[inout] user_data An opaque pointer that was passed into + * PPB_Audio.Create(). + */ +typedef void PPB_Audio_Callback([out] mem_t sample_buffer, + [in] uint32_t buffer_size_in_bytes, + [in, version=1.1] PP_TimeDelta latency, + [inout] mem_t user_data); + +/** + * The PPB_Audio interface contains pointers to several functions + * for handling audio resources. Refer to the + * Audio + * chapter in the Developer's Guide for information on using this interface. + * Please see descriptions for each PPB_Audio and + * PPB_AudioConfig function for more details. A C example using + * PPB_Audio and PPB_AudioConfig follows. + * + * Example: + * + * @code + * void audio_callback(void* sample_buffer, + * uint32_t buffer_size_in_bytes, + * void* user_data) { + * ... quickly fill in the buffer with samples and return to caller ... + * } + * + * ...Assume the application has cached the audio configuration interface in + * audio_config_interface and the audio interface in + * audio_interface... + * + * uint32_t count = audio_config_interface->RecommendSampleFrameCount( + * PP_AUDIOSAMPLERATE_44100, 4096); + * PP_Resource pp_audio_config = audio_config_interface->CreateStereo16Bit( + * pp_instance, PP_AUDIOSAMPLERATE_44100, count); + * PP_Resource pp_audio = audio_interface->Create(pp_instance, pp_audio_config, + * audio_callback, NULL); + * audio_interface->StartPlayback(pp_audio); + * + * ...audio_callback() will now be periodically invoked on a separate thread... + * @endcode + */ +interface PPB_Audio { + /** + * Create() creates an audio resource. No sound will be heard until + * StartPlayback() is called. The callback is called with the buffer address + * and given user data whenever the buffer needs to be filled. From within the + * callback, you should not call PPB_Audio functions. The + * callback will be called on a different thread than the one which created + * the interface. For performance-critical applications (i.e. low-latency + * audio), the callback should avoid blocking or calling functions that can + * obtain locks, such as malloc. The layout and the size of the buffer passed + * to the audio callback will be determined by the device configuration and is + * specified in the AudioConfig documentation. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * @param[in] config A PP_Resource corresponding to an audio + * config resource. + * @param[in] audio_callback A PPB_Audio_Callback callback + * function that the browser calls when it needs more samples to play. + * @param[in] user_data A pointer to user data used in the callback function. + * + * @return A PP_Resource containing the audio resource if + * successful or 0 if the configuration cannot be honored or the callback is + * null. + */ + PP_Resource Create( + [in] PP_Instance instance, + [in] PP_Resource config, + [in] PPB_Audio_Callback audio_callback, + [inout] mem_t user_data); + + /** + * IsAudio() determines if the provided resource is an audio resource. + * + * @param[in] resource A PP_Resource corresponding to a generic + * resource. + * + * @return A PP_Bool containing containing PP_TRUE + * if the given resource is an Audio resource, otherwise + * PP_FALSE. + */ + PP_Bool IsAudio( + [in] PP_Resource resource); + + /** + * GetCurrrentConfig() returns an audio config resource for the given audio + * resource. + * + * @param[in] config A PP_Resource corresponding to an audio + * resource. + * + * @return A PP_Resource containing the audio config resource if + * successful. + */ + PP_Resource GetCurrentConfig( + [in] PP_Resource audio); + + /** + * StartPlayback() starts the playback of the audio resource and begins + * periodically calling the callback. + * + * @param[in] config A PP_Resource corresponding to an audio + * resource. + * + * @return A PP_Bool containing PP_TRUE if + * successful, otherwise PP_FALSE. Also returns + * PP_TRUE (and be a no-op) if called while playback is already + * in progress. + */ + PP_Bool StartPlayback( + [in] PP_Resource audio); + + /** + * StopPlayback() stops the playback of the audio resource. + * + * @param[in] config A PP_Resource corresponding to an audio + * resource. + * + * @return A PP_Bool containing PP_TRUE if + * successful, otherwise PP_FALSE. Also returns + * PP_TRUE (and is a no-op) if called while playback is already + * stopped. If a callback is in progress, StopPlayback() will block until the + * callback completes. + */ + PP_Bool StopPlayback( + [in] PP_Resource audio); +}; + diff --git a/browser/extensions/mortar/ppapi/api/ppb_audio_buffer.idl b/browser/extensions/mortar/ppapi/api/ppb_audio_buffer.idl new file mode 100644 index 000000000000..8640f00dd1f0 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_audio_buffer.idl @@ -0,0 +1,140 @@ +/* Copyright 2014 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * Defines the PPB_AudioBuffer interface. + */ + +[generate_thunk] + +label Chrome { + [channel=dev] M34 = 0.1, + M35 = 0.1 +}; + +/** + * PP_AudioBuffer_SampleRate is an enumeration of the different audio sample + * rates. + */ +enum PP_AudioBuffer_SampleRate { + PP_AUDIOBUFFER_SAMPLERATE_UNKNOWN = 0, + PP_AUDIOBUFFER_SAMPLERATE_8000 = 8000, + PP_AUDIOBUFFER_SAMPLERATE_16000 = 16000, + PP_AUDIOBUFFER_SAMPLERATE_22050 = 22050, + PP_AUDIOBUFFER_SAMPLERATE_32000 = 32000, + PP_AUDIOBUFFER_SAMPLERATE_44100 = 44100, + PP_AUDIOBUFFER_SAMPLERATE_48000 = 48000, + PP_AUDIOBUFFER_SAMPLERATE_96000 = 96000, + PP_AUDIOBUFFER_SAMPLERATE_192000 = 192000 +}; + +/** + * PP_AudioBuffer_SampleSize is an enumeration of the different audio sample + * sizes. + */ +enum PP_AudioBuffer_SampleSize { + PP_AUDIOBUFFER_SAMPLESIZE_UNKNOWN = 0, + PP_AUDIOBUFFER_SAMPLESIZE_16_BITS = 2 +}; + +[version=0.1] +interface PPB_AudioBuffer { + /** + * Determines if a resource is an AudioBuffer resource. + * + * @param[in] resource The PP_Resource to test. + * + * @return A PP_Bool with PP_TRUE if the given + * resource is an AudioBuffer resource or PP_FALSE otherwise. + */ + PP_Bool IsAudioBuffer([in] PP_Resource resource); + + /** + * Gets the timestamp of the audio buffer. + * + * @param[in] buffer A PP_Resource corresponding to an audio + * buffer resource. + * + * @return A PP_TimeDelta containing the timestamp of the audio + * buffer. Given in seconds since the start of the containing audio stream. + */ + [on_failure=0.0] + PP_TimeDelta GetTimestamp([in] PP_Resource buffer); + + /** + * Sets the timestamp of the audio buffer. + * + * @param[in] buffer A PP_Resource corresponding to an audio + * buffer resource. + * @param[in] timestamp A PP_TimeDelta containing the timestamp + * of the audio buffer. Given in seconds since the start of the containing + * audio stream. + */ + void SetTimestamp([in] PP_Resource buffer, [in] PP_TimeDelta timestamp); + + /** + * Gets the sample rate of the audio buffer. + * + * @param[in] buffer A PP_Resource corresponding to an audio + * buffer resource. + * + * @return The sample rate of the audio buffer. + */ + [on_failure=PP_AUDIOBUFFER_SAMPLERATE_UNKNOWN] + PP_AudioBuffer_SampleRate GetSampleRate([in] PP_Resource buffer); + + /** + * Gets the sample size of the audio buffer. + * + * @param[in] buffer A PP_Resource corresponding to an audio + * buffer resource. + * + * @return The sample size of the audio buffer. + */ + [on_failure=PP_AUDIOBUFFER_SAMPLESIZE_UNKNOWN] + PP_AudioBuffer_SampleSize GetSampleSize([in] PP_Resource buffer); + + /** + * Gets the number of channels in the audio buffer. + * + * @param[in] buffer A PP_Resource corresponding to an audio + * buffer resource. + * + * @return The number of channels in the audio buffer. + */ + uint32_t GetNumberOfChannels([in] PP_Resource buffer); + + /** + * Gets the number of samples in the audio buffer. + * + * @param[in] buffer A PP_Resource corresponding to an audio + * buffer resource. + * + * @return The number of samples in the audio buffer. + * For example, at a sampling rate of 44,100 Hz in stereo audio, a buffer + * containing 4410 * 2 samples would have a duration of 100 milliseconds. + */ + uint32_t GetNumberOfSamples([in] PP_Resource buffer); + + /** + * Gets the data buffer containing the audio samples. + * + * @param[in] buffer A PP_Resource corresponding to an audio + * buffer resource. + * + * @return A pointer to the beginning of the data buffer. + */ + mem_t GetDataBuffer([in] PP_Resource buffer); + + /** + * Gets the size of the data buffer in bytes. + * + * @param[in] buffer A PP_Resource corresponding to an audio + * buffer resource. + * + * @return The size of the data buffer in bytes. + */ + uint32_t GetDataBufferSize([in] PP_Resource buffer); +}; diff --git a/browser/extensions/mortar/ppapi/api/ppb_audio_config.idl b/browser/extensions/mortar/ppapi/api/ppb_audio_config.idl new file mode 100644 index 000000000000..fd4cef4fe05a --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_audio_config.idl @@ -0,0 +1,216 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_AudioConfig interface for establishing an + * audio configuration resource within the browser. + */ + +label Chrome { + M14 = 1.0, + M19 = 1.1 +}; + +/** + * This enumeration contains audio frame count constants. + * PP_AUDIOMINSAMPLEFRAMECOUNT is the minimum possible frame + * count. PP_AUDIOMAXSAMPLEFRAMECOUNT is the maximum possible + * frame count. + */ +[unnamed] enum PP_AudioFrameSize { + PP_AUDIOMINSAMPLEFRAMECOUNT = 64, + PP_AUDIOMAXSAMPLEFRAMECOUNT = 32768 +}; + + +/** + * PP_AudioSampleRate is an enumeration of the different audio sampling rates. + * PP_AUDIOSAMPLERATE_44100 is the sample rate used on CDs and + * PP_AUDIOSAMPLERATE_48000 is the sample rate used on DVDs and + * Digital Audio Tapes. + */ +[assert_size(4)] +enum PP_AudioSampleRate { + PP_AUDIOSAMPLERATE_NONE = 0, + PP_AUDIOSAMPLERATE_44100 = 44100, + PP_AUDIOSAMPLERATE_48000 = 48000 +} ; + + +/** + * The PPB_AudioConfig interface contains pointers to several + * functions for establishing your audio configuration within the browser. + * This interface only supports 16-bit stereo output. + * + * Refer to the + * Audio + * chapter in the Developer's Guide for information on using this + * interface. + */ +[macro="PPB_AUDIO_CONFIG_INTERFACE"] +interface PPB_AudioConfig { + /** + * CreateStereo16bit() creates a 16 bit audio configuration resource. The + * sample_rate should be the result of calling + * RecommendSampleRate and sample_frame_count should + * be the result of calling RecommendSampleFrameCount. If the + * sample frame count or bit rate isn't supported, this function will fail and + * return a null resource. + * + * A single sample frame on a stereo device means one value for the left + * channel and one value for the right channel. + * + * Buffer layout for a stereo int16 configuration: + * int16_t *buffer16; + * buffer16[0] is the first left channel sample. + * buffer16[1] is the first right channel sample. + * buffer16[2] is the second left channel sample. + * buffer16[3] is the second right channel sample. + * ... + * buffer16[2 * (sample_frame_count - 1)] is the last left + * channel sample. + * buffer16[2 * (sample_frame_count - 1) + 1] is the last + * right channel sample. + * Data will always be in the native endian format of the platform. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * @param[in] sample_rate A PP_AudioSampleRate which is either + * PP_AUDIOSAMPLERATE_44100 or + * PP_AUDIOSAMPLERATE_48000. + * @param[in] sample_frame_count A uint32_t frame count returned + * from the RecommendSampleFrameCount function. + * + * @return A PP_Resource containing the + * PPB_Audio_Config if successful or a null resource if the + * sample frame count or bit rate are not supported. + */ + PP_Resource CreateStereo16Bit( + [in] PP_Instance instance, + [in] PP_AudioSampleRate sample_rate, + [in] uint32_t sample_frame_count); + + /** + * This comment block applies to version 1.0, which is deprecated in favor of + * the same function but with slightly different signature and behavior. + * + * RecommendSampleFrameCount() returns the supported sample frame count + * closest to the requested count. The sample frame count determines the + * overall latency of audio. Since one "frame" is always buffered in advance, + * smaller frame counts will yield lower latency, but higher CPU utilization. + * For best audio performance, use the value returned by RecommendSampleRate + * as the input sample rate, then use the RecommendSampleFrameCount return + * value when creating the audio configuration resource. + * + * Sample counts less than + * PP_AUDIOMINSAMPLEFRAMECOUNT and greater than + * PP_AUDIOMAXSAMPLEFRAMECOUNT are never supported on any + * system, but values in between aren't necessarily glitch-free. + * + * @param[in] sample_rate A PP_AudioSampleRate which is either + * PP_AUDIOSAMPLERATE_44100 or + * PP_AUDIOSAMPLERATE_48000. + * @param[in] requested_sample_frame_count A uint_32t requested + * frame count. + * + * @return A uint32_t containing the recommended sample frame + * count if successful. + */ + [deprecate=1.1] + uint32_t RecommendSampleFrameCount( + [in] PP_AudioSampleRate sample_rate, + [in] uint32_t requested_sample_frame_count); + + /** + * RecommendSampleFrameCount() returns the supported sample frame count + * closest to the requested count. The sample frame count determines the + * overall latency of audio. Since one "frame" is always buffered in advance, + * smaller frame counts will yield lower latency, but higher CPU utilization. + * + * Supported sample frame counts will vary by hardware and system (consider + * that the local system might be anywhere from a cell phone or a high-end + * audio workstation). Sample counts less than + * PP_AUDIOMINSAMPLEFRAMECOUNT and greater than + * PP_AUDIOMAXSAMPLEFRAMECOUNT are never supported on any + * system, but values in between aren't necessarily valid. This function + * will return a supported count closest to the requested frame count. + * + * RecommendSampleFrameCount() result is intended for audio output devices. + * + * @param[in] instance + * @param[in] sample_rate A PP_AudioSampleRate which is either + * PP_AUDIOSAMPLERATE_44100 or + * PP_AUDIOSAMPLERATE_48000. + * @param[in] requested_sample_frame_count A uint_32t requested + * frame count. + * + * @return A uint32_t containing the recommended sample frame + * count if successful. + */ + [version=1.1] + uint32_t RecommendSampleFrameCount( + [in] PP_Instance instance, + [in] PP_AudioSampleRate sample_rate, + [in] uint32_t requested_sample_frame_count); + + /** + * IsAudioConfig() determines if the given resource is a + * PPB_Audio_Config. + * + * @param[in] resource A PP_Resource corresponding to an audio + * config resource. + * + * @return A PP_Bool containing PP_TRUE if the given + * resource is an AudioConfig resource, otherwise + * PP_FALSE. + */ + PP_Bool IsAudioConfig( + [in] PP_Resource resource); + + /** + * GetSampleRate() returns the sample rate for the given + * PPB_Audio_Config. + * + * @param[in] config A PP_Resource corresponding to a + * PPB_Audio_Config. + * + * @return A PP_AudioSampleRate containing sample rate or + * PP_AUDIOSAMPLERATE_NONE if the resource is invalid. + */ + PP_AudioSampleRate GetSampleRate( + [in] PP_Resource config); + + /** + * GetSampleFrameCount() returns the sample frame count for the given + * PPB_Audio_Config. + * + * @param[in] config A PP_Resource corresponding to an audio + * config resource. + * + * @return A uint32_t containing sample frame count or + * 0 if the resource is invalid. Refer to + * RecommendSampleFrameCount() for more on sample frame counts. + */ + uint32_t GetSampleFrameCount( + [in] PP_Resource config); + + /** + * RecommendSampleRate() returns the native sample rate that the browser + * is using in the backend. Applications that use the recommended sample + * rate will have potentially better latency and fidelity. The return value + * is intended for audio output devices. If the output sample rate cannot be + * determined, this function can return PP_AUDIOSAMPLERATE_NONE. + * + * @param[in] instance + * + * @return A uint32_t containing the recommended sample frame + * count if successful. + */ + [version=1.1] + PP_AudioSampleRate RecommendSampleRate( + [in] PP_Instance instance); + +}; + diff --git a/browser/extensions/mortar/ppapi/api/ppb_audio_encoder.idl b/browser/extensions/mortar/ppapi/api/ppb_audio_encoder.idl new file mode 100644 index 000000000000..0a8029fcd386 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_audio_encoder.idl @@ -0,0 +1,209 @@ +/* Copyright 2015 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_AudioEncoder interface. + */ + +[generate_thunk] + +label Chrome { + [channel=dev] M47 = 0.1 +}; + +/** + * Audio encoder interface. + * + * Typical usage: + * - Call Create() to create a new audio encoder resource. + * - Call GetSupportedProfiles() to determine which codecs and profiles are + * available. + * - Call Initialize() to initialize the encoder for a supported profile. + * - Call GetBuffer() to get an empty buffer and fill it in, or get an audio + * buffer from another resource, e.g. PPB_MediaStreamAudioTrack. + * - Call Encode() to push the audio buffer to the encoder. If an external + * buffer is pushed, wait for completion to recycle the buffer. + * - Call GetBitstreamBuffer() continuously (waiting for each previous call to + * complete) to pull encoded buffers from the encoder. + * - Call RecycleBitstreamBuffer() after consuming the data in the bitstream + * buffer. + * - To destroy the encoder, the plugin should release all of its references to + * it. Any pending callbacks will abort before the encoder is destroyed. + * + * Available audio codecs vary by platform. + * All: opus. + */ +interface PPB_AudioEncoder { + /** + * Creates a new audio encoder resource. + * + * @param[in] instance A PP_Instance identifying the instance + * with the audio encoder. + * + * @return A PP_Resource corresponding to an audio encoder if + * successful or 0 otherwise. + */ + PP_Resource Create([in] PP_Instance instance); + + /** + * Determines if the given resource is an audio encoder. + * + * @param[in] resource A PP_Resource identifying a resource. + * + * @return PP_TRUE if the resource is a + * PPB_AudioEncoder, PP_FALSE if the resource is + * invalid or some other type. + */ + PP_Bool IsAudioEncoder([in] PP_Resource resource); + + /** + * Gets an array of supported audio encoder profiles. + * These can be used to choose a profile before calling Initialize(). + * + * @param[in] audio_encoder A PP_Resource identifying the audio + * encoder. + * @param[in] output A PP_ArrayOutput to receive the supported + * PP_AudioProfileDescription structs. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return If >= 0, the number of supported profiles returned, otherwise an + * error code from pp_errors.h. + */ + int32_t GetSupportedProfiles([in] PP_Resource audio_encoder, + [in] PP_ArrayOutput output, + [in] PP_CompletionCallback callback); + + /** + * Initializes an audio encoder resource. The plugin should call Initialize() + * successfully before calling any of the functions below. + * + * @param[in] audio_encoder A PP_Resource identifying the audio + * encoder. + * @param[in] channels The number of audio channels to encode. + * @param[in] input_sampling_rate The sampling rate of the input audio buffer. + * @param[in] input_sample_size The sample size of the input audio buffer. + * @param[in] output_profile A PP_AudioProfile specifying the + * codec profile of the encoded output stream. + * @param[in] initial_bitrate The initial bitrate for the encoder. + * @param[in] acceleration A PP_HardwareAcceleration specifying + * whether to use a hardware accelerated or a software implementation. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_NOTSUPPORTED if audio encoding is not available, or the + * requested codec profile is not supported. + */ + int32_t Initialize([in] PP_Resource audio_encoder, + [in] uint32_t channels, + [in] PP_AudioBuffer_SampleRate input_sample_rate, + [in] PP_AudioBuffer_SampleSize input_sample_size, + [in] PP_AudioProfile output_profile, + [in] uint32_t initial_bitrate, + [in] PP_HardwareAcceleration acceleration, + [in] PP_CompletionCallback callback); + + /** + * Gets the number of audio samples per channel that audio buffers must + * contain in order to be processed by the encoder. This will be the number of + * samples per channels contained in buffers returned by GetBuffer(). + * + * @param[in] audio_encoder A PP_Resource identifying the audio + * encoder. + * @return An int32_t containing the number of samples required, or an error + * code from pp_errors.h. + * Returns PP_ERROR_FAILED if Initialize() has not successfully completed. + */ + int32_t GetNumberOfSamples([in] PP_Resource audio_encoder); + + /** + * Gets a blank audio buffer (with metadata given by the Initialize() + * call) which can be filled with audio data and passed to the encoder. + * + * @param[in] audio_encoder A PP_Resource identifying the audio + * encoder. + * @param[out] audio_buffer A blank PPB_AudioBuffer resource. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_FAILED if Initialize() has not successfully completed. + */ + int32_t GetBuffer([in] PP_Resource audio_encoder, + [out] PP_Resource audio_buffer, + [in] PP_CompletionCallback callback); + + /** + * Encodes an audio buffer. + * + * @param[in] audio_encoder A PP_Resource identifying the audio + * encoder. + * @param[in] audio_buffer The PPB_AudioBuffer to be encoded. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. Plugins that pass PPB_AudioBuffer resources owned + * by other resources should wait for completion before reusing them. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_FAILED if Initialize() has not successfully completed. + */ + int32_t Encode([in] PP_Resource audio_encoder, + [in] PP_Resource audio_buffer, + [in] PP_CompletionCallback callback); + + /** + * Gets the next encoded bitstream buffer from the encoder. + * + * @param[in] audio_encoder A PP_Resource identifying the audio + * encoder. + * @param[out] bitstream_buffer A PP_BitstreamBuffer containing + * encoded audio data. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. The plugin can call GetBitstreamBuffer from the callback in + * order to continuously "pull" bitstream buffers from the encoder. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_FAILED if Initialize() has not successfully completed. + * Returns PP_ERROR_INPROGRESS if a prior call to GetBitstreamBuffer() has + * not completed. + */ + int32_t GetBitstreamBuffer([in] PP_Resource audio_encoder, + [out] PP_AudioBitstreamBuffer bitstream_buffer, + [in] PP_CompletionCallback callback); + + /** + * Recycles a bitstream buffer back to the encoder. + * + * @param[in] audio_encoder A PP_Resource identifying the audio + * encoder. + * @param[in] bitstream_buffer A PP_BitstreamBuffer that is no + * longer needed by the plugin. + */ + void RecycleBitstreamBuffer([in] PP_Resource audio_encoder, + [in] PP_AudioBitstreamBuffer bitstream_buffer); + + /** + * Requests a change to the encoding bitrate. This is only a request, + * fulfilled on a best-effort basis. + * + * @param[in] audio_encoder A PP_Resource identifying the audio + * encoder. + * @param[in] bitrate The requested new bitrate, in bits per second. + */ + void RequestBitrateChange([in] PP_Resource audio_encoder, + [in] uint32_t bitrate); + + /** + * Closes the audio encoder, and cancels any pending encodes. Any pending + * callbacks will still run, reporting PP_ERROR_ABORTED . It is + * not valid to call any encoder functions after a call to this method. + * Note: Destroying the audio encoder closes it implicitly, + * so you are not required to call Close(). + * + * @param[in] audio_encoder A PP_Resource identifying the audio + * encoder. + */ + void Close([in] PP_Resource audio_encoder); +}; diff --git a/browser/extensions/mortar/ppapi/api/ppb_compositor.idl b/browser/extensions/mortar/ppapi/api/ppb_compositor.idl new file mode 100644 index 000000000000..d9b4e64bd346 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_compositor.idl @@ -0,0 +1,131 @@ +/* Copyright 2014 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +[generate_thunk] + +label Chrome { + [channel=dev] M37 = 0.1 +}; + +/** + * Defines the PPB_Compositor interface. Used for setting + * PPB_CompositorLayer layers to the Chromium compositor for + * compositing. This allows a plugin to combine different sources of visual + * data efficiently, such as PPB_ImageData images and + * OpenGL textures. See also PPB_CompositorLayer for more + * information. + * This interface is still in development (Dev API status) and may change, + * so is only supported on Dev channel and Canary currently. + * + * Example usage from plugin code: + * + * Setup: + * @code + * PP_Resource compositor; + * compositor = compositor_if->Create(instance); + * instance_if->BindGraphics(instance, compositor); + * @endcode + * + * Setup layer stack: + * @code + * PP_Resource color_layer = compositor_if->AddLayer(compositor); + * PP_Resource texture_layer = compositor_if->AddLayer(compositor); + * @endcode + * + * Present one frame: + * layer_if->SetColor(color_layer, 255, 255, 0, 255, PP_MakeSize(400, 400)); + * PP_CompletionCallback release_callback = { + * TextureReleasedCallback, 0, PP_COMPLETIONCALLBACK_FLAG_NONE, + * }; + * layer_if->SetTexture(texture_layer, graphics3d, texture_id, + * PP_MakeSize(300, 300), release_callback); + * + * PP_CompletionCallback callback = { + * DidFinishCommitLayersCallback, + * (void*) texture_id, + * PP_COMPLETIONCALLBACK_FLAG_NONE, + * }; + * compositor_if->CommitLayers(compositor, callback); + * @endcode + * + * release callback + * void ReleaseCallback(int32_t result, void* user_data) { + * if (result == PP_OK) { + * uint32_t texture_id = (uint32_t) user_data; + * // reuse the texture or delete it. + * } + * } + * + * Shutdown: + * @code + * core->ReleaseResource(color_layer); + * core->ReleaseResource(texture_layer); + * core->ReleaseResource(compositor); + * @endcode + */ + +interface PPB_Compositor { + /** + * Determines if a resource is a compositor resource. + * + * @param[in] resource The PP_Resource to test. + * + * @return A PP_Bool with PP_TRUE if the given + * resource is a compositor resource or PP_FALSE otherwise. + */ + PP_Bool IsCompositor([in] PP_Resource resource); + + /** + * Creates a Compositor resource. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * + * @return A PP_Resource containing the compositor resource if + * successful or 0 otherwise. + */ + PP_Resource Create([in] PP_Instance instance); + + /** + * Creates a new PPB_CompositorLayer and adds it to the end + * of the layer stack. A PP_Resource containing the layer is + * returned. It is uninitialized, SetColor(), + * SetTexture or SetImage should be used to + * initialize it. The layer will appear above other pre-existing layers. + * If ResetLayers is called or the PPB_Compositor is + * released, the returned layer will be invalidated, and any further calls on + * the layer will return PP_ERROR_BADRESOURCE. + * + * param[in] compositor A PP_Resource corresponding to + * a compositor layer resource. + * + * @return A PP_Resource containing the compositor layer + * resource if successful or 0 otherwise. + */ + PP_Resource AddLayer([in] PP_Resource compositor); + + /** + * Commits layers added by AddLayer() to the chromium compositor. + * + * param[in] compositor A PP_Resource corresponding to + * a compositor layer resource. + * @param[in] cc A PP_CompletionCallback to be called when + * layers have been represented on screen. + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t CommitLayers([in] PP_Resource compositor, + [in] PP_CompletionCallback cc); + + /** + * Resets layers added by AddLayer(). + * + * param[in] compositor A PP_Resource corresponding to + * a compositor layer resource. + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t ResetLayers([in] PP_Resource compositor); +}; diff --git a/browser/extensions/mortar/ppapi/api/ppb_compositor_layer.idl b/browser/extensions/mortar/ppapi/api/ppb_compositor_layer.idl new file mode 100644 index 000000000000..ed0967d4fa42 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_compositor_layer.idl @@ -0,0 +1,251 @@ +/* Copyright 2014 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +[generate_thunk] + +label Chrome { + [channel=dev] M37 = 0.1, + [channel=dev] M38 = 0.2 +}; + +/** + * This enumeration contains blend modes used for computing the result pixels + * based on the source RGBA values in layers with the RGBA values that are + * already in the destination framebuffer. + * alpha_src, color_src: source alpha and color. + * alpha_dst, color_dst: destination alpha and color (before compositing). + * Below descriptions of the blend modes assume the colors are pre-multiplied. + * This interface is still in development (Dev API status) and may change, + * so is only supported on Dev channel and Canary currently. + */ +enum PP_BlendMode { + /** + * No blending, copy source to the destination directly. + */ + PP_BLENDMODE_NONE, + + /** + * Source is placed over the destination. + * Resulting alpha = alpha_src + alpha_dst - alpha_src * alpha_dst + * Resulting color = color_src + color_dst * (1 - alpha_src) + */ + PP_BLENDMODE_SRC_OVER, + + /** + * The last blend mode. + */ + PP_BLENDMODE_LAST = PP_BLENDMODE_SRC_OVER +}; + +/** + * Defines the PPB_CompositorLayer interface. It is used by + * PPB_Compositor. + */ +interface PPB_CompositorLayer { + /** + * Determines if a resource is a compositor layer resource. + * + * @param[in] resource The PP_Resource to test. + * + * @return A PP_Bool with PP_TRUE if the given + * resource is a compositor layer resource or PP_FALSE + * otherwise. + */ + PP_Bool IsCompositorLayer([in] PP_Resource resource); + + /** + * Sets the color of a solid color layer. If the layer is uninitialized, + * it will initialize the layer first, and then set its color. + * If the layer has been initialized to another kind of layer, the layer will + * not be changed, and PP_ERROR_BADARGUMENT will be returned. + * + * param[in] layer A PP_Resource corresponding to a compositor + * layer resource. + * param[in] red A float for the red color component. It will be + * clamped to [0, 1]. + * param[in] green A float for the green color component. It will + * be clamped to [0, 1]. + * param[in] blue A float for the blue color component. It will + * be clamped to [0, 1]. + * param[in] alpha A float for the alpha color component. It will + * be clamped to [0, 1]. + * param[in] size A PP_Size for the size of the layer before + * transform. + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t SetColor([in] PP_Resource layer, + [in] float_t red, + [in] float_t green, + [in] float_t blue, + [in] float_t alpha, + [in] PP_Size size); + + /** + * Sets the texture of a texture layer. If the layer is uninitialized, + * it will initialize the layer first, and then set its texture. + * The source rect will be set to ((0, 0), (1, 1)). If the layer has been + * initialized to another kind of layer, the layer will not be changed, + * and PP_ERROR_BADARGUMENT will be returned. + * + * param[in] layer A PP_Resource corresponding to a compositor + * layer resource. + * param[in] context A PP_Resource corresponding to a graphics + * 3d resource which owns the GL texture. + * param[in] texture A GL texture object id. + * param[in] size A PP_Size for the size of the layer before + * transform. + * param[in] cc A PP_CompletionCallback to be called when + * the texture is released by Chromium compositor. + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t SetTexture([in] PP_Resource layer, + [in] PP_Resource context, + [in] uint32_t texture, + [in] PP_Size size, + [in] PP_CompletionCallback cc); + + /** + * Sets the texture of a texture layer. If the layer is uninitialized, + * it will initialize the layer first, and then set its texture. + * The source rect will be set to ((0, 0), (1, 1)). If the layer has been + * initialized to another kind of layer, the layer will not be changed, + * and PP_ERROR_BADARGUMENT will be returned. + * + * param[in] layer A PP_Resource corresponding to a compositor + * layer resource. + * param[in] context A PP_Resource corresponding to a graphics + * 3d resource which owns the GL texture. + * param[in] target GL texture target (GL_TEXTURE_2D, etc). + * param[in] texture A GL texture object id. + * param[in] size A PP_Size for the size of the layer before + * transform. + * param[in] cc A PP_CompletionCallback to be called when + * the texture is released by Chromium compositor. + * + * @return An int32_t containing a result code from pp_errors.h. + */ + [version = 0.2] + int32_t SetTexture([in] PP_Resource layer, + [in] PP_Resource context, + [in] uint32_t target, + [in] uint32_t texture, + [in] PP_Size size, + [in] PP_CompletionCallback cc); + + /** + * Sets the image of an image layer. If the layer is uninitialized, + * it will initialize the layer first, and then set its image. + * The layer size will be set to the image's size. The source rect will be set + * to the full image. If the layer has been initialized to another kind of + * layer, the layer will not be changed, and PP_ERROR_BADARGUMENT + * will be returned. + * + * param[in] layer A PP_Resource corresponding to a compositor + * layer resource. + * param[in] image_data A PP_Resource corresponding to + * an image data resource. + * param[in] size A PP_Size for the size of the layer before + * transform. If NULL, the image's size will be used. + * param[in] cc A PP_CompletionCallback to be called when + * the image data is released by Chromium compositor. + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t SetImage([in] PP_Resource layer, + [in] PP_Resource image_data, + [in] PP_Size size, + [in] PP_CompletionCallback cc); + + /** + * Sets a clip rectangle for a compositor layer. The Chromium compositor + * applies a transform matrix on the layer first, and then clips the layer + * with the rectangle. + * + * param[in] layer A PP_Resource corresponding to a compositor + * layer resource. + * param[in] rect The clip rectangle. The origin is top-left corner of + * the plugin. + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t SetClipRect([in] PP_Resource layer, + [in] PP_Rect rect); + + /** + * Sets a transform matrix which is used to composite the layer. + * + * param[in] layer A PP_Resource corresponding to a compositor + * layer resource. + * param[in] matrix A float array with 16 elements. The matrix is + * column major. The default transform matrix is an identity matrix. + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t SetTransform([in] PP_Resource layer, + [in] float_t[16] matrix); + + /** + * Sets the opacity value which will be applied to the layer. The effective + * value of each pixel is computed as: + * + * if (premult_alpha) + * pixel.rgb = pixel.rgb * opacity; + * pixel.a = pixel.a * opactiy; + * + * param[in] layer A PP_Resource corresponding to a compositor + * layer resource. + * param[in] opacity A float for the opacity value, The default + * value is 1.0f. + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t SetOpacity([in] PP_Resource layer, + [in] float_t opacity); + + /** + * Sets the blend mode which is used to composite the layer. + * + * param[in] layer A PP_Resource corresponding to a compositor + * layer resource. + * param[in] mode A PP_BlendMode. The default mode is + * PP_BLENDMODE_SRC_OVER. + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t SetBlendMode([in] PP_Resource layer, + [in] PP_BlendMode mode); + + /** + * Sets a source rectangle for a texture layer or an image layer. + * + * param[in] layer A PP_Resource corresponding to a compositor + * layer resource. + * param[in] rect A PP_FloatRect for an area of the source to + * consider. For a texture layer, rect is in uv coordinates. For an image + * layer, rect is in pixels. If the rect is beyond the dimensions of the + * texture or image, PP_ERROR_BADARGUMENT will be returned. + * If the layer size does not match the source rect size, bilinear scaling + * will be used. + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t SetSourceRect([in] PP_Resource layer, + [in] PP_FloatRect rect); + + /** + * Sets the premultiplied alpha for an texture layer. + * + * param[in] layer A PP_Resource corresponding to a compositor + * layer resource. + * param[in] premult A PP_Bool with PP_TRUE if + * pre-multiplied alpha is used. + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t SetPremultipliedAlpha([in] PP_Resource layer, + [in] PP_Bool premult); +}; diff --git a/browser/extensions/mortar/ppapi/api/ppb_console.idl b/browser/extensions/mortar/ppapi/api/ppb_console.idl new file mode 100644 index 000000000000..84daa6fd842f --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_console.idl @@ -0,0 +1,51 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_Console interface. + */ + +[generate_thunk] + +label Chrome { + M25 = 1.0 +}; + +[assert_size(4)] +enum PP_LogLevel { + PP_LOGLEVEL_TIP = 0, + PP_LOGLEVEL_LOG = 1, + PP_LOGLEVEL_WARNING = 2, + PP_LOGLEVEL_ERROR = 3 +}; + +interface PPB_Console { + /** + * Logs the given message to the JavaScript console associated with the + * given plugin instance with the given logging level. The name of the plugin + * issuing the log message will be automatically prepended to the message. + * The value may be any type of Var. + */ + void Log( + [in] PP_Instance instance, + [in] PP_LogLevel level, + [in] PP_Var value); + + /** + * Logs a message to the console with the given source information rather + * than using the internal PPAPI plugin name. The name must be a string var. + * + * The regular log function will automatically prepend the name of your + * plugin to the message as the "source" of the message. Some plugins may + * wish to override this. For example, if your plugin is a Python + * interpreter, you would want log messages to contain the source .py file + * doing the log statement rather than have "python" show up in the console. + */ + void LogWithSource( + [in] PP_Instance instance, + [in] PP_LogLevel level, + [in] PP_Var source, + [in] PP_Var value); +}; diff --git a/browser/extensions/mortar/ppapi/api/ppb_core.idl b/browser/extensions/mortar/ppapi/api/ppb_core.idl new file mode 100644 index 000000000000..58bd9216d985 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_core.idl @@ -0,0 +1,101 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_Core interface defined by the browser + * and containing pointers to functions related to memory management, time, and + * threads. + */ + +label Chrome { + M14 = 1.0 +}; + +/** + * The PPB_Core interface contains pointers to functions related + * to memory management, time, and threads on the browser. + * + */ +interface PPB_Core { + /** + * + * AddRefResource() adds a reference to a resource. + * + * @param[in] config A PP_Resource corresponding to a + * resource. + */ + void AddRefResource([in] PP_Resource resource); + + /** + * ReleaseResource() removes a reference from a resource. + * + * @param[in] config A PP_Resource corresponding to a + * resource. + */ + void ReleaseResource([in] PP_Resource resource); + + /** + * GetTime() returns the "wall clock time" according to the + * browser. + * + * @return A PP_Time containing the "wall clock time" according + * to the browser. + */ + PP_Time GetTime(); + + /** + * GetTimeTicks() returns the "tick time" according to the browser. + * This clock is used by the browser when passing some event times to the + * module (e.g. using the PP_InputEvent::time_stamp_seconds + * field). It is not correlated to any actual wall clock time + * (like GetTime()). Because of this, it will not run change if the user + * changes their computer clock. + * + * @return A PP_TimeTicks containing the "tick time" according + * to the browser. + */ + PP_TimeTicks GetTimeTicks(); + + /** + * CallOnMainThread() schedules work to be executed on the main module thread + * after the specified delay. The delay may be 0 to specify a call back as + * soon as possible. + * + * The result parameter will just be passed as the second + * argument to the callback. Many applications won't need this, but it allows + * a module to emulate calls of some callbacks which do use this value. + * + * Note: CallOnMainThread, even when used from the main + * thread with a delay of 0 milliseconds, will never directly invoke the + * callback. Even in this case, the callback will be scheduled + * asynchronously. + * + * Note: If the browser is shutting down or if the module + * has no instances, then the callback function may not be called. + * + * @param[in] delay_in_milliseconds An int32_t delay in milliseconds. + * @param[in] callback A PP_CompletionCallback callback function + * that the browser will call after the specified delay. + * @param[in] result An int32_t that the browser will pass to the given + * PP_CompletionCallback. + */ + void CallOnMainThread( + [in] int32_t delay_in_milliseconds, + [in] PP_CompletionCallback callback, + [in] int32_t result); + + /** + * IsMainThread() returns true if the current thread is the main pepper + * thread. + * + * This function is useful for implementing sanity checks, and deciding if + * dispatching using CallOnMainThread() is required. + * + * @return A PP_Bool containing PP_TRUE if the + * current thread is the main pepper thread, otherwise PP_FALSE. + */ + PP_Bool IsMainThread(); +}; + diff --git a/browser/extensions/mortar/ppapi/api/ppb_file_io.idl b/browser/extensions/mortar/ppapi/api/ppb_file_io.idl new file mode 100644 index 000000000000..9b8c9e22bdfd --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_file_io.idl @@ -0,0 +1,293 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + + +/** + * This file defines the API to create a file i/o object. + */ + +[generate_thunk] + +label Chrome { + M14 = 1.0, + M25 = 1.1, + M29 = 1.2 +}; + +/** + * The PP_FileOpenFlags enum contains file open constants. + */ +[assert_size(4)] + enum PP_FileOpenFlags { + /** Requests read access to a file. */ + PP_FILEOPENFLAG_READ = 1 << 0, + + /** + * Requests write access to a file. May be combined with + * PP_FILEOPENFLAG_READ to request read and write access. + */ + PP_FILEOPENFLAG_WRITE = 1 << 1, + + /** + * Requests that the file be created if it does not exist. If the file + * already exists, then this flag is ignored unless + * PP_FILEOPENFLAG_EXCLUSIVE was also specified, in which case + * FileIO::Open() will fail. + */ + PP_FILEOPENFLAG_CREATE = 1 << 2, + + /** + * Requests that the file be truncated to length 0 if it exists and is a + * regular file. PP_FILEOPENFLAG_WRITE must also be specified. + */ + PP_FILEOPENFLAG_TRUNCATE = 1 << 3, + + /** + * Requests that the file is created when this flag is combined with + * PP_FILEOPENFLAG_CREATE. If this flag is specified, and the + * file already exists, then the FileIO::Open() call will fail. + */ + PP_FILEOPENFLAG_EXCLUSIVE = 1 << 4, + + /** + * Requests write access to a file, but writes will always occur at the end of + * the file. Mututally exclusive with PP_FILEOPENFLAG_WRITE. + * + * This is only supported in version 1.2 (Chrome 29) and later. + */ + [version=1.2] + PP_FILEOPENFLAG_APPEND = 1 << 5 +}; + + +/** + * The PPB_FileIO struct is used to operate on a regular file + * (PP_FileType_Regular). + */ +interface PPB_FileIO { + /** + * Create() creates a new FileIO object. + * + * @param[in] instance A PP_Instance identifying the instance + * with the file. + * + * @return A PP_Resource corresponding to a FileIO if + * successful or 0 if the module is invalid. + */ + PP_Resource Create([in] PP_Instance instance); + /** + * IsFileIO() determines if the provided resource is a FileIO. + * + * @param[in] resource A PP_Resource corresponding to a FileIO. + * + * @return PP_TRUE if the resource is a + * PPB_FileIO, PP_FALSE if the resource is + * invalid or some type other than PPB_FileIO. + */ + PP_Bool IsFileIO([in] PP_Resource resource); + + /** + * Open() opens the specified regular file for I/O according to the given + * open flags, which is a bit-mask of the PP_FileOpenFlags + * values. Upon success, the corresponding file is classified as "in use" + * by this FileIO object until such time as the FileIO object is closed + * or destroyed. + * + * @param[in] file_io A PP_Resource corresponding to a + * FileIO. + * @param[in] file_ref A PP_Resource corresponding to a file + * reference. + * @param[in] open_flags A bit-mask of the PP_FileOpenFlags + * values. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Open(). + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t Open([in] PP_Resource file_io, + [in] PP_Resource file_ref, + [in] int32_t open_flags, + [in] PP_CompletionCallback callback); + + /** + * Query() queries info about the file opened by this FileIO object. The + * FileIO object must be opened, and there must be no other operations + * pending. + * + * @param[in] file_io A PP_Resource corresponding to a + * FileIO. + * @param[out] info The PP_FileInfo structure representing all + * information about the file. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Query(). info must remain valid until after the + * callback runs. If you pass a blocking callback, info must + * remain valid until after Query() returns. + * + * @return An int32_t containing an error code from pp_errors.h. + * PP_ERROR_FAILED will be returned if the file isn't opened, and + * PP_ERROR_INPROGRESS will be returned if there is another operation pending. + */ + int32_t Query([in] PP_Resource file_io, + [out] PP_FileInfo info, + [in] PP_CompletionCallback callback); + + /** + * Touch() Updates time stamps for the file opened by this FileIO object. + * This function will fail if the FileIO object has not been opened. The + * FileIO object must be opened, and there must be no other operations + * pending. + * + * @param[in] file_io A PP_Resource corresponding to a file + * FileIO. + * @param[in] last_access_time The last time the FileIO was accessed. + * @param[in] last_modified_time The last time the FileIO was modified. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Touch(). + * + * @return An int32_t containing an error code from pp_errors.h. + * PP_ERROR_FAILED will be returned if the file isn't opened, and + * PP_ERROR_INPROGRESS will be returned if there is another operation pending. + */ + int32_t Touch([in] PP_Resource file_io, + [in] PP_Time last_access_time, + [in] PP_Time last_modified_time, + [in] PP_CompletionCallback callback); + + /** + * Read() reads from an offset in the file. The size of the buffer must be + * large enough to hold the specified number of bytes to read. This function + * might perform a partial read, meaning all the requested bytes + * might not be returned, even if the end of the file has not been reached. + * The FileIO object must have been opened with read access. + * + * ReadToArray() is preferred to Read() when doing asynchronous operations. + * + * @param[in] file_io A PP_Resource corresponding to a file + * FileIO. + * @param[in] offset The offset into the file. + * @param[in] buffer The buffer to hold the specified number of bytes read. + * @param[in] bytes_to_read The number of bytes to read from + * offset. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Read(). buffer must remain valid until after + * the callback runs. If you pass a blocking callback, buffer + * must remain valid until after Read() returns. + * + * @return The number of bytes read or an error code from + * pp_errors.h. If the return value is 0, then end-of-file was + * reached. It is valid to call Read() multiple times with a completion + * callback to queue up parallel reads from the file, but pending reads + * cannot be interleaved with other operations. + */ + int32_t Read([in] PP_Resource file_io, + [in] int64_t offset, + [inout] str_t buffer, + [in] int32_t bytes_to_read, + [in] PP_CompletionCallback callback); + + /** + * Write() writes to an offset in the file. This function might perform a + * partial write. The FileIO object must have been opened with write access. + * + * @param[in] file_io A PP_Resource corresponding to a file + * FileIO. + * @param[in] offset The offset into the file. + * @param[in] buffer The buffer to hold the specified number of bytes read. + * @param[in] bytes_to_write The number of bytes to write to + * offset. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Write(). + * + * @return The number of bytes written or an error code from + * pp_errors.h. If the return value is 0, then end-of-file was + * reached. It is valid to call Write() multiple times with a completion + * callback to queue up parallel writes to the file, but pending writes + * cannot be interleaved with other operations. + */ + int32_t Write([in] PP_Resource file_io, + [in] int64_t offset, + [in] str_t buffer, + [in] int32_t bytes_to_write, + [in] PP_CompletionCallback callback); + /** + * SetLength() sets the length of the file. If the file size is extended, + * then the extended area of the file is zero-filled. The FileIO object must + * have been opened with write access and there must be no other operations + * pending. + * + * @param[in] file_io A PP_Resource corresponding to a file + * FileIO. + * @param[in] length The length of the file to be set. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of SetLength(). + * + * @return An int32_t containing an error code from pp_errors.h. + * PP_ERROR_FAILED will be returned if the file isn't opened, and + * PP_ERROR_INPROGRESS will be returned if there is another operation pending. + */ + int32_t SetLength([in] PP_Resource file_io, + [in] int64_t length, + [in] PP_CompletionCallback callback); + + /** + * Flush() flushes changes to disk. This call can be very expensive! The + * FileIO object must have been opened with write access and there must be no + * other operations pending. + * + * @param[in] file_io A PP_Resource corresponding to a file + * FileIO. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Flush(). + * + * @return An int32_t containing an error code from pp_errors.h. + * PP_ERROR_FAILED will be returned if the file isn't opened, and + * PP_ERROR_INPROGRESS will be returned if there is another operation pending. + */ + int32_t Flush([in] PP_Resource file_io, + [in] PP_CompletionCallback callback); + + /** + * Close() cancels any IO that may be pending, and closes the FileIO object. + * Any pending callbacks will still run, reporting + * PP_ERROR_ABORTED if pending IO was interrupted. It is not + * valid to call Open() again after a call to this method. + * Note: If the FileIO object is destroyed, and it is still + * open, then it will be implicitly closed, so you are not required to call + * Close(). + * + * @param[in] file_io A PP_Resource corresponding to a file + * FileIO. + */ + void Close([in] PP_Resource file_io); + + /** + * ReadToArray() reads from an offset in the file. A PP_ArrayOutput must be + * provided so that output will be stored in its allocated buffer. This + * function might perform a partial read. The FileIO object must have been + * opened with read access. + * + * @param[in] file_io A PP_Resource corresponding to a file + * FileIO. + * @param[in] offset The offset into the file. + * @param[in] max_read_length The maximum number of bytes to read from + * offset. + * @param[in] output A PP_ArrayOutput to hold the output data. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of ReadToArray(). + * + * @return The number of bytes read or an error code from + * pp_errors.h. If the return value is 0, then end-of-file was + * reached. It is valid to call ReadToArray() multiple times with a completion + * callback to queue up parallel reads from the file, but pending reads + * cannot be interleaved with other operations. + */ + [version = 1.1] + int32_t ReadToArray([in] PP_Resource file_io, + [in] int64_t offset, + [in] int32_t max_read_length, + [inout] PP_ArrayOutput output, + [in] PP_CompletionCallback callback); +}; + diff --git a/browser/extensions/mortar/ppapi/api/ppb_file_ref.idl b/browser/extensions/mortar/ppapi/api/ppb_file_ref.idl new file mode 100644 index 000000000000..f3207e05bd2a --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_file_ref.idl @@ -0,0 +1,247 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the API to create a file reference or "weak pointer" to a + * file in a file system. + */ + +label Chrome { + M14 = 1.0, + M28 = 1.1, + M34 = 1.2 +}; + +/** + * The PP_MakeDirectoryFlags enum contains flags used to control + * behavior of PPB_FileRef.MakeDirectory(). + */ +enum PP_MakeDirectoryFlags { + PP_MAKEDIRECTORYFLAG_NONE = 0 << 0, + + /** Requests that ancestor directories are created if they do not exist. */ + PP_MAKEDIRECTORYFLAG_WITH_ANCESTORS = 1 << 0, + + /** + * Requests that the PPB_FileRef.MakeDirectory() call fails if the directory + * already exists. + */ + PP_MAKEDIRECTORYFLAG_EXCLUSIVE = 1 << 1 +}; + +/** + * The PPB_FileRef struct represents a "weak pointer" to a file in + * a file system. This struct contains a PP_FileSystemType + * identifier and a file path string. + */ +interface PPB_FileRef { + /** + * Create() creates a weak pointer to a file in the given file system. File + * paths are POSIX style. + * + * @param[in] resource A PP_Resource corresponding to a file + * system. + * @param[in] path A path to the file. Must begin with a '/' character. + * + * @return A PP_Resource corresponding to a file reference if + * successful or 0 if the path is malformed. + */ + PP_Resource Create([in] PP_Resource file_system, [in] str_t path); + /** + * IsFileRef() determines if the provided resource is a file reference. + * + * @param[in] resource A PP_Resource corresponding to a file + * reference. + * + * @return PP_TRUE if the resource is a + * PPB_FileRef, PP_FALSE if the resource is + * invalid or some type other than PPB_FileRef. + */ + PP_Bool IsFileRef([in] PP_Resource resource); + + /** + * GetFileSystemType() returns the type of the file system. + * + * @param[in] file_ref A PP_Resource corresponding to a file + * reference. + * + * @return A PP_FileSystemType with the file system type if + * valid or PP_FILESYSTEMTYPE_INVALID if the provided resource + * is not a valid file reference. + */ + PP_FileSystemType GetFileSystemType([in] PP_Resource file_ref); + + /** + * GetName() returns the name of the file. + * + * @param[in] file_ref A PP_Resource corresponding to a file + * reference. + * + * @return A PP_Var containing the name of the file. The value + * returned by this function does not include any path components (such as + * the name of the parent directory, for example). It is just the name of the + * file. Use GetPath() to get the full file path. + */ + PP_Var GetName([in] PP_Resource file_ref); + + /** + * GetPath() returns the absolute path of the file. + * + * @param[in] file_ref A PP_Resource corresponding to a file + * reference. + * + * @return A PP_Var containing the absolute path of the file. + * This function fails if the file system type is + * PP_FileSystemType_External. + */ + PP_Var GetPath([in] PP_Resource file_ref); + + /** + * GetParent() returns the parent directory of this file. If + * file_ref points to the root of the filesystem, then the root + * is returned. + * + * @param[in] file_ref A PP_Resource corresponding to a file + * reference. + * + * @return A PP_Resource containing the parent directory of the + * file. This function fails if the file system type is + * PP_FileSystemType_External. + */ + PP_Resource GetParent([in] PP_Resource file_ref); + + /** + * MakeDirectory() makes a new directory in the file system as well as any + * parent directories if the make_ancestors argument is + * PP_TRUE. It is not valid to make a directory in the external + * file system. + * + * @param[in] file_ref A PP_Resource corresponding to a file + * reference. + * @param[in] make_ancestors A PP_Bool set to + * PP_TRUE to make ancestor directories or PP_FALSE + * if ancestor directories are not needed. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of MakeDirectory(). + * + * @return An int32_t containing an error code from pp_errors.h. + * Succeeds if the directory already exists. Fails if ancestor directories + * do not exist and make_ancestors was passed as + * PP_FALSE. + */ + [deprecate=1.2] + int32_t MakeDirectory([in] PP_Resource directory_ref, + [in] PP_Bool make_ancestors, + [in] PP_CompletionCallback callback); + + /** + * MakeDirectory() makes a new directory in the file system according to the + * given make_directory_flags, which is a bit-mask of the + * PP_MakeDirectoryFlags values. It is not valid to make a + * directory in the external file system. + * + * @param[in] file_ref A PP_Resource corresponding to a file + * reference. + * @param[in] make_directory_flags A bit-mask of the + * PP_MakeDirectoryFlags values. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of MakeDirectory(). + * + * @return An int32_t containing an error code from pp_errors.h. + */ + [version=1.2] + int32_t MakeDirectory([in] PP_Resource directory_ref, + [in] int32_t make_directory_flags, + [in] PP_CompletionCallback callback); + + /** + * Touch() Updates time stamps for a file. You must have write access to the + * file if it exists in the external filesystem. + * + * @param[in] file_ref A PP_Resource corresponding to a file + * reference. + * @param[in] last_access_time The last time the file was accessed. + * @param[in] last_modified_time The last time the file was modified. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Touch(). + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t Touch([in] PP_Resource file_ref, + [in] PP_Time last_access_time, + [in] PP_Time last_modified_time, + [in] PP_CompletionCallback callback); + + /** + * Delete() deletes a file or directory. If file_ref refers to + * a directory, then the directory must be empty. It is an error to delete a + * file or directory that is in use. It is not valid to delete a file in + * the external file system. + * + * @param[in] file_ref A PP_Resource corresponding to a file + * reference. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Delete(). + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t Delete([in] PP_Resource file_ref, + [in] PP_CompletionCallback callback); + + /** + * Rename() renames a file or directory. Arguments file_ref and + * new_file_ref must both refer to files in the same file + * system. It is an error to rename a file or directory that is in use. It + * is not valid to rename a file in the external file system. + * + * @param[in] file_ref A PP_Resource corresponding to a file + * reference. + * @param[in] new_file_ref A PP_Resource corresponding to a new + * file reference. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Rename(). + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t Rename([in] PP_Resource file_ref, + [in] PP_Resource new_file_ref, + [in] PP_CompletionCallback callback); + + /** + * Query() queries info about a file or directory. You must have access to + * read this file or directory if it exists in the external filesystem. + * + * @param[in] file_ref A PP_Resource corresponding to a file + * reference. + * @param[out] info A pointer to a PP_FileInfo which will be + * populated with information about the file or directory. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Query(). + * + * @return An int32_t containing an error code from pp_errors.h. + */ + [version=1.1] + int32_t Query([in] PP_Resource file_ref, + [out] PP_FileInfo info, + [in] PP_CompletionCallback callback); + + /** + * ReadDirectoryEntries() reads all entries in a directory. + * + * @param[in] file_ref A PP_Resource corresponding to a directory + * reference. + * @param[in] output An output array which will receive + * PP_DirectoryEntry objects on success. + * @param[in] callback A PP_CompletionCallback to run on + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + */ + [version=1.1] + int32_t ReadDirectoryEntries([in] PP_Resource file_ref, + [in] PP_ArrayOutput output, + [in] PP_CompletionCallback callback); +}; + diff --git a/browser/extensions/mortar/ppapi/api/ppb_file_system.idl b/browser/extensions/mortar/ppapi/api/ppb_file_system.idl new file mode 100644 index 000000000000..c66b6a1092e1 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_file_system.idl @@ -0,0 +1,82 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the API to create a file system associated with a file. + */ + +[generate_thunk] + +label Chrome { + M14 = 1.0 +}; + +/** + * The PPB_FileSystem struct identifies the file system type + * associated with a file. + */ +interface PPB_FileSystem { + /** Create() creates a file system object of the given type. + * + * @param[in] instance A PP_Instance identifying the instance + * with the file. + * @param[in] type A file system type as defined by + * PP_FileSystemType enum (except PP_FILESYSTEMTYPE_ISOLATED, + * which is currently not supported). + * @return A PP_Resource corresponding to a file system if + * successful. + */ + PP_Resource Create([in] PP_Instance instance, [in] PP_FileSystemType type); + + /** + * IsFileSystem() determines if the provided resource is a file system. + * + * @param[in] resource A PP_Resource corresponding to a file + * system. + * + * @return PP_TRUE if the resource is a + * PPB_FileSystem, PP_FALSE if the resource is + * invalid or some type other than PPB_FileSystem. + */ + PP_Bool IsFileSystem([in] PP_Resource resource); + + /** + * Open() opens the file system. A file system must be opened before running + * any other operation on it. + * + * @param[in] file_system A PP_Resource corresponding to a file + * system. + * + * @param[in] expected_size The expected size of the file system. Note that + * this does not request quota; to do that, you must either invoke + * requestQuota from JavaScript: + * http://www.html5rocks.com/en/tutorials/file/filesystem/#toc-requesting-quota + * or set the unlimitedStorage permission for Chrome Web Store apps: + * http://code.google.com/chrome/extensions/manifest.html#permissions + * + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Open(). + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t Open([in] PP_Resource file_system, + [in] int64_t expected_size, + [in] PP_CompletionCallback callback); + + /** + * GetType() returns the type of the provided file system. + * + * @param[in] file_system A PP_Resource corresponding to a file + * system. + * + * @return A PP_FileSystemType with the file system type if + * valid or PP_FILESYSTEMTYPE_INVALID if the provided resource + * is not a valid file system. It is valid to call this function even before + * Open() completes. + */ + [on_failure=PP_FILESYSTEMTYPE_INVALID] + PP_FileSystemType GetType([in] PP_Resource file_system); +}; + diff --git a/browser/extensions/mortar/ppapi/api/ppb_fullscreen.idl b/browser/extensions/mortar/ppapi/api/ppb_fullscreen.idl new file mode 100644 index 000000000000..0599e186943d --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_fullscreen.idl @@ -0,0 +1,78 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + + +/** + * This file defines the PPB_Fullscreen interface for + * handling transitions of a module instance to and from fullscreen mode. + */ + +[generate_thunk] + +label Chrome { + M16 = 1.0 +}; + +/** + * The PPB_Fullscreen interface is implemented by the browser. + * This interface provides a way of checking the current screen mode and + * toggling fullscreen mode. + */ +interface PPB_Fullscreen { + /** + * IsFullscreen() checks whether the module instance is currently in + * fullscreen mode. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * + * @return PP_TRUE if the module instance is in fullscreen mode, + * PP_FALSE if the module instance is not in fullscreen mode. + */ + PP_Bool IsFullscreen( + [in] PP_Instance instance); + + /** + * SetFullscreen() switches the module instance to and from fullscreen + * mode. + * + * The transition to and from fullscreen mode is asynchronous. During the + * transition, IsFullscreen() will return the previous value and + * no 2D or 3D device can be bound. The transition ends at DidChangeView() + * when IsFullscreen() returns the new value. You might receive other + * DidChangeView() calls while in transition. + * + * The transition to fullscreen mode can only occur while the browser is + * processing a user gesture, even if PP_TRUE is returned. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * @param[in] fullscreen PP_TRUE to enter fullscreen mode, or + * PP_FALSE to exit fullscreen mode. + * + * @return PP_TRUE on success or PP_FALSE on + * failure. + */ + PP_Bool SetFullscreen( + [in] PP_Instance instance, + [in] PP_Bool fullscreen); + + /** + * GetScreenSize() gets the size of the screen in pixels. The module instance + * will be resized to this size when SetFullscreen() is called to enter + * fullscreen mode. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * @param[out] size The size of the entire screen in pixels. + * + * @return PP_TRUE on success or PP_FALSE on + * failure. + */ + PP_Bool GetScreenSize( + [in] PP_Instance instance, + [out] PP_Size size); +}; + diff --git a/browser/extensions/mortar/ppapi/api/ppb_gamepad.idl b/browser/extensions/mortar/ppapi/api/ppb_gamepad.idl new file mode 100644 index 000000000000..927f5cceb69e --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_gamepad.idl @@ -0,0 +1,97 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_Gamepad interface, which + * provides access to gamepad devices. + */ + +[generate_thunk] + +label Chrome { + M19 = 1.0 +}; + +/** + * The data for one gamepad device. + */ +[assert_size(472)] +struct PP_GamepadSampleData { + /** + * Number of valid elements in the |axes| array. + */ + uint32_t axes_length; + + /** + * Normalized values for the axes, indices valid up to |axes_length|-1. Axis + * values range from -1..1, and are in order of "importance". + */ + float_t[16] axes; + + /** + * Number of valid elements in the |buttons| array. + */ + uint32_t buttons_length; + + /** + * Normalized values for the buttons, indices valid up to |buttons_length| + * - 1. Button values range from 0..1, and are in order of importance. + */ + float_t[32] buttons; + + /** + * Monotonically increasing value that is incremented when the data have + * been updated. + */ + double_t timestamp; + + /** + * Identifier for the type of device/manufacturer. + */ + uint16_t[128] id; + + /** + * Is there a gamepad connected at this index? If this is false, no other + * data in this structure is valid. + */ + PP_Bool connected; + + /* Padding to make the struct the same size between 64 and 32. */ + int8_t[4] unused_pad_; +}; + +/** + * The data for all gamepads connected to the system. + */ +[assert_size(1896)] +struct PP_GamepadsSampleData { + /** + * Number of valid elements in the |items| array. + */ + uint32_t length; + + /* Padding to make the struct the same size between 64 and 32. */ + int8_t[4] unused_pad_; + + /** + * Data for an individual gamepad device connected to the system. + */ + PP_GamepadSampleData[4] items; +}; + +/** + * The PPB_Gamepad interface allows retrieving data from + * gamepad/joystick devices that are connected to the system. + */ +[version=1.0, macro="PPB_GAMEPAD_INTERFACE", singleton] +interface PPB_Gamepad { + /** + * Samples the current state of the available gamepads. + */ + [always_set_output_parameters] + void Sample( + [in] PP_Instance instance, + [out] PP_GamepadsSampleData data); +}; diff --git a/browser/extensions/mortar/ppapi/api/ppb_graphics_2d.idl b/browser/extensions/mortar/ppapi/api/ppb_graphics_2d.idl new file mode 100644 index 000000000000..f2fa64a58534 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_graphics_2d.idl @@ -0,0 +1,308 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * Defines the PPB_Graphics2D struct representing a 2D graphics + * context within the browser. + */ + +[generate_thunk] + +label Chrome { + M14 = 1.0, + M27 = 1.1, + M52 = 1.2 +}; + +/** + * PPB_Graphics2D defines the interface for a 2D graphics context. + */ +[macro="PPB_GRAPHICS_2D_INTERFACE"] +interface PPB_Graphics2D { + /** + * Create() creates a 2D graphics context. The returned graphics context will + * not be bound to the module instance on creation (call BindGraphics() on + * the module instance to bind the returned graphics context to the module + * instance). + * + * @param[in] instance The module instance. + * @param[in] size The size of the graphic context. + * @param[in] is_always_opaque Set the is_always_opaque flag to + * PP_TRUE if you know that you will be painting only opaque + * data to this context. This option will disable blending when compositing + * the module with the web page, which might give higher performance on some + * computers. + * + * If you set is_always_opaque, your alpha channel should always + * be set to 0xFF or there may be painting artifacts. The alpha values + * overwrite the destination alpha values without blending when + * is_always_opaque is true. + * + * @return A PP_Resource containing the 2D graphics context if + * successful or 0 if unsuccessful. + */ + PP_Resource Create( + [in] PP_Instance instance, + [in] PP_Size size, + [in] PP_Bool is_always_opaque); + + /** + * IsGraphics2D() determines if the given resource is a valid + * Graphics2D. + * + * @param[in] resource A Graphics2D context resource. + * + * @return PP_TRUE if the given resource is a valid Graphics2D, + * PP_FALSE if it is an invalid resource or is a resource of + * another type. + */ + PP_Bool IsGraphics2D( + [in] PP_Resource resource); + + /** + * Describe() retrieves the configuration for the given graphics context, + * filling the given values (which must not be NULL). + * + * @param[in] resource The 2D Graphics resource. + * @param[in,out] size The size of the 2D graphics context in the browser. + * @param[in,out] is_always_opaque Identifies whether only opaque data + * will be painted. + * + * @return Returns PP_TRUE on success or PP_FALSE if + * the resource is invalid. The output parameters will be set to 0 on a + * PP_FALSE. + */ + [always_set_output_parameters] + PP_Bool Describe( + [in] PP_Resource graphics_2d, + [out] PP_Size size, + [out] PP_Bool is_always_opaque); + + /** + * PaintImageData() enqueues a paint of the given image into the context. + * This function has no effect until you call Flush() As a result, what + * counts is the contents of the bitmap when you call Flush(), not when + * you call this function. + * + * The provided image will be placed at top_left from the top + * left of the context's internal backing store. Then the pixels contained + * in src_rect will be copied into the backing store. This + * means that the rectangle being painted will be at src_rect + * offset by top_left. + * + * The src_rect is specified in the coordinate system of the + * image being painted, not the context. For the common case of copying the + * entire image, you may specify an empty src_rect. + * + * The painted area of the source bitmap must fall entirely within the + * context. Attempting to paint outside of the context will result in an + * error. However, the source bitmap may fall outside the context, as long + * as the src_rect subset of it falls entirely within the + * context. + * + * There are two methods most modules will use for painting. The first + * method is to generate a new ImageData and then paint it. In + * this case, you'll set the location of your painting to + * top_left and set src_rect to NULL. + * The second is that you're generating small invalid regions out of a larger + * bitmap representing your entire instance. In this case, you would set the + * location of your image to (0,0) and then set src_rect to the + * pixels you changed. + * + * @param[in] resource The 2D Graphics resource. + * @param[in] image The ImageData to be painted. + * @param[in] top_left A Point representing the + * top_left location where the ImageData will be + * painted. + * @param[in] src_rect The rectangular area where the ImageData + * will be painted. + */ + void PaintImageData( + [in] PP_Resource graphics_2d, + [in] PP_Resource image_data, + [in] PP_Point top_left, + [in] PP_Rect src_rect); + + /** + * Scroll() enqueues a scroll of the context's backing store. This + * function has no effect until you call Flush(). The data within the + * provided clipping rectangle will be shifted by (dx, dy) pixels. + * + * This function will result in some exposed region which will have undefined + * contents. The module should call PaintImageData() on these exposed regions + * to give the correct contents. + * + * The scroll can be larger than the area of the clipping rectangle, which + * means the current image will be scrolled out of the rectangle. This + * scenario is not an error but will result in a no-op. + * + * @param[in] graphics_2d The 2D Graphics resource. + * @param[in] clip The clipping rectangle. + * @param[in] amount The amount the area in the clipping rectangle will + * shifted. + */ + void Scroll( + [in] PP_Resource graphics_2d, + [in] PP_Rect clip_rect, + [in] PP_Point amount); + + /** + * ReplaceContents() provides a slightly more efficient way to paint the + * entire module's image. Normally, calling PaintImageData() requires that + * the browser copy the pixels out of the image and into the graphics + * context's backing store. This function replaces the graphics context's + * backing store with the given image, avoiding the copy. + * + * The new image must be the exact same size as this graphics context. If the + * new image uses a different image format than the browser's native bitmap + * format (use PPB_ImageData.GetNativeImageDataFormat() to + * retrieve the format), then a conversion will be done inside the browser + * which may slow the performance a little bit. + * + * Note: The new image will not be painted until you call + * Flush(). + * + * After this call, you should take care to release your references to the + * image. If you paint to the image after ReplaceContents(), there is the + * possibility of significant painting artifacts because the page might use + * partially-rendered data when copying out of the backing store. + * + * In the case of an animation, you will want to allocate a new image for the + * next frame. It is best if you wait until the flush callback has executed + * before allocating this bitmap. This gives the browser the option of + * caching the previous backing store and handing it back to you (assuming + * the sizes match). In the optimal case, this means no bitmaps are allocated + * during the animation, and the backing store and "front buffer" (which the + * plugin is painting into) are just being swapped back and forth. + * + * @param[in] graphics_2d The 2D Graphics resource. + * @param[in] image The ImageData to be painted. + */ + void ReplaceContents( + [in] PP_Resource graphics_2d, + [in] PP_Resource image_data); + + /** + * Flush() flushes any enqueued paint, scroll, and replace commands to the + * backing store. This function actually executes the updates, and causes a + * repaint of the webpage, assuming this graphics context is bound to a module + * instance. + * + * Flush() runs in asynchronous mode. Specify a callback function and the + * argument for that callback function. The callback function will be + * executed on the calling thread when the image has been painted to the + * screen. While you are waiting for a flush callback, additional calls to + * Flush() will fail. + * + * Because the callback is executed (or thread unblocked) only when the + * instance's image is actually on the screen, this function provides + * a way to rate limit animations. By waiting until the image is on the + * screen before painting the next frame, you can ensure you're not + * flushing 2D graphics faster than the screen can be updated. + * + * Unbound contexts + * If the context is not bound to a module instance, you will + * still get a callback. The callback will execute after Flush() returns + * to avoid reentrancy. The callback will not wait until anything is + * painted to the screen because there will be nothing on the screen. The + * timing of this callback is not guaranteed and may be deprioritized by + * the browser because it is not affecting the user experience. + * + * Off-screen instances + * If the context is bound to an instance that is currently not visible (for + * example, scrolled out of view) it will behave like the "unbound context" + * case. + * + * Detaching a context + * If you detach a context from a module instance, any pending flush + * callbacks will be converted into the "unbound context" case. + * + * Released contexts + * A callback may or may not get called even if you have released all + * of your references to the context. This scenario can occur if there are + * internal references to the context suggesting it has not been internally + * destroyed (for example, if it is still bound to an instance) or due to + * other implementation details. As a result, you should be careful to + * check that flush callbacks are for the context you expect and that + * you're capable of handling callbacks for unreferenced contexts. + * + * Shutdown + * If a module instance is removed when a flush is pending, the + * callback will not be executed. + * + * @param[in] graphics_2d The 2D Graphics resource. + * @param[in] callback A CompletionCallback to be called when + * the image has been painted on the screen. + * + * @return Returns PP_OK on success or + * PP_ERROR_BADRESOURCE if the graphics context is invalid, + * PP_ERROR_BADARGUMENT if the callback is null and flush is + * being called from the main thread of the module, or + * PP_ERROR_INPROGRESS if a flush is already pending that has + * not issued its callback yet. In the failure case, nothing will be updated + * and no callback will be scheduled. + */ + int32_t Flush( + [in] PP_Resource graphics_2d, + [in] PP_CompletionCallback callback); + + /** + * SetScale() sets the scale factor that will be applied when painting the + * graphics context onto the output device. Typically, if rendering at device + * resolution is desired, the context would be created with the width and + * height scaled up by the view's GetDeviceScale and SetScale called with a + * scale of 1.0 / GetDeviceScale(). For example, if the view resource passed + * to DidChangeView has a rectangle of (w=200, h=100) and a device scale of + * 2.0, one would call Create with a size of (w=400, h=200) and then call + * SetScale with 0.5. One would then treat each pixel in the context as a + * single device pixel. + * + * @param[in] resource A Graphics2D context resource. + * @param[in] scale The scale to apply when painting. + * + * @return Returns PP_TRUE on success or PP_FALSE if + * the resource is invalid or the scale factor is 0 or less. + */ + [version=1.1] + PP_Bool SetScale( + [in] PP_Resource resource, + [in] float_t scale); + + /*** + * GetScale() gets the scale factor that will be applied when painting the + * graphics context onto the output device. + * + * @param[in] resource A Graphics2D context resource. + * + * @return Returns the scale factor for the graphics context. If the resource + * is not a valid Graphics2D context, this will return 0.0. + */ + [version=1.1] + float_t GetScale( + [in] PP_Resource resource); + + /** + * SetLayerTransform() sets a transformation factor that will be applied for + * the current graphics context displayed on the output device. If both + * SetScale and SetLayerTransform will be used, they are going to get combined + * for the final result. + * + * This function has no effect until you call Flush(). + * + * @param[in] scale The scale to be applied. + * @param[in] origin The origin of the scale. + * @param[in] translate The translation to be applied. + * + * @return Returns PP_TRUE on success or PP_FALSE + * if the resource is invalid or the scale factor is 0 or less. + */ + [version=1.2] + PP_Bool SetLayerTransform( + [in] PP_Resource resource, + [in] float_t scale, + [in] PP_Point origin, + [in] PP_Point translate); +}; + diff --git a/browser/extensions/mortar/ppapi/api/ppb_graphics_3d.idl b/browser/extensions/mortar/ppapi/api/ppb_graphics_3d.idl new file mode 100644 index 000000000000..b39ad24e38d3 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_graphics_3d.idl @@ -0,0 +1,298 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * Defines the PPB_Graphics3D struct representing a 3D graphics + * context within the browser. + */ + +[generate_thunk] + +label Chrome { + M15 = 1.0 +}; + +#inline c +/* Add 3D graphics enums */ +#include "ppapi/c/pp_graphics_3d.h" +#endinl + +/** + * PPB_Graphics3D defines the interface for a 3D graphics context. + * Example usage from plugin code: + * + * Setup: + * @code + * PP_Resource context; + * int32_t attribs[] = {PP_GRAPHICS3DATTRIB_WIDTH, 800, + * PP_GRAPHICS3DATTRIB_HEIGHT, 800, + * PP_GRAPHICS3DATTRIB_NONE}; + * context = g3d->Create(instance, 0, attribs); + * inst->BindGraphics(instance, context); + * @endcode + * + * Present one frame: + * @code + * PP_CompletionCallback callback = { + * DidFinishSwappingBuffers, 0, PP_COMPLETIONCALLBACK_FLAG_NONE, + * }; + * gles2->Clear(context, GL_COLOR_BUFFER_BIT); + * g3d->SwapBuffers(context, callback); + * @endcode + * + * Shutdown: + * @code + * core->ReleaseResource(context); + * @endcode + */ +[macro="PPB_GRAPHICS_3D_INTERFACE"] +interface PPB_Graphics3D { + /** + * GetAttribMaxValue() retrieves the maximum supported value for the + * given attribute. This function may be used to check if a particular + * attribute value is supported before attempting to create a context. + * + * @param[in] instance The module instance. + * @param[in] attribute The attribute for which maximum value is queried. + * Attributes that can be queried for include: + * - PP_GRAPHICS3DATTRIB_ALPHA_SIZE + * - PP_GRAPHICS3DATTRIB_BLUE_SIZE + * - PP_GRAPHICS3DATTRIB_GREEN_SIZE + * - PP_GRAPHICS3DATTRIB_RED_SIZE + * - PP_GRAPHICS3DATTRIB_DEPTH_SIZE + * - PP_GRAPHICS3DATTRIB_STENCIL_SIZE + * - PP_GRAPHICS3DATTRIB_SAMPLES + * - PP_GRAPHICS3DATTRIB_SAMPLE_BUFFERS + * - PP_GRAPHICS3DATTRIB_WIDTH + * - PP_GRAPHICS3DATTRIB_HEIGHT + * @param[out] value The maximum supported value for attribute + * + * @return Returns PP_TRUE on success or the following on error: + * - PP_ERROR_BADRESOURCE if instance is invalid + * - PP_ERROR_BADARGUMENT if attribute is invalid + * or value is 0 + */ + int32_t GetAttribMaxValue( + [in] PP_Resource instance, + [in] int32_t attribute, + [out] int32_t value); + + /** + * Create() creates and initializes a 3D rendering context. + * The returned context is off-screen to start with. It must be attached to + * a plugin instance using PPB_Instance::BindGraphics to draw + * on the web page. + * + * @param[in] instance The module instance. + * + * @param[in] share_context The 3D context with which the created context + * would share resources. If share_context is not 0, then all + * shareable data, as defined by the client API (note that for OpenGL and + * OpenGL ES, shareable data excludes texture objects named 0) will be shared + * by share_context, all other contexts share_context + * already shares with, and the newly created context. An arbitrary number of + * PPB_Graphics3D can share data in this fashion. + * + * @param[in] attrib_list specifies a list of attributes for the context. + * It is a list of attribute name-value pairs in which each attribute is + * immediately followed by the corresponding desired value. The list is + * terminated with PP_GRAPHICS3DATTRIB_NONE. + * The attrib_list may be 0 or empty (first attribute is + * PP_GRAPHICS3DATTRIB_NONE). If an attribute is not + * specified in attrib_list, then the default value is used + * (it is said to be specified implicitly). + * Attributes for the context are chosen according to an attribute-specific + * criteria. Attributes can be classified into two categories: + * - AtLeast: The attribute value in the returned context meets or exceeds + * the value specified in attrib_list. + * - Exact: The attribute value in the returned context is equal to + * the value specified in attrib_list. + * + * Attributes that can be specified in attrib_list include: + * - PP_GRAPHICS3DATTRIB_ALPHA_SIZE: + * Category: AtLeast Default: 0. + * - PP_GRAPHICS3DATTRIB_BLUE_SIZE: + * Category: AtLeast Default: 0. + * - PP_GRAPHICS3DATTRIB_GREEN_SIZE: + * Category: AtLeast Default: 0. + * - PP_GRAPHICS3DATTRIB_RED_SIZE: + * Category: AtLeast Default: 0. + * - PP_GRAPHICS3DATTRIB_DEPTH_SIZE: + * Category: AtLeast Default: 0. + * - PP_GRAPHICS3DATTRIB_STENCIL_SIZE: + * Category: AtLeast Default: 0. + * - PP_GRAPHICS3DATTRIB_SAMPLES: + * Category: AtLeast Default: 0. + * - PP_GRAPHICS3DATTRIB_SAMPLE_BUFFERS: + * Category: AtLeast Default: 0. + * - PP_GRAPHICS3DATTRIB_WIDTH: + * Category: Exact Default: 0. + * - PP_GRAPHICS3DATTRIB_HEIGHT: + * Category: Exact Default: 0. + * - PP_GRAPHICS3DATTRIB_SWAP_BEHAVIOR: + * Category: Exact Default: Implementation defined. + * + * @return A PP_Resource containing the 3D graphics context if + * successful or 0 if unsuccessful. + */ + PP_Resource Create( + [in] PP_Instance instance, + [in] PP_Resource share_context, + [in] int32_t[] attrib_list); + + /** + * IsGraphics3D() determines if the given resource is a valid + * Graphics3D context. + * + * @param[in] resource A Graphics3D context resource. + * + * @return PP_TRUE if the given resource is a valid Graphics3D, + * PP_FALSE if it is an invalid resource or is a resource of + * another type. + */ + PP_Bool IsGraphics3D( + [in] PP_Resource resource); + + /** + * GetAttribs() retrieves the value for each attribute in + * attrib_list. + * + * @param[in] context The 3D graphics context. + * @param[in,out] attrib_list The list of attributes that are queried. + * attrib_list has the same structure as described for + * PPB_Graphics3D::Create. It is both input and output + * structure for this function. All attributes specified in + * PPB_Graphics3D::Create can be queried for. + * + * @return Returns PP_OK on success or: + * - PP_ERROR_BADRESOURCE if context is invalid + * - PP_ERROR_BADARGUMENT if attrib_list is 0 or any attribute + * in the attrib_list is not a valid attribute. + * + * Example usage: To get the values for rgb bits in the + * color buffer, this function must be called as following: + * @code + * int attrib_list[] = {PP_GRAPHICS3DATTRIB_RED_SIZE, 0, + * PP_GRAPHICS3DATTRIB_GREEN_SIZE, 0, + * PP_GRAPHICS3DATTRIB_BLUE_SIZE, 0, + * PP_GRAPHICS3DATTRIB_NONE}; + * GetAttribs(context, attrib_list); + * int red_bits = attrib_list[1]; + * int green_bits = attrib_list[3]; + * int blue_bits = attrib_list[5]; + * @endcode + */ + int32_t GetAttribs( + [in] PP_Resource context, + [inout] int32_t[] attrib_list); + + /** + * SetAttribs() sets the values for each attribute in + * attrib_list. + * + * @param[in] context The 3D graphics context. + * @param[in] attrib_list The list of attributes whose values need to be set. + * attrib_list has the same structure as described for + * PPB_Graphics3D::Create. + * Attributes that can be specified are: + * - PP_GRAPHICS3DATTRIB_SWAP_BEHAVIOR + * + * @return Returns PP_OK on success or: + * - PP_ERROR_BADRESOURCE if context is invalid. + * - PP_ERROR_BADARGUMENT if attrib_list is 0 or + * any attribute in the attrib_list is not a valid attribute. + */ + int32_t SetAttribs( + [in] PP_Resource context, + [in] int32_t[] attrib_list); + + /** + * GetError() returns the current state of the given 3D context. + * + * The recoverable error conditions that have no side effect are + * detected and returned immediately by all functions in this interface. + * In addition the implementation may get into a fatal state while + * processing a command. In this case the application must destroy the + * context and reinitialize client API state and objects to continue + * rendering. + * + * Note that the same error code is also returned in the SwapBuffers callback. + * It is recommended to handle error in the SwapBuffers callback because + * GetError is synchronous. This function may be useful in rare cases where + * drawing a frame is expensive and you want to verify the result of + * ResizeBuffers before attempting to draw a frame. + * + * @param[in] The 3D graphics context. + * @return Returns: + * - PP_OK if no error + * - PP_ERROR_NOMEMORY + * - PP_ERROR_CONTEXT_LOST + */ + int32_t GetError( + [in] PP_Resource context); + + /** + * ResizeBuffers() resizes the backing surface for context. + * + * If the surface could not be resized due to insufficient resources, + * PP_ERROR_NOMEMORY error is returned on the next + * SwapBuffers callback. + * + * @param[in] context The 3D graphics context. + * @param[in] width The width of the backing surface. + * @param[in] height The height of the backing surface. + * @return Returns PP_OK on success or: + * - PP_ERROR_BADRESOURCE if context is invalid. + * - PP_ERROR_BADARGUMENT if the value specified for + * width or height is less than zero. + */ + int32_t ResizeBuffers( + [in] PP_Resource context, + [in] int32_t width, + [in] int32_t height); + + /** + * SwapBuffers() makes the contents of the color buffer available for + * compositing. This function has no effect on off-screen surfaces - ones not + * bound to any plugin instance. The contents of ancillary buffers are always + * undefined after calling SwapBuffers. The contents of the color + * buffer are undefined if the value of the + * PP_GRAPHICS3DATTRIB_SWAP_BEHAVIOR attribute of context is not + * PP_GRAPHICS3DATTRIB_BUFFER_PRESERVED. + * + * SwapBuffers runs in asynchronous mode. Specify a callback + * function and the argument for that callback function. The callback function + * will be executed on the calling thread after the color buffer has been + * composited with rest of the html page. While you are waiting for a + * SwapBuffers callback, additional calls to SwapBuffers will fail. + * + * Because the callback is executed (or thread unblocked) only when the + * plugin's current state is actually on the screen, this function provides a + * way to rate limit animations. By waiting until the image is on the screen + * before painting the next frame, you can ensure you're not generating + * updates faster than the screen can be updated. + * + * SwapBuffers performs an implicit flush operation on context. + * If the context gets into an unrecoverable error condition while + * processing a command, the error code will be returned as the argument + * for the callback. The callback may return the following error codes: + * - PP_ERROR_NOMEMORY + * - PP_ERROR_CONTEXT_LOST + * Note that the same error code may also be obtained by calling GetError. + * + * @param[in] context The 3D graphics context. + * @param[in] callback The callback that will executed when + * SwapBuffers completes. + * + * @return Returns PP_OK on success or: + * - PP_ERROR_BADRESOURCE if context is invalid. + * - PP_ERROR_BADARGUMENT if callback is invalid. + * + */ + int32_t SwapBuffers( + [in] PP_Resource context, + [in] PP_CompletionCallback callback); +}; + diff --git a/browser/extensions/mortar/ppapi/api/ppb_host_resolver.idl b/browser/extensions/mortar/ppapi/api/ppb_host_resolver.idl new file mode 100644 index 000000000000..20ff906a37f2 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_host_resolver.idl @@ -0,0 +1,141 @@ +/* Copyright 2013 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_HostResolver interface. + */ + +[generate_thunk] + +label Chrome { + M29 = 1.0 +}; + +/** + * PP_HostResolver_Flag is an enumeration of flags which can be + * OR-ed and passed to the host resolver. Currently there is only one flag + * defined. + */ +[assert_size(4)] +enum PP_HostResolver_Flag { + /** + * Hint to request the canonical name of the host, which can be retrieved by + * GetCanonicalName(). + */ + PP_HOSTRESOLVER_FLAG_CANONNAME = 1 << 0 +}; + +/** + * PP_HostResolver_Hint represents hints for host resolution. + */ +[assert_size(8)] +struct PP_HostResolver_Hint { + /** + * Network address family. + */ + PP_NetAddress_Family family; + /** + * Combination of flags from PP_HostResolver_Flag. + */ + int32_t flags; +}; + +/** + * The PPB_HostResolver interface supports host name + * resolution. + * + * Permissions: In order to run Resolve(), apps permission + * socket with subrule resolve-host is required. + * For more details about network communication permissions, please see: + * http://developer.chrome.com/apps/app_network.html + */ +interface PPB_HostResolver { + /** + * Creates a host resolver resource. + * + * @param[in] instance A PP_Instance identifying one instance of + * a module. + * + * @return A PP_Resource corresponding to a host reslover or 0 + * on failure. + */ + PP_Resource Create([in] PP_Instance instance); + + /** + * Determines if a given resource is a host resolver. + * + * @param[in] resource A PP_Resource to check. + * + * @return PP_TRUE if the input is a + * PPB_HostResolver resource; PP_FALSE otherwise. + */ + PP_Bool IsHostResolver([in] PP_Resource resource); + + /** + * Requests resolution of a host name. If the call completes successfully, the + * results can be retrieved by GetCanonicalName(), + * GetNetAddressCount() and GetNetAddress(). + * + * @param[in] host_resolver A PP_Resource corresponding to a host + * resolver. + * @param[in] host The host name (or IP address literal) to resolve. + * @param[in] port The port number to be set in the resulting network + * addresses. + * @param[in] hint A PP_HostResolver_Hint structure providing + * hints for host resolution. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * PP_ERROR_NOACCESS will be returned if the caller doesn't have + * required permissions. PP_ERROR_NAME_NOT_RESOLVED will be + * returned if the host name couldn't be resolved. + */ + int32_t Resolve([in] PP_Resource host_resolver, + [in] str_t host, + [in] uint16_t port, + [in] PP_HostResolver_Hint hint, + [in] PP_CompletionCallback callback); + + /** + * Gets the canonical name of the host. + * + * @param[in] host_resolver A PP_Resource corresponding to a host + * resolver. + * + * @return A string PP_Var on success, which is an empty string + * if PP_HOSTRESOLVER_FLAG_CANONNAME is not set in the hint flags + * when calling Resolve(); an undefined PP_Var if + * there is a pending Resolve() call or the previous + * Resolve() call failed. + */ + PP_Var GetCanonicalName([in] PP_Resource host_resolver); + + /** + * Gets the number of network addresses. + * + * @param[in] host_resolver A PP_Resource corresponding to a host + * resolver. + * + * @return The number of available network addresses on success; 0 if there is + * a pending Resolve() call or the previous + * Resolve() call failed. + */ + uint32_t GetNetAddressCount([in] PP_Resource host_resolver); + + /** + * Gets a network address. + * + * @param[in] host_resolver A PP_Resource corresponding to a host + * resolver. + * @param[in] index An index indicating which address to return. + * + * @return A PPB_NetAddress resource on success; 0 if there is a + * pending Resolve() call or the previous Resolve() + * call failed, or the specified index is out of range. + */ + PP_Resource GetNetAddress([in] PP_Resource host_resolver, + [in] uint32_t index); +}; diff --git a/browser/extensions/mortar/ppapi/api/ppb_image_data.idl b/browser/extensions/mortar/ppapi/api/ppb_image_data.idl new file mode 100644 index 000000000000..8e1d09dc2634 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_image_data.idl @@ -0,0 +1,188 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_ImageData struct for determining how + * a browser handles image data. + */ + +[generate_thunk] + +label Chrome { + M14 = 1.0 +}; + +/** + * PP_ImageDataFormat is an enumeration of the different types of + * image data formats. + * + * The third part of each enumeration value describes the memory layout from + * the lowest address to the highest. For example, BGRA means the B component + * is stored in the lowest address, no matter what endianness the platform is + * using. + * + * The PREMUL suffix implies pre-multiplied alpha is used. In this mode, the + * red, green and blue color components of the pixel data supplied to an image + * data should be pre-multiplied by their alpha value. For example: starting + * with floating point color components, here is how to convert them to 8-bit + * premultiplied components for image data: + * + * ...components of a pixel, floats ranging from 0 to 1... + * float red = 1.0f; + * float green = 0.50f; + * float blue = 0.0f; + * float alpha = 0.75f; + * ...components for image data are 8-bit values ranging from 0 to 255... + * uint8_t image_data_red_premul = (uint8_t)(red * alpha * 255.0f); + * + * uint8_t image_data_green_premul = (uint8_t)(green * alpha * 255.0f); + * + * uint8_t image_data_blue_premul = (uint8_t)(blue * alpha * 255.0f); + * + * uint8_t image_data_alpha_premul = (uint8_t)(alpha * 255.0f); + * + * Note: The resulting pre-multiplied red, green and blue + * components should not be greater than the alpha value. + */ +[assert_size(4)] +enum PP_ImageDataFormat { + PP_IMAGEDATAFORMAT_BGRA_PREMUL, + PP_IMAGEDATAFORMAT_RGBA_PREMUL +}; + +/** + * The PP_ImageDataDesc structure represents a description of + * image data. + */ +[assert_size(16)] +struct PP_ImageDataDesc { + /** + * This value represents one of the image data types in the + * PP_ImageDataFormat enum. + */ + PP_ImageDataFormat format; + + /** This value represents the size of the bitmap in pixels. */ + PP_Size size; + + /** + * This value represents the row width in bytes. This may be different than + * width * 4 since there may be padding at the end of the lines. + */ + int32_t stride; +}; + +/** + * The PPB_ImageData interface contains pointers to several + * functions for determining the browser's treatment of image data. + */ +interface PPB_ImageData { + /** + * GetNativeImageDataFormat() returns the browser's preferred format for + * image data. The browser uses this format internally for painting. Other + * formats may require internal conversions to paint or may have additional + * restrictions depending on the function. + * + * @return A PP_ImageDataFormat containing the preferred format. + */ + PP_ImageDataFormat GetNativeImageDataFormat(); + + /** + * IsImageDataFormatSupported() determines if the given image data format is + * supported by the browser. Note: PP_IMAGEDATAFORMAT_BGRA_PREMUL + * and PP_IMAGEDATAFORMAT_RGBA_PREMUL formats are always + * supported. Other image formats do not make this guarantee, and should be + * checked first with IsImageDataFormatSupported() before using. + * + * @param[in] format The image data format. + * + * @return A PP_Bool with PP_TRUE if the given + * image data format is supported by the browser. + */ + PP_Bool IsImageDataFormatSupported( + [in] PP_ImageDataFormat format); + + /** + * Create() allocates an image data resource with the given format and size. + * + * For security reasons, if uninitialized, the bitmap will not contain random + * memory, but may contain data from a previous image produced by the same + * module if the bitmap was cached and re-used. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * @param[in] format The desired image data format. + * @param[in] size A pointer to a PP_Size containing the image + * size. + * @param[in] init_to_zero A PP_Bool to determine transparency + * at creation. + * Set the init_to_zero flag if you want the bitmap initialized + * to transparent during the creation process. If this flag is not set, the + * current contents of the bitmap will be undefined, and the module should + * be sure to set all the pixels. + * + * @return A PP_Resource with a nonzero ID on success or zero on + * failure. Failure means the instance, image size, or format was invalid. + */ + PP_Resource Create( + [in] PP_Instance instance, + [in] PP_ImageDataFormat format, + [in] PP_Size size, + [in] PP_Bool init_to_zero); + + /** + * IsImageData() determines if a given resource is image data. + * + * @param[in] image_data A PP_Resource corresponding to image + * data. + * + * @return A PP_Bool with PP_TRUE if the given + * resource is an image data or PP_FALSE if the resource is + * invalid or some type other than image data. + */ + PP_Bool IsImageData( + [in] PP_Resource image_data); + + /** + * Describe() computes the description of the + * image data. + * + * @param[in] image_data A PP_Resource corresponding to image + * data. + * @param[in,out] desc A pointer to a PP_ImageDataDesc + * containing the description. + * + * @return A PP_Bool with PP_TRUE on success or + * PP_FALSE if the resource is not an image data. On + * PP_FALSE, the desc structure will be filled + * with 0. + */ + [always_set_output_parameters] + PP_Bool Describe( + [in] PP_Resource image_data, + [out] PP_ImageDataDesc desc); + + /** + * Map() maps an image data into the module address space. + * + * @param[in] image_data A PP_Resource corresponding to image + * data. + * + * @return A pointer to the beginning of the data. + */ + mem_t Map( + [in] PP_Resource image_data); + + /** + * Unmap is a pointer to a function that unmaps an image data from the module + * address space. + * + * @param[in] image_data A PP_Resource corresponding to image + * data. + */ + void Unmap( + [in] PP_Resource image_data); +}; + diff --git a/browser/extensions/mortar/ppapi/api/ppb_input_event.idl b/browser/extensions/mortar/ppapi/api/ppb_input_event.idl new file mode 100644 index 000000000000..b737a2e4832b --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_input_event.idl @@ -0,0 +1,1085 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the Input Event interfaces. + */ + +label Chrome { + M13 = 1.0, + M14 = 1.1, + M34 = 1.2, + M55 = 1.3 +}; + +/** + * This enumeration contains the types of input events. + */ +[assert_size(4)] +enum PP_InputEvent_Type { + PP_INPUTEVENT_TYPE_UNDEFINED = -1, + + /** + * Notification that a mouse button was pressed. + * + * Register for this event using the PP_INPUTEVENT_CLASS_MOUSE class. + */ + PP_INPUTEVENT_TYPE_MOUSEDOWN = 0, + + /** + * Notification that a mouse button was released. + * + * Register for this event using the PP_INPUTEVENT_CLASS_MOUSE class. + */ + PP_INPUTEVENT_TYPE_MOUSEUP = 1, + + /** + * Notification that a mouse button was moved when it is over the instance + * or dragged out of it. + * + * Register for this event using the PP_INPUTEVENT_CLASS_MOUSE class. + */ + PP_INPUTEVENT_TYPE_MOUSEMOVE = 2, + + /** + * Notification that the mouse entered the instance's bounds. + * + * Register for this event using the PP_INPUTEVENT_CLASS_MOUSE class. + */ + PP_INPUTEVENT_TYPE_MOUSEENTER = 3, + + /** + * Notification that a mouse left the instance's bounds. + * + * Register for this event using the PP_INPUTEVENT_CLASS_MOUSE class. + */ + PP_INPUTEVENT_TYPE_MOUSELEAVE = 4, + + /** + * Notification that the scroll wheel was used. + * + * Register for this event using the PP_INPUTEVENT_CLASS_WHEEL class. + */ + PP_INPUTEVENT_TYPE_WHEEL = 5, + + /** + * Notification that a key transitioned from "up" to "down". + * + * Register for this event using the PP_INPUTEVENT_CLASS_KEYBOARD class. + */ + PP_INPUTEVENT_TYPE_RAWKEYDOWN = 6, + + /** + * Notification that a key was pressed. This does not necessarily correspond + * to a character depending on the key and language. Use the + * PP_INPUTEVENT_TYPE_CHAR for character input. + * + * Register for this event using the PP_INPUTEVENT_CLASS_KEYBOARD class. + */ + PP_INPUTEVENT_TYPE_KEYDOWN = 7, + + /** + * Notification that a key was released. + * + * Register for this event using the PP_INPUTEVENT_CLASS_KEYBOARD class. + */ + PP_INPUTEVENT_TYPE_KEYUP = 8, + + /** + * Notification that a character was typed. Use this for text input. Key + * down events may generate 0, 1, or more than one character event depending + * on the key, locale, and operating system. + * + * Register for this event using the PP_INPUTEVENT_CLASS_KEYBOARD class. + */ + PP_INPUTEVENT_TYPE_CHAR = 9, + + /** + * Notification that a context menu should be shown. + * + * This message will be sent when the user right-clicks or performs another + * OS-specific mouse command that should open a context menu. When this event + * is delivered depends on the system, on some systems (Mac) it will + * delivered after the mouse down event, and on others (Windows) it will be + * delivered after the mouse up event. + * + * You will always get the normal mouse events. For example, you may see + * MOUSEDOWN,CONTEXTMENU,MOUSEUP or MOUSEDOWN,MOUSEUP,CONTEXTMENU. + * + * The return value from the event handler determines if the context menu + * event will be passed to the page when you are using filtered input events + * (via RequestFilteringInputEvents()). In non-filtering mode the event will + * never be propagated and no context menu will be displayed. If you are + * handling mouse events in filtering mode, you may want to return true from + * this event even if you do not support a context menu to suppress the + * default one. + * + * Register for this event using the PP_INPUTEVENT_CLASS_MOUSE class. + */ + PP_INPUTEVENT_TYPE_CONTEXTMENU = 10, + + /** + * Notification that an input method composition process has just started. + * + * Register for this event using the PP_INPUTEVENT_CLASS_IME class. + */ + PP_INPUTEVENT_TYPE_IME_COMPOSITION_START = 11, + + /** + * Notification that the input method composition string is updated. + * + * Register for this event using the PP_INPUTEVENT_CLASS_IME class. + */ + PP_INPUTEVENT_TYPE_IME_COMPOSITION_UPDATE = 12, + + /** + * Notification that an input method composition process has completed. + * + * Register for this event using the PP_INPUTEVENT_CLASS_IME class. + */ + PP_INPUTEVENT_TYPE_IME_COMPOSITION_END = 13, + + /** + * Notification that an input method committed a string. + * + * Register for this event using the PP_INPUTEVENT_CLASS_IME class. + */ + PP_INPUTEVENT_TYPE_IME_TEXT = 14, + + /** + * Notification that a finger was placed on a touch-enabled device. + * + * Register for this event using the PP_INPUTEVENT_CLASS_TOUCH class. + */ + PP_INPUTEVENT_TYPE_TOUCHSTART = 15, + + /** + * Notification that a finger was moved on a touch-enabled device. + * + * Register for this event using the PP_INPUTEVENT_CLASS_TOUCH class. + */ + PP_INPUTEVENT_TYPE_TOUCHMOVE = 16, + + /** + * Notification that a finger was released on a touch-enabled device. + * + * Register for this event using the PP_INPUTEVENT_CLASS_TOUCH class. + */ + PP_INPUTEVENT_TYPE_TOUCHEND = 17, + + /** + * Notification that a touch event was canceled. + * + * Register for this event using the PP_INPUTEVENT_CLASS_TOUCH class. + */ + PP_INPUTEVENT_TYPE_TOUCHCANCEL = 18 +}; + +/** + * This enumeration contains event modifier constants. Each modifier is one + * bit. Retrieve the modifiers from an input event using the GetEventModifiers + * function on PPB_InputEvent. + */ +[assert_size(4)] +enum PP_InputEvent_Modifier { + PP_INPUTEVENT_MODIFIER_SHIFTKEY = 1 << 0, + PP_INPUTEVENT_MODIFIER_CONTROLKEY = 1 << 1, + PP_INPUTEVENT_MODIFIER_ALTKEY = 1 << 2, + PP_INPUTEVENT_MODIFIER_METAKEY = 1 << 3, + PP_INPUTEVENT_MODIFIER_ISKEYPAD = 1 << 4, + PP_INPUTEVENT_MODIFIER_ISAUTOREPEAT = 1 << 5, + PP_INPUTEVENT_MODIFIER_LEFTBUTTONDOWN = 1 << 6, + PP_INPUTEVENT_MODIFIER_MIDDLEBUTTONDOWN = 1 << 7, + PP_INPUTEVENT_MODIFIER_RIGHTBUTTONDOWN = 1 << 8, + PP_INPUTEVENT_MODIFIER_CAPSLOCKKEY = 1 << 9, + PP_INPUTEVENT_MODIFIER_NUMLOCKKEY = 1 << 10, + PP_INPUTEVENT_MODIFIER_ISLEFT = 1 << 11, + PP_INPUTEVENT_MODIFIER_ISRIGHT = 1 << 12, + [version=1.3] + PP_INPUTEVENT_MODIFIER_ISPEN = 1 << 13, + [version=1.3] + PP_INPUTEVENT_MODIFIER_ISERASER = 1 << 14 +}; + +/** + * This enumeration contains constants representing each mouse button. To get + * the mouse button for a mouse down or up event, use GetMouseButton on + * PPB_InputEvent. + */ +[assert_size(4)] +enum PP_InputEvent_MouseButton { + PP_INPUTEVENT_MOUSEBUTTON_NONE = -1, + PP_INPUTEVENT_MOUSEBUTTON_LEFT = 0, + PP_INPUTEVENT_MOUSEBUTTON_MIDDLE = 1, + PP_INPUTEVENT_MOUSEBUTTON_RIGHT = 2 +}; + +[assert_size(4)] +enum PP_InputEvent_Class { + /** + * Request mouse input events. + * + * Normally you will request mouse events by calling RequestInputEvents(). + * The only use case for filtered events (via RequestFilteringInputEvents()) + * is for instances that have irregular outlines and you want to perform hit + * testing, which is very uncommon. Requesting non-filtered mouse events will + * lead to higher performance. + */ + PP_INPUTEVENT_CLASS_MOUSE = 1 << 0, + + /** + * Requests keyboard events. Often you will want to request filtered mode + * (via RequestFilteringInputEvents) for keyboard events so you can pass on + * events (by returning false) that you don't handle. For example, if you + * don't request filtered mode and the user pressed "Page Down" when your + * instance has focus, the page won't scroll which will be a poor experience. + * + * A small number of tab and window management commands like Alt-F4 are never + * sent to the page. You can not request these keyboard commands since it + * would allow pages to trap users on a page. + */ + PP_INPUTEVENT_CLASS_KEYBOARD = 1 << 1, + + /** + * Identifies scroll wheel input event. Wheel events must be requested in + * filtering mode via RequestFilteringInputEvents(). This is because many + * wheel commands should be forwarded to the page. + * + * Most instances will not need this event. Consuming wheel events by + * returning true from your filtered event handler will prevent the user from + * scrolling the page when the mouse is over the instance which can be very + * annoying. + * + * If you handle wheel events (for example, you have a document viewer which + * the user can scroll), the recommended behavior is to return false only if + * the wheel event actually causes your document to scroll. When the user + * reaches the end of the document, return false to indicating that the event + * was not handled. This will then forward the event to the containing page + * for scrolling, producing the nested scrolling behavior users expect from + * frames in a page. + */ + PP_INPUTEVENT_CLASS_WHEEL = 1 << 2, + + /** + * Identifies touch input events. + * + * Request touch events only if you intend to handle them. If the browser + * knows you do not need to handle touch events, it can handle them at a + * higher level and achieve higher performance. If the plugin does not + * register for touch-events, then it will receive synthetic mouse events that + * are generated from the touch events (e.g. mouse-down for touch-start, + * mouse-move for touch-move (with left-button down), and mouse-up for + * touch-end. If the plugin does register for touch events, then the synthetic + * mouse events are not created. + */ + PP_INPUTEVENT_CLASS_TOUCH = 1 << 3, + + /** + * Identifies IME composition input events. + * + * Request this input event class if you allow on-the-spot IME input. + */ + PP_INPUTEVENT_CLASS_IME = 1 << 4 +}; + +/** + * The PPB_InputEvent interface contains pointers to several + * functions related to generic input events on the browser. + */ +[version=1.0, macro="PPB_INPUT_EVENT_INTERFACE"] +interface PPB_InputEvent { + /** + * RequestInputEvent() requests that input events corresponding to the given + * input events are delivered to the instance. + * + * It's recommended that you use RequestFilteringInputEvents() for keyboard + * events instead of this function so that you don't interfere with normal + * browser accelerators. + * + * By default, no input events are delivered. Call this function with the + * classes of events you are interested in to have them be delivered to + * the instance. Calling this function will override any previous setting for + * each specified class of input events (for example, if you previously + * called RequestFilteringInputEvents(), this function will set those events + * to non-filtering mode). + * + * Input events may have high overhead, so you should only request input + * events that your plugin will actually handle. For example, the browser may + * do optimizations for scroll or touch events that can be processed + * substantially faster if it knows there are no non-default receivers for + * that message. Requesting that such messages be delivered, even if they are + * processed very quickly, may have a noticeable effect on the performance of + * the page. + * + * Note that synthetic mouse events will be generated from touch events if + * (and only if) you do not request touch events. + * + * When requesting input events through this function, the events will be + * delivered and not bubbled to the default handlers. + * + * Example: + * @code + * RequestInputEvents(instance, PP_INPUTEVENT_CLASS_MOUSE); + * RequestFilteringInputEvents(instance, + * PP_INPUTEVENT_CLASS_WHEEL | PP_INPUTEVENT_CLASS_KEYBOARD); + * @endcode + * + * @param instance The PP_Instance of the instance requesting + * the given events. + * + * @param event_classes A combination of flags from + * PP_InputEvent_Class that identifies the classes of events the + * instance is requesting. The flags are combined by logically ORing their + * values. + * + * @return PP_OK if the operation succeeded, + * PP_ERROR_BADARGUMENT if instance is invalid, or + * PP_ERROR_NOTSUPPORTED if one of the event class bits were + * illegal. In the case of an invalid bit, all valid bits will be applied + * and only the illegal bits will be ignored. The most common cause of a + * PP_ERROR_NOTSUPPORTED return value is requesting keyboard + * events, these must use RequestFilteringInputEvents(). + */ + int32_t RequestInputEvents([in] PP_Instance instance, + [in] uint32_t event_classes); + + /** + * RequestFilteringInputEvents() requests that input events corresponding to + * the given input events are delivered to the instance for filtering. + * + * By default, no input events are delivered. In most cases you would + * register to receive events by calling RequestInputEvents(). In some cases, + * however, you may wish to filter events such that they can be bubbled up + * to the default handlers. In this case, register for those classes of + * events using this function instead of RequestInputEvents(). + * + * Filtering input events requires significantly more overhead than just + * delivering them to the instance. As such, you should only request + * filtering in those cases where it's absolutely necessary. The reason is + * that it requires the browser to stop and block for the instance to handle + * the input event, rather than sending the input event asynchronously. This + * can have significant overhead. + * + * Example: + * @code + * RequestInputEvents(instance, PP_INPUTEVENT_CLASS_MOUSE); + * RequestFilteringInputEvents(instance, + * PP_INPUTEVENT_CLASS_WHEEL | PP_INPUTEVENT_CLASS_KEYBOARD); + * @endcode + * + * @return PP_OK if the operation succeeded, + * PP_ERROR_BADARGUMENT if instance is invalid, or + * PP_ERROR_NOTSUPPORTED if one of the event class bits were + * illegal. In the case of an invalid bit, all valid bits will be applied + * and only the illegal bits will be ignored. + */ + int32_t RequestFilteringInputEvents([in] PP_Instance instance, + [in] uint32_t event_classes); + + /** + * ClearInputEventRequest() requests that input events corresponding to the + * given input classes no longer be delivered to the instance. + * + * By default, no input events are delivered. If you have previously + * requested input events via RequestInputEvents() or + * RequestFilteringInputEvents(), this function will unregister handling + * for the given instance. This will allow greater browser performance for + * those events. + * + * Note that you may still get some input events after clearing the flag if + * they were dispatched before the request was cleared. For example, if + * there are 3 mouse move events waiting to be delivered, and you clear the + * mouse event class during the processing of the first one, you'll still + * receive the next two. You just won't get more events generated. + * + * @param instance The PP_Instance of the instance requesting + * to no longer receive the given events. + * + * @param event_classes A combination of flags from + * PP_InputEvent_Class that identify the classes of events the + * instance is no longer interested in. + */ + void ClearInputEventRequest([in] PP_Instance instance, + [in] uint32_t event_classes); + + /** + * IsInputEvent() returns true if the given resource is a valid input event + * resource. + * + * @param[in] resource A PP_Resource corresponding to a generic + * resource. + * + * @return PP_TRUE if the given resource is a valid input event + * resource. + */ + PP_Bool IsInputEvent([in] PP_Resource resource); + + /** + * GetType() returns the type of input event for the given input event + * resource. + * + * @param[in] resource A PP_Resource corresponding to an input + * event. + * + * @return A PP_InputEvent_Type if its a valid input event or + * PP_INPUTEVENT_TYPE_UNDEFINED if the resource is invalid. + */ + PP_InputEvent_Type GetType([in] PP_Resource event); + + /** + * GetTimeStamp() Returns the time that the event was generated. This will be + * before the current time since processing and dispatching the event has + * some overhead. Use this value to compare the times the user generated two + * events without being sensitive to variable processing time. + * + * @param[in] resource A PP_Resource corresponding to the event. + * + * @return The return value is in time ticks, which is a monotonically + * increasing clock not related to the wall clock time. It will not change + * if the user changes their clock or daylight savings time starts, so can + * be reliably used to compare events. This means, however, that you can't + * correlate event times to a particular time of day on the system clock. + */ + PP_TimeTicks GetTimeStamp([in] PP_Resource event); + + /** + * GetModifiers() returns a bitfield indicating which modifiers were down + * at the time of the event. This is a combination of the flags in the + * PP_InputEvent_Modifier enum. + * + * @param[in] resource A PP_Resource corresponding to an input + * event. + * + * @return The modifiers associated with the event, or 0 if the given + * resource is not a valid event resource. + */ + uint32_t GetModifiers([in] PP_Resource event); +}; + +/** + * The PPB_MouseInputEvent interface contains pointers to several + * functions related to mouse input events. + */ +[macro="PPB_MOUSE_INPUT_EVENT_INTERFACE"] +interface PPB_MouseInputEvent { + /** + * Create() creates a mouse input event with the given parameters. Normally + * you will get a mouse event passed through the + * HandleInputEvent and will not need to create them, but some + * applications may want to create their own for internal use. The type must + * be one of the mouse event types. + * + * @param[in] instance The instance for which this event occurred. + * + * @param[in] type A PP_InputEvent_Type identifying the type of + * input event. + * + * @param[in] time_stamp A PP_TimeTicks indicating the time + * when the event occurred. + * + * @param[in] modifiers A bit field combination of the + * PP_InputEvent_Modifier flags. + * + * @param[in] mouse_button The button that changed for mouse down or up + * events. This value will be PP_EVENT_MOUSEBUTTON_NONE for + * mouse move, enter, and leave events. + * + * @param[in] mouse_position A Point containing the x and y + * position of the mouse when the event occurred. + * + * @return A PP_Resource containing the new mouse input event. + */ + PP_Resource Create([in] PP_Instance instance, + [in] PP_InputEvent_Type type, + [in] PP_TimeTicks time_stamp, + [in] uint32_t modifiers, + [in] PP_InputEvent_MouseButton mouse_button, + [in] PP_Point mouse_position, + [in] int32_t click_count); + + /** + * Create() creates a mouse input event with the given parameters. Normally + * you will get a mouse event passed through the + * HandleInputEvent and will not need to create them, but some + * applications may want to create their own for internal use. The type must + * be one of the mouse event types. + * + * @param[in] instance The instance for which this event occurred. + * + * @param[in] type A PP_InputEvent_Type identifying the type of + * input event. + * + * @param[in] time_stamp A PP_TimeTicks indicating the time + * when the event occurred. + * + * @param[in] modifiers A bit field combination of the + * PP_InputEvent_Modifier flags. + * + * @param[in] mouse_button The button that changed for mouse down or up + * events. This value will be PP_EVENT_MOUSEBUTTON_NONE for + * mouse move, enter, and leave events. + * + * @param[in] mouse_position A Point containing the x and y + * position of the mouse when the event occurred. + * + * @param[in] mouse_movement The change in position of the mouse. + * + * @return A PP_Resource containing the new mouse input event. + */ + [version=1.1] + PP_Resource Create([in] PP_Instance instance, + [in] PP_InputEvent_Type type, + [in] PP_TimeTicks time_stamp, + [in] uint32_t modifiers, + [in] PP_InputEvent_MouseButton mouse_button, + [in] PP_Point mouse_position, + [in] int32_t click_count, + [in] PP_Point mouse_movement); + /** + * IsMouseInputEvent() determines if a resource is a mouse event. + * + * @param[in] resource A PP_Resource corresponding to an event. + * + * @return PP_TRUE if the given resource is a valid mouse input + * event, otherwise PP_FALSE. + */ + PP_Bool IsMouseInputEvent([in] PP_Resource resource); + + /** + * GetButton() returns the mouse button that generated a mouse down or up + * event. + * + * @param[in] mouse_event A PP_Resource corresponding to a + * mouse event. + * + * @return The mouse button associated with mouse down and up events. This + * value will be PP_EVENT_MOUSEBUTTON_NONE for mouse move, + * enter, and leave events, and for all non-mouse events. + */ + PP_InputEvent_MouseButton GetButton([in] PP_Resource mouse_event); + + /** + * GetPosition() returns the pixel location of a mouse input event. When + * the mouse is locked, it returns the last known mouse position just as + * mouse lock was entered. + * + * @param[in] mouse_event A PP_Resource corresponding to a + * mouse event. + * + * @return The point associated with the mouse event, relative to the upper- + * left of the instance receiving the event. These values can be negative for + * mouse drags. The return value will be (0, 0) for non-mouse events. + */ + [returnByValue] PP_Point GetPosition([in] PP_Resource mouse_event); + + int32_t GetClickCount([in] PP_Resource mouse_event); + + /** + * Returns the change in position of the mouse. When the mouse is locked, + * although the mouse position doesn't actually change, this function + * still provides movement information, which indicates what the change in + * position would be had the mouse not been locked. + * + * @param[in] mouse_event A PP_Resource corresponding to a + * mouse event. + * + * @return The change in position of the mouse, relative to the previous + * position. + */ + [version=1.1] + PP_Point GetMovement([in] PP_Resource mouse_event); +}; + + +/** + * The PPB_WheelIputEvent interface contains pointers to several + * functions related to wheel input events. + */ +[version=1.0, macro="PPB_WHEEL_INPUT_EVENT_INTERFACE"] +interface PPB_WheelInputEvent { + /** + * Create() creates a wheel input event with the given parameters. Normally + * you will get a wheel event passed through the + * HandleInputEvent and will not need to create them, but some + * applications may want to create their own for internal use. + * + * @param[in] instance The instance for which this event occurred. + * + * @param[in] time_stamp A PP_TimeTicks indicating the time + * when the event occurred. + * + * @param[in] modifiers A bit field combination of the + * PP_InputEvent_Modifier flags. + * + * @param[in] wheel_delta The scroll wheel's horizontal and vertical scroll + * amounts. + * + * @param[in] wheel_ticks The number of "clicks" of the scroll wheel that + * have produced the event. + * + * @param[in] scroll_by_page When true, the user is requesting to scroll + * by pages. When false, the user is requesting to scroll by lines. + * + * @return A PP_Resource containing the new wheel input event. + */ + PP_Resource Create([in] PP_Instance instance, + [in] PP_TimeTicks time_stamp, + [in] uint32_t modifiers, + [in] PP_FloatPoint wheel_delta, + [in] PP_FloatPoint wheel_ticks, + [in] PP_Bool scroll_by_page); + + /** + * IsWheelInputEvent() determines if a resource is a wheel event. + * + * @param[in] wheel_event A PP_Resource corresponding to an + * event. + * + * @return PP_TRUE if the given resource is a valid wheel input + * event. + */ + PP_Bool IsWheelInputEvent([in] PP_Resource resource); + + /** + * GetDelta() returns the amount vertically and horizontally the user has + * requested to scroll by with their mouse wheel. A scroll down or to the + * right (where the content moves up or left) is represented as positive + * values, and a scroll up or to the left (where the content moves down or + * right) is represented as negative values. + * + * This amount is system dependent and will take into account the user's + * preferred scroll sensitivity and potentially also nonlinear acceleration + * based on the speed of the scrolling. + * + * Devices will be of varying resolution. Some mice with large detents will + * only generate integer scroll amounts. But fractional values are also + * possible, for example, on some trackpads and newer mice that don't have + * "clicks". + * + * @param[in] wheel_event A PP_Resource corresponding to a wheel + * event. + * + * @return The vertical and horizontal scroll values. The units are either in + * pixels (when scroll_by_page is false) or pages (when scroll_by_page is + * true). For example, y = -3 means scroll up 3 pixels when scroll_by_page + * is false, and scroll up 3 pages when scroll_by_page is true. + */ + PP_FloatPoint GetDelta([in] PP_Resource wheel_event); + + /** + * GetTicks() returns the number of "clicks" of the scroll wheel + * that have produced the event. The value may have system-specific + * acceleration applied to it, depending on the device. The positive and + * negative meanings are the same as for GetDelta(). + * + * If you are scrolling, you probably want to use the delta values. These + * tick events can be useful if you aren't doing actual scrolling and don't + * want or pixel values. An example may be cycling between different items in + * a game. + * + * @param[in] wheel_event A PP_Resource corresponding to a wheel + * event. + * + * @return The number of "clicks" of the scroll wheel. You may receive + * fractional values for the wheel ticks if the mouse wheel is high + * resolution or doesn't have "clicks". If your program wants discrete + * events (as in the "picking items" example) you should accumulate + * fractional click values from multiple messages until the total value + * reaches positive or negative one. This should represent a similar amount + * of scrolling as for a mouse that has a discrete mouse wheel. + */ + PP_FloatPoint GetTicks([in] PP_Resource wheel_event); + + /** + * GetScrollByPage() indicates if the scroll delta x/y indicates pages or + * lines to scroll by. + * + * @param[in] wheel_event A PP_Resource corresponding to a wheel + * event. + * + * @return PP_TRUE if the event is a wheel event and the user is + * scrolling by pages. PP_FALSE if not or if the resource is not + * a wheel event. + */ + PP_Bool GetScrollByPage([in] PP_Resource wheel_event); +}; + +/** + * The PPB_KeyboardInputEvent interface contains pointers to + * several functions related to keyboard input events. + */ +[version=1.0, macro="PPB_KEYBOARD_INPUT_EVENT_INTERFACE"] +interface PPB_KeyboardInputEvent { + /** + * Creates a keyboard input event with the given parameters. Normally you + * will get a keyboard event passed through the HandleInputEvent and will not + * need to create them, but some applications may want to create their own + * for internal use. The type must be one of the keyboard event types. + * + * @param[in] instance The instance for which this event occurred. + * + * @param[in] type A PP_InputEvent_Type identifying the type of + * input event. + * + * @param[in] time_stamp A PP_TimeTicks indicating the time + * when the event occurred. + * + * @param[in] modifiers A bit field combination of the + * PP_InputEvent_Modifier flags. + * + * @param[in] key_code This value reflects the DOM KeyboardEvent + * keyCode field, which is the Windows-style Virtual Key + * code of the key. + * + * @param[in] character_text This value represents the typed character as a + * UTF-8 string. + * + * @return A PP_Resource containing the new keyboard input + * event. + */ + [deprecate=1.2] + PP_Resource Create([in] PP_Instance instance, + [in] PP_InputEvent_Type type, + [in] PP_TimeTicks time_stamp, + [in] uint32_t modifiers, + [in] uint32_t key_code, + [in] PP_Var character_text); + + /** + * Creates a keyboard input event with the given parameters. Normally you + * will get a keyboard event passed through the HandleInputEvent and will not + * need to create them, but some applications may want to create their own + * for internal use. The type must be one of the keyboard event types. + * + * @param[in] instance The instance for which this event occurred. + * + * @param[in] type A PP_InputEvent_Type identifying the type of + * input event. + * + * @param[in] time_stamp A PP_TimeTicks indicating the time + * when the event occurred. + * + * @param[in] modifiers A bit field combination of the + * PP_InputEvent_Modifier flags. + * + * @param[in] key_code This value reflects the DOM KeyboardEvent + * keyCode field, which is the Windows-style Virtual Key + * code of the key. + * + * @param[in] character_text This value represents the typed character as a + * UTF-8 string. + * + * @param[in] code This value represents the DOM3 |code| string that + * corresponds to the physical key being pressed. + * + * @return A PP_Resource containing the new keyboard input + * event. + */ + [version=1.2] + PP_Resource Create([in] PP_Instance instance, + [in] PP_InputEvent_Type type, + [in] PP_TimeTicks time_stamp, + [in] uint32_t modifiers, + [in] uint32_t key_code, + [in] PP_Var character_text, + [in] PP_Var code); + + /** + * IsKeyboardInputEvent() determines if a resource is a keyboard event. + * + * @param[in] resource A PP_Resource corresponding to an event. + * + * @return PP_TRUE if the given resource is a valid input event. + */ + PP_Bool IsKeyboardInputEvent([in] PP_Resource resource); + + /** + * GetKeyCode() returns the DOM keyCode field for the keyboard event. + * Chrome populates this with the Windows-style Virtual Key code of the key. + * + * @param[in] key_event A PP_Resource corresponding to a + * keyboard event. + * + * @return The DOM keyCode field for the keyboard event. + */ + uint32_t GetKeyCode([in] PP_Resource key_event); + + /** + * GetCharacterText() returns the typed character as a UTF-8 string for the + * given character event. + * + * @param[in] character_event A PP_Resource corresponding to a + * keyboard event. + * + * @return A string var representing a single typed character for character + * input events. For non-character input events the return value will be an + * undefined var. + */ + PP_Var GetCharacterText([in] PP_Resource character_event); + + /** + * GetCode() returns the DOM |code| field for this keyboard event, as + * defined in the DOM3 Events spec: + * http://www.w3.org/TR/DOM-Level-3-Events/ + * + * @param[in] key_event The key event for which to return the key code. + * + * @return The string that contains the DOM |code| for the keyboard event. + */ + [version=1.2] + PP_Var GetCode([in] PP_Resource key_event); +}; + +[assert_size(4)] +enum PP_TouchListType { + /** + * The list of all TouchPoints which are currently down. + */ + PP_TOUCHLIST_TYPE_TOUCHES = 0, + + /** + * The list of all TouchPoints whose state has changed since the last + * TouchInputEvent. + */ + PP_TOUCHLIST_TYPE_CHANGEDTOUCHES = 1, + + /** + * The list of all TouchPoints which are targeting this plugin. This is a + * subset of Touches. + */ + PP_TOUCHLIST_TYPE_TARGETTOUCHES = 2 +}; + +/** + * The PPB_TouchInputEvent interface contains pointers to several + * functions related to touch events. + */ +[version=1.0, macro="PPB_TOUCH_INPUT_EVENT_INTERFACE"] +interface PPB_TouchInputEvent { + /** + * Creates a touch input event with the given parameters. Normally you + * will get a touch event passed through the HandleInputEvent and will not + * need to create them, but some applications may want to create their own + * for internal use. The type must be one of the touch event types. + * This newly created touch input event does not have any touch point in any + * of the touch-point lists. AddTouchPoint should be called to + * add the touch-points. + * + * @param[in] instance The instance for which this event occurred. + * + * @param[in] type A PP_InputEvent_Type identifying the type of + * input event. + * + * @param[in] time_stamp A PP_TimeTicks indicating the time + * when the event occurred. + * + * @param[in] modifiers A bit field combination of the + * PP_InputEvent_Modifier flags. + * + * @return A PP_Resource containing the new touch input event. + */ + PP_Resource Create([in] PP_Instance instance, + [in] PP_InputEvent_Type type, + [in] PP_TimeTicks time_stamp, + [in] uint32_t modifiers); + + /** + * Adds a touch point to the touch event in the specified touch-list. + * + * @param[in] touch_event A PP_Resource corresponding to a touch + * event. + * + * @param[in] list The list to add the touch point to. + * + * @param[in] point The point to add to the list. + */ + void AddTouchPoint([in] PP_Resource touch_event, + [in] PP_TouchListType list, + [in] PP_TouchPoint point); + + /** + * IsTouchInputEvent() determines if a resource is a touch event. + * + * @param[in] resource A PP_Resource corresponding to an event. + * + * @return PP_TRUE if the given resource is a valid touch input + * event, otherwise PP_FALSE. + */ + PP_Bool IsTouchInputEvent([in] PP_Resource resource); + + /** + * Returns the number of touch-points in the specified list. + * + * @param[in] resource A PP_Resource corresponding to a touch + * event. + * + * @param[in] list The list. + * + * @return The number of touch-points in the specified list. + */ + uint32_t GetTouchCount([in] PP_Resource resource, + [in] PP_TouchListType list); + + /** + * Returns the touch-point at the specified index from the specified list. + * + * @param[in] resource A PP_Resource corresponding to a touch + * event. + * + * @param[in] list The list. + * + * @param[in] index The index. + * + * @return A PP_TouchPoint representing the touch-point. + */ + PP_TouchPoint GetTouchByIndex([in] PP_Resource resource, + [in] PP_TouchListType list, + [in] uint32_t index); + + /** + * Returns the touch-point with the specified touch-id in the specified list. + * + * @param[in] resource A PP_Resource corresponding to a touch + * event. + * + * @param[in] list The list. + * + * @param[in] touch_id The id of the touch-point. + * + * @return A PP_TouchPoint representing the touch-point. + */ + PP_TouchPoint GetTouchById([in] PP_Resource resource, + [in] PP_TouchListType list, + [in] uint32_t touch_id); +}; + +[macro="PPB_IME_INPUT_EVENT_INTERFACE"] +interface PPB_IMEInputEvent { + /** + * Create() creates an IME input event with the given parameters. Normally + * you will get an IME event passed through the HandleInputEvent + * and will not need to create them, but some applications may want to create + * their own for internal use. + * + * @param[in] instance The instance for which this event occurred. + * + * @param[in] type A PP_InputEvent_Type identifying the type of + * input event. The type must be one of the IME event types. + * + * @param[in] time_stamp A PP_TimeTicks indicating the time + * when the event occurred. + * + * @param[in] text The string returned by GetText. + * + * @param[in] segment_number The number returned by + * GetSegmentNumber. + * + * @param[in] segment_offsets The array of numbers returned by + * GetSegmentOffset. If segment_number is zero, + * the number of elements of the array should be zero. If + * segment_number is non-zero, the length of the array must be + * segment_number + 1. + * + * @param[in] target_segment The number returned by + * GetTargetSegment. + * + * @param[in] selection_start The start index returned by + * GetSelection. + * + * @param[in] selection_end The end index returned by + * GetSelection. + * + * @return A PP_Resource containing the new IME input event. + */ + PP_Resource Create([in] PP_Instance instance, + [in] PP_InputEvent_Type type, + [in] PP_TimeTicks time_stamp, + [in] PP_Var text, + [in] uint32_t segment_number, + [in] uint32_t[] segment_offsets, + [in] int32_t target_segment, + [in] uint32_t selection_start, + [in] uint32_t selection_end); + + /** + * IsIMEInputEvent() determines if a resource is an IME event. + * + * @param[in] resource A PP_Resource corresponding to an event. + * + * @return PP_TRUE if the given resource is a valid input event. + */ + PP_Bool IsIMEInputEvent([in] PP_Resource resource); + + /** + * GetText() returns the composition text as a UTF-8 string for the given IME + * event. + * + * @param[in] ime_event A PP_Resource corresponding to an IME + * event. + * + * @return A string var representing the composition text. For non-IME input + * events the return value will be an undefined var. + */ + PP_Var GetText([in] PP_Resource ime_event); + + /** + * GetSegmentNumber() returns the number of segments in the composition text. + * + * @param[in] ime_event A PP_Resource corresponding to an IME + * event. + * + * @return The number of segments. For events other than COMPOSITION_UPDATE, + * returns 0. + */ + uint32_t GetSegmentNumber([in] PP_Resource ime_event); + + /** + * GetSegmentOffset() returns the position of the index-th segmentation point + * in the composition text. The position is given by a byte-offset (not a + * character-offset) of the string returned by GetText(). It always satisfies + * 0=GetSegmentOffset(0) < ... < GetSegmentOffset(i) < GetSegmentOffset(i+1) + * < ... < GetSegmentOffset(GetSegmentNumber())=(byte-length of GetText()). + * Note that [GetSegmentOffset(i), GetSegmentOffset(i+1)) represents the range + * of the i-th segment, and hence GetSegmentNumber() can be a valid argument + * to this function instead of an off-by-1 error. + * + * @param[in] ime_event A PP_Resource corresponding to an IME + * event. + * + * @param[in] index An integer indicating a segment. + * + * @return The byte-offset of the segmentation point. If the event is not + * COMPOSITION_UPDATE or index is out of range, returns 0. + */ + uint32_t GetSegmentOffset([in] PP_Resource ime_event, + [in] uint32_t index); + + /** + * GetTargetSegment() returns the index of the current target segment of + * composition. + * + * @param[in] ime_event A PP_Resource corresponding to an IME + * event. + * + * @return An integer indicating the index of the target segment. When there + * is no active target segment, or the event is not COMPOSITION_UPDATE, + * returns -1. + */ + int32_t GetTargetSegment([in] PP_Resource ime_event); + + /** + * GetSelection() returns the range selected by caret in the composition text. + * + * @param[in] ime_event A PP_Resource corresponding to an IME + * event. + * + * @param[out] start The start position of the current selection. + * + * @param[out] end The end position of the current selection. + */ + void GetSelection([in] PP_Resource ime_event, + [out] uint32_t start, + [out] uint32_t end); +}; diff --git a/browser/extensions/mortar/ppapi/api/ppb_instance.idl b/browser/extensions/mortar/ppapi/api/ppb_instance.idl new file mode 100644 index 000000000000..794b4521a769 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_instance.idl @@ -0,0 +1,69 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_Instance interface implemented by the + * browser and containing pointers to functions related to + * the module instance on a web page. + */ + +[generate_thunk] + +label Chrome { + M14 = 1.0 + }; + +/** + * The PPB_Instance interface contains pointers to functions + * related to the module instance on a web page. + */ +interface PPB_Instance { + /** + * BindGraphics() binds the given graphics as the current display surface. + * The contents of this device is what will be displayed in the instance's + * area on the web page. The device must be a 2D or a 3D device. + * + * You can pass a NULL resource as the device parameter to + * unbind all devices from the given instance. The instance will then appear + * transparent. Re-binding the same device will return PP_TRUE + * and will do nothing. + * + * Any previously-bound device will be released. It is an error to bind + * a device when it is already bound to another instance. If you want + * to move a device between instances, first unbind it from the old one, and + * then rebind it to the new one. + * + * Binding a device will invalidate that portion of the web page to flush the + * contents of the new device to the screen. + * + * @param[in] instance A PP_Instance identifying one instance of a module. + * @param[in] device A PP_Resource corresponding to a graphics device. + * + * @return PP_Bool containing PP_TRUE if bind was + * successful or PP_FALSE if the device was not the correct + * type. On success, a reference to the device will be held by the + * instance, so the caller can release its reference if it chooses. + */ + PP_Bool BindGraphics( + [in] PP_Instance instance, + [in] PP_Resource device); + + /** + * IsFullFrame() determines if the instance is full-frame. Such an instance + * represents the entire document in a frame rather than an embedded + * resource. This can happen if the user does a top-level navigation or the + * page specifies an iframe to a resource with a MIME type registered by the + * module. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * + * @return A PP_Bool containing PP_TRUE if the + * instance is full-frame. + */ + PP_Bool IsFullFrame( + [in] PP_Instance instance); +}; + diff --git a/browser/extensions/mortar/ppapi/api/ppb_media_stream_audio_track.idl b/browser/extensions/mortar/ppapi/api/ppb_media_stream_audio_track.idl new file mode 100644 index 000000000000..4ffa9461aef5 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_media_stream_audio_track.idl @@ -0,0 +1,201 @@ +/* Copyright 2014 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * Defines the PPB_MediaStreamAudioTrack interface. Used for + * receiving audio samples from a MediaStream audio track in the browser. + */ + +[generate_thunk] + +label Chrome { + [channel=dev] M34 = 0.1, + M35 = 0.1 +}; + +/** + * This enumeration contains audio track attributes which are used by + * Configure(). + */ +enum PP_MediaStreamAudioTrack_Attrib { + /** + * Attribute list terminator. + */ + PP_MEDIASTREAMAUDIOTRACK_ATTRIB_NONE = 0, + + /** + * The maximum number of buffers to hold audio samples. + * Note: this is only used as advisory; the browser may allocate more or fewer + * based on available resources. How many buffers depends on usage - + * request at least 2 to make sure latency doesn't cause lost samples. If + * the plugin expects to hold on to more than one buffer at a time (e.g. to do + * multi-buffer processing), it should request that many more. + */ + PP_MEDIASTREAMAUDIOTRACK_ATTRIB_BUFFERS = 1, + + /** + * The sample rate of audio data in buffers. The attribute value is a + * PP_AudioBuffer_SampleRate. + */ + PP_MEDIASTREAMAUDIOTRACK_ATTRIB_SAMPLE_RATE = 2, + + /** + * The sample size of audio data in buffers in bytes. The attribute value is a + * PP_AudioBuffer_SampleSize. + */ + PP_MEDIASTREAMAUDIOTRACK_ATTRIB_SAMPLE_SIZE = 3, + + /** + * The number of channels in audio buffers. + * + * Supported values: 1, 2 + */ + PP_MEDIASTREAMAUDIOTRACK_ATTRIB_CHANNELS = 4, + + /** + * The duration of an audio buffer in milliseconds. + * + * Valid range: 10 to 10000 + */ + PP_MEDIASTREAMAUDIOTRACK_ATTRIB_DURATION = 5 +}; + +[version=0.1] +interface PPB_MediaStreamAudioTrack { + /** + * Determines if a resource is a MediaStream audio track resource. + * + * @param[in] resource The PP_Resource to test. + * + * @return A PP_Bool with PP_TRUE if the given + * resource is a Mediastream audio track resource or PP_FALSE + * otherwise. + */ + PP_Bool IsMediaStreamAudioTrack([in] PP_Resource resource); + + /** + * Configures underlying buffers for incoming audio samples. + * If the application doesn't want to drop samples, then the + * PP_MEDIASTREAMAUDIOTRACK_ATTRIB_BUFFERS should be + * chosen such that inter-buffer processing time variability won't overrun all + * the input buffers. If all buffers are filled, then samples will be + * dropped. The application can detect this by examining the timestamp on + * returned buffers. If Configure() is not called, default + * settings will be used. Calls to Configure while the plugin holds + * buffers will fail. + * Example usage from plugin code: + * @code + * int32_t attribs[] = { + * PP_MEDIASTREAMAUDIOTRACK_ATTRIB_BUFFERS, 4, + * PP_MEDIASTREAMAUDIOTRACK_ATTRIB_DURATION, 10, + * PP_MEDIASTREAMAUDIOTRACK_ATTRIB_NONE}; + * track_if->Configure(track, attribs, callback); + * @endcode + * + * @param[in] audio_track A PP_Resource corresponding to an audio + * resource. + * @param[in] attrib_list A list of attribute name-value pairs in which each + * attribute is immediately followed by the corresponding desired value. + * The list is terminated by + * PP_MEDIASTREAMAUDIOTRACK_ATTRIB_NONE. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Configure(). + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t Configure([in] PP_Resource audio_track, + [in] int32_t[] attrib_list, + [in] PP_CompletionCallback callback); + + /** + * Gets attribute value for a given attribute name. + * + * @param[in] audio_track A PP_Resource corresponding to an audio + * resource. + * @param[in] attrib A PP_MediaStreamAudioTrack_Attrib for + * querying. + * @param[out] value A int32_t for storing the attribute value on success. + * Otherwise, the value will not be changed. + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t GetAttrib([in] PP_Resource audio_track, + [in] PP_MediaStreamAudioTrack_Attrib attrib, + [out] int32_t value); + + /** + * Returns the track ID of the underlying MediaStream audio track. + * + * @param[in] audio_track The PP_Resource to check. + * + * @return A PP_Var containing the MediaStream track ID as + * a string. + */ + PP_Var GetId([in] PP_Resource audio_track); + + /** + * Checks whether the underlying MediaStream track has ended. + * Calls to GetBuffer while the track has ended are safe to make and will + * complete, but will fail. + * + * @param[in] audio_track The PP_Resource to check. + * + * @return A PP_Bool with PP_TRUE if the given + * MediaStream track has ended or PP_FALSE otherwise. + */ + [on_failure=PP_TRUE] + PP_Bool HasEnded([in] PP_Resource audio_track); + + /** + * Gets the next audio buffer from the MediaStream track. + * If internal processing is slower than the incoming buffer rate, new buffers + * will be dropped from the incoming stream. Once all buffers are full, + * audio samples will be dropped until RecycleBuffer() is called + * to free a slot for another buffer. + * If there are no audio data in the input buffer, + * PP_OK_COMPLETIONPENDING will be returned immediately and the + * callback will be called, when a new buffer of audio samples + * is received or an error happens. + * + * @param[in] audio_track A PP_Resource corresponding to an audio + * resource. + * @param[out] buffer A PP_Resource corresponding to + * an AudioBuffer resource. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of GetBuffer(). + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t GetBuffer([in] PP_Resource audio_track, + [out] PP_Resource buffer, + [in] PP_CompletionCallback callback); + + /** + * Recycles a buffer returned by GetBuffer(), so the track can + * reuse the buffer. And the buffer will become invalid. The caller should + * release all references it holds to buffer and not use it + * anymore. + * + * @param[in] audio_track A PP_Resource corresponding to an audio + * resource. + * @param[in] buffer A PP_Resource corresponding to + * an AudioBuffer resource returned by GetBuffer(). + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t RecycleBuffer([in] PP_Resource audio_track, + [in] PP_Resource buffer); + + /** + * Closes the MediaStream audio track and disconnects it from the audio + * source. After calling Close(), no new buffers will be + * received. + * + * @param[in] audio_track A PP_Resource corresponding to a + * MediaStream audio track resource. + */ + void Close([in] PP_Resource audio_track); +}; + diff --git a/browser/extensions/mortar/ppapi/api/ppb_media_stream_video_track.idl b/browser/extensions/mortar/ppapi/api/ppb_media_stream_video_track.idl new file mode 100644 index 000000000000..2cf85304c386 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_media_stream_video_track.idl @@ -0,0 +1,247 @@ +/* Copyright 2014 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * Defines the PPB_MediaStreamVideoTrack interface. Used for + * receiving video frames from a MediaStream video track in the browser. + */ + +[generate_thunk] + +label Chrome { + [channel=dev] M34 = 0.1, + M35 = 0.1, + [channel=dev] M36 = 1.0 +}; + +/** + * This enumeration contains video track attributes which are used by + * Configure(). + */ +enum PP_MediaStreamVideoTrack_Attrib { + /** + * Attribute list terminator. + */ + PP_MEDIASTREAMVIDEOTRACK_ATTRIB_NONE = 0, + + /** + * The maximum number of frames to hold in the input buffer. + * Note: this is only used as advisory; the browser may allocate more or fewer + * based on available resources. How many frames to buffer depends on usage - + * request at least 2 to make sure latency doesn't cause lost frames. If + * the plugin expects to hold on to more than one frame at a time (e.g. to do + * multi-frame processing), it should request that many more. + * If this attribute is not specified or value 0 is specified for this + * attribute, the default value will be used. + */ + PP_MEDIASTREAMVIDEOTRACK_ATTRIB_BUFFERED_FRAMES = 1, + + /** + * The width of video frames in pixels. It should be a multiple of 4. + * If the specified size is different from the video source (webcam), + * frames will be scaled to specified size. + * If this attribute is not specified or value 0 is specified, the original + * frame size of the video track will be used. + * + * Maximum value: 4096 (4K resolution). + */ + PP_MEDIASTREAMVIDEOTRACK_ATTRIB_WIDTH = 2, + + /** + * The height of video frames in pixels. It should be a multiple of 4. + * If the specified size is different from the video source (webcam), + * frames will be scaled to specified size. + * If this attribute is not specified or value 0 is specified, the original + * frame size of the video track will be used. + * + * Maximum value: 4096 (4K resolution). + */ + PP_MEDIASTREAMVIDEOTRACK_ATTRIB_HEIGHT = 3, + + /** + * The format of video frames. The attribute value is + * a PP_VideoFrame_Format. If the specified format is different + * from the video source (webcam), frames will be converted to specified + * format. + * If this attribute is not specified or value + * PP_VIDEOFRAME_FORMAT_UNKNOWN is specified, the orignal frame + * format of the video track will be used. + */ + PP_MEDIASTREAMVIDEOTRACK_ATTRIB_FORMAT = 4 +}; + +[version=0.1] +interface PPB_MediaStreamVideoTrack { + /** + * Creates a PPB_MediaStreamVideoTrack resource for video output. Call this + * when you will be creating frames and putting them to the track. + * + * @param[in] instance A PP_Instance identifying one instance of + * a module. + * + * @return A PP_Resource corresponding to a + * PPB_MediaStreamVideoTrack resource if successful, 0 if failed. + */ + [version=1.0] + PP_Resource Create([in] PP_Instance instance); + + /** + * Determines if a resource is a MediaStream video track resource. + * + * @param[in] resource The PP_Resource to test. + * + * @return A PP_Bool with PP_TRUE if the given + * resource is a Mediastream video track resource or PP_FALSE + * otherwise. + */ + PP_Bool IsMediaStreamVideoTrack([in] PP_Resource resource); + + /** + * Configures underlying frame buffers for incoming frames. + * If the application doesn't want to drop frames, then the + * PP_MEDIASTREAMVIDEOTRACK_ATTRIB_BUFFERED_FRAMES should be + * chosen such that inter-frame processing time variability won't overrun the + * input buffer. If the buffer is overfilled, then frames will be dropped. + * The application can detect this by examining the timestamp on returned + * frames. If some attributes are not specified, default values will be used + * for those unspecified attributes. If Configure() is not + * called, default settings will be used. + * Example usage from plugin code: + * @code + * int32_t attribs[] = { + * PP_MEDIASTREAMVIDEOTRACK_ATTRIB_BUFFERED_FRAMES, 4, + * PP_MEDIASTREAMVIDEOTRACK_ATTRIB_NONE}; + * track_if->Configure(track, attribs, callback); + * @endcode + * + * @param[in] video_track A PP_Resource corresponding to a video + * resource. + * @param[in] attrib_list A list of attribute name-value pairs in which each + * attribute is immediately followed by the corresponding desired value. + * The list is terminated by + * PP_MEDIASTREAMVIDEOTRACK_ATTRIB_NONE. + * @param[in] callback PP_CompletionCallback to be called upon + * completion of Configure(). + * + * @return An int32_t containing a result code from pp_errors.h. + * Returns PP_ERROR_INPROGRESS if there is a pending call of + * Configure() or GetFrame(), or the plugin + * holds some frames which are not recycled with RecycleFrame(). + * If an error is returned, all attributes and the underlying buffer will not + * be changed. + */ + int32_t Configure([in] PP_Resource video_track, + [in] int32_t[] attrib_list, + [in] PP_CompletionCallback callback); + + /** + * Gets attribute value for a given attribute name. + * + * @param[in] video_track A PP_Resource corresponding to a video + * resource. + * @param[in] attrib A PP_MediaStreamVideoTrack_Attrib for + * querying. + * @param[out] value A int32_t for storing the attribute value on success. + * Otherwise, the value will not be changed. + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t GetAttrib([in] PP_Resource video_track, + [in] PP_MediaStreamVideoTrack_Attrib attrib, + [out] int32_t value); + + /** + * Returns the track ID of the underlying MediaStream video track. + * + * @param[in] video_track The PP_Resource to check. + * + * @return A PP_Var containing the MediaStream track ID as + * a string. + */ + PP_Var GetId([in] PP_Resource video_track); + + /** + * Checks whether the underlying MediaStream track has ended. + * Calls to GetFrame while the track has ended are safe to make and will + * complete, but will fail. + * + * @param[in] video_track The PP_Resource to check. + * + * @return A PP_Bool with PP_TRUE if the given + * MediaStream track has ended or PP_FALSE otherwise. + */ + [on_failure=PP_TRUE] + PP_Bool HasEnded([in] PP_Resource video_track); + + /** + * Gets the next video frame from the MediaStream track. + * If internal processing is slower than the incoming frame rate, new frames + * will be dropped from the incoming stream. Once the input buffer is full, + * frames will be dropped until RecycleFrame() is called to free + * a spot for another frame to be buffered. + * If there are no frames in the input buffer, + * PP_OK_COMPLETIONPENDING will be returned immediately and the + * callback will be called when a new frame is received or an + * error happens. + * + * @param[in] video_track A PP_Resource corresponding to a video + * resource. + * @param[out] frame A PP_Resource corresponding to a VideoFrame + * resource. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of GetFrame(). + * + * @return An int32_t containing a result code from pp_errors.h. + * Returns PP_ERROR_NOMEMORY if max_buffered_frames frames buffer + * was not allocated successfully. + */ + int32_t GetFrame([in] PP_Resource video_track, + [out] PP_Resource frame, + [in] PP_CompletionCallback callback); + + /** + * Recycles a frame returned by GetFrame(), so the track can + * reuse the underlying buffer of this frame. And the frame will become + * invalid. The caller should release all references it holds to + * frame and not use it anymore. + * + * @param[in] video_track A PP_Resource corresponding to a video + * resource. + * @param[in] frame A PP_Resource corresponding to a VideoFrame + * resource returned by GetFrame(). + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t RecycleFrame([in] PP_Resource video_track, + [in] PP_Resource frame); + + /** + * Closes the MediaStream video track and disconnects it from video source. + * After calling Close(), no new frames will be received. + * + * @param[in] video_track A PP_Resource corresponding to a + * MediaStream video track resource. + */ + void Close([in] PP_Resource video_track); + + /** + * Gets a free frame for output. The frame is allocated by + * Configure(). The caller should fill it with frame data, and + * then use |PutFrame()| to send the frame back. + */ + [version=1.0] + int32_t GetEmptyFrame([in] PP_Resource video_track, + [out] PP_Resource frame, + [in] PP_CompletionCallback callback); + + /** + * Sends a frame returned by |GetEmptyFrame()| to the output track. + * After this function, the |frame| should not be used anymore and the + * caller should release the reference that it holds. + */ + [version=1.0] + int32_t PutFrame([in] PP_Resource video_track, [in] PP_Resource frame); +}; + diff --git a/browser/extensions/mortar/ppapi/api/ppb_message_loop.idl b/browser/extensions/mortar/ppapi/api/ppb_message_loop.idl new file mode 100644 index 000000000000..73ad14db836c --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_message_loop.idl @@ -0,0 +1,271 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * Defines the PPB_MessageLoop interface. + */ +label Chrome { + M25 = 1.0 +}; + +/** + * A message loop allows PPAPI calls to be issued on a thread. You may not + * issue any API calls on a thread without creating a message loop. It also + * allows you to post work to the message loop for a thread. + * + * To process work posted to the message loop, as well as completion callbacks + * for asynchronous operations, you must run the message loop via Run(). + * + * Note the system manages the lifetime of the instance (and all associated + * resources). If the instance is deleted from the page, background threads may + * suddenly see their PP_Resource handles become invalid. In this case, calls + * will fail with PP_ERROR_BADRESOURCE. If you need to access data associated + * with your instance, you will probably want to create some kind of threadsafe + * proxy object that can handle asynchronous destruction of the instance object. + * + * Typical usage: + * On the main thread: + * - Create the thread yourself (using pthreads). + * - Create the message loop resource. + * - Pass the message loop resource to your thread's main function. + * - Call PostWork() on the message loop to run functions on the thread. + * + * From the background thread's main function: + * - Call AttachToCurrentThread() with the message loop resource. + * - Call Run() with the message loop resource. + * + * Your callbacks should look like this: + * @code + * void DoMyWork(void* user_data, int32_t status) { + * if (status != PP_OK) { + * Cleanup(); // e.g. free user_data. + * return; + * } + * ... do your work... + * } + * @endcode + * For a C++ example, see ppapi/utility/threading/simple_thread.h + * + * (You can also create the message loop resource on the background thread, + * but then the main thread will have no reference to it should you want to + * call PostWork()). + * + * + * THREAD HANDLING + * + * The main thread has an implicitly created message loop. The main thread is + * the thread where PPP_InitializeModule and PPP_Instance functions are called. + * You can retrieve a reference to this message loop by calling + * GetForMainThread() or, if your code is on the main thread, GetCurrent() will + * also work. + * + * Some special threads created by the system can not have message loops. In + * particular, the background thread created for audio processing has this + * requirement because it's intended to be highly responsive to keep up with + * the realtime requirements of audio processing. You can not make PPAPI calls + * from these threads. + * + * Once you associate a message loop with a thread, you don't have to keep a + * reference to it. The system will hold a reference to the message loop for as + * long as the thread is running. The current message loop can be retrieved + * using the GetCurrent() function. + * + * It is legal to create threads in your plugin without message loops, but + * PPAPI calls will fail unless explicitly noted in the documentation. + * + * You can create a message loop object on a thread and never actually run the + * message loop. This will allow you to call blocking PPAPI calls (via + * PP_BlockUntilComplete()). If you make any asynchronous calls, the callbacks + * from those calls will be queued in the message loop and never run. The same + * thing will happen if work is scheduled after the message loop exits and + * the message loop is not run again. + * + * + * DESTRUCTION AND ERROR HANDLING + * + * Often, your application will associate memory with completion callbacks. For + * example, the C++ CompletionCallbackFactory has a small amount of + * heap-allocated memory for each callback. This memory will be leaked if the + * callback is never run. To avoid this memory leak, you need to be careful + * about error handling and shutdown. + * + * There are a number of cases where posted callbacks will never be run: + * + * - You tear down the thread (via pthreads) without "destroying" the message + * loop (via PostQuit with should_destroy = PP_TRUE). In this case, any + * tasks in the message queue will be lost. + * + * - You create a message loop, post callbacks to it, and never run it. + * + * - You quit the message loop via PostQuit with should_destroy set to + * PP_FALSE. In this case, the system will assume the message loop will be + * run again later and keep your tasks. + * + * To do proper shutdown, call PostQuit with should_destroy = PP_TRUE. This + * will prohibit future work from being posted, and will allow the message loop + * to run until all pending tasks are run. + * + * If you post a callback to a message loop that's been destroyed, or to an + * invalid message loop, PostWork will return an error and will not run the + * callback. This is true even for callbacks with the "required" flag set, + * since the system may not even know what thread to issue the error callback + * on. + * + * Therefore, you should check for errors from PostWork and destroy any + * associated memory to avoid leaks. If you're using the C++ + * CompletionCallbackFactory, use the following pattern: + * @code + * pp::CompletionCallback callback = factory_.NewOptionalCallback(...); + * int32_t result = message_loop.PostWork(callback); + * if (result != PP_OK) + * callback.Run(result); + * @endcode + * This will run the callback with an error value, and assumes that the + * implementation of your callback checks the "result" argument and returns + * immediately on error. + */ +interface PPB_MessageLoop { + /** + * Creates a message loop resource. + * + * This may be called from any thread. After your thread starts but before + * issuing any other PPAPI calls on it, you must associate it with a message + * loop by calling AttachToCurrentThread. + */ + PP_Resource Create(PP_Instance instance); + + /** + * Returns a resource identifying the message loop for the main thread. The + * main thread always has a message loop created by the system. + */ + PP_Resource GetForMainThread(); + + /** + * Returns a reference to the PPB_MessageLoop object attached to the current + * thread. If there is no attached message loop, the return value will be 0. + */ + PP_Resource GetCurrent(); + + /** + * Sets the given message loop resource as being the associated message loop + * for the currently running thread. + * + * You must call this function exactly once on a thread before making any + * PPAPI calls. A message loop can only be attached to one thread, and the + * message loop can not be changed later. The message loop will be attached + * as long as the thread is running or until you quit with should_destroy + * set to PP_TRUE. + * + * If this function fails, attempting to run the message loop will fail. + * Note that you can still post work to the message loop: it will get queued + * up should the message loop eventually be successfully attached and run. + * + * @return + * - PP_OK: The message loop was successfully attached to the thread and is + * ready to use. + * - PP_ERROR_BADRESOURCE: The given message loop resource is invalid. + * - PP_ERROR_INPROGRESS: The current thread already has a message loop + * attached. This will always be the case for the main thread, which has + * an implicit system-created message loop attached. + * - PP_ERROR_WRONG_THREAD: The current thread type can not have a message + * loop attached to it. See the interface level discussion about these + * special threads, which include realtime audio threads. + */ + int32_t AttachToCurrentThread([in] PP_Resource message_loop); + + /** + * Runs the thread message loop. Running the message loop is required for you + * to get issued completion callbacks on the thread. + * + * The message loop identified by the argument must have been previously + * successfully attached to the current thread. + * + * You may not run nested message loops. Since the main thread has an + * implicit message loop that the system runs, you may not call Run on the + * main thread. + * + * @return + * - PP_OK: The message loop was successfully run. Note that on + * success, the message loop will only exit when you call PostQuit(). + * - PP_ERROR_BADRESOURCE: The given message loop resource is invalid. + * - PP_ERROR_WRONG_THREAD: You are attempting to run a message loop that + * has not been successfully attached to the current thread. Call + * AttachToCurrentThread(). + * - PP_ERROR_INPROGRESS: You are attempting to call Run in a nested + * fashion (Run is already on the stack). This will occur if you attempt + * to call run on the main thread's message loop (see above). + */ + int32_t Run([in] PP_Resource message_loop); + + /** + * Schedules work to run on the given message loop. This may be called from + * any thread. Posted work will be executed in the order it was posted when + * the message loop is Run(). + * + * @param message_loop The message loop resource. + * + * @param callback The completion callback to execute from the message loop. + * + * @param delay_ms The number of milliseconds to delay execution of the given + * completion callback. Passing 0 means it will get queued normally and + * executed in order. + * + * + * The completion callback will be called with PP_OK as the "result" parameter + * if it is run normally. It is good practice to check for PP_OK and return + * early otherwise. + * + * The "required" flag on the completion callback is ignored. If there is an + * error posting your callback, the error will be returned from PostWork and + * the callback will never be run (because there is no appropriate place to + * run your callback with an error without causing unexpected threading + * problems). If you associate memory with the completion callback (for + * example, you're using the C++ CompletionCallbackFactory), you will need to + * free this or manually run the callback. See "Destruction and error + * handling" above. + * + * + * You can call this function before the message loop has started and the + * work will get queued until the message loop is run. You can also post + * work after the message loop has exited as long as should_destroy was + * PP_FALSE. It will be queued until the next invocation of Run(). + * + * @return + * - PP_OK: The work was posted to the message loop's queue. As described + * above, this does not mean that the work has been or will be executed + * (if you never run the message loop after posting). + * - PP_ERROR_BADRESOURCE: The given message loop resource is invalid. + * - PP_ERROR_BADARGUMENT: The function pointer for the completion callback + * is null (this will be the case if you pass PP_BlockUntilComplete()). + * - PP_ERROR_FAILED: The message loop has been destroyed. + */ + int32_t PostWork([in] PP_Resource message_loop, + [in] PP_CompletionCallback callback, + [in] int64_t delay_ms); + + /** + * Posts a quit message to the given message loop's work queue. Work posted + * before that point will be processed before quitting. + * + * This may be called on the message loop registered for the current thread, + * or it may be called on the message loop registered for another thread. It + * is an error to attempt to PostQuit() the main thread loop. + * + * @param should_destroy Marks the message loop as being in a destroyed state + * and prevents further posting of messages. + * + * If you quit a message loop without setting should_destroy, it will still + * be attached to the thread and you can still run it again by calling Run() + * again. If you destroy it, it will be detached from the current thread. + * + * @return + * - PP_OK: The request to quit was successfully posted. + * - PP_ERROR_BADRESOURCE: The message loop was invalid. + * - PP_ERROR_WRONG_THREAD: You are attempting to quit the main thread. + * The main thread's message loop is managed by the system and can't be + * quit. + */ + int32_t PostQuit([in] PP_Resource message_loop, PP_Bool should_destroy); +}; diff --git a/browser/extensions/mortar/ppapi/api/ppb_messaging.idl b/browser/extensions/mortar/ppapi/api/ppb_messaging.idl new file mode 100644 index 000000000000..aa5c6d769bca --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_messaging.idl @@ -0,0 +1,146 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_Messaging interface implemented + * by the browser for sending messages to DOM elements associated with a + * specific module instance. + */ + +[generate_thunk] + +label Chrome { + M14 = 1.0, + M39 = 1.2 +}; + +/** + * The PPB_Messaging interface is implemented by the browser + * and is related to sending messages to JavaScript message event listeners on + * the DOM element associated with specific module instance. + */ +interface PPB_Messaging { + /** + * PostMessage() asynchronously invokes any listeners for message events on + * the DOM element for the given module instance. A call to PostMessage() + * will not block while the message is processed. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * @param[in] message A PP_Var containing the data to be sent to + * JavaScript. + * message can be any PP_Var type except + * PP_VARTYPE_OBJECT. Array/Dictionary types are supported from + * Chrome M29 onward. All var types are copied when passing them to + * JavaScript. + * + * When passing array or dictionary PP_Vars, the entire reference + * graph will be converted and transferred. If the reference graph has cycles, + * the message will not be sent and an error will be logged to the console. + * + * Listeners for message events in JavaScript code will receive an object + * conforming to the HTML 5 MessageEvent interface. + * Specifically, the value of message will be contained as a property called + * data in the received MessageEvent. + * + * This messaging system is similar to the system used for listening for + * messages from Web Workers. Refer to + * http://www.whatwg.org/specs/web-workers/current-work/ for + * further information. + * + * Example: + * + * @code + * + * + * + * + * + * + * @endcode + * + * The module instance then invokes PostMessage() as follows: + * + * @code + * + * char hello_world[] = "Hello world!"; + * PP_Var hello_var = ppb_var_interface->VarFromUtf8(instance, + * hello_world, + * sizeof(hello_world)); + * ppb_messaging_interface->PostMessage(instance, hello_var); // Copies var. + * ppb_var_interface->Release(hello_var); + * + * @endcode + * + * The browser will pop-up an alert saying "Hello world!" + */ + [version=1.0] + void PostMessage([in] PP_Instance instance, [in] PP_Var message); + + /** + * Registers a handler for receiving messages from JavaScript. If a handler + * is registered this way, it will replace PPP_Messaging, and all messages + * sent from JavaScript via postMessage and postMessageAndAwaitResponse will + * be dispatched to handler. + * + * The function calls will be dispatched via message_loop. This + * means that the functions will be invoked on the thread to which + * message_loop is attached, when message_loop is + * run. It is illegal to pass the main thread message loop; + * RegisterMessageHandler will return PP_ERROR_WRONG_THREAD in that case. + * If you quit message_loop before calling Unregister(), + * the browser will not be able to call functions in the plugin's message + * handler any more. That could mean missing some messages or could cause a + * leak if you depend on Destroy() to free hander data. So you should, + * whenever possible, Unregister() the handler prior to quitting its event + * loop. + * + * Attempting to register a message handler when one is already registered + * will cause the current MessageHandler to be unregistered and replaced. In + * that case, no messages will be sent to the "default" message handler + * (PPP_Messaging). Messages will stop arriving at the prior message handler + * and will begin to be dispatched at the new message handler. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * @param[in] user_data A pointer the plugin may choose to use when handling + * calls to functions within PPP_MessageHandler. The browser will pass this + * same pointer when invoking functions within PPP_MessageHandler. + * @param[in] handler The plugin-provided set of functions for handling + * messages. + * @param[in] message_loop Represents the message loop on which + * PPP_MessageHandler functions should be invoked. + * @return PP_OK on success, or an error from pp_errors.h. + */ + [version=1.2] + int32_t RegisterMessageHandler([in] PP_Instance instance, + [inout] mem_t user_data, + [in] PPP_MessageHandler handler, + [in] PP_Resource message_loop); + /** + * Unregisters the current message handler for instance if one + * is registered. After this call, the message handler (if one was + * registered) will have "Destroy" called on it and will receive no further + * messages after that point. After that point, all messages sent from + * JavaScript using postMessage() will be dispatched to PPP_Messaging (if + * the plugin supports PPP_MESSAGING_INTERFACE). Attempts to call + * postMessageAndAwaitResponse() from JavaScript will fail. + * + * Attempting to unregister a message handler when none is registered has no + * effect. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + */ + [version=1.2] + void UnregisterMessageHandler([in] PP_Instance instance); +}; + diff --git a/browser/extensions/mortar/ppapi/api/ppb_mouse_cursor.idl b/browser/extensions/mortar/ppapi/api/ppb_mouse_cursor.idl new file mode 100644 index 000000000000..9fba254195c0 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_mouse_cursor.idl @@ -0,0 +1,108 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_MouseCursor interface for setting + * the mouse cursor. + */ + +[generate_thunk] + +label Chrome { + M19 = 1.0 +}; + +/** + * The PP_MouseCursor_Type enumeration lists the available stock + * cursor types. + */ +[assert_size(4), notypedef] +enum PP_MouseCursor_Type { + PP_MOUSECURSOR_TYPE_CUSTOM = -1, + PP_MOUSECURSOR_TYPE_POINTER = 0, + PP_MOUSECURSOR_TYPE_CROSS = 1, + PP_MOUSECURSOR_TYPE_HAND = 2, + PP_MOUSECURSOR_TYPE_IBEAM = 3, + PP_MOUSECURSOR_TYPE_WAIT = 4, + PP_MOUSECURSOR_TYPE_HELP = 5, + PP_MOUSECURSOR_TYPE_EASTRESIZE = 6, + PP_MOUSECURSOR_TYPE_NORTHRESIZE = 7, + PP_MOUSECURSOR_TYPE_NORTHEASTRESIZE = 8, + PP_MOUSECURSOR_TYPE_NORTHWESTRESIZE = 9, + PP_MOUSECURSOR_TYPE_SOUTHRESIZE = 10, + PP_MOUSECURSOR_TYPE_SOUTHEASTRESIZE = 11, + PP_MOUSECURSOR_TYPE_SOUTHWESTRESIZE = 12, + PP_MOUSECURSOR_TYPE_WESTRESIZE = 13, + PP_MOUSECURSOR_TYPE_NORTHSOUTHRESIZE = 14, + PP_MOUSECURSOR_TYPE_EASTWESTRESIZE = 15, + PP_MOUSECURSOR_TYPE_NORTHEASTSOUTHWESTRESIZE = 16, + PP_MOUSECURSOR_TYPE_NORTHWESTSOUTHEASTRESIZE = 17, + PP_MOUSECURSOR_TYPE_COLUMNRESIZE = 18, + PP_MOUSECURSOR_TYPE_ROWRESIZE = 19, + PP_MOUSECURSOR_TYPE_MIDDLEPANNING = 20, + PP_MOUSECURSOR_TYPE_EASTPANNING = 21, + PP_MOUSECURSOR_TYPE_NORTHPANNING = 22, + PP_MOUSECURSOR_TYPE_NORTHEASTPANNING = 23, + PP_MOUSECURSOR_TYPE_NORTHWESTPANNING = 24, + PP_MOUSECURSOR_TYPE_SOUTHPANNING = 25, + PP_MOUSECURSOR_TYPE_SOUTHEASTPANNING = 26, + PP_MOUSECURSOR_TYPE_SOUTHWESTPANNING = 27, + PP_MOUSECURSOR_TYPE_WESTPANNING = 28, + PP_MOUSECURSOR_TYPE_MOVE = 29, + PP_MOUSECURSOR_TYPE_VERTICALTEXT = 30, + PP_MOUSECURSOR_TYPE_CELL = 31, + PP_MOUSECURSOR_TYPE_CONTEXTMENU = 32, + PP_MOUSECURSOR_TYPE_ALIAS = 33, + PP_MOUSECURSOR_TYPE_PROGRESS = 34, + PP_MOUSECURSOR_TYPE_NODROP = 35, + PP_MOUSECURSOR_TYPE_COPY = 36, + PP_MOUSECURSOR_TYPE_NONE = 37, + PP_MOUSECURSOR_TYPE_NOTALLOWED = 38, + PP_MOUSECURSOR_TYPE_ZOOMIN = 39, + PP_MOUSECURSOR_TYPE_ZOOMOUT = 40, + PP_MOUSECURSOR_TYPE_GRAB = 41, + PP_MOUSECURSOR_TYPE_GRABBING = 42 +}; + +/** + * The PPB_MouseCursor allows setting the mouse cursor. + */ +interface PPB_MouseCursor { + /** + * Sets the given mouse cursor. The mouse cursor will be in effect whenever + * the mouse is over the given instance until it is set again by another + * call. Note that you can hide the mouse cursor by setting it to the + * PP_MOUSECURSOR_TYPE_NONE type. + * + * This function allows setting both system defined mouse cursors and + * custom cursors. To set a system-defined cursor, pass the type you want + * and set the custom image to 0 and the hot spot to NULL. To set a custom + * cursor, set the type to PP_MOUSECURSOR_TYPE_CUSTOM and + * specify your image and hot spot. + * + * @param[in] instance A PP_Instance identifying the instance + * that the mouse cursor will affect. + * + * @param[in] type A PP_MouseCursor_Type identifying the type of + * mouse cursor to show. + * + * @param[in] image A PPB_ImageData resource identifying the + * custom image to set when the type is + * PP_MOUSECURSOR_TYPE_CUSTOM. The image must be less than 32 + * pixels in each direction and must be of the system's native image format. + * When you are specifying a predefined cursor, this parameter must be 0. + * + * @param[in] hot_spot When setting a custom cursor, this identifies the + * pixel position within the given image of the "hot spot" of the cursor. + * When specifying a stock cursor, this parameter is ignored. + * + * @return PP_TRUE on success, or PP_FALSE if the instance or cursor type + * is invalid, or if the image is too large. + */ + PP_Bool SetCursor([in] PP_Instance instance, + [in] PP_MouseCursor_Type type, + [in] PP_Resource image, + [in] PP_Point hot_spot); +}; diff --git a/browser/extensions/mortar/ppapi/api/ppb_mouse_lock.idl b/browser/extensions/mortar/ppapi/api/ppb_mouse_lock.idl new file mode 100644 index 000000000000..b0e9488eeba5 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_mouse_lock.idl @@ -0,0 +1,62 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_MouseLock interface for + * locking the target of mouse events to a specific module instance. + */ + +[generate_thunk] + +label Chrome { + M16 = 1.0 +}; + +/** + * The PPB_MouseLock interface is implemented by the browser. + * This interface provides a way of locking the target of mouse events to a + * single module instance and removing the cursor from view. This mode is + * useful for certain classes of applications, especially first-person + * perspective 3D applications and 3D modeling software. + */ +interface PPB_MouseLock { + /** + * LockMouse() requests the mouse to be locked. + * + * While the mouse is locked, the cursor is implicitly hidden from the user. + * Any movement of the mouse will generate a + * PP_INPUTEVENT_TYPE_MOUSEMOVE event. The + * GetPosition() function in the PPB_MouseInputEvent + * interface reports the last known mouse position just as mouse lock was + * entered. The GetMovement() function provides relative movement + * information indicating what the change in position of the mouse would be + * had it not been locked. + * + * The browser may revoke the mouse lock for reasons including (but not + * limited to) the user pressing the ESC key, the user activating another + * program using a reserved keystroke (e.g. ALT+TAB), or some other system + * event. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t LockMouse([in] PP_Instance instance, + [in] PP_CompletionCallback callback); + + /** + * UnlockMouse() causes the mouse to be unlocked, allowing it to track user + * movement again. This is an asynchronous operation. The module instance + * will be notified using the PPP_MouseLock interface when it + * has lost the mouse lock. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + */ + void UnlockMouse([in] PP_Instance instance); +}; diff --git a/browser/extensions/mortar/ppapi/api/ppb_net_address.idl b/browser/extensions/mortar/ppapi/api/ppb_net_address.idl new file mode 100644 index 000000000000..ddd69b57e0e0 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_net_address.idl @@ -0,0 +1,169 @@ +/* Copyright 2013 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_NetAddress interface. + */ + +label Chrome { + M29 = 1.0 +}; + +/** + * Network address family types. + */ +[assert_size(4)] +enum PP_NetAddress_Family { + /** + * The address family is unspecified. + */ + PP_NETADDRESS_FAMILY_UNSPECIFIED = 0, + /** + * The Internet Protocol version 4 (IPv4) address family. + */ + PP_NETADDRESS_FAMILY_IPV4 = 1, + /** + * The Internet Protocol version 6 (IPv6) address family. + */ + PP_NETADDRESS_FAMILY_IPV6 = 2 +}; + +/** + * All members are expressed in network byte order. + */ +[assert_size(6)] +struct PP_NetAddress_IPv4 { + /** + * Port number. + */ + uint16_t port; + /** + * IPv4 address. + */ + uint8_t[4] addr; +}; + +/** + * All members are expressed in network byte order. + */ +[assert_size(18)] +struct PP_NetAddress_IPv6 { + /** + * Port number. + */ + uint16_t port; + /** + * IPv6 address. + */ + uint8_t[16] addr; +}; + +/** + * The PPB_NetAddress interface provides operations on network + * addresses. + */ +interface PPB_NetAddress { + /** + * Creates a PPB_NetAddress resource with the specified IPv4 + * address. + * + * @param[in] instance A PP_Instance identifying one instance of + * a module. + * @param[in] ipv4_addr An IPv4 address. + * + * @return A PP_Resource representing the same address as + * ipv4_addr or 0 on failure. + */ + PP_Resource CreateFromIPv4Address([in] PP_Instance instance, + [in] PP_NetAddress_IPv4 ipv4_addr); + + /** + * Creates a PPB_NetAddress resource with the specified IPv6 + * address. + * + * @param[in] instance A PP_Instance identifying one instance of + * a module. + * @param[in] ipv6_addr An IPv6 address. + * + * @return A PP_Resource representing the same address as + * ipv6_addr or 0 on failure. + */ + PP_Resource CreateFromIPv6Address([in] PP_Instance instance, + [in] PP_NetAddress_IPv6 ipv6_addr); + + /** + * Determines if a given resource is a network address. + * + * @param[in] resource A PP_Resource to check. + * + * @return PP_TRUE if the input is a PPB_NetAddress + * resource; PP_FALSE otherwise. + */ + PP_Bool IsNetAddress([in] PP_Resource resource); + + /** + * Gets the address family. + * + * @param[in] addr A PP_Resource corresponding to a network + * address. + * + * @return The address family on success; + * PP_NETADDRESS_FAMILY_UNSPECIFIED on failure. + */ + PP_NetAddress_Family GetFamily([in] PP_Resource addr); + + /** + * Returns a human-readable description of the network address. The + * description is in the form of host [ ":" port ] and conforms to + * http://tools.ietf.org/html/rfc3986#section-3.2 for IPv4 and IPv6 addresses + * (e.g., "192.168.0.1", "192.168.0.1:99", or "[::1]:80"). + * + * @param[in] addr A PP_Resource corresponding to a network + * address. + * @param[in] include_port Whether to include the port number in the + * description. + * + * @return A string PP_Var on success; an undefined + * PP_Var on failure. + */ + PP_Var DescribeAsString([in] PP_Resource addr, + [in] PP_Bool include_port); + + /** + * Fills a PP_NetAddress_IPv4 structure if the network address is + * of PP_NETADDRESS_FAMILY_IPV4 address family. + * Note that passing a network address of + * PP_NETADDRESS_FAMILY_IPV6 address family will fail even if the + * address is an IPv4-mapped IPv6 address. + * + * @param[in] addr A PP_Resource corresponding to a network + * address. + * @param[out] ipv4_addr A PP_NetAddress_IPv4 structure to store + * the result. + * + * @return A PP_Bool value indicating whether the operation + * succeeded. + */ + PP_Bool DescribeAsIPv4Address([in] PP_Resource addr, + [out] PP_NetAddress_IPv4 ipv4_addr); + + /** + * Fills a PP_NetAddress_IPv6 structure if the network address is + * of PP_NETADDRESS_FAMILY_IPV6 address family. + * Note that passing a network address of + * PP_NETADDRESS_FAMILY_IPV4 address family will fail - this + * method doesn't map it to an IPv6 address. + * + * @param[in] addr A PP_Resource corresponding to a network + * address. + * @param[out] ipv6_addr A PP_NetAddress_IPv6 structure to store + * the result. + * + * @return A PP_Bool value indicating whether the operation + * succeeded. + */ + PP_Bool DescribeAsIPv6Address([in] PP_Resource addr, + [out] PP_NetAddress_IPv6 ipv6_addr); +}; diff --git a/browser/extensions/mortar/ppapi/api/ppb_network_list.idl b/browser/extensions/mortar/ppapi/api/ppb_network_list.idl new file mode 100644 index 000000000000..70c301f8754c --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_network_list.idl @@ -0,0 +1,172 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_NetworkList interface. + */ + +[generate_thunk] + +label Chrome { + M31 = 1.0 +}; + +/** + * Type of a network interface. + */ +[assert_size(4)] +enum PP_NetworkList_Type { + /** + * Type of the network interface is not known. + */ + PP_NETWORKLIST_TYPE_UNKNOWN = 0, + + /** + * Wired Ethernet network. + */ + PP_NETWORKLIST_TYPE_ETHERNET = 1, + + /** + * Wireless Wi-Fi network. + */ + PP_NETWORKLIST_TYPE_WIFI = 2, + + /** + * Cellular network (e.g. LTE). + */ + PP_NETWORKLIST_TYPE_CELLULAR = 3 +}; + +/** + * State of a network interface. + */ +[assert_size(4)] +enum PP_NetworkList_State { + /** + * Network interface is down. + */ + PP_NETWORKLIST_STATE_DOWN = 0, + + /** + * Network interface is up. + */ + PP_NETWORKLIST_STATE_UP = 1 +}; + +/** + * The PPB_NetworkList is used to represent a list of + * network interfaces and their configuration. The content of the list + * is immutable. The current networks configuration can be received + * using the PPB_NetworkMonitor interface. + */ +interface PPB_NetworkList { + /** + * Determines if the specified resource is a + * NetworkList object. + * + * @param[in] resource A PP_Resource resource. + * + * @return Returns PP_TRUE if resource is + * a PPB_NetworkList, PP_FALSE + * otherwise. + */ + PP_Bool IsNetworkList([in] PP_Resource resource); + + /** + * Gets number of interfaces in the list. + * + * @param[in] resource A PP_Resource corresponding to a + * network list. + * + * @return Returns number of available network interfaces or 0 if + * the list has never been updated. + */ + uint32_t GetCount([in] PP_Resource resource); + + /** + * Gets name of a network interface. + * + * @param[in] resource A PP_Resource corresponding to a + * network list. + * @param[in] index Index of the network interface. + * + * @return Returns name for the network interface with the specified + * index. + */ + PP_Var GetName([in] PP_Resource resource, + [in] uint32_t index); + + /** + * Gets type of a network interface. + * + * @param[in] resource A PP_Resource corresponding to a + * network list. + * @param[in] index Index of the network interface. + * + * @return Returns type of the network interface with the specified + * index. + */ + [on_failure=PP_NETWORKLIST_TYPE_UNKNOWN] + PP_NetworkList_Type GetType([in] PP_Resource resource, + [in] uint32_t index); + + /** + * Gets state of a network interface. + * + * @param[in] resource A PP_Resource corresponding to a + * network list. + * @param[in] index Index of the network interface. + * + * @return Returns current state of the network interface with the + * specified index. + */ + [on_failure=PP_NETWORKLIST_STATE_DOWN] + PP_NetworkList_State GetState([in] PP_Resource resource, + [in] uint32_t index); + + /** + * Gets list of IP addresses for a network interface. + * + * @param[in] resource A PP_Resource corresponding to a + * network list. + * @param[in] index Index of the network interface. + * @param[in] output An output array which will receive + * PPB_NetAddress resources on success. Please note that the + * ref count of those resources has already been increased by 1 for the + * caller. + * + * @return An error code from pp_errors.h. + */ + int32_t GetIpAddresses([in] PP_Resource resource, + [in] uint32_t index, + [in] PP_ArrayOutput output); + + /** + * Gets display name of a network interface. + * + * @param[in] resource A PP_Resource corresponding to a + * network list. + * @param[in] index Index of the network interface. + * + * @return Returns display name for the network interface with the + * specified index. + */ + PP_Var GetDisplayName([in] PP_Resource resource, + [in] uint32_t index); + + /** + * Gets MTU (Maximum Transmission Unit) of a network interface. + * + * @param[in] resource A PP_Resource corresponding to a + * network list. + * @param[in] index Index of the network interface. + * + * @return Returns MTU for the network interface with the specified + * index or 0 if MTU is unknown. + */ + uint32_t GetMTU([in] PP_Resource resource, + [in] uint32_t index); + +}; diff --git a/browser/extensions/mortar/ppapi/api/ppb_network_monitor.idl b/browser/extensions/mortar/ppapi/api/ppb_network_monitor.idl new file mode 100644 index 000000000000..361f7cbbeb49 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_network_monitor.idl @@ -0,0 +1,69 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_NetworkMonitor interface. + */ + +[generate_thunk] + +label Chrome { + M31 = 1.0 +}; + +/** + * The PPB_NetworkMonitor allows to get network interfaces + * configuration and monitor network configuration changes. + * + * Permissions: Apps permission socket with subrule + * network-state is required for UpdateNetworkList(). + * For more details about network communication permissions, please see: + * http://developer.chrome.com/apps/app_network.html + */ +interface PPB_NetworkMonitor { + /** + * Creates a Network Monitor resource. + * + * @param[in] instance A PP_Instance identifying one instance of + * a module. + * + * @return A PP_Resource corresponding to a network monitor or 0 + * on failure. + */ + PP_Resource Create([in] PP_Instance instance); + + + /** + * Gets current network configuration. When called for the first time, + * completes as soon as the current network configuration is received from + * the browser. Each consequent call will wait for network list changes, + * returning a new PPB_NetworkList resource every time. + * + * @param[in] network_monitor A PP_Resource corresponding to a + * network monitor. + * @param[out] network_list The PPB_NetworkList resource with the + * current state of network interfaces. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * PP_ERROR_NOACCESS will be returned if the caller doesn't have + * required permissions. + */ + int32_t UpdateNetworkList([in] PP_Resource network_monitor, + [out] PP_Resource network_list, + [in] PP_CompletionCallback callback); + + /** + * Determines if the specified resource is a + * NetworkMonitor object. + * + * @param[in] resource A PP_Resource resource. + * + * @return Returns PP_TRUE if resource is a + * PPB_NetworkMonitor, PP_FALSE otherwise. + */ + PP_Bool IsNetworkMonitor([in] PP_Resource resource); +}; diff --git a/browser/extensions/mortar/ppapi/api/ppb_network_proxy.idl b/browser/extensions/mortar/ppapi/api/ppb_network_proxy.idl new file mode 100644 index 000000000000..6957f4a6babe --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_network_proxy.idl @@ -0,0 +1,53 @@ +/* Copyright 2013 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_NetworkProxy interface. + */ + +[generate_thunk] + +label Chrome { + M29 = 1.0 +}; + +/** + * This interface provides a way to determine the appropriate proxy settings + * for a given URL. + * + * Permissions: Apps permission socket with subrule + * resolve-proxy is required for using this API. + * For more details about network communication permissions, please see: + * http://developer.chrome.com/apps/app_network.html + */ +[singleton] +interface PPB_NetworkProxy { + /** + * Retrieves the proxy that will be used for the given URL. The result will + * be a string in PAC format. For more details about PAC format, please see + * http://en.wikipedia.org/wiki/Proxy_auto-config + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * + * @param[in] url A string PP_Var containing a URL. + * + * @param[out] proxy_string A PP_Var that GetProxyForURL will + * set upon successful completion. If the call fails, proxy_string + * will be unchanged. Otherwise, it will be set to a string + * PP_Var containing the appropriate PAC string for url. + * If set, proxy_string will have a reference count of 1 which + * the plugin must manage. + * + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t GetProxyForURL([in] PP_Instance instance, + [in] PP_Var url, + [out] PP_Var proxy_string, + [in] PP_CompletionCallback callback); +}; diff --git a/browser/extensions/mortar/ppapi/api/ppb_opengles2.idl b/browser/extensions/mortar/ppapi/api/ppb_opengles2.idl new file mode 100644 index 000000000000..5f0809928600 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_opengles2.idl @@ -0,0 +1,741 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// This file is auto-generated from +// gpu/command_buffer/build_gles2_cmd_buffer.py +// It's formatted by clang-format using chromium coding style: +// clang-format -i -style=chromium filename +// DO NOT EDIT! + +label Chrome { + M39 = 1.0 +}; + +[version=1.0] +describe { + GLbitfield; + GLbitfield_ptr_t; + GLboolean; + GLboolean_ptr_t; + GLbyte; + GLbyte_ptr_t; + GLclampf; + GLclampf_ptr_t; + GLclampx; + GLclampx_ptr_t; + GLenum; + GLenum_ptr_t; + GLfixed; + GLfixed_ptr_t; + GLfloat; + GLfloat_ptr_t; + GLint; + GLint_ptr_t; + GLintptr; + GLintptr_ptr_t; + GLshort; + GLshort_ptr_t; + GLsizei; + GLsizei_ptr_t; + GLsizeiptr; + GLsizeiptr_ptr_t; + GLubyte; + GLubyte_ptr_t; + GLuint; + GLuint_ptr_t; + GLushort; + GLushort_ptr_t; +}; + +#inline c +#include "ppapi/c/pp_resource.h" + +#ifndef __gl2_h_ +typedef void GLvoid; +typedef int GLsizei; +typedef unsigned short GLushort; +typedef short GLshort; +typedef unsigned char GLubyte; +typedef unsigned int GLenum; +typedef int GLint; +typedef unsigned char GLboolean; +typedef unsigned int GLbitfield; +typedef float GLfloat; +typedef float GLclampf; +typedef signed char GLbyte; +typedef unsigned int GLuint; +typedef int GLfixed; +typedef int GLclampx; +#ifdef _WIN64 +typedef long long int GLintptr; +typedef long long int GLsizeiptr; +#else +typedef long int GLintptr; +typedef long int GLsizeiptr; +#endif // _WIN64 +#endif // __gl2_h_ + +#endinl + +[macro="PPB_OPENGLES2_INTERFACE", force_struct_namespace] +interface PPB_OpenGLES2 { + void ActiveTexture([in] PP_Resource context, + [in] GLenum texture); + void AttachShader([in] PP_Resource context, + [in] GLuint program, + [in] GLuint shader); + void BindAttribLocation([in] PP_Resource context, + [in] GLuint program, + [in] GLuint index, + [in] cstr_t name); + void BindBuffer([in] PP_Resource context, + [in] GLenum target, + [in] GLuint buffer); + void BindFramebuffer([in] PP_Resource context, + [in] GLenum target, + [in] GLuint framebuffer); + void BindRenderbuffer([in] PP_Resource context, + [in] GLenum target, + [in] GLuint renderbuffer); + void BindTexture([in] PP_Resource context, + [in] GLenum target, + [in] GLuint texture); + void BlendColor([in] PP_Resource context, + [in] GLclampf red, + [in] GLclampf green, + [in] GLclampf blue, + [in] GLclampf alpha); + void BlendEquation([in] PP_Resource context, + [in] GLenum mode); + void BlendEquationSeparate([in] PP_Resource context, + [in] GLenum modeRGB, + [in] GLenum modeAlpha); + void BlendFunc([in] PP_Resource context, + [in] GLenum sfactor, + [in] GLenum dfactor); + void BlendFuncSeparate([in] PP_Resource context, + [in] GLenum srcRGB, + [in] GLenum dstRGB, + [in] GLenum srcAlpha, + [in] GLenum dstAlpha); + void BufferData([in] PP_Resource context, + [in] GLenum target, + [in] GLsizeiptr size, + [in] mem_t data, + [in] GLenum usage); + void BufferSubData([in] PP_Resource context, + [in] GLenum target, + [in] GLintptr offset, + [in] GLsizeiptr size, + [in] mem_t data); + GLenum CheckFramebufferStatus([in] PP_Resource context, + [in] GLenum target); + void Clear([in] PP_Resource context, + [in] GLbitfield mask); + void ClearColor([in] PP_Resource context, + [in] GLclampf red, + [in] GLclampf green, + [in] GLclampf blue, + [in] GLclampf alpha); + void ClearDepthf([in] PP_Resource context, + [in] GLclampf depth); + void ClearStencil([in] PP_Resource context, + [in] GLint s); + void ColorMask([in] PP_Resource context, + [in] GLboolean red, + [in] GLboolean green, + [in] GLboolean blue, + [in] GLboolean alpha); + void CompileShader([in] PP_Resource context, + [in] GLuint shader); + void CompressedTexImage2D([in] PP_Resource context, + [in] GLenum target, + [in] GLint level, + [in] GLenum internalformat, + [in] GLsizei width, + [in] GLsizei height, + [in] GLint border, + [in] GLsizei imageSize, + [in] mem_t data); + void CompressedTexSubImage2D([in] PP_Resource context, + [in] GLenum target, + [in] GLint level, + [in] GLint xoffset, + [in] GLint yoffset, + [in] GLsizei width, + [in] GLsizei height, + [in] GLenum format, + [in] GLsizei imageSize, + [in] mem_t data); + void CopyTexImage2D([in] PP_Resource context, + [in] GLenum target, + [in] GLint level, + [in] GLenum internalformat, + [in] GLint x, + [in] GLint y, + [in] GLsizei width, + [in] GLsizei height, + [in] GLint border); + void CopyTexSubImage2D([in] PP_Resource context, + [in] GLenum target, + [in] GLint level, + [in] GLint xoffset, + [in] GLint yoffset, + [in] GLint x, + [in] GLint y, + [in] GLsizei width, + [in] GLsizei height); + GLuint CreateProgram([in] PP_Resource context); + GLuint CreateShader([in] PP_Resource context, + [in] GLenum type); + void CullFace([in] PP_Resource context, + [in] GLenum mode); + void DeleteBuffers([in] PP_Resource context, + [in] GLsizei n, + [in] GLuint_ptr_t buffers); + void DeleteFramebuffers([in] PP_Resource context, + [in] GLsizei n, + [in] GLuint_ptr_t framebuffers); + void DeleteProgram([in] PP_Resource context, + [in] GLuint program); + void DeleteRenderbuffers([in] PP_Resource context, + [in] GLsizei n, + [in] GLuint_ptr_t renderbuffers); + void DeleteShader([in] PP_Resource context, + [in] GLuint shader); + void DeleteTextures([in] PP_Resource context, + [in] GLsizei n, + [in] GLuint_ptr_t textures); + void DepthFunc([in] PP_Resource context, + [in] GLenum func); + void DepthMask([in] PP_Resource context, + [in] GLboolean flag); + void DepthRangef([in] PP_Resource context, + [in] GLclampf zNear, + [in] GLclampf zFar); + void DetachShader([in] PP_Resource context, + [in] GLuint program, + [in] GLuint shader); + void Disable([in] PP_Resource context, + [in] GLenum cap); + void DisableVertexAttribArray([in] PP_Resource context, + [in] GLuint index); + void DrawArrays([in] PP_Resource context, + [in] GLenum mode, + [in] GLint first, + [in] GLsizei count); + void DrawElements([in] PP_Resource context, + [in] GLenum mode, + [in] GLsizei count, + [in] GLenum type, + [in] mem_t indices); + void Enable([in] PP_Resource context, + [in] GLenum cap); + void EnableVertexAttribArray([in] PP_Resource context, + [in] GLuint index); + void Finish([in] PP_Resource context); + void Flush([in] PP_Resource context); + void FramebufferRenderbuffer([in] PP_Resource context, + [in] GLenum target, + [in] GLenum attachment, + [in] GLenum renderbuffertarget, + [in] GLuint renderbuffer); + void FramebufferTexture2D([in] PP_Resource context, + [in] GLenum target, + [in] GLenum attachment, + [in] GLenum textarget, + [in] GLuint texture, + [in] GLint level); + void FrontFace([in] PP_Resource context, + [in] GLenum mode); + void GenBuffers([in] PP_Resource context, + [in] GLsizei n, + [out] GLuint_ptr_t buffers); + void GenerateMipmap([in] PP_Resource context, + [in] GLenum target); + void GenFramebuffers([in] PP_Resource context, + [in] GLsizei n, + [out] GLuint_ptr_t framebuffers); + void GenRenderbuffers([in] PP_Resource context, + [in] GLsizei n, + [out] GLuint_ptr_t renderbuffers); + void GenTextures([in] PP_Resource context, + [in] GLsizei n, + [out] GLuint_ptr_t textures); + void GetActiveAttrib([in] PP_Resource context, + [in] GLuint program, + [in] GLuint index, + [in] GLsizei bufsize, + [out] GLsizei_ptr_t length, + [out] GLint_ptr_t size, + [out] GLenum_ptr_t type, + [out] str_t name); + void GetActiveUniform([in] PP_Resource context, + [in] GLuint program, + [in] GLuint index, + [in] GLsizei bufsize, + [out] GLsizei_ptr_t length, + [out] GLint_ptr_t size, + [out] GLenum_ptr_t type, + [out] str_t name); + void GetAttachedShaders([in] PP_Resource context, + [in] GLuint program, + [in] GLsizei maxcount, + [out] GLsizei_ptr_t count, + [out] GLuint_ptr_t shaders); + GLint GetAttribLocation([in] PP_Resource context, + [in] GLuint program, + [in] cstr_t name); + void GetBooleanv([in] PP_Resource context, + [in] GLenum pname, + [out] GLboolean_ptr_t params); + void GetBufferParameteriv([in] PP_Resource context, + [in] GLenum target, + [in] GLenum pname, + [out] GLint_ptr_t params); + GLenum GetError([in] PP_Resource context); + void GetFloatv([in] PP_Resource context, + [in] GLenum pname, + [out] GLfloat_ptr_t params); + void GetFramebufferAttachmentParameteriv([in] PP_Resource context, + [in] GLenum target, + [in] GLenum attachment, + [in] GLenum pname, + [out] GLint_ptr_t params); + void GetIntegerv([in] PP_Resource context, + [in] GLenum pname, + [out] GLint_ptr_t params); + void GetProgramiv([in] PP_Resource context, + [in] GLuint program, + [in] GLenum pname, + [out] GLint_ptr_t params); + void GetProgramInfoLog([in] PP_Resource context, + [in] GLuint program, + [in] GLsizei bufsize, + [out] GLsizei_ptr_t length, + [out] str_t infolog); + void GetRenderbufferParameteriv([in] PP_Resource context, + [in] GLenum target, + [in] GLenum pname, + [out] GLint_ptr_t params); + void GetShaderiv([in] PP_Resource context, + [in] GLuint shader, + [in] GLenum pname, + [out] GLint_ptr_t params); + void GetShaderInfoLog([in] PP_Resource context, + [in] GLuint shader, + [in] GLsizei bufsize, + [out] GLsizei_ptr_t length, + [out] str_t infolog); + void GetShaderPrecisionFormat([in] PP_Resource context, + [in] GLenum shadertype, + [in] GLenum precisiontype, + [out] GLint_ptr_t range, + [out] GLint_ptr_t precision); + void GetShaderSource([in] PP_Resource context, + [in] GLuint shader, + [in] GLsizei bufsize, + [out] GLsizei_ptr_t length, + [out] str_t source); + GLubyte_ptr_t GetString([in] PP_Resource context, + [in] GLenum name); + void GetTexParameterfv([in] PP_Resource context, + [in] GLenum target, + [in] GLenum pname, + [out] GLfloat_ptr_t params); + void GetTexParameteriv([in] PP_Resource context, + [in] GLenum target, + [in] GLenum pname, + [out] GLint_ptr_t params); + void GetUniformfv([in] PP_Resource context, + [in] GLuint program, + [in] GLint location, + [out] GLfloat_ptr_t params); + void GetUniformiv([in] PP_Resource context, + [in] GLuint program, + [in] GLint location, + [out] GLint_ptr_t params); + GLint GetUniformLocation([in] PP_Resource context, + [in] GLuint program, + [in] cstr_t name); + void GetVertexAttribfv([in] PP_Resource context, + [in] GLuint index, + [in] GLenum pname, + [out] GLfloat_ptr_t params); + void GetVertexAttribiv([in] PP_Resource context, + [in] GLuint index, + [in] GLenum pname, + [out] GLint_ptr_t params); + void GetVertexAttribPointerv([in] PP_Resource context, + [in] GLuint index, + [in] GLenum pname, + [out] mem_ptr_t pointer); + void Hint([in] PP_Resource context, + [in] GLenum target, + [in] GLenum mode); + GLboolean IsBuffer([in] PP_Resource context, + [in] GLuint buffer); + GLboolean IsEnabled([in] PP_Resource context, + [in] GLenum cap); + GLboolean IsFramebuffer([in] PP_Resource context, + [in] GLuint framebuffer); + GLboolean IsProgram([in] PP_Resource context, + [in] GLuint program); + GLboolean IsRenderbuffer([in] PP_Resource context, + [in] GLuint renderbuffer); + GLboolean IsShader([in] PP_Resource context, + [in] GLuint shader); + GLboolean IsTexture([in] PP_Resource context, + [in] GLuint texture); + void LineWidth([in] PP_Resource context, + [in] GLfloat width); + void LinkProgram([in] PP_Resource context, + [in] GLuint program); + void PixelStorei([in] PP_Resource context, + [in] GLenum pname, + [in] GLint param); + void PolygonOffset([in] PP_Resource context, + [in] GLfloat factor, + [in] GLfloat units); + void ReadPixels([in] PP_Resource context, + [in] GLint x, + [in] GLint y, + [in] GLsizei width, + [in] GLsizei height, + [in] GLenum format, + [in] GLenum type, + [out] mem_t pixels); + void ReleaseShaderCompiler([in] PP_Resource context); + void RenderbufferStorage([in] PP_Resource context, + [in] GLenum target, + [in] GLenum internalformat, + [in] GLsizei width, + [in] GLsizei height); + void SampleCoverage([in] PP_Resource context, + [in] GLclampf value, + [in] GLboolean invert); + void Scissor([in] PP_Resource context, + [in] GLint x, + [in] GLint y, + [in] GLsizei width, + [in] GLsizei height); + void ShaderBinary([in] PP_Resource context, + [in] GLsizei n, + [in] GLuint_ptr_t shaders, + [in] GLenum binaryformat, + [in] mem_t binary, + [in] GLsizei length); + void ShaderSource([in] PP_Resource context, + [in] GLuint shader, + [in] GLsizei count, + [out] cstr_t str, + [in] GLint_ptr_t length); + void StencilFunc([in] PP_Resource context, + [in] GLenum func, + [in] GLint ref, + [in] GLuint mask); + void StencilFuncSeparate([in] PP_Resource context, + [in] GLenum face, + [in] GLenum func, + [in] GLint ref, + [in] GLuint mask); + void StencilMask([in] PP_Resource context, + [in] GLuint mask); + void StencilMaskSeparate([in] PP_Resource context, + [in] GLenum face, + [in] GLuint mask); + void StencilOp([in] PP_Resource context, + [in] GLenum fail, + [in] GLenum zfail, + [in] GLenum zpass); + void StencilOpSeparate([in] PP_Resource context, + [in] GLenum face, + [in] GLenum fail, + [in] GLenum zfail, + [in] GLenum zpass); + void TexImage2D([in] PP_Resource context, + [in] GLenum target, + [in] GLint level, + [in] GLint internalformat, + [in] GLsizei width, + [in] GLsizei height, + [in] GLint border, + [in] GLenum format, + [in] GLenum type, + [in] mem_t pixels); + void TexParameterf([in] PP_Resource context, + [in] GLenum target, + [in] GLenum pname, + [in] GLfloat param); + void TexParameterfv([in] PP_Resource context, + [in] GLenum target, + [in] GLenum pname, + [in] GLfloat_ptr_t params); + void TexParameteri([in] PP_Resource context, + [in] GLenum target, + [in] GLenum pname, + [in] GLint param); + void TexParameteriv([in] PP_Resource context, + [in] GLenum target, + [in] GLenum pname, + [in] GLint_ptr_t params); + void TexSubImage2D([in] PP_Resource context, + [in] GLenum target, + [in] GLint level, + [in] GLint xoffset, + [in] GLint yoffset, + [in] GLsizei width, + [in] GLsizei height, + [in] GLenum format, + [in] GLenum type, + [in] mem_t pixels); + void Uniform1f([in] PP_Resource context, + [in] GLint location, + [in] GLfloat x); + void Uniform1fv([in] PP_Resource context, + [in] GLint location, + [in] GLsizei count, + [in] GLfloat_ptr_t v); + void Uniform1i([in] PP_Resource context, + [in] GLint location, + [in] GLint x); + void Uniform1iv([in] PP_Resource context, + [in] GLint location, + [in] GLsizei count, + [in] GLint_ptr_t v); + void Uniform2f([in] PP_Resource context, + [in] GLint location, + [in] GLfloat x, + [in] GLfloat y); + void Uniform2fv([in] PP_Resource context, + [in] GLint location, + [in] GLsizei count, + [in] GLfloat_ptr_t v); + void Uniform2i([in] PP_Resource context, + [in] GLint location, + [in] GLint x, + [in] GLint y); + void Uniform2iv([in] PP_Resource context, + [in] GLint location, + [in] GLsizei count, + [in] GLint_ptr_t v); + void Uniform3f([in] PP_Resource context, + [in] GLint location, + [in] GLfloat x, + [in] GLfloat y, + [in] GLfloat z); + void Uniform3fv([in] PP_Resource context, + [in] GLint location, + [in] GLsizei count, + [in] GLfloat_ptr_t v); + void Uniform3i([in] PP_Resource context, + [in] GLint location, + [in] GLint x, + [in] GLint y, + [in] GLint z); + void Uniform3iv([in] PP_Resource context, + [in] GLint location, + [in] GLsizei count, + [in] GLint_ptr_t v); + void Uniform4f([in] PP_Resource context, + [in] GLint location, + [in] GLfloat x, + [in] GLfloat y, + [in] GLfloat z, + [in] GLfloat w); + void Uniform4fv([in] PP_Resource context, + [in] GLint location, + [in] GLsizei count, + [in] GLfloat_ptr_t v); + void Uniform4i([in] PP_Resource context, + [in] GLint location, + [in] GLint x, + [in] GLint y, + [in] GLint z, + [in] GLint w); + void Uniform4iv([in] PP_Resource context, + [in] GLint location, + [in] GLsizei count, + [in] GLint_ptr_t v); + void UniformMatrix2fv([in] PP_Resource context, + [in] GLint location, + [in] GLsizei count, + [in] GLboolean transpose, + [in] GLfloat_ptr_t value); + void UniformMatrix3fv([in] PP_Resource context, + [in] GLint location, + [in] GLsizei count, + [in] GLboolean transpose, + [in] GLfloat_ptr_t value); + void UniformMatrix4fv([in] PP_Resource context, + [in] GLint location, + [in] GLsizei count, + [in] GLboolean transpose, + [in] GLfloat_ptr_t value); + void UseProgram([in] PP_Resource context, + [in] GLuint program); + void ValidateProgram([in] PP_Resource context, + [in] GLuint program); + void VertexAttrib1f([in] PP_Resource context, + [in] GLuint indx, + [in] GLfloat x); + void VertexAttrib1fv([in] PP_Resource context, + [in] GLuint indx, + [in] GLfloat_ptr_t values); + void VertexAttrib2f([in] PP_Resource context, + [in] GLuint indx, + [in] GLfloat x, + [in] GLfloat y); + void VertexAttrib2fv([in] PP_Resource context, + [in] GLuint indx, + [in] GLfloat_ptr_t values); + void VertexAttrib3f([in] PP_Resource context, + [in] GLuint indx, + [in] GLfloat x, + [in] GLfloat y, + [in] GLfloat z); + void VertexAttrib3fv([in] PP_Resource context, + [in] GLuint indx, + [in] GLfloat_ptr_t values); + void VertexAttrib4f([in] PP_Resource context, + [in] GLuint indx, + [in] GLfloat x, + [in] GLfloat y, + [in] GLfloat z, + [in] GLfloat w); + void VertexAttrib4fv([in] PP_Resource context, + [in] GLuint indx, + [in] GLfloat_ptr_t values); + void VertexAttribPointer([in] PP_Resource context, + [in] GLuint indx, + [in] GLint size, + [in] GLenum type, + [in] GLboolean normalized, + [in] GLsizei stride, + [in] mem_t ptr); + void Viewport([in] PP_Resource context, + [in] GLint x, + [in] GLint y, + [in] GLsizei width, + [in] GLsizei height); +}; + + +[macro="PPB_OPENGLES2_INSTANCEDARRAYS_INTERFACE", force_struct_namespace] +interface PPB_OpenGLES2InstancedArrays { + void DrawArraysInstancedANGLE([in] PP_Resource context, + [in] GLenum mode, + [in] GLint first, + [in] GLsizei count, + [in] GLsizei primcount); + void DrawElementsInstancedANGLE([in] PP_Resource context, + [in] GLenum mode, + [in] GLsizei count, + [in] GLenum type, + [in] mem_t indices, + [in] GLsizei primcount); + void VertexAttribDivisorANGLE([in] PP_Resource context, + [in] GLuint index, + [in] GLuint divisor); +}; + + +[macro="PPB_OPENGLES2_FRAMEBUFFERBLIT_INTERFACE", force_struct_namespace] +interface PPB_OpenGLES2FramebufferBlit { + void BlitFramebufferEXT([in] PP_Resource context, + [in] GLint srcX0, + [in] GLint srcY0, + [in] GLint srcX1, + [in] GLint srcY1, + [in] GLint dstX0, + [in] GLint dstY0, + [in] GLint dstX1, + [in] GLint dstY1, + [in] GLbitfield mask, + [in] GLenum filter); +}; + + +[macro="PPB_OPENGLES2_FRAMEBUFFERMULTISAMPLE_INTERFACE", force_struct_namespace] +interface PPB_OpenGLES2FramebufferMultisample { + void RenderbufferStorageMultisampleEXT([in] PP_Resource context, + [in] GLenum target, + [in] GLsizei samples, + [in] GLenum internalformat, + [in] GLsizei width, + [in] GLsizei height); +}; + + +[macro="PPB_OPENGLES2_CHROMIUMENABLEFEATURE_INTERFACE", force_struct_namespace] +interface PPB_OpenGLES2ChromiumEnableFeature { + GLboolean EnableFeatureCHROMIUM([in] PP_Resource context, + [in] cstr_t feature); +}; + + +[macro="PPB_OPENGLES2_CHROMIUMMAPSUB_INTERFACE", force_struct_namespace] +interface PPB_OpenGLES2ChromiumMapSub { + mem_t MapBufferSubDataCHROMIUM([in] PP_Resource context, + [in] GLuint target, + [in] GLintptr offset, + [in] GLsizeiptr size, + [in] GLenum access); + void UnmapBufferSubDataCHROMIUM([in] PP_Resource context, + [in] mem_t mem); + mem_t MapTexSubImage2DCHROMIUM([in] PP_Resource context, + [in] GLenum target, + [in] GLint level, + [in] GLint xoffset, + [in] GLint yoffset, + [in] GLsizei width, + [in] GLsizei height, + [in] GLenum format, + [in] GLenum type, + [in] GLenum access); + void UnmapTexSubImage2DCHROMIUM([in] PP_Resource context, + [in] mem_t mem); +}; + + +[macro="PPB_OPENGLES2_QUERY_INTERFACE", force_struct_namespace] +interface PPB_OpenGLES2Query { + void GenQueriesEXT([in] PP_Resource context, + [in] GLsizei n, + [out] GLuint_ptr_t queries); + void DeleteQueriesEXT([in] PP_Resource context, + [in] GLsizei n, + [in] GLuint_ptr_t queries); + GLboolean IsQueryEXT([in] PP_Resource context, + [in] GLuint id); + void BeginQueryEXT([in] PP_Resource context, + [in] GLenum target, + [in] GLuint id); + void EndQueryEXT([in] PP_Resource context, + [in] GLenum target); + void GetQueryivEXT([in] PP_Resource context, + [in] GLenum target, + [in] GLenum pname, + [out] GLint_ptr_t params); + void GetQueryObjectuivEXT([in] PP_Resource context, + [in] GLuint id, + [in] GLenum pname, + [out] GLuint_ptr_t params); +}; + + +[macro="PPB_OPENGLES2_VERTEXARRAYOBJECT_INTERFACE", force_struct_namespace] +interface PPB_OpenGLES2VertexArrayObject { + void GenVertexArraysOES([in] PP_Resource context, + [in] GLsizei n, + [out] GLuint_ptr_t arrays); + void DeleteVertexArraysOES([in] PP_Resource context, + [in] GLsizei n, + [in] GLuint_ptr_t arrays); + GLboolean IsVertexArrayOES([in] PP_Resource context, + [in] GLuint array); + void BindVertexArrayOES([in] PP_Resource context, + [in] GLuint array); +}; + diff --git a/browser/extensions/mortar/ppapi/api/ppb_tcp_socket.idl b/browser/extensions/mortar/ppapi/api/ppb_tcp_socket.idl new file mode 100644 index 000000000000..5851f1d3e34d --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_tcp_socket.idl @@ -0,0 +1,291 @@ +/* Copyright 2013 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_TCPSocket interface. + */ + +label Chrome { + M29 = 1.0, + M31 = 1.1, + M41 = 1.2 +}; + +/** + * Option names used by SetOption(). + */ +[assert_size(4)] +enum PP_TCPSocket_Option { + /** + * Disables coalescing of small writes to make TCP segments, and instead + * delivers data immediately. Value's type is PP_VARTYPE_BOOL. + * On version 1.1 or earlier, this option can only be set after a successful + * Connect() call. On version 1.2 or later, there is no such + * limitation. + */ + PP_TCPSOCKET_OPTION_NO_DELAY = 0, + + /** + * Specifies the total per-socket buffer space reserved for sends. Value's + * type should be PP_VARTYPE_INT32. + * On version 1.1 or earlier, this option can only be set after a successful + * Connect() call. On version 1.2 or later, there is no such + * limitation. + * + * Note: This is only treated as a hint for the browser to set the buffer + * size. Even if SetOption() succeeds, the browser doesn't + * guarantee it will conform to the size. + */ + PP_TCPSOCKET_OPTION_SEND_BUFFER_SIZE = 1, + + /** + * Specifies the total per-socket buffer space reserved for receives. Value's + * type should be PP_VARTYPE_INT32. + * On version 1.1 or earlier, this option can only be set after a successful + * Connect() call. On version 1.2 or later, there is no such + * limitation. + * + * Note: This is only treated as a hint for the browser to set the buffer + * size. Even if SetOption() succeeds, the browser doesn't + * guarantee it will conform to the size. + */ + PP_TCPSOCKET_OPTION_RECV_BUFFER_SIZE = 2 +}; + +/** + * The PPB_TCPSocket interface provides TCP socket operations. + * + * Permissions: Apps permission socket with subrule + * tcp-connect is required for Connect(); subrule + * tcp-listen is required for Listen(). + * For more details about network communication permissions, please see: + * http://developer.chrome.com/apps/app_network.html + */ +interface PPB_TCPSocket { + /** + * Creates a TCP socket resource. + * + * @param[in] instance A PP_Instance identifying one instance of + * a module. + * + * @return A PP_Resource corresponding to a TCP socket or 0 + * on failure. + */ + PP_Resource Create([in] PP_Instance instance); + + /** + * Determines if a given resource is a TCP socket. + * + * @param[in] resource A PP_Resource to check. + * + * @return PP_TRUE if the input is a + * PPB_TCPSocket resource; PP_FALSE otherwise. + */ + PP_Bool IsTCPSocket([in] PP_Resource resource); + + /** + * Binds the socket to the given address. The socket must not be bound. + * + * @param[in] tcp_socket A PP_Resource corresponding to a TCP + * socket. + * @param[in] addr A PPB_NetAddress resource. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h, + * including (but not limited to): + * - PP_ERROR_ADDRESS_IN_USE: the address is already in use. + * - PP_ERROR_ADDRESS_INVALID: the address is invalid. + */ + [version=1.1] + int32_t Bind([in] PP_Resource tcp_socket, + [in] PP_Resource addr, + [in] PP_CompletionCallback callback); + + /** + * Connects the socket to the given address. The socket must not be listening. + * Binding the socket beforehand is optional. + * + * @param[in] tcp_socket A PP_Resource corresponding to a TCP + * socket. + * @param[in] addr A PPB_NetAddress resource. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h, + * including (but not limited to): + * - PP_ERROR_NOACCESS: the caller doesn't have required + * permissions. + * - PP_ERROR_ADDRESS_UNREACHABLE: addr is + * unreachable. + * - PP_ERROR_CONNECTION_REFUSED: the connection attempt was + * refused. + * - PP_ERROR_CONNECTION_FAILED: the connection attempt failed. + * - PP_ERROR_CONNECTION_TIMEDOUT: the connection attempt timed + * out. + * + * Since version 1.1, if the socket is listening/connected or has a pending + * listen/connect request, Connect() will fail without starting a + * connection attempt; otherwise, any failure during the connection attempt + * will cause the socket to be closed. + */ + int32_t Connect([in] PP_Resource tcp_socket, + [in] PP_Resource addr, + [in] PP_CompletionCallback callback); + + /** + * Gets the local address of the socket, if it is bound. + * + * @param[in] tcp_socket A PP_Resource corresponding to a TCP + * socket. + * + * @return A PPB_NetAddress resource on success or 0 on failure. + */ + PP_Resource GetLocalAddress([in] PP_Resource tcp_socket); + + /** + * Gets the remote address of the socket, if it is connected. + * + * @param[in] tcp_socket A PP_Resource corresponding to a TCP + * socket. + * + * @return A PPB_NetAddress resource on success or 0 on failure. + */ + PP_Resource GetRemoteAddress([in] PP_Resource tcp_socket); + + /** + * Reads data from the socket. The socket must be connected. It may perform a + * partial read. + * + * @param[in] tcp_socket A PP_Resource corresponding to a TCP + * socket. + * @param[out] buffer The buffer to store the received data on success. It + * must be at least as large as bytes_to_read. + * @param[in] bytes_to_read The number of bytes to read. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return A non-negative number on success to indicate how many bytes have + * been read, 0 means that end-of-file was reached; otherwise, an error code + * from pp_errors.h. + */ + int32_t Read([in] PP_Resource tcp_socket, + [out] str_t buffer, + [in] int32_t bytes_to_read, + [in] PP_CompletionCallback callback); + + /** + * Writes data to the socket. The socket must be connected. It may perform a + * partial write. + * + * @param[in] tcp_socket A PP_Resource corresponding to a TCP + * socket. + * @param[in] buffer The buffer containing the data to write. + * @param[in] bytes_to_write The number of bytes to write. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return A non-negative number on success to indicate how many bytes have + * been written; otherwise, an error code from pp_errors.h. + */ + int32_t Write([in] PP_Resource tcp_socket, + [in] str_t buffer, + [in] int32_t bytes_to_write, + [in] PP_CompletionCallback callback); + /** + * Starts listening. The socket must be bound and not connected. + * + * @param[in] tcp_socket A PP_Resource corresponding to a TCP + * socket. + * @param[in] backlog A hint to determine the maximum length to which the + * queue of pending connections may grow. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h, + * including (but not limited to): + * - PP_ERROR_NOACCESS: the caller doesn't have required + * permissions. + * - PP_ERROR_ADDRESS_IN_USE: Another socket is already listening + * on the same port. + */ + [version=1.1] + int32_t Listen([in] PP_Resource tcp_socket, + [in] int32_t backlog, + [in] PP_CompletionCallback callback); + + /** + * Accepts a connection. The socket must be listening. + * + * @param[in] tcp_socket A PP_Resource corresponding to a TCP + * socket. + * @param[out] accepted_tcp_socket Stores the accepted TCP socket on success. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h, + * including (but not limited to): + * - PP_ERROR_CONNECTION_ABORTED: A connection has been aborted. + */ + [version=1.1] + int32_t Accept([in] PP_Resource tcp_socket, + [out] PP_Resource accepted_tcp_socket, + [in] PP_CompletionCallback callback); + + /** + * Cancels all pending operations and closes the socket. Any pending callbacks + * will still run, reporting PP_ERROR_ABORTED if pending IO was + * interrupted. After a call to this method, no output buffer pointers passed + * into previous Read() or Accept() calls will be + * accessed. It is not valid to call Connect() or + * Listen() again. + * + * The socket is implicitly closed if it is destroyed, so you are not required + * to call this method. + * + * @param[in] tcp_socket A PP_Resource corresponding to a TCP + * socket. + */ + void Close([in] PP_Resource tcp_socket); + + /** + * Sets a socket option on the TCP socket. + * Please see the PP_TCPSocket_Option description for option + * names, value types and allowed values. + * + * @param[in] tcp_socket A PP_Resource corresponding to a TCP + * socket. + * @param[in] name The option to set. + * @param[in] value The option value to set. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t SetOption([in] PP_Resource tcp_socket, + [in] PP_TCPSocket_Option name, + [in] PP_Var value, + [in] PP_CompletionCallback callback); + + /** + * Sets a socket option on the TCP socket. + * Please see the PP_TCPSocket_Option description for option + * names, value types and allowed values. + * + * @param[in] tcp_socket A PP_Resource corresponding to a TCP + * socket. + * @param[in] name The option to set. + * @param[in] value The option value to set. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + */ + [version=1.2] + int32_t SetOption([in] PP_Resource tcp_socket, + [in] PP_TCPSocket_Option name, + [in] PP_Var value, + [in] PP_CompletionCallback callback); +}; diff --git a/browser/extensions/mortar/ppapi/api/ppb_text_input_controller.idl b/browser/extensions/mortar/ppapi/api/ppb_text_input_controller.idl new file mode 100644 index 000000000000..63a9b19bdd1c --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_text_input_controller.idl @@ -0,0 +1,95 @@ +/* Copyright 2013 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_TextInputController interface. + */ + +label Chrome { + M30 = 1.0 +}; + +/** + * PP_TextInput_Type is used to indicate the status of a plugin in regard to + * text input. + */ +[assert_size(4)] +enum PP_TextInput_Type { + /** + * Input caret is not in an editable mode, no input method shall be used. + */ + PP_TEXTINPUT_TYPE_NONE = 0, + /** + * Input caret is in a normal editable mode, any input method can be used. + */ + PP_TEXTINPUT_TYPE_TEXT = 1, + /** + * Input caret is in a password box, an input method may be used only if + * it's suitable for password input. + */ + PP_TEXTINPUT_TYPE_PASSWORD = 2, + PP_TEXTINPUT_TYPE_SEARCH = 3, + PP_TEXTINPUT_TYPE_EMAIL = 4, + PP_TEXTINPUT_TYPE_NUMBER = 5, + PP_TEXTINPUT_TYPE_TELEPHONE = 6, + PP_TEXTINPUT_TYPE_URL = 7 +}; + +/** + * PPB_TextInputController provides a set of functions for giving + * hints to the browser about the text input status of plugins, and functions + * for controlling input method editors (IMEs). + */ +interface PPB_TextInputController { + /** + * Informs the browser about the current text input mode of the plugin. + * Typical use of this information in the browser is to properly + * display/suppress tools for supporting text inputs (such as virtual + * keyboards in touch screen based devices, or input method editors often + * used for composing East Asian characters). + */ + void SetTextInputType([in] PP_Instance instance, + [in] PP_TextInput_Type type); + + /** + * Informs the browser about the coordinates of the text input caret area. + * Typical use of this information in the browser is to layout IME windows + * etc. + */ + void UpdateCaretPosition([in] PP_Instance instance, + [in] PP_Rect caret); + + /** + * Cancels the current composition in IME. + */ + void CancelCompositionText([in] PP_Instance instance); + + /** + * Informs the browser about the current text selection and surrounding + * text. text is a UTF-8 string that contains the current range + * of text selection in the plugin. caret is the byte-index of + * the caret position within text. anchor is the + * byte-index of the anchor position (i.e., if a range of text is selected, + * it is the other edge of selection different from caret. If + * there are no selection, anchor is equal to caret. + * + * Typical use of this information in the browser is to enable "reconversion" + * features of IME that puts back the already committed text into the + * pre-commit composition state. Another use is to improve the precision + * of suggestion of IME by taking the context into account (e.g., if the caret + * looks to be on the beginning of a sentence, suggest capital letters in a + * virtual keyboard). + * + * When the focus is not on text, call this function setting text + * to an empty string and caret and anchor to zero. + * Also, the plugin should send the empty text when it does not want to reveal + * the selection to IME (e.g., when the surrounding text is containing + * password text). + */ + void UpdateSurroundingText([in] PP_Instance instance, + [in] PP_Var text, + [in] uint32_t caret, + [in] uint32_t anchor); +}; diff --git a/browser/extensions/mortar/ppapi/api/ppb_udp_socket.idl b/browser/extensions/mortar/ppapi/api/ppb_udp_socket.idl new file mode 100644 index 000000000000..a9e7f84c22cf --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_udp_socket.idl @@ -0,0 +1,303 @@ +/* Copyright 2013 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_UDPSocket interface. + */ + +[generate_thunk] + +label Chrome { + M29 = 1.0, + M41 = 1.1, + M43 = 1.2 +}; + +/** + * Option names used by SetOption(). + */ +[assert_size(4)] +enum PP_UDPSocket_Option { + /** + * Allows the socket to share the local address to which it will be bound with + * other processes. Value's type should be PP_VARTYPE_BOOL. + * This option can only be set before calling Bind(). + */ + PP_UDPSOCKET_OPTION_ADDRESS_REUSE = 0, + + /** + * Allows sending and receiving packets to and from broadcast addresses. + * Value's type should be PP_VARTYPE_BOOL. + * On version 1.0, this option can only be set before calling + * Bind(). On version 1.1 or later, there is no such limitation. + */ + PP_UDPSOCKET_OPTION_BROADCAST = 1, + + /** + * Specifies the total per-socket buffer space reserved for sends. Value's + * type should be PP_VARTYPE_INT32. + * On version 1.0, this option can only be set after a successful + * Bind() call. On version 1.1 or later, there is no such + * limitation. + * + * Note: This is only treated as a hint for the browser to set the buffer + * size. Even if SetOption() succeeds, the browser doesn't + * guarantee it will conform to the size. + */ + PP_UDPSOCKET_OPTION_SEND_BUFFER_SIZE = 2, + + /** + * Specifies the total per-socket buffer space reserved for receives. Value's + * type should be PP_VARTYPE_INT32. + * On version 1.0, this option can only be set after a successful + * Bind() call. On version 1.1 or later, there is no such + * limitation. + * + * Note: This is only treated as a hint for the browser to set the buffer + * size. Even if SetOption() succeeds, the browser doesn't + * guarantee it will conform to the size. + */ + PP_UDPSOCKET_OPTION_RECV_BUFFER_SIZE = 3, + + /** + * Specifies whether the packets sent from the host to the multicast group + * should be looped back to the host or not. Value's type should be + * PP_VARTYPE_BOOL. + * This option can only be set before calling Bind(). + * + * This is only supported in version 1.2 of the API (Chrome 43) and later. + */ + PP_UDPSOCKET_OPTION_MULTICAST_LOOP = 4, + + /** + * Specifies the time-to-live for packets sent to the multicast group. The + * value should be within 0 to 255 range. The default value is 1 and means + * that packets will not be routed beyond the local network. Value's type + * should be PP_VARTYPE_INT32. + * This option can only be set before calling Bind(). + * + * This is only supported in version 1.2 of the API (Chrome 43) and later. + */ + PP_UDPSOCKET_OPTION_MULTICAST_TTL = 5 +}; + +/** + * The PPB_UDPSocket interface provides UDP socket operations. + * + * Permissions: Apps permission socket with subrule + * udp-bind is required for Bind(); subrule + * udp-send-to is required for SendTo(). + * For more details about network communication permissions, please see: + * http://developer.chrome.com/apps/app_network.html + */ +interface PPB_UDPSocket { + /** + * Creates a UDP socket resource. + * + * @param[in] instance A PP_Instance identifying one instance of + * a module. + * + * @return A PP_Resource corresponding to a UDP socket or 0 + * on failure. + */ + PP_Resource Create([in] PP_Instance instance); + + /** + * Determines if a given resource is a UDP socket. + * + * @param[in] resource A PP_Resource to check. + * + * @return PP_TRUE if the input is a PPB_UDPSocket + * resource; PP_FALSE otherwise. + */ + PP_Bool IsUDPSocket([in] PP_Resource resource); + + /** + * Binds the socket to the given address. + * + * @param[in] udp_socket A PP_Resource corresponding to a UDP + * socket. + * @param[in] addr A PPB_NetAddress resource. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * PP_ERROR_NOACCESS will be returned if the caller doesn't have + * required permissions. PP_ERROR_ADDRESS_IN_USE will be returned + * if the address is already in use. + */ + int32_t Bind([in] PP_Resource udp_socket, + [in] PP_Resource addr, + [in] PP_CompletionCallback callback); + + /** + * Gets the address that the socket is bound to. The socket must be bound. + * + * @param[in] udp_socket A PP_Resource corresponding to a UDP + * socket. + * + * @return A PPB_NetAddress resource on success or 0 on failure. + */ + PP_Resource GetBoundAddress([in] PP_Resource udp_socket); + + /** + * Receives data from the socket and stores the source address. The socket + * must be bound. + * + * @param[in] udp_socket A PP_Resource corresponding to a UDP + * socket. + * @param[out] buffer The buffer to store the received data on success. It + * must be at least as large as num_bytes. + * @param[in] num_bytes The number of bytes to receive. + * @param[out] addr A PPB_NetAddress resource to store the source + * address on success. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return A non-negative number on success to indicate how many bytes have + * been received; otherwise, an error code from pp_errors.h. + */ + int32_t RecvFrom([in] PP_Resource udp_socket, + [out] str_t buffer, + [in] int32_t num_bytes, + [out] PP_Resource addr, + [in] PP_CompletionCallback callback); + + /** + * Sends data to a specific destination. The socket must be bound. + * + * @param[in] udp_socket A PP_Resource corresponding to a UDP + * socket. + * @param[in] buffer The buffer containing the data to send. + * @param[in] num_bytes The number of bytes to send. + * @param[in] addr A PPB_NetAddress resource holding the + * destination address. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return A non-negative number on success to indicate how many bytes have + * been sent; otherwise, an error code from pp_errors.h. + * PP_ERROR_NOACCESS will be returned if the caller doesn't have + * required permissions. + * PP_ERROR_INPROGRESS will be returned if the socket is busy + * sending. The caller should wait until a pending send completes before + * retrying. + */ + int32_t SendTo([in] PP_Resource udp_socket, + [in] str_t buffer, + [in] int32_t num_bytes, + [in] PP_Resource addr, + [in] PP_CompletionCallback callback); + + /** + * Cancels all pending reads and writes, and closes the socket. Any pending + * callbacks will still run, reporting PP_ERROR_ABORTED if + * pending IO was interrupted. After a call to this method, no output + * parameters passed into previous RecvFrom() calls will be + * accessed. It is not valid to call Bind() again. + * + * The socket is implicitly closed if it is destroyed, so you are not + * required to call this method. + * + * @param[in] udp_socket A PP_Resource corresponding to a UDP + * socket. + */ + void Close([in] PP_Resource udp_socket); + + /** + * Sets a socket option on the UDP socket. + * Please see the PP_UDPSocket_Option description for option + * names, value types and allowed values. + * + * @param[in] udp_socket A PP_Resource corresponding to a UDP + * socket. + * @param[in] name The option to set. + * @param[in] value The option value to set. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t SetOption([in] PP_Resource udp_socket, + [in] PP_UDPSocket_Option name, + [in] PP_Var value, + [in] PP_CompletionCallback callback); + + /** + * Sets a socket option on the UDP socket. + * Please see the PP_UDPSocket_Option description for option + * names, value types and allowed values. + * + * @param[in] udp_socket A PP_Resource corresponding to a UDP + * socket. + * @param[in] name The option to set. + * @param[in] value The option value to set. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + */ + [version=1.1] + int32_t SetOption([in] PP_Resource udp_socket, + [in] PP_UDPSocket_Option name, + [in] PP_Var value, + [in] PP_CompletionCallback callback); + + /** + * Sets a socket option on the UDP socket. + * Please see the PP_UDPSocket_Option description for option + * names, value types and allowed values. + * + * @param[in] udp_socket A PP_Resource corresponding to a UDP + * socket. + * @param[in] name The option to set. + * @param[in] value The option value to set. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + */ + [version=1.2] + int32_t SetOption([in] PP_Resource udp_socket, + [in] PP_UDPSocket_Option name, + [in] PP_Var value, + [in] PP_CompletionCallback callback); + + /** + * Joins the multicast group with address specified by group + * parameter, which is expected to be a PPB_NetAddress object. + * + * @param[in] udp_socket A PP_Resource corresponding to a UDP + * socket. + * @param[in] group A PP_Resource corresponding to the network + * address of the multicast group. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + */ + [version=1.2] + int32_t JoinGroup([in] PP_Resource udp_socket, + [in] PP_Resource group, + [in] PP_CompletionCallback callback); + + /** + * Leaves the multicast group with address specified by group + * parameter, which is expected to be a PPB_NetAddress object. + * + * @param[in] udp_socket A PP_Resource corresponding to a UDP + * socket. + * @param[in] group A PP_Resource corresponding to the network + * address of the multicast group. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + */ + [version=1.2] + int32_t LeaveGroup([in] PP_Resource udp_socket, + [in] PP_Resource group, + [in] PP_CompletionCallback callback); +}; diff --git a/browser/extensions/mortar/ppapi/api/ppb_url_loader.idl b/browser/extensions/mortar/ppapi/api/ppb_url_loader.idl new file mode 100644 index 000000000000..6e1a271d8e08 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_url_loader.idl @@ -0,0 +1,225 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_URLLoader interface for loading + * URLs. + */ + +[generate_thunk] + +label Chrome { + M14 = 1.0 +}; + +/** + * The PPB_URLLoader interface contains pointers to functions + * for loading URLs. The typical steps for loading a URL are: + * + * -# Call Create() to create a URLLoader object. + * -# Create a URLRequestInfo object and set properties on it. + * Refer to PPB_URLRequestInfo for further information. + * -# Call Open() with the URLRequestInfo as an argument. + * -# When Open() completes, call GetResponseInfo() to examine the response + * headers. Refer to PPB_URLResponseInfo for further information. + * -# Call ReadResponseBody() to stream the data for the response. + * + * Alternatively, if PP_URLREQUESTPROPERTY_STREAMTOFILE was set on + * the URLRequestInfo in step #2: + * - Call FinishStreamingToFile(), after examining the response headers + * (step #4), to wait for the downloaded file to be complete. + * - Then, access the downloaded file using the GetBodyAsFileRef() function of + * the URLResponseInfo returned in step #4. + */ +interface PPB_URLLoader { + /** + * Create() creates a new URLLoader object. The + * URLLoader is associated with a particular instance, so that + * any UI dialogs that need to be shown to the user can be positioned + * relative to the window containing the instance. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * + * @return A PP_Resource corresponding to a URLLoader if + * successful, 0 if the instance is invalid. + */ + PP_Resource Create( + [in] PP_Instance instance); + + /** + * IsURLLoader() determines if a resource is an URLLoader. + * + * @param[in] resource A PP_Resource corresponding to a + * URLLoader. + * + * @return PP_TRUE if the resource is a URLLoader, + * PP_FALSE if the resource is invalid or some type other + * than URLLoader. + */ + PP_Bool IsURLLoader( + [in] PP_Resource resource); + + /** + * Open() begins loading the URLRequestInfo. The operation + * completes when response headers are received or when an error occurs. Use + * GetResponseInfo() to access the response headers. + * + * @param[in] loader A PP_Resource corresponding to a + * URLLoader. + * @param[in] resource A PP_Resource corresponding to a + * URLRequestInfo. + * @param[in] callback A PP_CompletionCallback to run on + * asynchronous completion of Open(). This callback will run when response + * headers for the url are received or error occurred. This callback + * will only run if Open() returns PP_OK_COMPLETIONPENDING. + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t Open( + [in] PP_Resource loader, + [in] PP_Resource request_info, + [in] PP_CompletionCallback callback); + + /** + * FollowRedirect() can be invoked to follow a redirect after Open() + * completed on receiving redirect headers. + * + * @param[in] loader A PP_Resource corresponding to a + * URLLoader. + * @param[in] callback A PP_CompletionCallback to run on + * asynchronous completion of FollowRedirect(). This callback will run when + * response headers for the redirect url are received or error occurred. This + * callback will only run if FollowRedirect() returns + * PP_OK_COMPLETIONPENDING. + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t FollowRedirect( + [in] PP_Resource loader, + [in] PP_CompletionCallback callback); + + /** + * GetUploadProgress() returns the current upload progress (which is + * meaningful after Open() has been called). Progress only refers to the + * request body and does not include the headers. + * + * This data is only available if the URLRequestInfo passed + * to Open() had the PP_URLREQUESTPROPERTY_REPORTUPLOADPROGRESS + * property set to PP_TRUE. + * + * @param[in] loader A PP_Resource corresponding to a + * URLLoader. + * @param[in] bytes_sent The number of bytes sent thus far. + * @param[in] total_bytes_to_be_sent The total number of bytes to be sent. + * + * @return PP_TRUE if the upload progress is available, + * PP_FALSE if it is not available. + */ + [always_set_output_parameters] + PP_Bool GetUploadProgress( + [in] PP_Resource loader, + [out] int64_t bytes_sent, + [out] int64_t total_bytes_to_be_sent); + + /** + * GetDownloadProgress() returns the current download progress, which is + * meaningful after Open() has been called. Progress only refers to the + * response body and does not include the headers. + * + * This data is only available if the URLRequestInfo passed to + * Open() had the PP_URLREQUESTPROPERTY_REPORTDOWNLOADPROGRESS + * property set to PP_TRUE. + * + * @param[in] loader A PP_Resource corresponding to a + * URLLoader. + * @param[in] bytes_received The number of bytes received thus far. + * @param[in] total_bytes_to_be_received The total number of bytes to be + * received. The total bytes to be received may be unknown, in which case + * total_bytes_to_be_received will be set to -1. + * + * @return PP_TRUE if the download progress is available, + * PP_FALSE if it is not available. + */ + [always_set_output_parameters] + PP_Bool GetDownloadProgress( + [in] PP_Resource loader, + [out] int64_t bytes_received, + [out] int64_t total_bytes_to_be_received); + + /** + * GetResponseInfo() returns the current URLResponseInfo object. + * + * @param[in] instance A PP_Resource corresponding to a + * URLLoader. + * + * @return A PP_Resource corresponding to the + * URLResponseInfo if successful, 0 if the loader is not a valid + * resource or if Open() has not been called. + */ + PP_Resource GetResponseInfo( + [in] PP_Resource loader); + + /** + * ReadResponseBody() is used to read the response body. The size of the + * buffer must be large enough to hold the specified number of bytes to read. + * This function might perform a partial read. + * + * @param[in] loader A PP_Resource corresponding to a + * URLLoader. + * @param[in,out] buffer A pointer to the buffer for the response body. + * @param[in] bytes_to_read The number of bytes to read. + * @param[in] callback A PP_CompletionCallback to run on + * asynchronous completion. The callback will run if the bytes (full or + * partial) are read or an error occurs asynchronously. This callback will + * run only if this function returns PP_OK_COMPLETIONPENDING. + * + * @return An int32_t containing the number of bytes read or an error code + * from pp_errors.h. + */ + int32_t ReadResponseBody( + [in] PP_Resource loader, + [out] mem_t buffer, + [in] int32_t bytes_to_read, + [in] PP_CompletionCallback callback); + + /** + * FinishStreamingToFile() is used to wait for the response body to be + * completely downloaded to the file provided by the GetBodyAsFileRef() + * in the current URLResponseInfo. This function is only used if + * PP_URLREQUESTPROPERTY_STREAMTOFILE was set on the + * URLRequestInfo passed to Open(). + * + * @param[in] loader A PP_Resource corresponding to a + * URLLoader. + * @param[in] callback A PP_CompletionCallback to run on + * asynchronous completion. This callback will run when body is downloaded + * or an error occurs after FinishStreamingToFile() returns + * PP_OK_COMPLETIONPENDING. + * + * @return An int32_t containing the number of bytes read or an error code + * from pp_errors.h. + */ + int32_t FinishStreamingToFile( + [in] PP_Resource loader, + [in] PP_CompletionCallback callback); + + /** + * Close is a pointer to a function used to cancel any pending IO and close + * the URLLoader object. Any pending callbacks will still run, + * reporting PP_ERROR_ABORTED if pending IO was interrupted. + * It is NOT valid to call Open() again after a call to this function. + * + * Note: If the URLLoader object is destroyed + * while it is still open, then it will be implicitly closed so you are not + * required to call Close(). + * + * @param[in] loader A PP_Resource corresponding to a + * URLLoader. + */ + void Close( + [in] PP_Resource loader); +}; + diff --git a/browser/extensions/mortar/ppapi/api/ppb_url_request_info.idl b/browser/extensions/mortar/ppapi/api/ppb_url_request_info.idl new file mode 100644 index 000000000000..856ae813abb5 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_url_request_info.idl @@ -0,0 +1,260 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_URLRequestInfo API for creating and + * manipulating URL requests. + */ + +[generate_thunk] + +label Chrome { + M14 = 1.0 +}; + +/** + * This enumeration contains properties that can be set on a URL request. + */ +[assert_size(4)] +enum PP_URLRequestProperty { + /** This corresponds to a string (PP_VARTYPE_STRING). */ + PP_URLREQUESTPROPERTY_URL = 0, + + /** + * This corresponds to a string (PP_VARTYPE_STRING); either + * POST or GET. Refer to the + * HTTP + * Methods documentation for further information. + * + */ + PP_URLREQUESTPROPERTY_METHOD = 1, + + /** + * This corresponds to a string (PP_VARTYPE_STRING); \n + * delimited. Refer to the + * documentation for further information. + */ + PP_URLREQUESTPROPERTY_HEADERS = 2, + + /** + * This corresponds to a PP_Bool (PP_VARTYPE_BOOL; + * default=PP_FALSE). + * Set this value to PP_TRUE if you want to download the data + * to a file. Use PPB_URLLoader.FinishStreamingToFile() to complete the + * download. + */ + PP_URLREQUESTPROPERTY_STREAMTOFILE = 3, + + /** + * This corresponds to a PP_Bool (PP_VARTYPE_BOOL; + * default=PP_TRUE). + * Set this value to PP_FALSE if you want to use + * PPB_URLLoader.FollowRedirects() to follow the redirects only after + * examining redirect headers. + */ + PP_URLREQUESTPROPERTY_FOLLOWREDIRECTS = 4, + + /** + * This corresponds to a PP_Bool (PP_VARTYPE_BOOL; + * default=PP_FALSE). + * Set this value to PP_TRUE if you want to be able to poll the + * download progress using PPB_URLLoader.GetDownloadProgress(). + */ + PP_URLREQUESTPROPERTY_RECORDDOWNLOADPROGRESS = 5, + + /** + * This corresponds to a PP_Bool + * (default=PP_FALSE). Set this value to PP_TRUE if + * you want to be able to poll the upload progress using + * PPB_URLLoader.GetUploadProgress(). + */ + PP_URLREQUESTPROPERTY_RECORDUPLOADPROGRESS = 6, + + /** + * This corresponds to a string (PP_VARTYPE_STRING) or may be + * undefined (PP_VARTYPE_UNDEFINED; default). + * Set it to a string to set a custom referrer (if empty, the referrer header + * will be omitted), or to undefined to use the default referrer. Only loaders + * with universal access (only available on trusted implementations) will + * accept URLRequestInfo objects that try to set a custom + * referrer; if given to a loader without universal access, + * PP_ERROR_NOACCESS will result. + */ + PP_URLREQUESTPROPERTY_CUSTOMREFERRERURL = 7, + + /** + * This corresponds to a PP_Bool (PP_VARTYPE_BOOL; + * default=PP_FALSE). Whether cross-origin requests are allowed. + * Cross-origin requests are made using the CORS (Cross-Origin Resource + * Sharing) algorithm to check whether the request should be allowed. For the + * complete CORS algorithm, refer to + * the Cross-Origin Resource + * Sharing documentation. + */ + PP_URLREQUESTPROPERTY_ALLOWCROSSORIGINREQUESTS = 8, + + /** + * This corresponds to a PP_Bool (PP_VARTYPE_BOOL; + * default=PP_FALSE). + * Whether HTTP credentials are sent with cross-origin requests. If false, + * no credentials are sent with the request and cookies are ignored in the + * response. If the request is not cross-origin, this property is ignored. + */ + PP_URLREQUESTPROPERTY_ALLOWCREDENTIALS = 9, + + /** + * This corresponds to a string (PP_VARTYPE_STRING) or may be + * undefined (PP_VARTYPE_UNDEFINED; default). + * Set it to a string to set a custom content-transfer-encoding header (if + * empty, that header will be omitted), or to undefined to use the default + * (if any). Only loaders with universal access (only available on trusted + * implementations) will accept URLRequestInfo objects that try + * to set a custom content transfer encoding; if given to a loader without + * universal access, PP_ERROR_NOACCESS will result. + */ + PP_URLREQUESTPROPERTY_CUSTOMCONTENTTRANSFERENCODING = 10, + + /** + * This corresponds to an integer (PP_VARTYPE_INT32); default + * is not defined and is set by the browser, possibly depending on system + * capabilities. Set it to an integer to set an upper threshold for the + * prefetched buffer of an asynchronous load. When exceeded, the browser will + * defer loading until + * PP_URLREQUESTPROPERTY_PREFETCHBUFFERLOWERERTHRESHOLD is hit, + * at which time it will begin prefetching again. When setting this property, + * PP_URLREQUESTPROPERTY_PREFETCHBUFFERLOWERERTHRESHOLD must also + * be set. Behavior is undefined if the former is <= the latter. + */ + PP_URLREQUESTPROPERTY_PREFETCHBUFFERUPPERTHRESHOLD = 11, + + /** + * This corresponds to an integer (PP_VARTYPE_INT32); default is + * not defined and is set by the browser to a value appropriate for the + * default PP_URLREQUESTPROPERTY_PREFETCHBUFFERUPPERTHRESHOLD. + * Set it to an integer to set a lower threshold for the prefetched buffer + * of an asynchronous load. When reached, the browser will resume loading if + * If PP_URLREQUESTPROPERTY_PREFETCHBUFFERLOWERERTHRESHOLD had + * previously been reached. + * When setting this property, + * PP_URLREQUESTPROPERTY_PREFETCHBUFFERUPPERTHRESHOLD must also + * be set. Behavior is undefined if the former is >= the latter. + */ + PP_URLREQUESTPROPERTY_PREFETCHBUFFERLOWERTHRESHOLD = 12, + + /** + * This corresponds to a string (PP_VARTYPE_STRING) or may be + * undefined (PP_VARTYPE_UNDEFINED; default). Set it to a string + * to set a custom user-agent header (if empty, that header will be omitted), + * or to undefined to use the default. Only loaders with universal access + * (only available on trusted implementations) will accept + * URLRequestInfo objects that try to set a custom user agent; if + * given to a loader without universal access, PP_ERROR_NOACCESS + * will result. + */ + PP_URLREQUESTPROPERTY_CUSTOMUSERAGENT = 13 +}; + +/** + * The PPB_URLRequestInfo interface is used to create + * and handle URL requests. This API is used in conjunction with + * PPB_URLLoader. Refer to PPB_URLLoader for further + * information. + */ +interface PPB_URLRequestInfo { + /** + * Create() creates a new URLRequestInfo object. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * + * @return A PP_Resource identifying the + * URLRequestInfo if successful, 0 if the instance is invalid. + */ + PP_Resource Create( + [in] PP_Instance instance); + + /** + * IsURLRequestInfo() determines if a resource is a + * URLRequestInfo. + * + * @param[in] resource A PP_Resource corresponding to a + * URLRequestInfo. + * + * @return PP_TRUE if the resource is a + * URLRequestInfo, PP_FALSE if the resource is + * invalid or some type other than URLRequestInfo. + */ + PP_Bool IsURLRequestInfo( + [in] PP_Resource resource); + + /** + * SetProperty() sets a request property. The value of the property must be + * the correct type according to the property being set. + * + * @param[in] request A PP_Resource corresponding to a + * URLRequestInfo. + * @param[in] property A PP_URLRequestProperty identifying the + * property to set. + * @param[in] value A PP_Var containing the property value. + * + * @return PP_TRUE if successful, PP_FALSE if any + * of the parameters are invalid. + */ + PP_Bool SetProperty( + [in] PP_Resource request, + [in] PP_URLRequestProperty property, + [in] PP_Var value); + + /** + * AppendDataToBody() appends data to the request body. A Content-Length + * request header will be automatically generated. + * + * @param[in] request A PP_Resource corresponding to a + * URLRequestInfo. + * @param[in] data A pointer to a buffer holding the data. + * @param[in] len The length, in bytes, of the data. + * + * @return PP_TRUE if successful, PP_FALSE if any + * of the parameters are invalid. + * + * + */ + PP_Bool AppendDataToBody( + [in] PP_Resource request, + [in] mem_t data, + [in] uint32_t len); + + /** + * AppendFileToBody() appends a file, to be uploaded, to the request body. + * A content-length request header will be automatically generated. + * + * @param[in] request A PP_Resource corresponding to a + * URLRequestInfo. + * @param[in] file_ref A PP_Resource corresponding to a file + * reference. + * @param[in] start_offset An optional starting point offset within the + * file. + * @param[in] number_of_bytes An optional number of bytes of the file to + * be included. If number_of_bytes is -1, then the sub-range + * to upload extends to the end of the file. + * @param[in] expected_last_modified_time An optional (non-zero) last + * modified time stamp used to validate that the file was not modified since + * the given time before it was uploaded. The upload will fail with an error + * code of PP_ERROR_FILECHANGED if the file has been modified + * since the given time. If expected_last_modified_time is 0, + * then no validation is performed. + * + * @return PP_TRUE if successful, PP_FALSE if any + * of the parameters are invalid. + */ + PP_Bool AppendFileToBody( + [in] PP_Resource request, + [in] PP_Resource file_ref, + [in] int64_t start_offset, + [in] int64_t number_of_bytes, + [in] PP_Time expected_last_modified_time); +}; + diff --git a/browser/extensions/mortar/ppapi/api/ppb_url_response_info.idl b/browser/extensions/mortar/ppapi/api/ppb_url_response_info.idl new file mode 100644 index 000000000000..2998b7ab47b6 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_url_response_info.idl @@ -0,0 +1,132 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_URLResponseInfo API for examining URL + * responses. + */ + +[generate_thunk] + +label Chrome { + M14 = 1.0 +}; + +/** + * This enumeration contains properties set on a URL response. + */ +[assert_size(4)] +enum PP_URLResponseProperty { + /** + * This corresponds to a string (PP_VARTYPE_STRING); an absolute URL formed by + * resolving the relative request URL with the absolute document URL. Refer + * to the + * + * HTTP Request URI and + * + * HTML Resolving Relative URIs documentation for further information. + */ + PP_URLRESPONSEPROPERTY_URL = 0, + + /** + * This corresponds to a string (PP_VARTYPE_STRING); the absolute URL returned + * in the response header's 'Location' field if this is a redirect response, + * an empty string otherwise. Refer to the + * + * HTTP Status Codes - Redirection documentation for further information. + */ + PP_URLRESPONSEPROPERTY_REDIRECTURL = 1, + + /** + * This corresponds to a string (PP_VARTYPE_STRING); the HTTP method to be + * used in a new request if this is a redirect response, an empty string + * otherwise. Refer to the + * + * HTTP Status Codes - Redirection documentation for further information. + */ + PP_URLRESPONSEPROPERTY_REDIRECTMETHOD = 2, + + /** + * This corresponds to an int32 (PP_VARETYPE_INT32); the status code from the + * response, e.g., 200 if the request was successful. Refer to the + * + * HTTP Status Code and Reason Phrase documentation for further + * information. + */ + PP_URLRESPONSEPROPERTY_STATUSCODE = 3, + + /** + * This corresponds to a string (PP_VARTYPE_STRING); the status line + * from the response. Refer to the + * + * HTTP Response Status Line documentation for further information. + */ + PP_URLRESPONSEPROPERTY_STATUSLINE = 4, + + /** + * This corresponds to a string(PP_VARTYPE_STRING), a \n-delimited list of + * header field/value pairs of the form "field: value", returned by the + * server. Refer to the + * + * HTTP Header Field Definitions documentation for further information. + */ + PP_URLRESPONSEPROPERTY_HEADERS = 5 +}; + + +/** + * The PPB_URLResponseInfo interface contains APIs for + * examining URL responses. Refer to PPB_URLLoader for further + * information. + */ +interface PPB_URLResponseInfo { + /** + * IsURLResponseInfo() determines if a response is a + * URLResponseInfo. + * + * @param[in] resource A PP_Resource corresponding to a + * URLResponseInfo. + * + * @return PP_TRUE if the resource is a + * URLResponseInfo, PP_FALSE if the resource is + * invalid or some type other than URLResponseInfo. + */ + PP_Bool IsURLResponseInfo( + [in] PP_Resource resource); + + /** + * GetProperty() gets a response property. + * + * @param[in] request A PP_Resource corresponding to a + * URLResponseInfo. + * @param[in] property A PP_URLResponseProperty identifying + * the type of property in the response. + * + * @return A PP_Var containing the response property value if + * successful, PP_VARTYPE_VOID if an input parameter is invalid. + */ + PP_Var GetProperty( + [in] PP_Resource response, + [in] PP_URLResponseProperty property); + + /** + * GetBodyAsFileRef() returns a FileRef pointing to the file containing the + * response body. This is only valid if + * PP_URLREQUESTPROPERTY_STREAMTOFILE was set on the + * URLRequestInfo used to produce this response. This file + * remains valid until the URLLoader associated with this + * URLResponseInfo is closed or destroyed. + * + * @param[in] request A PP_Resource corresponding to a + * URLResponseInfo. + * + * @return A PP_Resource corresponding to a FileRef + * if successful, 0 if PP_URLREQUESTPROPERTY_STREAMTOFILE was + * not requested or if the URLLoader has not been opened yet. + */ + PP_Resource GetBodyAsFileRef( + [in] PP_Resource response); +}; + diff --git a/browser/extensions/mortar/ppapi/api/ppb_var.idl b/browser/extensions/mortar/ppapi/api/ppb_var.idl new file mode 100644 index 000000000000..cc12b1bb3b75 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_var.idl @@ -0,0 +1,147 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_Var struct. + */ + +label Chrome { + M14 = 1.0, + M18 = 1.1, + M34 = 1.2 +}; + +/** + * PPB_Var API + */ +interface PPB_Var { + /** + * AddRef() adds a reference to the given var. If this is not a refcounted + * object, this function will do nothing so you can always call it no matter + * what the type. + * + * @param[in] var A PP_Var that will have a reference added. + */ + [version=1.0] + void AddRef([in] PP_Var var); + + /** + * Release() removes a reference to given var, deleting it if the internal + * reference count becomes 0. If the PP_Var is of type + * PP_VARTYPE_RESOURCE, + * it will implicitly release a reference count on the + * PP_Resource (equivalent to PPB_Core::ReleaseResource()). + * + * If the given var is not a refcounted object, this function will do nothing + * so you can always call it no matter what the type. + * + * @param[in] var A PP_Var that will have a reference removed. + */ + [version=1.0] + void Release([in] PP_Var var); + + /** + * VarFromUtf8() creates a string var from a string. The string must be + * encoded in valid UTF-8 and is NOT NULL-terminated, the length must be + * specified in len. It is an error if the string is not + * valid UTF-8. + * + * If the length is 0, the *data pointer will not be dereferenced + * and may be NULL. Note, however if length is 0, the + * "NULL-ness" will not be preserved, as VarToUtf8() will never + * return NULL on success, even for empty strings. + * + * The resulting object will be a refcounted string object. It will be + * AddRef'ed for the caller. When the caller is done with it, it should be + * Released. + * + * On error (basically out of memory to allocate the string, or input that + * is not valid UTF-8), this function will return a Null var. + * + * @param[in] module A PP_Module uniquely identifying the module or .nexe. + * @param[in] data A string + * @param[in] len The length of the string. + * + * @return A PP_Var structure containing a reference counted + * string object. + */ + [version=1.0] + PP_Var VarFromUtf8([in] PP_Module module, [in] str_t data, [in] uint32_t len); + + /** + * VarFromUtf8() creates a string var from a string. The string must be + * encoded in valid UTF-8 and is NOT NULL-terminated, the length must be + * specified in len. It is an error if the string is not + * valid UTF-8. + * + * If the length is 0, the *data pointer will not be dereferenced + * and may be NULL. Note, however if length is 0, the + * "NULL-ness" will not be preserved, as VarToUtf8() will never return + * NULL on success, even for empty strings. + * + * The resulting object will be a refcounted string object. It will be + * AddRef'ed for the caller. When the caller is done with it, it should be + * Released. + * + * On error (basically out of memory to allocate the string, or input that + * is not valid UTF-8), this function will return a Null var. + * + * @param[in] data A string + * @param[in] len The length of the string. + * + * @return A PP_Var structure containing a reference counted + * string object. + */ + [version=1.1] + PP_Var VarFromUtf8([in] str_t data, [in] uint32_t len); + + /** + * VarToUtf8() converts a string-type var to a char* encoded in UTF-8. This + * string is NOT NULL-terminated. The length will be placed in + * *len. If the string is valid but empty the return value will + * be non-NULL, but *len will still be 0. + * + * If the var is not a string, this function will return NULL and + * *len will be 0. + * + * The returned buffer will be valid as long as the underlying var is alive. + * If the instance frees its reference, the string will be freed and the + * pointer will be to arbitrary memory. + * + * @param[in] var A PP_Var struct containing a string-type var. + * @param[in,out] len A pointer to the length of the string-type var. + * + * @return A char* encoded in UTF-8. + */ + [version=1.0] + str_t VarToUtf8([in] PP_Var var, [out] uint32_t len); + + /** + * Converts a resource-type var to a PP_Resource. + * + * @param[in] var A PP_Var struct containing a resource-type var. + * + * @return A PP_Resource retrieved from the var, or 0 if the var + * is not a resource. The reference count of the resource is incremented on + * behalf of the caller. + */ + [version=1.2] + PP_Resource VarToResource([in] PP_Var var); + + /** + * Creates a new PP_Var from a given resource. Implicitly adds a + * reference count on the PP_Resource (equivalent to + * PPB_Core::AddRefResource(resource)). + * + * @param[in] resource A PP_Resource to be wrapped in a var. + * + * @return A PP_Var created for this resource, with type + * PP_VARTYPE_RESOURCE. The reference count of the var is set to + * 1 on behalf of the caller. + */ + [version=1.2] + PP_Var VarFromResource([in] PP_Resource resource); +}; + diff --git a/browser/extensions/mortar/ppapi/api/ppb_var_array.idl b/browser/extensions/mortar/ppapi/api/ppb_var_array.idl new file mode 100644 index 000000000000..9925e4471f8e --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_var_array.idl @@ -0,0 +1,77 @@ +/* Copyright 2013 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_VarArray struct providing + * a way to interact with array vars. + */ + +label Chrome { + M29 = 1.0 +}; + +[macro="PPB_VAR_ARRAY_INTERFACE"] +interface PPB_VarArray { + /** + * Creates an array var, i.e., a PP_Var with type set to + * PP_VARTYPE_ARRAY. The array length is set to 0. + * + * @return An empty array var, whose reference count is set to 1 on behalf of + * the caller. + */ + PP_Var Create(); + + /** + * Gets an element from the array. + * + * @param[in] array An array var. + * @param[in] index An index indicating which element to return. + * + * @return The element at the specified position. The reference count of the + * element returned is incremented on behalf of the caller. If + * index is larger than or equal to the array length, an + * undefined var is returned. + */ + PP_Var Get([in] PP_Var array, [in] uint32_t index); + + /** + * Sets the value of an element in the array. + * + * @param[in] array An array var. + * @param[in] index An index indicating which element to modify. If + * index is larger than or equal to the array length, the length + * is updated to be index + 1. Any position in the array that + * hasn't been set before is set to undefined, i.e., PP_Var of + * type PP_VARTYPE_UNDEFINED. + * @param[in] value The value to set. The array holds a reference to it on + * success. + * + * @return A PP_Bool indicating whether the operation succeeds. + */ + PP_Bool Set([in] PP_Var array, [in] uint32_t index, [in] PP_Var value); + + /** + * Gets the array length. + * + * @param[in] array An array var. + * + * @return The array length. + */ + uint32_t GetLength([in] PP_Var array); + + /** + * Sets the array length. + * + * @param[in] array An array var. + * @param[in] length The new array length. If length is smaller + * than its current value, the array is truncated to the new length; any + * elements that no longer fit are removed and the references to them will be + * released. If length is larger than its current value, + * undefined vars are appended to increase the array to the specified length. + * + * @return A PP_Bool indicating whether the operation succeeds. + */ + PP_Bool SetLength([in] PP_Var array, [in] uint32_t length); +}; diff --git a/browser/extensions/mortar/ppapi/api/ppb_var_array_buffer.idl b/browser/extensions/mortar/ppapi/api/ppb_var_array_buffer.idl new file mode 100644 index 000000000000..f48c19fee395 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_var_array_buffer.idl @@ -0,0 +1,101 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_VarArrayBuffer struct providing + * a way to interact with JavaScript ArrayBuffers. + */ + +label Chrome { + M18 = 1.0 +}; + +/** + * The PPB_VarArrayBuffer interface provides a way to interact + * with JavaScript ArrayBuffers, which represent a contiguous sequence of + * bytes. Use PPB_Var to manage the reference count for a + * VarArrayBuffer. Note that these Vars are not part of the + * embedding page's DOM, and can only be shared with JavaScript using the + * PostMessage and HandleMessage functions of + * pp::Instance. + */ +[macro="PPB_VAR_ARRAY_BUFFER_INTERFACE"] +interface PPB_VarArrayBuffer { + /** + * Create() creates a zero-initialized VarArrayBuffer. + * + * @param[in] size_in_bytes The size of the ArrayBuffer to + * be created. + * + * @return A PP_Var representing a VarArrayBuffer + * of the requested size and with a reference count of 1. + */ + PP_Var Create([in] uint32_t size_in_bytes); + + /** + * ByteLength() retrieves the length of the VarArrayBuffer in + * bytes. On success, byte_length is set to the length of the + * given ArrayBuffer var. On failure, byte_length + * is unchanged (this could happen, for instance, if the given + * PP_Var is not of type PP_VARTYPE_ARRAY_BUFFER). + * Note that ByteLength() will successfully retrieve the size of an + * ArrayBuffer even if the ArrayBuffer is not + * currently mapped. + * + * @param[in] array The ArrayBuffer whose length should be + * returned. + * + * @param[out] byte_length A variable which is set to the length of the given + * ArrayBuffer on success. + * + * @return PP_TRUE on success, PP_FALSE on failure. + */ + PP_Bool ByteLength([in] PP_Var array, [out] uint32_t byte_length); + + /** + * Map() maps the ArrayBuffer in to the module's address space + * and returns a pointer to the beginning of the buffer for the given + * ArrayBuffer PP_Var. ArrayBuffers are copied when transmitted, + * so changes to the underlying memory are not automatically available to + * the embedding page. + * + * Note that calling Map() can be a relatively expensive operation. Use care + * when calling it in performance-critical code. For example, you should call + * it only once when looping over an ArrayBuffer. + * + * Example: + * + * @code + * char* data = (char*)(array_buffer_if.Map(array_buffer_var)); + * uint32_t byte_length = 0; + * PP_Bool ok = array_buffer_if.ByteLength(array_buffer_var, &byte_length); + * if (!ok) + * return DoSomethingBecauseMyVarIsNotAnArrayBuffer(); + * for (uint32_t i = 0; i < byte_length; ++i) + * data[i] = 'A'; + * @endcode + * + * @param[in] array The ArrayBuffer whose internal buffer should + * be returned. + * + * @return A pointer to the internal buffer for this + * ArrayBuffer. Returns NULL + * if the given PP_Var is not of type + * PP_VARTYPE_ARRAY_BUFFER. + */ + mem_t Map([in] PP_Var array); + + /** + * Unmap() unmaps the given ArrayBuffer var from the module + * address space. Use this if you want to save memory but might want to call + * Map() to map the buffer again later. The PP_Var remains valid + * and should still be released using PPB_Var when you are done + * with the ArrayBuffer. + * + * @param[in] array The ArrayBuffer to be released. + */ + void Unmap([in] PP_Var array); +}; + diff --git a/browser/extensions/mortar/ppapi/api/ppb_var_dictionary.idl b/browser/extensions/mortar/ppapi/api/ppb_var_dictionary.idl new file mode 100644 index 000000000000..b4b9c060709d --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_var_dictionary.idl @@ -0,0 +1,90 @@ +/* Copyright 2013 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_VarDictionary struct providing + * a way to interact with dictionary vars. + */ + +label Chrome { + M29 = 1.0 +}; + +/** + * A dictionary var contains key-value pairs with unique keys. The keys are + * strings while the values can be arbitrary vars. Key comparison is always + * done by value instead of by reference. + */ +[macro="PPB_VAR_DICTIONARY_INTERFACE"] +interface PPB_VarDictionary { + /** + * Creates a dictionary var, i.e., a PP_Var with type set to + * PP_VARTYPE_DICTIONARY. + * + * @return An empty dictionary var, whose reference count is set to 1 on + * behalf of the caller. + */ + PP_Var Create(); + + /** + * Gets the value associated with the specified key. + * + * @param[in] dict A dictionary var. + * @param[in] key A string var. + * + * @return The value that is associated with key. The reference + * count of the element returned is incremented on behalf of the caller. If + * key is not a string var, or it doesn't exist in + * dict, an undefined var is returned. + */ + PP_Var Get([in] PP_Var dict, [in] PP_Var key); + + /** + * Sets the value associated with the specified key. + * + * @param[in] dict A dictionary var. + * @param[in] key A string var. If this key hasn't existed in + * dict, it is added and associated with value; + * otherwise, the previous value is replaced with value. + * @param[in] value The value to set. The dictionary holds a reference to it + * on success. + * + * @return A PP_Bool indicating whether the operation succeeds. + */ + PP_Bool Set([in] PP_Var dict, [in] PP_Var key, [in] PP_Var value); + + /** + * Deletes the specified key and its associated value, if the key exists. The + * reference to the element will be released. + * + * @param[in] dict A dictionary var. + * @param[in] key A string var. + */ + void Delete([in] PP_Var dict, [in] PP_Var key); + + /** + * Checks whether a key exists. + * + * @param[in] dict A dictionary var. + * @param[in] key A string var. + * + * @return A PP_Bool indicating whether the key exists. + */ + PP_Bool HasKey([in] PP_Var dict, [in] PP_Var key); + + /** + * Gets all the keys in a dictionary. Please note that for each key that you + * set into the dictionary, a string var with the same contents is returned; + * but it may not be the same string var (i.e., value.as_id may + * be different). + * + * @param[in] dict A dictionary var. + * + * @return An array var which contains all the keys of dict. Its + * reference count is incremented on behalf of the caller. The elements are + * string vars. Returns a null var if failed. + */ + PP_Var GetKeys([in] PP_Var dict); +}; diff --git a/browser/extensions/mortar/ppapi/api/ppb_video_decoder.idl b/browser/extensions/mortar/ppapi/api/ppb_video_decoder.idl new file mode 100644 index 000000000000..9997c79029f4 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_video_decoder.idl @@ -0,0 +1,312 @@ +/* Copyright (c) 2014 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_VideoDecoder interface. + */ + +[generate_thunk] + +label Chrome { + /** Though not labeled 'channel=dev', 0.1 is a still a 'Dev' only API. */ + M36 = 0.1, + M39 = 0.2, + M40 = 1.0, + M46 = 1.1 +}; + +/** + * Video decoder interface. + * + * Typical usage: + * - Call Create() to create a new video decoder resource. + * - Call Initialize() to initialize it with a 3d graphics context and the + * desired codec profile. + * - Call Decode() continuously (waiting for each previous call to complete) to + * push bitstream buffers to the decoder. + * - Call GetPicture() continuously (waiting for each previous call to complete) + * to pull decoded pictures from the decoder. + * - Call Flush() to signal end of stream to the decoder and perform shutdown + * when it completes. + * - Call Reset() to quickly stop the decoder (e.g. to implement Seek) and wait + * for the callback before restarting decoding at another point. + * - To destroy the decoder, the plugin should release all of its references to + * it. Any pending callbacks will abort before the decoder is destroyed. + * + * Available video codecs vary by platform. + * All: theora, vorbis, vp8. + * Chrome and ChromeOS: aac, h264. + * ChromeOS: mpeg4. + */ +interface PPB_VideoDecoder { + /** + * Creates a new video decoder resource. + * + * @param[in] instance A PP_Instance identifying the instance + * with the video decoder. + * + * @return A PP_Resource corresponding to a video decoder if + * successful or 0 otherwise. + */ + PP_Resource Create( + [in] PP_Instance instance); + + /** + * Determines if the given resource is a video decoder. + * + * @param[in] resource A PP_Resource identifying a resource. + * + * @return PP_TRUE if the resource is a + * PPB_VideoDecoder, PP_FALSE if the resource is + * invalid or some other type. + */ + PP_Bool IsVideoDecoder( + [in] PP_Resource resource); + + /** + * Initializes a video decoder resource. This should be called after Create() + * and before any other functions. + * + * @param[in] video_decoder A PP_Resource identifying the video + * decoder. + * @param[in] graphics3d_context A PPB_Graphics3D resource to use + * during decoding. + * @param[in] profile A PP_VideoProfile specifying the video + * codec profile. + * @param[in] allow_software_fallback A PP_Bool specifying + * whether the decoder can fall back to software decoding if a suitable + * hardware decoder isn't available. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_NOTSUPPORTED if video decoding is not available, or the + * requested profile is not supported. In this case, the client may call + * Initialize() again with different parameters to find a good configuration. + */ + int32_t Initialize( + [in] PP_Resource video_decoder, + [in] PP_Resource graphics3d_context, + [in] PP_VideoProfile profile, + [in] PP_Bool allow_software_fallback, + [in] PP_CompletionCallback callback); + + /** + * Initializes a video decoder resource. This should be called after Create() + * and before any other functions. + * + * @param[in] video_decoder A PP_Resource identifying the video + * decoder. + * @param[in] graphics3d_context A PPB_Graphics3D resource to use + * during decoding. + * @param[in] profile A PP_VideoProfile specifying the video + * codec profile. + * @param[in] acceleration A PP_HardwareAcceleration specifying + * whether to use a hardware accelerated or a software implementation. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_NOTSUPPORTED if video decoding is not available, or the + * requested profile is not supported. In this case, the client may call + * Initialize() again with different parameters to find a good configuration. + */ + [version = 0.2] + int32_t Initialize( + [in] PP_Resource video_decoder, + [in] PP_Resource graphics3d_context, + [in] PP_VideoProfile profile, + [in] PP_HardwareAcceleration acceleration, + [in] PP_CompletionCallback callback); + + /** + * Initializes a video decoder resource. This should be called after Create() + * and before any other functions. + * + * @param[in] video_decoder A PP_Resource identifying the video + * decoder. + * @param[in] graphics3d_context A PPB_Graphics3D resource to use + * during decoding. + * @param[in] profile A PP_VideoProfile specifying the video + * codec profile. + * @param[in] acceleration A PP_HardwareAcceleration specifying + * whether to use a hardware accelerated or a software implementation. + * @param[in] min_picture_count A count of pictures the plugin would like to + * have in flight. This is effectively the number of times the plugin can + * call GetPicture() and get a decoded frame without calling + * RecyclePicture(). The decoder has its own internal minimum count, and will + * take the larger of its internal and this value. A client that doesn't care + * can therefore just pass in zero for this argument. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_NOTSUPPORTED if video decoding is not available, or the + * requested profile is not supported. In this case, the client may call + * Initialize() again with different parameters to find a good configuration. + * Returns PP_ERROR_BADARGUMENT if the requested minimum picture count is + * unreasonably large. + */ + [version = 1.1] + int32_t Initialize( + [in] PP_Resource video_decoder, + [in] PP_Resource graphics3d_context, + [in] PP_VideoProfile profile, + [in] PP_HardwareAcceleration acceleration, + [in] uint32_t min_picture_count, + [in] PP_CompletionCallback callback); + + /** + * Decodes a bitstream buffer. Copies |size| bytes of data from the plugin's + * |buffer|. The plugin should wait until the decoder signals completion by + * returning PP_OK or by running |callback| before calling Decode() again. + * + * In general, each bitstream buffer should contain a demuxed bitstream frame + * for the selected video codec. For example, H264 decoders expect to receive + * one AnnexB NAL unit, including the 4 byte start code prefix, while VP8 + * decoders expect to receive a bitstream frame without the IVF frame header. + * + * If the call to Decode() eventually results in a picture, the |decode_id| + * parameter is copied into the returned picture. The plugin can use this to + * associate decoded pictures with Decode() calls (e.g. to assign timestamps + * or frame numbers to pictures.) This value is opaque to the API so the + * plugin is free to pass any value. + * + * @param[in] video_decoder A PP_Resource identifying the video + * decoder. + * @param[in] decode_id An optional value, chosen by the plugin, that can be + * used to associate calls to Decode() with decoded pictures returned by + * GetPicture(). + * @param[in] size Buffer size in bytes. + * @param[in] buffer Starting address of buffer. + * @param[in] callback A PP_CompletionCallback to be called on + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_FAILED if the decoder isn't initialized or if a Flush() + * or Reset() call is pending. + * Returns PP_ERROR_INPROGRESS if there is another Decode() call pending. + * Returns PP_ERROR_NOMEMORY if a bitstream buffer can't be created. + * Returns PP_ERROR_ABORTED when Reset() is called while Decode() is pending. + */ + int32_t Decode( + [in] PP_Resource video_decoder, + [in] uint32_t decode_id, + [in] uint32_t size, + [in] mem_t buffer, + [in] PP_CompletionCallback callback); + + /** + * Gets the next picture from the decoder. The picture is valid after the + * decoder signals completion by returning PP_OK or running |callback|. The + * plugin can call GetPicture() again after the decoder signals completion. + * When the plugin is finished using the picture, it should return it to the + * system by calling RecyclePicture(). + * + * @param[in] video_decoder A PP_Resource identifying the video + * decoder. + * @param[out] picture A PP_VideoPicture to hold the decoded + * picture. + * @param[in] callback A PP_CompletionCallback to be called on + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_FAILED if the decoder isn't initialized or if a Reset() + * call is pending. + * Returns PP_ERROR_INPROGRESS if there is another GetPicture() call pending. + * Returns PP_ERROR_ABORTED when Reset() is called, or if a call to Flush() + * completes while GetPicture() is pending. + */ + int32_t GetPicture( + [in] PP_Resource video_decoder, + [out] PP_VideoPicture_0_1 picture, + [in] PP_CompletionCallback callback); + + /** + * Gets the next picture from the decoder. The picture is valid after the + * decoder signals completion by returning PP_OK or running |callback|. The + * plugin can call GetPicture() again after the decoder signals completion. + * When the plugin is finished using the picture, it should return it to the + * system by calling RecyclePicture(). + * + * @param[in] video_decoder A PP_Resource identifying the video + * decoder. + * @param[out] picture A PP_VideoPicture to hold the decoded + * picture. + * @param[in] callback A PP_CompletionCallback to be called on + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_FAILED if the decoder isn't initialized or if a Reset() + * call is pending. + * Returns PP_ERROR_INPROGRESS if there is another GetPicture() call pending. + * Returns PP_ERROR_ABORTED when Reset() is called, or if a call to Flush() + * completes while GetPicture() is pending. + */ + [version = 1.0] + int32_t GetPicture( + [in] PP_Resource video_decoder, + [out] PP_VideoPicture picture, + [in] PP_CompletionCallback callback); + + /** + * Recycles a picture that the plugin has received from the decoder. + * The plugin should call this as soon as it has finished using the texture so + * the decoder can decode more pictures. + * + * @param[in] video_decoder A PP_Resource identifying the video + * decoder. + * @param[in] picture A PP_VideoPicture to return to + * the decoder. + */ + void RecyclePicture( + [in] PP_Resource video_decoder, + [in] PP_VideoPicture picture); + + /** + * Flushes the decoder. The plugin should call Flush() when it reaches the + * end of its video stream in order to stop cleanly. The decoder will run any + * pending Decode() call to completion. The plugin should make no further + * calls to the decoder other than GetPicture() and RecyclePicture() until + * the decoder signals completion by running |callback|. Just before + * completion, any pending GetPicture() call will complete by running its + * callback with result PP_ERROR_ABORTED to signal that no more pictures are + * available. Any pictures held by the plugin remain valid during and after + * the flush and should be recycled back to the decoder. + * + * @param[in] video_decoder A PP_Resource identifying the video + * decoder. + * @param[in] callback A PP_CompletionCallback to be called on + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_FAILED if the decoder isn't initialized. + */ + int32_t Flush( + [in] PP_Resource video_decoder, + [in] PP_CompletionCallback callback); + + /** + * Resets the decoder as quickly as possible. The plugin can call Reset() to + * skip to another position in the video stream. After Reset() returns, any + * pending calls to Decode() and GetPicture()) abort, causing their callbacks + * to run with PP_ERROR_ABORTED. The plugin should not make further calls to + * the decoder other than RecyclePicture() until the decoder signals + * completion by running |callback|. Any pictures held by the plugin remain + * valid during and after the reset and should be recycled back to the + * decoder. + * + * @param[in] video_decoder A PP_Resource identifying the video + * decoder. + * @param[in] callback A PP_CompletionCallback to be called on + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_FAILED if the decoder isn't initialized. + */ + int32_t Reset( + [in] PP_Resource video_decoder, + [in] PP_CompletionCallback callback); +}; diff --git a/browser/extensions/mortar/ppapi/api/ppb_video_encoder.idl b/browser/extensions/mortar/ppapi/api/ppb_video_encoder.idl new file mode 100644 index 000000000000..de96b690bf63 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_video_encoder.idl @@ -0,0 +1,249 @@ +/* Copyright 2015 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_VideoEncoder interface. + */ + +[generate_thunk] + +label Chrome { + [channel=dev] M42 = 0.1, + M44 = 0.2 +}; + +/** + * Video encoder interface. + * + * Typical usage: + * - Call Create() to create a new video encoder resource. + * - Call GetSupportedFormats() to determine which codecs and profiles are + * available. + * - Call Initialize() to initialize the encoder for a supported profile. + * - Call GetVideoFrame() to get a blank frame and fill it in, or get a video + * frame from another resource, e.g. PPB_MediaStreamVideoTrack. + * - Call Encode() to push the video frame to the encoder. If an external frame + * is pushed, wait for completion to recycle the frame. + * - Call GetBitstreamBuffer() continuously (waiting for each previous call to + * complete) to pull encoded pictures from the encoder. + * - Call RecycleBitstreamBuffer() after consuming the data in the bitstream + * buffer. + * - To destroy the encoder, the plugin should release all of its references to + * it. Any pending callbacks will abort before the encoder is destroyed. + * + * Available video codecs vary by platform. + * All: vp8 (software). + * ChromeOS, depending on your device: h264 (hardware), vp8 (hardware) + */ +interface PPB_VideoEncoder { + /** + * Creates a new video encoder resource. + * + * @param[in] instance A PP_Instance identifying the instance + * with the video encoder. + * + * @return A PP_Resource corresponding to a video encoder if + * successful or 0 otherwise. + */ + PP_Resource Create([in] PP_Instance instance); + + /** + * Determines if the given resource is a video encoder. + * + * @param[in] resource A PP_Resource identifying a resource. + * + * @return PP_TRUE if the resource is a + * PPB_VideoEncoder, PP_FALSE if the resource is + * invalid or some other type. + */ + PP_Bool IsVideoEncoder([in] PP_Resource resource); + + /** + * Gets an array of supported video encoder profiles. + * These can be used to choose a profile before calling Initialize(). + * + * @param[in] video_encoder A PP_Resource identifying the video + * encoder. + * @param[in] output A PP_ArrayOutput to receive the supported + * PP_VideoProfileDescription_0_1 structs. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return If >= 0, the number of supported profiles returned, otherwise an + * error code from pp_errors.h. + */ + int32_t GetSupportedProfiles([in] PP_Resource video_encoder, + [in] PP_ArrayOutput output, + [in] PP_CompletionCallback callback); + + /** + * Gets an array of supported video encoder profiles. + * These can be used to choose a profile before calling Initialize(). + * + * @param[in] video_encoder A PP_Resource identifying the video + * encoder. + * @param[in] output A PP_ArrayOutput to receive the supported + * PP_VideoProfileDescription structs. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return If >= 0, the number of supported profiles returned, otherwise an + * error code from pp_errors.h. + */ + [version = 0.2] + int32_t GetSupportedProfiles([in] PP_Resource video_encoder, + [in] PP_ArrayOutput output, + [in] PP_CompletionCallback callback); + + /** + * Initializes a video encoder resource. The plugin should call Initialize() + * successfully before calling any of the functions below. + * + * @param[in] video_encoder A PP_Resource identifying the video + * encoder. + * @param[in] input_format The PP_VideoFrame_Format of the + * frames which will be encoded. + * @param[in] input_visible_size A PP_Size specifying the + * dimensions of the visible part of the input frames. + * @param[in] output_profile A PP_VideoProfile specifying the + * codec profile of the encoded output stream. + * @param[in] acceleration A PP_HardwareAcceleration specifying + * whether to use a hardware accelerated or a software implementation. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_NOTSUPPORTED if video encoding is not available, or the + * requested codec profile is not supported. + */ + int32_t Initialize([in] PP_Resource video_encoder, + [in] PP_VideoFrame_Format input_format, + [in] PP_Size input_visible_size, + [in] PP_VideoProfile output_profile, + [in] uint32_t initial_bitrate, + [in] PP_HardwareAcceleration acceleration, + [in] PP_CompletionCallback callback); + + /** + * Gets the number of input video frames that the encoder may hold while + * encoding. If the plugin is providing the video frames, it should have at + * least this many available. + * + * @param[in] video_encoder A PP_Resource identifying the video + * encoder. + * @return An int32_t containing the number of frames required, or an error + * code from pp_errors.h. + * Returns PP_ERROR_FAILED if Initialize() has not successfully completed. + */ + int32_t GetFramesRequired([in] PP_Resource video_encoder); + + /** + * Gets the coded size of the video frames required by the encoder. Coded + * size is the logical size of the input frames, in pixels. The encoder may + * have hardware alignment requirements that make this different from + * |input_visible_size|, as requested in the call to Initialize(). + * + * @param[in] video_encoder A PP_Resource identifying the video + * encoder. + * @param[in] coded_size A PP_Size to hold the coded size. + * @return An int32_t containing a result code from pp_errors.h. + * Returns PP_ERROR_FAILED if Initialize() has not successfully completed. + */ + int32_t GetFrameCodedSize([in] PP_Resource video_encoder, + [out] PP_Size coded_size); + + /** + * Gets a blank video frame which can be filled with video data and passed + * to the encoder. + * + * @param[in] video_encoder A PP_Resource identifying the video + * encoder. + * @param[out] video_frame A blank PPB_VideoFrame resource. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_FAILED if Initialize() has not successfully completed. + */ + int32_t GetVideoFrame([in] PP_Resource video_encoder, + [out] PP_Resource video_frame, + [in] PP_CompletionCallback callback); + + /** + * Encodes a video frame. + * + * @param[in] video_encoder A PP_Resource identifying the video + * encoder. + * @param[in] video_frame The PPB_VideoFrame to be encoded. + * @param[in] force_keyframe A PP_Bool> specifying whether the encoder + * should emit a key frame for this video frame. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. Plugins that pass PPB_VideoFrame resources owned + * by other resources should wait for completion before reusing them. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_FAILED if Initialize() has not successfully completed. + */ + int32_t Encode([in] PP_Resource video_encoder, + [in] PP_Resource video_frame, + [in] PP_Bool force_keyframe, + [in] PP_CompletionCallback callback); + + /** + * Gets the next encoded bitstream buffer from the encoder. + * + * @param[in] video_encoder A PP_Resource identifying the video + * encoder. + * @param[out] bitstream_buffer A PP_BitstreamBuffer containing + * encoded video data. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. The plugin can call GetBitstreamBuffer from the callback in + * order to continuously "pull" bitstream buffers from the encoder. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_FAILED if Initialize() has not successfully completed. + * Returns PP_ERROR_INPROGRESS if a prior call to GetBitstreamBuffer() has + * not completed. + */ + int32_t GetBitstreamBuffer([in] PP_Resource video_encoder, + [out] PP_BitstreamBuffer bitstream_buffer, + [in] PP_CompletionCallback callback); + + /** + * Recycles a bitstream buffer back to the encoder. + * + * @param[in] video_encoder A PP_Resource identifying the video + * encoder. + * @param[in] bitstream_buffer A PP_BitstreamBuffer that is no + * longer needed by the plugin. + */ + void RecycleBitstreamBuffer([in] PP_Resource video_encoder, + [in] PP_BitstreamBuffer bitstream_buffer); + + /** + * Requests a change to encoding parameters. This is only a request, + * fulfilled on a best-effort basis. + * + * @param[in] video_encoder A PP_Resource identifying the video + * encoder. + * @param[in] bitrate The requested new bitrate, in bits per second. + * @param[in] framerate The requested new framerate, in frames per second. + */ + void RequestEncodingParametersChange([in] PP_Resource video_encoder, + [in] uint32_t bitrate, + [in] uint32_t framerate); + + /** + * Closes the video encoder, and cancels any pending encodes. Any pending + * callbacks will still run, reporting PP_ERROR_ABORTED . It is + * not valid to call any encoder functions after a call to this method. + * Note: Destroying the video encoder closes it implicitly, + * so you are not required to call Close(). + * + * @param[in] video_encoder A PP_Resource identifying the video + * encoder. + */ + void Close([in] PP_Resource video_encoder); +}; diff --git a/browser/extensions/mortar/ppapi/api/ppb_video_frame.idl b/browser/extensions/mortar/ppapi/api/ppb_video_frame.idl new file mode 100644 index 000000000000..57378925aa8c --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_video_frame.idl @@ -0,0 +1,123 @@ +/* Copyright 2014 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * Defines the PPB_VideoFrame interface. + */ + +[generate_thunk] + +label Chrome { + [channel=dev] M34 = 0.1, + M35 = 0.1 +}; + +enum PP_VideoFrame_Format { + /** + * Unknown format value. + */ + PP_VIDEOFRAME_FORMAT_UNKNOWN = 0, + + /** + * 12bpp YVU planar 1x1 Y, 2x2 VU samples. + */ + PP_VIDEOFRAME_FORMAT_YV12 = 1, + + /** + * 12bpp YUV planar 1x1 Y, 2x2 UV samples. + */ + PP_VIDEOFRAME_FORMAT_I420 = 2, + + /** + * 32bpp BGRA. + */ + PP_VIDEOFRAME_FORMAT_BGRA = 3, + + /** + * The last format. + */ + PP_VIDEOFRAME_FORMAT_LAST = PP_VIDEOFRAME_FORMAT_BGRA +}; + +[version=0.1] +interface PPB_VideoFrame { + /** + * Determines if a resource is a VideoFrame resource. + * + * @param[in] resource The PP_Resource to test. + * + * @return A PP_Bool with PP_TRUE if the given + * resource is a VideoFrame resource or PP_FALSE otherwise. + */ + PP_Bool IsVideoFrame([in] PP_Resource resource); + + /** + * Gets the timestamp of the video frame. + * + * @param[in] frame A PP_Resource corresponding to a video frame + * resource. + * + * @return A PP_TimeDelta containing the timestamp of the video + * frame. Given in seconds since the start of the containing video stream. + */ + [on_failure=0.0] + PP_TimeDelta GetTimestamp([in] PP_Resource frame); + + /** + * Sets the timestamp of the video frame. Given in seconds since the + * start of the containing video stream. + * + * @param[in] frame A PP_Resource corresponding to a video frame + * resource. + * @param[in] timestamp A PP_TimeDelta containing the timestamp + * of the video frame. Given in seconds since the start of the containing + * video stream. + */ + void SetTimestamp([in] PP_Resource frame, [in] PP_TimeDelta timestamp); + + /** + * Gets the format of the video frame. + * + * @param[in] frame A PP_Resource corresponding to a video frame + * resource. + * + * @return A PP_VideoFrame_Format containing the format of the + * video frame. + */ + [on_failure=PP_VIDEOFRAME_FORMAT_UNKNOWN] + PP_VideoFrame_Format GetFormat([in] PP_Resource frame); + + /** + * Gets the size of the video frame. + * + * @param[in] frame A PP_Resource corresponding to a video frame + * resource. + * @param[out] size A PP_Size. + * + * @return A PP_Bool with PP_TRUE on success or + * PP_FALSE on failure. + */ + PP_Bool GetSize([in] PP_Resource frame, [out] PP_Size size); + + /** + * Gets the data buffer for video frame pixels. + * + * @param[in] frame A PP_Resource corresponding to a video frame + * resource. + * + * @return A pointer to the beginning of the data buffer. + */ + mem_t GetDataBuffer([in] PP_Resource frame); + + /** + * Gets the size of data buffer. + * + * @param[in] frame A PP_Resource corresponding to a video frame + * resource. + * + * @return The size of the data buffer. + */ + uint32_t GetDataBufferSize([in] PP_Resource frame); +}; diff --git a/browser/extensions/mortar/ppapi/api/ppb_view.idl b/browser/extensions/mortar/ppapi/api/ppb_view.idl new file mode 100644 index 000000000000..6a878637c138 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_view.idl @@ -0,0 +1,215 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_View struct representing the state + * of the view of an instance. + */ + +[generate_thunk] + +label Chrome { + M18 = 1.0, + M28 = 1.1, + M37 = 1.2 +}; + +/** + * PPB_View represents the state of the view of an instance. + * You will receive new view information using + * PPP_Instance.DidChangeView. + */ +[macro="PPB_VIEW_INTERFACE"] +interface PPB_View { + /** + * IsView() determines if the given resource is a valid + * PPB_View resource. Note that PPB_ViewChanged + * resources derive from PPB_View and will return true here + * as well. + * + * @param resource A PP_Resource corresponding to a + * PPB_View resource. + * + * @return PP_TRUE if the given resource supports + * PPB_View or PP_FALSE if it is an invalid + * resource or is a resource of another type. + */ + PP_Bool IsView([in] PP_Resource resource); + + /** + * GetRect() retrieves the rectangle of the module instance associated + * with a view changed notification relative to the upper-left of the browser + * viewport. This position changes when the page is scrolled. + * + * The returned rectangle may not be inside the visible portion of the + * viewport if the module instance is scrolled off the page. Therefore, the + * position may be negative or larger than the size of the page. The size will + * always reflect the size of the module were it to be scrolled entirely into + * view. + * + * In general, most modules will not need to worry about the position of the + * module instance in the viewport, and only need to use the size. + * + * @param resource A PP_Resource corresponding to a + * PPB_View resource. + * + * @param rect A PP_Rect receiving the rectangle on success. + * + * @return Returns PP_TRUE if the resource was valid and the + * viewport rectangle was filled in, PP_FALSE if not. + */ + PP_Bool GetRect([in] PP_Resource resource, + [out] PP_Rect rect); + + /** + * IsFullscreen() returns whether the instance is currently + * displaying in fullscreen mode. + * + * @param resource A PP_Resource corresponding to a + * PPB_View resource. + * + * @return PP_TRUE if the instance is in full screen mode, + * or PP_FALSE if it's not or the resource is invalid. + */ + PP_Bool IsFullscreen([in] PP_Resource resource); + + /** + * IsVisible() determines whether the module instance might be visible to + * the user. For example, the Chrome window could be minimized or another + * window could be over it. In both of these cases, the module instance + * would not be visible to the user, but IsVisible() will return true. + * + * Use the result to speed up or stop updates for invisible module + * instances. + * + * This function performs the duties of GetRect() (determining whether the + * module instance is scrolled into view and the clip rectangle is nonempty) + * and IsPageVisible() (whether the page is visible to the user). + * + * @param resource A PP_Resource corresponding to a + * PPB_View resource. + * + * @return PP_TRUE if the instance might be visible to the + * user, PP_FALSE if it is definitely not visible. + */ + PP_Bool IsVisible([in] PP_Resource resource); + + /** + * IsPageVisible() determines if the page that contains the module instance + * is visible. The most common cause of invisible pages is that + * the page is in a background tab in the browser. + * + * Most applications should use IsVisible() instead of this function since + * the module instance could be scrolled off of a visible page, and this + * function will still return true. However, depending on how your module + * interacts with the page, there may be certain updates that you may want to + * perform when the page is visible even if your specific module instance is + * not visible. + * + * @param resource A PP_Resource corresponding to a + * PPB_View resource. + * + * @return PP_TRUE if the instance is plausibly visible to the + * user, PP_FALSE if it is definitely not visible. + */ + PP_Bool IsPageVisible([in] PP_Resource resource); + + /** + * GetClipRect() returns the clip rectangle relative to the upper-left corner + * of the module instance. This rectangle indicates the portions of the module + * instance that are scrolled into view. + * + * If the module instance is scrolled off the view, the return value will be + * (0, 0, 0, 0). This clip rectangle does not take into account page + * visibility. Therefore, if the module instance is scrolled into view, but + * the page itself is on a tab that is not visible, the return rectangle will + * contain the visible rectangle as though the page were visible. Refer to + * IsPageVisible() and IsVisible() if you want to account for page + * visibility. + * + * Most applications will not need to worry about the clip rectangle. The + * recommended behavior is to do full updates if the module instance is + * visible, as determined by IsVisible(), and do no updates if it is not + * visible. + * + * However, if the cost for computing pixels is very high for your + * application, or the pages you're targeting frequently have very large + * module instances with small visible portions, you may wish to optimize + * further. In this case, the clip rectangle will tell you which parts of + * the module to update. + * + * Note that painting of the page and sending of view changed updates + * happens asynchronously. This means when the user scrolls, for example, + * it is likely that the previous backing store of the module instance will + * be used for the first paint, and will be updated later when your + * application generates new content with the new clip. This may cause + * flickering at the boundaries when scrolling. If you do choose to do + * partial updates, you may want to think about what color the invisible + * portions of your backing store contain (be it transparent or some + * background color) or to paint a certain region outside the clip to reduce + * the visual distraction when this happens. + * + * @param resource A PP_Resource corresponding to a + * PPB_View resource. + * + * @param clip Output argument receiving the clip rect on success. + * + * @return Returns PP_TRUE if the resource was valid and the + * clip rect was filled in, PP_FALSE if not. + */ + PP_Bool GetClipRect([in] PP_Resource resource, + [out] PP_Rect clip); + + /** + * GetDeviceScale returns the scale factor between device pixels and Density + * Independent Pixels (DIPs, also known as logical pixels or UI pixels on + * some platforms). This allows the developer to render their contents at + * device resolution, even as coordinates / sizes are given in DIPs through + * the API. + * + * Note that the coordinate system for Pepper APIs is DIPs. Also note that + * one DIP might not equal one CSS pixel - when page scale/zoom is in effect. + * + * @param[in] resource A PP_Resource corresponding to a + * PPB_View resource. + * + * @return A float value representing the number of device pixels + * per DIP. If the resource is invalid, the value will be 0.0. + */ + [version=1.1] + float_t GetDeviceScale([in] PP_Resource resource); + + /** + * GetCSSScale returns the scale factor between DIPs and CSS pixels. This + * allows proper scaling between DIPs - as sent via the Pepper API - and CSS + * pixel coordinates used for Web content. + * + * @param[in] resource A PP_Resource corresponding to a + * PPB_View resource. + * + * @return css_scale A float value representing the number of + * DIPs per CSS pixel. If the resource is invalid, the value will be 0.0. + */ + [version=1.1] + float_t GetCSSScale([in] PP_Resource resource); + + /** + * GetScrollOffset returns the scroll offset of the window containing the + * plugin. + * + * @param[in] resource A PP_Resource corresponding to a + * PPB_View resource. + * + * @param[out] offset A PP_Point which will be set to the value + * of the scroll offset in CSS pixels. + * + * @return Returns PP_TRUE if the resource was valid and the + * offset was filled in, PP_FALSE if not. + */ + [version=1.2] + PP_Bool GetScrollOffset([in] PP_Resource resource, + [out] PP_Point offset); +}; + diff --git a/browser/extensions/mortar/ppapi/api/ppb_vpn_provider.idl b/browser/extensions/mortar/ppapi/api/ppb_vpn_provider.idl new file mode 100644 index 000000000000..92a8b4af5b94 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_vpn_provider.idl @@ -0,0 +1,159 @@ +/* Copyright 2016 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_VpnProvider interface. + */ + +[generate_thunk] + +label Chrome { + [channel=dev] M52 = 0.1 +}; + +/** + * Use the PPB_VpnProvider interface to implement a VPN client. + * Important: This API is available only on Chrome OS. + * + * This interface enhances the chrome.vpnProvider JavaScript API by + * providing a high performance path for packet handling. + * + * Permissions: Apps permission vpnProvider is required for + * PPB_VpnProvider.Bind(). + * + * Typical usage: + * - Create a PPB_VpnProvider instance. + * - Register the callback for PPB_VpnProvider.ReceivePacket(). + * - In the extension follow the usual workflow for configuring a VPN connection + * via the chrome.vpnProvider API until the step for notifying + * the connection state as "connected". + * - Bind to the previously created connection using + * PPB_VpnProvider.Bind(). + * - Notify the connection state as "connected" from JavaScript using + * chrome.vpnProvider.notifyConnectionStateChanged. + * - When the steps above are completed without errors, a virtual tunnel is + * created to the network stack of Chrome OS. IP packets can be sent through + * the tunnel using PPB_VpnProvider.SendPacket() and any packets + * originating on the Chrome OS device will be received using the callback + * registered for PPB_VpnProvider.ReceivePacket(). + * - When the user disconnects from the VPN configuration or there is an error + * the extension will be notfied via + * chrome.vpnProvider.onPlatformMessage. + */ +interface PPB_VpnProvider { + /** + * Create() creates a VpnProvider instance. + * + * @param[in] instance A PP_Instance identifying the instance + * with the VpnProvider. + * + * @return A PP_Resource corresponding to a VpnProvider if + * successful. + */ + PP_Resource Create([in] PP_Instance instance); + + /** + * IsVpnProvider() determines if the provided resource is a + * VpnProvider instance. + * + * @param[in] resource A PP_Resource corresponding to a + * VpnProvider. + * + * @return Returns PP_TRUE if resource is a + * PPB_VpnProvider, PP_FALSE if the + * resource is invalid or some type other than + * PPB_VpnProvider. + */ + PP_Bool IsVpnProvider([in] PP_Resource resource); + + /** + * Bind() binds to an existing configuration created from JavaScript by + * chrome.vpnProvider.createConfig. All packets will be routed + * via SendPacket and ReceivePacket. The user should + * register the callback for ReceivePacket before calling + * Bind(). + * + * @param[in] vpn_provider A PP_Resource corresponding to a + * VpnProvider. + * + * @param[in] configuration_id A PP_VARTYPE_STRING representing + * the configuration id from the callback of + * chrome.vpnProvider.createConfig. + * + * @param[in] configuration_name A PP_VARTYPE_STRING representing + * the configuration name as defined by the user when calling + * chrome.vpnProvider.createConfig. + * + * @param[in] callback A PP_CompletionCallback called on + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_INPROGRESS if a previous call to + * Bind() has not completed. + * Returns PP_ERROR_BADARGUMENT if either + * configuration_id or configuration_name are not of + * type PP_VARTYPE_STRING. + * Returns PP_ERROR_NOACCESS if the caller does the have the + * required "vpnProvider" permission. + * Returns PP_ERROR_FAILED if connection_id and + * connection_name could not be matched with the existing + * connection, or if the plugin originates from a different extension than the + * one that created the connection. + */ + int32_t Bind([in] PP_Resource vpn_provider, + [in] PP_Var configuration_id, + [in] PP_Var configuration_name, + [in] PP_CompletionCallback callback); + + /** + * SendPacket() sends an IP packet through the tunnel created for the VPN + * session. This will succeed only when the VPN session is owned by the + * module and the connection is bound. + * + * @param[in] vpn_provider A PP_Resource corresponding to a + * VpnProvider. + * + * @param[in] packet A PP_VARTYPE_ARRAY_BUFFER corresponding to + * an IP packet to be sent to the platform. + * + * @param[in] callback A PP_CompletionCallback called on + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_FAILED if the connection is not bound. + * Returns PP_ERROR_INPROGRESS if a previous call to + * SendPacket() has not completed. + * Returns PP_ERROR_BADARGUMENT if packet is not of + * type PP_VARTYPE_ARRAY_BUFFER. + */ + int32_t SendPacket([in] PP_Resource vpn_provider, + [in] PP_Var packet, + [in] PP_CompletionCallback callback); + + /** + * ReceivePacket() receives an IP packet from the tunnel for the VPN session. + * This function only returns a single packet. This function must be called at + * least N times to receive N packets, no matter the size of each packet. The + * callback should be registered before calling Bind(). + * + * @param[in] vpn_provider A PP_Resource corresponding to a + * VpnProvider. + * + * @param[out] packet The received packet is copied to provided + * packet. The packet must remain valid until + * ReceivePacket() completes. Its received PP_VarType will be + * PP_VARTYPE_ARRAY_BUFFER. + * + * @param[in] callback A PP_CompletionCallback called on + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_INPROGRESS if a previous call to + * ReceivePacket() has not completed. + */ + int32_t ReceivePacket([in] PP_Resource vpn_provider, + [out] PP_Var packet, + [in] PP_CompletionCallback callback); +}; diff --git a/browser/extensions/mortar/ppapi/api/ppb_websocket.idl b/browser/extensions/mortar/ppapi/api/ppb_websocket.idl new file mode 100644 index 000000000000..d006d282bcc7 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppb_websocket.idl @@ -0,0 +1,460 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_WebSocket interface providing + * bi-directional, full-duplex, communications over a single TCP socket. + */ + +[generate_thunk] + +label Chrome { + M18 = 1.0 +}; + +/** + * This enumeration contains the types representing the WebSocket ready state + * and these states are based on the JavaScript WebSocket API specification. + * GetReadyState() returns one of these states. + */ +[assert_size(4)] +enum PP_WebSocketReadyState { + /** + * Ready state is queried on an invalid resource. + */ + PP_WEBSOCKETREADYSTATE_INVALID = -1, + + /** + * Ready state that the connection has not yet been established. + */ + PP_WEBSOCKETREADYSTATE_CONNECTING = 0, + + /** + * Ready state that the WebSocket connection is established and communication + * is possible. + */ + PP_WEBSOCKETREADYSTATE_OPEN = 1, + + /** + * Ready state that the connection is going through the closing handshake. + */ + PP_WEBSOCKETREADYSTATE_CLOSING = 2, + + /** + * Ready state that the connection has been closed or could not be opened. + */ + PP_WEBSOCKETREADYSTATE_CLOSED = 3 +}; + +/** + * This enumeration contains status codes. These codes are used in Close() and + * GetCloseCode(). Refer to RFC 6455, The WebSocket Protocol, for further + * information. + * PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE and codes in the range + * PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MIN to + * PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MAX, and + * PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MIN to + * PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MAX are valid for Close(). + */ +[assert_size(4)] +enum PP_WebSocketCloseCode { + /** + * Indicates to request closing connection without status code and reason. + * + * (Note that the code 1005 is forbidden to send in actual close frames by + * the RFC. PP_WebSocket reuses this code internally and the code will never + * appear in the actual close frames.) + */ + PP_WEBSOCKETSTATUSCODE_NOT_SPECIFIED = 1005, + + /** + * Status codes in the range 0-999 are not used. + */ + + /** + * Indicates a normal closure. + */ + PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE = 1000, + + /** + * Indicates that an endpoint is "going away", such as a server going down. + */ + PP_WEBSOCKETSTATUSCODE_GOING_AWAY = 1001, + + /** + * Indicates that an endpoint is terminating the connection due to a protocol + * error. + */ + PP_WEBSOCKETSTATUSCODE_PROTOCOL_ERROR = 1002, + + /** + * Indicates that an endpoint is terminating the connection because it has + * received a type of data it cannot accept. + */ + PP_WEBSOCKETSTATUSCODE_UNSUPPORTED_DATA = 1003, + + /** + * Status code 1004 is reserved. + */ + + /** + * Pseudo code to indicate that receiving close frame doesn't contain any + * status code. + */ + PP_WEBSOCKETSTATUSCODE_NO_STATUS_RECEIVED = 1005, + + /** + * Pseudo code to indicate that connection was closed abnormally, e.g., + * without closing handshake. + */ + PP_WEBSOCKETSTATUSCODE_ABNORMAL_CLOSURE = 1006, + + /** + * Indicates that an endpoint is terminating the connection because it has + * received data within a message that was not consistent with the type of + * the message (e.g., non-UTF-8 data within a text message). + */ + PP_WEBSOCKETSTATUSCODE_INVALID_FRAME_PAYLOAD_DATA = 1007, + + /** + * Indicates that an endpoint is terminating the connection because it has + * received a message that violates its policy. + */ + PP_WEBSOCKETSTATUSCODE_POLICY_VIOLATION = 1008, + + /** + * Indicates that an endpoint is terminating the connection because it has + * received a message that is too big for it to process. + */ + PP_WEBSOCKETSTATUSCODE_MESSAGE_TOO_BIG = 1009, + + /** + * Indicates that an endpoint (client) is terminating the connection because + * it has expected the server to negotiate one or more extension, but the + * server didn't return them in the response message of the WebSocket + * handshake. + */ + PP_WEBSOCKETSTATUSCODE_MANDATORY_EXTENSION = 1010, + + /** + * Indicates that a server is terminating the connection because it + * encountered an unexpected condition. + */ + PP_WEBSOCKETSTATUSCODE_INTERNAL_SERVER_ERROR = 1011, + + /** + * Status codes in the range 1012-1014 are reserved. + */ + + /** + * Pseudo code to indicate that the connection was closed due to a failure to + * perform a TLS handshake. + */ + PP_WEBSOCKETSTATUSCODE_TLS_HANDSHAKE = 1015, + + /** + * Status codes in the range 1016-2999 are reserved. + */ + + /** + * Status codes in the range 3000-3999 are reserved for use by libraries, + * frameworks, and applications. These codes are registered directly with + * IANA. + */ + PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MIN = 3000, + PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MAX = 3999, + + /** + * Status codes in the range 4000-4999 are reserved for private use. + * Application can use these codes for application specific purposes freely. + */ + PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MIN = 4000, + PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MAX = 4999 +}; + +/** + * The PPB_WebSocket interface provides bi-directional, + * full-duplex, communications over a single TCP socket. + */ +interface PPB_WebSocket { + /** + * Create() creates a WebSocket instance. + * + * @param[in] instance A PP_Instance identifying the instance + * with the WebSocket. + * + * @return A PP_Resource corresponding to a WebSocket if + * successful. + */ + PP_Resource Create([in] PP_Instance instance); + + /** + * IsWebSocket() determines if the provided resource is a + * WebSocket instance. + * + * @param[in] resource A PP_Resource corresponding to a + * WebSocket. + * + * @return Returns PP_TRUE if resource is a + * PPB_WebSocket, PP_FALSE if the + * resource is invalid or some type other than + * PPB_WebSocket. + */ + PP_Bool IsWebSocket([in] PP_Resource resource); + + /** + * Connect() connects to the specified WebSocket server. You can call this + * function once for a web_socket. + * + * @param[in] web_socket A PP_Resource corresponding to a + * WebSocket. + * + * @param[in] url A PP_Var representing a WebSocket server URL. + * The PP_VarType must be PP_VARTYPE_STRING. + * + * @param[in] protocols A pointer to an array of PP_Var + * specifying sub-protocols. Each PP_Var represents one + * sub-protocol and its PP_VarType must be + * PP_VARTYPE_STRING. This argument can be null only if + * protocol_count is 0. + * + * @param[in] protocol_count The number of sub-protocols in + * protocols. + * + * @param[in] callback A PP_CompletionCallback called + * when a connection is established or an error occurs in establishing + * connection. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_BADARGUMENT if the specified + * url, or protocols contain an invalid string as + * defined in the WebSocket API specification. + * PP_ERROR_BADARGUMENT corresponds to a SyntaxError in the + * WebSocket API specification. + * Returns PP_ERROR_NOACCESS if the protocol specified in the + * url is not a secure protocol, but the origin of the caller + * has a secure scheme. Also returns PP_ERROR_NOACCESS if the + * port specified in the url is a port that the user agent + * is configured to block access to because it is a well-known port like + * SMTP. PP_ERROR_NOACCESS corresponds to a SecurityError of the + * specification. + * Returns PP_ERROR_INPROGRESS if this is not the first call to + * Connect(). + */ + [report_errors=False] + int32_t Connect([in] PP_Resource web_socket, + [in] PP_Var url, + [in, size_as=protocol_count] PP_Var[] protocols, + [in] uint32_t protocol_count, + [in] PP_CompletionCallback callback); + + /** + * Close() closes the specified WebSocket connection by specifying + * code and reason. + * + * @param[in] web_socket A PP_Resource corresponding to a + * WebSocket. + * + * @param[in] code The WebSocket close code. This is ignored if it is + * PP_WEBSOCKETSTATUSCODE_NOT_SPECIFIED. + * PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE must be used for the + * usual case. To indicate some specific error cases, codes in the range + * PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MIN to + * PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MAX, and in the range + * PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MIN to + * PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MAX are available. + * + * @param[in] reason A PP_Var representing the WebSocket + * close reason. This is ignored if it is PP_VARTYPE_UNDEFINED. + * Otherwise, its PP_VarType must be + * PP_VARTYPE_STRING. + * + * @param[in] callback A PP_CompletionCallback called + * when the connection is closed or an error occurs in closing the + * connection. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_BADARGUMENT if reason contains + * an invalid character as a UTF-8 string, or is longer than 123 bytes. + * PP_ERROR_BADARGUMENT corresponds to a JavaScript SyntaxError + * in the WebSocket API specification. + * Returns PP_ERROR_NOACCESS if the code is not an integer + * equal to 1000 or in the range 3000 to 4999. PP_ERROR_NOACCESS + * corresponds to an InvalidAccessError in the WebSocket API specification. + * Returns PP_ERROR_INPROGRESS if a previous call to Close() is + * not finished. + */ + [report_errors=False] + int32_t Close([in] PP_Resource web_socket, + [in] uint16_t code, + [in] PP_Var reason, + [in] PP_CompletionCallback callback); + + /** + * ReceiveMessage() receives a message from the WebSocket server. + * This interface only returns a single message. That is, this interface must + * be called at least N times to receive N messages, no matter the size of + * each message. + * + * @param[in] web_socket A PP_Resource corresponding to a + * WebSocket. + * + * @param[out] message The received message is copied to provided + * message. The message must remain valid until + * ReceiveMessage() completes. Its received PP_VarType will be + * PP_VARTYPE_STRING or PP_VARTYPE_ARRAY_BUFFER. + * + * @param[in] callback A PP_CompletionCallback called + * when ReceiveMessage() completes. This callback is ignored if + * ReceiveMessage() completes synchronously and returns PP_OK. + * + * @return An int32_t containing an error code from pp_errors.h. + * If an error is detected or connection is closed, ReceiveMessage() returns + * PP_ERROR_FAILED after all buffered messages are received. + * Until buffered message become empty, ReceiveMessage() continues to return + * PP_OK as if connection is still established without errors. + */ + [report_errors=False] + int32_t ReceiveMessage([in] PP_Resource web_socket, + [out] PP_Var message, + [in] PP_CompletionCallback callback); + + /** + * SendMessage() sends a message to the WebSocket server. + * + * @param[in] web_socket A PP_Resource corresponding to a + * WebSocket. + * + * @param[in] message A message to send. The message is copied to an internal + * buffer, so the caller can free message safely after returning + * from the function. Its sent PP_VarType must be + * PP_VARTYPE_STRING or PP_VARTYPE_ARRAY_BUFFER. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_FAILED if the ReadyState is + * PP_WEBSOCKETREADYSTATE_CONNECTING. + * PP_ERROR_FAILED corresponds to a JavaScript + * InvalidStateError in the WebSocket API specification. + * Returns PP_ERROR_BADARGUMENT if the provided + * message contains an invalid character as a UTF-8 string. + * PP_ERROR_BADARGUMENT corresponds to a JavaScript + * SyntaxError in the WebSocket API specification. + * Otherwise, returns PP_OK, which doesn't necessarily mean + * that the server received the message. + */ + [report_errors=False] + int32_t SendMessage([in] PP_Resource web_socket, + [in] PP_Var message); + + /** + * GetBufferedAmount() returns the number of bytes of text and binary + * messages that have been queued for the WebSocket connection to send, but + * have not been transmitted to the network yet. + * + * @param[in] web_socket A PP_Resource corresponding to a + * WebSocket. + * + * @return Returns the number of bytes. + */ + [report_errors=False] + uint64_t GetBufferedAmount([in] PP_Resource web_socket); + + /** + * GetCloseCode() returns the connection close code for the WebSocket + * connection. + * + * @param[in] web_socket A PP_Resource corresponding to a + * WebSocket. + * + * @return Returns 0 if called before the close code is set. + */ + [report_errors=False] + uint16_t GetCloseCode([in] PP_Resource web_socket); + + /** + * GetCloseReason() returns the connection close reason for the WebSocket + * connection. + * + * @param[in] web_socket A PP_Resource corresponding to a + * WebSocket. + * + * @return Returns a PP_VARTYPE_STRING var. If called before the + * close reason is set, the return value contains an empty string. Returns a + * PP_VARTYPE_UNDEFINED if called on an invalid resource. + */ + [report_errors=False] + PP_Var GetCloseReason([in] PP_Resource web_socket); + + /** + * GetCloseWasClean() returns if the connection was closed cleanly for the + * specified WebSocket connection. + * + * @param[in] web_socket A PP_Resource corresponding to a + * WebSocket. + * + * @return Returns PP_FALSE if called before the connection is + * closed, called on an invalid resource, or closed for abnormal reasons. + * Otherwise, returns PP_TRUE if the connection was closed + * cleanly. + */ + [report_errors=False] + PP_Bool GetCloseWasClean([in] PP_Resource web_socket); + + /** + * GetExtensions() returns the extensions selected by the server for the + * specified WebSocket connection. + * + * @param[in] web_socket A PP_Resource corresponding to a + * WebSocket. + * + * @return Returns a PP_VARTYPE_STRING var. If called before the + * connection is established, the var's data is an empty string. Returns a + * PP_VARTYPE_UNDEFINED if called on an invalid resource. + */ + [report_errors=False] + PP_Var GetExtensions([in] PP_Resource web_socket); + + /** + * GetProtocol() returns the sub-protocol chosen by the server for the + * specified WebSocket connection. + * + * @param[in] web_socket A PP_Resource corresponding to a + * WebSocket. + * + * @return Returns a PP_VARTYPE_STRING var. If called before the + * connection is established, the var contains the empty string. Returns a + * PP_VARTYPE_UNDEFINED if called on an invalid resource. + */ + [report_errors=False] + PP_Var GetProtocol([in] PP_Resource web_socket); + + /** + * GetReadyState() returns the ready state of the specified WebSocket + * connection. + * + * @param[in] web_socket A PP_Resource corresponding to a + * WebSocket. + * + * @return Returns PP_WEBSOCKETREADYSTATE_INVALID if called + * before Connect() is called, or if this function is called on an + * invalid resource. + */ + [on_failure=PP_WEBSOCKETREADYSTATE_INVALID, report_errors=False] + PP_WebSocketReadyState GetReadyState([in] PP_Resource web_socket); + + /** + * GetURL() returns the URL associated with specified WebSocket connection. + * + * @param[in] web_socket A PP_Resource corresponding to a + * WebSocket. + * + * @return Returns a PP_VARTYPE_STRING var. If called before the + * connection is established, the var contains the empty string. Returns a + * PP_VARTYPE_UNDEFINED if this function is called on an + * invalid resource. + */ + [report_errors=False] + PP_Var GetURL([in] PP_Resource web_socket); +}; diff --git a/browser/extensions/mortar/ppapi/api/ppp.idl b/browser/extensions/mortar/ppapi/api/ppp.idl new file mode 100644 index 000000000000..6cb99e072051 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppp.idl @@ -0,0 +1,139 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines three functions that your module must + * implement to interact with the browser. + */ + +#inline c + +#include "ppapi/c/pp_module.h" +#include "ppapi/c/pp_stdint.h" +#include "ppapi/c/ppb.h" + +#if __GNUC__ >= 4 +#define PP_EXPORT __attribute__ ((visibility("default"))) +#elif defined(_MSC_VER) +#define PP_EXPORT __declspec(dllexport) +#endif + +/* {PENDING: undefine PP_EXPORT?} */ + +/* We don't want name mangling for these external functions. We only need + * 'extern "C"' if we're compiling with a C++ compiler. + */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @addtogroup Functions + * @{ + */ + +/** + * PPP_InitializeModule() is the entry point for a module and is called by the + * browser when your module loads. Your code must implement this function. + * + * Failure indicates to the browser that this module can not be used. In this + * case, the module will be unloaded and ShutdownModule will NOT be called. + * + * @param[in] module A handle to your module. Generally you should store this + * value since it will be required for other API calls. + * @param[in] get_browser_interface A pointer to the function that you can + * use to query for browser interfaces. Generally you should store this value + * for future use. + * + * @return PP_OK on success. Any other value on failure. + */ +PP_EXPORT int32_t PPP_InitializeModule(PP_Module module, + PPB_GetInterface get_browser_interface); +/** + * @} + */ + +/** + * @addtogroup Functions + * @{ + */ + +/** + * PPP_ShutdownModule() is sometimes called before the module + * is unloaded. It is not recommended that you implement this function. + * + * There is no practical use of this function for third party modules. Its + * existence is because of some internal use cases inside Chrome. + * + * Since your module runs in a separate process, there's no need to free + * allocated memory. There is also no need to free any resources since all of + * resources associated with an instance will be force-freed when that instance + * is deleted. + * + * Note: This function will always be skipped on untrusted + * (Native Client) implementations. This function may be skipped on trusted + * implementations in certain circumstances when Chrome does "fast shutdown" + * of a web page. + */ +PP_EXPORT void PPP_ShutdownModule(void); +/** + * @} + */ + +/** + * @addtogroup Functions + * @{ + */ + +/** + * PPP_GetInterface() is called by the browser to query the module for + * interfaces it supports. + * + * Your module must implement the PPP_Instance interface or it + * will be unloaded. Other interfaces are optional. + * + * This function is called from within browser code whenever an interface is + * needed. This means your plugin could be reentered via this function if you + * make a browser call and it needs an interface. Furthermore, you should not + * make any other browser calls from within your implementation to avoid + * reentering the browser. + * + * As a result, your implementation of this should merely provide a lookup + * from the requested name to an interface pointer, via something like a big + * if/else block or a map, and not do any other work. + * + * @param[in] interface_name A pointer to a "PPP" (plugin) interface name. + * Interface names are null-terminated ASCII strings. + * + * @return A pointer for the interface or NULL if the interface is + * not supported. + */ +PP_EXPORT const void* PPP_GetInterface(const char* interface_name); +/** + * @} + */ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endinl + +/** + * Defines the type of the PPP_InitializeModule function. + */ +typedef int32_t PP_InitializeModule_Func( + [in] PP_Module module, + [in] PPB_GetInterface get_browser_interface); + +/** + * Defines the type of the PPP_ShutdownModule function. + */ +typedef void PP_ShutdownModule_Func(); + +/** + * Defines the type of the PPP_ShutdownModule function. + */ +typedef interface_t PP_GetInterface_Func([in] str_t interface_name); diff --git a/browser/extensions/mortar/ppapi/api/ppp_graphics_3d.idl b/browser/extensions/mortar/ppapi/api/ppp_graphics_3d.idl new file mode 100644 index 000000000000..007cae7aba9e --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppp_graphics_3d.idl @@ -0,0 +1,25 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * Defines the PPP_Graphics3D struct representing a 3D graphics + * context within the browser. + */ + +label Chrome { + M15 = 1.0 +}; + +/** + * PPP_Graphics3D defines the notification interface for a 3D + * graphics context. + */ +[macro="PPP_GRAPHICS_3D_INTERFACE", iname="PPP_Graphics_3D"] +interface PPP_Graphics3D { + /** + * Called when the OpenGL ES window is invalidated and needs to be repainted. + */ + void Graphics3DContextLost(PP_Instance instance); +}; diff --git a/browser/extensions/mortar/ppapi/api/ppp_input_event.idl b/browser/extensions/mortar/ppapi/api/ppp_input_event.idl new file mode 100644 index 000000000000..97285c284205 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppp_input_event.idl @@ -0,0 +1,63 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the API for receiving input events from the browser. + */ + +label Chrome { + M14 = 0.1 +}; + +[version=0.1, macro="PPP_INPUT_EVENT_INTERFACE"] +interface PPP_InputEvent { + /** + * Function for receiving input events from the browser. + * + * In order to receive input events, you must register for them by calling + * PPB_InputEvent.RequestInputEvents() or RequestFilteringInputEvents(). By + * default, no events are delivered. + * + * If the event was handled, it will not be forwarded to the default handlers + * in the web page. If it was not handled, it may be dispatched to a default + * handler. So it is important that an instance respond accurately with + * whether event propagation should continue. + * + * Event propagation also controls focus. If you handle an event like a mouse + * event, typically the instance will be given focus. Returning false from + * a filtered event handler or not registering for an event type means that + * the click will be given to a lower part of the page and your instance will + * not receive focus. This allows an instance to be partially transparent, + * where clicks on the transparent areas will behave like clicks to the + * underlying page. + * + * In general, you should try to keep input event handling short. Especially + * for filtered input events, the browser or page may be blocked waiting for + * you to respond. + * + * The caller of this function will maintain a reference to the input event + * resource during this call. Unless you take a reference to the resource + * to hold it for later, you don't need to release it. + * + * Note: If you're not receiving input events, make sure you + * register for the event classes you want by calling RequestInputEvents or + * RequestFilteringInputEvents. If you're still not receiving keyboard input + * events, make sure you're returning true (or using a non-filtered event + * handler) for mouse events. Otherwise, the instance will not receive focus + * and keyboard events will not be sent. + * + * \see PPB_InputEvent.RequestInputEvents and + * PPB_InputEvent.RequestFilteringInputEvents + * + * @return PP_TRUE if the event was handled, PP_FALSE if not. If you have + * registered to filter this class of events by calling + * RequestFilteringInputEvents, and you return PP_FALSE, the event will + * be forwarded to the page (and eventually the browser) for the default + * handling. For non-filtered events, the return value will be ignored. + */ + PP_Bool HandleInputEvent([in] PP_Instance instance, + [in] PP_Resource input_event); +}; + diff --git a/browser/extensions/mortar/ppapi/api/ppp_instance.idl b/browser/extensions/mortar/ppapi/api/ppp_instance.idl new file mode 100644 index 000000000000..f178b7a42e4f --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppp_instance.idl @@ -0,0 +1,242 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPP_Instance structure - a series of + * pointers to methods that you must implement in your module. + */ + +label Chrome { + M14 = 1.0, + M17 = 1.1 +}; + +/** + * The PPP_Instance interface contains pointers to a series of + * functions that you must implement in your module. These functions can be + * trivial (simply return the default return value) unless you want your module + * to handle events such as change of focus or input events (keyboard/mouse) + * events. + */ +interface PPP_Instance { + /** + * DidCreate() is a creation handler that is called when a new instance is + * created. This function is called for each instantiation on the page, + * corresponding to one \ tag on the page. + * + * Generally you would handle this call by initializing the information + * your module associates with an instance and creating a mapping from the + * given PP_Instance handle to this data. The + * PP_Instance handle will be used in subsequent calls to + * identify which instance the call pertains to. + * + * It's possible for more than one instance to be created in a single module. + * This means that you may get more than one OnCreate without an + * OnDestroy in between, and should be prepared to maintain + * multiple states associated with each instance. + * + * If this function reports a failure (by returning PP_FALSE), + * the instance will be deleted. + * + * @param[in] instance A new PP_Instance identifying one + * instance of a module. This is an opaque handle. + * + * @param[in] argc The number of arguments contained in argn + * and argv. + * + * @param[in] argn An array of argument names. These argument names are + * supplied in the \ tag, for example: + * \ will produce two + * argument names: "id" and "dimensions." + * + * @param[in] argv An array of argument values. These are the values of the + * arguments listed in the \ tag, for example + * \ will produce two + * argument values: "nacl_module" and "2". The indices of these values match + * the indices of the corresponding names in argn. + * + * @return PP_TRUE on success or PP_FALSE on + * failure. + */ + PP_Bool DidCreate( + /* A PP_Instance identifying one instance of a module. */ + [in] PP_Instance instance, + /* The number of arguments contained in argn and argv. */ + [in] uint32_t argc, + /* An array of argument names. These argument names are + * supplied in the tag, for example: + * will produce two argument + * names: "id" and "dimensions." + */ + [in, size_as=argc] str_t[] argn, + /* An array of argument values. These are the values of the + * arguments listed in the tag, for example + * will produce two argument + * values: "nacl_module" and "2." The indices of these values match the + * indices of the corresponding names in argn. + */ + [in, size_as=argc] str_t[] argv); + + /** + * DidDestroy() is an instance destruction handler. This function is called + * in many cases (see below) when a module instance is destroyed. It will be + * called even if DidCreate() returned failure. + * + * Generally you will handle this call by deallocating the tracking + * information and the PP_Instance mapping you created in the + * DidCreate() call. You can also free resources associated with this + * instance but this isn't required; all resources associated with the deleted + * instance will be automatically freed when this function returns. + * + * The instance identifier will still be valid during this call, so the module + * can perform cleanup-related tasks. Once this function returns, the + * PP_Instance handle will be invalid. This means that you can't + * do any asynchronous operations like network requests, file writes or + * messaging from this function since they will be immediately canceled. + * + * Note: This function will always be skipped on untrusted + * (Native Client) implementations. This function may be skipped on trusted + * implementations in certain circumstances when Chrome does "fast shutdown" + * of a web page. Fast shutdown will happen in some cases when all module + * instances are being deleted, and no cleanup functions will be called. + * The module will just be unloaded and the process terminated. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + */ + void DidDestroy( + /* A PP_Instance identifying one instance of a module. */ + [in] PP_Instance instance); + + /** + * Deprecated in 1.1 in favor of the version that takes a Resource. + * + * DidChangeView() is called when the position, the size, of the clip + * rectangle of the element in the browser that corresponds to this + * instance has changed. + * + * A typical implementation will check the size of the position + * argument and reallocate the graphics context when a different size is + * received. Note that this function will be called for scroll events where + * the size doesn't change, so you should always check that the size is + * actually different before doing any reallocations. + * + * @param[in] instance A PP_Instance identifying the instance + * that has changed. + * + * @param[in] position The location on the page of the instance. This is + * relative to the top left corner of the viewport, which changes as the + * page is scrolled. Generally the size of this value will be used to create + * a graphics device, and the position is ignored (most things are relative + * to the instance so the absolute position isn't useful in most cases). + * + * @param[in] clip The visible region of the instance. This is relative to + * the top left of the module's coordinate system (not the page). If the + * module is invisible, clip will be (0, 0, 0, 0). + * + * It's recommended to check for invisible instances and to stop + * generating graphics updates in this case to save system resources. It's + * not usually worthwhile, however, to generate partial updates according to + * the clip when the instance is partially visible. Instead, update the entire + * region. The time saved doing partial paints is usually not significant and + * it can create artifacts when scrolling (this notification is sent + * asynchronously from scrolling so there can be flashes of old content in the + * exposed regions). + */ + void DidChangeView( + /* A PP_Instance identifying the instance whose view changed. */ + [in] PP_Instance instance, + /* The new location on the page of this instance. This is relative to + * the top left corner of the viewport, which changes as the + * page is scrolled. + */ + [in] PP_Rect position, + /* The visible region of the NaCl module. This is relative to the top + * left of the plugin's coordinate system (not the page) If the plugin + * is invisible, clip will be (0, 0, 0, 0). + */ + [in] PP_Rect clip); + + /** + * DidChangeView() is called when the position, size, or other view + * attributes of the instance has changed. + */ + [version=1.1] + void DidChangeView( + /* A PP_Instance identifying the instance whose view changed. */ + [in] PP_Instance instance, + /** + * A handle to a PPB_View resource identifying the new view. + */ + [in] PP_Resource view); + + /** + * DidChangeFocus() is called when an instance has gained or lost focus. + * Having focus means that keyboard events will be sent to the instance. + * An instance's default condition is that it will not have focus. + * + * The focus flag takes into account both browser tab and window focus as + * well as focus of the plugin element on the page. In order to be deemed + * to have focus, the browser window must be topmost, the tab must be + * selected in the window, and the instance must be the focused element on + * the page. + * + * Note:Clicks on instances will give focus only if you + * handle the click event. Return true from + * HandleInputEvent in PPP_InputEvent (or use + * unfiltered events) to signal that the click event was handled. Otherwise, + * the browser will bubble the event and give focus to the element on the page + * that actually did end up consuming it. If you're not getting focus, check + * to make sure you're either requesting them via + * RequestInputEvents() (which implicitly marks all input events + * as consumed) or via RequestFilteringInputEvents() and + * returning true from your event handler. + * + * @param[in] instance A PP_Instance identifying the instance + * receiving the input event. + * + * @param[in] has_focus Indicates the new focused state of the instance. + */ + void DidChangeFocus( + /* A PP_Instance identifying one instance of a module. */ + [in] PP_Instance instance, + /* Indicates whether this NaCl module gained or lost event focus. */ + [in] PP_Bool has_focus); + + /** + * HandleDocumentLoad() is called after initialize for a full-frame + * instance that was instantiated based on the MIME type of a DOMWindow + * navigation. This situation only applies to modules that are pre-registered + * to handle certain MIME types. If you haven't specifically registered to + * handle a MIME type or aren't positive this applies to you, your + * implementation of this function can just return PP_FALSE. + * + * The given url_loader corresponds to a + * PPB_URLLoader instance that is already opened. Its response + * headers may be queried using PPB_URLLoader::GetResponseInfo. + * The reference count for the URL loader is not incremented automatically on + * behalf of the module. You need to increment the reference count yourself + * if you are going to keep a reference to it. + * + * This method returns PP_FALSE if the module cannot handle the + * data. In response to this method, the module should call + * ReadResponseBody() to read the incoming data. + * + * @param[in] instance A PP_Instance identifying the instance + * that should do the load. + * + * @param[in] url_loader An open PPB_URLLoader instance. + * + * @return PP_TRUE if the data was handled, + * PP_FALSE otherwise. If you return false, the load will be + * canceled for you. + */ + PP_Bool HandleDocumentLoad( + /* A PP_Instance identifying one instance of a module. */ + [in] PP_Instance instance, + /* A PP_Resource an open PPB_URLLoader instance. */ + [in] PP_Resource url_loader); + +}; diff --git a/browser/extensions/mortar/ppapi/api/ppp_message_handler.idl b/browser/extensions/mortar/ppapi/api/ppp_message_handler.idl new file mode 100644 index 000000000000..4fe7fa8c3246 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppp_message_handler.idl @@ -0,0 +1,77 @@ +/* Copyright 2014 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPP_MessageHandler interface that plugins + * can implement and register using PPB_Messaging::RegisterMessageHandler in + * order to handle messages sent from JavaScript via postMessage() or + * postMessageAndAwaitResponse(). + */ + +label Chrome { + M39 = 0.2 +}; + +/** + * The PPP_MessageHandler interface is implemented by the plugin + * if the plugin wants to receive messages from a thread other than the main + * Pepper thread, or if the plugin wants to handle blocking messages which + * JavaScript may send via postMessageAndAwaitResponse(). + * + * This interface struct should not be returned by PPP_GetInterface; instead it + * must be passed as a parameter to PPB_Messaging::RegisterMessageHandler. + */ +[no_interface_string] +interface PPP_MessageHandler { + /** + * Invoked as a result of JavaScript invoking postMessage() on the plugin's + * DOM element. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * @param[in] user_data is the same pointer which was provided by a call to + * RegisterMessageHandler(). + * @param[in] message A copy of the parameter that JavaScript provided to + * postMessage(). + */ + void HandleMessage([in] PP_Instance instance, + [inout] mem_t user_data, + [constptr_in] PP_Var message); + /** + * Invoked as a result of JavaScript invoking postMessageAndAwaitResponse() + * on the plugin's DOM element. + * + * NOTE: JavaScript execution is blocked during the duration of this call. + * Hence, the plugin should respond as quickly as possible. For this reason, + * blocking completion callbacks are disallowed while handling a blocking + * message. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * @param[in] user_data is the same pointer which was provided by a call to + * RegisterMessageHandler(). + * @param[in] message is a copy of the parameter that JavaScript provided + * to postMessageAndAwaitResponse(). + * @param[out] response will be copied to a JavaScript object which is + * returned as the result of postMessageAndAwaitResponse() to the invoking + JavaScript. + */ + void HandleBlockingMessage([in] PP_Instance instance, + [inout] mem_t user_data, + [constptr_in] PP_Var message, + [out] PP_Var response); + /** + * Invoked when the handler object is no longer needed. After this, no more + * calls will be made which pass this same value for instance + * and user_data. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * @param[in] user_data is the same pointer which was provided by a call to + * RegisterMessageHandler. + */ + void Destroy([in] PP_Instance instance, [inout] mem_t user_data); +}; + diff --git a/browser/extensions/mortar/ppapi/api/ppp_messaging.idl b/browser/extensions/mortar/ppapi/api/ppp_messaging.idl new file mode 100644 index 000000000000..83c2010382be --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppp_messaging.idl @@ -0,0 +1,64 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPP_Messaging interface containing pointers to + * functions that you must implement to handle postMessage messages + * on the associated DOM element. + * + */ + +label Chrome { + M14 = 1.0 +}; + +/** + * The PPP_Messaging interface contains pointers to functions + * that you must implement to handle postMessage events on the associated + * DOM element. + */ +interface PPP_Messaging { + /** + * HandleMessage() is a function that the browser calls when PostMessage() + * is invoked on the DOM element for the module instance in JavaScript. Note + * that PostMessage() in the JavaScript interface is asynchronous, meaning + * JavaScript execution will not be blocked while HandleMessage() is + * processing the message. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * @param[in] message A PP_Var which has been converted from a + * JavaScript value. JavaScript array/object types are supported from Chrome + * M29 onward. All JavaScript values are copied when passing them to the + * plugin. + * + * When converting JavaScript arrays, any object properties whose name + * is not an array index are ignored. When passing arrays and objects, the + * entire reference graph will be converted and transferred. If the reference + * graph has cycles, the message will not be sent and an error will be logged + * to the console. + * + * The following JavaScript code invokes HandleMessage, passing + * the module instance on which it was invoked, with message + * being a string PP_Var containing "Hello world!" + * + * Example: + * + * @code + * + * + * + * + * + * + * @endcode + * + */ + void HandleMessage([in] PP_Instance instance, [in] PP_Var message); +}; + diff --git a/browser/extensions/mortar/ppapi/api/ppp_mouse_lock.idl b/browser/extensions/mortar/ppapi/api/ppp_mouse_lock.idl new file mode 100644 index 000000000000..f54543bd7789 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/ppp_mouse_lock.idl @@ -0,0 +1,30 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPP_MouseLock interface containing a + * function that you must implement to receive mouse lock events from the + * browser. + */ + +label Chrome { + M16 = 1.0 +}; + +/** + * The PPP_MouseLock interface contains a function that you must + * implement to receive mouse lock events from the browser. + */ +interface PPP_MouseLock { + /** + * MouseLockLost() is called when the instance loses the mouse lock, such as + * when the user presses the ESC key. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + */ + void MouseLockLost([in] PP_Instance instance); +}; + diff --git a/browser/extensions/mortar/ppapi/api/private/finish_writing_these/ppb_flash_file.idl b/browser/extensions/mortar/ppapi/api/private/finish_writing_these/ppb_flash_file.idl new file mode 100644 index 000000000000..cf6fe8fb167d --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/finish_writing_these/ppb_flash_file.idl @@ -0,0 +1,81 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* This file contains PPB_Flash_File interface. */ + +/* A directory entry. */ +struct PP_DirEntry_Dev { + str_t name; + PP_Bool is_dir; +}; + +/* Directory. */ +struct PP_DirContents_Dev { + int32_t count; + [size_is(count)] PP_DirEntry_Dev[] entries; +}; + +/* PPB_Flash_File_ModuleLocal */ +interface PPB_Flash_File_ModuleLocal_0_1 { + /* Opens a module-local file, returning a file descriptor (posix) or a HANDLE + * (win32) into file. Module-local file paths (here and below) are + * '/'-separated UTF-8 strings, relative to a module-specific root. The return + * value is the ppapi error, PP_OK if success, one of the PP_ERROR_* in case + * of failure + */ + int32_t OpenFile( + [in] PP_Instance instance, + [in] str_t path, + [in] int32_t mode, + [out] PP_FileHandle file); + + /* Renames a module-local file. The return value is the ppapi error, PP_OK if + * success, one of the PP_ERROR_* in case of failure. + */ + int32_t RenameFile( + [in] PP_Instance instance, + [in] str_t path_from, + [in] str_t path_to); + + /* Deletes a module-local file or directory. If recursive is set and the path + * points to a directory, deletes all the contents of the directory. The + * return value is the ppapi error, PP_OK if success, one of the PP_ERROR_* in + * case of failure. + */ + int32_t DeleteFileOrDir( + [in] PP_Instance instance, + [in] str_t path, + [in] PP_Bool recursive); + + /* Creates a module-local directory. The return value is the ppapi error, + * PP_OK if success, one of the PP_ERROR_* in case of failure. + */ + int32_t CreateDir( + [in] PP_Instance instance, + [in] str_t path); + + /* Queries information about a module-local file. The return value is the + * ppapi error, PP_OK if success, one of the PP_ERROR_* in case of failure. + */ + int32_t QueryFile( + [in] PP_Instance instance, + [in] str_t path, + [out] PP_FileInfo info); + + /* Gets the list of files contained in a module-local directory. The return + * value is the ppapi error, PP_OK if success, one of the PP_ERROR_* in case + * of failure. If non-NULL, the returned contents should be freed with + * FreeDirContents. + */ + int32_t GetDirContents( + [in] PP_Instance instance, + [in] str_t path, + [out] PP_DirContents_Dev contents); + + /* Frees the data allocated by GetDirContents. */ + void FreeDirContents( + [in] PP_Instance instance, + [in] PP_DirContents_Dev contents); +}; diff --git a/browser/extensions/mortar/ppapi/api/private/finish_writing_these/ppb_pdf.idl b/browser/extensions/mortar/ppapi/api/private/finish_writing_these/ppb_pdf.idl new file mode 100644 index 000000000000..20e077f346a1 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/finish_writing_these/ppb_pdf.idl @@ -0,0 +1,165 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* This file contains PPB_PDF interface. */ + +enum PP_ResourceString{ + PP_RESOURCESTRING_PDFGETPASSWORD = 0, + PP_RESOURCESTRING_PDFLOADING = 1, + PP_RESOURCESTRING_PDFLOAD_FAILED = 2 +}; + +enum PP_ResourceImage{ + PP_RESOURCEIMAGE_PDF_BUTTON_FTH = 0, + PP_RESOURCEIMAGE_PDF_BUTTON_FTH_HOVER = 1, + PP_RESOURCEIMAGE_PDF_BUTTON_FTH_PRESSED = 2, + PP_RESOURCEIMAGE_PDF_BUTTON_FTW = 3, + PP_RESOURCEIMAGE_PDF_BUTTON_FTW_HOVER = 4, + PP_RESOURCEIMAGE_PDF_BUTTON_FTW_PRESSED = 5, + PP_RESOURCEIMAGE_PDF_BUTTON_ZOOMIN = 6, + PP_RESOURCEIMAGE_PDF_BUTTON_ZOOMIN_HOVER = 7, + PP_RESOURCEIMAGE_PDF_BUTTON_ZOOMIN_PRESSED = 8, + PP_RESOURCEIMAGE_PDF_BUTTON_ZOOMOUT = 9, + PP_RESOURCEIMAGE_PDF_BUTTON_ZOOMOUT_HOVER = 10, + PP_RESOURCEIMAGE_PDF_BUTTON_ZOOMOUT_PRESSED = 11, + PP_RESOURCEIMAGE_PDF_BUTTON_THUMBNAIL_0 = 12, + PP_RESOURCEIMAGE_PDF_BUTTON_THUMBNAIL_1 = 13, + PP_RESOURCEIMAGE_PDF_BUTTON_THUMBNAIL_2 = 14, + PP_RESOURCEIMAGE_PDF_BUTTON_THUMBNAIL_3 = 15, + PP_RESOURCEIMAGE_PDF_BUTTON_THUMBNAIL_4 = 16, + PP_RESOURCEIMAGE_PDF_BUTTON_THUMBNAIL_5 = 17, + PP_RESOURCEIMAGE_PDF_BUTTON_THUMBNAIL_6 = 18, + PP_RESOURCEIMAGE_PDF_BUTTON_THUMBNAIL_7 = 19, + PP_RESOURCEIMAGE_PDF_BUTTON_THUMBNAIL_8 = 20, + PP_RESOURCEIMAGE_PDF_BUTTON_THUMBNAIL_9 = 21, + PP_RESOURCEIMAGE_PDF_BUTTON_THUMBNAIL_NUM_BACKGROUND = 22 +}; + +enum PP_PrivateFontCharset { + PP_PRIVATEFONTCHARSET_ANSI = 0, + PP_PRIVATEFONTCHARSET_DEFAULT = 1, + PP_PRIVATEFONTCHARSET_SYMBOL = 2, + PP_PRIVATEFONTCHARSET_MAC = 77, + PP_PRIVATEFONTCHARSET_SHIFTJIS = 128, + PP_PRIVATEFONTCHARSET_HANGUL = 129, + PP_PRIVATEFONTCHARSET_JOHAB = 130, + PP_PRIVATEFONTCHARSET_GB2312 = 134, + PP_PRIVATEFONTCHARSET_CHINESEBIG5 = 136, + PP_PRIVATEFONTCHARSET_GREEK = 161, + PP_PRIVATEFONTCHARSET_TURKISH = 162, + PP_PRIVATEFONTCHARSET_VIETNAMESE = 163, + PP_PRIVATEFONTCHARSET_HEBREW = 177, + PP_PRIVATEFONTCHARSET_ARABIC = 178, + PP_PRIVATEFONTCHARSET_BALTIC = 186, + PP_PRIVATEFONTCHARSET_RUSSIAN = 204, + PP_PRIVATEFONTCHARSET_THAI = 222, + PP_PRIVATEFONTCHARSET_EASTEUROPE = 238, + PP_PRIVATEFONTCHARSET_OEM = 255 +}; + +struct PP_PrivateFontFileDescription { + str_t face; + uint32_t weight; + PP_Bool italic; +}; + +struct PP_PrivateFindResult { + int32_t start_index; + int32_t length; +}; + +interface PPB_PDF_0_1 { + /* Returns a localized string. */ + PP_Var GetLocalizedString( + [in] PP_Instance instance, + [in] PP_ResourceString string_id); + + /* Returns a resource image. */ + PP_Resource GetResourceImage( + [in] PP_Instance instance, + [in] PP_ResourceImage image_id); + + /* Returns a resource identifying a font file corresponding to the given font + * request after applying the browser-specific fallback. + * + * Currently Linux-only. + */ + PP_Resource GetFontFileWithFallback( + [in] PP_Instance instance, + [in] PP_FontDescription_Dev description, + [in] PP_PrivateFontCharset charset); + + /* Given a resource previously returned by GetFontFileWithFallback, returns + * a pointer to the requested font table. Linux only. + */ + PP_Bool GetFontTableForPrivateFontFile( + [in] PP_Resource font_file, + [in] uint32_t table, + [out] mem_t output, + [out] uint32_t output_length); + + /* Search the given string using ICU. Use PPB_Core's MemFree on results when + * done. + */ + void SearchString( + [in] PP_Instance instance, + [in] mem_t string, + [in] mem_t term, + [in] PP_Bool case_sensitive, + [out, size_is(count)] PP_PrivateFindResult[] results, + [out] int32_t count); + + /* Since WebFrame doesn't know about PPAPI requests, it'll think the page has + * finished loading even if there are outstanding requests by the plugin. + * Take this out once WebFrame knows about requests by PPAPI plugins. + */ + void DidStartLoading( + [in] PP_Instance instance); + void DidStopLoading( + [in] PP_Instance instance); + + /* Sets content restriction for a full-page plugin (i.e. can't copy/print). + * The value is a bitfield of ContentRestriction enums. + */ + void SetContentRestriction( + [in] PP_Instance instance, + [in] int32_t restrictions); + + /* Use UMA so we know average pdf page count. */ + void HistogramPDFPageCount( + [in] int32_t count); + + /* Notifies the browser that the given action has been performed. */ + void UserMetricsRecordAction( + [in] PP_Var action); + + /* Notifies the browser that the PDF has an unsupported feature. */ + void HasUnsupportedFeature( + [in] PP_Instance instance); + + /* Tells the browser to open a dialog box to receive a password from the + * user, masking input characters. Returns the value entered by the user, or + * an empty string if the user cancels instead. + */ + PP_Var ModalPromptForPassword( + [in] PP_Instance instance, + [in] PP_Var message); + + /* Returns PP_TRUE if the plugin is out of process. */ + PP_Bool IsOutOfProcess( + [in] PP_Instance instance); + + /* Sets the selected text of the plugin. If |selected_text| is empty, then no + * text is selected. */ + void SetSelectedText( + [in] PP_Instance instance, + [in] str_t selected_text); + + /* Sets the link under the cursor. If |url| is empty, then no link is under + * the cursor. */ + void SetLinkUnderCursor( + [in] PP_Instance instance, + [in] str_t url); +}; diff --git a/browser/extensions/mortar/ppapi/api/private/finish_writing_these/ppb_proxy_private.idl b/browser/extensions/mortar/ppapi/api/private/finish_writing_these/ppb_proxy_private.idl new file mode 100644 index 000000000000..f0173ebc7366 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/finish_writing_these/ppb_proxy_private.idl @@ -0,0 +1,17 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* Exposes functions needed by the out-of-process proxy to call into the + * renderer PPAPI implementation. + */ +interface PPB_Proxy_Private_0_2 { + /* Called when the given plugin process has crashed. */ + void PluginCrashed( + [in] PP_Module module); + + /* Returns the instance for the given resource, or 0 on failure. */ + PP_Instance GetInstanceForResource( + [in] PP_Resource resource); +}; diff --git a/browser/extensions/mortar/ppapi/api/private/pp_content_decryptor.idl b/browser/extensions/mortar/ppapi/api/private/pp_content_decryptor.idl new file mode 100644 index 000000000000..da62b14c2722 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/pp_content_decryptor.idl @@ -0,0 +1,487 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * The PP_DecryptTrackingInfo struct contains necessary information + * that can be used to associate the decrypted block with a decrypt request + * and/or an input block. + */ +[assert_size(16)] +struct PP_DecryptTrackingInfo { + /** + * Client-specified identifier for the associated decrypt request. By using + * this value, the client can associate the decrypted block with a decryption + * request. + */ + uint32_t request_id; + + /** + * A unique buffer ID to identify a PPB_Buffer_Dev. Unlike a PP_Resource, + * this ID is identical at both the renderer side and the plugin side. + * In PPB_ContentDecryptor_Private calls, this is the ID of the + * buffer associated with the decrypted block/frame/samples. + * In PPP_ContentDecryptor_Private calls, this is the ID of a + * buffer that is no longer need at the renderer side, which can be released + * or recycled by the plugin. This ID can be 0 if there is no buffer to be + * released or recycled. + */ + uint32_t buffer_id; + + /** + * Timestamp in microseconds of the associated block. By using this value, + * the client can associate the decrypted (and decoded) data with an input + * block. This is needed because buffers may be delivered out of order and + * not in response to the request_id they were provided with. + */ + int64_t timestamp; +}; + +/** + * The PP_DecryptSubsampleDescription struct contains information + * to support subsample decryption. + * + * An input block can be split into several continuous subsamples. + * A PP_DecryptSubsampleEntry specifies the number of clear and + * cipher bytes in each subsample. For example, the following block has three + * subsamples: + * + * |<----- subsample1 ----->|<----- subsample2 ----->|<----- subsample3 ----->| + * | clear1 | cipher1 | clear2 | cipher2 | clear3 | cipher3 | + * + * For decryption, all of the cipher bytes in a block should be treated as a + * contiguous (in the subsample order) logical stream. The clear bytes should + * not be considered as part of decryption. + * + * Logical stream to decrypt: | cipher1 | cipher2 | cipher3 | + * Decrypted stream: | decrypted1| decrypted2 | decrypted3 | + * + * After decryption, the decrypted bytes should be copied over the position + * of the corresponding cipher bytes in the original block to form the output + * block. Following the above example, the decrypted block should be: + * + * |<----- subsample1 ----->|<----- subsample2 ----->|<----- subsample3 ----->| + * | clear1 | decrypted1| clear2 | decrypted2 | clear3 | decrypted3 | + */ +[assert_size(8)] +struct PP_DecryptSubsampleDescription { + /** + * Size in bytes of clear data in a subsample entry. + */ + uint32_t clear_bytes; + + /** + * Size in bytes of encrypted data in a subsample entry. + */ + uint32_t cipher_bytes; +}; + +/** + * The PP_EncryptedBlockInfo struct contains all the information + * needed to decrypt an encrypted block. + */ +[assert_size(368)] +struct PP_EncryptedBlockInfo { + /** + * Information needed by the client to track the block to be decrypted. + */ + PP_DecryptTrackingInfo tracking_info; + + /** + * Size in bytes of data to be decrypted (data_offset included). + */ + uint32_t data_size; + + /** + * Key ID of the block to be decrypted. + * + * For WebM the key ID can be as large as 2048 bytes in theory. But it's not + * used in current implementations. If we really need to support it, we should + * move key ID out as a separate parameter, e.g. as a PP_Var, or + * make the whole PP_EncryptedBlockInfo as a + * PP_Resource. + */ + uint8_t[64] key_id; + uint32_t key_id_size; + + /** + * Initialization vector of the block to be decrypted. + */ + uint8_t[16] iv; + uint32_t iv_size; + + /** + * Subsample information of the block to be decrypted. + * + * We need to have a fixed size of |subsamples| here. Choose 32 because it is + * sufficient for almost all real life scenarios. Note that in theory the + * number of subsamples could be larger than 32. If that happens, playback + * will fail. + */ + PP_DecryptSubsampleDescription[32] subsamples; + uint32_t num_subsamples; +}; + +/** + * PP_DecryptedFrameFormat contains video frame formats. + */ +[assert_size(4)] +enum PP_DecryptedFrameFormat { + PP_DECRYPTEDFRAMEFORMAT_UNKNOWN = 0, + PP_DECRYPTEDFRAMEFORMAT_YV12 = 1, + PP_DECRYPTEDFRAMEFORMAT_I420 = 2 +}; + +/** + * PP_DecryptedSampleFormat contains audio sample formats. + */ +[assert_size(4)] +enum PP_DecryptedSampleFormat { + PP_DECRYPTEDSAMPLEFORMAT_UNKNOWN = 0, + PP_DECRYPTEDSAMPLEFORMAT_U8 = 1, + PP_DECRYPTEDSAMPLEFORMAT_S16 = 2, + PP_DECRYPTEDSAMPLEFORMAT_S32 = 3, + PP_DECRYPTEDSAMPLEFORMAT_F32 = 4, + PP_DECRYPTEDSAMPLEFORMAT_PLANAR_S16 = 5, + PP_DECRYPTEDSAMPLEFORMAT_PLANAR_F32 = 6 +}; + +/** + * The PP_DecryptResult enum contains decryption and decoding + * result constants. + */ +[assert_size(4)] +enum PP_DecryptResult { + /** The decryption (and/or decoding) operation finished successfully. */ + PP_DECRYPTRESULT_SUCCESS = 0, + /** The decryptor did not have the necessary decryption key. */ + PP_DECRYPTRESULT_DECRYPT_NOKEY = 1, + /** The input was accepted by the decoder but no frame(s) can be produced. */ + PP_DECRYPTRESULT_NEEDMOREDATA = 2, + /** An unexpected error happened during decryption. */ + PP_DECRYPTRESULT_DECRYPT_ERROR = 3, + /** An unexpected error happened during decoding. */ + PP_DECRYPTRESULT_DECODE_ERROR = 4 +}; + +/** + * PP_DecryptedBlockInfo struct contains the decryption result and + * tracking info associated with the decrypted block. + */ +[assert_size(24)] +struct PP_DecryptedBlockInfo { + /** + * Result of the decryption (and/or decoding) operation. + */ + PP_DecryptResult result; + + /** + * Size in bytes of decrypted data, which may be less than the size of the + * corresponding buffer. + */ + uint32_t data_size; + + /** + * Information needed by the client to track the block to be decrypted. + */ + PP_DecryptTrackingInfo tracking_info; +}; + +/** + * PP_DecryptedFramePlanes provides YUV plane index values for + * accessing plane offsets stored in PP_DecryptedFrameInfo. + */ +[assert_size(4)] +enum PP_DecryptedFramePlanes { + PP_DECRYPTEDFRAMEPLANES_Y = 0, + PP_DECRYPTEDFRAMEPLANES_U = 1, + PP_DECRYPTEDFRAMEPLANES_V = 2 +}; + +/** + * PP_DecryptedFrameInfo contains the result of the + * decrypt and decode operation on the associated frame, information required + * to access the frame data in buffer, and tracking info. + */ +[assert_size(56)] +struct PP_DecryptedFrameInfo { + /** + * Result of the decrypt and decode operation. + */ + PP_DecryptResult result; + + /** + * Format of the decrypted frame. + */ + PP_DecryptedFrameFormat format; + + /** + * Offsets into the buffer resource for accessing video planes. + */ + int32_t[3] plane_offsets; + + /** + * Stride of each plane. + */ + int32_t[3] strides; + + /** + * Width of the video frame, in pixels. + */ + int32_t width; + + /** + * Height of the video frame, in pixels. + */ + int32_t height; + + /** + * Information needed by the client to track the decrypted frame. + */ + PP_DecryptTrackingInfo tracking_info; +}; + +/** + * PP_DecryptedSampleInfo contains the result of the + * decrypt and decode operation on the associated samples, information required + * to access the sample data in buffer, and tracking info. + */ +[assert_size(32)] +struct PP_DecryptedSampleInfo { + /** + * Result of the decrypt and decode operation. + */ + PP_DecryptResult result; + + /** + * Format of the decrypted samples. + */ + PP_DecryptedSampleFormat format; + + /** + * Size in bytes of decrypted samples. + */ + uint32_t data_size; + + /** + * 4-byte padding to make the size of PP_DecryptedSampleInfo + * a multiple of 8 bytes. The value of this field should not be used. + */ + uint32_t padding; + + /** + * Information needed by the client to track the decrypted samples. + */ + PP_DecryptTrackingInfo tracking_info; +}; + +/** + * PP_AudioCodec contains audio codec type constants. + */ +[assert_size(4)] +enum PP_AudioCodec { + PP_AUDIOCODEC_UNKNOWN = 0, + PP_AUDIOCODEC_VORBIS = 1, + PP_AUDIOCODEC_AAC = 2 +}; + +/** + * PP_AudioDecoderConfig contains audio decoder configuration + * information required to initialize audio decoders, and a request ID + * that allows clients to associate a decoder initialization request with a + * status response. Note: When codec requires extra data for + * initialization, the data is sent as a PP_Resource carried + * alongside PP_AudioDecoderConfig. + */ + [assert_size(20)] +struct PP_AudioDecoderConfig { + /** + * The audio codec to initialize. + */ + PP_AudioCodec codec; + + /** + * Number of audio channels. + */ + int32_t channel_count; + + /** + * Size of each audio channel. + */ + int32_t bits_per_channel; + + /** + * Audio sampling rate. + */ + int32_t samples_per_second; + + /** + * Client-specified identifier for the associated audio decoder initialization + * request. By using this value, the client can associate a decoder + * initialization status response with an initialization request. + */ + uint32_t request_id; +}; + +/** + * PP_VideoCodec contains video codec type constants. + */ +[assert_size(4)] +enum PP_VideoCodec { + PP_VIDEOCODEC_UNKNOWN = 0, + PP_VIDEOCODEC_VP8 = 1, + PP_VIDEOCODEC_H264 = 2, + PP_VIDEOCODEC_VP9 = 3 +}; + +/** + * PP_VideoCodecProfile contains video codec profile type + * constants required for video decoder configuration. + *. + */ +[assert_size(4)] +enum PP_VideoCodecProfile { + PP_VIDEOCODECPROFILE_UNKNOWN = 0, + PP_VIDEOCODECPROFILE_NOT_NEEDED = 1, + PP_VIDEOCODECPROFILE_H264_BASELINE = 2, + PP_VIDEOCODECPROFILE_H264_MAIN = 3, + PP_VIDEOCODECPROFILE_H264_EXTENDED = 4, + PP_VIDEOCODECPROFILE_H264_HIGH = 5, + PP_VIDEOCODECPROFILE_H264_HIGH_10 = 6, + PP_VIDEOCODECPROFILE_H264_HIGH_422 = 7, + PP_VIDEOCODECPROFILE_H264_HIGH_444_PREDICTIVE = 8 +}; + +/** + * PP_VideoDecoderConfig contains video decoder configuration + * information required to initialize video decoders, and a request ID + * that allows clients to associate a decoder initialization request with a + * status response. Note: When codec requires extra data for + * initialization, the data is sent as a PP_Resource carried + * alongside PP_VideoDecoderConfig. + */ +[assert_size(24)] +struct PP_VideoDecoderConfig { + /** + * The video codec to initialize. + */ + PP_VideoCodec codec; + + /** + * Profile to use when initializing the video codec. + */ + PP_VideoCodecProfile profile; + + /** + * Output video format. + */ + PP_DecryptedFrameFormat format; + + /** + * Width of decoded video frames, in pixels. + */ + int32_t width; + + /** + * Height of decoded video frames, in pixels. + */ + int32_t height; + + /** + * Client-specified identifier for the associated video decoder initialization + * request. By using this value, the client can associate a decoder + * initialization status response with an initialization request. + */ + uint32_t request_id; +}; + +/** + * PP_DecryptorStreamType contains stream type constants. + */ +[assert_size(4)] +enum PP_DecryptorStreamType { + PP_DECRYPTORSTREAMTYPE_AUDIO = 0, + PP_DECRYPTORSTREAMTYPE_VIDEO = 1 +}; + +/** + * PP_SessionType contains session type constants. + */ +[assert_size(4)] +enum PP_SessionType { + PP_SESSIONTYPE_TEMPORARY = 0, + PP_SESSIONTYPE_PERSISTENT_LICENSE = 1, + PP_SESSIONTYPE_PERSISTENT_RELEASE = 2 +}; + +/** + * PP_InitDataType contains Initialization Data Type constants. + */ +[assert_size(4)] +enum PP_InitDataType { + PP_INITDATATYPE_CENC = 0, + PP_INITDATATYPE_KEYIDS = 1, + PP_INITDATATYPE_WEBM = 2 +}; + +/** + * PP_CdmExceptionCode contains exception code constants. + */ +[assert_size(4)] +enum PP_CdmExceptionCode { + PP_CDMEXCEPTIONCODE_NOTSUPPORTEDERROR = 1, + PP_CDMEXCEPTIONCODE_INVALIDSTATEERROR = 2, + PP_CDMEXCEPTIONCODE_INVALIDACCESSERROR = 3, + PP_CDMEXCEPTIONCODE_QUOTAEXCEEDEDERROR = 4, + PP_CDMEXCEPTIONCODE_UNKNOWNERROR = 5, + PP_CDMEXCEPTIONCODE_CLIENTERROR = 6, + PP_CDMEXCEPTIONCODE_OUTPUTERROR = 7 +}; + +/** + * PP_CdmMessageType contains message type constants. + */ +[assert_size(4)] +enum PP_CdmMessageType { + PP_CDMMESSAGETYPE_LICENSE_REQUEST = 0, + PP_CDMMESSAGETYPE_LICENSE_RENEWAL = 1, + PP_CDMMESSAGETYPE_LICENSE_RELEASE = 2 +}; + +/** + * PP_CdmKeyStatus contains key status constants. + */ +[assert_size(4)] +enum PP_CdmKeyStatus { + PP_CDMKEYSTATUS_USABLE = 0, + PP_CDMKEYSTATUS_INVALID = 1, + PP_CDMKEYSTATUS_EXPIRED = 2, + PP_CDMKEYSTATUS_OUTPUTRESTRICTED = 3, + PP_CDMKEYSTATUS_OUTPUTDOWNSCALED = 4, + PP_CDMKEYSTATUS_STATUSPENDING = 5, + PP_CDMKEYSTATUS_RELEASED = 6 +}; + +/** + * The PP_KeyInformation struct contains information about a + * key used for decryption. + */ +[assert_size(524)] +struct PP_KeyInformation { + /** + * Key ID. + */ + uint8_t[512] key_id; + uint32_t key_id_size; + + /** + * Status of this key. + */ + PP_CdmKeyStatus key_status; + + /** + * Optional error code for keys that are not usable. + */ + uint32_t system_code; +}; diff --git a/browser/extensions/mortar/ppapi/api/private/pp_file_handle.idl b/browser/extensions/mortar/ppapi/api/private/pp_file_handle.idl new file mode 100644 index 000000000000..07bb74b7e826 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/pp_file_handle.idl @@ -0,0 +1,22 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file provides support for native OS file handles. + */ + +#inline c + +#ifdef _WIN32 +#include +typedef HANDLE PP_FileHandle; +static const PP_FileHandle PP_kInvalidFileHandle = NULL; + +#else +typedef int PP_FileHandle; +static const PP_FileHandle PP_kInvalidFileHandle = -1; +#endif + +#endinl diff --git a/browser/extensions/mortar/ppapi/api/private/pp_private_font_charset.idl b/browser/extensions/mortar/ppapi/api/private/pp_private_font_charset.idl new file mode 100644 index 000000000000..36e605a021b7 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/pp_private_font_charset.idl @@ -0,0 +1,27 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +[assert_size(4)] +enum PP_PrivateFontCharset { + PP_PRIVATEFONTCHARSET_ANSI = 0, + PP_PRIVATEFONTCHARSET_DEFAULT = 1, + PP_PRIVATEFONTCHARSET_SYMBOL = 2, + PP_PRIVATEFONTCHARSET_MAC = 77, + PP_PRIVATEFONTCHARSET_SHIFTJIS = 128, + PP_PRIVATEFONTCHARSET_HANGUL = 129, + PP_PRIVATEFONTCHARSET_JOHAB = 130, + PP_PRIVATEFONTCHARSET_GB2312 =134, + PP_PRIVATEFONTCHARSET_CHINESEBIG5 = 136, + PP_PRIVATEFONTCHARSET_GREEK = 161, + PP_PRIVATEFONTCHARSET_TURKISH = 162, + PP_PRIVATEFONTCHARSET_VIETNAMESE = 163, + PP_PRIVATEFONTCHARSET_HEBREW = 177, + PP_PRIVATEFONTCHARSET_ARABIC = 178, + PP_PRIVATEFONTCHARSET_BALTIC = 186, + PP_PRIVATEFONTCHARSET_RUSSIAN = 204, + PP_PRIVATEFONTCHARSET_THAI = 222, + PP_PRIVATEFONTCHARSET_EASTEUROPE = 238, + PP_PRIVATEFONTCHARSET_OEM = 255 +}; diff --git a/browser/extensions/mortar/ppapi/api/private/pp_video_capture_format.idl b/browser/extensions/mortar/ppapi/api/private/pp_video_capture_format.idl new file mode 100644 index 000000000000..e9345665ada1 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/pp_video_capture_format.idl @@ -0,0 +1,29 @@ +/* Copyright 2015 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the struct used to hold a video capture format. + */ + +label Chrome { + M42 = 0.1 +}; + +/** + * The PP_VideoCaptureFormat struct represents a video capture + * format. + */ +[assert_size(12)] +struct PP_VideoCaptureFormat { + /** + * Frame size in pixels. + */ + PP_Size frame_size; + + /** + * Frame rate in frames per second. + */ + float_t frame_rate; +}; diff --git a/browser/extensions/mortar/ppapi/api/private/pp_video_frame_private.idl b/browser/extensions/mortar/ppapi/api/private/pp_video_frame_private.idl new file mode 100644 index 000000000000..593f363a59fe --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/pp_video_frame_private.idl @@ -0,0 +1,36 @@ +/* Copyright (c) 2013 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the struct used to hold a video frame. + */ + +/** + * The PP_VideoFrame_Private struct represents a video frame. + * Video sources and destinations use frames to transfer video to and from + * the browser. + */ +[assert_size(16)] +struct PP_VideoFrame_Private { + /** + * A timestamp placing the frame in a video stream. + */ + PP_TimeTicks timestamp; + + /** + * An image data resource to hold the video frame. + */ + PP_Resource image_data; + + /** + * Ensure that this struct is 16-bytes wide by padding the end. In some + * compilers, PP_TimeTicks is 8-byte aligned, so those compilers align this + * struct on 8-byte boundaries as well and pad it to 8 bytes even without this + * padding attribute. This padding makes its size consistent across + * compilers. + */ + int32_t padding; +}; + diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_camera_capabilities_private.idl b/browser/extensions/mortar/ppapi/api/private/ppb_camera_capabilities_private.idl new file mode 100644 index 000000000000..fb480bfd5e81 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_camera_capabilities_private.idl @@ -0,0 +1,55 @@ +/* Copyright 2014 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_CameraCapabilities_Private interface for + * establishing an image capture configuration resource within the browser. + */ + +[generate_thunk] + +label Chrome { + M42 = 0.1 +}; + +/** + * The PPB_CameraCapabilities_Private interface contains pointers + * to several functions for getting the image capture capabilities within the + * browser. + */ +[version=0.1] +interface PPB_CameraCapabilities_Private { + /** + * IsCameraCapabilities() determines if the given resource is a + * PPB_CameraCapabilities_Private. + * + * @param[in] resource A PP_Resource corresponding to an image + * capture capabilities resource. + * + * @return A PP_Bool containing PP_TRUE if the given + * resource is an PP_CameraCapabilities_Private resource, + * otherwise PP_FALSE. + */ + PP_Bool IsCameraCapabilities( + [in] PP_Resource resource); + + /** + * GetSupportedVideoCaptureFormats() returns the supported video capture + * formats for the given PPB_CameraCapabilities_Private. + * + * @param[in] capabilities A PP_Resource corresponding to an + * image capture capabilities resource. + * @param[out] array_size The size of preview size array. + * @param[out] formats An array of PP_VideoCaptureFormat + * corresponding to the supported video capture formats. The ownership of the + * array belongs to PPB_CameraCapabilities_Private and the caller + * should not free it. When a PPB_CameraCapabilities_Private is deleted, the + * array returning from this is no longer valid. + */ + void GetSupportedVideoCaptureFormats( + [in] PP_Resource capabilities, + [out] uint32_t array_size, + [out, size_is(array_size)] PP_VideoCaptureFormat[] formats); +}; diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_camera_device_private.idl b/browser/extensions/mortar/ppapi/api/private/ppb_camera_device_private.idl new file mode 100644 index 000000000000..d87ac2059a8e --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_camera_device_private.idl @@ -0,0 +1,96 @@ +/* Copyright 2014 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * Defines the PPB_CameraDevice_Private interface. Used for + * manipulating a camera device. + */ + +[generate_thunk] + +label Chrome { + M42 = 0.1 +}; + +/** + * To query camera capabilities: + * 1. Get a PPB_CameraDevice_Private object by Create(). + * 2. Open() camera device with track id of MediaStream video track. + * 3. Call GetCameraCapabilities() to get a + * PPB_CameraCapabilities_Private object, which can be used to + * query camera capabilities. + */ +interface PPB_CameraDevice_Private { + /** + * Creates a PPB_CameraDevice_Private resource. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * + * @return A PP_Resource corresponding to a + * PPB_CameraDevice_Private resource if successful, 0 if failed. + */ + PP_Resource Create([in] PP_Instance instance); + + /** + * Determines if a resource is a camera device resource. + * + * @param[in] resource The PP_Resource to test. + * + * @return A PP_Bool with PP_TRUE if the given + * resource is a camera device resource or PP_FALSE + * otherwise. + */ + PP_Bool IsCameraDevice([in] PP_Resource resource); + + /** + * Opens a camera device. + * + * @param[in] camera_device A PP_Resource corresponding to a + * camera device resource. + * @param[in] device_id A PP_Var identifying a camera device. The + * type is string. The ID can be obtained from MediaStreamTrack.getSources() + * or MediaStreamVideoTrack.id. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Open(). + * + * @return An error code from pp_errors.h. + */ + int32_t Open( + [in] PP_Resource camera_device, + [in] PP_Var device_id, + [in] PP_CompletionCallback callback); + + /** + * Disconnects from the camera and cancels all pending requests. + * After this returns, no callbacks will be called. If + * PPB_CameraDevice_Private is destroyed and is not closed yet, this + * function will be automatically called. Calling this more than once has no + * effect. + * + * @param[in] camera_device A PP_Resource corresponding to a + * camera device resource. + */ + void Close([in] PP_Resource camera_device); + + /** + * Gets the camera capabilities. + * + * The camera capabilities do not change for a given camera source. + * + * @param[in] camera_device A PP_Resource corresponding to a + * camera device resource. + * @param[out] capabilities A PPB_CameraCapabilities_Private for + * storing the camera capabilities on success. Otherwise, the value will not + * be changed. + * @param[in] callback PP_CompletionCallback to be called upon + * completion of GetCameraCapabilities(). + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t GetCameraCapabilities([in] PP_Resource camera_device, + [out] PP_Resource capabilities, + [in] PP_CompletionCallback callback); +}; diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_content_decryptor_private.idl b/browser/extensions/mortar/ppapi/api/private/ppb_content_decryptor_private.idl new file mode 100644 index 000000000000..602bf125e4c5 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_content_decryptor_private.idl @@ -0,0 +1,315 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_ContentDecryptor_Private + * interface. Note: This is a special interface, only to be used for Content + * Decryption Modules, not normal plugins. + */ + +[generate_thunk] + +label Chrome { + M44 = 0.14 +}; + +/** + * PPB_ContentDecryptor_Private structure contains the function + * pointers the browser must implement to support plugins implementing the + * PPP_ContentDecryptor_Private interface. This interface provides + * browser side support for the Content Decryption Module (CDM) for Encrypted + * Media Extensions: http://www.w3.org/TR/encrypted-media/ + */ +interface PPB_ContentDecryptor_Private { + /** + * A promise has been resolved by the CDM. + * + * @param[in] promise_id Identifies the promise that the CDM resolved. + */ + void PromiseResolved( + [in] PP_Instance instance, + [in] uint32_t promise_id); + + /** + * A promise that resulted in a new session has been resolved by the CDM. + * + * @param[in] promise_id Identifies the promise that the CDM resolved. + * + * @param[in] session_id A PP_Var of type + * PP_VARTYPE_STRING containing the session's ID attribute. + */ + void PromiseResolvedWithSession( + [in] PP_Instance instance, + [in] uint32_t promise_id, + [in] PP_Var session_id); + + + /** + * A promise has been rejected by the CDM due to an error. + * + * @param[in] promise_id Identifies the promise that the CDM rejected. + * + * @param[in] exception_code A PP_CdmExceptionCode containing + * the exception code. + * + * @param[in] system_code A system error code. + * + * @param[in] error_description A PP_Var of type + * PP_VARTYPE_STRING containing the error description. + */ + void PromiseRejected( + [in] PP_Instance instance, + [in] uint32_t promise_id, + [in] PP_CdmExceptionCode exception_code, + [in] uint32_t system_code, + [in] PP_Var error_description); + + /** + * A message or request has been generated for key_system in the CDM, and + * must be sent to the web application. + * + * For example, when the browser invokes CreateSession() + * on the PPP_ContentDecryptor_Private interface, the plugin + * must send a message containing the license request. + * + * Note that SessionMessage() can be used for purposes other than + * responses to CreateSession() calls. See also the text + * in the comment for SessionReady(), which describes a sequence + * of UpdateSession() and SessionMessage() calls + * required to prepare for decryption. + * + * @param[in] session_id A PP_Var of type + * PP_VARTYPE_STRING containing the ID of a session for + * which this message is intended. + * + * @param[in] message_type A PP_CdmMessageType containing the + * message type. + * + * @param[in] message A PP_Var of type + * PP_VARTYPE_ARRAY_BUFFER that contains the message. + * + * @param[in] legacy_destination_url A PP_Var of type + * PP_VARTYPE_STRING containing the destination URL for the + * message. + */ + void SessionMessage( + [in] PP_Instance instance, + [in] PP_Var session_id, + [in] PP_CdmMessageType message_type, + [in] PP_Var message, + [in] PP_Var legacy_destination_url); + + /** + * The keys for a session have changed. + * + * @param[in] session_id A PP_Var of type + * PP_VARTYPE_STRING containing the ID of the session that has + * a change in keys. + * + * @param[in] has_additional_usable_key A PP_Bool indicating if + * a new usable key has been added. + * + * @param[in] key_count The number of arguments contained in + * key_information + * + * @param[in] key_information An array of type PP_KeyInformation + * that are the session's key IDs and their status. + */ + void SessionKeysChange( + [in] PP_Instance instance, + [in] PP_Var session_id, + [in] PP_Bool has_additional_usable_key, + [in] uint32_t key_count, + [in, size_as=key_count] PP_KeyInformation[] key_information); + + /** + * The expiration time for a session has changed. + * + * @param[in] session_id A PP_Var of type + * PP_VARTYPE_STRING containing the ID of the session that has + * a new expiration time. + * + * @param[in] new_expiry_time A PP_Time indicating the new + * expiry time of the session. The value is defined as the number of seconds + * since the Epoch (00:00:00 UTC, January 1, 1970). + */ + void SessionExpirationChange( + [in] PP_Instance instance, + [in] PP_Var session_id, + [in] PP_Time new_expiry_time); + + /** + * The session has been closed as the result of a call to the + * ReleaseSession() method on the + * PPP_ContentDecryptor_Private interface, or due to other + * factors as determined by the CDM. + * + * @param[in] session_id A PP_Var of type + * PP_VARTYPE_STRING containing the session's ID attribute of + * the session that is now closed. + */ + void SessionClosed( + [in] PP_Instance instance, + [in] PP_Var session_id); + + /** + * An error occurred in a PPP_ContentDecryptor_Private method, + * or within the plugin implementing the interface. + * + * @param[in] session_id A PP_Var of type + * PP_VARTYPE_STRING containing the session's ID attribute of + * the session that caused the error. + * + * @param[in] exception_code A PP_CdmExceptionCode containing + * the exception code. + * + * @param[in] system_code A system error code. + * + * @param[in] error_description A PP_Var of type + * PP_VARTYPE_STRING containing the error description. + */ + void LegacySessionError( + [in] PP_Instance instance, + [in] PP_Var session_id, + [in] PP_CdmExceptionCode exception_code, + [in] uint32_t system_code, + [in] PP_Var error_description); + + /** + * Called after the Decrypt() method on the + * PPP_ContentDecryptor_Private interface completes to + * deliver decrypted_block to the browser for decoding and rendering. + * + * The plugin must not hold a reference to the encrypted buffer resource + * provided to Decrypt() when it calls this method. The browser + * will reuse the buffer in a subsequent Decrypt() call. + * + * @param[in] decrypted_block A PP_Resource corresponding to a + * PPB_Buffer_Dev resource that contains a decrypted data + * block. + * + * @param[in] decrypted_block_info A PP_DecryptedBlockInfo that + * contains the result code and tracking info associated with the + * decrypted_block. + */ + void DeliverBlock( + [in] PP_Instance instance, + [in] PP_Resource decrypted_block, + [in] PP_DecryptedBlockInfo decrypted_block_info); + + /** + * Called after the InitializeAudioDecoder() or + * InitializeVideoDecoder() method on the + * PPP_ContentDecryptor_Private interface completes to report + * decoder initialization status to the browser. + * + * @param[in] success A PP_Bool that is set to + * PP_TRUE when the decoder initialization request associated + * with request_id was successful. + * + * @param[in] decoder_type A PP_DecryptorStreamType identifying + * the decoder type for which this initialization status response was sent. + * + * @param[in] request_id The request_id value passed to + * InitializeAudioDecoder or InitializeVideoDecoder + * in PP_AudioDecoderConfig or + * PP_VideoDecoderConfig. + */ + void DecoderInitializeDone( + [in] PP_Instance instance, + [in] PP_DecryptorStreamType decoder_type, + [in] uint32_t request_id, + [in] PP_Bool success); + + /** + * Called after the DeinitializeDecoder() method on the + * PPP_ContentDecryptor_Private interface completes to report + * decoder de-initialization completion to the browser. + * + * @param[in] decoder_type The PP_DecryptorStreamType passed to + * DeinitializeDecoder(). + * + * @param[in] request_id The request_id value passed to + * DeinitializeDecoder(). + */ + void DecoderDeinitializeDone( + [in] PP_Instance instance, + [in] PP_DecryptorStreamType decoder_type, + [in] uint32_t request_id); + + /** + * Called after the ResetDecoder() method on the + * PPP_ContentDecryptor_Private interface completes to report + * decoder reset completion to the browser. + * + * @param[in] decoder_type The PP_DecryptorStreamType passed to + * ResetDecoder(). + * + * @param[in] request_id The request_id value passed to + * ResetDecoder(). + */ + void DecoderResetDone( + [in] PP_Instance instance, + [in] PP_DecryptorStreamType decoder_type, + [in] uint32_t request_id); + + /** + * Called after the DecryptAndDecode() method on the + * PPP_ContentDecryptor_Private interface completes to deliver + * a decrypted and decoded video frame to the browser for rendering. + * + * The plugin must not hold a reference to the encrypted buffer resource + * provided to DecryptAndDecode() when it calls this method. The + * browser will reuse the buffer in a subsequent + * DecryptAndDecode() call. + * + * @param[in] decrypted_frame A PP_Resource corresponding to a + * PPB_Buffer_Dev resource that contains a video frame. + * + * @param[in] decrypted_frame_info A PP_DecryptedFrameInfo that + * contains the result code, tracking info, and buffer format associated with + * decrypted_frame. + */ + void DeliverFrame( + [in] PP_Instance instance, + [in] PP_Resource decrypted_frame, + [in] PP_DecryptedFrameInfo decrypted_frame_info); + + /** + * Called after the DecryptAndDecode() method on the + * PPP_ContentDecryptor_Private interface completes to deliver + * a buffer of decrypted and decoded audio samples to the browser for + * rendering. + * + * The plugin must not hold a reference to the encrypted buffer resource + * provided to DecryptAndDecode() when it calls this method. The + * browser will reuse the buffer in a subsequent + * DecryptAndDecode() call. + * + * audio_frames can contain multiple audio output buffers. Each + * buffer is serialized in this format: + * + * |<------------------- serialized audio buffer ------------------->| + * | int64_t timestamp | int64_t length | length bytes of audio data | + * + * For example, with three audio output buffers, |audio_frames| will look + * like this: + * + * |<---------------- audio_frames ------------------>| + * | audio buffer 0 | audio buffer 1 | audio buffer 2 | + * + * @param[in] audio_frames A PP_Resource corresponding to a + * PPB_Buffer_Dev resource that contains a decrypted buffer + * of decoded audio samples. + * + * @param[in] decrypted_sample_info A PP_DecryptedSampleInfo that + * contains the tracking info and result code associated with the decrypted + * samples. + */ + void DeliverSamples( + [in] PP_Instance instance, + [in] PP_Resource audio_frames, + [in] PP_DecryptedSampleInfo decrypted_sample_info); +}; diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_display_color_profile_private.idl b/browser/extensions/mortar/ppapi/api/private/ppb_display_color_profile_private.idl new file mode 100644 index 000000000000..41e484165917 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_display_color_profile_private.idl @@ -0,0 +1,97 @@ +/* Copyright 2014 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_DisplayColorProfile struct used for + * getting the color profile of the display. + */ + +[generate_thunk] + +label Chrome { + M33 = 0.1 +}; + +/** + * PPB_DisplayColorProfile_Private defines the methods for getting + * the display color profile and monitoring its changes. + * + * Setup: + * @code + * PP_ArrayOutput output = { MyAllocatorFunction, color_profile_data }; + * PP_Resource display_cp = display_cp_interface->Create(instance); + * display_cp_interface->GetColorProfile(display_cp, + * output, + * completion_callback); + * @endcode + */ +interface PPB_DisplayColorProfile_Private { + /** + * Create() creates a display color profile resource. + * + * @param[in] instance The module instance. + * @return A PP_Resource containing a display color profile + * resource. + */ + PP_Resource Create([in] PP_Instance instance); + + /** + * IsDisplayColorProfile() determines if the given resource is a valid + * DisplayColorProfile resource. + * + * @param[in] resource A DisplayColorProfile context resource. + * @return Returns: + * - PP_TRUE if the given resource is a valid + * DisplayColorProfile + * - PP_FALSE if it is an invalid resource or is a resource + * of another type. + */ + PP_Bool IsDisplayColorProfile([in] PP_Resource resource); + + /** + * GetColorProfile() enqueues a request for the current display color profile. + * + * This method is intended for getting the color profile data of the display + * on which the browser window resides. [However currently Chrome only + * considers the system's primary display color profile when doing its color + * management. For consistency this method will also return the color profile + * that Chrome uses for its browser window.] + * + * @param[in] display_color_profile_res The display color profile resource. + * @param[in] color_profile A PP_OutputArray which on success + * will receive a byte array containing the ICC color profile data (see + * www.color.org for a reference to the ICC color profile specification + * and versions). The returned color profile version is the one supported by + * the host system. + * @param[in] callback The completion callback to be called once the display + * color profile data is available. + * + * @return Returns an error code from pp_errors.h. + */ + int32_t GetColorProfile([in] PP_Resource display_color_profile_res, + [in] PP_ArrayOutput color_profile, + [in] PP_CompletionCallback callback); + + /** + * RegisterColorProfileChangeCallback() registers a callback to be called next + * time the color profile for the browser window in which the plugin resides + * changes. In order to get notifications for all color profile changes a call + * to RegisterColorProfileChangeCallback() function should be done when the + * previous notification was fired. + * + * There might be 2 scenarios in which the color profile for a window changes: + * a) The window is moved from one display to another; + * b) The user changes the display color space from the system settings. + * + * @param[in] display_color_profile_res The display color profile resource. + * @param[in] callback The callback to be invoked next time the display + * color profile changes. + * + * @return Returns an error code from pp_errors.h. + */ + int32_t RegisterColorProfileChangeCallback( + [in] PP_Resource display_color_profile_res, + [in] PP_CompletionCallback callback); +}; diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_ext_crx_file_system_private.idl b/browser/extensions/mortar/ppapi/api/private/ppb_ext_crx_file_system_private.idl new file mode 100644 index 000000000000..5c46de726239 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_ext_crx_file_system_private.idl @@ -0,0 +1,31 @@ +/* Copyright (c) 2013 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file contains the PPB_Ext_CrxFileSystem_Private interface. + */ +label Chrome { + M28 = 0.1 +}; + +/* PPB_Ext_CrxFileSystem_Private interface */ +interface PPB_Ext_CrxFileSystem_Private { + /** + * Open() opens the CRX file system for the current extension. It will fail + * when called from non-extension context. + * + * @param[in] crxfs A PP_Resource corresponding to a + * CrxFileSystem. + * @param[out] file_system An output PP_Resource corresponding + * to a PPB_FileSystem. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Open. + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t Open([in] PP_Instance instance, + [out] PP_Resource file_system, + [in] PP_CompletionCallback callback); +}; diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_file_io_private.idl b/browser/extensions/mortar/ppapi/api/private/ppb_file_io_private.idl new file mode 100644 index 000000000000..38b23393fd9f --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_file_io_private.idl @@ -0,0 +1,26 @@ +/* Copyright (c) 2013 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#inline c +#include "ppapi/c/private/pp_file_handle.h" +#endinl + +/* This file contains the PPB_FileIO_Private interface. */ +label Chrome { + M28 = 0.1 +}; + +/* PPB_FileIO_Private interface */ +interface PPB_FileIO_Private { + /** + * Returns a file handle corresponding to the given FileIO + * object. The FileIO object must have been opened with a + * successful call to FileIO::Open. The caller gets the ownership + * of the returned file handle and must close it. + */ + int32_t RequestOSFileHandle([in] PP_Resource file_io, + [out] PP_FileHandle handle, + [in] PP_CompletionCallback callback); +}; diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_file_ref_private.idl b/browser/extensions/mortar/ppapi/api/private/ppb_file_ref_private.idl new file mode 100644 index 000000000000..e19e8ec71efe --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_file_ref_private.idl @@ -0,0 +1,24 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* This file contains the PPB_FileRefPrivate interface. */ +label Chrome { + M15 = 0.1 +}; + +/* PPB_FileRefPrivate interface */ +interface PPB_FileRefPrivate { + /** + * GetAbsolutePath() returns the absolute path of the file. + * + * @param[in] file_ref A PP_Resource corresponding to a file + * reference. + * + * @return A PP_Var containing the absolute path of the file. + */ + PP_Var GetAbsolutePath([in] PP_Resource file_ref); +}; + + diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_find_private.idl b/browser/extensions/mortar/ppapi/api/private/ppb_find_private.idl new file mode 100644 index 000000000000..e6f7cfa72835 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_find_private.idl @@ -0,0 +1,66 @@ +/* Copyright 2014 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_Find_Private interface. + */ + +[generate_thunk] + +label Chrome { + M14 = 0.3 +}; + +/** + * This is a private interface for doing browser Find in the PDF plugin. + */ +interface PPB_Find_Private { + /** + * Sets the instance of this plugin as the mechanism that will be used to + * handle find requests in the renderer. This will only succeed if the plugin + * is embedded within the content of the top level frame. Note that this will + * result in the renderer handing over all responsibility for doing find to + * the plugin and content from the rest of the page will not be searched. + * + * + * In the case that the plugin is loaded directly as the top level document, + * this function does not need to be called. In that case the plugin is + * assumed to handle find requests. + * + * There can only be one plugin which handles find requests. If a plugin calls + * this while an existing plugin is registered, the existing plugin will be + * de-registered and will no longer receive any requests. + */ + void SetPluginToHandleFindRequests( + [in] PP_Instance instance); + + /** + * Updates the number of find results for the current search term. If + * there are no matches 0 should be passed in. Only when the plugin has + * finished searching should it pass in the final count with final_result set + * to PP_TRUE. + */ + void NumberOfFindResultsChanged( + [in] PP_Instance instance, + [in] int32_t total, + [in] PP_Bool final_result); + + /** + * Updates the index of the currently selected search item. + */ + void SelectedFindResultChanged( + [in] PP_Instance instance, + [in] int32_t index); + + /** + * Updates the tickmarks on the scrollbar for the find request. |tickmarks| + * contains |count| PP_Rects indicating the tickmark ranges. + */ + void SetTickmarks( + [in] PP_Instance instance, + [in, size_as=count] PP_Rect[] tickmarks, + [in] uint32_t count); +}; + diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_flash.idl b/browser/extensions/mortar/ppapi/api/private/ppb_flash.idl new file mode 100644 index 000000000000..f16cbc9c2d12 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_flash.idl @@ -0,0 +1,274 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file contains the PPB_Flash interface. + */ + +label Chrome { + M21 = 12.4, + M22 = 12.5, + M24_0 = 12.6, + M24_1 = 13.0 +}; + +[assert_size(4)] +enum PP_FlashLSORestrictions { + /** + * No restrictions on Flash LSOs. + */ + PP_FLASHLSORESTRICTIONS_NONE = 1, + + /** + * Don't allow access to Flash LSOs. + */ + PP_FLASHLSORESTRICTIONS_BLOCK = 2, + + /** + * Store Flash LSOs in memory only. + */ + PP_FLASHLSORESTRICTIONS_IN_MEMORY = 3 +}; + +[assert_size(4)] +enum PP_FlashSetting { + /** + * Specifies if the system likely supports 3D hardware acceleration. + * + * The result is a boolean PP_Var, depending on the supported nature of 3D + * acceleration. If querying this function returns true, the 3D system will + * normally use the native hardware for rendering which will be much faster. + * + * Having this set to true only means that 3D should be used to draw 2D and + * video elements. PP_FLASHSETTING_STAGE3D_ENABLED should be checked to + * determine if it's ok to use 3D for arbitrary content. + * + * In rare cases (depending on the platform) this value will be true but a + * created 3D context will use emulation because context initialization + * failed. + */ + PP_FLASHSETTING_3DENABLED = 1, + + /** + * Specifies if the given instance is in private/incognito/off-the-record mode + * (returns true) or "regular" mode (returns false). Returns an undefined + * PP_Var on invalid instance. + */ + PP_FLASHSETTING_INCOGNITO = 2, + + /** + * Specifies if arbitrary 3d commands are supported (returns true), or if 3d + * should only be used for drawing 2d and video (returns false). + * + * This should only be enabled if PP_FLASHSETTING_3DENABLED is true. + */ + PP_FLASHSETTING_STAGE3DENABLED = 3, + + /** + * Specifies the string for the language code of the UI of the browser. + * + * For example: "en-US" or "de". + * + * Returns an undefined PP_Var on invalid instance. + */ + PP_FLASHSETTING_LANGUAGE = 4, + + /** + * Specifies the number of CPU cores that are present on the system. + */ + PP_FLASHSETTING_NUMCORES = 5, + + /** + * Specifies restrictions on how flash should handle LSOs. The result is an + * int from PP_FlashLSORestrictions. + */ + PP_FLASHSETTING_LSORESTRICTIONS = 6, + + /** + * Specifies if the driver is reliable enough to use Shader Model 3 commands + * with it. + * + * This should only be enabled if PP_FLASHSETTING_STAGE3DENABLED is true. + */ + PP_FLASHSETTING_STAGE3DBASELINEENABLED = 7 +}; + +/** + * This enum provides keys for setting breakpad crash report data. + */ +[assert_size(4)] +enum PP_FlashCrashKey { + /** + * Specifies the document URL which contains the flash instance. + */ + PP_FLASHCRASHKEY_URL = 1, + + /** + * Specifies the URL of the current swf. + */ + PP_FLASHCRASHKEY_RESOURCE_URL = 2 +}; + +/** + * The PPB_Flash interface contains pointers to various functions + * that are only needed to support Pepper Flash. + */ +interface PPB_Flash { + /** + * Sets or clears the rendering hint that the given plugin instance is always + * on top of page content. Somewhat more optimized painting can be used in + * this case. + */ + void SetInstanceAlwaysOnTop( + [in] PP_Instance instance, + [in] PP_Bool on_top); + + /** + * Draws the given pre-laid-out text. It is almost equivalent to Windows' + * ExtTextOut with the addition of the transformation (a 3x3 matrix given the + * transform to apply before drawing). It also adds the allow_subpixel_aa + * flag which when true, will use subpixel antialiasing if enabled in the + * system settings. For this to work properly, the graphics layer that the + * text is being drawn into must be opaque. + */ + PP_Bool DrawGlyphs( + [in] PP_Instance instance, + [in] PP_Resource pp_image_data, + [in] PP_BrowserFont_Trusted_Description font_desc, + [in] uint32_t color, + [in] PP_Point position, + [in] PP_Rect clip, + [in] float_t[3][3] transformation, + [in] PP_Bool allow_subpixel_aa, + [in] uint32_t glyph_count, + [in, size_is(glyph_count)] uint16_t[] glyph_indices, + [in, size_is(glyph_count)] PP_Point[] glyph_advances); + + /** + * Retrieves the proxy that will be used for the given URL. The result will + * be a string in PAC format, or an undefined var on error. + */ + PP_Var GetProxyForURL( + [in] PP_Instance instance, + [in] str_t url); + + /** + * Navigate to the URL given by the given URLRequestInfo. (This supports GETs, + * POSTs, and javascript: URLs.) May open a new tab if target is not "_self". + */ + int32_t Navigate( + [in] PP_Resource request_info, + [in] str_t target, + [in] PP_Bool from_user_action); + + /** + * Deprecated. Does nothing. Use PPB_Flash_MessageLoop. + */ + [deprecate=13.0] + void RunMessageLoop( + [in] PP_Instance instance); + + /** + * Deprecated. Does nothing. Use PPB_Flash_MessageLoop. + */ + [deprecate=13.0] + void QuitMessageLoop( + [in] PP_Instance instance); + + /** + * Retrieves the local time zone offset from GM time for the given UTC time. + */ + double_t GetLocalTimeZoneOffset( + [in] PP_Instance instance, + [in] PP_Time t); + + /** + * Gets a (string) with "command-line" options for Flash; used to pass + * run-time debugging parameters, etc. + */ + PP_Var GetCommandLineArgs( + [in] PP_Module module); + + /** + * Loads the given font in a more privileged process on Windows. Call this if + * Windows is giving errors for font calls. See + * content/renderer/font_cache_dispatcher_win.cc + * + * The parameter is a pointer to a LOGFONTW structure. + * + * On non-Windows platforms, this function does nothing. + */ + void PreloadFontWin( + [in] mem_t logfontw); + + /** + * Returns whether the given rectangle (in the plugin) is topmost, i.e., above + * all other web content. + */ + PP_Bool IsRectTopmost( + [in] PP_Instance instance, + [in] PP_Rect rect); + + /** + * Deprecated. Does nothing. Use PPB_Flash_Print. + */ + [deprecate=13.0] + int32_t InvokePrinting( + [in] PP_Instance instance); + + /** + * Indicates that there's activity and, e.g., the screensaver shouldn't kick + * in. + */ + void UpdateActivity( + [in] PP_Instance instance); + + /** + * Deprecated. Does nothing. + */ + [deprecate=13.0] + PP_Var GetDeviceID([in] PP_Instance instance); + + /** + * Deprecated. Does nothing. See GetSetting(). + */ + [deprecate=13.0] + int32_t GetSettingInt([in] PP_Instance instance, + [in] PP_FlashSetting setting); + + /** + * Returns the value associated with the given setting. Invalid enums will + * result in an undefined PP_Var return value. + */ + PP_Var GetSetting(PP_Instance instance, PP_FlashSetting setting); + + /** + * Allows setting breakpad crash data which will be included in plugin crash + * reports. Returns PP_FALSE if crash data could not be set. + */ + [version=12.5] + PP_Bool SetCrashData([in] PP_Instance instance, + [in] PP_FlashCrashKey key, + [in] PP_Var value); + + /** + * Enumerates video capture devices. |video_capture| is a valid + * PPB_VideoCapture_Dev resource. Once the operation has completed + * successfully, |devices| will be set up with an array of + * PPB_DeviceRef_Dev resources. + * + * PP_OK is returned on success and different pepper error code on failure. + * The ref count of the returned |devices| has already been increased by 1 for + * the caller. + * + * NOTE: This method is a synchronous version of |EnumerateDevices| in + * PPB_VideoCapture_Dev. + */ + [version=12.6] + int32_t EnumerateVideoCaptureDevices( + [in] PP_Instance instance, + [in] PP_Resource video_capture, + [in] PP_ArrayOutput devices); +}; diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_flash_clipboard.idl b/browser/extensions/mortar/ppapi/api/private/ppb_flash_clipboard.idl new file mode 100644 index 000000000000..d2fef48a074b --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_flash_clipboard.idl @@ -0,0 +1,157 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the private PPB_Flash_Clipboard API used by + * Pepper Flash for reading and writing to the clipboard. + */ + +label Chrome { + M19 = 4.0, + M24 = 5.0, + M34 = 5.1 +}; + +/** + * This enumeration contains the types of clipboards that can be accessed. + * These types correspond to clipboard types in WebKit. + */ +[assert_size(4)] +enum PP_Flash_Clipboard_Type { + /** The standard clipboard. */ + PP_FLASH_CLIPBOARD_TYPE_STANDARD = 0, + /** The selection clipboard (e.g., on Linux). */ + PP_FLASH_CLIPBOARD_TYPE_SELECTION = 1 +}; + +/** + * This enumeration contains the predefined clipboard data formats. + */ +[assert_size(4)] +enum PP_Flash_Clipboard_Format { + /** Indicates an invalid or unsupported clipboard data format. */ + PP_FLASH_CLIPBOARD_FORMAT_INVALID = 0, + /** + * Indicates plaintext clipboard data. The format expected/returned is a + * PP_VARTYPE_STRING. + */ + PP_FLASH_CLIPBOARD_FORMAT_PLAINTEXT = 1, + /** + * Indicates HTML clipboard data. The format expected/returned is a + * PP_VARTYPE_STRING. + */ + PP_FLASH_CLIPBOARD_FORMAT_HTML = 2, + /** + * Indicates RTF clipboard data. The format expected/returned is a + * PP_VARTYPE_ARRAY_BUFFER. + */ + PP_FLASH_CLIPBOARD_FORMAT_RTF = 3 +}; + +/** + * The PPB_Flash_Clipboard interface contains pointers to functions + * used by Pepper Flash to access the clipboard. + * + */ +interface PPB_Flash_Clipboard { + /** + * Deprecated in 5.0. + */ + [version=4.0, deprecate=5.0] + PP_Bool IsFormatAvailable( + [in] PP_Instance instance_id, + [in] PP_Flash_Clipboard_Type clipboard_type, + [in] PP_Flash_Clipboard_Format format); + + /** + * Deprecated in 5.0. + */ + [version=4.0, deprecate=5.0] + PP_Var ReadData([in] PP_Instance instance_id, + [in] PP_Flash_Clipboard_Type clipboard_type, + [in] PP_Flash_Clipboard_Format format); + + /** + * Deprecated in 5.0. + */ + [version=4.0, deprecate=5.0] + int32_t WriteData([in] PP_Instance instance_id, + [in] PP_Flash_Clipboard_Type clipboard_type, + [in] uint32_t data_item_count, + [in, size_is(data_item_count)] PP_Flash_Clipboard_Format[] formats, + [in, size_is(data_item_count)] PP_Var[] data_items); + + /** + * Registers a custom clipboard format. The format is identified by a + * string. An id identifying the format will be returned if the format is + * successfully registered, which can be used to read/write data of that + * format. If the format has already been registered, the id associated with + * that format will be returned. If the format fails to be registered + * PP_FLASH_CLIPBOARD_FORMAT_INVALID will be returned. + * + * All custom data should be read/written as PP_Var array + * buffers. The clipboard format is pepper-specific meaning that although the + * data will be stored on the system clipboard, it can only be accessed in a + * sensible way by using the pepper API. Data stored in custom formats can + * be safely shared between different applications that use pepper. + */ + [version=5.0] + uint32_t RegisterCustomFormat( + [in] PP_Instance instance_id, + [in] str_t format_name); + + /** + * Checks whether a given data format is available from the given clipboard. + * Returns true if the given format is available from the given clipboard. + */ + [version=5.0] + PP_Bool IsFormatAvailable( + [in] PP_Instance instance_id, + [in] PP_Flash_Clipboard_Type clipboard_type, + [in] uint32_t format); + + /** + * Reads data in the given format from the clipboard. An + * undefined PP_Var is returned if there is an error in reading + * the clipboard data and a null PP_Var is returned if there is + * no data of the specified format to read. + */ + [version=5.0] + PP_Var ReadData([in] PP_Instance instance_id, + [in] PP_Flash_Clipboard_Type clipboard_type, + [in] uint32_t format); + + /** + * Writes the given array of data items to the clipboard. All existing + * clipboard data in any format is erased before writing this data. Thus, + * passing an array of size 0 has the effect of clearing the clipboard without + * writing any data. Each data item in the array should have a different + * PP_Flash_Clipboard_Format. If multiple data items have the + * same format, only the last item with that format will be written. + * If there is an error writing any of the items in the array to the + * clipboard, none will be written and an error code is returned. + * The error code will be PP_ERROR_NOSPACE if the value is + * too large to be written, PP_ERROR_BADARGUMENT if a PP_Var + * cannot be converted into the format supplied or PP_FAILED + * if the format is not supported. + */ + [version=5.0] + int32_t WriteData([in] PP_Instance instance_id, + [in] PP_Flash_Clipboard_Type clipboard_type, + [in] uint32_t data_item_count, + [in, size_is(data_item_count)] uint32_t[] formats, + [in, size_is(data_item_count)] PP_Var[] data_items); + + /** + * Gets a sequence number which uniquely identifies clipboard state. This can + * be used to version the data on the clipboard and determine whether it has + * changed. The sequence number will be placed in |sequence_number| and + * PP_TRUE returned if the sequence number was retrieved successfully. + */ + [version=5.1] + PP_Bool GetSequenceNumber([in] PP_Instance instance_id, + [in] PP_Flash_Clipboard_Type clipboard_type, + [out] uint64_t sequence_number); +}; diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_flash_device_id.idl b/browser/extensions/mortar/ppapi/api/private/ppb_flash_device_id.idl new file mode 100644 index 000000000000..b4ba3ca935c8 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_flash_device_id.idl @@ -0,0 +1,29 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file contains the PPB_Flash_DeviceID interface. + */ + +label Chrome { + M21 = 1.0 +}; + +// TODO(raymes): This is deprecated by the PPB_Flash_DRM interface. Remove this +// interface after a few versions of Chrome have passed. +interface PPB_Flash_DeviceID { + PP_Resource Create([in] PP_Instance instance); + + /** + * Asynchronously computes the device ID. When available, it will place the + * string in |*id| and will call the completion callback. On failure the + * given var will be PP_VARTYPE_UNDEFINED. + */ + [version=1.0] + int32_t GetDeviceID([in] PP_Resource device_id, + [out] PP_Var id, + [in] PP_CompletionCallback callback); +}; + diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_flash_drm.idl b/browser/extensions/mortar/ppapi/api/private/ppb_flash_drm.idl new file mode 100644 index 000000000000..a5da9673d1bb --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_flash_drm.idl @@ -0,0 +1,65 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file contains the PPB_Flash_DRM interface. + */ + +[generate_thunk] + +label Chrome { + M29 = 1.0, + M33 = 1.1 +}; + +/** + * A resource for performing Flash DRM-related operations. + */ +interface PPB_Flash_DRM { + /** + * Creates a PPB_Flash_DRM resource for performing DRM-related operations in + * Flash. + */ + PP_Resource Create([in] PP_Instance instance); + + /** + * Asynchronously computes the device ID. When available, it will place the + * string in |*id| and will call the completion callback. On failure the + * given var will be PP_VARTYPE_UNDEFINED. + */ + int32_t GetDeviceID([in] PP_Resource drm, + [out] PP_Var id, + [in] PP_CompletionCallback callback); + + /** + * Windows and Mac only. Synchronously outputs the HMONITOR or + * CGDirectDisplayID corresponding to the monitor on which the plugin instance + * is displayed in |hmonitor|. This value is queried asynchronously and this + * will return PP_FALSE if the value is not yet available or an error + * occurred. PP_TRUE is returned on success. + */ + PP_Bool GetHmonitor([in] PP_Resource drm, + [out] int64_t hmonitor); + + /** + * Asynchronously returns a PPB_FileRef resource in |file_ref| which points to + * the Voucher file for performing DRM verification. |callback| will be called + * upon completion. + */ + int32_t GetVoucherFile([in] PP_Resource drm, + [out] PP_Resource file_ref, + [in] PP_CompletionCallback callback); + + /** + * Asynchronously returns a value indicating whether the monitor on which the + * plugin instance is displayed is external. |callback| will be called upon + * completion. + */ + [version=1.1] + int32_t MonitorIsExternal([in] PP_Resource drm, + [out] PP_Bool is_external, + [in] PP_CompletionCallback callback); +}; + diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_flash_file.idl b/browser/extensions/mortar/ppapi/api/private/ppb_flash_file.idl new file mode 100644 index 000000000000..496962b77cc6 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_flash_file.idl @@ -0,0 +1,126 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file contains the PPB_Flash_File_ModuleLocal and PPB_Flash_File_FileRef interfaces. + */ + +label Chrome { + M24 = 2.0, + M25 = 3.0 +}; + +struct PP_DirEntry_Dev { + str_t name; + PP_Bool is_dir; +}; + +/* Directory. */ +struct PP_DirContents_Dev { + int32_t count; + [size_is(count)] PP_DirEntry_Dev[] entries; +}; + +/* PPB_Flash_File_ModuleLocal */ +[version=3.0] +interface PPB_Flash_File_ModuleLocal { + /* Deprecated. Returns true. */ + PP_Bool CreateThreadAdapterForInstance( + [in] PP_Instance instance); + /* Deprecated. Does nothing. */ + void ClearThreadAdapterForInstance( + [in] PP_Instance instance); + + /* Opens a module-local file, returning a file descriptor (posix) or a HANDLE + * (win32) into file. Module-local file paths (here and below) are + * '/'-separated UTF-8 strings, relative to a module-specific root. The return + * value is the ppapi error, PP_OK if success, one of the PP_ERROR_* in case + * of failure + */ + int32_t OpenFile( + [in] PP_Instance instance, + [in] str_t path, + [in] int32_t mode, + [out] PP_FileHandle file); + + /* Renames a module-local file. The return value is the ppapi error, PP_OK if + * success, one of the PP_ERROR_* in case of failure. + */ + int32_t RenameFile( + [in] PP_Instance instance, + [in] str_t path_from, + [in] str_t path_to); + + /* Deletes a module-local file or directory. If recursive is set and the path + * points to a directory, deletes all the contents of the directory. The + * return value is the ppapi error, PP_OK if success, one of the PP_ERROR_* in + * case of failure. + */ + int32_t DeleteFileOrDir( + [in] PP_Instance instance, + [in] str_t path, + [in] PP_Bool recursive); + + /* Creates a module-local directory. The return value is the ppapi error, + * PP_OK if success, one of the PP_ERROR_* in case of failure. + */ + int32_t CreateDir( + [in] PP_Instance instance, + [in] str_t path); + + /* Queries information about a module-local file. The return value is the + * ppapi error, PP_OK if success, one of the PP_ERROR_* in case of failure. + */ + int32_t QueryFile( + [in] PP_Instance instance, + [in] str_t path, + [out] PP_FileInfo info); + + /* Gets the list of files contained in a module-local directory. The return + * value is the ppapi error, PP_OK if success, one of the PP_ERROR_* in case + * of failure. If non-NULL, the returned contents should be freed with + * FreeDirContents. + */ + int32_t GetDirContents( + [in] PP_Instance instance, + [in] str_t path, + [out] PP_DirContents_Dev contents); + + /* Frees the data allocated by GetDirContents. */ + void FreeDirContents( + [in] PP_Instance instance, + [in] PP_DirContents_Dev contents); + + /* Creates a temporary file. The file will be automatically deleted when all + * handles to it are closed. + * Returns PP_OK if successful, one of the PP_ERROR_* values in case of + * failure. + * If successful, |file| is set to a file descriptor (posix) or a HANDLE + * (win32) to the file. If failed, |file| is not touched. + */ + int32_t CreateTemporaryFile( + [in] PP_Instance instance, + [out] PP_FileHandle file); +}; + +/** + * This interface provides (for Flash) synchronous access to files whose paths + * are given by a Pepper FileRef. Such FileRefs are typically obtained via the + * Pepper file chooser. + */ +[version=2.0] +interface PPB_Flash_File_FileRef { + /* The functions below correspond exactly to their module-local counterparts + * (except in taking FileRefs instead of paths, of course). We omit the + * functionality which we do not provide for FileRefs. + */ + int32_t OpenFile( + [in] PP_Resource file_ref_id, + [in] int32_t mode, + [out] PP_FileHandle file); + int32_t QueryFile( + [in] PP_Resource file_ref_id, + [out] PP_FileInfo info); +}; diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_flash_font_file.idl b/browser/extensions/mortar/ppapi/api/private/ppb_flash_font_file.idl new file mode 100644 index 000000000000..b921d1854ca9 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_flash_font_file.idl @@ -0,0 +1,50 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file contains the PPB_Flash_FontFile interface. + */ + +[generate_thunk] + +label Chrome { + M24 = 0.1, + M48 = 0.2 +}; + +interface PPB_Flash_FontFile { + /* Returns a resource identifying a font file corresponding to the given font + * request after applying the browser-specific fallback. + */ + PP_Resource Create( + [in] PP_Instance instance, + [in] PP_BrowserFont_Trusted_Description description, + [in] PP_PrivateFontCharset charset); + + /* Determines if a given resource is Flash font file. + */ + PP_Bool IsFlashFontFile([in] PP_Resource resource); + + /* Returns the requested font table. + * |output_length| should pass in the size of |output|. And it will return + * the actual length of returned data. |output| could be NULL in order to + * query the size of the buffer size needed. In that case, the input value of + * |output_length| is ignored. + * Note: it is Linux only and fails directly on other platforms. + */ + PP_Bool GetFontTable( + [in] PP_Resource font_file, + [in] uint32_t table, + [out] mem_t output, + [out] uint32_t output_length); + + /** + * Returns whether PPB_Flash_FontFile is supported on Windows. + */ + [version=0.2] + PP_Bool IsSupportedForWindows(); + +}; + diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_flash_fullscreen.idl b/browser/extensions/mortar/ppapi/api/private/ppb_flash_fullscreen.idl new file mode 100644 index 000000000000..11f94e4d402a --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_flash_fullscreen.idl @@ -0,0 +1,56 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + + +/** + * This file defines the PPB_FlashFullscreen interface. + */ + +label Chrome { + M16 = 0.1, + M23 = 1.0 +}; + +interface PPB_FlashFullscreen { + /** + * Checks whether the plugin instance is currently in fullscreen mode. + */ + PP_Bool IsFullscreen( + [in] PP_Instance instance); + + /* + * This older version required that graphics contexts be recreated after the + * transition. + */ + [version=0.1, deprecate=1.0] + PP_Bool SetFullscreen( + [in] PP_Instance instance, + [in] PP_Bool fullscreen); + + /** + * Switches the plugin instance to/from fullscreen mode. Returns PP_TRUE on + * success, PP_FALSE on failure. + * + * This does not unbind the current Graphics2D or Graphics3D. Pending flushes + * and swapbuffers will execute as if the resource was off-screen. The + * transition is asynchronous. During the transition, IsFullscreen will + * return PP_FALSE, and no Graphics2D or Graphics3D can be bound. The + * transition ends at the next DidChangeView when going into fullscreen mode. + * The transition out of fullscreen mode is synchronous. + */ + [version=1.0] + PP_Bool SetFullscreen( + [in] PP_Instance instance, + [in] PP_Bool fullscreen); + + /** + * Gets the size of the screen in pixels. When going fullscreen, the instance + * will be resized to that size. + */ + PP_Bool GetScreenSize( + [in] PP_Instance instance, + [out] PP_Size size); +}; + diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_flash_menu.idl b/browser/extensions/mortar/ppapi/api/private/ppb_flash_menu.idl new file mode 100644 index 000000000000..253d8bd722f1 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_flash_menu.idl @@ -0,0 +1,54 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_Flash_Menu interface. + */ +label Chrome { + M14 = 0.2 +}; + +/* Menu item type. + * + * TODO(viettrungluu): Radio items not supported yet. Will also probably want + * special menu items tied to clipboard access. + */ +[assert_size(4)] +enum PP_Flash_MenuItem_Type { + PP_FLASH_MENUITEM_TYPE_NORMAL = 0, + PP_FLASH_MENUITEM_TYPE_CHECKBOX = 1, + PP_FLASH_MENUITEM_TYPE_SEPARATOR = 2, + PP_FLASH_MENUITEM_TYPE_SUBMENU = 3 +}; + +struct PP_Flash_MenuItem { + PP_Flash_MenuItem_Type type; + str_t name; + int32_t id; + PP_Bool enabled; + PP_Bool checked; + [ref] PP_Flash_Menu submenu; +}; + +struct PP_Flash_Menu { + uint32_t count; + [size_is(count)] PP_Flash_MenuItem[] items; +}; + +interface PPB_Flash_Menu { + PP_Resource Create([in] PP_Instance instance_id, + [in] PP_Flash_Menu menu_data); + PP_Bool IsFlashMenu(PP_Resource resource_id); + /* Display a context menu at the given location. If the user selects an item, + * |selected_id| will be set to its |id| and the callback called with |PP_OK|. + * If the user dismisses the menu without selecting an item, + * |PP_ERROR_USERCANCEL| will be indicated. + */ + int32_t Show([in] PP_Resource menu_id, + [in] PP_Point location, + [out] int32_t selected_id, + [in] PP_CompletionCallback callback); +}; + diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_flash_message_loop.idl b/browser/extensions/mortar/ppapi/api/private/ppb_flash_message_loop.idl new file mode 100644 index 000000000000..48749072a507 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_flash_message_loop.idl @@ -0,0 +1,73 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file contains the PPB_Flash_MessageLoop interface. + */ + +label Chrome { + M18 = 0.1 +}; + +/** + * The PPB_Flash_MessageLoop interface supports Pepper Flash to run + * nested message loops. + */ +interface PPB_Flash_MessageLoop { + /** + * Allocates a Flash message loop resource. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * + * @return A PP_Resource that can be used to run a nested message + * loop if successful; 0 if failed. + */ + PP_Resource Create([in] PP_Instance instance); + + /** + * Determines if a given resource is a Flash message loop. + * + * @param[in] resource A PP_Resource corresponding to a generic + * resource. + * + * @return A PP_Bool that is PP_TRUE if the given + * resource is a Flash message loop, otherwise PP_FALSE. + */ + PP_Bool IsFlashMessageLoop([in] PP_Resource resource); + + /** + * Runs a nested message loop. The plugin will be reentered from this call. + * This function is used in places where Flash would normally enter a nested + * message loop (e.g., when displaying context menus), but Pepper provides + * only an asynchronous call. After performing that asynchronous call, call + * Run(). In the callback, call Quit(). + * + * For a given message loop resource, only the first call to + * Run() will start a nested message loop. The subsequent calls + * will return PP_ERROR_FAILED immediately. + * + * @param[in] flash_message_loop The Flash message loop. + * + * @return PP_ERROR_ABORTED if the message loop quits because the + * resource is destroyed; PP_OK if the message loop quits because + * of other reasons (e.g., Quit() is called); + * PP_ERROR_FAILED if this is not the first call to + * Run(). + */ + int32_t Run([in] PP_Resource flash_message_loop); + + /** + * Signals to quit the outermost nested message loop. Use this to exit and + * return back to the caller after you call Run(). + * + * If Quit() is not called to balance the call to + * Run(), the outermost nested message loop will be quitted + * implicitly when the resource is destroyed. + * + * @param[in] flash_message_loop The Flash message loop. + */ + void Quit([in] PP_Resource flash_message_loop); +}; \ No newline at end of file diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_flash_print.idl b/browser/extensions/mortar/ppapi/api/private/ppb_flash_print.idl new file mode 100644 index 000000000000..1961b8b8485b --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_flash_print.idl @@ -0,0 +1,23 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file contains the PPB_Flash_Print interface. + */ + +label Chrome { + M20 = 1.0 +}; + +/** + * The PPB_Flash_Print interface contains Flash-specific printing + * functionality. + */ +interface PPB_Flash_Print { + /** + * Invokes printing on the given plugin instance. + */ + void InvokePrinting([in] PP_Instance instance); +}; diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_host_resolver_private.idl b/browser/extensions/mortar/ppapi/api/private/ppb_host_resolver_private.idl new file mode 100644 index 000000000000..f7b0e4a5c297 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_host_resolver_private.idl @@ -0,0 +1,79 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_HostResolver_Private interface. + */ + +label Chrome { + M19 = 0.1 +}; + +/** + * The PP_HostResolver_Flags is an enumeration of the + * different types of flags, that can be OR-ed and passed to host + * resolver. + */ +[assert_size(4)] +enum PP_HostResolver_Private_Flags { + /** + * AI_CANONNAME + */ + PP_HOST_RESOLVER_PRIVATE_FLAGS_CANONNAME = 1 << 0, + /** + * Hint to the resolver that only loopback addresses are configured. + */ + PP_HOST_RESOLVER_PRIVATE_FLAGS_LOOPBACK_ONLY = 1 << 1 +}; + +[assert_size(8)] +struct PP_HostResolver_Private_Hint { + PP_NetAddressFamily_Private family; + int32_t flags; +}; + +interface PPB_HostResolver_Private { + /** + * Allocates a Host Resolver resource. + */ + PP_Resource Create([in] PP_Instance instance); + + /** + * Determines if a given resource is a Host Resolver. + */ + PP_Bool IsHostResolver([in] PP_Resource resource); + + /** + * Creates a new request to Host Resolver. |callback| is invoked + * when request is processed and a list of network addresses is + * obtained. These addresses can be be used in Connect, Bind or + * Listen calls to connect to a given |host| and |port|. + */ + int32_t Resolve([in] PP_Resource host_resolver, + [in] str_t host, + [in] uint16_t port, + [in] PP_HostResolver_Private_Hint hint, + [in] PP_CompletionCallback callback); + + /** + * Returns canonical name of host. + */ + PP_Var GetCanonicalName([in] PP_Resource host_resolver); + + /** + * Returns number of network addresses obtained after Resolve call. + */ + uint32_t GetSize([in] PP_Resource host_resolver); + + /** + * Stores in the |addr| |index|-th network address. |addr| can't be + * NULL. Returns PP_TRUE if success or PP_FALSE if the given + * resource is not a Host Resolver or |index| exceeds number of + * available addresses. + */ + PP_Bool GetNetAddress([in] PP_Resource host_resolver, + [in] uint32_t index, + [out] PP_NetAddress_Private addr); +}; diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_instance_private.idl b/browser/extensions/mortar/ppapi/api/private/ppb_instance_private.idl new file mode 100644 index 000000000000..2ba9df319fbb --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_instance_private.idl @@ -0,0 +1,80 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_Instance_Private interface implemented by the + * browser and containing pointers to functions available only to trusted plugin + * instances. + */ + +[generate_thunk] + +label Chrome { + M13 = 0.1 +}; + +/** + * The PP_ExternalPluginResult enum contains result codes from + * launching an external plugin. + */ +[assert_size(4)] +enum PP_ExternalPluginResult { + /** Successful external plugin call */ + PP_EXTERNAL_PLUGIN_OK = 0, + /** Unspecified external plugin error */ + PP_EXTERNAL_PLUGIN_FAILED = 1, + /** Error creating the module */ + PP_EXTERNAL_PLUGIN_ERROR_MODULE = 2, + /** Error creating and initializing the instance */ + PP_EXTERNAL_PLUGIN_ERROR_INSTANCE = 3 +}; + + +/** + * The PPB_Instance_Private interface contains functions available only to + * trusted plugin instances. + * + */ +interface PPB_Instance_Private { + /** + * GetWindowObject is a pointer to a function that determines + * the DOM window containing this module instance. + * + * @param[in] instance A PP_Instance whose WindowObject should be retrieved. + * @return A PP_Var containing window object on success. + */ + PP_Var GetWindowObject([in] PP_Instance instance); + + /** + * GetOwnerElementObject is a pointer to a function that determines + * the DOM element containing this module instance. + * + * @param[in] instance A PP_Instance whose WindowObject should be retrieved. + * @return A PP_Var containing DOM element on success. + */ + PP_Var GetOwnerElementObject([in] PP_Instance instance); + + /** + * ExecuteScript is a pointer to a function that executes the given + * script in the context of the frame containing the module. + * + * The exception, if any, will be returned in *exception. As with the PPB_Var + * interface, the exception parameter, if non-NULL, must be initialized + * to a "void" var or the function will immediately return. On success, + * the exception parameter will be set to a "void" var. On failure, the + * return value will be a "void" var. + * + * @param[in] script A string containing the JavaScript to execute. + * @param[in/out] exception PP_Var containing the exception. Initialize + * this to NULL if you don't want exception info; initialize this to a void + * exception if want exception info. + * + * @return The result of the script execution, or a "void" var + * if execution failed. + */ + PP_Var ExecuteScript([in] PP_Instance instance, + [in] PP_Var script, + [out] PP_Var exception); +}; diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_isolated_file_system_private.idl b/browser/extensions/mortar/ppapi/api/private/ppb_isolated_file_system_private.idl new file mode 100644 index 000000000000..c42d52012360 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_isolated_file_system_private.idl @@ -0,0 +1,54 @@ +/* Copyright 2013 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +[generate_thunk,thunk_include="ppapi/thunk/ppb_isolated_file_system_private_api.h"] + +/** + * This file contains the PPB_IsolatedFileSystem_Private interface. + */ +label Chrome { + M33 = 0.2 +}; + + +/** + * The PP_IsolatedFileSystemType_Private values indicate the type + * of isolated file systems. + */ +[assert_size(4)] +enum PP_IsolatedFileSystemType_Private { + /** Type for invalid file systems */ + PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_INVALID = 0, + /** Type for CRX file systems */ + PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_CRX = 1, + /** Type for PluginPrivate file systems */ + PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_PLUGINPRIVATE = 2 +}; + +/* PPB_IsolatedFileSystem_Private interface */ +interface PPB_IsolatedFileSystem_Private { + /** + * Open() opens a file system corresponding the given file system type. + * + * When opening the CRX file system, this should be called from an extension + * context, otherwise it will fail. + * + * @param[in] instance A PP_Instance identifying the instance + * with the file system. + * @param[in] type A file system type as defined by + * PP_IsolatedFileSystemType_Private enum. + * @param[out] file_system An output PP_Resource corresponding + * to a PPB_FileSystem. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Open. + * + * @return An int32_t containing an error code from pp_errors.h. + */ + [singleton,api=PPB_IsolatedFileSystem_Private_API] + int32_t Open([in] PP_Instance instance, + [in] PP_IsolatedFileSystemType_Private type, + [out] PP_Resource file_system, + [in] PP_CompletionCallback callback); +}; diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_net_address_private.idl b/browser/extensions/mortar/ppapi/api/private/ppb_net_address_private.idl new file mode 100644 index 000000000000..cc8045ddbd99 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_net_address_private.idl @@ -0,0 +1,129 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_NetAddress_Private interface. + */ + +label Chrome { + M13 = 0.0, + M17 = 0.1, + M19_0 = 1.0, + M19_1 = 1.1 +}; + +[assert_size(4)] +enum PP_NetAddressFamily_Private { + /** + * The address family is unspecified. + */ + PP_NETADDRESSFAMILY_PRIVATE_UNSPECIFIED = 0, + /** + * The Internet Protocol version 4 (IPv4) address family. + */ + PP_NETADDRESSFAMILY_PRIVATE_IPV4 = 1, + /** + * The Internet Protocol version 6 (IPv6) address family. + */ + PP_NETADDRESSFAMILY_PRIVATE_IPV6 = 2 +}; + +/** + * This is an opaque type holding a network address. Plugins must + * never access members of this struct directly. + */ +[assert_size(132)] +struct PP_NetAddress_Private { + uint32_t size; + int8_t[128] data; +}; + +/** + * The PPB_NetAddress_Private interface provides operations on + * network addresses. + */ +[version=0.1] interface PPB_NetAddress_Private { + /** + * Returns PP_TRUE if the two addresses are equal (host and port). + */ + PP_Bool AreEqual([in] PP_NetAddress_Private addr1, + [in] PP_NetAddress_Private addr2); + + /** + * Returns PP_TRUE if the two addresses refer to the same host. + */ + PP_Bool AreHostsEqual([in] PP_NetAddress_Private addr1, + [in] PP_NetAddress_Private addr2); + + /** + * Returns a human-readable description of the network address, optionally + * including the port (e.g., "192.168.0.1", "192.168.0.1:99", or "[::1]:80"), + * or an undefined var on failure. + */ + PP_Var Describe([in] PP_Module module, + [in] PP_NetAddress_Private addr, + [in] PP_Bool include_port); + + /** + * Replaces the port in the given source address. Returns PP_TRUE on success. + */ + PP_Bool ReplacePort([in] PP_NetAddress_Private src_addr, + [in] uint16_t port, + [out] PP_NetAddress_Private addr_out); + + /** + * Gets the "any" address (for IPv4 or IPv6); for use with UDP Bind. + */ + void GetAnyAddress([in] PP_Bool is_ipv6, + [out] PP_NetAddress_Private addr); + + /** + * Gets the address family. + */ + [version=1.0] + PP_NetAddressFamily_Private GetFamily([in] PP_NetAddress_Private addr); + + /** + * Gets the port. The port is returned in host byte order. + */ + [version=1.0] + uint16_t GetPort([in] PP_NetAddress_Private addr); + + /** + * Gets the address. The output, address, must be large enough for the + * current socket family. The output will be the binary representation of an + * address for the current socket family. For IPv4 and IPv6 the address is in + * network byte order. PP_TRUE is returned if the address was successfully + * retrieved. + */ + [version=1.0] + PP_Bool GetAddress([in] PP_NetAddress_Private addr, + [out] mem_t address, + [in] uint16_t address_size); + + /** + * Returns ScopeID for IPv6 addresses or 0 for IPv4. + */ + [version=1.1] + uint32_t GetScopeID([in] PP_NetAddress_Private addr); + + /** + * Creates NetAddress with the specified IPv4 address and port + * number. + */ + [version=1.1] + void CreateFromIPv4Address([in] uint8_t[4] ip, + [in] uint16_t port, + [out] PP_NetAddress_Private addr_out); + /** + * Creates NetAddress with the specified IPv6 address, scope_id and + * port number. + */ + [version=1.1] + void CreateFromIPv6Address([in] uint8_t[16] ip, + [in] uint32_t scope_id, + [in] uint16_t port, + [out] PP_NetAddress_Private addr_out); +}; diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_output_protection_private.idl b/browser/extensions/mortar/ppapi/api/private/ppb_output_protection_private.idl new file mode 100644 index 000000000000..44a2585be05c --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_output_protection_private.idl @@ -0,0 +1,141 @@ +/* Copyright 2013 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the API for output protection. Currently, it only supports + * Chrome OS. + */ + +[generate_thunk] + +label Chrome { + M31 = 0.1 +}; + +/** + * Content protection methods applied on video output link. + */ +[assert_size(4)] enum PP_OutputProtectionMethod_Private { + PP_OUTPUT_PROTECTION_METHOD_PRIVATE_NONE = 0, + PP_OUTPUT_PROTECTION_METHOD_PRIVATE_HDCP = 1 << 0 +}; + +/** + * Video output link types. + */ +[assert_size(4)] enum PP_OutputProtectionLinkType_Private { + PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_NONE = 0, + PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_UNKNOWN = 1 << 0, + PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_INTERNAL = 1 << 1, + PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_VGA = 1 << 2, + PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_HDMI = 1 << 3, + PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_DVI = 1 << 4, + PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_DISPLAYPORT = 1 << 5, + PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_NETWORK = 1 << 6 +}; + +/** + * The PPB_OutputProtection_Private interface allows controlling + * output protection. + * + * Example: + * + * @code + * op = output_protection->Create(instance); + * output_protection->QueryStatus(op, &link_mask, &protection_mask, + * done_callback); + * @endcode + * + * In this example, the plugin wants to enforce HDCP for HDMI link. + * @code + * if (link_mask & PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_HDMI) { + * output_protection->EnableProtection( + * op, PP_OUTPUT_PROTECTION_METHOD_PRIVATE_HDCP, done_callback); + * } + * @endcode + * + * After EnableProtection() completes, the plugin has to query protection + * status periodically to make sure the protection is enabled and remains + * enabled. + */ +interface PPB_OutputProtection_Private { + /** + * Create() creates a new PPB_OutputProtection_Private object. + * + * @pram[in] instance A PP_Instance identifying one instance of + * a module. + * + * @return A PP_Resource corresponding to a + * PPB_OutputProtection_Private if successful, 0 if creation + * failed. + */ + PP_Resource Create([in] PP_Instance instance); + + /** + * IsOutputProtection() determines if the provided resource is a + * PPB_OutputProtection_Private. + * + * @param[in] resource A PP_Resource corresponding to a + * PPB_OutputProtection_Private. + * + * @return PP_TRUE if the resource is a + * PPB_OutputProtection_Private, PP_FALSE if the + * resource is invalid or some type other than + * PPB_OutputProtection_Private. + */ + PP_Bool IsOutputProtection([in] PP_Resource resource); + + /** + * Query link status and protection status. + * Clients have to query status periodically in order to detect changes. + * + * @param[in] resource A PP_Resource corresponding to a + * PPB_OutputProtection_Private. + * @param[out] link_mask The type of connected output links, which is a + * bit-mask of the PP_OutputProtectionLinkType_Private values. + * @param[out] protection_mask Enabled protection methods, which is a + * bit-mask of the PP_OutputProtectionMethod_Private values. + * @param[in] callback A PP_CompletionCallback to run on + * asynchronous completion of QueryStatus(). This callback will only run if + * QueryStatus() returns PP_OK_COMPLETIONPENDING. + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t QueryStatus( + [in] PP_Resource resource, + [out] uint32_t link_mask, + [out] uint32_t protection_mask, + [in] PP_CompletionCallback callback); + + /** + * Set desired protection methods. + * + * When the desired protection method(s) have been applied to all applicable + * output links, the relevant bit(s) of the protection_mask returned by + * QueryStatus() will be set. Otherwise, the relevant bit(s) of + * protection_mask will not be set; there is no separate error code or + * callback. + * + * Protections will be disabled if no longer desired by all instances. + * + * @param[in] resource A PP_Resource corresponding to a + * PPB_OutputProtection_Private. + * @param[in] desired_protection_mask The desired protection methods, which + * is a bit-mask of the PP_OutputProtectionMethod_Private + * values. + * @param[in] callback A PP_CompletionCallback to be called with + * PP_OK when the protection request has been made. This may be + * before the protection have actually been applied. Call QueryStatus to get + * protection status. If it failed to make the protection request, the + * callback is called with PP_ERROR_FAILED and there is no need + * to call QueryStatus(). + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t EnableProtection( + [in] PP_Resource resource, + [in] uint32_t desired_protection_mask, + [in] PP_CompletionCallback callback); +}; diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_pdf.idl b/browser/extensions/mortar/ppapi/api/private/ppb_pdf.idl new file mode 100644 index 000000000000..51088d906aa3 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_pdf.idl @@ -0,0 +1,182 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* This file contains PPB_PDF interface. */ + +label Chrome { + M19 = 0.1 +}; + +enum PP_PDFFeature { + PP_PDFFEATURE_HIDPI = 0, + PP_PDFFEATURE_PRINTING = 1 +}; + +struct PP_PrivateFontFileDescription { + str_t face; + uint32_t weight; + PP_Bool italic; +}; + +struct PP_PrivateFindResult { + int32_t start_index; + int32_t length; +}; + +struct PP_PrivateAccessibilityViewportInfo { + double_t zoom; + PP_Point scroll; + PP_Point offset; +}; + +struct PP_PrivateAccessibilityDocInfo { + uint32_t page_count; + PP_Bool text_accessible; + PP_Bool text_copyable; +}; + +enum PP_PrivateDirection { + PP_PRIVATEDIRECTION_NONE = 0, + PP_PRIVATEDIRECTION_LTR = 1, + PP_PRIVATEDIRECTION_RTL = 2, + PP_PRIVATEDIRECTION_TTB = 3, + PP_PRIVATEDIRECTION_BTT = 4, + PP_PRIVATEDIRECTION_LAST = PP_PRIVATEDIRECTION_BTT +}; + +struct PP_PrivateAccessibilityPageInfo { + uint32_t page_index; + PP_Rect bounds; + uint32_t text_run_count; + uint32_t char_count; +}; + +struct PP_PrivateAccessibilityTextRunInfo { + uint32_t len; + double_t font_size; + PP_FloatRect bounds; + PP_PrivateDirection direction; +}; + +struct PP_PrivateAccessibilityCharInfo { + uint32_t unicode_character; + double_t char_width; +}; + +interface PPB_PDF { + /* Returns a resource identifying a font file corresponding to the given font + * request after applying the browser-specific fallback. + * + * Currently Linux-only. + */ + PP_Resource GetFontFileWithFallback( + [in] PP_Instance instance, + [in] PP_BrowserFont_Trusted_Description description, + [in] PP_PrivateFontCharset charset); + + /* Given a resource previously returned by GetFontFileWithFallback, returns + * a pointer to the requested font table. Linux only. + */ + PP_Bool GetFontTableForPrivateFontFile( + [in] PP_Resource font_file, + [in] uint32_t table, + [out] mem_t output, + [out] uint32_t output_length); + + /* Search the given string using ICU. Use PPB_Core's MemFree on results when + * done. + */ + void SearchString( + [in] PP_Instance instance, + [in] mem_t str, + [in] mem_t term, + [in] PP_Bool case_sensitive, + [out, size_is(count)] PP_PrivateFindResult[] results, + [out] int32_t count); + + /* Since WebFrame doesn't know about PPAPI requests, it'll think the page has + * finished loading even if there are outstanding requests by the plugin. + * Take this out once WebFrame knows about requests by PPAPI plugins. + */ + void DidStartLoading( + [in] PP_Instance instance); + void DidStopLoading( + [in] PP_Instance instance); + + /* Sets content restriction for a full-page plugin (i.e. can't copy/print). + * The value is a bitfield of ContentRestriction enums. + */ + void SetContentRestriction( + [in] PP_Instance instance, + [in] int32_t restrictions); + + /* Notifies the browser that the given action has been performed. */ + void UserMetricsRecordAction( + [in] PP_Instance instance, + [in] PP_Var action); + + /* Notifies the browser that the PDF has an unsupported feature. */ + void HasUnsupportedFeature( + [in] PP_Instance instance); + + /*Invoke SaveAs... dialog, similar to the right-click or wrench menu. */ + void SaveAs( + [in] PP_Instance instance); + + /* Invoke Print dialog for plugin. */ + void Print( + [in] PP_Instance instance); + + PP_Bool IsFeatureEnabled( + [in] PP_Instance instance, + [in] PP_PDFFeature feature); + + /* Sets the selected text of the plugin. If |selected_text| is empty, then no + * text is selected. */ + void SetSelectedText( + [in] PP_Instance instance, + [in] str_t selected_text); + + /* Sets the link under the cursor. If |url| is empty, then no link is under + * the cursor. */ + void SetLinkUnderCursor( + [in] PP_Instance instance, + [in] str_t url); + + /* Gets pointers to both the mmap'd V8 snapshot files and their sizes. + * This is needed when loading V8's initial snapshot from external files. */ + void GetV8ExternalSnapshotData( + [in] PP_Instance instance, + [out] mem_ptr_t natives_data_out, + [out] int32_t natives_size_out, + [out] mem_ptr_t snapshot_data_out, + [out] int32_t snapshot_size_out); + + /* Sends information about the viewport to the renderer for accessibility + * support. */ + void SetAccessibilityViewportInfo( + [in] PP_Instance instance, + [in] PP_PrivateAccessibilityViewportInfo viewport_info); + + /* Sends information about the PDF document to the renderer for accessibility + * support. */ + void SetAccessibilityDocInfo( + [in] PP_Instance instance, + [in] PP_PrivateAccessibilityDocInfo doc_info); + + /* Sends information about one page in a PDF document to the renderer for + * accessibility support. */ + void SetAccessibilityPageInfo( + [in] PP_Instance instance, + [in] PP_PrivateAccessibilityPageInfo page_info, + [in] PP_PrivateAccessibilityTextRunInfo[] text_runs, + [in] PP_PrivateAccessibilityCharInfo[] chars); + + /* Sends information about the PDF's URL and the embedder's URL. */ + void SetCrashData( + [in] PP_Instance instance, + [in] str_t pdf_url, + [in] str_t top_level_url); +}; diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_platform_verification_private.idl b/browser/extensions/mortar/ppapi/api/private/ppb_platform_verification_private.idl new file mode 100644 index 000000000000..87df6af7e227 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_platform_verification_private.idl @@ -0,0 +1,85 @@ +/* Copyright 2013 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the API for platform verification. Currently, it only + * supports Chrome OS. + */ + +[generate_thunk] + +label Chrome { + M32 = 0.2 +}; + +/** + * The PPB_PlatformVerification_Private interface allows authorized + * services to verify that the underlying platform is trusted. An example of a + * trusted platform is a Chrome OS device in verified boot mode. + */ + +interface PPB_PlatformVerification_Private { + /** + * Create() creates a PPB_PlatformVerification_Private object. + * + * @pram[in] instance A PP_Instance identifying one instance of + * a module. + * + * @return A PP_Resource corresponding to a + * PPB_PlatformVerification_Private if successful, 0 if creation + * failed. + */ + PP_Resource Create([in] PP_Instance instance); + + /** + * IsPlatformVerification() determines if the provided resource is a + * PPB_PlatformVerification_Private. + * + * @param[in] resource A PP_Resource corresponding to a + * PPB_PlatformVerification_Private. + * + * @return PP_TRUE if the resource is a + * PPB_PlatformVerification_Private, PP_FALSE if the + * resource is invalid or some type other than + * PPB_PlatformVerification_Private. + */ + PP_Bool IsPlatformVerification([in] PP_Resource resource); + + /** + * Requests a platform challenge for a given service id. + * + * @param[in] service_id A PP_Var of type + * PP_VARTYPE_STRING containing the service_id for the challenge. + * + * @param[in] challenge A PP_Var of type + * PP_VARTYPE_ARRAY_BUFFER that contains the challenge data. + * + * @param[out] signed_data A PP_Var of type + * PP_VARTYPE_ARRAY_BUFFER that contains the data signed by the + * platform. + * + * @param[out] signed_data_signature A PP_Var of type + * PP_VARTYPE_ARRAY_BUFFER that contains the signature of the + * signed data block. + * + * @param[out] platform_key_certificate A PP_Var of type + * PP_VARTYPE_STRING that contains the device specific + * certificate for the requested service_id. + * + * @param[in] callback A PP_CompletionCallback to be called after + * the platform challenge has been completed. This callback will only run if + * the return code is PP_OK_COMPLETIONPENDING. + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t ChallengePlatform( + [in] PP_Resource instance, + [in] PP_Var service_id, + [in] PP_Var challenge, + [out] PP_Var signed_data, + [out] PP_Var signed_data_signature, + [out] PP_Var platform_key_certificate, + [in] PP_CompletionCallback callback); +}; diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_tcp_server_socket_private.idl b/browser/extensions/mortar/ppapi/api/private/ppb_tcp_server_socket_private.idl new file mode 100644 index 000000000000..a9130ccd6c9d --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_tcp_server_socket_private.idl @@ -0,0 +1,71 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_TCPServerSocket_Private interface. + */ + +label Chrome { + M18 = 0.1, + M28 = 0.2 +}; + +/** + * The PPB_TCPServerSocket_Private interface provides TCP + * server socket operations. + */ +interface PPB_TCPServerSocket_Private { + /** + * Allocates a TCP server socket resource. + */ + PP_Resource Create([in] PP_Instance instance); + + /** + * Determines if a given resource is TCP server socket. + */ + PP_Bool IsTCPServerSocket([in] PP_Resource resource); + + /** + * Binds |tcp_server_socket| to the address given by |addr| and + * starts listening. The |backlog| argument defines the maximum + * length to which the queue of pending connections may + * grow. |callback| is invoked when |tcp_server_socket| is ready to + * accept incoming connections or in the case of failure. Returns + * PP_ERROR_NOSPACE if socket can't be initialized, or + * PP_ERROR_FAILED in the case of Listen failure. Otherwise, returns + * PP_OK. + */ + int32_t Listen([in] PP_Resource tcp_server_socket, + [in] PP_NetAddress_Private addr, + [in] int32_t backlog, + [in] PP_CompletionCallback callback); + + /** + * Accepts single connection, creates instance of + * PPB_TCPSocket_Private and stores reference to it in + * |tcp_socket|. |callback| is invoked when connection is accepted + * or in the case of failure. This method can be called only after + * successful Listen call on |tcp_server_socket|. + */ + int32_t Accept([in] PP_Resource tcp_server_socket, + [out] PP_Resource tcp_socket, + [in] PP_CompletionCallback callback); + + /** + * Returns the current address to which the socket is bound, in the + * buffer pointed to by |addr|. This method can be called only after + * successful Listen() call and before StopListening() call. + */ + [version=0.2] + int32_t GetLocalAddress([in] PP_Resource tcp_server_socket, + [out] PP_NetAddress_Private addr); + + /** + * Cancels all pending callbacks reporting PP_ERROR_ABORTED and + * closes the socket. Note: this method is implicitly called when + * server socket is destroyed. + */ + void StopListening([in] PP_Resource tcp_server_socket); +}; diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_tcp_socket_private.idl b/browser/extensions/mortar/ppapi/api/private/ppb_tcp_socket_private.idl new file mode 100644 index 000000000000..b9913bccfe84 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_tcp_socket_private.idl @@ -0,0 +1,162 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_TCPSocket_Private interface. + */ + +label Chrome { + M17 = 0.3, + M20 = 0.4, + M27 = 0.5 +}; + +[assert_size(4)] +enum PP_TCPSocketOption_Private { + // Special value used for testing. Guaranteed to fail SetOption(). + PP_TCPSOCKETOPTION_PRIVATE_INVALID = 0, + + // Disable coalescing of small writes to make TCP segments, and instead + // deliver data immediately. For SSL sockets, this option must be set before + // SSLHandshake() is called. Value type is PP_VARTYPE_BOOL. + PP_TCPSOCKETOPTION_PRIVATE_NO_DELAY = 1 +}; + +/** + * The PPB_TCPSocket_Private interface provides TCP socket + * operations. + */ +interface PPB_TCPSocket_Private { + /** + * Allocates a TCP socket resource. + */ + PP_Resource Create([in] PP_Instance instance); + + /** + * Determines if a given resource is TCP socket. + */ + PP_Bool IsTCPSocket([in] PP_Resource resource); + + /** + * Connects to a TCP port given as a host-port pair. + * When a proxy server is used, |host| and |port| refer to the proxy server + * instead of the destination server. + */ + int32_t Connect([in] PP_Resource tcp_socket, + [in] str_t host, + [in] uint16_t port, + [in] PP_CompletionCallback callback); + + /** + * Same as Connect(), but connecting to the address given by |addr|. A typical + * use-case would be for reconnections. + */ + int32_t ConnectWithNetAddress([in] PP_Resource tcp_socket, + [in] PP_NetAddress_Private addr, + [in] PP_CompletionCallback callback); + + /** + * Gets the local address of the socket, if it has been connected. + * Returns PP_TRUE on success. + */ + PP_Bool GetLocalAddress([in] PP_Resource tcp_socket, + [out] PP_NetAddress_Private local_addr); + + /** + * Gets the remote address of the socket, if it has been connected. + * Returns PP_TRUE on success. + */ + PP_Bool GetRemoteAddress([in] PP_Resource tcp_socket, + [out] PP_NetAddress_Private remote_addr); + + /** + * Does SSL handshake and moves to sending and receiving encrypted data. The + * socket must have been successfully connected. |server_name| will be + * compared with the name(s) in the server's certificate during the SSL + * handshake. |server_port| is only used to identify an SSL server in the SSL + * session cache. + * When a proxy server is used, |server_name| and |server_port| refer to the + * destination server. + * If the socket is not connected, or there are pending read/write requests, + * SSLHandshake() will fail without starting a handshake. Otherwise, any + * failure during the handshake process will cause the socket to be + * disconnected. + */ + int32_t SSLHandshake([in] PP_Resource tcp_socket, + [in] str_t server_name, + [in] uint16_t server_port, + [in] PP_CompletionCallback callback); + + /** + * Returns the server's PPB_X509Certificate_Private for a socket + * connection if an SSL connection has been established using + * SSLHandshake. If no SSL connection has been established, a + * null resource is returned. + */ + [version=0.4] + PP_Resource GetServerCertificate([in] PP_Resource tcp_socket); + + /** + * NOTE: This function is not implemented and will return + * PP_FALSE. + * Adds a trusted/untrusted chain building certificate to be used for this + * connection. The certificate must be a + * PPB_X509Certificate_Private. PP_TRUE is returned + * upon success. + */ + [version=0.4] + PP_Bool AddChainBuildingCertificate([in] PP_Resource tcp_socket, + [in] PP_Resource certificate, + [in] PP_Bool is_trusted); + + /** + * Reads data from the socket. The size of |buffer| must be at least as large + * as |bytes_to_read|. May perform a partial read. Returns the number of bytes + * read or an error code. If the return value is 0, then it indicates that + * end-of-file was reached. + * This method won't return more than 1 megabyte, so if |bytes_to_read| + * exceeds 1 megabyte, it will always perform a partial read. + * Multiple outstanding read requests are not supported. + */ + int32_t Read([in] PP_Resource tcp_socket, + [out] str_t buffer, + [in] int32_t bytes_to_read, + [in] PP_CompletionCallback callback); + + /** + * Writes data to the socket. May perform a partial write. Returns the number + * of bytes written or an error code. + * This method won't write more than 1 megabyte, so if |bytes_to_write| + * exceeds 1 megabyte, it will always perform a partial write. + * Multiple outstanding write requests are not supported. + */ + int32_t Write([in] PP_Resource tcp_socket, + [in] str_t buffer, + [in] int32_t bytes_to_write, + [in] PP_CompletionCallback callback); + + /** + * Cancels any IO that may be pending, and disconnects the socket. Any pending + * callbacks will still run, reporting PP_Error_Aborted if pending IO was + * interrupted. It is NOT valid to call Connect() again after a call to this + * method. Note: If the socket is destroyed when it is still connected, then + * it will be implicitly disconnected, so you are not required to call this + * method. + */ + void Disconnect([in] PP_Resource tcp_socket); + + /** + * Sets an option on |tcp_socket|. Supported |name| and |value| parameters + * are as described for PP_TCPSocketOption_Private. |callback| will be + * invoked with PP_OK if setting the option succeeds, or an error code + * otherwise. The socket must be connection before SetOption is called. + */ + [version=0.5] + int32_t SetOption([in] PP_Resource tcp_socket, + [in] PP_TCPSocketOption_Private name, + [in] PP_Var value, + [in] PP_CompletionCallback callback); + +}; diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_testing_private.idl b/browser/extensions/mortar/ppapi/api/private/ppb_testing_private.idl new file mode 100644 index 000000000000..c2aed4176150 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_testing_private.idl @@ -0,0 +1,153 @@ +/* Copyright 2013 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file contains interface functions used for unit testing. Do not use in + * production code. They are not guaranteed to be available in normal plugin + * environments so you should not depend on them. + */ + +label Chrome { + M33 = 1.0 +}; + +interface PPB_Testing_Private { + /** + * Reads the bitmap data out of the backing store for the given + * DeviceContext2D and into the given image. If the data was successfully + * read, it will return PP_TRUE. + * + * This function should not generally be necessary for normal plugin + * operation. If you want to update portions of a device, the expectation is + * that you will either regenerate the data, or maintain a backing store + * pushing updates to the device from your backing store via PaintImageData. + * Using this function will introduce an extra copy which will make your + * plugin slower. In some cases, this may be a very expensive operation (it + * may require slow cross-process transitions or graphics card readbacks). + * + * Data will be read into the image starting at |top_left| in the device + * context, and proceeding down and to the right for as many pixels as the + * image is large. If any part of the image bound would fall outside of the + * backing store of the device if positioned at |top_left|, this function + * will fail and return PP_FALSE. + * + * The image format must be of the format + * PPB_ImageData.GetNativeImageDataFormat() or this function will fail and + * return PP_FALSE. + * + * The returned image data will represent the current status of the backing + * store. This will not include any paint, scroll, or replace operations + * that have not yet been flushed; these operations are only reflected in + * the backing store (and hence ReadImageData) until after a Flush() + * operation has completed. + */ + PP_Bool ReadImageData([in] PP_Resource device_context_2d, + [in] PP_Resource image, + [in] PP_Point top_left); + + /** + * Runs a nested message loop. The plugin will be reentered from this call. + * This function is used for unit testing the API. The normal pattern is to + * issue some asynchronous call that has a callback. Then you call + * RunMessageLoop which will suspend the plugin and go back to processing + * messages, giving the asynchronous operation time to complete. In your + * callback, you save the data and call QuitMessageLoop, which will then + * pop back up and continue with the test. This avoids having to write a + * complicated state machine for simple tests for asynchronous APIs. + */ + void RunMessageLoop([in] PP_Instance instance); + + /** + * Posts a quit message for the outermost nested message loop. Use this to + * exit and return back to the caller after you call RunMessageLoop. + */ + void QuitMessageLoop([in] PP_Instance instance); + + /** + * Returns the number of live objects (resources + strings + objects) + * associated with this plugin instance. Used for detecting leaks. Returns + * (uint32_t)-1 on failure. + */ + uint32_t GetLiveObjectsForInstance([in] PP_Instance instance); + + /** + * Returns PP_TRUE if the plugin is running out-of-process, PP_FALSE + * otherwise. + */ + PP_Bool IsOutOfProcess(); + + /** + * Posts the plugin's current Power Saver status to JavaScript. The plugin + * itself does not recieve anything. This is not idiomatic for Pepper, + * but convenient for testing. + */ + void PostPowerSaverStatus([in] PP_Instance instance); + + /** + * Subscribes to changes to the plugin's Power Saver status. The status + * changes are not forwarded to the plugin itself, but posted to JavaScript. + * This is not idiomatic for Pepper, but conveienent for testing. + */ + void SubscribeToPowerSaverNotifications([in] PP_Instance instance); + + /** + * Passes the input event to the browser, which sends it back to the + * plugin. The plugin should implement PPP_InputEvent and register for + * the input event type. + * + * This method sends an input event through the browser just as if it had + * come from the user. If the browser determines that it is an event for the + * plugin, it will be sent to be handled by the plugin's PPP_InputEvent + * interface. When generating mouse events, make sure the position is within + * the plugin's area on the page. When generating a keyboard event, make sure + * the plugin is focused. + * + * Note that the browser may generate extra input events in order to + * maintain certain invariants, such as always having a "mouse enter" event + * before any other mouse event. Furthermore, the event the plugin receives + * after sending a simulated event will be slightly different from the + * original event. The browser may change the timestamp, add modifiers, and + * slightly alter the mouse position, due to coordinate transforms it + * performs. + */ + void SimulateInputEvent([in] PP_Instance instance, + [in] PP_Resource input_event); + + /** + * Returns the URL for the document. This is a safe way to retrieve + * window.location.href. + * If the canonicalized URL is valid, the method will parse the URL + * and fill in the components structure. This pointer may be NULL + * to specify that no component information is necessary. + */ + PP_Var GetDocumentURL([in] PP_Instance instance, + [out] PP_URLComponents_Dev components); + + /** + * Fetches up to |array_size| active PP_Vars in the tracker. Returns the + * number of vars in the tracker. The active vars are written to |live_vars| + * contiguously starting at index 0. The vars are not in any particular order. + * If the number of live vars is greater than |array_size|, then an arbitrary + * subset of |array_size| vars is written to |live_vars|. The reference count + * of the returned PP_Vars will *not* be affected by this call. + */ + uint32_t GetLiveVars([size_as=array_size] PP_Var[] live_vars, + [in] uint32_t array_size); + + /** + * Sets the threshold size at which point we switch from transmitting + * array buffers in IPC messages to using shared memory. This is only used + * for testing purposes where we need to transmit small buffers using shmem + * (in order to have fast tests). Passing a value of 0 resets the threshold + * to its default. The threshold is in bytes. + */ + void SetMinimumArrayBufferSizeForShmem([in] PP_Instance instance, + [in] uint32_t threshold); + + /** + * Run the V8 garbage collector for tests. + */ + void RunV8GC([in] PP_Instance instance); +}; diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_udp_socket_private.idl b/browser/extensions/mortar/ppapi/api/private/ppb_udp_socket_private.idl new file mode 100644 index 000000000000..9888a548e995 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_udp_socket_private.idl @@ -0,0 +1,98 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_UDPSocket_Private interface. + */ + +label Chrome { + M17 = 0.2, + M19 = 0.3, + M23 = 0.4 +}; + +[assert_size(4)] +enum PP_UDPSocketFeature_Private { + // Allow the socket to share the local address to which socket will + // be bound with other processes. Value's type should be + // PP_VARTYPE_BOOL. + PP_UDPSOCKETFEATURE_PRIVATE_ADDRESS_REUSE = 0, + + // Allow sending and receiving packets sent to and from broadcast + // addresses. Value's type should be PP_VARTYPE_BOOL. + PP_UDPSOCKETFEATURE_PRIVATE_BROADCAST = 1, + + // Special value for counting the number of available + // features. Should not be passed to SetSocketFeature(). + PP_UDPSOCKETFEATURE_PRIVATE_COUNT = 2 +}; + +interface PPB_UDPSocket_Private { + /** + * Creates a UDP socket resource. + */ + PP_Resource Create([in] PP_Instance instance_id); + + /** + * Determines if a given resource is a UDP socket. + */ + PP_Bool IsUDPSocket([in] PP_Resource resource_id); + + /** + * Sets a socket feature to |udp_socket|. Should be called before + * Bind(). Possible values for |name|, |value| and |value|'s type + * are described in PP_UDPSocketFeature_Private description. If no + * error occurs, returns PP_OK. Otherwise, returns + * PP_ERROR_BADRESOURCE (if bad |udp_socket| provided), + * PP_ERROR_BADARGUMENT (if bad name/value/value's type provided) + * or PP_ERROR_FAILED in the case of internal errors. + */ + [version=0.4] + int32_t SetSocketFeature([in] PP_Resource udp_socket, + [in] PP_UDPSocketFeature_Private name, + [in] PP_Var value); + + /* Creates a socket and binds to the address given by |addr|. */ + int32_t Bind([in] PP_Resource udp_socket, + [in] PP_NetAddress_Private addr, + [in] PP_CompletionCallback callback); + + /* Returns the address that the socket has bound to. A successful + * call to Bind must be called first. Returns PP_FALSE if Bind + * fails, or if Close has been called. + */ + [version=0.3] + PP_Bool GetBoundAddress([in] PP_Resource udp_socket, + [out] PP_NetAddress_Private addr); + + /* Performs a non-blocking recvfrom call on socket. + * Bind must be called first. |callback| is invoked when recvfrom + * reads data. You must call GetRecvFromAddress to recover the + * address the data was retrieved from. + */ + int32_t RecvFrom([in] PP_Resource udp_socket, + [out] str_t buffer, + [in] int32_t num_bytes, + [in] PP_CompletionCallback callback); + + /* Upon successful completion of RecvFrom, the address that the data + * was received from is stored in |addr|. + */ + PP_Bool GetRecvFromAddress([in] PP_Resource udp_socket, + [out] PP_NetAddress_Private addr); + + /* Performs a non-blocking sendto call on the socket created and + * bound(has already called Bind). The callback |callback| is + * invoked when sendto completes. + */ + int32_t SendTo([in] PP_Resource udp_socket, + [in] str_t buffer, + [in] int32_t num_bytes, + [in] PP_NetAddress_Private addr, + [in] PP_CompletionCallback callback); + + /* Cancels all pending reads and writes, and closes the socket. */ + void Close([in] PP_Resource udp_socket); +}; diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_uma_private.idl b/browser/extensions/mortar/ppapi/api/private/ppb_uma_private.idl new file mode 100644 index 000000000000..2d9b950fbba3 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_uma_private.idl @@ -0,0 +1,67 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_UMA_Private interface. + */ + +[generate_thunk,thunk_include="ppapi/thunk/ppb_uma_singleton_api.h"] + +label Chrome { + M35 = 0.3 +}; + +/** + * Contains functions for plugins to report UMA usage stats. + */ +interface PPB_UMA_Private { + /** + * HistogramCustomTimes is a pointer to a function which records a time + * sample given in milliseconds in the histogram given by |name|, possibly + * creating the histogram if it does not exist. + */ + [singleton,api=PPB_UMA_Singleton_API] + void HistogramCustomTimes([in] PP_Instance instance, + [in] PP_Var name, + [in] int64_t sample, + [in] int64_t min, + [in] int64_t max, + [in] uint32_t bucket_count); + + /** + * HistogramCustomCounts is a pointer to a function which records a sample + * in the histogram given by |name|, possibly creating the histogram if it + * does not exist. + */ + [singleton,api=PPB_UMA_Singleton_API] + void HistogramCustomCounts([in] PP_Instance instance, + [in] PP_Var name, + [in] int32_t sample, + [in] int32_t min, + [in] int32_t max, + [in] uint32_t bucket_count); + + /** + * HistogramEnumeration is a pointer to a function which records a sample + * in the histogram given by |name|, possibly creating the histogram if it + * does not exist. The sample represents a value in an enumeration bounded + * by |boundary_value|, that is, sample < boundary_value always. + */ + [singleton,api=PPB_UMA_Singleton_API] + void HistogramEnumeration([in] PP_Instance instance, + [in] PP_Var name, + [in] int32_t sample, + [in] int32_t boundary_value); + + /** + * IsCrashReportingEnabled returns PP_OK to the completion callback to + * indicate that the current user has opted-in to crash reporting, or + * PP_ERROR_* on failure or when a user has not opted-in. This can be used to + * gate other reporting processes such as analytics and crash reporting. + */ + [singleton,api=PPB_UMA_Singleton_API] + int32_t IsCrashReportingEnabled([in] PP_Instance instance, + [in] PP_CompletionCallback callback); +}; diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_video_destination_private.idl b/browser/extensions/mortar/ppapi/api/private/ppb_video_destination_private.idl new file mode 100644 index 000000000000..a37cbd56ac87 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_video_destination_private.idl @@ -0,0 +1,95 @@ +/* Copyright (c) 2013 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_VideoDestination_Private interface + * for a video destination resource, which sends video frames to a MediaStream + * video track in the browser. + */ + + label Chrome { + M28 = 0.1 + }; + +/** + * The PPB_VideoDestination_Private interface contains pointers to + * several functions for creating video destination resources and using them to + * send video frames to a MediaStream video track in the browser. + */ +interface PPB_VideoDestination_Private { + /** + * Creates a video destination resource. + * + * @param[in] instance A PP_Instance identifying an instance of + * a module. + * + * @return A PP_Resource with a nonzero ID on success or zero on + * failure. Failure means the instance was invalid. + */ + PP_Resource Create([in] PP_Instance instance); + + /** + * Determines if a resource is a video destination resource. + * + * @param[in] resource The PP_Resource to test. + * + * @return A PP_Bool with PP_TRUE if the given + * resource is a video destination resource or PP_FALSE + * otherwise. + */ + PP_Bool IsVideoDestination([in] PP_Resource resource); + + /** + * Opens a video destination for putting frames. + * + * @param[in] destination A PP_Resource corresponding to a video + * destination resource. + * @param[in] stream_url A PP_Var string holding a URL + * identifying a MediaStream. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Open(). + * + * @return An int32_t containing a result code from pp_errors.h. + * Returns PP_ERROR_BADRESOURCE if destination isn't a valid video + * destination. + * Returns PP_ERROR_INPROGRESS if destination is already open. + * Returns PP_ERROR_FAILED if the MediaStream doesn't exist or if there is + * some other browser error. + */ + int32_t Open([in] PP_Resource destination, + [in] PP_Var stream_url, + [in] PP_CompletionCallback callback); + + /** + * Puts a frame to the video destination. + * + * After this call, you should take care to release your references to the + * image embedded in the video frame. If you paint to the image after + * PutFame(), there is the possibility of artifacts because the browser may + * still be copying the frame to the stream. + * + * @param[in] destination A PP_Resource corresponding to a video + * destination resource. + * @param[in] frame A PP_VideoFrame_Private holding the video + * frame to send to the destination. + * + * @return An int32_t containing a result code from pp_errors.h. + * Returns PP_ERROR_BADRESOURCE if destination isn't a valid video + * destination. + * Returns PP_ERROR_FAILED if destination is not open, if the video frame has + * an invalid image data resource, or if some other browser error occurs. + */ + int32_t PutFrame([in] PP_Resource destination, + [in] PP_VideoFrame_Private frame); + + /** + * Closes the video destination. + * + * @param[in] destination A PP_Resource corresponding to a video + * destination. + */ + void Close([in] PP_Resource destination); +}; + diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_video_source_private.idl b/browser/extensions/mortar/ppapi/api/private/ppb_video_source_private.idl new file mode 100644 index 000000000000..e57eedd08102 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_video_source_private.idl @@ -0,0 +1,93 @@ +/* Copyright (c) 2013 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_VideoSource_Private interface for a + * video source resource, which receives video frames from a MediaStream video + * track in the browser. + */ + + label Chrome { + M28 = 0.1 + }; + +/** + * The PPB_VideoSource_Private interface contains pointers to + * several functions for creating video source resources and using them to + * receive video frames from a MediaStream video track in the browser. + */ +interface PPB_VideoSource_Private { + /** + * Creates a video source resource. + * + * @param[in] instance A PP_Instance identifying an instance of + * a module. + * + * @return A PP_Resource with a nonzero ID on success or zero on + * failure. Failure means the instance was invalid. + */ + PP_Resource Create([in] PP_Instance instance); + + /** + * Determines if a resource is a video source resource. + * + * @param[in] resource The PP_Resource to test. + * + * @return A PP_Bool with PP_TRUE if the given + * resource is a video source resource or PP_FALSE otherwise. + */ + PP_Bool IsVideoSource([in] PP_Resource resource); + + /** + * Opens a video source for getting frames. + * + * @param[in] source A PP_Resource corresponding to a video + * source resource. + * @param[in] stream_url A PP_Var string holding a URL + * identifying a MediaStream. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Open(). + * + * @return An int32_t containing a result code from pp_errors.h. + * Returns PP_ERROR_BADRESOURCE if source isn't a valid video source. + * Returns PP_ERROR_INPROGRESS if source is already open. + * Returns PP_ERROR_FAILED if the MediaStream doesn't exist or if there is + * some other browser error. + */ + int32_t Open([in] PP_Resource source, + [in] PP_Var stream_url, + [in] PP_CompletionCallback callback); + + /** + * Gets a frame from the video source. The returned image data is only valid + * until the next call to GetFrame. + * The image data resource inside the returned frame will have its reference + * count incremented by one and must be managed by the plugin. + * + * @param[in] source A PP_Resource corresponding to a video + * source resource. + * @param[out] frame A PP_VideoFrame_Private to hold a video + * frame from the source. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of GetNextFrame(). + * + * @return An int32_t containing a result code from pp_errors.h. + * Returns PP_ERROR_BADRESOURCE if source isn't a valid video source. + * Returns PP_ERROR_FAILED if the source is not open, or if some other + * browser error occurs. + */ + int32_t GetFrame([in] PP_Resource source, + [out] PP_VideoFrame_Private frame, + [in] PP_CompletionCallback callback); + + /** + * Closes the video source. + * + * @param[in] source A PP_Resource corresponding to a video + * source resource. + */ + void Close([in] PP_Resource source); +}; + diff --git a/browser/extensions/mortar/ppapi/api/private/ppb_x509_certificate_private.idl b/browser/extensions/mortar/ppapi/api/private/ppb_x509_certificate_private.idl new file mode 100644 index 000000000000..c58403e4d744 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppb_x509_certificate_private.idl @@ -0,0 +1,173 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_X509Certificate_Private interface for + * an X509 certificate. + */ + +label Chrome { + M19 = 0.1 +}; + +/** + * This enumeration corresponds to fields of an X509 certificate. Refer to + * PP_TRUE on success, PP_FALSE on failure. + */ + [version=1.2] + PP_Bool DeauthorizeContentLicenses([in] str_t plugin_data_path); + + /** + * Gets permission settings. callback will be called exactly once + * to return the settings. + * + * @param[in] plugin_data_path String containing the directory where the + * plugin settings are stored. + * @param[in] setting_type What type of setting to retrieve. + * @param[in] callback The callback to return retrieved data. + * @param[inout] user_data An opaque pointer that will be passed to + * callback. + */ + [version=1.2] + void GetPermissionSettings( + [in] str_t plugin_data_path, + [in] PP_Flash_BrowserOperations_SettingType setting_type, + [in] PPB_Flash_BrowserOperations_GetSettingsCallback callback, + [inout] mem_t user_data); + + /** + * Sets default permission. It applies to all sites except those with + * site-specific settings. + * + * @param[in] plugin_data_path String containing the directory where the + * plugin settings are stored. + * @param[in] setting_type What type of setting to set. + * @param[in] permission The default permission. + * @param[in] clear_site_specific Whether to remove all site-specific + * settings. + * + * @return PP_TRUE on success, PP_FALSE on failure. + */ + [version=1.2] + PP_Bool SetDefaultPermission( + [in] str_t plugin_data_path, + [in] PP_Flash_BrowserOperations_SettingType setting_type, + [in] PP_Flash_BrowserOperations_Permission permission, + [in] PP_Bool clear_site_specific); + + /** + * Sets site-specific permission. If a site has already got site-specific + * permission and it is not in sites, it won't be affected. + * + * @param[in] plugin_data_path String containing the directory where the + * plugin settings are stored. + * @param[in] setting_type What type of setting to set. + * @param[in] site_count How many items are there in sites. + * @param[in] sites The site-specific settings. If a site is specified with + * PP_FLASH_BROWSEROPERATIONS_PERMISSION_DEFAULT permission, it + * will be removed from the site-specific list. + * + * @return PP_TRUE on success, PP_FALSE on failure. + */ + [version=1.2] + PP_Bool SetSitePermission( + [in] str_t plugin_data_path, + [in] PP_Flash_BrowserOperations_SettingType setting_type, + [in] uint32_t site_count, + [in, size_is(site_count)] PP_Flash_BrowserOperations_SiteSetting[] sites); + + /** + * Returns a list of sites that have stored data, for use with the + * "Clear site data" feature. + * + * @param[in] plugin_data_path String containing the directory where the + * plugin data is stored. + * @param[out] sites A NULL-terminated array of sites that have stored data. + * Use FreeSiteList on the array when done. + * + * See also the NPP_GetSitesWithData function in NPAPI: + * https://wiki.mozilla.org/NPAPI:ClearSiteData + */ + [version=1.3] + void GetSitesWithData([in] str_t plugin_data_path, + [out] str_t[] sites); + + /** + * Frees the list of sites returned by GetSitesWithData. + * + * @param[in] sites A NULL-terminated array of strings. + */ + [version=1.3] + void FreeSiteList([inout] str_t[] sites); +}; diff --git a/browser/extensions/mortar/ppapi/api/private/ppp_instance_private.idl b/browser/extensions/mortar/ppapi/api/private/ppp_instance_private.idl new file mode 100644 index 000000000000..3756faf96f9e --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppp_instance_private.idl @@ -0,0 +1,37 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPP_InstancePrivate structure; a series of functions + * that a trusted plugin may implement to provide capabilities only available + * to trusted plugins. + */ +label Chrome { + M18 = 0.1 +}; + +/** + * The PPP_Instance_Private interface contains pointers to a series of + * functions that may be implemented in a trusted plugin to provide capabilities + * that aren't possible in untrusted modules. + */ + +interface PPP_Instance_Private { + /** + * GetInstanceObject returns a PP_Var representing the scriptable object for + * the given instance. Normally this will be a PPP_Class_Deprecated object + * that exposes methods and properties to JavaScript. + * + * On Failure, the returned PP_Var should be a "void" var. + * + * The returned PP_Var should have a reference added for the caller, which + * will be responsible for Release()ing that reference. + * + * @param[in] instance A PP_Instance identifying the instance from which the + * instance object is being requested. + * @return A PP_Var containing scriptable object. + */ + PP_Var GetInstanceObject([in] PP_Instance instance); +}; diff --git a/browser/extensions/mortar/ppapi/api/private/ppp_pexe_stream_handler.idl b/browser/extensions/mortar/ppapi/api/private/ppp_pexe_stream_handler.idl new file mode 100644 index 000000000000..b199b18a9f28 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/private/ppp_pexe_stream_handler.idl @@ -0,0 +1,46 @@ +/* Copyright 2014 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* This file contains NaCl private interfaces. This interface is not versioned + * and is for internal Chrome use. It may change without notice. */ + +#inline c +#include "ppapi/c/private/pp_file_handle.h" +#endinl + +label Chrome { + M25 = 1.0 +}; + +interface PPP_PexeStreamHandler { + /** + * Invoked as a result of a cache hit for a translated pexe. + */ + void DidCacheHit([inout] mem_t user_data, + [in] PP_FileHandle nexe_file_handle); + + /** + * Invoked as a result of a cache miss for a translated pexe. + * Provides the expected length of the pexe, as read from HTTP headers. + */ + void DidCacheMiss([inout] mem_t user_data, + [in] int64_t expected_total_length, + [in] PP_FileHandle temp_nexe_file); + + /** + * Invoked when a block of data has been downloaded. + * Only invoked after DidCacheMiss(). + */ + void DidStreamData([inout] mem_t user_data, + [in] mem_t data, + [in] int32_t length); + + /** + * Invoked when the stream has finished downloading, regardless of whether it + * succeeded. Not invoked if DidCacheHit() was called. + */ + void DidFinishStream([inout] mem_t user_data, + [in] int32_t pp_error); +}; diff --git a/browser/extensions/mortar/ppapi/api/trusted/ppb_broker_trusted.idl b/browser/extensions/mortar/ppapi/api/trusted/ppb_broker_trusted.idl new file mode 100644 index 000000000000..023d9fcff075 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/trusted/ppb_broker_trusted.idl @@ -0,0 +1,77 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_BrokerTrusted interface, which provides + * access to a trusted broker with greater privileges than the plugin. + */ + +label Chrome { + M14 = 0.2, + M25 = 0.3 +}; + +/** + * The PPB_BrokerTrusted interface provides access to a trusted broker + * with greater privileges than the plugin. The interface only supports + * out-of-process plugins and is to be used by proxy implementations. All + * functions should be called from the main thread only. + * + * A PPB_BrokerTrusted resource represents a connection to the broker. Its + * lifetime controls the lifetime of the broker, regardless of whether the + * handle is closed. The handle should be closed before the resource is + * released. + */ +[macro="PPB_BROKER_TRUSTED_INTERFACE"] +interface PPB_BrokerTrusted { + /** + * Returns a trusted broker resource. + */ + PP_Resource CreateTrusted([in] PP_Instance instance); + + /** + * Returns true if the resource is a trusted broker. + */ + PP_Bool IsBrokerTrusted([in] PP_Resource resource); + + /** + * Connects to the trusted broker. It may have already + * been launched by another instance. + * The plugin takes ownership of the handle once the callback has been called + * with a result of PP_OK. The plugin should immediately call GetHandle and + * begin managing it. If the result is not PP_OK, the browser still owns the + * handle. + * + * Returns PP_ERROR_WOULD_BLOCK on success, and invokes + * the |connect_callback| asynchronously to complete. + * As this function should always be invoked from the main thread, + * do not use the blocking variant of PP_CompletionCallback. + * Returns PP_ERROR_FAILED if called from an in-process plugin. + */ + int32_t Connect([in] PP_Resource broker, + [in] PP_CompletionCallback connect_callback); + + /** + * Gets the handle to the pipe. Use once Connect has completed. Each instance + * of this interface has its own pipe. + * + * Returns PP_OK on success, and places the result into the given output + * parameter. The handle is only set when returning PP_OK. Calling this + * before connect has completed will return PP_ERROR_FAILED. + */ + int32_t GetHandle([in] PP_Resource broker, [out] int32_t handle); + + /** + * Returns PP_TRUE if the plugin has permission to launch the broker. A user + * must explicitly grant permission to launch the broker for a particular + * website. This is done through an infobar that is displayed when |Connect| + * is called. This function returns PP_TRUE if the user has already granted + * permission to launch the broker for the website containing this plugin + * instance. Returns PP_FALSE otherwise. + */ + [version=0.3] + PP_Bool IsAllowed([in] PP_Resource broker); +}; + diff --git a/browser/extensions/mortar/ppapi/api/trusted/ppb_browser_font_trusted.idl b/browser/extensions/mortar/ppapi/api/trusted/ppb_browser_font_trusted.idl new file mode 100644 index 000000000000..7a79417efce0 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/trusted/ppb_browser_font_trusted.idl @@ -0,0 +1,261 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_BrowserFont_Trusted interface. + */ +label Chrome { + M19 = 1.0 +}; + +[assert_size(4)] +enum PP_BrowserFont_Trusted_Family { + /** + * Uses the user's default web page font (normally either the default serif + * or sans serif font). + */ + PP_BROWSERFONT_TRUSTED_FAMILY_DEFAULT = 0, + + /** + * These families will use the default web page font corresponding to the + * given family. + */ + PP_BROWSERFONT_TRUSTED_FAMILY_SERIF = 1, + PP_BROWSERFONT_TRUSTED_FAMILY_SANSSERIF = 2, + PP_BROWSERFONT_TRUSTED_FAMILY_MONOSPACE = 3 +}; + +/** + * Specifies the font weight. Normally users will only use NORMAL or BOLD. + */ +[assert_size(4)] +enum PP_BrowserFont_Trusted_Weight { + PP_BROWSERFONT_TRUSTED_WEIGHT_100 = 0, + PP_BROWSERFONT_TRUSTED_WEIGHT_200 = 1, + PP_BROWSERFONT_TRUSTED_WEIGHT_300 = 2, + PP_BROWSERFONT_TRUSTED_WEIGHT_400 = 3, + PP_BROWSERFONT_TRUSTED_WEIGHT_500 = 4, + PP_BROWSERFONT_TRUSTED_WEIGHT_600 = 5, + PP_BROWSERFONT_TRUSTED_WEIGHT_700 = 6, + PP_BROWSERFONT_TRUSTED_WEIGHT_800 = 7, + PP_BROWSERFONT_TRUSTED_WEIGHT_900 = 8, + PP_BROWSERFONT_TRUSTED_WEIGHT_NORMAL = + PP_BROWSERFONT_TRUSTED_WEIGHT_400, + PP_BROWSERFONT_TRUSTED_WEIGHT_BOLD = + PP_BROWSERFONT_TRUSTED_WEIGHT_700 +}; + +[assert_size(48)] +struct PP_BrowserFont_Trusted_Description { + /** + * Font face name as a string. This can also be an undefined var, in which + * case the generic family will be obeyed. If the face is not available on + * the system, the browser will attempt to do font fallback or pick a default + * font. + */ + PP_Var face; + + /** + * When Create()ing a font and the face is an undefined var, the family + * specifies the generic font family type to use. If the face is specified, + * this will be ignored. + * + * When Describe()ing a font, the family will be the value you passed in when + * the font was created. In other words, if you specify a face name, the + * family will not be updated to reflect whether the font name you requested + * is serif or sans serif. + */ + PP_BrowserFont_Trusted_Family family; + + /** + * Size in pixels. + * + * You can specify 0 to get the default font size. The default font size + * may vary depending on the requested font. The typical example is that + * the user may have a different font size for the default monospace font to + * give it a similar optical size to the proportionally spaced fonts. + */ + uint32_t size; + + /** + * Normally you will use either normal or bold. + */ + PP_BrowserFont_Trusted_Weight weight; + + PP_Bool italic; + PP_Bool small_caps; + + /** + * Adjustment to apply to letter and word spacing, respectively. Initialize + * to 0 to get normal spacing. Negative values bring letters/words closer + * together, positive values separate them. + */ + int32_t letter_spacing; + int32_t word_spacing; + + /** + * Ensure that this struct is 48-bytes wide by padding the end. In some + * compilers, PP_Var is 8-byte aligned, so those compilers align this struct + * on 8-byte boundaries as well and pad it to 16 bytes even without this + * padding attribute. This padding makes its size consistent across + * compilers. + */ + int32_t padding; +}; + +[assert_size(20)] +struct PP_BrowserFont_Trusted_Metrics { + int32_t height; + int32_t ascent; + int32_t descent; + int32_t line_spacing; + int32_t x_height; +}; + +[assert_size(24)] +struct PP_BrowserFont_Trusted_TextRun { + /** + * This var must either be a string or a null/undefined var (which will be + * treated as a 0-length string). + */ + PP_Var text; + + /** + * Set to PP_TRUE if the text is right-to-left. + */ + PP_Bool rtl; + + /** + * Set to PP_TRUE to force the directionality of the text regardless of + * content + */ + PP_Bool override_direction; +}; + +/** + * Provides an interface for native browser text rendering. + * + * This API is "trusted" not for security reasons, but because it can not be + * implemented efficiently when running out-of-process in Browser Client. In + * this case, WebKit is in another process and every text call would require a + * synchronous IPC to the renderer. It is, however, available to native + * (non-NaCl) out-of-process PPAPI plugins since WebKit is available in the + * plugin process. + */ +interface PPB_BrowserFont_Trusted { + /** + * Returns a list of all available font families on the system. You can use + * this list to decide whether to Create() a font. + * + * The return value will be a single string with null characters delimiting + * the end of each font name. For example: "Arial\0Courier\0Times\0". + * + * Returns an undefined var on failure (this typically means you passed an + * invalid instance). + */ + PP_Var GetFontFamilies( + [in] PP_Instance instance); + + /** + * Returns a font which best matches the given description. The return value + * will have a non-zero ID on success, or zero on failure. + */ + PP_Resource Create( + [in] PP_Instance instance, + [in] PP_BrowserFont_Trusted_Description description); + + /** + * Returns PP_TRUE if the given resource is a Font. Returns PP_FALSE if the + * resource is invalid or some type other than a Font. + */ + PP_Bool IsFont( + [in] PP_Resource resource); + + /** + * Loads the description and metrics of the font into the given structures. + * The description will be different than the description the font was + * created with since it will be filled with the real values from the font + * that was actually selected. + * + * The PP_Var in the description should be of type Void on input. On output, + * this will contain the string and will have a reference count of 1. The + * plugin is responsible for calling Release on this var. + * + * Returns PP_TRUE on success, PP_FALSE if the font is invalid or if the Var + * in the description isn't Null (to prevent leaks). + */ + PP_Bool Describe( + [in] PP_Resource font, + [out] PP_BrowserFont_Trusted_Description description, + [out] PP_BrowserFont_Trusted_Metrics metrics); + + /** + * Draws the text to the image buffer. + * + * The given point represents the baseline of the left edge of the font, + * regardless of whether it is left-to-right or right-to-left (in the case of + * RTL text, this will actually represent the logical end of the text). + * + * The clip is optional and may be NULL. In this case, the text will be + * clipped to the image. + * + * The image_data_is_opaque flag indicates whether subpixel antialiasing can + * be performed, if it is supported. When the image below the text is + * opaque, subpixel antialiasing is supported and you should set this to + * PP_TRUE to pick up the user's default preferences. If your plugin is + * partially transparent, then subpixel antialiasing is not possible and + * grayscale antialiasing will be used instead (assuming the user has + * antialiasing enabled at all). + */ + PP_Bool DrawTextAt( + [in] PP_Resource font, + [in] PP_Resource image_data, + [in] PP_BrowserFont_Trusted_TextRun text, + [in] PP_Point position, + [in] uint32_t color, + [in] PP_Rect clip, + [in] PP_Bool image_data_is_opaque); + + /** + * Returns the width of the given string. If the font is invalid or the var + * isn't a valid string, this will return -1. + * + * Note that this function handles complex scripts such as Arabic, combining + * accents, etc. so that adding the width of substrings won't necessarily + * produce the correct width of the entire string. + * + * Returns -1 on failure. + */ + int32_t MeasureText( + [in] PP_Resource font, + [in] PP_BrowserFont_Trusted_TextRun text); + + /** + * Returns the character at the given pixel X position from the beginning of + * the string. This handles complex scripts such as Arabic, where characters + * may be combined or replaced depending on the context. Returns (uint32)-1 + * on failure. + * + * TODO(brettw) this function may be broken. See the CharPosRTL test. It + * seems to tell you "insertion point" rather than painting position. This + * is useful but maybe not what we intended here. + */ + uint32_t CharacterOffsetForPixel( + [in] PP_Resource font, + [in] PP_BrowserFont_Trusted_TextRun text, + [in] int32_t pixel_position); + + /** + * Returns the horizontal advance to the given character if the string was + * placed at the given position. This handles complex scripts such as Arabic, + * where characters may be combined or replaced depending on context. Returns + * -1 on error. + */ + int32_t PixelOffsetForCharacter( + [in] PP_Resource font, + [in] PP_BrowserFont_Trusted_TextRun text, + [in] uint32_t char_offset); +}; + diff --git a/browser/extensions/mortar/ppapi/api/trusted/ppb_char_set_trusted.idl b/browser/extensions/mortar/ppapi/api/trusted/ppb_char_set_trusted.idl new file mode 100644 index 000000000000..61bd8d500d83 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/trusted/ppb_char_set_trusted.idl @@ -0,0 +1,95 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* + * This file defines the PPB_CharSet_Trusted interface. + */ + +label Chrome { + M18 = 1.0 +}; + +[assert_size(4)] enum PP_CharSet_Trusted_ConversionError { + /** + * Causes the entire conversion to fail if an error is encountered. The + * conversion function will return NULL. + */ + PP_CHARSET_TRUSTED_CONVERSIONERROR_FAIL, + + /** + * Silently skips over errors. Unrepresentable characters and input encoding + * errors will be removed from the output. + */ + PP_CHARSET_TRUSTED_CONVERSIONERROR_SKIP, + + /** + * Replaces the error or unrepresentable character with a substitution + * character. When converting to a Unicode character set (UTF-8 or UTF-16) it + * will use the unicode "substitution character" U+FFFD. When converting to + * another character set, the character will be charset-specific. For many + * languages this will be the representation of the '?' character. + */ + PP_CHARSET_TRUSTED_CONVERSIONERROR_SUBSTITUTE +}; + +/** + * The PPB_CharSet_Trusted interface provides functions for + * converting between character sets. + * + * This inteface is provided for trusted plugins only since in Native Client it + * would require an expensive out-of-process IPC call for each conversion, + * which makes performance unacceptable. Native Client plugins should include + * ICU or some other library if they need this feature. + */ +interface PPB_CharSet_Trusted { + /** + * Converts the UTF-16 string pointed to by |*utf16| to an 8-bit string in + * the specified code page. |utf16_len| is measured in UTF-16 units, not + * bytes. This value may not be NULL. + * + * The given output buffer will be filled up to output_length bytes with the + * result. output_length will be updated with the number of bytes required + * for the given string. The output buffer may be null to just retrieve the + * required buffer length. + * + * This function will return PP_FALSE if there was an error converting the + * string and you requested PP_CHARSET_CONVERSIONERROR_FAIL, or the output + * character set was unknown. Otherwise, it will return PP_TRUE. + */ + PP_Bool UTF16ToCharSet([in, size_as=utf16_len] uint16_t[] utf16, + [in] uint32_t utf16_len, + [in] str_t output_char_set, + [in] PP_CharSet_Trusted_ConversionError on_error, + [out] str_t output_buffer, + [inout] uint32_t output_length); + + /** + * Same as UTF16ToCharSet except converts in the other direction. The input + * is in the given charset, and the |input_len| is the number of bytes in + * the |input| string. + * + * Note that the output_utf16_length is measured in UTF-16 characters. + * + * Since UTF16 can represent every Unicode character, the only time the + * replacement character will be used is if the encoding in the input string + * is incorrect. + */ + PP_Bool CharSetToUTF16([in] str_t input, + [in] uint32_t input_len, + [in] str_t input_char_set, + [in] PP_CharSet_Trusted_ConversionError on_error, + [out] uint16_t output_buffer, + [inout] uint32_t output_utf16_length); + + /** + * Returns a string var representing the current multi-byte character set of + * the current system. + * + * WARNING: You really shouldn't be using this function unless you're dealing + * with legacy data. You should be using UTF-8 or UTF-16 and you don't have + * to worry about the character sets. + */ + PP_Var GetDefaultCharSet([in] PP_Instance instance); +}; diff --git a/browser/extensions/mortar/ppapi/api/trusted/ppb_file_chooser_trusted.idl b/browser/extensions/mortar/ppapi/api/trusted/ppb_file_chooser_trusted.idl new file mode 100644 index 000000000000..0a0ae6bd98b7 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/trusted/ppb_file_chooser_trusted.idl @@ -0,0 +1,71 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + + +/** + * This file defines the PPB_FileChooser_Trusted interface. + */ + +[generate_thunk] + +label Chrome { + M16 = 0.5, + M20 = 0.6 +}; + +[macro="PPB_FILECHOOSER_TRUSTED_INTERFACE"] +interface PPB_FileChooserTrusted { + /** + * This function displays a previously created file chooser resource as a + * dialog box, prompting the user to choose a file or files to open, or a + * single file for saving. The callback is called with PP_OK on successful + * completion with a file (or files) selected or PP_ERROR_USERCANCEL if the + * user selected no file. + * + * @param[in] chooser The file chooser resource. + * @param[in] save_as A PP_Bool value indicating if this dialog + * is choosing a file for saving. + * @param[in] suggested_file_name If saving, the suggested name for the + * file, otherwise, null or undefined. + * @param[in] callback A CompletionCallback to be called after + * the user has closed the file chooser dialog. + * + * @return PP_OK_COMPLETIONPENDING if request to show the dialog was + * successful, another error code from pp_errors.h on failure. + */ + [deprecate=0.6] + int32_t ShowWithoutUserGesture( + [in] PP_Resource chooser, + [in] PP_Bool save_as, + [in] PP_Var suggested_file_name, + [in] PP_CompletionCallback callback); + + /** + * This function displays a previously created file chooser resource as a + * dialog box, prompting the user to choose a file or files to open, or a + * single file for saving. The callback is called with PP_OK on successful + * completion with a file (or files) selected or PP_ERROR_USERCANCEL if the + * user selected no file. + * + * @param[in] chooser The file chooser resource. + * @param[in] save_as A PP_Bool value indicating if this dialog + * is choosing a file for saving. + * @param[in] suggested_file_name If saving, the suggested name for the + * file, otherwise, null or undefined. + * @param[in] callback A CompletionCallback to be called after + * the user has closed the file chooser dialog. + * + * @return PP_OK_COMPLETIONPENDING if request to show the dialog was + * successful, another error code from pp_errors.h on failure. + */ + [version=0.6] + int32_t ShowWithoutUserGesture( + [in] PP_Resource chooser, + [in] PP_Bool save_as, + [in] PP_Var suggested_file_name, + [in] PP_ArrayOutput output, + [in] PP_CompletionCallback callback); +}; + diff --git a/browser/extensions/mortar/ppapi/api/trusted/ppb_url_loader_trusted.idl b/browser/extensions/mortar/ppapi/api/trusted/ppb_url_loader_trusted.idl new file mode 100644 index 000000000000..bb602910f490 --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/trusted/ppb_url_loader_trusted.idl @@ -0,0 +1,51 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* URL loader trusted interfaces. */ + +[generate_thunk] + +label Chrome { + M14 = 0.3 +}; + +/** + * Callback that indicates the status of the download and upload for the + * given URLLoader resource. + */ +typedef void PP_URLLoaderTrusted_StatusCallback( + [in] PP_Instance pp_instance, + [in] PP_Resource pp_resource, + [in] int64_t bytes_sent, + [in] int64_t total_bytes_to_be_sent, + [in] int64_t bytes_received, + [in] int64_t total_bytes_to_be_received); + +/* Available only to trusted implementations. */ +interface PPB_URLLoaderTrusted { + /** + * Grant this URLLoader the capability to make unrestricted cross-origin + * requests. + */ + void GrantUniversalAccess([in] PP_Resource loader); + + /** + * Registers that the given function will be called when the upload or + * downloaded byte count has changed. This is not exposed on the untrusted + * interface because it can be quite chatty and encourages people to write + * feedback UIs that update as frequently as the progress updates. + * + * The other serious gotcha with this callback is that the callback must not + * mutate the URL loader or cause it to be destroyed. + * + * However, the proxy layer needs this information to push to the other + * process, so we expose it here. Only one callback can be set per URL + * Loader. Setting to a NULL callback will disable it. + */ + void RegisterStatusCallback( + [in] PP_Resource loader, + [in] PP_URLLoaderTrusted_StatusCallback cb); +}; + diff --git a/browser/extensions/mortar/ppapi/api/trusted/ppp_broker.idl b/browser/extensions/mortar/ppapi/api/trusted/ppp_broker.idl new file mode 100644 index 000000000000..a9dc4fabad3e --- /dev/null +++ b/browser/extensions/mortar/ppapi/api/trusted/ppp_broker.idl @@ -0,0 +1,94 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines functions that your module must implement to support a + * broker. + */ + +#inline c +// {PENDING: undefine PP_EXPORT?} + +#include "ppapi/c/pp_instance.h" +#include "ppapi/c/pp_stdint.h" + + +#if __GNUC__ >= 4 + +#define PP_EXPORT __attribute__ ((visibility("default"))) +#elif defined(_MSC_VER) +#define PP_EXPORT __declspec(dllexport) +#endif + + + +/* We don't want name mangling for these external functions. We only need + * 'extern "C"' if we're compiling with a C++ compiler. + */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @addtogroup Typedefs + * @{ + */ + +/** + * PP_ConnectInstance_Func defines the signature that you implement to + * receive notifications when a plugin instance connects to the broker. + * The broker should listen on the socket before returning. + * + * @param[in] instance The plugin instance connecting to the broker. + * @param[in] handle Handle to a socket the broker can use to communicate with + * the plugin. + * @return PP_OK on success. Any other value on failure. + */ +typedef int32_t (*PP_ConnectInstance_Func)(PP_Instance instance, + int32_t handle); +/** + * @} + */ + +/** + * @addtogroup Functions + * @{ + */ + +/** + * PPP_InitializeBroker() is the entry point for a broker and is + * called by the browser when your module loads. Your code must implement this + * function. + * + * Failure indicates to the browser that this broker can not be used. In this + * case, the broker will be unloaded. + * + * @param[out] connect_instance_func A pointer to a connect instance function. + * @return PP_OK on success. Any other value on failure. +*/ +PP_EXPORT int32_t PPP_InitializeBroker( + PP_ConnectInstance_Func* connect_instance_func); +/** + * @} + */ + +/** + * @addtogroup Functions + * @{ + */ + +/** PPP_ShutdownBroker() is called before the broker is unloaded. + */ +PP_EXPORT void PPP_ShutdownBroker(); +/** + * @} + */ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endinl + diff --git a/browser/extensions/mortar/ppapi/c/pp_graphics_3d.h b/browser/extensions/mortar/ppapi/c/pp_graphics_3d.h new file mode 100644 index 000000000000..b5e6ddb9fd16 --- /dev/null +++ b/browser/extensions/mortar/ppapi/c/pp_graphics_3d.h @@ -0,0 +1,3 @@ +// This file is empty on purpose since it is included in +// ppapi/api/ppb_graphics_3d.idl. And we would like to keep the differences +// small with chromium's idl. diff --git a/browser/extensions/mortar/ppapi/c/pp_instance.h b/browser/extensions/mortar/ppapi/c/pp_instance.h new file mode 100644 index 000000000000..7e6fd1ec6b83 --- /dev/null +++ b/browser/extensions/mortar/ppapi/c/pp_instance.h @@ -0,0 +1,3 @@ +// This file is empty on purpose since it is included in +// ppapi/api/trusted/ppp_broker.idl. And we would like to keep the differences +// small with chromium's idl. diff --git a/browser/extensions/mortar/ppapi/c/pp_module.h b/browser/extensions/mortar/ppapi/c/pp_module.h new file mode 100644 index 000000000000..31874722e4f6 --- /dev/null +++ b/browser/extensions/mortar/ppapi/c/pp_module.h @@ -0,0 +1,2 @@ +// This file is empty on purpose since it is included in ppapi/api/ppp.idl. +// And we would like to keep the differences small with chromium's idl. diff --git a/browser/extensions/mortar/ppapi/c/pp_resource.h b/browser/extensions/mortar/ppapi/c/pp_resource.h new file mode 100644 index 000000000000..cbaa7bfde93e --- /dev/null +++ b/browser/extensions/mortar/ppapi/c/pp_resource.h @@ -0,0 +1,3 @@ +// This file is empty on purpose since it is included in +// ppapi/api/dev/ppb_opengles2ext_dev.idl and ppapi/api/ppb_opengles2.idl. +// And we would like to keep the differences small with chromium's idl. diff --git a/browser/extensions/mortar/ppapi/c/pp_stdint.h b/browser/extensions/mortar/ppapi/c/pp_stdint.h new file mode 100644 index 000000000000..6b8fd7467f16 --- /dev/null +++ b/browser/extensions/mortar/ppapi/c/pp_stdint.h @@ -0,0 +1,3 @@ +// This file is empty on purpose since it is included in ppapi/api/ppp.idl and +// ppapi/api/trusted/ppp_broker.idl. And we would like to keep the differences +// small with chromium's idl. diff --git a/browser/extensions/mortar/ppapi/c/ppb.h b/browser/extensions/mortar/ppapi/c/ppb.h new file mode 100644 index 000000000000..31874722e4f6 --- /dev/null +++ b/browser/extensions/mortar/ppapi/c/ppb.h @@ -0,0 +1,2 @@ +// This file is empty on purpose since it is included in ppapi/api/ppp.idl. +// And we would like to keep the differences small with chromium's idl. diff --git a/browser/extensions/mortar/ppapi/c/ppb_opengles2.h b/browser/extensions/mortar/ppapi/c/ppb_opengles2.h new file mode 100644 index 000000000000..065420f0ba68 --- /dev/null +++ b/browser/extensions/mortar/ppapi/c/ppb_opengles2.h @@ -0,0 +1,3 @@ +// This file is empty on purpose since it is included in +// ppapi/api/dev/ppb_opengles2ext_dev.idl. And we would like to keep the +// differences small with chromium's idl. diff --git a/browser/extensions/mortar/ppapi/c/private/pp_file_handle.h b/browser/extensions/mortar/ppapi/c/private/pp_file_handle.h new file mode 100644 index 000000000000..575c4a926a16 --- /dev/null +++ b/browser/extensions/mortar/ppapi/c/private/pp_file_handle.h @@ -0,0 +1,4 @@ +// This file is empty on purpose since it is included in +// ppapi/api/private/ppb_file_io_private.idl and +// ppapi/api/private/ppp_pexe_stream_handler.idl. And we would like to keep the +// differences small with chromium's idl. diff --git a/browser/extensions/mortar/ppapi/generators/OWNERS b/browser/extensions/mortar/ppapi/generators/OWNERS new file mode 100644 index 000000000000..c3be9543d989 --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/OWNERS @@ -0,0 +1,5 @@ +yzshen@chromium.org +noelallen@chromium.org +noelallen@google.com +sehr@google.com +sehr@chromium.org diff --git a/browser/extensions/mortar/ppapi/generators/generator.py b/browser/extensions/mortar/ppapi/generators/generator.py new file mode 100755 index 000000000000..a71893c792b5 --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/generator.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import os +import sys +import traceback + +# Note: some of these files are imported to register cmdline options. +from idl_generator import Generator +from idl_option import ParseOptions +from idl_outfile import IDLOutFile +from idl_parser import ParseFiles +from idl_c_header import HGen +from idl_thunk import TGen +from idl_gen_pnacl import PnaclGen + + +def Main(args): + # If no arguments are provided, assume we are trying to rebuild the + # C headers with warnings off. + try: + if not args: + args = [ + '--wnone', '--cgen', '--range=start,end', + '--pnacl', '--pnaclshim', + '../native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c', + '--tgen', + ] + current_dir = os.path.abspath(os.getcwd()) + script_dir = os.path.abspath(os.path.dirname(__file__)) + if current_dir != script_dir: + print '\nIncorrect CWD, default run skipped.' + print 'When running with no arguments set CWD to the scripts directory:' + print '\t' + script_dir + '\n' + print 'This ensures correct default paths and behavior.\n' + return 1 + + filenames = ParseOptions(args) + ast = ParseFiles(filenames) + if ast.errors: + print 'Found %d errors. Aborting build.\n' % ast.errors + return 1 + return Generator.Run(ast) + except SystemExit, ec: + print 'Exiting with %d' % ec.code + sys.exit(ec.code) + + except: + typeinfo, value, tb = sys.exc_info() + traceback.print_exception(typeinfo, value, tb) + print 'Called with: ' + ' '.join(sys.argv) + + +if __name__ == '__main__': + sys.exit(Main(sys.argv[1:])) diff --git a/browser/extensions/mortar/ppapi/generators/idl_ast.py b/browser/extensions/mortar/ppapi/generators/idl_ast.py new file mode 100644 index 000000000000..515dbb0c128d --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/idl_ast.py @@ -0,0 +1,182 @@ +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Nodes for PPAPI IDL AST.""" + +from idl_namespace import IDLNamespace +from idl_node import IDLNode +from idl_option import GetOption +from idl_visitor import IDLVisitor +from idl_release import IDLReleaseMap + +# +# IDLLabelResolver +# +# A specialized visitor which traverses the AST, building a mapping of +# Release names to Versions numbers and calculating a min version. +# The mapping is applied to the File nodes within the AST. +# +class IDLLabelResolver(IDLVisitor): + def Depart(self, node, ignore, childdata): + # Build list of Release=Version + if node.IsA('LabelItem'): + channel = node.GetProperty('channel') + if not channel: + channel = 'stable' + return (node.GetName(), node.GetProperty('VALUE'), channel) + + # On completion of the Label, apply to the parent File if the + # name of the label matches the generation label. + if node.IsA('Label') and node.GetName() == GetOption('label'): + try: + node.parent.release_map = IDLReleaseMap(childdata) + except Exception as err: + node.Error('Unable to build release map: %s' % str(err)) + + # For File objects, set the minimum version + if node.IsA('File'): + file_min, _ = node.release_map.GetReleaseRange() + node.SetMin(file_min) + + return None + + +# +# IDLNamespaceVersionResolver +# +# A specialized visitor which traverses the AST, building a namespace tree +# as it goes. The namespace tree is mapping from a name to a version list. +# Labels must already be resolved to use. +# +class IDLNamespaceVersionResolver(IDLVisitor): + NamespaceSet = set(['AST', 'Callspec', 'Interface', 'Member', 'Struct']) + # + # When we arrive at a node we must assign it a namespace and if the + # node is named, then place it in the appropriate namespace. + # + def Arrive(self, node, parent_namespace): + # If we are a File, grab the Min version and replease mapping + if node.IsA('File'): + self.rmin = node.GetMinMax()[0] + self.release_map = node.release_map + + # Set the min version on any non Label within the File + if not node.IsA('AST', 'File', 'Label', 'LabelItem'): + my_min, _ = node.GetMinMax() + if not my_min: + node.SetMin(self.rmin) + + # If this object is not a namespace aware object, use the parent's one + if node.cls not in self.NamespaceSet: + node.namespace = parent_namespace + else: + # otherwise create one. + node.namespace = IDLNamespace(parent_namespace) + + # If this node is named, place it in its parent's namespace + if parent_namespace and node.cls in IDLNode.NamedSet: + # Set version min and max based on properties + if self.release_map: + vmin = node.GetProperty('dev_version') + if vmin == None: + vmin = node.GetProperty('version') + vmax = node.GetProperty('deprecate') + # If no min is available, the use the parent File's min + if vmin == None: + rmin = self.rmin + else: + rmin = self.release_map.GetRelease(vmin) + rmax = self.release_map.GetRelease(vmax) + node.SetReleaseRange(rmin, rmax) + parent_namespace.AddNode(node) + + # Pass this namespace to each child in case they inherit it + return node.namespace + + +# +# IDLFileTypeRessolver +# +# A specialized visitor which traverses the AST and sets a FILE property +# on all file nodes. In addition, searches the namespace resolving all +# type references. The namespace tree must already have been populated +# before this visitor is used. +# +class IDLFileTypeResolver(IDLVisitor): + def VisitFilter(self, node, data): + return not node.IsA('Comment', 'Copyright') + + def Arrive(self, node, filenode): + # Track the file node to update errors + if node.IsA('File'): + node.SetProperty('FILE', node) + filenode = node + + if not node.IsA('AST'): + file_min, _ = filenode.release_map.GetReleaseRange() + if not file_min: + print 'Resetting min on %s to %s' % (node, file_min) + node.SetMinRange(file_min) + + # If this node has a TYPEREF, resolve it to a version list + typeref = node.GetPropertyLocal('TYPEREF') + if typeref: + node.typelist = node.parent.namespace.FindList(typeref) + if not node.typelist: + node.Error('Could not resolve %s.' % typeref) + else: + node.typelist = None + return filenode + +# +# IDLReleaseResolver +# +# A specialized visitor which will traverse the AST, and generate a mapping +# from any release to the first release in which that version of the object +# was generated. Types must already be resolved to use. +# +class IDLReleaseResolver(IDLVisitor): + def Arrive(self, node, releases): + node.BuildReleaseMap(releases) + return releases + + +# +# IDLAst +# +# A specialized version of the IDLNode for containing the whole of the +# AST. Construction of the AST object will cause resolution of the +# tree including versions, types, etc... Errors counts will be collected +# both per file, and on the AST itself. +# +class IDLAst(IDLNode): + def __init__(self, children): + IDLNode.__init__(self, 'AST', 'BuiltIn', 1, 0, children) + self.Resolve() + + def Resolve(self): + # Set the appropriate Release=Version mapping for each File + IDLLabelResolver().Visit(self, None) + + # Generate the Namesapce Tree + self.namespace = IDLNamespace(None) + IDLNamespaceVersionResolver().Visit(self, self.namespace) + + # Using the namespace, resolve type references + IDLFileTypeResolver().Visit(self, None) + + # Build an ordered list of all releases + releases = set() + for filenode in self.GetListOf('File'): + releases |= set(filenode.release_map.GetReleases()) + + # Generate a per node list of releases and release mapping + IDLReleaseResolver().Visit(self, sorted(releases)) + + for filenode in self.GetListOf('File'): + errors = filenode.GetProperty('ERRORS') + if errors: + self.errors += errors + + diff --git a/browser/extensions/mortar/ppapi/generators/idl_c_header.py b/browser/extensions/mortar/ppapi/generators/idl_c_header.py new file mode 100755 index 000000000000..b4b98227df4c --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/idl_c_header.py @@ -0,0 +1,374 @@ +#!/usr/bin/env python +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +""" Generator for C style prototypes and definitions """ + +import glob +import os +import re +import sys + +from idl_log import ErrOut, InfoOut, WarnOut +from idl_node import IDLAttribute, IDLNode +from idl_ast import IDLAst +from idl_option import GetOption, Option, ParseOptions +from idl_outfile import IDLOutFile +from idl_parser import ParseFiles +from idl_c_proto import CGen, GetNodeComments, CommentLines, Comment +from idl_generator import Generator, GeneratorByFile +from idl_visitor import IDLVisitor + +Option('dstroot', 'Base directory of output', default=os.path.join('..', 'c')) +Option('guard', 'Include guard prefix', default=os.path.join('ppapi', 'c')) + + +# +# PrototypeResolver +# +# A specialized visitor which traverses the AST, building a mapping of +# Release names to Versions numbers and calculating a min version. +# The mapping is applied to the File nodes within the AST. +# +class ProtoResolver(IDLVisitor): + def __init__(self): + IDLVisitor.__init__(self) + self.struct_map = {} + self.interface_map = {} + + def Arrive(self, node, ignore): + if node.IsA('Member') and node.GetProperty('ref'): + typeref = node.typelist.GetReleases()[0] + if typeref.IsA('Struct'): + nodelist = self.struct_map.get(typeref.GetName(), []) + nodelist.append(node) + self.struct_map[typeref.GetName()] = nodelist + + if node.IsA('Param'): + typeref = node.typelist.GetReleases()[0] + if typeref.IsA('Interface'): + nodelist = self.struct_map.get(typeref.GetName(), []) + nodelist.append(node) + self.interface_map[typeref.GetName()] = nodelist + + return None + + +def GetPathFromNode(filenode, relpath=None, ext=None): + path, name = os.path.split(filenode.GetProperty('NAME')) + if ext: name = os.path.splitext(name)[0] + ext + if path: name = os.path.join(path, name) + if relpath: name = os.path.join(relpath, name) + name = os.path.normpath(name) + return name + + +def GetHeaderFromNode(filenode, relpath=None): + return GetPathFromNode(filenode, relpath, ext='.h') + + +def WriteGroupMarker(out, node, last_group): + # If we are part of a group comment marker... + if last_group and last_group != node.cls: + pre = CommentLines(['*',' @}', '']) + '\n' + else: + pre = '\n' + + if node.cls in ['Typedef', 'Interface', 'Struct', 'Enum']: + if last_group != node.cls: + pre += CommentLines(['*',' @addtogroup %ss' % node.cls, ' @{', '']) + last_group = node.cls + else: + last_group = None + out.Write(pre) + return last_group + + +def GenerateHeader(out, filenode, releases): + cgen = CGen() + pref = '' + do_comments = True + + # Generate definitions. + last_group = None + top_types = ['Typedef', 'Interface', 'Struct', 'Enum', 'Inline'] + for node in filenode.GetListOf(*top_types): + # Skip if this node is not in this release + if not node.InReleases(releases): + print "Skiping %s" % node + continue + + # End/Start group marker + if do_comments: + last_group = WriteGroupMarker(out, node, last_group) + + if node.IsA('Inline'): + item = node.GetProperty('VALUE') + # If 'C++' use __cplusplus wrapper + if node.GetName() == 'cc': + item = '#ifdef __cplusplus\n%s\n#endif /* __cplusplus */\n\n' % item + # If not C++ or C, then skip it + elif not node.GetName() == 'c': + continue + if item: out.Write(item) + continue + + # + # Otherwise we are defining a file level object, so generate the + # correct document notation. + # + item = cgen.Define(node, releases, prefix=pref, comment=True) + if not item: continue + asize = node.GetProperty('assert_size()') + if asize: + name = '%s%s' % (pref, node.GetName()) + if node.IsA('Struct'): + form = 'PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(%s, %s);\n' + elif node.IsA('Enum'): + if node.GetProperty('notypedef'): + form = 'PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(%s, %s);\n' + else: + form = 'PP_COMPILE_ASSERT_SIZE_IN_BYTES(%s, %s);\n' + else: + form = 'PP_COMPILE_ASSERT_SIZE_IN_BYTES(%s, %s);\n' + item += form % (name, asize[0]) + + if item: out.Write(item) + if last_group: + out.Write(CommentLines(['*',' @}', '']) + '\n') + + +def CheckTypedefs(filenode, releases): + """Checks that typedefs don't specify callbacks that take some structs. + + See http://crbug.com/233439 for details. + """ + cgen = CGen() + for node in filenode.GetListOf('Typedef'): + build_list = node.GetUniqueReleases(releases) + callnode = node.GetOneOf('Callspec') + if callnode: + for param in callnode.GetListOf('Param'): + if param.GetListOf('Array'): + continue + if cgen.GetParamMode(param) != 'in': + continue + t = param.GetType(build_list[0]) + while t.IsA('Typedef'): + t = t.GetType(build_list[0]) + if t.IsA('Struct') and t.GetProperty('passByValue'): + raise Exception('%s is a struct in callback %s. ' + 'See http://crbug.com/233439' % + (t.GetName(), node.GetName())) + + +def CheckPassByValue(filenode, releases): + """Checks that new pass-by-value structs are not introduced. + + See http://crbug.com/233439 for details. + """ + cgen = CGen() + # DO NOT add any more entries to this whitelist. + # http://crbug.com/233439 + type_whitelist = ['PP_ArrayOutput', 'PP_CompletionCallback', + 'PP_Ext_EventListener', 'PP_FloatPoint', + 'PP_Point', 'PP_TouchPoint', 'PP_Var'] + nodes_to_check = filenode.GetListOf('Struct') + nodes_to_check.extend(filenode.GetListOf('Union')) + for node in nodes_to_check: + if node.GetName() in type_whitelist: + continue + build_list = node.GetUniqueReleases(releases) + if node.GetProperty('passByValue'): + raise Exception('%s is a new passByValue struct or union. ' + 'See http://crbug.com/233439' % node.GetName()) + if node.GetProperty('returnByValue'): + raise Exception('%s is a new returnByValue struct or union. ' + 'See http://crbug.com/233439' % node.GetName()) + + +class HGen(GeneratorByFile): + def __init__(self): + Generator.__init__(self, 'C Header', 'cgen', 'Generate the C headers.') + + def GenerateFile(self, filenode, releases, options): + CheckTypedefs(filenode, releases) + CheckPassByValue(filenode, releases) + savename = GetHeaderFromNode(filenode, GetOption('dstroot')) + my_min, my_max = filenode.GetMinMax(releases) + if my_min > releases[-1] or my_max < releases[0]: + if os.path.isfile(savename): + print "Removing stale %s for this range." % filenode.GetName() + os.remove(os.path.realpath(savename)) + return False + + out = IDLOutFile(savename) + self.GenerateHead(out, filenode, releases, options) + self.GenerateBody(out, filenode, releases, options) + self.GenerateTail(out, filenode, releases, options) + return out.Close() + + def GenerateHead(self, out, filenode, releases, options): + __pychecker__ = 'unusednames=options' + + proto = ProtoResolver() + proto.Visit(filenode, None) + + cgen = CGen() + gpath = GetOption('guard') + def_guard = GetHeaderFromNode(filenode, relpath=gpath) + def_guard = def_guard.replace(os.sep,'_').replace('.','_').upper() + '_' + + cright_node = filenode.GetChildren()[0] + assert(cright_node.IsA('Copyright')) + fileinfo = filenode.GetChildren()[1] + assert(fileinfo.IsA('Comment')) + + out.Write('%s\n' % cgen.Copyright(cright_node)) + + # Wrap the From ... modified ... comment if it would be >80 characters. + from_text = 'From %s' % GetPathFromNode(filenode).replace(os.sep, '/') + modified_text = 'modified %s.' % ( + filenode.GetProperty('DATETIME')) + if len(from_text) + len(modified_text) < 74: + out.Write('/* %s %s */\n\n' % (from_text, modified_text)) + else: + out.Write('/* %s,\n * %s\n */\n\n' % (from_text, modified_text)) + + out.Write('#ifndef %s\n#define %s\n\n' % (def_guard, def_guard)) + # Generate set of includes + + deps = set() + for release in releases: + deps |= filenode.GetDeps(release) + + includes = set([]) + for dep in deps: + depfile = dep.GetProperty('FILE') + if depfile: + includes.add(depfile) + includes = [GetHeaderFromNode( + include, relpath=gpath).replace(os.sep, '/') for include in includes] + includes.append('ppapi/c/pp_macros.h') + + # Assume we need stdint if we "include" C or C++ code + if filenode.GetListOf('Include'): + includes.append('ppapi/c/pp_stdint.h') + + includes = sorted(set(includes)) + cur_include = GetHeaderFromNode(filenode, + relpath=gpath).replace(os.sep, '/') + for include in includes: + if include == cur_include: continue + out.Write('#include "%s"\n' % include) + + # Generate Prototypes + if proto.struct_map: + out.Write('\n/* Struct prototypes */\n') + for struct in proto.struct_map: + out.Write('struct %s;\n' % struct) + + # Create a macro for the highest available release number. + if filenode.GetProperty('NAME').endswith('pp_macros.idl'): + releasestr = ' '.join(releases) + if releasestr: + release_numbers = re.findall('[\d\_]+', releasestr) + release = re.findall('\d+', release_numbers[-1])[0] + if release: + out.Write('\n#define PPAPI_RELEASE %s\n' % release) + + # Generate all interface defines + out.Write('\n') + for node in filenode.GetListOf('Interface'): + idefs = '' + macro = cgen.GetInterfaceMacro(node) + unique = node.GetUniqueReleases(releases) + + # Skip this interface if there are no matching versions + if not unique: continue + + # Skip this interface if it should have no interface string. + if node.GetProperty('no_interface_string'): continue + + last_stable_ver = None + last_dev_rel = None + for rel in unique: + channel = node.GetProperty('FILE').release_map.GetChannel(rel) + if channel == 'dev': + last_dev_rel = rel + + for rel in unique: + version = node.GetVersion(rel) + name = cgen.GetInterfaceString(node, version) + strver = str(version).replace('.', '_') + channel = node.GetProperty('FILE').release_map.GetChannel(rel) + if channel == 'dev': + # Skip dev channel interface versions that are + # Not the newest version, and + # Don't have an equivalent stable version. + if rel != last_dev_rel and not node.DevInterfaceMatchesStable(rel): + continue + value_string = '"%s" /* dev */' % name + else: + value_string = '"%s"' % name + last_stable_ver = strver + idefs += cgen.GetDefine('%s_%s' % (macro, strver), value_string) + if last_stable_ver: + idefs += cgen.GetDefine(macro, '%s_%s' % (macro, last_stable_ver)) + idefs += '\n' + + out.Write(idefs) + + # Generate the @file comment + out.Write('%s\n' % Comment(fileinfo, prefix='*\n @file')) + + def GenerateBody(self, out, filenode, releases, options): + __pychecker__ = 'unusednames=options' + GenerateHeader(out, filenode, releases) + + def GenerateTail(self, out, filenode, releases, options): + __pychecker__ = 'unusednames=options,releases' + gpath = GetOption('guard') + def_guard = GetPathFromNode(filenode, relpath=gpath, ext='.h') + def_guard = def_guard.replace(os.sep,'_').replace('.','_').upper() + '_' + out.Write('#endif /* %s */\n\n' % def_guard) + + +hgen = HGen() + +def main(args): + # Default invocation will verify the golden files are unchanged. + failed = 0 + if not args: + args = ['--wnone', '--diff', '--test', '--dstroot=.'] + + ParseOptions(args) + + idldir = os.path.split(sys.argv[0])[0] + idldir = os.path.join(idldir, 'test_cgen', '*.idl') + filenames = glob.glob(idldir) + ast = ParseFiles(filenames) + if hgen.GenerateRelease(ast, 'M14', {}): + print "Golden file for M14 failed." + failed = 1 + else: + print "Golden file for M14 passed." + + + idldir = os.path.split(sys.argv[0])[0] + idldir = os.path.join(idldir, 'test_cgen_range', '*.idl') + filenames = glob.glob(idldir) + + ast = ParseFiles(filenames) + if hgen.GenerateRange(ast, ['M13', 'M14', 'M15', 'M16', 'M17'], {}): + print "Golden file for M13-M17 failed." + failed =1 + else: + print "Golden file for M13-M17 passed." + + return failed + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) + diff --git a/browser/extensions/mortar/ppapi/generators/idl_c_proto.py b/browser/extensions/mortar/ppapi/generators/idl_c_proto.py new file mode 100755 index 000000000000..60b83084806f --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/idl_c_proto.py @@ -0,0 +1,822 @@ +#!/usr/bin/env python +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +""" Generator for C style prototypes and definitions """ + +import glob +import os +import sys + +from idl_log import ErrOut, InfoOut, WarnOut +from idl_node import IDLNode +from idl_ast import IDLAst +from idl_option import GetOption, Option, ParseOptions +from idl_parser import ParseFiles + +Option('cgen_debug', 'Debug generate.') + +class CGenError(Exception): + def __init__(self, msg): + self.value = msg + + def __str__(self): + return repr(self.value) + + +def CommentLines(lines, tabs=0): + # Generate a C style comment block by prepending the block with '/*' + # and adding a ' *' per line. + tab = ' ' * tabs + + out = '%s/*' % tab + ('\n%s *' % tab).join(lines) + + # Add a terminating ' */' unless the last line is blank which would mean it + # already has ' *' + if not lines[-1]: + out += '/\n' + else: + out += ' */\n' + return out + +def Comment(node, prefix=None, tabs=0): + # Generate a comment block from the provided Comment node. + comment = node.GetName() + lines = comment.split('\n') + + # If an option prefix is provided, then prepend that to the comment + # for this node. + if prefix: + prefix_lines = prefix.split('\n') + # If both the prefix and comment start with a blank line ('*') remove + # the extra one. + if prefix_lines[0] == '*' and lines[0] == '*': + lines = prefix_lines + lines[1:] + else: + lines = prefix_lines + lines; + return CommentLines(lines, tabs) + +def GetNodeComments(node, tabs=0): + # Generate a comment block joining all comment nodes which are children of + # the provided node. + comment_txt = '' + for doc in node.GetListOf('Comment'): + comment_txt += Comment(doc, tabs=tabs) + return comment_txt + + +class CGen(object): + # TypeMap + # + # TypeMap modifies how an object is stored or passed, for example pointers + # are passed as 'const' if they are 'in' parameters, and structures are + # preceeded by the keyword 'struct' as well as using a pointer. + # + TypeMap = { + 'Array': { + 'in': 'const %s', + 'inout': '%s', + 'out': '%s*', + 'store': '%s', + 'return': '%s', + 'ref': '%s*' + }, + 'Callspec': { + 'in': '%s', + 'inout': '%s', + 'out': '%s', + 'store': '%s', + 'return': '%s' + }, + 'Enum': { + 'in': '%s', + 'inout': '%s*', + 'out': '%s*', + 'store': '%s', + 'return': '%s' + }, + 'Interface': { + 'in': 'const %s*', + 'inout': '%s*', + 'out': '%s**', + 'return': '%s*', + 'store': '%s*' + }, + 'Struct': { + 'in': 'const %s*', + 'inout': '%s*', + 'out': '%s*', + 'return': ' %s*', + 'store': '%s', + 'ref': '%s*' + }, + 'blob_t': { + 'in': 'const %s', + 'inout': '%s', + 'out': '%s', + 'return': '%s', + 'store': '%s' + }, + 'mem_t': { + 'in': 'const %s', + 'inout': '%s', + 'out': '%s', + 'return': '%s', + 'store': '%s' + }, + 'mem_ptr_t': { + 'in': 'const %s', + 'inout': '%s', + 'out': '%s', + 'return': '%s', + 'store': '%s' + }, + 'str_t': { + 'in': 'const %s', + 'inout': '%s', + 'out': '%s', + 'return': 'const %s', + 'store': '%s' + }, + 'cstr_t': { + 'in': '%s', + 'inout': '%s*', + 'out': '%s*', + 'return': '%s', + 'store': '%s' + }, + 'TypeValue': { + 'in': '%s', + 'constptr_in': 'const %s*', # So we can use const* for PP_Var sometimes. + 'inout': '%s*', + 'out': '%s*', + 'return': '%s', + 'store': '%s' + }, + } + + + # + # RemapName + # + # A diction array of PPAPI types that are converted to language specific + # types before being returned by by the C generator + # + RemapName = { + 'blob_t': 'void**', + 'float_t': 'float', + 'double_t': 'double', + 'handle_t': 'int', + 'mem_t': 'void*', + 'mem_ptr_t': 'void**', + 'str_t': 'char*', + 'cstr_t': 'const char*', + 'interface_t' : 'const void*' + } + + # Tell how to handle pointers to GL types. + for gltype in ['GLbitfield', 'GLboolean', 'GLbyte', 'GLclampf', + 'GLclampx', 'GLenum', 'GLfixed', 'GLfloat', 'GLint', + 'GLintptr', 'GLshort', 'GLsizei', 'GLsizeiptr', + 'GLubyte', 'GLuint', 'GLushort']: + ptrtype = gltype + '_ptr_t' + TypeMap[ptrtype] = { + 'in': 'const %s', + 'inout': '%s', + 'out': '%s', + 'return': 'const %s', + 'store': '%s' + } + RemapName[ptrtype] = '%s*' % gltype + + def __init__(self): + self.dbg_depth = 0 + + # + # Debug Logging functions + # + def Log(self, txt): + if not GetOption('cgen_debug'): return + tabs = ' ' * self.dbg_depth + print '%s%s' % (tabs, txt) + + def LogEnter(self, txt): + if txt: self.Log(txt) + self.dbg_depth += 1 + + def LogExit(self, txt): + self.dbg_depth -= 1 + if txt: self.Log(txt) + + + def GetDefine(self, name, value): + out = '#define %s %s' % (name, value) + if len(out) > 80: + out = '#define %s \\\n %s' % (name, value) + return '%s\n' % out + + # + # Interface strings + # + def GetMacroHelper(self, node): + macro = node.GetProperty('macro') + if macro: return macro + name = node.GetName() + name = name.upper() + return "%s_INTERFACE" % name + + def GetInterfaceMacro(self, node, version = None): + name = self.GetMacroHelper(node) + if version is None: + return name + return '%s_%s' % (name, str(version).replace('.', '_')) + + def GetInterfaceString(self, node, version = None): + # If an interface name is specified, use that + name = node.GetProperty('iname') + if not name: + # Otherwise, the interface name is the object's name + # With '_Dev' replaced by '(Dev)' if it's a Dev interface. + name = node.GetName() + if name.endswith('_Dev'): + name = '%s(Dev)' % name[:-4] + if version is None: + return name + return "%s;%s" % (name, version) + + + # + # Return the array specification of the object. + # + def GetArraySpec(self, node): + assert(node.cls == 'Array') + fixed = node.GetProperty('FIXED') + if fixed: + return '[%s]' % fixed + else: + return '[]' + + # + # GetTypeName + # + # For any valid 'typed' object such as Member or Typedef + # the typenode object contains the typename + # + # For a given node return the type name by passing mode. + # + def GetTypeName(self, node, release, prefix=''): + self.LogEnter('GetTypeName of %s rel=%s' % (node, release)) + + # For Members, Params, and Typedefs get the type it refers to otherwise + # the node in question is it's own type (struct, union etc...) + if node.IsA('Member', 'Param', 'Typedef'): + typeref = node.GetType(release) + else: + typeref = node + + if typeref is None: + node.Error('No type at release %s.' % release) + raise CGenError('No type for %s' % node) + + # If the type is a (BuiltIn) Type then return it's name + # remapping as needed + if typeref.IsA('Type'): + name = CGen.RemapName.get(typeref.GetName(), None) + if name is None: name = typeref.GetName() + name = '%s%s' % (prefix, name) + + # For Interfaces, use the name + version + elif typeref.IsA('Interface'): + rel = typeref.first_release[release] + name = 'struct %s%s' % (prefix, self.GetStructName(typeref, rel, True)) + + # For structures, preceed with 'struct' or 'union' as appropriate + elif typeref.IsA('Struct'): + if typeref.GetProperty('union'): + name = 'union %s%s' % (prefix, typeref.GetName()) + else: + name = 'struct %s%s' % (prefix, typeref.GetName()) + + # If it's an enum, or typedef then return the Enum's name + elif typeref.IsA('Enum', 'Typedef'): + if not typeref.LastRelease(release): + first = node.first_release[release] + ver = '_' + node.GetVersion(first).replace('.','_') + else: + ver = '' + # The enum may have skipped having a typedef, we need prefix with 'enum'. + if typeref.GetProperty('notypedef'): + name = 'enum %s%s%s' % (prefix, typeref.GetName(), ver) + else: + name = '%s%s%s' % (prefix, typeref.GetName(), ver) + + else: + raise RuntimeError('Getting name of non-type %s.' % node) + self.LogExit('GetTypeName %s is %s' % (node, name)) + return name + + + # + # GetRootType + # + # For a given node return basic type of that object. This is + # either a 'Type', 'Callspec', or 'Array' + # + def GetRootTypeMode(self, node, release, mode): + self.LogEnter('GetRootType of %s' % node) + # If it has an array spec, then treat it as an array regardless of type + if node.GetOneOf('Array'): + rootType = 'Array' + # Or if it has a callspec, treat it as a function + elif node.GetOneOf('Callspec'): + rootType, mode = self.GetRootTypeMode(node.GetType(release), release, + 'return') + + # If it's a plain typedef, try that object's root type + elif node.IsA('Member', 'Param', 'Typedef'): + rootType, mode = self.GetRootTypeMode(node.GetType(release), + release, mode) + + # If it's an Enum, then it's normal passing rules + elif node.IsA('Enum'): + rootType = node.cls + + # If it's an Interface or Struct, we may be passing by value + elif node.IsA('Interface', 'Struct'): + if mode == 'return': + if node.GetProperty('returnByValue'): + rootType = 'TypeValue' + else: + rootType = node.cls + else: + if node.GetProperty('passByValue'): + rootType = 'TypeValue' + else: + rootType = node.cls + + # If it's an Basic Type, check if it's a special type + elif node.IsA('Type'): + if node.GetName() in CGen.TypeMap: + rootType = node.GetName() + else: + rootType = 'TypeValue' + else: + raise RuntimeError('Getting root type of non-type %s.' % node) + self.LogExit('RootType is "%s"' % rootType) + return rootType, mode + + + def GetTypeByMode(self, node, release, mode): + self.LogEnter('GetTypeByMode of %s mode=%s release=%s' % + (node, mode, release)) + name = self.GetTypeName(node, release) + ntype, mode = self.GetRootTypeMode(node, release, mode) + out = CGen.TypeMap[ntype][mode] % name + self.LogExit('GetTypeByMode %s = %s' % (node, out)) + return out + + + # Get the passing mode of the object (in, out, inout). + def GetParamMode(self, node): + self.Log('GetParamMode for %s' % node) + if node.GetProperty('in'): return 'in' + if node.GetProperty('out'): return 'out' + if node.GetProperty('inout'): return 'inout' + if node.GetProperty('constptr_in'): return 'constptr_in' + return 'return' + + # + # GetComponents + # + # Returns the signature components of an object as a tuple of + # (rtype, name, arrays, callspec) where: + # rtype - The store or return type of the object. + # name - The name of the object. + # arrays - A list of array dimensions as [] or []. + # args - None if not a function, otherwise a list of parameters. + # + def GetComponents(self, node, release, mode): + self.LogEnter('GetComponents mode %s for %s %s' % (mode, node, release)) + + # Generate passing type by modifying root type + rtype = self.GetTypeByMode(node, release, mode) + # If this is an array output, change it from type* foo[] to type** foo. + # type* foo[] means an array of pointers to type, which is confusing. + arrayspec = [self.GetArraySpec(array) for array in node.GetListOf('Array')] + if mode == 'out' and len(arrayspec) == 1 and arrayspec[0] == '[]': + rtype += '*' + del arrayspec[0] + + if node.IsA('Enum', 'Interface', 'Struct'): + rname = node.GetName() + else: + rname = node.GetType(release).GetName() + + if rname in CGen.RemapName: + rname = CGen.RemapName[rname] + if '%' in rtype: + rtype = rtype % rname + name = node.GetName() + callnode = node.GetOneOf('Callspec') + if callnode: + callspec = [] + for param in callnode.GetListOf('Param'): + if not param.IsRelease(release): + continue + mode = self.GetParamMode(param) + ptype, pname, parray, pspec = self.GetComponents(param, release, mode) + if node.GetName() == 'GetDirContents' and pname == 'contents': + ptype += '*' + callspec.append((ptype, pname, parray, pspec)) + else: + callspec = None + + self.LogExit('GetComponents: %s, %s, %s, %s' % + (rtype, name, arrayspec, callspec)) + return (rtype, name, arrayspec, callspec) + + + def Compose(self, rtype, name, arrayspec, callspec, prefix, func_as_ptr, + include_name, unsized_as_ptr): + self.LogEnter('Compose: %s %s' % (rtype, name)) + arrayspec = ''.join(arrayspec) + + # Switch unsized array to a ptr. NOTE: Only last element can be unsized. + if unsized_as_ptr and arrayspec[-2:] == '[]': + prefix += '*' + arrayspec=arrayspec[:-2] + + if not include_name: + name = prefix + arrayspec + else: + name = prefix + name + arrayspec + if callspec is None: + out = '%s %s' % (rtype, name) + else: + params = [] + for ptype, pname, parray, pspec in callspec: + params.append(self.Compose(ptype, pname, parray, pspec, '', True, + include_name=True, + unsized_as_ptr=unsized_as_ptr)) + if func_as_ptr: + name = '(*%s)' % name + if not params: + params = ['void'] + out = '%s %s(%s)' % (rtype, name, ', '.join(params)) + self.LogExit('Exit Compose: %s' % out) + return out + + # + # GetSignature + # + # Returns the 'C' style signature of the object + # prefix - A prefix for the object's name + # func_as_ptr - Formats a function as a function pointer + # include_name - If true, include member name in the signature. + # If false, leave it out. In any case, prefix is always + # included. + # include_version - if True, include version in the member name + # + def GetSignature(self, node, release, mode, prefix='', func_as_ptr=True, + include_name=True, include_version=False): + self.LogEnter('GetSignature %s %s as func=%s' % + (node, mode, func_as_ptr)) + rtype, name, arrayspec, callspec = self.GetComponents(node, release, mode) + if include_version: + name = self.GetStructName(node, release, True) + + # If not a callspec (such as a struct) use a ptr instead of [] + unsized_as_ptr = not callspec + + out = self.Compose(rtype, name, arrayspec, callspec, prefix, + func_as_ptr, include_name, unsized_as_ptr) + + self.LogExit('Exit GetSignature: %s' % out) + return out + + # Define a Typedef. + def DefineTypedef(self, node, releases, prefix='', comment=False): + __pychecker__ = 'unusednames=comment' + build_list = node.GetUniqueReleases(releases) + + out = 'typedef %s;\n' % self.GetSignature(node, build_list[-1], 'return', + prefix, True, + include_version=False) + + # Version mangle any other versions + for index, rel in enumerate(build_list[:-1]): + out += '\n' + out += 'typedef %s;\n' % self.GetSignature(node, rel, 'return', + prefix, True, + include_version=True) + self.Log('DefineTypedef: %s' % out) + return out + + # Define an Enum. + def DefineEnum(self, node, releases, prefix='', comment=False): + __pychecker__ = 'unusednames=comment,releases' + self.LogEnter('DefineEnum %s' % node) + name = '%s%s' % (prefix, node.GetName()) + notypedef = node.GetProperty('notypedef') + unnamed = node.GetProperty('unnamed') + + if unnamed: + out = 'enum {' + elif notypedef: + out = 'enum %s {' % name + else: + out = 'typedef enum {' + enumlist = [] + for child in node.GetListOf('EnumItem'): + value = child.GetProperty('VALUE') + comment_txt = GetNodeComments(child, tabs=1) + if value: + item_txt = '%s%s = %s' % (prefix, child.GetName(), value) + else: + item_txt = '%s%s' % (prefix, child.GetName()) + enumlist.append('%s %s' % (comment_txt, item_txt)) + self.LogExit('Exit DefineEnum') + + if unnamed or notypedef: + out = '%s\n%s\n};\n' % (out, ',\n'.join(enumlist)) + else: + out = '%s\n%s\n} %s;\n' % (out, ',\n'.join(enumlist), name) + return out + + def DefineMember(self, node, releases, prefix='', comment=False): + __pychecker__ = 'unusednames=prefix,comment' + release = releases[0] + self.LogEnter('DefineMember %s' % node) + if node.GetProperty('ref'): + out = '%s;' % self.GetSignature(node, release, 'ref', '', True) + else: + out = '%s;' % self.GetSignature(node, release, 'store', '', True) + self.LogExit('Exit DefineMember') + return out + + def GetStructName(self, node, release, include_version=False): + suffix = '' + if include_version: + ver_num = node.GetVersion(release) + suffix = ('_%s' % ver_num).replace('.', '_') + return node.GetName() + suffix + + def DefineStructInternals(self, node, release, + include_version=False, comment=True): + channel = node.GetProperty('FILE').release_map.GetChannel(release) + if channel == 'dev': + channel_comment = ' /* dev */' + else: + channel_comment = '' + out = '' + if node.GetProperty('union'): + out += 'union %s {%s\n' % ( + self.GetStructName(node, release, include_version), channel_comment) + else: + out += 'struct %s {%s\n' % ( + self.GetStructName(node, release, include_version), channel_comment) + + channel = node.GetProperty('FILE').release_map.GetChannel(release) + # Generate Member Functions + members = [] + for child in node.GetListOf('Member'): + if channel == 'stable' and child.NodeIsDevOnly(): + continue + member = self.Define(child, [release], tabs=1, comment=comment) + if not member: + continue + members.append(member) + out += '%s\n};\n' % '\n'.join(members) + return out + + + def DefineUnversionedInterface(self, node, rel): + out = '\n' + if node.GetProperty('force_struct_namespace'): + # Duplicate the definition to put it in struct namespace. This + # attribute is only for legacy APIs like OpenGLES2 and new APIs + # must not use this. See http://crbug.com/411799 + out += self.DefineStructInternals(node, rel, + include_version=False, comment=True) + else: + # Define an unversioned typedef for the most recent version + out += 'typedef struct %s %s;\n' % ( + self.GetStructName(node, rel, include_version=True), + self.GetStructName(node, rel, include_version=False)) + return out + + + def DefineStruct(self, node, releases, prefix='', comment=False): + __pychecker__ = 'unusednames=comment,prefix' + self.LogEnter('DefineStruct %s' % node) + out = '' + build_list = node.GetUniqueReleases(releases) + + newest_stable = None + newest_dev = None + for rel in build_list: + channel = node.GetProperty('FILE').release_map.GetChannel(rel) + if channel == 'stable': + newest_stable = rel + if channel == 'dev': + newest_dev = rel + last_rel = build_list[-1] + + # TODO(noelallen) : Bug 157017 finish multiversion support + if node.IsA('Struct'): + if len(build_list) != 1: + node.Error('Can not support multiple versions of node.') + assert len(build_list) == 1 + # Build the most recent one versioned, with comments + out = self.DefineStructInternals(node, last_rel, + include_version=False, comment=True) + + if node.IsA('Interface'): + # Build the most recent one versioned, with comments + out = self.DefineStructInternals(node, last_rel, + include_version=True, comment=True) + if last_rel == newest_stable: + out += self.DefineUnversionedInterface(node, last_rel) + + # Build the rest without comments and with the version number appended + for rel in build_list[0:-1]: + channel = node.GetProperty('FILE').release_map.GetChannel(rel) + # Skip dev channel interface versions that are + # Not the newest version, and + # Don't have an equivalent stable version. + if channel == 'dev' and rel != newest_dev: + if not node.DevInterfaceMatchesStable(rel): + continue + out += '\n' + self.DefineStructInternals(node, rel, + include_version=True, + comment=False) + if rel == newest_stable: + out += self.DefineUnversionedInterface(node, rel) + + self.LogExit('Exit DefineStruct') + return out + + + # + # Copyright and Comment + # + # Generate a comment or copyright block + # + def Copyright(self, node, cpp_style=False): + lines = node.GetName().split('\n') + if cpp_style: + return '//' + '\n//'.join(filter(lambda f: f != '', lines)) + '\n' + return CommentLines(lines) + + + def Indent(self, data, tabs=0): + """Handles indentation and 80-column line wrapping.""" + tab = ' ' * tabs + lines = [] + for line in data.split('\n'): + # Add indentation + line = tab + line + space_break = line.rfind(' ', 0, 80) + if len(line) <= 80 or 'http://' in line: + # Ignore normal line and URLs permitted by the style guide. + lines.append(line.rstrip()) + elif not '(' in line and space_break >= 0: + # Break long typedefs on nearest space. + lines.append(line[0:space_break]) + lines.append(' ' + line[space_break + 1:]) + else: + left = line.rfind('(') + 1 + args = line[left:].split(',') + orig_args = args + orig_left = left + # Try to split on '(arg1)' or '(arg1, arg2)', not '()' + while args[0][0] == ')': + left = line.rfind('(', 0, left - 1) + 1 + if left == 0: # No more parens, take the original option + args = orig_args + left = orig_left + break + args = line[left:].split(',') + + line_max = 0 + for arg in args: + if len(arg) > line_max: line_max = len(arg) + + if left + line_max >= 80: + indent = '%s ' % tab + args = (',\n%s' % indent).join([arg.strip() for arg in args]) + lines.append('%s\n%s%s' % (line[:left], indent, args)) + else: + indent = ' ' * (left - 1) + args = (',\n%s' % indent).join(args) + lines.append('%s%s' % (line[:left], args)) + return '\n'.join(lines) + + + # Define a top level object. + def Define(self, node, releases, tabs=0, prefix='', comment=False): + # If this request does not match unique release, or if the release is not + # available (possibly deprecated) then skip. + unique = node.GetUniqueReleases(releases) + if not unique or not node.InReleases(releases): + return '' + + self.LogEnter('Define %s tab=%d prefix="%s"' % (node,tabs,prefix)) + declmap = dict({ + 'Enum': CGen.DefineEnum, + 'Function': CGen.DefineMember, + 'Interface': CGen.DefineStruct, + 'Member': CGen.DefineMember, + 'Struct': CGen.DefineStruct, + 'Typedef': CGen.DefineTypedef + }) + + out = '' + func = declmap.get(node.cls, None) + if not func: + ErrOut.Log('Failed to define %s named %s' % (node.cls, node.GetName())) + define_txt = func(self, node, releases, prefix=prefix, comment=comment) + + comment_txt = GetNodeComments(node, tabs=0) + if comment_txt and comment: + out += comment_txt + out += define_txt + + indented_out = self.Indent(out, tabs) + self.LogExit('Exit Define') + return indented_out + + +# Clean a string representing an object definition and return then string +# as a single space delimited set of tokens. +def CleanString(instr): + instr = instr.strip() + instr = instr.split() + return ' '.join(instr) + + +# Test a file, by comparing all it's objects, with their comments. +def TestFile(filenode): + cgen = CGen() + + errors = 0 + for node in filenode.GetChildren()[2:]: + instr = node.GetOneOf('Comment') + if not instr: continue + instr.Dump() + instr = CleanString(instr.GetName()) + + outstr = cgen.Define(node, releases=['M14']) + if GetOption('verbose'): + print outstr + '\n' + outstr = CleanString(outstr) + + if instr != outstr: + ErrOut.Log('Failed match of\n>>%s<<\nto:\n>>%s<<\nFor:\n' % + (instr, outstr)) + node.Dump(1, comments=True) + errors += 1 + return errors + + +# Build and resolve the AST and compare each file individual. +def TestFiles(filenames): + if not filenames: + idldir = os.path.split(sys.argv[0])[0] + idldir = os.path.join(idldir, 'test_cgen', '*.idl') + filenames = glob.glob(idldir) + + filenames = sorted(filenames) + ast = ParseFiles(filenames) + + total_errs = 0 + for filenode in ast.GetListOf('File'): + errs = TestFile(filenode) + if errs: + ErrOut.Log('%s test failed with %d error(s).' % + (filenode.GetName(), errs)) + total_errs += errs + + if total_errs: + ErrOut.Log('Failed generator test.') + else: + InfoOut.Log('Passed generator test.') + return total_errs + +def main(args): + filenames = ParseOptions(args) + if GetOption('test'): + return TestFiles(filenames) + ast = ParseFiles(filenames) + cgen = CGen() + for f in ast.GetListOf('File'): + if f.GetProperty('ERRORS') > 0: + print 'Skipping %s' % f.GetName() + continue + for node in f.GetChildren()[2:]: + print cgen.Define(node, ast.releases, comment=True, prefix='tst_') + + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/browser/extensions/mortar/ppapi/generators/idl_diff.py b/browser/extensions/mortar/ppapi/generators/idl_diff.py new file mode 100755 index 000000000000..0d15fe83e847 --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/idl_diff.py @@ -0,0 +1,354 @@ +#!/usr/bin/env python +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import glob +import os +import subprocess +import sys + +from idl_option import GetOption, Option, ParseOptions +from idl_outfile import IDLOutFile +# +# IDLDiff +# +# IDLDiff is a tool for comparing sets of IDL generated header files +# with the standard checked in headers. It does this by capturing the +# output of the standard diff tool, parsing it into separate changes, then +# ignoring changes that are know to be safe, such as adding or removing +# blank lines, etc... +# + +Option('gen', 'IDL generated files', default='hdir') +Option('src', 'Original ".h" files', default='../c') +Option('halt', 'Stop if a difference is found') +Option('diff', 'Directory holding acceptable diffs', default='diff') +Option('ok', 'Write out the diff file.') +# Change +# +# A Change object contains the previous lines, new news and change type. +# +class Change(object): + def __init__(self, mode, was, now): + self.mode = mode + self.was = was + self.now = now + + def Dump(self): + if not self.was: + print 'Adding %s' % self.mode + elif not self.now: + print 'Missing %s' % self.mode + else: + print 'Modifying %s' % self.mode + + for line in self.was: + print 'src: >>%s<<' % line + for line in self.now: + print 'gen: >>%s<<' % line + print + +# +# IsCopyright +# +# Return True if this change is only a one line change in the copyright notice +# such as non-matching years. +# +def IsCopyright(change): + if len(change.now) != 1 or len(change.was) != 1: return False + if 'Copyright (c)' not in change.now[0]: return False + if 'Copyright (c)' not in change.was[0]: return False + return True + +# +# IsBlankComment +# +# Return True if this change only removes a blank line from a comment +# +def IsBlankComment(change): + if change.now: return False + if len(change.was) != 1: return False + if change.was[0].strip() != '*': return False + return True + +# +# IsBlank +# +# Return True if this change only adds or removes blank lines +# +def IsBlank(change): + for line in change.now: + if line: return False + for line in change.was: + if line: return False + return True + + +# +# IsCppComment +# +# Return True if this change only going from C++ to C style +# +def IsToCppComment(change): + if not len(change.now) or len(change.now) != len(change.was): + return False + for index in range(len(change.now)): + was = change.was[index].strip() + if was[:2] != '//': + return False + was = was[2:].strip() + now = change.now[index].strip() + if now[:2] != '/*': + return False + now = now[2:-2].strip() + if now != was: + return False + return True + + + return True + +def IsMergeComment(change): + if len(change.was) != 1: return False + if change.was[0].strip() != '*': return False + for line in change.now: + stripped = line.strip() + if stripped != '*' and stripped[:2] != '/*' and stripped[-2:] != '*/': + return False + return True +# +# IsSpacing +# +# Return True if this change is only different in the way 'words' are spaced +# such as in an enum: +# ENUM_XXX = 1, +# ENUM_XYY_Y = 2, +# vs +# ENUM_XXX = 1, +# ENUM_XYY_Y = 2, +# +def IsSpacing(change): + if len(change.now) != len(change.was): return False + for i in range(len(change.now)): + # Also ignore right side comments + line = change.was[i] + offs = line.find('//') + if offs == -1: + offs = line.find('/*') + if offs >-1: + line = line[:offs-1] + + words1 = change.now[i].split() + words2 = line.split() + if words1 != words2: return False + return True + +# +# IsInclude +# +# Return True if change has extra includes +# +def IsInclude(change): + for line in change.was: + if line.strip().find('struct'): return False + for line in change.now: + if line and '#include' not in line: return False + return True + +# +# IsCppComment +# +# Return True if the change is only missing C++ comments +# +def IsCppComment(change): + if len(change.now): return False + for line in change.was: + line = line.strip() + if line[:2] != '//': return False + return True +# +# ValidChange +# +# Return True if none of the changes does not patch an above "bogus" change. +# +def ValidChange(change): + if IsToCppComment(change): return False + if IsCopyright(change): return False + if IsBlankComment(change): return False + if IsMergeComment(change): return False + if IsBlank(change): return False + if IsSpacing(change): return False + if IsInclude(change): return False + if IsCppComment(change): return False + return True + + +# +# Swapped +# +# Check if the combination of last + next change signals they are both +# invalid such as swap of line around an invalid block. +# +def Swapped(last, next): + if not last.now and not next.was and len(last.was) == len(next.now): + cnt = len(last.was) + for i in range(cnt): + match = True + for j in range(cnt): + if last.was[j] != next.now[(i + j) % cnt]: + match = False + break; + if match: return True + if not last.was and not next.now and len(last.now) == len(next.was): + cnt = len(last.now) + for i in range(cnt): + match = True + for j in range(cnt): + if last.now[i] != next.was[(i + j) % cnt]: + match = False + break; + if match: return True + return False + + +def FilterLinesIn(output): + was = [] + now = [] + filter = [] + for index in range(len(output)): + filter.append(False) + line = output[index] + if len(line) < 2: continue + if line[0] == '<': + if line[2:].strip() == '': continue + was.append((index, line[2:])) + elif line[0] == '>': + if line[2:].strip() == '': continue + now.append((index, line[2:])) + for windex, wline in was: + for nindex, nline in now: + if filter[nindex]: continue + if filter[windex]: continue + if wline == nline: + filter[nindex] = True + filter[windex] = True + if GetOption('verbose'): + print "Found %d, %d >>%s<<" % (windex + 1, nindex + 1, wline) + out = [] + for index in range(len(output)): + if not filter[index]: + out.append(output[index]) + + return out +# +# GetChanges +# +# Parse the output into discrete change blocks. +# +def GetChanges(output): + # Split on lines, adding an END marker to simply add logic + lines = output.split('\n') + lines = FilterLinesIn(lines) + lines.append('END') + + changes = [] + was = [] + now = [] + mode = '' + last = None + + for line in lines: +# print "LINE=%s" % line + if not line: continue + + elif line[0] == '<': + if line[2:].strip() == '': continue + # Ignore prototypes + if len(line) > 10: + words = line[2:].split() + if len(words) == 2 and words[1][-1] == ';': + if words[0] == 'struct' or words[0] == 'union': + continue + was.append(line[2:]) + elif line[0] == '>': + if line[2:].strip() == '': continue + if line[2:10] == '#include': continue + now.append(line[2:]) + elif line[0] == '-': + continue + else: + change = Change(line, was, now) + was = [] + now = [] + if ValidChange(change): + changes.append(change) + if line == 'END': + break + + return FilterChanges(changes) + +def FilterChanges(changes): + if len(changes) < 2: return changes + out = [] + filter = [False for change in changes] + for cur in range(len(changes)): + for cmp in range(cur+1, len(changes)): + if filter[cmp]: + continue + if Swapped(changes[cur], changes[cmp]): + filter[cur] = True + filter[cmp] = True + for cur in range(len(changes)): + if filter[cur]: continue + out.append(changes[cur]) + return out + +def Main(args): + filenames = ParseOptions(args) + if not filenames: + gendir = os.path.join(GetOption('gen'), '*.h') + filenames = sorted(glob.glob(gendir)) + srcdir = os.path.join(GetOption('src'), '*.h') + srcs = sorted(glob.glob(srcdir)) + for name in srcs: + name = os.path.split(name)[1] + name = os.path.join(GetOption('gen'), name) + if name not in filenames: + print 'Missing: %s' % name + + for filename in filenames: + gen = filename + filename = filename[len(GetOption('gen')) + 1:] + src = os.path.join(GetOption('src'), filename) + diff = os.path.join(GetOption('diff'), filename) + p = subprocess.Popen(['diff', src, gen], stdout=subprocess.PIPE) + output, errors = p.communicate() + + try: + input = open(diff, 'rt').read() + except: + input = '' + + if input != output: + changes = GetChanges(output) + else: + changes = [] + + if changes: + print "\n\nDelta between:\n src=%s\n gen=%s\n" % (src, gen) + for change in changes: + change.Dump() + print 'Done with %s\n\n' % src + if GetOption('ok'): + open(diff, 'wt').write(output) + if GetOption('halt'): + return 1 + else: + print "\nSAME:\n src=%s\n gen=%s" % (src, gen) + if input: print ' ** Matched expected diff. **' + print '\n' + + +if __name__ == '__main__': + sys.exit(Main(sys.argv[1:])) diff --git a/browser/extensions/mortar/ppapi/generators/idl_gen_pnacl.py b/browser/extensions/mortar/ppapi/generators/idl_gen_pnacl.py new file mode 100755 index 000000000000..dd1ce0cd9eb7 --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/idl_gen_pnacl.py @@ -0,0 +1,284 @@ +#!/usr/bin/env python +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Generator for Pnacl Shim functions that bridges the calling conventions +between GCC and PNaCl. """ + +from datetime import datetime +import difflib +import glob +import os +import sys + +from idl_c_proto import CGen +from idl_gen_wrapper import Interface, WrapperGen +from idl_log import ErrOut, InfoOut, WarnOut +from idl_option import GetOption, Option, ParseOptions +from idl_parser import ParseFiles + +Option('pnaclshim', 'Name of the pnacl shim file.', + default='temp_pnacl_shim.c') + +Option('disable_pnacl_opt', 'Turn off optimization of pnacl shim.') + + +class PnaclGen(WrapperGen): + """PnaclGen generates shim code to bridge the Gcc ABI with PNaCl. + + This subclass of WrapperGenerator takes the IDL sources and + generates shim methods for bridging the calling conventions between GCC + and PNaCl (LLVM). Some of the PPAPI methods do not need shimming, so + this will also detect those situations and provide direct access to the + original PPAPI methods (rather than the shim methods). + """ + + def __init__(self): + WrapperGen.__init__(self, + 'Pnacl', + 'Pnacl Shim Gen', + 'pnacl', + 'Generate the PNaCl shim.') + self.cgen = CGen() + self._skip_opt = False + + ############################################################ + + def OwnHeaderFile(self): + """Return the header file that specifies the API of this wrapper. + We do not generate the header files. """ + return 'ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.h' + + + def InterfaceVersionNeedsWrapping(self, iface, version): + """Return true if the interface+version has ANY methods that + need wrapping. + """ + if self._skip_opt: + return True + if iface.GetName().endswith('Trusted'): + return False + # TODO(dmichael): We have no way to wrap PPP_ interfaces without an + # interface string. If any ever need wrapping, we'll need to figure out a + # way to get the plugin-side of the Pepper proxy (within the IRT) to access + # and use the wrapper. + if iface.GetProperty("no_interface_string"): + return False + for member in iface.GetListOf('Member'): + release = member.GetRelease(version) + if self.MemberNeedsWrapping(member, release): + return True + return False + + + def MemberNeedsWrapping(self, member, release): + """Return true if a particular member function at a particular + release needs wrapping. + """ + if self._skip_opt: + return True + if not member.InReleases([release]): + return False + ret, name, array, args_spec = self.cgen.GetComponents(member, + release, + 'store') + return self.TypeNeedsWrapping(ret, []) or self.ArgsNeedWrapping(args_spec) + + + def ArgsNeedWrapping(self, args): + """Return true if any parameter in the list needs wrapping. + """ + for arg in args: + (type_str, name, array_dims, more_args) = arg + if self.TypeNeedsWrapping(type_str, array_dims): + return True + return False + + + def TypeNeedsWrapping(self, type_node, array_dims): + """Return true if a parameter type needs wrapping. + Currently, this is true for byval aggregates. + """ + is_aggregate = type_node.startswith('struct') or \ + type_node.startswith('union') + is_reference = (type_node.find('*') != -1 or array_dims != []) + return is_aggregate and not is_reference + + ############################################################ + + + def ConvertByValueReturnType(self, ret, args_spec): + if self.TypeNeedsWrapping(ret, array_dims=[]): + args_spec = [(ret, '_struct_result', [], None)] + args_spec + ret2 = 'void' + wrap_return = True + else: + ret2 = ret + wrap_return = False + return wrap_return, ret2, args_spec + + + def ConvertByValueArguments(self, args_spec): + args = [] + for type_str, name, array_dims, more_args in args_spec: + if self.TypeNeedsWrapping(type_str, array_dims): + type_str += '*' + args.append((type_str, name, array_dims, more_args)) + return args + + + def FormatArgs(self, c_operator, args_spec): + args = [] + for type_str, name, array_dims, more_args in args_spec: + if self.TypeNeedsWrapping(type_str, array_dims): + args.append(c_operator + name) + else: + args.append(name) + return ', '.join(args) + + + def GenerateWrapperForPPBMethod(self, iface, member): + result = [] + func_prefix = self.WrapperMethodPrefix(iface.node, iface.release) + ret, name, array, cspec = self.cgen.GetComponents(member, + iface.release, + 'store') + wrap_return, ret2, cspec2 = self.ConvertByValueReturnType(ret, cspec) + cspec2 = self.ConvertByValueArguments(cspec2) + sig = self.cgen.Compose(ret2, name, array, cspec2, + prefix=func_prefix, + func_as_ptr=False, + include_name=True, + unsized_as_ptr=False) + result.append('static %s {\n' % sig) + result.append(' const struct %s *iface = %s.real_iface;\n' % + (iface.struct_name, self.GetWrapperInfoName(iface))) + + return_prefix = '' + if wrap_return: + return_prefix = '*_struct_result = ' + elif ret != 'void': + return_prefix = 'return ' + + result.append(' %siface->%s(%s);\n}\n\n' % (return_prefix, + member.GetName(), + self.FormatArgs('*', cspec))) + return result + + + def GenerateWrapperForPPPMethod(self, iface, member): + result = [] + func_prefix = self.WrapperMethodPrefix(iface.node, iface.release) + sig = self.cgen.GetSignature(member, iface.release, 'store', + func_prefix, False) + result.append('static %s {\n' % sig) + result.append(' const struct %s *iface = %s.real_iface;\n' % + (iface.struct_name, self.GetWrapperInfoName(iface))) + ret, name, array, cspec = self.cgen.GetComponents(member, + iface.release, + 'store') + wrap_return, ret2, cspec = self.ConvertByValueReturnType(ret, cspec) + cspec2 = self.ConvertByValueArguments(cspec) + temp_fp = self.cgen.Compose(ret2, name, array, cspec2, + prefix='temp_fp', + func_as_ptr=True, + include_name=False, + unsized_as_ptr=False) + cast = self.cgen.Compose(ret2, name, array, cspec2, + prefix='', + func_as_ptr=True, + include_name=False, + unsized_as_ptr=False) + result.append(' %s =\n ((%s)iface->%s);\n' % (temp_fp, + cast, + member.GetName())) + return_prefix = '' + if wrap_return: + result.append(' %s _struct_result;\n' % ret) + elif ret != 'void': + return_prefix = 'return ' + + result.append(' %stemp_fp(%s);\n' % (return_prefix, + self.FormatArgs('&', cspec))) + if wrap_return: + result.append(' return _struct_result;\n') + result.append('}\n\n') + return result + + + def GenerateRange(self, ast, releases, options): + """Generate shim code for a range of releases. + """ + self._skip_opt = GetOption('disable_pnacl_opt') + self.SetOutputFile(GetOption('pnaclshim')) + return WrapperGen.GenerateRange(self, ast, releases, options) + +pnaclgen = PnaclGen() + +###################################################################### +# Tests. + +# Clean a string representing an object definition and return then string +# as a single space delimited set of tokens. +def CleanString(instr): + instr = instr.strip() + instr = instr.split() + return ' '.join(instr) + + +def PrintErrorDiff(old, new): + oldlines = old.split(';') + newlines = new.split(';') + d = difflib.Differ() + diff = d.compare(oldlines, newlines) + ErrOut.Log('Diff is:\n%s' % '\n'.join(diff)) + + +def GetOldTestOutput(ast): + # Scan the top-level comments in the IDL file for comparison. + old = [] + for filenode in ast.GetListOf('File'): + for node in filenode.GetChildren(): + instr = node.GetOneOf('Comment') + if not instr: continue + instr.Dump() + old.append(instr.GetName()) + return CleanString(''.join(old)) + + +def TestFiles(filenames, test_releases): + ast = ParseFiles(filenames) + iface_releases = pnaclgen.DetermineInterfaces(ast, test_releases) + new_output = CleanString(pnaclgen.GenerateWrapperForMethods( + iface_releases, comments=False)) + old_output = GetOldTestOutput(ast) + if new_output != old_output: + PrintErrorDiff(old_output, new_output) + ErrOut.Log('Failed pnacl generator test.') + return 1 + else: + InfoOut.Log('Passed pnacl generator test.') + return 0 + + +def Main(args): + filenames = ParseOptions(args) + test_releases = ['M13', 'M14', 'M15'] + if not filenames: + idldir = os.path.split(sys.argv[0])[0] + idldir = os.path.join(idldir, 'test_gen_pnacl', '*.idl') + filenames = glob.glob(idldir) + filenames = sorted(filenames) + if GetOption('test'): + # Run the tests. + return TestFiles(filenames, test_releases) + + # Otherwise, generate the output file (for potential use as golden file). + ast = ParseFiles(filenames) + return pnaclgen.GenerateRange(ast, test_releases, filenames) + + +if __name__ == '__main__': + retval = Main(sys.argv[1:]) + sys.exit(retval) diff --git a/browser/extensions/mortar/ppapi/generators/idl_gen_rpc.py b/browser/extensions/mortar/ppapi/generators/idl_gen_rpc.py new file mode 100755 index 000000000000..cd71c6cae926 --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/idl_gen_rpc.py @@ -0,0 +1,669 @@ +#!/usr/bin/env python +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +""" Generator for C style prototypes and definitions """ + +import glob +import os +import re +import sys + +from idl_log import ErrOut, InfoOut, WarnOut +from idl_node import IDLNode +from idl_ast import IDLAst +from idl_option import GetOption, Option, ParseOptions +from idl_parser import ParseFiles +from idl_c_proto import CGen +from idl_c_header import GetHeaderFromNode, GenerateHeader +from idl_outfile import IDLOutFile + +Option('debug', 'Debug generate.') + +#API = namedtuple('API', ['interface', 'member', 'param']) + +customAPIs = { + ('PPB_CharSet_Dev', 'CharSetToUTF16', 'input'): { 'array': True, 'arrayType': 'uint8_t', 'arraySize': 'input_len' }, + ('PPB_CharSet_Dev', 'CharSetToUTF16', 'rval'): { 'convert': ' size_t length = iterator.expectArrayAndGotoFirstItem();\n rval = new uint16_t[length];\n for (size_t i = 0; i < length; ++i) {\n FromJSON_uint16_t(iterator, rval[i]);\n }\n' }, + ('PPB_Core', 'IsMainThread', None): { 'maybeNonMainThread': True }, + ('PPB_Core', 'CallOnMainThread', None): { 'maybeNonMainThread': True }, + ('PPB_Flash_MessageLoop', 'Quit', None): { 'maybeNonMainThread': True }, + ('PPB_Graphics3D', 'Create', 'attrib_list'): { 'arraySentinel': 'PP_GRAPHICS3DATTRIB_NONE' }, + ('PPB_MediaStreamAudioTrack', 'Configure', 'attrib_list'): { 'arraySentinel': 'PP_MEDIASTREAMAUDIOTRACK_ATTRIB_NONE' }, + ('PPB_OpenGLES2', 'DeleteBuffers', 'buffers'): { 'array': True, 'arrayType': 'GLuint', 'arraySize': 'n' }, + ('PPB_OpenGLES2', 'DeleteFramebuffers', 'framebuffers'): { 'array': True, 'arrayType': 'GLuint', 'arraySize': 'n' }, + ('PPB_OpenGLES2', 'DeleteRenderbuffers', 'renderbuffers'): { 'array': True, 'arrayType': 'GLuint', 'arraySize': 'n' }, + ('PPB_OpenGLES2', 'DeleteTextures', 'textures'): { 'array': True, 'arrayType': 'GLuint', 'arraySize': 'n' }, + ('PPB_OpenGLES2', 'GenBuffers', 'buffers'): { 'array': True, 'arrayType': 'GLuint', 'arraySize': 'n', 'create': False }, + ('PPB_OpenGLES2', 'GenTextures', 'textures'): { 'array': True, 'arrayType': 'GLuint', 'arraySize': 'n', 'create': False }, + ('PPB_OpenGLES2', 'ShaderSource', 'str'): { 'array': True, 'arrayType': 'str_t', 'arraySize': 'count', 'mode': 'in' }, + ('PPB_OpenGLES2', 'UniformMatrix3fv', 'value'): { 'array': True, 'arrayType': 'GLfloat', 'arraySize': 'count * 9', 'mode': 'in' }, + ('PPB_PDF', 'SearchString', 'results'): { 'arraySize': None }, + ('PPB_PDF', 'SetAccessibilityPageInfo', 'text_runs'): { 'arraySize': 'page_info->text_run_count' }, + ('PPB_PDF', 'SetAccessibilityPageInfo', 'chars'): { 'arraySize': 'page_info->char_count' }, + ('PPB_TCPSocket_Private', 'Write', 'buffer'): { 'array': True, 'arrayType': 'uint8_t', 'arraySize': 'bytes_to_write' }, +} +def getCustom(interface, member, param): + def matches(pattern, value): + return pattern == value or pattern == '*' + custom = list(v for (i, m, p), v in customAPIs.iteritems() if matches(interface, i) and matches(m, member) and matches(p, param)) + assert len(custom) <= 1 + return custom[0] if len(custom) == 1 else dict() + +class RPCGen(object): + def __init__(self): + self.cgen = CGen() + self.interfaceStructs = [] + self.pppInterfaceGetters = [] + + def AddProp(self, release, s, prefix, member, isOutParam=False, callnode=None, derefSizeIs=True): + out = '' + key = member.GetName() + if not member.InReleases([release]): + out += '/* skipping %s */\n' % key + return + type = member.GetType(release).GetName() + array = member.GetOneOf('Array') + interfaceMember = member.parent + interface = interfaceMember.parent.parent + customSerializer = getCustom(interface.GetName(), interfaceMember.GetName(), member.GetName()) + array = customSerializer.get('array', array) + isOutParam = customSerializer.get('isOutParam', isOutParam) + if isOutParam: + out += ' AddProp(' + s + ', "' + key + '", PointerToString(' + prefix + key + '));\n' + elif array: + if customSerializer: + type = customSerializer.get('arrayType', type) + count = array.GetProperty('FIXED') if isinstance(array, IDLNode) else None + if not count: + size_is = member.GetProperty('size_is()') + if size_is: + size_is = size_is[0] + count = prefix + size_is + if callnode: + for param in callnode.GetListOf('Param'): + if param.GetName() == size_is: + if self.cgen.GetParamMode(param) == 'out' and derefSizeIs: + count = '*' + count + break + else: + size_as = member.GetProperty('size_as') + count = size_as + if customSerializer: + count = customSerializer.get('arraySize', count) + out += ' {\n' + out += ' BeginProp(' + s + ', "' + key + '");\n' + out += ' BeginElements(' + s + ');\n' + out += ' for (uint32_t _n = 0; ' + if count: + out += '_n < ' + count + else: + sentinel = customSerializer.get('arraySentinel', '0') + out += prefix + key + '[_n] != ' + sentinel + out += '; ++_n) {\n' + out += ' AddElement(' + s + ', ToString_' + type + '(' + prefix + key + '[_n]));\n' + out += ' }\n' + out += ' EndElements(' + s + ');\n' + out += ' }\n' + else: + out += ' AddProp(' + s + ', "' + key + '", ToString_' + type + '(' + prefix + key + '));\n' + return out + + def FromJSON(self, release, prefix, outvalue, node, create, callnode=None): + out = '' + type = node.GetType(release).GetName() + array = node.GetOneOf('Array') + interfaceMember = node.parent + interface = interfaceMember.parent.parent + customParser = getCustom(interface.GetName(), interfaceMember.GetName(), node.GetName()) + array = customParser.get('array', array) + create = customParser.get('create', create) + name = node.GetName() + outvalue = prefix + outvalue + if array: + if customParser: + type = customParser.get('arrayType', type) + fixed = array.GetProperty('FIXED') if isinstance(array, IDLNode) else None + count = fixed + if type == 'char': + assert count > 0 + out += ' FromJSON_charArray(iterator, ' + outvalue + ', ' + str(count) + ');\n' + else: + if not count: + size_is = node.GetProperty('size_is()') + if size_is: + size_is = size_is[0] + count = prefix + size_is + if callnode: + for param in callnode.GetListOf('Param'): + if param.GetName() == size_is: + if self.cgen.GetParamMode(param) == 'out': + count = '*' + count + break + else: + size_as = node.GetProperty('size_as') + count = size_as + if customParser: + count = customParser.get('arraySize', count) + out += '\n' + out += ' {\n' + out += ' size_t children = iterator.expectArrayAndGotoFirstItem();\n' + if count: + out += ' if (children > ' + count + ') {\n' + out += ' Fail("Too many items in array\\n", "");\n' + out += ' }\n' + if create and not fixed: + if not count: + count = 'children' + out += ' ' + outvalue + ' = new ' + self.cgen.GetTypeByMode(node, release, 'store') + '[' + count + '];\n' + out += ' for (uint32_t _n = 0; _n < children; ++_n) {\n' + out += ' FromJSON_' + type + '(iterator, (' + outvalue + ')[_n]);\n' + out += ' }\n' + out += ' // FIXME Null out remaining items?\n' + out += ' }\n' + else: + out += ' FromJSON_' + type + '(iterator, ' + outvalue + ');\n' + return out + + def MemberFromJSON(self, release, prefix, member, create): + key = member.GetName() + if not member.InReleases([release]): + return '/* skipping %s */\n' % key + return self.FromJSON(release, prefix, key, member, create) + + DerefOutType = { + 'Array': { 'out': '*' }, + 'Enum': '*', + 'Struct': '*', + 'cstr_t': '*', + 'TypeValue': '*', + } + + def DefineInterfaceMethodSerializer(self, iface, releases, node, release): + customSerializer = getCustom(iface.GetName(), node.GetName(), None) + if not node.InReleases([release]): + return '/* skipping %s */\n' % node.GetName() + if customSerializer and customSerializer.get('skip', False): + return self.cgen.GetSignature(node, release, 'ref', '', func_as_ptr=False, include_version=True) + ";\n" + out = '' + out += 'static ' + out += self.cgen.GetSignature(node, release, 'ref', '', func_as_ptr=False, include_version=True) + out += ' {\n' + out += ' stringstream ss;\n' + out += ' BeginProps(ss);\n' + out += ' AddProp(ss, "__interface", "\\"' + iface.GetName() + '\\"");\n' + out += ' AddProp(ss, "__version", "\\"' + iface.GetVersion(release) + '\\"");\n' + out += ' AddProp(ss, "__method", "\\"' + node.GetName() + '\\"");\n' + callnode = node.GetOneOf('Callspec') + hasOutParams = False + if callnode: + for param in callnode.GetListOf('Param'): + mode = self.cgen.GetParamMode(param) + ntype, mode = self.cgen.GetRootTypeMode(param, release, mode) + mode = getCustom(param.parent.parent.parent.GetName(), param.parent.GetName(), param.GetName()).get('mode', mode) + if mode == "out" or mode == "inout": + hasOutParams = hasOutParams or not (ntype == 'mem_t' and mode == "inout") + out += self.AddProp(release, 'ss', '', param, mode == "out", callnode) + out += ' EndProps(ss);\n' + if node.GetProperty('ref'): + mode = 'ref' + else: + mode = 'store' + rtype = self.cgen.GetTypeByMode(node.GetType(release), release, 'store') + out += '#ifndef INTERPOSE\n' + out += ' ' + if rtype != 'void' or hasOutParams: + out += 'string json = RPCWithResult' + else: + out += 'RPC' + if customSerializer and customSerializer.get('maybeNonMainThread', False): + out += '' + else: + out += '' + out += '(ss);\n' + if rtype != 'void' or hasOutParams: + if rtype != 'void': + out += ' ' + rtype + ' rval;\n' + out += ' JSONIterator iterator(json);\n' + out += ' iterator.expectArrayAndGotoFirstItem();\n' + if hasOutParams: + out += ' iterator.expectArrayAndGotoFirstItem();\n' + if rtype != 'void': + customRval = getCustom(iface.GetName(), node.GetName(), "rval").get('convert') + if customRval: + out += customRval + else: + out += ' FromJSON_' + node.GetType(release).GetName() + '(iterator, rval);\n' + if hasOutParams: + out += ' iterator.expectObjectAndGotoFirstProperty();\n' + for param in callnode.GetListOf('Param'): + mode = self.cgen.GetParamMode(param) + ntype, mode = self.cgen.GetRootTypeMode(param, release, mode) + mode = getCustom(param.parent.parent.parent.GetName(), param.parent.GetName(), param.GetName()).get('mode', mode) + if mode == "out" or mode == "inout": + if ntype == 'mem_t' and mode == "inout": + continue; + if ntype == 'Struct' and mode == 'out': + out += ' if (!!' + param.GetName() + ') {\n' + to_indent = ' iterator.skip();\n' + deref = self.DerefOutType.get(ntype, '') + if isinstance(deref, dict): + deref = deref.get(mode, '') + to_indent += self.FromJSON(release, '', deref + param.GetName(), param, mode == 'out', callnode) + if ntype == 'Struct' and mode == 'out': + out += re.sub(r"(^|\n)(?!(\n|$))", r'\1' + (2 * ' '), to_indent) + out += ' }\n' + else: + out += to_indent + if rtype != 'void': + out += ' return rval;\n' + out += '#else // !INTERPOSE\n' + out += ' printf("%s\\n", ss.str().c_str());\n' + #out += ' printf("Calling: %p\\n", RealGetInterface("' + self.cgen.GetInterfaceString(iface, iface.GetVersion(release)) + '"));\n' + #out += ' printf(" -> %p\\n", ((' + self.cgen.GetStructName(iface, release, include_version=True) + '*)RealGetInterface("' + self.cgen.GetInterfaceString(iface, iface.GetVersion(release)) + '"))->' + node.GetName() + ');\n' + out += ' ' + rtype = self.cgen.GetTypeByMode(node.GetType(release), release, 'return') + params = [] + for param in callnode.GetListOf('Param'): + mode = self.cgen.GetParamMode(param) + ntype, mode = self.cgen.GetRootTypeMode(param, release, mode) + if mode == "in" and param.GetType(release).GetName() == 'PP_CompletionCallback': + out += 'PP_CompletionCallback logging_' + param.GetName() + ';\n' + out += ' logging_' + param.GetName() + '.func = &Logging_PP_CompletionCallback;\n' + out += ' logging_' + param.GetName() + '.user_data = new PP_CompletionCallback(' + param.GetName() + ');\n' + out += ' logging_' + param.GetName() + '.flags = ' + param.GetName() + '.flags;\n' + out += ' ' + params.append('logging_' + param.GetName()) + elif mode == "in" and param.GetType(release).GetName() == 'PPP_Class_Deprecated': + out += 'Logging_PPP_Class_Deprecated_holder* logging_' + param.GetName() + ' = new Logging_PPP_Class_Deprecated_holder();\n' + out += ' logging_' + param.GetName() + '->_real_PPP_Class_Deprecated = ' + param.GetName() + ';\n' + out += ' logging_' + param.GetName() + '->object = object_data;\n' + out += ' object_data = logging_' + param.GetName() + ';\n' + out += ' ' + params.append('&_interpose_PPP_Class_Deprecated_1_0') + elif mode == "return" and param.GetType(release).GetName() == 'PPB_Audio_Callback' and param.GetVersion(release) == "1.0": + out += 'Logging_PPB_Audio_Callback_1_0_holder* ' + param.GetName() + '_holder = new Logging_PPB_Audio_Callback_1_0_holder();\n' + out += ' ' + param.GetName() + '_holder->func = ' + param.GetName() + ';\n' + out += ' ' + param.GetName() + '_holder->user_data = user_data;\n' + out += ' user_data = ' + param.GetName() + '_holder;\n' + out += ' ' + params.append('Logging_PPB_Audio_Callback_1_0') + else: + params.append(param.GetName()) + if rtype != 'void': + out += rtype + ' rval = ' + out += '((' + self.cgen.GetStructName(iface, release, include_version=True) + '*)RealGetInterface("' + self.cgen.GetInterfaceString(iface, iface.GetVersion(release)) + '"))->' + node.GetName() + '(' + ', '.join(params) + ');\n' + if rtype != 'void' or hasOutParams: + out += ' printf("RPC response: [");\n' + if hasOutParams: + out += ' printf("[");\n' + if rtype != 'void': + out += ' printf("%s", ToString_' + node.GetType(release).GetName() + '(rval).c_str());\n' + if hasOutParams: + if rtype != 'void': + out += ' printf(",");\n' + out += ' std::stringstream os;\n' + out += ' BeginProps(os);\n' + for param in callnode.GetListOf('Param'): + mode = self.cgen.GetParamMode(param) + ntype, mode = self.cgen.GetRootTypeMode(param, release, mode) + if mode == "out" or mode == "inout": + if mode == "out" and (ntype == 'Struct' or ntype == 'TypeValue'): + out += ' if (!!' + param.GetName() + ') {\n' + out += self.AddProp(release, 'os', '', param, False, callnode) + if mode == "out" and (ntype == 'Struct' or ntype == 'TypeValue'): + out += ' }\n' + out += ' EndProps(os);\n' + out += ' printf("%s]", os.str().c_str());\n' + out += ' printf("]\\n");\n' + if rtype != 'void': + out += ' return rval;\n' + out += '#endif // !INTERPOSE\n' + out += '}\n' + return out + + def DefineInterfaceMethodParser(self, iface, releases, node, release): + if not node.InReleases([release]): + return '/* skipping %s */\n' % node.GetName() + version = self.GetNodeName(iface, release, releases) + out = '' + out += 'char* Call_%s_%s(const %s* _interface, JSONIterator& iterator) {\n' % (iface.GetName(), node.GetName(), version) + callnode = node.GetOneOf('Callspec') + params = [] + hasOutParams = False + for param in callnode.GetListOf('Param'): + mode = self.cgen.GetParamMode(param) + ptype, pname, parray, pspec = self.cgen.GetComponents(param, release, "store") + out += ' ' + self.cgen.Compose(ptype, pname, parray, pspec, '', func_as_ptr=True, + include_name=True, unsized_as_ptr=True) + ';\n' + if mode == 'out': + if len(parray) > 0: + out += ' iterator.skip();\n' + out += ' PointerValueFromJSON(iterator, ' + pname + ');\n' + else: + out += ' iterator.skip();\n' + out += self.FromJSON(release, '', pname, param, True, callnode) + hasOutParams = hasOutParams or mode == "out" or mode == "inout" + if node.GetProperty('ref'): + mode = 'ref' + else: + mode = 'store' + rtype = self.cgen.GetTypeByMode(node.GetType(release), release, 'store') + out += ' ' + if rtype != 'void': + out += rtype + ' rval;\n' + out += ' rval = ' + params = [] + for param in callnode.GetListOf('Param'): + mode = self.cgen.GetParamMode(param) + ntype, mode = self.cgen.GetRootTypeMode(param, release, mode) + ptype, pname, parray, pspec = self.cgen.GetComponents(param, release, mode) + if mode == 'out' or ntype == 'Struct' or (mode == 'constptr_in' and ntype == 'TypeValue'): + pname = '&' + pname + pname = '(' + self.cgen.Compose(ptype, pname, parray, pspec, '', func_as_ptr=True, + include_name=False, unsized_as_ptr=True) + ')' + pname + params.append(pname) + out += '_interface->' + node.GetName() + '(' + ", ".join(params) + ');\n' + if rtype != 'void' or hasOutParams: + typeref = node.GetType(release) + if hasOutParams: + out += ' stringstream os;\n' + out += ' BeginElements(os);\n' + if rtype != 'void': + out += ' AddElement(os, ToString_' + typeref.GetName() + '(rval).c_str());\n' + out += ' BeginElement(os);\n' + out += ' BeginProps(os);\n' + for param in callnode.GetListOf('Param'): + mode = self.cgen.GetParamMode(param) + ntype, mode = self.cgen.GetRootTypeMode(param, release, mode) + ptype, pname, parray, pspec = self.cgen.GetComponents(param, release, mode) + if mode == 'out' or mode == 'inout': + out += self.AddProp(release, 'os', '', param, False, callnode, derefSizeIs=False) + out += ' EndProps(os);\n' + out += ' EndElements(os);\n' + out += ' return strdup(os.str().c_str());\n' + else: + out += ' return strdup(ToString_' + typeref.GetName() + '(rval).c_str());\n' + else: + out += ' return nullptr;\n' + out += '}\n' + return out + + def DefineInterface(self, node, releases, declareOnly): + out = '' + if node.GetName() == "PPB_NaCl_Private": + # skip + return out + isPPP = node.GetName()[0:4] == "PPP_" + build_list = node.GetUniqueReleases(releases) + for release in build_list: + name = self.cgen.GetStructName(node, release, include_version=True) + if declareOnly: + out += '#ifdef INTERPOSE\n' + out += 'static ' + name + ' *_real_' + name + ';\n' + out += '#endif // INTERPOSE\n' + if isPPP: + version = self.GetNodeName(node, release, build_list) + if declareOnly: + out += 'static char* Call_%s(void* _interface, JSONIterator& iterator);\n' % (version) + continue + members = node.GetListOf('Member') + for member in members: + out += self.DefineInterfaceMethodParser(node, build_list, member, release) + out += 'char* Call_%s(const void* _interface, JSONIterator& iterator) {\n' % (version) + out += ' iterator.skip();\n' + out += ' const Token& member = iterator.getCurrentStringAndGotoNext();\n' + out += ' string memberName = member.value();\n' + for member in members: + if not member.InReleases([release]): + out += '/* skipping %s */\n' % member.GetName() + continue + out += ' if (!memberName.compare("' + member.GetName() + '")) {\n' + out += ' return Call_' + node.GetName() + '_' + member.GetName() + '((const ' + version + '*)_interface, iterator);\n' + out += ' }\n' + out += ' return nullptr;\n' + out += '}\n' + self.pppInterfaceGetters.append((self.cgen.GetInterfaceString(node, node.GetVersion(release)), 'Call_' + version)) + continue + version = self.cgen.GetStructName(node, release, include_version=True) + if declareOnly: + out += 'const string ToString_%s(const %s *v);\n' % (node.GetName(), version) + continue + ns = 'ns_' + version + out += 'namespace ' + ns + ' {\n' + members = node.GetListOf('Member') + for member in members: + out += self.DefineInterfaceMethodSerializer(node, releases, member, release) + out += '}\n' + self.interfaceStructs.append((self.cgen.GetInterfaceString(node, node.GetVersion(release)), '_' + name)) + out += 'static ' + name + ' _' + name + ' = {\n' + for member in members: + if not member.InReleases([release]): + continue + memberName = self.cgen.GetStructName(member, release, True) + out += ' ' + ns + '::' + memberName + ',\n' + out += '};\n' + out += 'const string ToString_%s(const %s *v) {\n' % (node.GetName(), version) + out += ' stringstream s;\n' + out += ' s << v;\n' + out += ' return s.str();\n' + out += '}\n' + return out + + def GetNodeName(self, node, release, build_list): + return self.cgen.GetStructName(node, release, include_version=(release != build_list[-1])) + + @staticmethod + def SerializerAndParserSignatures(typename, type): + s = ('const string ToString_%s(const %s *v)', + 'const string ToString_%s(const %s &v)', + 'void FromJSON_%s(JSONIterator& iterator, %s &value)') + return (sig % (typename, type) for sig in s) + + def DefineTypedefSerializerAndParser(self, node, releases, declareOnly): + out = '' + build_list = node.GetUniqueReleases(releases) + for release in build_list: + type = self.GetNodeName(node, release, build_list) + typeref = node.GetType(release) + (toStringFromPointer, toStringFromRef, fromJSONToRef) = self.SerializerAndParserSignatures(node.GetName(), type) + isFuncPtr = node.GetOneOf('Callspec') + if declareOnly: + if not isFuncPtr: + out += toStringFromPointer + ";\n" + out += toStringFromRef + ";\n" + out += fromJSONToRef + ";\n" + continue + if not isFuncPtr: + out += toStringFromPointer + ' {\n' + out += ' return ToString_%s(v);\n' % (typeref.GetName()) + out += '}\n' + out += toStringFromRef + ' {\n' + if isFuncPtr: + out += ' return PointerToString(v);\n' + else: + out += ' return ToString_%s(&v);\n' % (node.GetName()) + out += '}\n' + out += fromJSONToRef + ' {\n' + if isFuncPtr: + out += ' PointerValueFromJSON(iterator, value);\n' + else: + out += ' FromJSON_%s(iterator, value);\n' % (typeref.GetName()) + out += '}\n' + return out + + def DefineStructSerializerAndParser(self, node, releases, declareOnly): + out = '' + build_list = node.GetUniqueReleases(releases) + for release in build_list: + name = node.GetName() + version = self.GetNodeName(node, release, build_list) + (toStringFromPointer, toStringFromRef, fromJSONToRef) = self.SerializerAndParserSignatures(name, version) + if declareOnly: + out += toStringFromPointer + ";\n" + out += toStringFromRef + ";\n" + out += fromJSONToRef + ";\n" + continue + out += toStringFromPointer + ' {\n' + out += ' if (!v) {\n' + out += ' return "null";\n' + out += ' }\n' + out += ' return ToString_%s(*v);\n' % (name) + out += '}\n' + out += toStringFromRef + ' {\n' + out += ' stringstream x;\n' + out += ' BeginProps(x);\n' + members = node.GetListOf('Member') + for member in members: + out += self.AddProp(release, 'x', 'v.', member) + out += ' EndProps(x);\n' + out += ' return x.str();\n' + out += '}\n' + out += fromJSONToRef + ' {\n' + out += ' const JSON::Token& current = iterator.getCurrentAndGotoNext();\n' + # FIXME Should we warn here somehow? It might be ok to return null in + # error conditions, so maybe not. + out += ' if (current.isPrimitive() && !current.value().compare("null")) {\n' + out += ' return;\n' + out += ' }\n' + out += ' if (!current.isObject()) {\n' + out += ' Fail("Expected object!", "");\n' + out += ' }\n' + if node.GetProperty('union'): + out += ' string name = iterator.getCurrentStringAndGotoNext().value();\n' + out += " else ".join(map(lambda m: ' if (!name.compare(\"' + m.GetName() + '\")) {\n ' + self.MemberFromJSON(release, 'value.', m, False) + ' }', members)) + "\n" + else: + for member in members: + typeref = member.GetType(release) + out += ' iterator.skip();\n' + out += self.MemberFromJSON(release, 'value.', member, False) + out += '}\n' + return out + + def DefineEnumSerializerAndParser(self, node, releases, declareOnly): + if node.GetProperty('unnamed'): + return '' + out = '' + name = node.GetName() + (toStringFromPointer, toStringFromRef, fromJSONToRef) = self.SerializerAndParserSignatures(name, name) + if declareOnly: + out += toStringFromPointer + ";\n" + out += toStringFromRef + ";\n" + out += fromJSONToRef + ";\n" + return out + out += toStringFromPointer + ' {\n' + out += ' switch (*v) {\n' + next = 0 + emitted = set() + for child in node.GetListOf('EnumItem'): + value = child.GetName() + label = child.GetProperty('VALUE') + if not label: + label = str(next) + next = next + 1 + if label in emitted: + continue + emitted.add(label) + emitted.add(value) + out += ' case ' + label + ':\n' + out += ' return "\\"' + value + '\\"";\n' + out += ' default:\n' + out += ' return "\\"???\\"";\n' + out += ' }\n' + out += '}\n' + out += toStringFromRef + ' {\n' + out += ' return ToString_%s(&v);\n' % (name) + out += '}\n' + out += fromJSONToRef + ' {\n' + out += ' long int v;\n' + out += ' FromJSON_int(iterator, v);\n' + out += ' value = %s(v);\n' % (name) + out += '}\n' + return out + + def Define(self, node, releases, declareOnly): + # Skip if this node is not in this release + if not node.InReleases(releases): + return "/* skipping %s */\n" % node + if node.IsA('Typedef'): + return self.DefineTypedefSerializerAndParser(node, releases, declareOnly) + if node.IsA('Struct'): + return self.DefineStructSerializerAndParser(node, releases, declareOnly) + if node.IsA('Enum'): + return self.DefineEnumSerializerAndParser(node, releases, declareOnly) + if node.IsA('Interface'): + return self.DefineInterface(node, releases, declareOnly) + return '' + +def GetIncludes(f, releases): + deps = set() + for release in releases: + deps |= f.GetDeps(release) + includes = set([]) + for dep in deps: + depfile = dep.GetProperty('FILE') + if depfile: + includes.add(depfile) + return includes + +def GenerateDep(outfile, emitted, f, releases): + includes = GetIncludes(f, releases) + for include in includes: + if include in emitted: + continue + emitted.add(include) + GenerateDep(outfile, emitted, include, releases) + outfile.Write('/* ' + include.GetName() + ' */') + GenerateHeader(outfile, include, releases) + +def main(args): + filenames = ParseOptions(args) + ast = ParseFiles(filenames) + rpcgen = RPCGen() + files = ast.GetListOf('File') + outname = GetOption('out') + if outname == '': + outname = 'out.cc' + outfile = IDLOutFile(outname) + emitted = set() + for f in files: + if f.GetName() == 'pp_macros.idl': + GenerateDep(outfile, emitted, f, ast.releases) + for f in files: + GenerateDep(outfile, emitted, f, ast.releases) + out = '' + out += '#include "host/rpc.h"\n' + out += '#include "json/json.cpp"\n' + out += 'using namespace std;\n' + out += 'using namespace JSON;\n' + for declareOnly in [True,False]: + for f in files: + if f.GetProperty('ERRORS') > 0: + print 'Skipping %s' % f.GetName() + continue + for node in f.GetChildren()[2:]: + out += rpcgen.Define(node, ast.releases, declareOnly) + out += 'static map gInterfaces;\n' + out += '\n' + out += 'typedef char* (*InterfaceMemberCallFunc)(const void*, JSONIterator&);\n' + out += 'static map gInterfaceMemberCallers;\n' + out += '\n' + out += 'void InitializeInterfaceList() {\n' + for (interfaceString, interfaceStruct) in rpcgen.interfaceStructs: + if interfaceString == "PPB_Flash_File_FileRef;2.0": + interfaceString = "PPB_Flash_File_FileRef;2" + elif interfaceString == "PPB_Flash_File_ModuleLocal;3.0": + interfaceString = "PPB_Flash_File_ModuleLocal;3" + elif interfaceString == "PPB_PDF;0.1": + interfaceString = "PPB_PDF;1" + out += ' gInterfaces.insert(pair("' + interfaceString + '", &' + interfaceStruct + '));\n' + for (interfaceString, caller) in rpcgen.pppInterfaceGetters: + out += ' gInterfaceMemberCallers.insert(pair("' + interfaceString + '", ' + caller + '));\n' + out += '};\n' + out += '\n' + outfile.Write(out); + outfile.Close() + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/browser/extensions/mortar/ppapi/generators/idl_gen_wrapper.py b/browser/extensions/mortar/ppapi/generators/idl_gen_wrapper.py new file mode 100644 index 000000000000..5d38eff8c9a9 --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/idl_gen_wrapper.py @@ -0,0 +1,438 @@ +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Base class for generating wrapper functions for PPAPI methods. +""" + +from datetime import datetime +import os +import sys + +from idl_c_proto import CGen +from idl_generator import Generator +from idl_log import ErrOut, InfoOut, WarnOut +from idl_option import GetOption +from idl_outfile import IDLOutFile + + +class PPKind(object): + @staticmethod + def ChoosePPFunc(iface, ppb_func, ppp_func): + name = iface.node.GetName() + if name.startswith("PPP"): + return ppp_func + elif name.startswith("PPB"): + return ppb_func + else: + raise Exception('Unknown PPKind for ' + name) + + +class Interface(object): + """Tracks information about a particular interface version. + + - struct_name: the struct type used by the ppapi headers to hold the + method pointers (the vtable). + - needs_wrapping: True if a method in the interface needs wrapping. + - header_file: the name of the header file that defined this interface. + """ + def __init__(self, interface_node, release, version, + struct_name, needs_wrapping, header_file): + self.node = interface_node + self.release = release + self.version = version + self.struct_name = struct_name + # We may want finer grained filtering (method level), but it is not + # yet clear how to actually do that. + self.needs_wrapping = needs_wrapping + self.header_file = header_file + + +class WrapperGen(Generator): + """WrapperGen - An abstract class that generates wrappers for PPAPI methods. + + This generates a wrapper PPB and PPP GetInterface, which directs users + to wrapper PPAPI methods. Wrapper PPAPI methods may perform arbitrary + work before invoking the real PPAPI method (supplied by the original + GetInterface functions). + + Subclasses must implement GenerateWrapperForPPBMethod (and PPP). + """ + + def __init__(self, wrapper_prefix, s1, s2, s3): + Generator.__init__(self, s1, s2, s3) + self.wrapper_prefix = wrapper_prefix + self._skip_opt = False + self.output_file = None + self.cgen = CGen() + + def SetOutputFile(self, fname): + self.output_file = fname + + + def GenerateRelease(self, ast, release, options): + return self.GenerateRange(ast, [release], options) + + + @staticmethod + def GetHeaderName(name): + """Get the corresponding ppapi .h file from each IDL filename. + """ + name = os.path.splitext(name)[0] + '.h' + name = name.replace(os.sep, '/') + return 'ppapi/c/' + name + + + def WriteCopyright(self, out): + now = datetime.now() + c = """/* Copyright (c) %s The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* NOTE: this is auto-generated from IDL */ +""" % now.year + out.Write(c) + + def GetWrapperMetadataName(self): + return '__%sWrapperInfo' % self.wrapper_prefix + + + def GenerateHelperFunctions(self, out): + """Generate helper functions to avoid dependencies on libc. + """ + out.Write("""/* Use local strcmp to avoid dependency on libc. */ +static int mystrcmp(const char* s1, const char *s2) { + while (1) { + if (*s1 == 0) break; + if (*s2 == 0) break; + if (*s1 != *s2) break; + ++s1; + ++s2; + } + return (int)(*s1) - (int)(*s2); +}\n +""") + + + def GenerateFixedFunctions(self, out): + """Write out the set of constant functions (those that do not depend on + the current Pepper IDL). + """ + out.Write(""" + +static PPB_GetInterface __real_PPBGetInterface; +static PPP_GetInterface_Type __real_PPPGetInterface; + +void __set_real_%(wrapper_prefix)s_PPBGetInterface(PPB_GetInterface real) { + __real_PPBGetInterface = real; +} + +void __set_real_%(wrapper_prefix)s_PPPGetInterface(PPP_GetInterface_Type real) { + __real_PPPGetInterface = real; +} + +/* Map interface string -> wrapper metadata */ +static struct %(wrapper_struct)s *%(wrapper_prefix)sPPBShimIface( + const char *name) { + struct %(wrapper_struct)s **next = s_ppb_wrappers; + while (*next != NULL) { + if (mystrcmp(name, (*next)->iface_macro) == 0) return *next; + ++next; + } + return NULL; +} + +/* Map interface string -> wrapper metadata */ +static struct %(wrapper_struct)s *%(wrapper_prefix)sPPPShimIface( + const char *name) { + struct %(wrapper_struct)s **next = s_ppp_wrappers; + while (*next != NULL) { + if (mystrcmp(name, (*next)->iface_macro) == 0) return *next; + ++next; + } + return NULL; +} + +const void *__%(wrapper_prefix)s_PPBGetInterface(const char *name) { + struct %(wrapper_struct)s *wrapper = %(wrapper_prefix)sPPBShimIface(name); + if (wrapper == NULL) { + /* We did not generate a wrapper for this, so return the real interface. */ + return (*__real_PPBGetInterface)(name); + } + + /* Initialize the real_iface if it hasn't been. The wrapper depends on it. */ + if (wrapper->real_iface == NULL) { + const void *iface = (*__real_PPBGetInterface)(name); + if (NULL == iface) return NULL; + wrapper->real_iface = iface; + } + + return wrapper->wrapped_iface; +} + +const void *__%(wrapper_prefix)s_PPPGetInterface(const char *name) { + struct %(wrapper_struct)s *wrapper = %(wrapper_prefix)sPPPShimIface(name); + if (wrapper == NULL) { + /* We did not generate a wrapper for this, so return the real interface. */ + return (*__real_PPPGetInterface)(name); + } + + /* Initialize the real_iface if it hasn't been. The wrapper depends on it. */ + if (wrapper->real_iface == NULL) { + const void *iface = (*__real_PPPGetInterface)(name); + if (NULL == iface) return NULL; + wrapper->real_iface = iface; + } + + return wrapper->wrapped_iface; +} +""" % { 'wrapper_struct' : self.GetWrapperMetadataName(), + 'wrapper_prefix' : self.wrapper_prefix, + } ) + + + ############################################################ + + def OwnHeaderFile(self): + """Return the header file that specifies the API of this wrapper. + We do not generate the header files. """ + raise Exception('Child class must implement this') + + + ############################################################ + + def DetermineInterfaces(self, ast, releases): + """Get a list of interfaces along with whatever metadata we need. + """ + iface_releases = [] + for filenode in ast.GetListOf('File'): + # If this file has errors, skip it + if filenode in self.skip_list: + if GetOption('verbose'): + InfoOut.Log('WrapperGen: Skipping %s due to errors\n' % + filenode.GetName()) + continue + + file_name = self.GetHeaderName(filenode.GetName()) + ifaces = filenode.GetListOf('Interface') + for iface in ifaces: + releases_for_iface = iface.GetUniqueReleases(releases) + for release in releases_for_iface: + version = iface.GetVersion(release) + struct_name = self.cgen.GetStructName(iface, release, + include_version=True) + needs_wrap = self.InterfaceVersionNeedsWrapping(iface, version) + if not needs_wrap: + if GetOption('verbose'): + InfoOut.Log('Interface %s ver %s does not need wrapping' % + (struct_name, version)) + iface_releases.append( + Interface(iface, release, version, + struct_name, needs_wrap, file_name)) + return iface_releases + + + def GenerateIncludes(self, iface_releases, out): + """Generate the list of #include that define the original interfaces. + """ + self.WriteCopyright(out) + # First include own header. + out.Write('#include "%s"\n\n' % self.OwnHeaderFile()) + + # Get typedefs for PPB_GetInterface. + out.Write('#include "%s"\n' % self.GetHeaderName('ppb.h')) + + # Only include headers where *some* interface needs wrapping. + header_files = set() + for iface in iface_releases: + if iface.needs_wrapping: + header_files.add(iface.header_file) + for header in sorted(header_files): + out.Write('#include "%s"\n' % header) + out.Write('\n') + + + def WrapperMethodPrefix(self, iface, release): + return '%s_%s_%s_' % (self.wrapper_prefix, release, iface.GetName()) + + + def GenerateWrapperForPPBMethod(self, iface, member): + result = [] + func_prefix = self.WrapperMethodPrefix(iface.node, iface.release) + sig = self.cgen.GetSignature(member, iface.release, 'store', + func_prefix, False) + result.append('static %s {\n' % sig) + result.append(' while(1) { /* Not implemented */ } \n') + result.append('}\n') + return result + + + def GenerateWrapperForPPPMethod(self, iface, member): + result = [] + func_prefix = self.WrapperMethodPrefix(iface.node, iface.release) + sig = self.cgen.GetSignature(member, iface.release, 'store', + func_prefix, False) + result.append('static %s {\n' % sig) + result.append(' while(1) { /* Not implemented */ } \n') + result.append('}\n') + return result + + + def GenerateWrapperForMethods(self, iface_releases, comments=True): + """Return a string representing the code for each wrapper method + (using a string rather than writing to the file directly for testing.) + """ + result = [] + for iface in iface_releases: + if not iface.needs_wrapping: + if comments: + result.append('/* Not generating wrapper methods for %s */\n\n' % + iface.struct_name) + continue + if comments: + result.append('/* Begin wrapper methods for %s */\n\n' % + iface.struct_name) + generator = PPKind.ChoosePPFunc(iface, + self.GenerateWrapperForPPBMethod, + self.GenerateWrapperForPPPMethod) + for member in iface.node.GetListOf('Member'): + # Skip the method if it's not actually in the release. + if not member.InReleases([iface.release]): + continue + result.extend(generator(iface, member)) + if comments: + result.append('/* End wrapper methods for %s */\n\n' % + iface.struct_name) + return ''.join(result) + + + def GenerateWrapperInterfaces(self, iface_releases, out): + for iface in iface_releases: + if not iface.needs_wrapping: + out.Write('/* Not generating wrapper interface for %s */\n\n' % + iface.struct_name) + continue + + out.Write('static const struct %s %s_Wrappers_%s = {\n' % ( + iface.struct_name, self.wrapper_prefix, iface.struct_name)) + methods = [] + for member in iface.node.GetListOf('Member'): + # Skip the method if it's not actually in the release. + if not member.InReleases([iface.release]): + continue + prefix = self.WrapperMethodPrefix(iface.node, iface.release) + # Casts are necessary for the PPB_* wrappers because we must + # cast away "__attribute__((pnaclcall))". The PPP_* wrappers + # must match the default calling conventions and so don't have + # the attribute, so omitting casts for them provides a little + # extra type checking. + if iface.node.GetName().startswith('PPB_'): + cast = '(%s)' % self.cgen.GetSignature( + member, iface.release, 'return', + prefix='', + func_as_ptr=True, + include_name=False) + else: + cast = '' + methods.append(' .%s = %s&%s%s' % (member.GetName(), + cast, + prefix, + member.GetName())) + out.Write(' ' + ',\n '.join(methods) + '\n') + out.Write('};\n\n') + + + def GetWrapperInfoName(self, iface): + return '%s_WrapperInfo_%s' % (self.wrapper_prefix, iface.struct_name) + + + def GenerateWrapperInfoAndCollection(self, iface_releases, out): + for iface in iface_releases: + iface_macro = self.cgen.GetInterfaceMacro(iface.node, iface.version) + if iface.needs_wrapping: + wrap_iface = '(const void *) &%s_Wrappers_%s' % (self.wrapper_prefix, + iface.struct_name) + out.Write("""static struct %s %s = { + .iface_macro = %s, + .wrapped_iface = %s, + .real_iface = NULL +};\n\n""" % (self.GetWrapperMetadataName(), + self.GetWrapperInfoName(iface), + iface_macro, + wrap_iface)) + + # Now generate NULL terminated arrays of the above wrapper infos. + ppb_wrapper_infos = [] + ppp_wrapper_infos = [] + for iface in iface_releases: + if iface.needs_wrapping: + appender = PPKind.ChoosePPFunc(iface, + ppb_wrapper_infos.append, + ppp_wrapper_infos.append) + appender(' &%s' % self.GetWrapperInfoName(iface)) + ppb_wrapper_infos.append(' NULL') + ppp_wrapper_infos.append(' NULL') + out.Write( + 'static struct %s *s_ppb_wrappers[] = {\n%s\n};\n\n' % + (self.GetWrapperMetadataName(), ',\n'.join(ppb_wrapper_infos))) + out.Write( + 'static struct %s *s_ppp_wrappers[] = {\n%s\n};\n\n' % + (self.GetWrapperMetadataName(), ',\n'.join(ppp_wrapper_infos))) + + + def DeclareWrapperInfos(self, iface_releases, out): + """The wrapper methods usually need access to the real_iface, so we must + declare these wrapper infos ahead of time (there is a circular dependency). + """ + out.Write('/* BEGIN Declarations for all Wrapper Infos */\n\n') + for iface in iface_releases: + if iface.needs_wrapping: + out.Write('static struct %s %s;\n' % + (self.GetWrapperMetadataName(), + self.GetWrapperInfoName(iface))) + out.Write('/* END Declarations for all Wrapper Infos. */\n\n') + + + def GenerateRange(self, ast, releases, options): + """Generate shim code for a range of releases. + """ + + # Remember to set the output filename before running this. + out_filename = self.output_file + if out_filename is None: + ErrOut.Log('Did not set filename for writing out wrapper\n') + return 1 + + InfoOut.Log("Generating %s for %s" % (out_filename, self.wrapper_prefix)) + + out = IDLOutFile(out_filename) + + # Get a list of all the interfaces along with metadata. + iface_releases = self.DetermineInterfaces(ast, releases) + + # Generate the includes. + self.GenerateIncludes(iface_releases, out) + + # Write out static helper functions (mystrcmp). + self.GenerateHelperFunctions(out) + + # Declare list of WrapperInfo before actual wrapper methods, since + # they reference each other. + self.DeclareWrapperInfos(iface_releases, out) + + # Generate wrapper functions for each wrapped method in the interfaces. + result = self.GenerateWrapperForMethods(iface_releases) + out.Write(result) + + # Collect all the wrapper functions into interface structs. + self.GenerateWrapperInterfaces(iface_releases, out) + + # Generate a table of the wrapped interface structs that can be looked up. + self.GenerateWrapperInfoAndCollection(iface_releases, out) + + # Write out the IDL-invariant functions. + self.GenerateFixedFunctions(out) + + out.Close() + return 0 diff --git a/browser/extensions/mortar/ppapi/generators/idl_generator.py b/browser/extensions/mortar/ppapi/generators/idl_generator.py new file mode 100755 index 000000000000..028a233435b9 --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/idl_generator.py @@ -0,0 +1,277 @@ +#!/usr/bin/env python +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import sys + +from idl_log import ErrOut, InfoOut, WarnOut +from idl_option import GetOption, Option, ParseOptions +from idl_parser import ParseFiles + +GeneratorList = [] + +Option('out', 'List of output files', default='') +Option('release', 'Which release to generate.', default='') +Option('range', 'Which ranges in the form of MIN,MAX.', default='start,end') + +class Generator(object): + """Base class for generators. + + This class provides a mechanism for adding new generator objects to the IDL + driver. To use this class override the GenerateRelease and GenerateRange + members, and instantiate one copy of the class in the same module which + defines it to register the generator. After the AST is generated, call the + static Run member which will check every registered generator to see which + ones have been enabled through command-line options. To enable a generator + use the switches: + -- : To enable with defaults + --_opt= : To enable with generator specific options. + + NOTE: Generators still have access to global options + """ + + def __init__(self, name, sname, desc): + self.name = name + self.run_switch = Option(sname, desc) + self.opt_switch = Option(sname + '_opt', 'Options for %s.' % sname, + default='') + GeneratorList.append(self) + self.errors = 0 + self.skip_list = [] + + def Error(self, msg): + ErrOut.Log('Error %s : %s' % (self.name, msg)) + self.errors += 1 + + def GetRunOptions(self): + options = {} + option_list = self.opt_switch.Get() + if option_list: + option_list = option_list.split(',') + for opt in option_list: + offs = opt.find('=') + if offs > 0: + options[opt[:offs]] = opt[offs+1:] + else: + options[opt] = True + return options + if self.run_switch.Get(): + return options + return None + + def Generate(self, ast, options): + self.errors = 0 + + rangestr = GetOption('range') + releasestr = GetOption('release') + + print "Found releases: %s" % ast.releases + + # Generate list of files to ignore due to errors + for filenode in ast.GetListOf('File'): + # If this file has errors, skip it + if filenode.GetProperty('ERRORS') > 0: + self.skip_list.append(filenode) + continue + + # Check for a range option which over-rides a release option + if not releasestr and rangestr: + range_list = rangestr.split(',') + if len(range_list) != 2: + self.Error('Failed to generate for %s, incorrect range: "%s"' % + (self.name, rangestr)) + else: + vmin = range_list[0] + vmax = range_list[1] + + # Generate 'start' and 'end' represent first and last found. + if vmin == 'start': + vmin = ast.releases[0] + if vmax == 'end': + vmax = ast.releases[-1] + + vmin = ast.releases.index(vmin) + vmax = ast.releases.index(vmax) + 1 + releases = ast.releases[vmin:vmax] + InfoOut.Log('Generate range %s of %s.' % (rangestr, self.name)) + ret = self.GenerateRange(ast, releases, options) + if ret < 0: + self.Error('Failed to generate range %s : %s.' %(vmin, vmax)) + else: + InfoOut.Log('%s wrote %d files.' % (self.name, ret)) + # Otherwise this should be a single release generation + else: + if releasestr == 'start': + releasestr = ast.releases[0] + if releasestr == 'end': + releasestr = ast.releases[-1] + + if releasestr > ast.releases[-1]: + InfoOut.Log('There is no unique release for %s, using last release.' % + releasestr) + releasestr = ast.releases[-1] + + if releasestr not in ast.releases: + self.Error('Release %s not in [%s].' % + (releasestr, ', '.join(ast.releases))) + + if releasestr: + InfoOut.Log('Generate release %s of %s.' % (releasestr, self.name)) + ret = self.GenerateRelease(ast, releasestr, options) + if ret < 0: + self.Error('Failed to generate release %s.' % releasestr) + else: + InfoOut.Log('%s wrote %d files.' % (self.name, ret)) + + else: + self.Error('No range or release specified for %s.' % releasestr) + return self.errors + + def GenerateRelease(self, ast, release, options): + __pychecker__ = 'unusednames=ast,release,options' + self.Error("Undefined release generator.") + return 0 + + def GenerateRange(self, ast, releases, options): + __pychecker__ = 'unusednames=ast,releases,options' + self.Error("Undefined range generator.") + return 0 + + @staticmethod + def Run(ast): + fail_count = 0 + + # Check all registered generators if they should run. + for gen in GeneratorList: + options = gen.GetRunOptions() + if options is not None: + if gen.Generate(ast, options): + fail_count += 1 + return fail_count + + +class GeneratorByFile(Generator): + """A simplified generator that generates one output file per IDL source file. + + A subclass of Generator for use of generators which have a one to one + mapping between IDL sources and output files. + + Derived classes should define GenerateFile. + """ + + def GenerateFile(self, filenode, releases, options): + """Generates an output file from the IDL source. + + Returns true if the generated file is different than the previously + generated file. + """ + __pychecker__ = 'unusednames=filenode,releases,options' + self.Error("Undefined release generator.") + return 0 + + def GenerateRelease(self, ast, release, options): + return self.GenerateRange(ast, [release], options) + + def GenerateRange(self, ast, releases, options): + # Get list of out files + outlist = GetOption('out') + if outlist: outlist = outlist.split(',') + + skipList = [] + cnt = 0 + for filenode in ast.GetListOf('File'): + # Ignore files with errors + if filenode in self.skip_list: + continue + + # Skip this file if not required + if outlist and filenode.GetName() not in outlist: + continue + + # Create the output file and increment out count if there was a delta + if self.GenerateFile(filenode, releases, options): + cnt = cnt + 1 + + for filenode in skipList: + errcnt = filenode.GetProperty('ERRORS') + ErrOut.Log('%s : Skipped because of %d errors.' % ( + filenode.GetName(), errcnt)) + + if skipList: + return -len(skipList) + + if GetOption('diff'): + return -cnt + return cnt + + +check_release = 0 +check_range = 0 + +class GeneratorReleaseTest(Generator): + def GenerateRelease(self, ast, release, options = {}): + __pychecker__ = 'unusednames=ast,release,options' + global check_release + check_map = { + 'so_long': True, + 'MyOpt': 'XYZ', + 'goodbye': True + } + check_release = 1 + for item in check_map: + check_item = check_map[item] + option_item = options.get(item, None) + if check_item != option_item: + print 'Option %s is %s, expecting %s' % (item, option_item, check_item) + check_release = 0 + + if release != 'M14': + check_release = 0 + return check_release == 1 + + def GenerateRange(self, ast, releases, options): + __pychecker__ = 'unusednames=ast,releases,options' + global check_range + check_range = 1 + return True + +def Test(): + __pychecker__ = 'unusednames=args' + global check_release + global check_range + + ParseOptions(['--testgen_opt=so_long,MyOpt=XYZ,goodbye']) + if Generator.Run('AST') != 0: + print 'Generate release: Failed.\n' + return -1 + + if check_release != 1 or check_range != 0: + print 'Gererate release: Failed to run.\n' + return -1 + + check_release = 0 + ParseOptions(['--testgen_opt="HELLO"', '--range=M14,M16']) + if Generator.Run('AST') != 0: + print 'Generate range: Failed.\n' + return -1 + + if check_release != 0 or check_range != 1: + print 'Gererate range: Failed to run.\n' + return -1 + + print 'Generator test: Pass' + return 0 + + +def Main(args): + if not args: return Test() + filenames = ParseOptions(args) + ast = ParseFiles(filenames) + + return Generator.Run(ast) + + +if __name__ == '__main__': + GeneratorReleaseTest('Test Gen', 'testgen', 'Generator Class Test.') + sys.exit(Main(sys.argv[1:])) diff --git a/browser/extensions/mortar/ppapi/generators/idl_lexer.py b/browser/extensions/mortar/ppapi/generators/idl_lexer.py new file mode 100755 index 000000000000..47d64a243b3e --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/idl_lexer.py @@ -0,0 +1,352 @@ +#!/usr/bin/env python +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +""" Lexer for PPAPI IDL """ + +# +# IDL Lexer +# +# The lexer is uses the PLY lex library to build a tokenizer which understands +# WebIDL tokens. +# +# WebIDL, and WebIDL regular expressions can be found at: +# http://dev.w3.org/2006/webapi/WebIDL/ +# PLY can be found at: +# http://www.dabeaz.com/ply/ + +import os.path +import re +import sys + +# +# Try to load the ply module, if not, then assume it is in the third_party +# directory, relative to ppapi +# +try: + from ply import lex +except: + module_path, module_name = os.path.split(__file__) + third_party = os.path.join(module_path, '..', '..', 'third_party') + sys.path.append(third_party) + from ply import lex + +from idl_option import GetOption, Option, ParseOptions + + +Option('output', 'Generate output.') + +# +# IDL Lexer +# +class IDLLexer(object): + # 'tokens' is a value required by lex which specifies the complete list + # of valid token types. + tokens = [ + # Symbol and keywords types + 'COMMENT', + 'DESCRIBE', + 'ENUM', + 'LABEL', + 'SYMBOL', + 'INLINE', + 'INTERFACE', + 'STRUCT', + 'TYPEDEF', + 'OR', + + # Extra WebIDL keywords + 'CALLBACK', + 'DICTIONARY', + 'OPTIONAL', + 'STATIC', + + # Invented for apps use + 'NAMESPACE', + + # Data types + 'FLOAT', + 'OCT', + 'INT', + 'HEX', + 'STRING', + + # Operators + 'LSHIFT', + 'RSHIFT' + ] + + # 'keywords' is a map of string to token type. All SYMBOL tokens are + # matched against keywords, to determine if the token is actually a keyword. + keywords = { + 'describe' : 'DESCRIBE', + 'enum' : 'ENUM', + 'label' : 'LABEL', + 'interface' : 'INTERFACE', + 'readonly' : 'READONLY', + 'struct' : 'STRUCT', + 'typedef' : 'TYPEDEF', + + 'callback' : 'CALLBACK', + 'dictionary' : 'DICTIONARY', + 'optional' : 'OPTIONAL', + 'static' : 'STATIC', + 'namespace' : 'NAMESPACE', + + 'or' : 'OR', + } + + # 'literals' is a value expected by lex which specifies a list of valid + # literal tokens, meaning the token type and token value are identical. + literals = '"*.(){}[],;:=+-/~|&^?' + + # Token definitions + # + # Lex assumes any value or function in the form of 't_' represents a + # regular expression where a match will emit a token of type . In the + # case of a function, the function is called when a match is made. These + # definitions come from WebIDL. + + # 't_ignore' is a special match of items to ignore + t_ignore = ' \t' + + # Constant values + t_FLOAT = r'-?(\d+\.\d*|\d*\.\d+)([Ee][+-]?\d+)?|-?\d+[Ee][+-]?\d+' + t_INT = r'-?[0-9]+[uU]?' + t_OCT = r'-?0[0-7]+' + t_HEX = r'-?0[Xx][0-9A-Fa-f]+' + t_LSHIFT = r'<<' + t_RSHIFT = r'>>' + + # A line ending '\n', we use this to increment the line number + def t_LINE_END(self, t): + r'\n+' + self.AddLines(len(t.value)) + + # We do not process escapes in the IDL strings. Strings are exclusively + # used for attributes, and not used as typical 'C' constants. + def t_STRING(self, t): + r'"[^"]*"' + t.value = t.value[1:-1] + self.AddLines(t.value.count('\n')) + return t + + # A C or C++ style comment: /* xxx */ or // + def t_COMMENT(self, t): + r'(/\*(.|\n)*?\*/)|(//.*(\n[ \t]*//.*)*)' + self.AddLines(t.value.count('\n')) + return t + + # Return a "preprocessor" inline block + def t_INLINE(self, t): + r'\#inline (.|\n)*?\#endinl.*' + self.AddLines(t.value.count('\n')) + return t + + # A symbol or keyword. + def t_KEYWORD_SYMBOL(self, t): + r'_?[A-Za-z][A-Za-z_0-9]*' + + # All non-keywords are assumed to be symbols + t.type = self.keywords.get(t.value, 'SYMBOL') + + # We strip leading underscores so that you can specify symbols with the same + # value as a keywords (E.g. a dictionary named 'interface'). + if t.value[0] == '_': + t.value = t.value[1:] + return t + + def t_ANY_error(self, t): + msg = "Unrecognized input" + line = self.lexobj.lineno + + # If that line has not been accounted for, then we must have hit + # EoF, so compute the beginning of the line that caused the problem. + if line >= len(self.index): + # Find the offset in the line of the first word causing the issue + word = t.value.split()[0] + offs = self.lines[line - 1].find(word) + # Add the computed line's starting position + self.index.append(self.lexobj.lexpos - offs) + msg = "Unexpected EoF reached after" + + pos = self.lexobj.lexpos - self.index[line] + file = self.lexobj.filename + out = self.ErrorMessage(file, line, pos, msg) + sys.stderr.write(out + '\n') + self.lex_errors += 1 + + + def AddLines(self, count): + # Set the lexer position for the beginning of the next line. In the case + # of multiple lines, tokens can not exist on any of the lines except the + # last one, so the recorded value for previous lines are unused. We still + # fill the array however, to make sure the line count is correct. + self.lexobj.lineno += count + for i in range(count): + self.index.append(self.lexobj.lexpos) + + def FileLineMsg(self, file, line, msg): + if file: return "%s(%d) : %s" % (file, line + 1, msg) + return " : %s" % msg + + def SourceLine(self, file, line, pos): + caret = '\t^'.expandtabs(pos) + # We decrement the line number since the array is 0 based while the + # line numbers are 1 based. + return "%s\n%s" % (self.lines[line - 1], caret) + + def ErrorMessage(self, file, line, pos, msg): + return "\n%s\n%s" % ( + self.FileLineMsg(file, line, msg), + self.SourceLine(file, line, pos)) + + def SetData(self, filename, data): + # Start with line 1, not zero + self.lexobj.lineno = 1 + self.lexobj.filename = filename + self.lines = data.split('\n') + self.index = [0] + self.lexobj.input(data) + self.lex_errors = 0 + + def __init__(self): + self.lexobj = lex.lex(object=self, lextab=None, optimize=0) + + + +# +# FilesToTokens +# +# From a set of source file names, generate a list of tokens. +# +def FilesToTokens(filenames, verbose=False): + lexer = IDLLexer() + outlist = [] + for filename in filenames: + data = open(filename).read() + lexer.SetData(filename, data) + if verbose: sys.stdout.write(' Loaded %s...\n' % filename) + while 1: + t = lexer.lexobj.token() + if t is None: break + outlist.append(t) + return outlist + + +def TokensFromText(text): + lexer = IDLLexer() + lexer.SetData('unknown', text) + outlist = [] + while 1: + t = lexer.lexobj.token() + if t is None: break + outlist.append(t.value) + return outlist + +# +# TextToTokens +# +# From a block of text, generate a list of tokens +# +def TextToTokens(source): + lexer = IDLLexer() + outlist = [] + lexer.SetData('AUTO', source) + while 1: + t = lexer.lexobj.token() + if t is None: break + outlist.append(t.value) + return outlist + + +# +# TestSame +# +# From a set of token values, generate a new source text by joining with a +# single space. The new source is then tokenized and compared against the +# old set. +# +def TestSame(values1): + # Recreate the source from the tokens. We use newline instead of whitespace + # since the '//' and #inline regex are line sensitive. + text = '\n'.join(values1) + values2 = TextToTokens(text) + + count1 = len(values1) + count2 = len(values2) + if count1 != count2: + print "Size mismatch original %d vs %d\n" % (count1, count2) + if count1 > count2: count1 = count2 + + for i in range(count1): + if values1[i] != values2[i]: + print "%d >>%s<< >>%s<<" % (i, values1[i], values2[i]) + + if GetOption('output'): + sys.stdout.write('Generating original.txt and tokenized.txt\n') + open('original.txt', 'w').write(src1) + open('tokenized.txt', 'w').write(src2) + + if values1 == values2: + sys.stdout.write('Same: Pass\n') + return 0 + + print "****************\n%s\n%s***************\n" % (src1, src2) + sys.stdout.write('Same: Failed\n') + return -1 + + +# +# TestExpect +# +# From a set of tokens pairs, verify the type field of the second matches +# the value of the first, so that: +# INT 123 FLOAT 1.1 +# will generate a passing test, where the first token is the SYMBOL INT, +# and the second token is the INT 123, third token is the SYMBOL FLOAT and +# the fourth is the FLOAT 1.1, etc... +def TestExpect(tokens): + count = len(tokens) + index = 0 + errors = 0 + while index < count: + type = tokens[index].value + token = tokens[index + 1] + index += 2 + + if type != token.type: + sys.stderr.write('Mismatch: Expected %s, but got %s = %s.\n' % + (type, token.type, token.value)) + errors += 1 + + if not errors: + sys.stdout.write('Expect: Pass\n') + return 0 + + sys.stdout.write('Expect: Failed\n') + return -1 + + +def Main(args): + filenames = ParseOptions(args) + + try: + tokens = FilesToTokens(filenames, GetOption('verbose')) + values = [tok.value for tok in tokens] + if GetOption('output'): sys.stdout.write(' <> '.join(values) + '\n') + if GetOption('test'): + if TestSame(values): + return -1 + if TestExpect(tokens): + return -1 + return 0 + + except lex.LexError as le: + sys.stderr.write('%s\n' % str(le)) + return -1 + + +if __name__ == '__main__': + sys.exit(Main(sys.argv[1:])) diff --git a/browser/extensions/mortar/ppapi/generators/idl_lint.py b/browser/extensions/mortar/ppapi/generators/idl_lint.py new file mode 100644 index 000000000000..d60f7e32b8e6 --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/idl_lint.py @@ -0,0 +1,122 @@ +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +""" Lint for IDL """ + +import os +import sys + +from idl_log import ErrOut, InfoOut, WarnOut +from idl_node import IDLAttribute, IDLNode +from idl_ast import IDLAst +from idl_option import GetOption, Option, ParseOptions +from idl_outfile import IDLOutFile +from idl_visitor import IDLVisitor + + +Option('wcomment', 'Disable warning for missing comment.') +Option('wenum', 'Disable warning for missing enum value.') +Option('winline', 'Disable warning for inline blocks.') +Option('wname', 'Disable warning for inconsistent interface name.') +Option('wnone', 'Disable all warnings.') +Option('wparam', 'Disable warning for missing [in|out|inout] on param.') +Option('wpass', 'Disable warning for mixed passByValue and returnByValue.') + +# +# IDLLinter +# +# Once the AST is build, we need to resolve the namespace and version +# information. +# +class IDLLinter(IDLVisitor): + def VisitFilter(self, node, data): + __pychecker__ = 'unusednames=node,data' + return not node.IsA('Comment', 'Copyright') + + def Arrive(self, node, errors): + __pychecker__ = 'unusednames=node,errors' + warnings = 0 + if node.IsA('Interface', 'Member', 'Struct', 'Enum', 'EnumItem', 'Typedef'): + comments = node.GetListOf('Comment') + if not comments and not node.GetProperty('wcomment'): + node.Warning('Expecting a comment.') + warnings += 1 + + if node.IsA('File'): + labels = node.GetListOf('Label') + interfaces = node.GetListOf('Interface') + if interfaces and not labels: + node.Warning('Expecting a label in a file containing interfaces.') + + if node.IsA('Struct', 'Typedef') and not node.GetProperty('wpass'): + if node.GetProperty('passByValue'): + pbv = 'is' + else: + pbv = 'is not' + if node.GetProperty('returnByValue'): + ret = 'is' + else: + ret = 'is not' + if pbv != ret: + node.Warning('%s passByValue but %s returnByValue.' % (pbv, ret)) + warnings += 1 + + if node.IsA('EnumItem'): + if not node.GetProperty('VALUE') and not node.GetProperty('wenum'): + node.Warning('Expecting value for enumeration.') + warnings += 1 + + if node.IsA('Interface'): + macro = node.GetProperty('macro') + if macro and not node.GetProperty('wname'): + node.Warning('Interface name inconsistent: %s' % macro) + warnings += 1 + + if node.IsA('Inline') and not node.GetProperty('winline'): + inline_type = node.GetProperty('NAME') + node.parent.Warning('Requires an inline %s block.' % inline_type) + warnings += 1 + + if node.IsA('Callspec') and not node.GetProperty('wparam'): + out = False + for arg in node.GetListOf('Param'): + if arg.GetProperty('out'): + out = True + if arg.GetProperty('in') and out: + arg.Warning('[in] parameter after [out] parameter') + warnings += 1 + + if node.IsA('Param') and not node.GetProperty('wparam'): + found = False; + for form in ['in', 'inout', 'out']: + if node.GetProperty(form): found = True + if not found: + node.Warning('Missing argument type: [in|out|inout]') + warnings += 1 + + return warnings + + def Depart(self, node, warnings, childdata): + __pychecker__ = 'unusednames=node' + for child in childdata: + warnings += child + return warnings + +def Lint(ast): + options = ['wcomment', 'wenum', 'winline', 'wparam', 'wpass', 'wname'] + wnone = GetOption('wnone') + for opt in options: + if wnone or GetOption(opt): ast.SetProperty(opt, True) + + skipList = [] + for filenode in ast.GetListOf('File'): + name = filenode.GetProperty('NAME') + if filenode.GetProperty('ERRORS') > 0: + ErrOut.Log('%s : Skipped due to errors.' % name) + skipList.append(filenode) + continue + warnings = IDLLinter().Visit(filenode, 0) + if warnings: + WarnOut.Log('%s warning(s) for %s\n' % (warnings, name)) + return skipList diff --git a/browser/extensions/mortar/ppapi/generators/idl_log.py b/browser/extensions/mortar/ppapi/generators/idl_log.py new file mode 100644 index 000000000000..f5b103e751c4 --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/idl_log.py @@ -0,0 +1,54 @@ +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +""" Error and information logging for IDL """ + +import sys + + +class IDLLog(object): + """Captures and routes logging output. + + Caputres logging output and/or sends out via a file handle, typically + stdout or stderr. + """ + def __init__(self, name, out): + if name: + self._name = '%s : ' % name + else: + self._name = '' + + self._out = out + self._capture = False + self._console = True + self._log = [] + + def Log(self, msg): + if self._console: + line = "%s\n" % (msg) + self._out.write(line) + if self._capture: + self._log.append(msg) + + def LogLine(self, filename, lineno, pos, msg): + if self._console: + line = "%s(%d) : %s%s\n" % (filename, lineno, self._name, msg) + self._out.write(line) + if self._capture: + self._log.append(msg) + + def SetConsole(self, enable): + self._console = enable + + def SetCapture(self, enable): + self._capture = enable + + def DrainLog(self): + out = self._log + self._log = [] + return out + +ErrOut = IDLLog('Error', sys.stderr) +WarnOut = IDLLog('Warning', sys.stdout) +InfoOut = IDLLog('', sys.stdout) diff --git a/browser/extensions/mortar/ppapi/generators/idl_namespace.py b/browser/extensions/mortar/ppapi/generators/idl_namespace.py new file mode 100755 index 000000000000..b81411e68dd6 --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/idl_namespace.py @@ -0,0 +1,249 @@ +#!/usr/bin/env python +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +""" +IDLNamespace for PPAPI + +This file defines the behavior of the AST namespace which allows for resolving +a symbol as one or more AST nodes given a release or range of releases. +""" + +import sys + +from idl_option import GetOption, Option, ParseOptions +from idl_log import ErrOut, InfoOut, WarnOut +from idl_release import IDLRelease, IDLReleaseList + +Option('label', 'Use the specifed label blocks.', default='Chrome') +Option('namespace_debug', 'Use the specified release') + + +# +# IDLNamespace +# +# IDLNamespace provides a mapping between a symbol name and an IDLReleaseList +# which contains IDLRelease objects. It provides an interface for fetching +# one or more IDLNodes based on a release or range of releases. +# +class IDLNamespace(object): + def __init__(self, parent): + self._name_to_releases = {} + self._parent = parent + + def Dump(self): + for name in self._name_to_releases: + InfoOut.Log('NAME=%s' % name) + for cver in self._name_to_releases[name].GetReleases(): + InfoOut.Log(' %s' % cver) + InfoOut.Log('') + + def FindRelease(self, name, release): + verlist = self._name_to_releases.get(name, None) + if verlist == None: + if self._parent: + return self._parent.FindRelease(name, release) + else: + return None + return verlist.FindRelease(release) + + def FindRange(self, name, rmin, rmax): + verlist = self._name_to_releases.get(name, None) + if verlist == None: + if self._parent: + return self._parent.FindRange(name, rmin, rmax) + else: + return [] + return verlist.FindRange(rmin, rmax) + + def FindList(self, name): + verlist = self._name_to_releases.get(name, None) + if verlist == None: + if self._parent: + return self._parent.FindList(name) + return verlist + + def AddNode(self, node): + name = node.GetName() + verlist = self._name_to_releases.setdefault(name,IDLReleaseList()) + if GetOption('namespace_debug'): + print "Adding to namespace: %s" % node + return verlist.AddNode(node) + + +# +# Testing Code +# + +# +# MockNode +# +# Mocks the IDLNode to support error, warning handling, and string functions. +# +class MockNode(IDLRelease): + def __init__(self, name, rmin, rmax): + self.name = name + self.rmin = rmin + self.rmax = rmax + self.errors = [] + self.warns = [] + self.properties = { + 'NAME': name, + 'release': rmin, + 'deprecate' : rmax + } + + def __str__(self): + return '%s (%s : %s)' % (self.name, self.rmin, self.rmax) + + def GetName(self): + return self.name + + def Error(self, msg): + if GetOption('release_debug'): print 'Error: %s' % msg + self.errors.append(msg) + + def Warn(self, msg): + if GetOption('release_debug'): print 'Warn: %s' % msg + self.warns.append(msg) + + def GetProperty(self, name): + return self.properties.get(name, None) + +errors = 0 +# +# DumpFailure +# +# Dumps all the information relevant to an add failure. +def DumpFailure(namespace, node, msg): + global errors + print '\n******************************' + print 'Failure: %s %s' % (node, msg) + for warn in node.warns: + print ' WARN: %s' % warn + for err in node.errors: + print ' ERROR: %s' % err + print '\n' + namespace.Dump() + print '******************************\n' + errors += 1 + +# Add expecting no errors or warnings +def AddOkay(namespace, node): + okay = namespace.AddNode(node) + if not okay or node.errors or node.warns: + DumpFailure(namespace, node, 'Expected success') + +# Add expecting a specific warning +def AddWarn(namespace, node, msg): + okay = namespace.AddNode(node) + if not okay or node.errors or not node.warns: + DumpFailure(namespace, node, 'Expected warnings') + if msg not in node.warns: + DumpFailure(namespace, node, 'Expected warning: %s' % msg) + +# Add expecting a specific error any any number of warnings +def AddError(namespace, node, msg): + okay = namespace.AddNode(node) + if okay or not node.errors: + DumpFailure(namespace, node, 'Expected errors') + if msg not in node.errors: + DumpFailure(namespace, node, 'Expected error: %s' % msg) + print ">>%s<<\n>>%s<<\n" % (node.errors[0], msg) + +# Verify that a FindRelease call on the namespace returns the expected node. +def VerifyFindOne(namespace, name, release, node): + global errors + if (namespace.FindRelease(name, release) != node): + print "Failed to find %s as release %f of %s" % (node, release, name) + namespace.Dump() + print "\n" + errors += 1 + +# Verify that a FindRage call on the namespace returns a set of expected nodes. +def VerifyFindAll(namespace, name, rmin, rmax, nodes): + global errors + out = namespace.FindRange(name, rmin, rmax) + if (out != nodes): + print "Found [%s] instead of[%s] for releases %f to %f of %s" % ( + ' '.join([str(x) for x in out]), + ' '.join([str(x) for x in nodes]), + rmin, + rmax, + name) + namespace.Dump() + print "\n" + errors += 1 + +def Main(args): + global errors + ParseOptions(args) + + InfoOut.SetConsole(True) + + namespace = IDLNamespace(None) + + FooXX = MockNode('foo', None, None) + Foo1X = MockNode('foo', 1.0, None) + Foo2X = MockNode('foo', 2.0, None) + Foo3X = MockNode('foo', 3.0, None) + + # Verify we succeed with undeprecated adds + AddOkay(namespace, FooXX) + AddOkay(namespace, Foo1X) + AddOkay(namespace, Foo3X) + # Verify we fail to add a node between undeprecated releases + AddError(namespace, Foo2X, + 'Overlap in releases: 3.0 vs 2.0 when adding foo (2.0 : None)') + + BarXX = MockNode('bar', None, None) + Bar12 = MockNode('bar', 1.0, 2.0) + Bar23 = MockNode('bar', 2.0, 3.0) + Bar34 = MockNode('bar', 3.0, 4.0) + + + # Verify we succeed with fully qualified releases + namespace = IDLNamespace(namespace) + AddOkay(namespace, BarXX) + AddOkay(namespace, Bar12) + # Verify we warn when detecting a gap + AddWarn(namespace, Bar34, 'Gap in release numbers.') + # Verify we fail when inserting into this gap + # (NOTE: while this could be legal, it is sloppy so we disallow it) + AddError(namespace, Bar23, 'Declarations out of order.') + + # Verify local namespace + VerifyFindOne(namespace, 'bar', 0.0, BarXX) + VerifyFindAll(namespace, 'bar', 0.5, 1.5, [BarXX, Bar12]) + + # Verify the correct release of the object is found recursively + VerifyFindOne(namespace, 'foo', 0.0, FooXX) + VerifyFindOne(namespace, 'foo', 0.5, FooXX) + VerifyFindOne(namespace, 'foo', 1.0, Foo1X) + VerifyFindOne(namespace, 'foo', 1.5, Foo1X) + VerifyFindOne(namespace, 'foo', 3.0, Foo3X) + VerifyFindOne(namespace, 'foo', 100.0, Foo3X) + + # Verify the correct range of objects is found + VerifyFindAll(namespace, 'foo', 0.0, 1.0, [FooXX]) + VerifyFindAll(namespace, 'foo', 0.5, 1.0, [FooXX]) + VerifyFindAll(namespace, 'foo', 1.0, 1.1, [Foo1X]) + VerifyFindAll(namespace, 'foo', 0.5, 1.5, [FooXX, Foo1X]) + VerifyFindAll(namespace, 'foo', 0.0, 3.0, [FooXX, Foo1X]) + VerifyFindAll(namespace, 'foo', 3.0, 100.0, [Foo3X]) + + FooBar = MockNode('foobar', 1.0, 2.0) + namespace = IDLNamespace(namespace) + AddOkay(namespace, FooBar) + + if errors: + print 'Test failed with %d errors.' % errors + else: + print 'Passed.' + return errors + + +if __name__ == '__main__': + sys.exit(Main(sys.argv[1:])) + diff --git a/browser/extensions/mortar/ppapi/generators/idl_node.py b/browser/extensions/mortar/ppapi/generators/idl_node.py new file mode 100755 index 000000000000..b50ba597c13d --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/idl_node.py @@ -0,0 +1,447 @@ +#!/usr/bin/env python +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Nodes for PPAPI IDL AST""" + +# +# IDL Node +# +# IDL Node defines the IDLAttribute and IDLNode objects which are constructed +# by the parser as it processes the various 'productions'. The IDLAttribute +# objects are assigned to the IDLNode's property dictionary instead of being +# applied as children of The IDLNodes, so they do not exist in the final tree. +# The AST of IDLNodes is the output from the parsing state and will be used +# as the source data by the various generators. +# + +import sys + +from idl_log import ErrOut, InfoOut, WarnOut +from idl_propertynode import IDLPropertyNode +from idl_release import IDLRelease, IDLReleaseMap + + +# IDLAttribute +# +# A temporary object used by the parsing process to hold an Extended Attribute +# which will be passed as a child to a standard IDLNode. +# +class IDLAttribute(object): + def __init__(self, name, value): + self.cls = 'ExtAttribute' + self.name = name + self.value = value + + def __str__(self): + return '%s=%s' % (self.name, self.value) + +# +# IDLNode +# +# This class implements the AST tree, providing the associations between +# parents and children. It also contains a namepsace and propertynode to +# allow for look-ups. IDLNode is derived from IDLRelease, so it is +# version aware. +# +class IDLNode(IDLRelease): + + # Set of object IDLNode types which have a name and belong in the namespace. + NamedSet = set(['Enum', 'EnumItem', 'File', 'Function', 'Interface', + 'Member', 'Param', 'Struct', 'Type', 'Typedef']) + + def __init__(self, cls, filename, lineno, pos, children=None): + # Initialize with no starting or ending Version + IDLRelease.__init__(self, None, None) + + self.cls = cls + self.lineno = lineno + self.pos = pos + self._filename = filename + self._deps = {} + self.errors = 0 + self.namespace = None + self.typelist = None + self.parent = None + self._property_node = IDLPropertyNode() + self._unique_releases = None + + # A list of unique releases for this node + self.releases = None + + # A map from any release, to the first unique release + self.first_release = None + + # self._children is a list of children ordered as defined + self._children = [] + # Process the passed in list of children, placing ExtAttributes into the + # property dictionary, and nodes into the local child list in order. In + # addition, add nodes to the namespace if the class is in the NamedSet. + if children: + for child in children: + if child.cls == 'ExtAttribute': + self.SetProperty(child.name, child.value) + else: + self.AddChild(child) + + def __str__(self): + name = self.GetName() + if name is None: + name = '' + return '%s(%s)' % (self.cls, name) + + def Location(self): + """Return a file and line number for where this node was defined.""" + return '%s(%d)' % (self._filename, self.lineno) + + def Error(self, msg): + """Log an error for this object.""" + self.errors += 1 + ErrOut.LogLine(self._filename, self.lineno, 0, ' %s %s' % + (str(self), msg)) + filenode = self.GetProperty('FILE') + if filenode: + errcnt = filenode.GetProperty('ERRORS') + if not errcnt: + errcnt = 0 + filenode.SetProperty('ERRORS', errcnt + 1) + + def Warning(self, msg): + """Log a warning for this object.""" + WarnOut.LogLine(self._filename, self.lineno, 0, ' %s %s' % + (str(self), msg)) + + def GetName(self): + return self.GetProperty('NAME') + + def Dump(self, depth=0, comments=False, out=sys.stdout): + """Dump this object and its children""" + if self.cls in ['Comment', 'Copyright']: + is_comment = True + else: + is_comment = False + + # Skip this node if it's a comment, and we are not printing comments + if not comments and is_comment: + return + + tab = ''.rjust(depth * 2) + if is_comment: + out.write('%sComment\n' % tab) + for line in self.GetName().split('\n'): + out.write('%s "%s"\n' % (tab, line)) + else: + ver = IDLRelease.__str__(self) + if self.releases: + release_list = ': ' # + ' '.join(self.releases) + else: + release_list = ': undefined' + out.write('%s%s%s%s\n' % (tab, self, ver, release_list)) + if self.typelist: + out.write('%s Typelist: %s\n' % (tab, self.typelist.GetReleases()[0])) + properties = self._property_node.GetPropertyList() + if properties: + out.write('%s Properties\n' % tab) + for p in properties: + if is_comment and p == 'NAME': + # Skip printing the name for comments, since we printed above already + continue + out.write('%s %s : %s\n' % (tab, p, self.GetProperty(p))) + for child in self._children: + child.Dump(depth+1, comments=comments, out=out) + + def IsA(self, *typelist): + """Check if node is of a given type.""" + return self.cls in typelist + + def GetListOf(self, *keys): + """Get a list of objects for the given key(s).""" + out = [] + for child in self._children: + if child.cls in keys: + out.append(child) + return out + + def GetOneOf(self, *keys): + """Get an object for the given key(s).""" + out = self.GetListOf(*keys) + if out: + return out[0] + return None + + def SetParent(self, parent): + self._property_node.AddParent(parent) + self.parent = parent + + def AddChild(self, node): + node.SetParent(self) + self._children.append(node) + + # Get a list of all children + def GetChildren(self): + return self._children + + def GetType(self, release): + if not self.typelist: + return None + return self.typelist.FindRelease(release) + + def GetDeps(self, release, visited=None): + visited = visited or set() + + # If this release is not valid for this object, then done. + if not self.IsRelease(release) or self.IsA('Comment', 'Copyright'): + return set([]) + + # If we have cached the info for this release, return the cached value + deps = self._deps.get(release, None) + if deps is not None: + return deps + + # If we are already visited, then return + if self in visited: + return set([self]) + + # Otherwise, build the dependency list + visited |= set([self]) + deps = set([self]) + + # Get child deps + for child in self.GetChildren(): + deps |= child.GetDeps(release, visited) + visited |= set(deps) + + # Get type deps + typeref = self.GetType(release) + if typeref: + deps |= typeref.GetDeps(release, visited) + + self._deps[release] = deps + return deps + + def GetVersion(self, release): + filenode = self.GetProperty('FILE') + if not filenode: + return None + return filenode.release_map.GetVersion(release) + + def GetUniqueReleases(self, releases): + """Return the unique set of first releases corresponding to input + + Since we are returning the corresponding 'first' version for a + release, we may return a release version prior to the one in the list.""" + my_min, my_max = self.GetMinMax(releases) + if my_min > releases[-1] or my_max < releases[0]: + return [] + + out = set() + for rel in releases: + remapped = self.first_release[rel] + if not remapped: + continue + out |= set([remapped]) + + # Cache the most recent set of unique_releases + self._unique_releases = sorted(out) + return self._unique_releases + + def LastRelease(self, release): + # Get the most recent release from the most recently generated set of + # cached unique releases. + if self._unique_releases and self._unique_releases[-1] > release: + return False + return True + + def GetRelease(self, version): + filenode = self.GetProperty('FILE') + if not filenode: + return None + return filenode.release_map.GetRelease(version) + + def _GetReleaseList(self, releases, visited=None): + visited = visited or set() + if not self.releases: + # If we are unversionable, then return first available release + if self.IsA('Comment', 'Copyright', 'Label'): + self.releases = [] + return self.releases + + # Generate the first and if deprecated within this subset, the + # last release for this node + my_min, my_max = self.GetMinMax(releases) + + if my_max != releases[-1]: + my_releases = set([my_min, my_max]) + else: + my_releases = set([my_min]) + + r = self.GetRelease(self.GetProperty('version')) + if not r in my_releases: + my_releases |= set([r]) + + # Break cycle if we reference ourselves + if self in visited: + return [my_min] + + visited |= set([self]) + + # Files inherit all their releases from items in the file + if self.IsA('AST', 'File'): + my_releases = set() + + # Visit all children + child_releases = set() + + # Exclude sibling results from parent visited set + cur_visits = visited + + for child in self._children: + child_releases |= set(child._GetReleaseList(releases, cur_visits)) + visited |= set(child_releases) + + # Visit my type + type_releases = set() + if self.typelist: + type_list = self.typelist.GetReleases() + for typenode in type_list: + type_releases |= set(typenode._GetReleaseList(releases, cur_visits)) + + type_release_list = sorted(type_releases) + if my_min < type_release_list[0]: + type_node = type_list[0] + self.Error('requires %s in %s which is undefined at %s.' % ( + type_node, type_node._filename, my_min)) + + for rel in child_releases | type_releases: + if rel >= my_min and rel <= my_max: + my_releases |= set([rel]) + + self.releases = sorted(my_releases) + return self.releases + + def BuildReleaseMap(self, releases): + unique_list = self._GetReleaseList(releases) + _, my_max = self.GetMinMax(releases) + + self.first_release = {} + last_rel = None + for rel in releases: + if rel in unique_list: + last_rel = rel + self.first_release[rel] = last_rel + if rel == my_max: + last_rel = None + + def SetProperty(self, name, val): + self._property_node.SetProperty(name, val) + + def GetProperty(self, name): + return self._property_node.GetProperty(name) + + def GetPropertyLocal(self, name): + return self._property_node.GetPropertyLocal(name) + + def NodeIsDevOnly(self): + """Returns true iff a node is only in dev channel.""" + return self.GetProperty('dev_version') and not self.GetProperty('version') + + def DevInterfaceMatchesStable(self, release): + """Returns true if an interface has an equivalent stable version.""" + assert(self.IsA('Interface')) + for child in self.GetListOf('Member'): + unique = child.GetUniqueReleases([release]) + if not unique or not child.InReleases([release]): + continue + if child.NodeIsDevOnly(): + return False + return True + + +# +# IDLFile +# +# A specialized version of IDLNode which tracks errors and warnings. +# +class IDLFile(IDLNode): + def __init__(self, name, children, errors=0): + attrs = [IDLAttribute('NAME', name), + IDLAttribute('ERRORS', errors)] + if not children: + children = [] + IDLNode.__init__(self, 'File', name, 1, 0, attrs + children) + # TODO(teravest): Why do we set release map like this here? This looks + # suspicious... + self.release_map = IDLReleaseMap([('M13', 1.0, 'stable')]) + + +# +# Tests +# +def StringTest(): + errors = 0 + name_str = 'MyName' + text_str = 'MyNode(%s)' % name_str + name_node = IDLAttribute('NAME', name_str) + node = IDLNode('MyNode', 'no file', 1, 0, [name_node]) + if node.GetName() != name_str: + ErrOut.Log('GetName returned >%s< not >%s<' % (node.GetName(), name_str)) + errors += 1 + if node.GetProperty('NAME') != name_str: + ErrOut.Log('Failed to get name property.') + errors += 1 + if str(node) != text_str: + ErrOut.Log('str() returned >%s< not >%s<' % (str(node), text_str)) + errors += 1 + if not errors: + InfoOut.Log('Passed StringTest') + return errors + + +def ChildTest(): + errors = 0 + child = IDLNode('child', 'no file', 1, 0) + parent = IDLNode('parent', 'no file', 1, 0, [child]) + + if child.parent != parent: + ErrOut.Log('Failed to connect parent.') + errors += 1 + + if [child] != parent.GetChildren(): + ErrOut.Log('Failed GetChildren.') + errors += 1 + + if child != parent.GetOneOf('child'): + ErrOut.Log('Failed GetOneOf(child)') + errors += 1 + + if parent.GetOneOf('bogus'): + ErrOut.Log('Failed GetOneOf(bogus)') + errors += 1 + + if not parent.IsA('parent'): + ErrOut.Log('Expecting parent type') + errors += 1 + + parent = IDLNode('parent', 'no file', 1, 0, [child, child]) + if [child, child] != parent.GetChildren(): + ErrOut.Log('Failed GetChildren2.') + errors += 1 + + if not errors: + InfoOut.Log('Passed ChildTest') + return errors + + +def Main(): + errors = StringTest() + errors += ChildTest() + + if errors: + ErrOut.Log('IDLNode failed with %d errors.' % errors) + return -1 + return 0 + +if __name__ == '__main__': + sys.exit(Main()) + diff --git a/browser/extensions/mortar/ppapi/generators/idl_option.py b/browser/extensions/mortar/ppapi/generators/idl_option.py new file mode 100644 index 000000000000..54ac4cf25fce --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/idl_option.py @@ -0,0 +1,108 @@ +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import getopt +import sys + +from idl_log import ErrOut, InfoOut, WarnOut + +OptionMap = { } + + +def GetOption(name): + if name not in OptionMap: + raise RuntimeError('Could not find option "%s".' % name) + return OptionMap[name].Get() + +class Option(object): + def __init__(self, name, desc, default = None, callfunc = None, + testfunc = None, cookie = None): + + # Verify this option is not a duplicate + if name in OptionMap: + raise RuntimeError('Option "%s" already exists.' % name) + self.name = name + self.desc = desc + self.default = default + self.value = default + self.callfunc = callfunc + self.testfunc = testfunc + self.cookie = cookie + OptionMap[name] = self + + def Set(self, value): + if self.testfunc: + if not self.testfunc(self, value): return False + # If this is a boolean option, set it to true + if self.default is None: + self.value = True + else: + self.value = value + if self.callfunc: + self.callfunc(self) + return True + + def Get(self): + return self.value + + +def DumpOption(option): + if len(option.name) > 1: + out = ' --%-15.15s\t%s' % (option.name, option.desc) + else: + out = ' -%-15.15s\t%s' % (option.name, option.desc) + if option.default: + out = '%s\n\t\t\t(Default: %s)\n' % (out, option.default) + InfoOut.Log(out) + +def DumpHelp(option=None): + InfoOut.Log('Usage:') + for opt in sorted(OptionMap.keys()): + DumpOption(OptionMap[opt]) + sys.exit(0) + +# +# Default IDL options +# +# -h : Help, prints options +# --verbose : use verbose output +# --test : test this module +# +Option('h', 'Help', callfunc=DumpHelp) +Option('help', 'Help', callfunc=DumpHelp) +Option('verbose', 'Verbose') +Option('test', 'Test the IDL scripts') + +def ParseOptions(args): + short_opts= "" + long_opts = [] + + # Build short and long option lists + for name in sorted(OptionMap.keys()): + option = OptionMap[name] + if len(name) > 1: + if option.default is None: + long_opts.append('%s' % name) + else: + long_opts.append('%s=' % name) + else: + if option.default is None: + short_opts += name + else: + short_opts += '%s:' % name + + try: + opts, filenames = getopt.getopt(args, short_opts, long_opts) + + for opt, val in opts: + if len(opt) == 2: opt = opt[1:] + if opt[0:2] == '--': opt = opt[2:] + OptionMap[opt].Set(val) + + except getopt.error, e: + ErrOut.Log('Illegal option: %s\n' % str(e)) + DumpHelp() + sys.exit(-1) + + return filenames diff --git a/browser/extensions/mortar/ppapi/generators/idl_outfile.py b/browser/extensions/mortar/ppapi/generators/idl_outfile.py new file mode 100755 index 000000000000..053cf3ea05b9 --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/idl_outfile.py @@ -0,0 +1,205 @@ +#!/usr/bin/env python +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +""" Output file objects for generator. """ + +import difflib +import os +import time +import subprocess +import sys + +from idl_log import ErrOut, InfoOut, WarnOut +from idl_option import GetOption, Option, ParseOptions +from stat import * + +Option('diff', 'Generate a DIFF when saving the file.') + + +# +# IDLOutFile +# +# IDLOutFile provides a temporary output file. By default, the object will +# not write the output if the file already exists, and matches what will be +# written. This prevents the timestamp from changing to optimize cases where +# the output files are used by a timestamp dependent build system +# +class IDLOutFile(object): + def __init__(self, filename, always_write = False, create_dir = True): + self.filename = filename + self.always_write = always_write + self.create_dir = create_dir + self.outlist = [] + self.open = True + + # Compare the old text to the current list of output lines. + def IsEquivalent_(self, oldtext): + if not oldtext: return False + + oldlines = oldtext.split('\n') + curlines = (''.join(self.outlist)).split('\n') + + # If number of lines don't match, it's a mismatch + if len(oldlines) != len(curlines): + return False + + for index in range(len(oldlines)): + oldline = oldlines[index] + curline = curlines[index] + + if oldline == curline: continue + + curwords = curline.split() + oldwords = oldline.split() + + # Unmatched lines must be the same length + if len(curwords) != len(oldwords): + return False + + # If it's not a comment then it's a mismatch + if curwords[0] not in ['*', '/*', '//']: + return False + + # Ignore changes to the Copyright year which is autogenerated + # /* Copyright (c) 2011 The Chromium Authors. All rights reserved. + if len(curwords) > 4 and curwords[1] == 'Copyright': + if curwords[4:] == oldwords[4:]: continue + + # Ignore changes to auto generation timestamp when line unwrapped + # // From FILENAME.idl modified DAY MON DATE TIME YEAR. + # /* From FILENAME.idl modified DAY MON DATE TIME YEAR. */ + if len(curwords) > 8 and curwords[1] == 'From': + if curwords[0:4] == oldwords[0:4]: continue + + # Ignore changes to auto generation timestamp when line is wrapped + # * modified DAY MON DATE TIME YEAR. + if len(curwords) > 6 and curwords[1] == 'modified': + continue + + return False + return True + + # Return the file name + def Filename(self): + return self.filename + + # Append to the output if the file is still open + def Write(self, string): + if not self.open: + raise RuntimeError('Could not write to closed file %s.' % self.filename) + self.outlist.append(string) + + # Run clang-format on the buffered file contents. + def ClangFormat(self): + clang_format = subprocess.Popen(['clang-format', '-style=Chromium'], + stdin=subprocess.PIPE, + stdout=subprocess.PIPE) + new_output = clang_format.communicate("".join(self.outlist))[0] + self.outlist = [new_output] + + # Close the file, flushing it to disk + def Close(self): + filename = os.path.realpath(self.filename) + self.open = False + outtext = ''.join(self.outlist) + oldtext = '' + + if not self.always_write: + if os.path.isfile(filename): + oldtext = open(filename, 'rb').read() + if self.IsEquivalent_(oldtext): + if GetOption('verbose'): + InfoOut.Log('Output %s unchanged.' % self.filename) + return False + + if GetOption('diff'): + for line in difflib.unified_diff(oldtext.split('\n'), outtext.split('\n'), + 'OLD ' + self.filename, + 'NEW ' + self.filename, + n=1, lineterm=''): + ErrOut.Log(line) + + try: + # If the directory does not exit, try to create it, if we fail, we + # still get the exception when the file is openned. + basepath, leafname = os.path.split(filename) + if basepath and not os.path.isdir(basepath) and self.create_dir: + InfoOut.Log('Creating directory: %s\n' % basepath) + os.makedirs(basepath) + + if not GetOption('test'): + outfile = open(filename, 'wb') + outfile.write(outtext) + outfile.close(); + InfoOut.Log('Output %s written.' % self.filename) + return True + + except IOError as (errno, strerror): + ErrOut.Log("I/O error(%d): %s" % (errno, strerror)) + except: + ErrOut.Log("Unexpected error: %s" % sys.exc_info()[0]) + raise + + return False + + +def TestFile(name, stringlist, force, update): + errors = 0 + + # Get the old timestamp + if os.path.exists(name): + old_time = os.stat(filename)[ST_MTIME] + else: + old_time = 'NONE' + + # Create the file and write to it + out = IDLOutFile(filename, force) + for item in stringlist: + out.Write(item) + + # We wait for flush to force the timestamp to change + time.sleep(2) + + wrote = out.Close() + cur_time = os.stat(filename)[ST_MTIME] + if update: + if not wrote: + ErrOut.Log('Failed to write output %s.' % filename) + return 1 + if cur_time == old_time: + ErrOut.Log('Failed to update timestamp for %s.' % filename) + return 1 + else: + if wrote: + ErrOut.Log('Should not have writen output %s.' % filename) + return 1 + if cur_time != old_time: + ErrOut.Log('Should not have modified timestamp for %s.' % filename) + return 1 + return 0 + + +def main(): + errors = 0 + stringlist = ['Test', 'Testing\n', 'Test'] + filename = 'outtest.txt' + + # Test forcibly writing a file + errors += TestFile(filename, stringlist, force=True, update=True) + + # Test conditionally writing the file skipping + errors += TestFile(filename, stringlist, force=False, update=False) + + # Test conditionally writing the file updating + errors += TestFile(filename, stringlist + ['X'], force=False, update=True) + + # Clean up file + os.remove(filename) + if not errors: InfoOut.Log('All tests pass.') + return errors + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/browser/extensions/mortar/ppapi/generators/idl_parser.py b/browser/extensions/mortar/ppapi/generators/idl_parser.py new file mode 100755 index 000000000000..51941d7cd9c9 --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/idl_parser.py @@ -0,0 +1,1296 @@ +#!/usr/bin/env python +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +""" Parser for PPAPI IDL """ + +# +# IDL Parser +# +# The parser is uses the PLY yacc library to build a set of parsing rules based +# on WebIDL. +# +# WebIDL, and WebIDL regular expressions can be found at: +# http://dev.w3.org/2006/webapi/WebIDL/ +# PLY can be found at: +# http://www.dabeaz.com/ply/ +# +# The parser generates a tree by recursively matching sets of items against +# defined patterns. When a match is made, that set of items is reduced +# to a new item. The new item can provide a match for parent patterns. +# In this way an AST is built (reduced) depth first. + + +import getopt +import glob +import os.path +import re +import sys +import time + +from idl_ast import IDLAst +from idl_log import ErrOut, InfoOut, WarnOut +from idl_lexer import IDLLexer +from idl_node import IDLAttribute, IDLFile, IDLNode +from idl_option import GetOption, Option, ParseOptions +from idl_lint import Lint + +from ply import lex +from ply import yacc + +Option('build_debug', 'Debug tree building.') +Option('parse_debug', 'Debug parse reduction steps.') +Option('token_debug', 'Debug token generation.') +Option('dump_tree', 'Dump the tree.') +Option('srcroot', 'Working directory.', default=os.path.join('..', 'api')) +Option('include_private', 'Include private IDL directory in default API paths.') + +# +# ERROR_REMAP +# +# Maps the standard error formula into a more friendly error message. +# +ERROR_REMAP = { + 'Unexpected ")" after "(".' : 'Empty argument list.', + 'Unexpected ")" after ",".' : 'Missing argument.', + 'Unexpected "}" after ",".' : 'Trailing comma in block.', + 'Unexpected "}" after "{".' : 'Unexpected empty block.', + 'Unexpected comment after "}".' : 'Unexpected trailing comment.', + 'Unexpected "{" after keyword "enum".' : 'Enum missing name.', + 'Unexpected "{" after keyword "struct".' : 'Struct missing name.', + 'Unexpected "{" after keyword "interface".' : 'Interface missing name.', +} + +# DumpReduction +# +# Prints out the set of items which matched a particular pattern and the +# new item or set it was reduced to. +def DumpReduction(cls, p): + if p[0] is None: + InfoOut.Log("OBJ: %s(%d) - None\n" % (cls, len(p))) + InfoOut.Log(" [%s]\n" % [str(x) for x in p[1:]]) + else: + out = "" + for index in range(len(p) - 1): + out += " >%s< " % str(p[index + 1]) + InfoOut.Log("OBJ: %s(%d) - %s : %s\n" % (cls, len(p), str(p[0]), out)) + + +# CopyToList +# +# Takes an input item, list, or None, and returns a new list of that set. +def CopyToList(item): + # If the item is 'Empty' make it an empty list + if not item: item = [] + + # If the item is not a list + if type(item) is not type([]): item = [item] + + # Make a copy we can modify + return list(item) + + + +# ListFromConcat +# +# Generate a new List by joining of two sets of inputs which can be an +# individual item, a list of items, or None. +def ListFromConcat(*items): + itemsout = [] + for item in items: + itemlist = CopyToList(item) + itemsout.extend(itemlist) + + return itemsout + + +# TokenTypeName +# +# Generate a string which has the type and value of the token. +def TokenTypeName(t): + if t.type == 'SYMBOL': return 'symbol %s' % t.value + if t.type in ['HEX', 'INT', 'OCT', 'FLOAT']: + return 'value %s' % t.value + if t.type == 'STRING' : return 'string "%s"' % t.value + if t.type == 'COMMENT' : return 'comment' + if t.type == t.value: return '"%s"' % t.value + return 'keyword "%s"' % t.value + + +# +# IDL Parser +# +# The Parser inherits the from the Lexer to provide PLY with the tokenizing +# definitions. Parsing patterns are encoded as function where p_ is +# is called any time a patern matching the function documentation is found. +# Paterns are expressed in the form of: +# """ : .... +# | ....""" +# +# Where new item is the result of a match against one or more sets of items +# separated by the "|". +# +# The function is called with an object 'p' where p[0] is the output object +# and p[n] is the set of inputs for positive values of 'n'. Len(p) can be +# used to distinguish between multiple item sets in the pattern. +# +# For more details on parsing refer to the PLY documentation at +# http://www.dabeaz.com/ply/ +# +# +# The parser uses the following conventions: +# a _block defines a block of definitions in the form of: +# [comment] [ext_attr_block] '{' _list '}' ';' +# A block is reduced by returning an object of with a name of +# which in turn has _list as children. +# +# A [comment] is a optional C style comment block enclosed in /* ... */ which +# is appended to the adjacent node as a child. +# +# A [ext_attr_block] is an optional list of Extended Attributes which is +# appended to the adjacent node as a child. +# +# a _list defines a list of items which will be passed as a +# list of children to the parent pattern. A list is in the form of: +# [comment] [ext_attr_block] <...DEF...> ';' _list | (empty) +# or +# [comment] [ext_attr_block] <...DEF...> _cont +# +# In the first form, the list is reduced recursively, where the right side +# _list is first reduced then joined with pattern currently being +# matched. The list is terminated with the (empty) pattern is matched. +# +# In the second form the list is reduced recursively, where the right side +# _cont is first reduced then joined with the pattern currently being +# matched. The type_ is in the form of: +# ',' _list | (empty) +# The _cont form is used to consume the ',' which only occurs when +# there is more than one object in the list. The _cont also provides +# the terminating (empty) definition. +# + + +class IDLParser(IDLLexer): +# TOP +# +# This pattern defines the top of the parse tree. The parse tree is in the +# the form of: +# +# top +# *modifiers +# *comments +# *ext_attr_block +# ext_attr_list +# attr_arg_list +# *integer, value +# *param_list +# *typeref +# +# top_list +# describe_block +# describe_list +# enum_block +# enum_item +# interface_block +# member +# label_block +# label_item +# struct_block +# member +# typedef_decl +# typedef_data +# typedef_func +# +# (* sub matches found at multiple levels and are not truly children of top) +# +# We force all input files to start with two comments. The first comment is a +# Copyright notice followed by a set of file wide Extended Attributes, followed +# by the file comment and finally by file level patterns. +# + # Find the Copyright, File comment, and optional file wide attributes. We + # use a match with COMMENT instead of comments to force the token to be + # present. The extended attributes and the top_list become siblings which + # in turn are children of the file object created from the results of top. + def p_top(self, p): + """top : COMMENT COMMENT ext_attr_block top_list""" + + Copyright = self.BuildComment('Copyright', p, 1) + Filedoc = self.BuildComment('Comment', p, 2) + + p[0] = ListFromConcat(Copyright, Filedoc, p[3], p[4]) + if self.parse_debug: DumpReduction('top', p) + + def p_top_short(self, p): + """top : COMMENT ext_attr_block top_list""" + Copyright = self.BuildComment('Copyright', p, 1) + Filedoc = IDLNode('Comment', self.lexobj.filename, p.lineno(2)-1, + p.lexpos(2)-1, [self.BuildAttribute('NAME', ''), + self.BuildAttribute('FORM', 'cc')]) + p[0] = ListFromConcat(Copyright, Filedoc, p[2], p[3]) + if self.parse_debug: DumpReduction('top', p) + + # Build a list of top level items. + def p_top_list(self, p): + """top_list : callback_decl top_list + | describe_block top_list + | dictionary_block top_list + | enum_block top_list + | inline top_list + | interface_block top_list + | label_block top_list + | namespace top_list + | struct_block top_list + | typedef_decl top_list + | bad_decl top_list + | """ + if len(p) > 2: + p[0] = ListFromConcat(p[1], p[2]) + if self.parse_debug: DumpReduction('top_list', p) + + # Recover from error and continue parsing at the next top match. + def p_top_error(self, p): + """top_list : error top_list""" + p[0] = p[2] + + # Recover from error and continue parsing at the next top match. + def p_bad_decl(self, p): + """bad_decl : modifiers SYMBOL error '}' ';'""" + p[0] = [] + +# +# Modifier List +# +# + def p_modifiers(self, p): + """modifiers : comments ext_attr_block""" + p[0] = ListFromConcat(p[1], p[2]) + if self.parse_debug: DumpReduction('modifiers', p) + +# +# Scoped name is a name with an optional scope. +# +# Used for types and namespace names. eg. foo_bar.hello_world, or +# foo_bar.hello_world.SomeType. +# + def p_scoped_name(self, p): + """scoped_name : SYMBOL scoped_name_rest""" + p[0] = ''.join(p[1:]) + if self.parse_debug: DumpReduction('scoped_name', p) + + def p_scoped_name_rest(self, p): + """scoped_name_rest : '.' scoped_name + |""" + p[0] = ''.join(p[1:]) + if self.parse_debug: DumpReduction('scoped_name_rest', p) + +# +# Type reference +# +# + def p_typeref(self, p): + """typeref : scoped_name""" + p[0] = p[1] + if self.parse_debug: DumpReduction('typeref', p) + + +# +# Comments +# +# Comments are optional list of C style comment objects. Comments are returned +# as a list or None. +# + def p_comments(self, p): + """comments : COMMENT comments + | """ + if len(p) > 1: + child = self.BuildComment('Comment', p, 1) + p[0] = ListFromConcat(child, p[2]) + if self.parse_debug: DumpReduction('comments', p) + else: + if self.parse_debug: DumpReduction('no comments', p) + + +# +# Namespace +# +# A namespace provides a named scope to an enclosed top_list. +# + def p_namespace(self, p): + """namespace : modifiers NAMESPACE namespace_name '{' top_list '}' ';'""" + children = ListFromConcat(p[1], p[5]) + p[0] = self.BuildNamed('Namespace', p, 3, children) + + # We allow namespace names of the form foo.bar.baz. + def p_namespace_name(self, p): + """namespace_name : scoped_name""" + p[0] = p[1] + + +# +# Dictionary +# +# A dictionary is a named list of optional and required members. +# + def p_dictionary_block(self, p): + """dictionary_block : modifiers DICTIONARY SYMBOL '{' struct_list '}' ';'""" + p[0] = self.BuildNamed('Dictionary', p, 3, ListFromConcat(p[1], p[5])) + + def p_dictionary_errorA(self, p): + """dictionary_block : modifiers DICTIONARY error ';'""" + p[0] = [] + + def p_dictionary_errorB(self, p): + """dictionary_block : modifiers DICTIONARY error '{' struct_list '}' ';'""" + p[0] = [] + +# +# Callback +# +# A callback is essentially a single function declaration (outside of an +# Interface). +# + def p_callback_decl(self, p): + """callback_decl : modifiers CALLBACK SYMBOL '=' SYMBOL param_list ';'""" + children = ListFromConcat(p[1], p[6]) + p[0] = self.BuildNamed('Callback', p, 3, children) + + +# +# Inline +# +# Inline blocks define option code to be emitted based on language tag, +# in the form of: +# #inline +# +# #endinl +# + def p_inline(self, p): + """inline : modifiers INLINE""" + words = p[2].split() + name = self.BuildAttribute('NAME', words[1]) + lines = p[2].split('\n') + value = self.BuildAttribute('VALUE', '\n'.join(lines[1:-1]) + '\n') + children = ListFromConcat(name, value, p[1]) + p[0] = self.BuildProduction('Inline', p, 2, children) + if self.parse_debug: DumpReduction('inline', p) + +# Extended Attributes +# +# Extended Attributes denote properties which will be applied to a node in the +# AST. A list of extended attributes are denoted by a brackets '[' ... ']' +# enclosing a comma separated list of extended attributes in the form of: +# +# Name +# Name=HEX | INT | OCT | FLOAT +# Name="STRING" +# Name=Function(arg ...) +# TODO(noelallen) -Not currently supported: +# ** Name(arg ...) ... +# ** Name=Scope::Value +# +# Extended Attributes are returned as a list or None. + + def p_ext_attr_block(self, p): + """ext_attr_block : '[' ext_attr_list ']' + | """ + if len(p) > 1: + p[0] = p[2] + if self.parse_debug: DumpReduction('ext_attr_block', p) + else: + if self.parse_debug: DumpReduction('no ext_attr_block', p) + + def p_ext_attr_list(self, p): + """ext_attr_list : SYMBOL '=' SYMBOL ext_attr_cont + | SYMBOL '=' value ext_attr_cont + | SYMBOL '=' SYMBOL param_list ext_attr_cont + | SYMBOL ext_attr_cont""" + # If there are 4 tokens plus a return slot, this must be in the form + # SYMBOL = SYMBOL|value ext_attr_cont + if len(p) == 5: + p[0] = ListFromConcat(self.BuildAttribute(p[1], p[3]), p[4]) + # If there are 5 tokens plus a return slot, this must be in the form + # SYMBOL = SYMBOL (param_list) ext_attr_cont + elif len(p) == 6: + member = self.BuildNamed('Member', p, 3, [p[4]]) + p[0] = ListFromConcat(self.BuildAttribute(p[1], member), p[5]) + # Otherwise, this must be: SYMBOL ext_attr_cont + else: + p[0] = ListFromConcat(self.BuildAttribute(p[1], 'True'), p[2]) + if self.parse_debug: DumpReduction('ext_attribute_list', p) + + def p_ext_attr_list_values(self, p): + """ext_attr_list : SYMBOL '=' '(' values ')' ext_attr_cont + | SYMBOL '=' '(' symbols ')' ext_attr_cont""" + p[0] = ListFromConcat(self.BuildAttribute(p[1], p[4]), p[6]) + + def p_values(self, p): + """values : value values_cont""" + p[0] = ListFromConcat(p[1], p[2]) + + def p_symbols(self, p): + """symbols : SYMBOL symbols_cont""" + p[0] = ListFromConcat(p[1], p[2]) + + def p_symbols_cont(self, p): + """symbols_cont : ',' SYMBOL symbols_cont + | """ + if len(p) > 1: p[0] = ListFromConcat(p[2], p[3]) + + def p_values_cont(self, p): + """values_cont : ',' value values_cont + | """ + if len(p) > 1: p[0] = ListFromConcat(p[2], p[3]) + + def p_ext_attr_cont(self, p): + """ext_attr_cont : ',' ext_attr_list + |""" + if len(p) > 1: p[0] = p[2] + if self.parse_debug: DumpReduction('ext_attribute_cont', p) + + def p_ext_attr_func(self, p): + """ext_attr_list : SYMBOL '(' attr_arg_list ')' ext_attr_cont""" + p[0] = ListFromConcat(self.BuildAttribute(p[1] + '()', p[3]), p[5]) + if self.parse_debug: DumpReduction('attr_arg_func', p) + + def p_ext_attr_arg_list(self, p): + """attr_arg_list : SYMBOL attr_arg_cont + | value attr_arg_cont""" + p[0] = ListFromConcat(p[1], p[2]) + + def p_attr_arg_cont(self, p): + """attr_arg_cont : ',' attr_arg_list + | """ + if self.parse_debug: DumpReduction('attr_arg_cont', p) + if len(p) > 1: p[0] = p[2] + + def p_attr_arg_error(self, p): + """attr_arg_cont : error attr_arg_cont""" + p[0] = p[2] + if self.parse_debug: DumpReduction('attr_arg_error', p) + + +# +# Describe +# +# A describe block is defined at the top level. It provides a mechanism for +# attributing a group of ext_attr to a describe_list. Members of the +# describe list are language specific 'Type' declarations +# + def p_describe_block(self, p): + """describe_block : modifiers DESCRIBE '{' describe_list '}' ';'""" + children = ListFromConcat(p[1], p[4]) + p[0] = self.BuildProduction('Describe', p, 2, children) + if self.parse_debug: DumpReduction('describe_block', p) + + # Recover from describe error and continue parsing at the next top match. + def p_describe_error(self, p): + """describe_list : error describe_list""" + p[0] = [] + + def p_describe_list(self, p): + """describe_list : modifiers SYMBOL ';' describe_list + | modifiers ENUM ';' describe_list + | modifiers STRUCT ';' describe_list + | modifiers TYPEDEF ';' describe_list + | """ + if len(p) > 1: + Type = self.BuildNamed('Type', p, 2, p[1]) + p[0] = ListFromConcat(Type, p[4]) + +# +# Constant Values (integer, value) +# +# Constant values can be found at various levels. A Constant value is returns +# as the string value after validated against a FLOAT, HEX, INT, OCT or +# STRING pattern as appropriate. +# + def p_value(self, p): + """value : FLOAT + | HEX + | INT + | OCT + | STRING""" + p[0] = p[1] + if self.parse_debug: DumpReduction('value', p) + + def p_value_lshift(self, p): + """value : integer LSHIFT INT""" + p[0] = "%s << %s" % (p[1], p[3]) + if self.parse_debug: DumpReduction('value', p) + +# Integers are numbers which may not be floats used in cases like array sizes. + def p_integer(self, p): + """integer : HEX + | INT + | OCT""" + p[0] = p[1] + if self.parse_debug: DumpReduction('integer', p) + +# +# Expression +# +# A simple arithmetic expression. +# + precedence = ( + ('left','|','&','^'), + ('left','LSHIFT','RSHIFT'), + ('left','+','-'), + ('left','*','/'), + ('right','UMINUS','~'), + ) + + def p_expression_binop(self, p): + """expression : expression LSHIFT expression + | expression RSHIFT expression + | expression '|' expression + | expression '&' expression + | expression '^' expression + | expression '+' expression + | expression '-' expression + | expression '*' expression + | expression '/' expression""" + p[0] = "%s %s %s" % (str(p[1]), str(p[2]), str(p[3])) + if self.parse_debug: DumpReduction('expression_binop', p) + + def p_expression_unop(self, p): + """expression : '-' expression %prec UMINUS + | '~' expression %prec '~'""" + p[0] = "%s%s" % (str(p[1]), str(p[2])) + if self.parse_debug: DumpReduction('expression_unop', p) + + def p_expression_term(self, p): + """expression : '(' expression ')'""" + p[0] = "%s%s%s" % (str(p[1]), str(p[2]), str(p[3])) + if self.parse_debug: DumpReduction('expression_term', p) + + def p_expression_symbol(self, p): + """expression : SYMBOL""" + p[0] = p[1] + if self.parse_debug: DumpReduction('expression_symbol', p) + + def p_expression_integer(self, p): + """expression : integer""" + p[0] = p[1] + if self.parse_debug: DumpReduction('expression_integer', p) + +# +# Array List +# +# Defined a list of array sizes (if any). +# + def p_arrays(self, p): + """arrays : '[' ']' arrays + | '[' integer ']' arrays + | """ + # If there are 3 tokens plus a return slot it is an unsized array + if len(p) == 4: + array = self.BuildProduction('Array', p, 1) + p[0] = ListFromConcat(array, p[3]) + # If there are 4 tokens plus a return slot it is a fixed array + elif len(p) == 5: + count = self.BuildAttribute('FIXED', p[2]) + array = self.BuildProduction('Array', p, 2, [count]) + p[0] = ListFromConcat(array, p[4]) + # If there is only a return slot, do not fill it for this terminator. + elif len(p) == 1: return + if self.parse_debug: DumpReduction('arrays', p) + + +# An identifier is a legal value for a parameter or attribute name. Lots of +# existing IDL files use "callback" as a parameter/attribute name, so we allow +# a SYMBOL or the CALLBACK keyword. + def p_identifier(self, p): + """identifier : SYMBOL + | CALLBACK""" + p[0] = p[1] + # Save the line number of the underlying token (otherwise it gets + # discarded), since we use it in the productions with an identifier in + # them. + p.set_lineno(0, p.lineno(1)) + + +# +# Union +# +# A union allows multiple choices of types for a parameter or member. +# + + def p_union_option(self, p): + """union_option : modifiers SYMBOL arrays""" + typeref = self.BuildAttribute('TYPEREF', p[2]) + children = ListFromConcat(p[1], typeref, p[3]) + p[0] = self.BuildProduction('Option', p, 2, children) + + def p_union_list(self, p): + """union_list : union_option OR union_list + | union_option""" + if len(p) > 2: + p[0] = ListFromConcat(p[1], p[3]) + else: + p[0] = p[1] + +# +# Parameter List +# +# A parameter list is a collection of arguments which are passed to a +# function. +# + def p_param_list(self, p): + """param_list : '(' param_item param_cont ')' + | '(' ')' """ + if len(p) > 3: + args = ListFromConcat(p[2], p[3]) + else: + args = [] + p[0] = self.BuildProduction('Callspec', p, 1, args) + if self.parse_debug: DumpReduction('param_list', p) + + def p_param_item(self, p): + """param_item : modifiers optional typeref arrays identifier""" + typeref = self.BuildAttribute('TYPEREF', p[3]) + children = ListFromConcat(p[1], p[2], typeref, p[4]) + p[0] = self.BuildNamed('Param', p, 5, children) + if self.parse_debug: DumpReduction('param_item', p) + + def p_param_item_union(self, p): + """param_item : modifiers optional '(' union_list ')' identifier""" + union = self.BuildAttribute('Union', True) + children = ListFromConcat(p[1], p[2], p[4], union) + p[0] = self.BuildNamed('Param', p, 6, children) + if self.parse_debug: DumpReduction('param_item', p) + + def p_optional(self, p): + """optional : OPTIONAL + | """ + if len(p) == 2: + p[0] = self.BuildAttribute('OPTIONAL', True) + + + def p_param_cont(self, p): + """param_cont : ',' param_item param_cont + | """ + if len(p) > 1: + p[0] = ListFromConcat(p[2], p[3]) + if self.parse_debug: DumpReduction('param_cont', p) + + def p_param_error(self, p): + """param_cont : error param_cont""" + p[0] = p[2] + + +# +# Typedef +# +# A typedef creates a new referencable type. The typedef can specify an array +# definition as well as a function declaration. +# + def p_typedef_data(self, p): + """typedef_decl : modifiers TYPEDEF SYMBOL SYMBOL ';' """ + typeref = self.BuildAttribute('TYPEREF', p[3]) + children = ListFromConcat(p[1], typeref) + p[0] = self.BuildNamed('Typedef', p, 4, children) + if self.parse_debug: DumpReduction('typedef_data', p) + + def p_typedef_array(self, p): + """typedef_decl : modifiers TYPEDEF SYMBOL arrays SYMBOL ';' """ + typeref = self.BuildAttribute('TYPEREF', p[3]) + children = ListFromConcat(p[1], typeref, p[4]) + p[0] = self.BuildNamed('Typedef', p, 5, children) + if self.parse_debug: DumpReduction('typedef_array', p) + + def p_typedef_func(self, p): + """typedef_decl : modifiers TYPEDEF SYMBOL SYMBOL param_list ';' """ + typeref = self.BuildAttribute('TYPEREF', p[3]) + children = ListFromConcat(p[1], typeref, p[5]) + p[0] = self.BuildNamed('Typedef', p, 4, children) + if self.parse_debug: DumpReduction('typedef_func', p) + +# +# Enumeration +# +# An enumeration is a set of named integer constants. An enumeration +# is valid type which can be referenced in other definitions. +# + def p_enum_block(self, p): + """enum_block : modifiers ENUM SYMBOL '{' enum_list '}' ';'""" + p[0] = self.BuildNamed('Enum', p, 3, ListFromConcat(p[1], p[5])) + if self.parse_debug: DumpReduction('enum_block', p) + + # Recover from enum error and continue parsing at the next top match. + def p_enum_errorA(self, p): + """enum_block : modifiers ENUM error '{' enum_list '}' ';'""" + p[0] = [] + + def p_enum_errorB(self, p): + """enum_block : modifiers ENUM error ';'""" + p[0] = [] + + def p_enum_list(self, p): + """enum_list : modifiers SYMBOL '=' expression enum_cont + | modifiers SYMBOL enum_cont""" + if len(p) > 4: + val = self.BuildAttribute('VALUE', p[4]) + enum = self.BuildNamed('EnumItem', p, 2, ListFromConcat(val, p[1])) + p[0] = ListFromConcat(enum, p[5]) + else: + enum = self.BuildNamed('EnumItem', p, 2, p[1]) + p[0] = ListFromConcat(enum, p[3]) + if self.parse_debug: DumpReduction('enum_list', p) + + def p_enum_cont(self, p): + """enum_cont : ',' enum_list + |""" + if len(p) > 1: p[0] = p[2] + if self.parse_debug: DumpReduction('enum_cont', p) + + def p_enum_cont_error(self, p): + """enum_cont : error enum_cont""" + p[0] = p[2] + if self.parse_debug: DumpReduction('enum_error', p) + + +# +# Label +# +# A label is a special kind of enumeration which allows us to go from a +# set of labels +# + def p_label_block(self, p): + """label_block : modifiers LABEL SYMBOL '{' label_list '}' ';'""" + p[0] = self.BuildNamed('Label', p, 3, ListFromConcat(p[1], p[5])) + if self.parse_debug: DumpReduction('label_block', p) + + def p_label_list(self, p): + """label_list : modifiers SYMBOL '=' FLOAT label_cont""" + val = self.BuildAttribute('VALUE', p[4]) + label = self.BuildNamed('LabelItem', p, 2, ListFromConcat(val, p[1])) + p[0] = ListFromConcat(label, p[5]) + if self.parse_debug: DumpReduction('label_list', p) + + def p_label_cont(self, p): + """label_cont : ',' label_list + |""" + if len(p) > 1: p[0] = p[2] + if self.parse_debug: DumpReduction('label_cont', p) + + def p_label_cont_error(self, p): + """label_cont : error label_cont""" + p[0] = p[2] + if self.parse_debug: DumpReduction('label_error', p) + + +# +# Members +# +# A member attribute or function of a struct or interface. +# + def p_member_attribute(self, p): + """member_attribute : modifiers typeref arrays questionmark identifier""" + typeref = self.BuildAttribute('TYPEREF', p[2]) + children = ListFromConcat(p[1], typeref, p[3], p[4]) + p[0] = self.BuildNamed('Member', p, 5, children) + if self.parse_debug: DumpReduction('attribute', p) + + def p_member_attribute_union(self, p): + """member_attribute : modifiers '(' union_list ')' questionmark identifier""" + union = self.BuildAttribute('Union', True) + children = ListFromConcat(p[1], p[3], p[5], union) + p[0] = self.BuildNamed('Member', p, 6, children) + if self.parse_debug: DumpReduction('attribute', p) + + def p_member_function(self, p): + """member_function : modifiers static typeref arrays SYMBOL param_list""" + typeref = self.BuildAttribute('TYPEREF', p[3]) + children = ListFromConcat(p[1], p[2], typeref, p[4], p[6]) + p[0] = self.BuildNamed('Member', p, 5, children) + if self.parse_debug: DumpReduction('function', p) + + def p_static(self, p): + """static : STATIC + | """ + if len(p) == 2: + p[0] = self.BuildAttribute('STATIC', True) + + def p_questionmark(self, p): + """questionmark : '?' + | """ + if len(p) == 2: + p[0] = self.BuildAttribute('OPTIONAL', True) + +# +# Interface +# +# An interface is a named collection of functions. +# + def p_interface_block(self, p): + """interface_block : modifiers INTERFACE SYMBOL '{' interface_list '}' ';'""" + p[0] = self.BuildNamed('Interface', p, 3, ListFromConcat(p[1], p[5])) + if self.parse_debug: DumpReduction('interface_block', p) + + def p_interface_error(self, p): + """interface_block : modifiers INTERFACE error '{' interface_list '}' ';'""" + p[0] = [] + + def p_interface_list(self, p): + """interface_list : member_function ';' interface_list + | """ + if len(p) > 1 : + p[0] = ListFromConcat(p[1], p[3]) + if self.parse_debug: DumpReduction('interface_list', p) + + +# +# Struct +# +# A struct is a named collection of members which in turn reference other +# types. The struct is a referencable type. +# + def p_struct_block(self, p): + """struct_block : modifiers STRUCT SYMBOL '{' struct_list '}' ';'""" + children = ListFromConcat(p[1], p[5]) + p[0] = self.BuildNamed('Struct', p, 3, children) + if self.parse_debug: DumpReduction('struct_block', p) + + # Recover from struct error and continue parsing at the next top match. + def p_struct_error(self, p): + """enum_block : modifiers STRUCT error '{' struct_list '}' ';'""" + p[0] = [] + + def p_struct_list(self, p): + """struct_list : member_attribute ';' struct_list + | member_function ';' struct_list + |""" + if len(p) > 1: p[0] = ListFromConcat(p[1], p[3]) + + +# +# Parser Errors +# +# p_error is called whenever the parser can not find a pattern match for +# a set of items from the current state. The p_error function defined here +# is triggered logging an error, and parsing recover happens as the +# p__error functions defined above are called. This allows the parser +# to continue so as to capture more than one error per file. +# + def p_error(self, t): + filename = self.lexobj.filename + self.parse_errors += 1 + if t: + lineno = t.lineno + pos = t.lexpos + prev = self.yaccobj.symstack[-1] + if type(prev) == lex.LexToken: + msg = "Unexpected %s after %s." % ( + TokenTypeName(t), TokenTypeName(prev)) + else: + msg = "Unexpected %s." % (t.value) + else: + lineno = self.last.lineno + pos = self.last.lexpos + msg = "Unexpected end of file after %s." % TokenTypeName(self.last) + self.yaccobj.restart() + + # Attempt to remap the error to a friendlier form + if msg in ERROR_REMAP: + msg = ERROR_REMAP[msg] + + # Log the error + ErrOut.LogLine(filename, lineno, pos, msg) + + def Warn(self, node, msg): + WarnOut.LogLine(node.filename, node.lineno, node.pos, msg) + self.parse_warnings += 1 + + def __init__(self): + IDLLexer.__init__(self) + self.yaccobj = yacc.yacc(module=self, tabmodule=None, debug=False, + optimize=0, write_tables=0) + + self.build_debug = GetOption('build_debug') + self.parse_debug = GetOption('parse_debug') + self.token_debug = GetOption('token_debug') + self.verbose = GetOption('verbose') + self.parse_errors = 0 + +# +# Tokenizer +# +# The token function returns the next token provided by IDLLexer for matching +# against the leaf paterns. +# + def token(self): + tok = self.lexobj.token() + if tok: + self.last = tok + if self.token_debug: + InfoOut.Log("TOKEN %s(%s)" % (tok.type, tok.value)) + return tok + +# +# BuildProduction +# +# Production is the set of items sent to a grammar rule resulting in a new +# item being returned. +# +# p - Is the Yacc production object containing the stack of items +# index - Index into the production of the name for the item being produced. +# cls - The type of item being producted +# childlist - The children of the new item + def BuildProduction(self, cls, p, index, childlist=None): + if not childlist: childlist = [] + filename = self.lexobj.filename + lineno = p.lineno(index) + pos = p.lexpos(index) + out = IDLNode(cls, filename, lineno, pos, childlist) + if self.build_debug: + InfoOut.Log("Building %s" % out) + return out + + def BuildNamed(self, cls, p, index, childlist=None): + if not childlist: childlist = [] + childlist.append(self.BuildAttribute('NAME', p[index])) + return self.BuildProduction(cls, p, index, childlist) + + def BuildComment(self, cls, p, index): + name = p[index] + + # Remove comment markers + lines = [] + if name[:2] == '//': + # For C++ style, remove any leading whitespace and the '//' marker from + # each line. + form = 'cc' + for line in name.split('\n'): + start = line.find('//') + lines.append(line[start+2:]) + else: + # For C style, remove ending '*/'' + form = 'c' + for line in name[:-2].split('\n'): + # Remove characters until start marker for this line '*' if found + # otherwise it should be blank. + offs = line.find('*') + if offs >= 0: + line = line[offs + 1:].rstrip() + else: + line = '' + lines.append(line) + name = '\n'.join(lines) + + childlist = [self.BuildAttribute('NAME', name), + self.BuildAttribute('FORM', form)] + return self.BuildProduction(cls, p, index, childlist) + +# +# BuildAttribute +# +# An ExtendedAttribute is a special production that results in a property +# which is applied to the adjacent item. Attributes have no children and +# instead represent key/value pairs. +# + def BuildAttribute(self, key, val): + return IDLAttribute(key, val) + + +# +# ParseData +# +# Attempts to parse the current data loaded in the lexer. +# + def ParseData(self, data, filename=''): + self.SetData(filename, data) + try: + self.parse_errors = 0 + self.parse_warnings = 0 + return self.yaccobj.parse(lexer=self) + + except lex.LexError as le: + ErrOut.Log(str(le)) + return [] + +# +# ParseFile +# +# Loads a new file into the lexer and attemps to parse it. +# + def ParseFile(self, filename): + date = time.ctime(os.path.getmtime(filename)) + data = open(filename).read() + if self.verbose: + InfoOut.Log("Parsing %s" % filename) + try: + out = self.ParseData(data, filename) + + # If we have a src root specified, remove it from the path + srcroot = GetOption('srcroot') + if srcroot and filename.find(srcroot) == 0: + filename = filename[len(srcroot) + 1:] + filenode = IDLFile(filename, out, self.parse_errors + self.lex_errors) + filenode.SetProperty('DATETIME', date) + return filenode + + except Exception as e: + ErrOut.LogLine(filename, self.last.lineno, self.last.lexpos, + 'Internal parsing error - %s.' % str(e)) + raise + + + +# +# Flatten Tree +# +# Flattens the tree of IDLNodes for use in testing. +# +def FlattenTree(node): + add_self = False + out = [] + for child in node.GetChildren(): + if child.IsA('Comment'): + add_self = True + else: + out.extend(FlattenTree(child)) + + if add_self: + out = [str(node)] + out + return out + + +def TestErrors(filename, filenode): + nodelist = filenode.GetChildren() + + lexer = IDLLexer() + data = open(filename).read() + lexer.SetData(filename, data) + + pass_comments = [] + fail_comments = [] + while True: + tok = lexer.lexobj.token() + if tok == None: break + if tok.type == 'COMMENT': + args = tok.value[3:-3].split() + if args[0] == 'OK': + pass_comments.append((tok.lineno, ' '.join(args[1:]))) + else: + if args[0] == 'FAIL': + fail_comments.append((tok.lineno, ' '.join(args[1:]))) + obj_list = [] + for node in nodelist: + obj_list.extend(FlattenTree(node)) + + errors = 0 + + # + # Check for expected successes + # + obj_cnt = len(obj_list) + pass_cnt = len(pass_comments) + if obj_cnt != pass_cnt: + InfoOut.Log("Mismatched pass (%d) vs. nodes built (%d)." + % (pass_cnt, obj_cnt)) + InfoOut.Log("PASS: %s" % [x[1] for x in pass_comments]) + InfoOut.Log("OBJS: %s" % obj_list) + errors += 1 + if pass_cnt > obj_cnt: pass_cnt = obj_cnt + + for i in range(pass_cnt): + line, comment = pass_comments[i] + if obj_list[i] != comment: + ErrOut.LogLine(filename, line, None, "OBJ %s : EXPECTED %s\n" % + (obj_list[i], comment)) + errors += 1 + + # + # Check for expected errors + # + err_list = ErrOut.DrainLog() + err_cnt = len(err_list) + fail_cnt = len(fail_comments) + if err_cnt != fail_cnt: + InfoOut.Log("Mismatched fail (%d) vs. errors seen (%d)." + % (fail_cnt, err_cnt)) + InfoOut.Log("FAIL: %s" % [x[1] for x in fail_comments]) + InfoOut.Log("ERRS: %s" % err_list) + errors += 1 + if fail_cnt > err_cnt: fail_cnt = err_cnt + + for i in range(fail_cnt): + line, comment = fail_comments[i] + err = err_list[i].strip() + + if err_list[i] != comment: + ErrOut.Log("%s(%d) Error\n\tERROR : %s\n\tEXPECT: %s" % ( + filename, line, err_list[i], comment)) + errors += 1 + + # Clear the error list for the next run + err_list = [] + return errors + + +def TestFile(parser, filename): + # Capture errors instead of reporting them so we can compare them + # with the expected errors. + ErrOut.SetConsole(False) + ErrOut.SetCapture(True) + + filenode = parser.ParseFile(filename) + + # Renable output + ErrOut.SetConsole(True) + ErrOut.SetCapture(False) + + # Compare captured errors + return TestErrors(filename, filenode) + + +def TestErrorFiles(filter): + idldir = os.path.split(sys.argv[0])[0] + idldir = os.path.join(idldir, 'test_parser', '*.idl') + filenames = glob.glob(idldir) + parser = IDLParser() + total_errs = 0 + for filename in filenames: + if filter and filename not in filter: continue + errs = TestFile(parser, filename) + if errs: + ErrOut.Log("%s test failed with %d error(s)." % (filename, errs)) + total_errs += errs + + if total_errs: + ErrOut.Log("Failed parsing test.") + else: + InfoOut.Log("Passed parsing test.") + return total_errs + + +def TestNamespaceFiles(filter): + idldir = os.path.split(sys.argv[0])[0] + idldir = os.path.join(idldir, 'test_namespace', '*.idl') + filenames = glob.glob(idldir) + testnames = [] + + for filename in filenames: + if filter and filename not in filter: continue + testnames.append(filename) + + # If we have no files to test, then skip this test + if not testnames: + InfoOut.Log('No files to test for namespace.') + return 0 + + InfoOut.SetConsole(False) + ast = ParseFiles(testnames) + InfoOut.SetConsole(True) + + errs = ast.GetProperty('ERRORS') + if errs: + ErrOut.Log("Failed namespace test.") + else: + InfoOut.Log("Passed namespace test.") + return errs + + + +def FindVersionError(releases, node): + err_cnt = 0 + if node.IsA('Interface', 'Struct'): + comment_list = [] + comment = node.GetOneOf('Comment') + if comment and comment.GetName()[:4] == 'REL:': + comment_list = comment.GetName()[5:].strip().split(' ') + + first_list = [node.first_release[rel] for rel in releases] + first_list = sorted(set(first_list)) + if first_list != comment_list: + node.Error("Mismatch in releases: %s vs %s." % ( + comment_list, first_list)) + err_cnt += 1 + + for child in node.GetChildren(): + err_cnt += FindVersionError(releases, child) + return err_cnt + + +def TestVersionFiles(filter): + idldir = os.path.split(sys.argv[0])[0] + idldir = os.path.join(idldir, 'test_version', '*.idl') + filenames = glob.glob(idldir) + testnames = [] + + for filename in filenames: + if filter and filename not in filter: continue + testnames.append(filename) + + # If we have no files to test, then skip this test + if not testnames: + InfoOut.Log('No files to test for version.') + return 0 + + ast = ParseFiles(testnames) + errs = FindVersionError(ast.releases, ast) + errs += ast.errors + + if errs: + ErrOut.Log("Failed version test.") + else: + InfoOut.Log("Passed version test.") + return errs + + +default_dirs = ['.', 'trusted', 'dev', 'private'] +def ParseFiles(filenames): + parser = IDLParser() + filenodes = [] + + if not filenames: + filenames = [] + srcroot = GetOption('srcroot') + dirs = default_dirs + if GetOption('include_private'): + dirs += ['private'] + for dirname in dirs: + srcdir = os.path.join(srcroot, dirname, '*.idl') + srcdir = os.path.normpath(srcdir) + filenames += sorted(glob.glob(srcdir)) + + if not filenames: + ErrOut.Log('No sources provided.') + + for filename in filenames: + filenode = parser.ParseFile(filename) + filenodes.append(filenode) + + ast = IDLAst(filenodes) + if GetOption('dump_tree'): ast.Dump(0) + + Lint(ast) + return ast + + +def Main(args): + filenames = ParseOptions(args) + + # If testing... + if GetOption('test'): + errs = TestErrorFiles(filenames) + errs = TestNamespaceFiles(filenames) + errs = TestVersionFiles(filenames) + if errs: + ErrOut.Log("Parser failed with %d errors." % errs) + return -1 + return 0 + + # Otherwise, build the AST + ast = ParseFiles(filenames) + errs = ast.GetProperty('ERRORS') + if errs: + ErrOut.Log('Found %d error(s).' % errs); + InfoOut.Log("%d files processed." % len(filenames)) + return errs + + +if __name__ == '__main__': + sys.exit(Main(sys.argv[1:])) + diff --git a/browser/extensions/mortar/ppapi/generators/idl_propertynode.py b/browser/extensions/mortar/ppapi/generators/idl_propertynode.py new file mode 100755 index 000000000000..e15354ad0a4d --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/idl_propertynode.py @@ -0,0 +1,114 @@ +#!/usr/bin/env python +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +""" Hierarchical property system for IDL AST """ +import re +import sys + +from idl_log import ErrOut, InfoOut, WarnOut + +# +# IDLPropertyNode +# +# A property node is a hierarchically aware system for mapping +# keys to values, such that a local dictionary is search first, +# followed by parent dictionaries in order. +# +class IDLPropertyNode(object): + def __init__(self): + self.parents = [] + self.property_map = {} + + def AddParent(self, parent): + assert parent + self.parents.append(parent) + + def SetProperty(self, name, val): + self.property_map[name] = val + + def GetProperty(self, name): + # Check locally for the property, and return it if found. + prop = self.property_map.get(name, None) + if prop is not None: + return prop + # If not, seach parents in order + for parent in self.parents: + prop = parent.GetProperty(name) + if prop is not None: + return prop + # Otherwise, it can not be found. + return None + + def GetPropertyLocal(self, name): + # Search for the property, but only locally. + return self.property_map.get(name, None) + + def GetPropertyList(self): + return self.property_map.keys() + +# +# Testing functions +# + +# Build a property node, setting the properties including a name, and +# associate the children with this new node. +# +def BuildNode(name, props, children=None, parents=None): + node = IDLPropertyNode() + node.SetProperty('NAME', name) + for prop in props: + toks = prop.split('=') + node.SetProperty(toks[0], toks[1]) + if children: + for child in children: + child.AddParent(node) + if parents: + for parent in parents: + node.AddParent(parent) + return node + +def ExpectProp(node, name, val): + found = node.GetProperty(name) + if found != val: + ErrOut.Log('Got property %s expecting %s' % (found, val)) + return 1 + return 0 + +# +# Verify property inheritance +# +def PropertyTest(): + errors = 0 + left = BuildNode('Left', ['Left=Left']) + right = BuildNode('Right', ['Right=Right']) + top = BuildNode('Top', ['Left=Top', 'Right=Top'], [left, right]) + + errors += ExpectProp(top, 'Left', 'Top') + errors += ExpectProp(top, 'Right', 'Top') + + errors += ExpectProp(left, 'Left', 'Left') + errors += ExpectProp(left, 'Right', 'Top') + + errors += ExpectProp(right, 'Left', 'Top') + errors += ExpectProp(right, 'Right', 'Right') + + if not errors: + InfoOut.Log('Passed PropertyTest') + return errors + + +def Main(): + errors = 0 + errors += PropertyTest() + + if errors: + ErrOut.Log('IDLNode failed with %d errors.' % errors) + return -1 + return 0 + + +if __name__ == '__main__': + sys.exit(Main()) + diff --git a/browser/extensions/mortar/ppapi/generators/idl_release.py b/browser/extensions/mortar/ppapi/generators/idl_release.py new file mode 100755 index 000000000000..ff4aa01db04e --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/idl_release.py @@ -0,0 +1,356 @@ +#!/usr/bin/env python +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +""" +IDLRelease for PPAPI + +This file defines the behavior of the AST namespace which allows for resolving +a symbol as one or more AST nodes given a Release or range of Releases. +""" + +import sys + +from idl_log import ErrOut, InfoOut, WarnOut +from idl_option import GetOption, Option, ParseOptions + +Option('release_debug', 'Debug Release data') +Option('wgap', 'Ignore Release gap warning') + + +# +# Module level functions and data used for testing. +# +error = None +warning = None +def ReportReleaseError(msg): + global error + error = msg + +def ReportReleaseWarning(msg): + global warning + warning = msg + +def ReportClear(): + global error, warning + error = None + warning = None + +# +# IDLRelease +# +# IDLRelease is an object which stores the association of a given symbol +# name, with an AST node for a range of Releases for that object. +# +# A vmin value of None indicates that the object begins at the earliest +# available Release number. The value of vmin is always inclusive. + +# A vmax value of None indicates that the object is never deprecated, so +# it exists until it is overloaded or until the latest available Release. +# The value of vmax is always exclusive, representing the first Release +# on which the object is no longer valid. +class IDLRelease(object): + def __init__(self, rmin, rmax): + self.rmin = rmin + self.rmax = rmax + + def __str__(self): + if not self.rmin: + rmin = '0' + else: + rmin = str(self.rmin) + if not self.rmax: + rmax = '+oo' + else: + rmax = str(self.rmax) + return '[%s,%s)' % (rmin, rmax) + + def SetReleaseRange(self, rmin, rmax): + self.rmin = rmin + self.rmax = rmax + + # True, if Release falls within the interval [self.vmin, self.vmax) + def IsRelease(self, release): + if self.rmax and self.rmax <= release: + return False + if self.rmin and self.rmin > release: + return False + if GetOption('release_debug'): + InfoOut.Log('%f is in %s' % (release, self)) + return True + + # True, if Release falls within the interval [self.vmin, self.vmax) + def InReleases(self, releases): + if not releases: return False + + # Check last release first, since InRange does not match last item + if self.IsRelease(releases[-1]): return True + if len(releases) > 1: + return self.InRange(releases[0], releases[-1]) + return False + + # True, if interval [vmin, vmax) overlaps interval [self.vmin, self.vmax) + def InRange(self, rmin, rmax): + assert (rmin == None) or rmin < rmax + + # An min of None always passes a min bound test + # An max of None always passes a max bound test + if rmin is not None and self.rmax is not None: + if self.rmax <= rmin: + return False + if rmax is not None and self.rmin is not None: + if self.rmin >= rmax: + return False + + if GetOption('release_debug'): + InfoOut.Log('%f to %f is in %s' % (rmin, rmax, self)) + return True + + def GetMinMax(self, releases = None): + if not releases: + return self.rmin, self.rmax + + if not self.rmin: + rmin = releases[0] + else: + rmin = str(self.rmin) + if not self.rmax: + rmax = releases[-1] + else: + rmax = str(self.rmax) + return (rmin, rmax) + + def SetMin(self, release): + assert not self.rmin + self.rmin = release + + def Error(self, msg): + ReportReleaseError(msg) + + def Warn(self, msg): + ReportReleaseWarning(msg) + + +# +# IDLReleaseList +# +# IDLReleaseList is a list based container for holding IDLRelease +# objects in order. The IDLReleaseList can be added to, and searched by +# range. Objects are stored in order, and must be added in order. +# +class IDLReleaseList(object): + def __init__(self): + self._nodes = [] + + def GetReleases(self): + return self._nodes + + def FindRelease(self, release): + for node in self._nodes: + if node.IsRelease(release): + return node + return None + + def FindRange(self, rmin, rmax): + assert (rmin == None) or rmin != rmax + + out = [] + for node in self._nodes: + if node.InRange(rmin, rmax): + out.append(node) + return out + + def AddNode(self, node): + if GetOption('release_debug'): + InfoOut.Log('\nAdding %s %s' % (node.Location(), node)) + last = None + + # Check current releases in that namespace + for cver in self._nodes: + if GetOption('release_debug'): InfoOut.Log(' Checking %s' % cver) + + # We should only be missing a 'release' tag for the first item. + if not node.rmin: + node.Error('Missing release on overload of previous %s.' % + cver.Location()) + return False + + # If the node has no max, then set it to this one + if not cver.rmax: + cver.rmax = node.rmin + if GetOption('release_debug'): InfoOut.Log(' Update %s' % cver) + + # if the max and min overlap, than's an error + if cver.rmax > node.rmin: + if node.rmax and cver.rmin >= node.rmax: + node.Error('Declarations out of order.') + else: + node.Error('Overlap in releases: %s vs %s when adding %s' % + (cver.rmax, node.rmin, node)) + return False + last = cver + + # Otherwise, the previous max and current min should match + # unless this is the unlikely case of something being only + # temporarily deprecated. + if last and last.rmax != node.rmin: + node.Warn('Gap in release numbers.') + + # If we made it here, this new node must be the 'newest' + # and does not overlap with anything previously added, so + # we can add it to the end of the list. + if GetOption('release_debug'): InfoOut.Log('Done %s' % node) + self._nodes.append(node) + return True + +# +# IDLReleaseMap +# +# A release map, can map from an float interface release, to a global +# release string. +# +class IDLReleaseMap(object): + def __init__(self, release_info): + self.version_to_release = {} + self.release_to_version = {} + self.release_to_channel = {} + for release, version, channel in release_info: + self.version_to_release[version] = release + self.release_to_version[release] = version + self.release_to_channel[release] = channel + self.releases = sorted(self.release_to_version.keys()) + self.versions = sorted(self.version_to_release.keys()) + + def GetVersion(self, release): + return self.release_to_version.get(release, None) + + def GetVersions(self): + return self.versions + + def GetRelease(self, version): + return self.version_to_release.get(version, None) + + def GetReleases(self): + return self.releases + + def GetReleaseRange(self): + return (self.releases[0], self.releases[-1]) + + def GetVersionRange(self): + return (self.versions[0], self.version[-1]) + + def GetChannel(self, release): + return self.release_to_channel.get(release, None) + +# +# Test Code +# +def TestReleaseNode(): + FooXX = IDLRelease(None, None) + Foo1X = IDLRelease('M14', None) + Foo23 = IDLRelease('M15', 'M16') + + assert FooXX.IsRelease('M13') + assert FooXX.IsRelease('M14') + assert FooXX.InRange('M13', 'M13A') + assert FooXX.InRange('M14','M15') + + assert not Foo1X.IsRelease('M13') + assert Foo1X.IsRelease('M14') + assert Foo1X.IsRelease('M15') + + assert not Foo1X.InRange('M13', 'M14') + assert not Foo1X.InRange('M13A', 'M14') + assert Foo1X.InRange('M14', 'M15') + assert Foo1X.InRange('M15', 'M16') + + assert not Foo23.InRange('M13', 'M14') + assert not Foo23.InRange('M13A', 'M14') + assert not Foo23.InRange('M14', 'M15') + assert Foo23.InRange('M15', 'M16') + assert Foo23.InRange('M14', 'M15A') + assert Foo23.InRange('M15B', 'M17') + assert not Foo23.InRange('M16', 'M17') + print "TestReleaseNode - Passed" + + +def TestReleaseListWarning(): + FooXX = IDLRelease(None, None) + Foo1X = IDLRelease('M14', None) + Foo23 = IDLRelease('M15', 'M16') + Foo45 = IDLRelease('M17', 'M18') + + # Add nodes out of order should fail + ReportClear() + releases = IDLReleaseList() + assert releases.AddNode(Foo23) + assert releases.AddNode(Foo45) + assert warning + print "TestReleaseListWarning - Passed" + + +def TestReleaseListError(): + FooXX = IDLRelease(None, None) + Foo1X = IDLRelease('M14', None) + Foo23 = IDLRelease('M15', 'M16') + Foo45 = IDLRelease('M17', 'M18') + + # Add nodes out of order should fail + ReportClear() + releases = IDLReleaseList() + assert releases.AddNode(FooXX) + assert releases.AddNode(Foo23) + assert not releases.AddNode(Foo1X) + assert error + print "TestReleaseListError - Passed" + + +def TestReleaseListOK(): + FooXX = IDLRelease(None, None) + Foo1X = IDLRelease('M14', None) + Foo23 = IDLRelease('M15', 'M16') + Foo45 = IDLRelease('M17', 'M18') + + # Add nodes in order should work + ReportClear() + releases = IDLReleaseList() + assert releases.AddNode(FooXX) + assert releases.AddNode(Foo1X) + assert releases.AddNode(Foo23) + assert not error and not warning + assert releases.AddNode(Foo45) + assert warning + + assert releases.FindRelease('M13') == FooXX + assert releases.FindRelease('M14') == Foo1X + assert releases.FindRelease('M15') == Foo23 + assert releases.FindRelease('M16') == None + assert releases.FindRelease('M17') == Foo45 + assert releases.FindRelease('M18') == None + + assert releases.FindRange('M13','M14') == [FooXX] + assert releases.FindRange('M13','M17') == [FooXX, Foo1X, Foo23] + assert releases.FindRange('M16','M17') == [] + assert releases.FindRange(None, None) == [FooXX, Foo1X, Foo23, Foo45] + + # Verify we can find the correct versions + print "TestReleaseListOK - Passed" + + +def TestReleaseMap(): + print "TestReleaseMap- Passed" + + +def Main(args): + TestReleaseNode() + TestReleaseListWarning() + TestReleaseListError() + TestReleaseListOK() + print "Passed" + return 0 + + +if __name__ == '__main__': + sys.exit(Main(sys.argv[1:])) + diff --git a/browser/extensions/mortar/ppapi/generators/idl_tests.py b/browser/extensions/mortar/ppapi/generators/idl_tests.py new file mode 100755 index 000000000000..bf6d8a1570cc --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/idl_tests.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +""" Test runner for IDL Generator changes """ + +import subprocess +import sys + +def TestIDL(testname, args): + print '\nRunning unit tests for %s.' % testname + try: + args = [sys.executable, testname] + args + subprocess.check_call(args) + return 0 + except subprocess.CalledProcessError as err: + print 'Failed with %s.' % str(err) + return 1 + +def main(args): + errors = 0 + errors += TestIDL('idl_lexer.py', ['--test']) + assert errors == 0 + errors += TestIDL('idl_parser.py', ['--test']) + assert errors == 0 + errors += TestIDL('idl_c_header.py', []) + assert errors == 0 + errors += TestIDL('idl_c_proto.py', ['--wnone', '--test']) + assert errors == 0 + errors += TestIDL('idl_gen_pnacl.py', ['--wnone', '--test']) + assert errors == 0 + errors += TestIDL('idl_namespace.py', []) + assert errors == 0 + errors += TestIDL('idl_node.py', []) + assert errors == 0 + + if errors: + print '\nFailed tests.' + return errors + + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) + diff --git a/browser/extensions/mortar/ppapi/generators/idl_thunk.py b/browser/extensions/mortar/ppapi/generators/idl_thunk.py new file mode 100755 index 000000000000..5e037a221298 --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/idl_thunk.py @@ -0,0 +1,581 @@ +#!/usr/bin/env python +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +""" Generator for C++ style thunks """ + +import glob +import os +import re +import sys + +from idl_log import ErrOut, InfoOut, WarnOut +from idl_node import IDLAttribute, IDLNode +from idl_ast import IDLAst +from idl_option import GetOption, Option, ParseOptions +from idl_outfile import IDLOutFile +from idl_parser import ParseFiles +from idl_c_proto import CGen, GetNodeComments, CommentLines, Comment +from idl_generator import Generator, GeneratorByFile + +Option('thunkroot', 'Base directory of output', + default=os.path.join('..', 'thunk')) + + +class TGenError(Exception): + def __init__(self, msg): + self.value = msg + + def __str__(self): + return repr(self.value) + + +class ThunkBodyMetadata(object): + """Metadata about thunk body. Used for selecting which headers to emit.""" + def __init__(self): + self._apis = set() + self._builtin_includes = set() + self._includes = set() + + def AddApi(self, api): + self._apis.add(api) + + def Apis(self): + return self._apis + + def AddInclude(self, include): + self._includes.add(include) + + def Includes(self): + return self._includes + + def AddBuiltinInclude(self, include): + self._builtin_includes.add(include) + + def BuiltinIncludes(self): + return self._builtin_includes + + +def _GetBaseFileName(filenode): + """Returns the base name for output files, given the filenode. + + Examples: + 'dev/ppb_find_dev.h' -> 'ppb_find_dev' + 'trusted/ppb_buffer_trusted.h' -> 'ppb_buffer_trusted' + """ + path, name = os.path.split(filenode.GetProperty('NAME')) + name = os.path.splitext(name)[0] + return name + + +def _GetHeaderFileName(filenode): + """Returns the name for the header for this file.""" + path, name = os.path.split(filenode.GetProperty('NAME')) + name = os.path.splitext(name)[0] + if path: + header = "ppapi/c/%s/%s.h" % (path, name) + else: + header = "ppapi/c/%s.h" % name + return header + + +def _GetThunkFileName(filenode, relpath): + """Returns the thunk file name.""" + path = os.path.split(filenode.GetProperty('NAME'))[0] + name = _GetBaseFileName(filenode) + # We don't reattach the path for thunk. + if relpath: name = os.path.join(relpath, name) + name = '%s%s' % (name, '_thunk.cc') + return name + + +def _StripFileName(filenode): + """Strips path and dev, trusted, and private suffixes from the file name.""" + api_basename = _GetBaseFileName(filenode) + if api_basename.endswith('_dev'): + api_basename = api_basename[:-len('_dev')] + if api_basename.endswith('_trusted'): + api_basename = api_basename[:-len('_trusted')] + if api_basename.endswith('_private'): + api_basename = api_basename[:-len('_private')] + return api_basename + + +def _StripApiName(api_name): + """Strips Dev, Private, and Trusted suffixes from the API name.""" + if api_name.endswith('Trusted'): + api_name = api_name[:-len('Trusted')] + if api_name.endswith('_Dev'): + api_name = api_name[:-len('_Dev')] + if api_name.endswith('_Private'): + api_name = api_name[:-len('_Private')] + return api_name + + +def _MakeEnterLine(filenode, interface, member, arg, handle_errors, callback, + meta): + """Returns an EnterInstance/EnterResource string for a function.""" + api_name = _StripApiName(interface.GetName()) + '_API' + if member.GetProperty('api'): # Override API name. + manually_provided_api = True + # TODO(teravest): Automatically guess the API header file. + api_name = member.GetProperty('api') + else: + manually_provided_api = False + + if arg[0] == 'PP_Instance': + if callback is None: + arg_string = arg[1] + else: + arg_string = '%s, %s' % (arg[1], callback) + if interface.GetProperty('singleton') or member.GetProperty('singleton'): + if not manually_provided_api: + meta.AddApi('ppapi/thunk/%s_api.h' % _StripFileName(filenode)) + return 'EnterInstanceAPI<%s> enter(%s);' % (api_name, arg_string) + else: + return 'EnterInstance enter(%s);' % arg_string + elif arg[0] == 'PP_Resource': + enter_type = 'EnterResource<%s>' % api_name + if not manually_provided_api: + meta.AddApi('ppapi/thunk/%s_api.h' % _StripFileName(filenode)) + if callback is None: + return '%s enter(%s, %s);' % (enter_type, arg[1], + str(handle_errors).lower()) + else: + return '%s enter(%s, %s, %s);' % (enter_type, arg[1], + callback, + str(handle_errors).lower()) + else: + raise TGenError("Unknown type for _MakeEnterLine: %s" % arg[0]) + + +def _GetShortName(interface, filter_suffixes): + """Return a shorter interface name that matches Is* and Create* functions.""" + parts = interface.GetName().split('_')[1:] + tail = parts[len(parts) - 1] + if tail in filter_suffixes: + parts = parts[:-1] + return ''.join(parts) + + +def _IsTypeCheck(interface, node, args): + """Returns true if node represents a type-checking function.""" + if len(args) == 0 or args[0][0] != 'PP_Resource': + return False + return node.GetName() == 'Is%s' % _GetShortName(interface, ['Dev', 'Private']) + + +def _GetCreateFuncName(interface): + """Returns the creation function name for an interface.""" + return 'Create%s' % _GetShortName(interface, ['Dev']) + + +def _GetDefaultFailureValue(t): + """Returns the default failure value for a given type. + + Returns None if no default failure value exists for the type. + """ + values = { + 'PP_Bool': 'PP_FALSE', + 'PP_Resource': '0', + 'struct PP_Var': 'PP_MakeUndefined()', + 'float': '0.0f', + 'int32_t': 'enter.retval()', + 'uint16_t': '0', + 'uint32_t': '0', + 'uint64_t': '0', + 'void*': 'NULL' + } + if t in values: + return values[t] + return None + + +def _MakeCreateMemberBody(interface, member, args): + """Returns the body of a Create() function. + + Args: + interface - IDLNode for the interface + member - IDLNode for member function + args - List of arguments for the Create() function + """ + if args[0][0] == 'PP_Resource': + body = 'Resource* object =\n' + body += ' PpapiGlobals::Get()->GetResourceTracker()->' + body += 'GetResource(%s);\n' % args[0][1] + body += 'if (!object)\n' + body += ' return 0;\n' + body += 'EnterResourceCreation enter(object->pp_instance());\n' + elif args[0][0] == 'PP_Instance': + body = 'EnterResourceCreation enter(%s);\n' % args[0][1] + else: + raise TGenError('Unknown arg type for Create(): %s' % args[0][0]) + + body += 'if (enter.failed())\n' + body += ' return 0;\n' + arg_list = ', '.join([a[1] for a in args]) + if member.GetProperty('create_func'): + create_func = member.GetProperty('create_func') + else: + create_func = _GetCreateFuncName(interface) + body += 'return enter.functions()->%s(%s);' % (create_func, + arg_list) + return body + + +def _GetOutputParams(member, release): + """Returns output parameters (and their types) for a member function. + + Args: + member - IDLNode for the member function + release - Release to get output parameters for + Returns: + A list of name strings for all output parameters of the member + function. + """ + out_params = [] + callnode = member.GetOneOf('Callspec') + if callnode: + cgen = CGen() + for param in callnode.GetListOf('Param'): + mode = cgen.GetParamMode(param) + if mode == 'out': + # We use the 'store' mode when getting the parameter type, since we + # need to call sizeof() for memset(). + _, pname, _, _ = cgen.GetComponents(param, release, 'store') + out_params.append(pname) + return out_params + + +def _MakeNormalMemberBody(filenode, release, node, member, rtype, args, + include_version, meta): + """Returns the body of a typical function. + + Args: + filenode - IDLNode for the file + release - release to generate body for + node - IDLNode for the interface + member - IDLNode for the member function + rtype - Return type for the member function + args - List of 4-tuple arguments for the member function + include_version - whether to include the version in the invocation + meta - ThunkBodyMetadata for header hints + """ + if len(args) == 0: + # Calling into the "Shared" code for the interface seems like a reasonable + # heuristic when we don't have any arguments; some thunk code follows this + # convention today. + meta.AddApi('ppapi/shared_impl/%s_shared.h' % _StripFileName(filenode)) + return 'return %s::%s();' % (_StripApiName(node.GetName()) + '_Shared', + member.GetName()) + + is_callback_func = args[len(args) - 1][0] == 'struct PP_CompletionCallback' + + if is_callback_func: + call_args = args[:-1] + [('', 'enter.callback()', '', '')] + meta.AddInclude('ppapi/c/pp_completion_callback.h') + else: + call_args = args + + if args[0][0] == 'PP_Instance': + call_arglist = ', '.join(a[1] for a in call_args) + function_container = 'functions' + elif args[0][0] == 'PP_Resource': + call_arglist = ', '.join(a[1] for a in call_args[1:]) + function_container = 'object' + else: + # Calling into the "Shared" code for the interface seems like a reasonable + # heuristic when the first argument isn't a PP_Instance or a PP_Resource; + # some thunk code follows this convention today. + meta.AddApi('ppapi/shared_impl/%s_shared.h' % _StripFileName(filenode)) + return 'return %s::%s(%s);' % (_StripApiName(node.GetName()) + '_Shared', + member.GetName(), + ', '.join(a[1] for a in args)) + + function_name = member.GetName() + if include_version: + version = node.GetVersion(release).replace('.', '_') + function_name += version + + invocation = 'enter.%s()->%s(%s)' % (function_container, + function_name, + call_arglist) + + handle_errors = not (member.GetProperty('report_errors') == 'False') + out_params = _GetOutputParams(member, release) + if is_callback_func: + body = '%s\n' % _MakeEnterLine(filenode, node, member, args[0], + handle_errors, args[len(args) - 1][1], meta) + failure_value = member.GetProperty('on_failure') + if failure_value is None: + failure_value = 'enter.retval()' + failure_return = 'return %s;' % failure_value + success_return = 'return enter.SetResult(%s);' % invocation + elif rtype == 'void': + body = '%s\n' % _MakeEnterLine(filenode, node, member, args[0], + handle_errors, None, meta) + failure_return = 'return;' + success_return = '%s;' % invocation # We don't return anything for void. + else: + body = '%s\n' % _MakeEnterLine(filenode, node, member, args[0], + handle_errors, None, meta) + failure_value = member.GetProperty('on_failure') + if failure_value is None: + failure_value = _GetDefaultFailureValue(rtype) + if failure_value is None: + raise TGenError('There is no default value for rtype %s. ' + 'Maybe you should provide an on_failure attribute ' + 'in the IDL file.' % rtype) + failure_return = 'return %s;' % failure_value + success_return = 'return %s;' % invocation + + if member.GetProperty('always_set_output_parameters'): + body += 'if (enter.failed()) {\n' + for param in out_params: + body += ' memset(%s, 0, sizeof(*%s));\n' % (param, param) + body += ' %s\n' % failure_return + body += '}\n' + body += '%s' % success_return + meta.AddBuiltinInclude('string.h') + else: + body += 'if (enter.failed())\n' + body += ' %s\n' % failure_return + body += '%s' % success_return + return body + + +def DefineMember(filenode, node, member, release, include_version, meta): + """Returns a definition for a member function of an interface. + + Args: + filenode - IDLNode for the file + node - IDLNode for the interface + member - IDLNode for the member function + release - release to generate + include_version - include the version in emitted function name. + meta - ThunkMetadata for header hints + Returns: + A string with the member definition. + """ + cgen = CGen() + rtype, name, arrays, args = cgen.GetComponents(member, release, 'return') + log_body = '\"%s::%s()\";' % (node.GetName(), member.GetName()) + if len(log_body) > 69: # Prevent lines over 80 characters. + body = 'VLOG(4) <<\n' + body += ' %s\n' % log_body + else: + body = 'VLOG(4) << %s\n' % log_body + + if _IsTypeCheck(node, member, args): + body += '%s\n' % _MakeEnterLine(filenode, node, member, args[0], False, + None, meta) + body += 'return PP_FromBool(enter.succeeded());' + elif member.GetName() == 'Create' or member.GetName() == 'CreateTrusted': + body += _MakeCreateMemberBody(node, member, args) + else: + body += _MakeNormalMemberBody(filenode, release, node, member, rtype, args, + include_version, meta) + + signature = cgen.GetSignature(member, release, 'return', func_as_ptr=False, + include_version=include_version) + return '%s\n%s\n}' % (cgen.Indent('%s {' % signature, tabs=0), + cgen.Indent(body, tabs=1)) + + +def _IsNewestMember(member, members, releases): + """Returns true if member is the newest node with its name in members. + + Currently, every node in the AST only has one version. This means that we + will have two sibling nodes with the same name to represent different + versions. + See http://crbug.com/157017 . + + Special handling is required for nodes which share their name with others, + but aren't the newest version in the IDL. + + Args: + member - The member which is checked if it's newest + members - The list of members to inspect + releases - The set of releases to check for versions in. + """ + build_list = member.GetUniqueReleases(releases) + release = build_list[0] # Pick the oldest release. + same_name_siblings = filter( + lambda n: str(n) == str(member) and n != member, members) + + for s in same_name_siblings: + sibling_build_list = s.GetUniqueReleases(releases) + sibling_release = sibling_build_list[0] + if sibling_release > release: + return False + return True + + +class TGen(GeneratorByFile): + def __init__(self): + Generator.__init__(self, 'Thunk', 'tgen', 'Generate the C++ thunk.') + + def GenerateFile(self, filenode, releases, options): + savename = _GetThunkFileName(filenode, GetOption('thunkroot')) + my_min, my_max = filenode.GetMinMax(releases) + if my_min > releases[-1] or my_max < releases[0]: + if os.path.isfile(savename): + print "Removing stale %s for this range." % filenode.GetName() + os.remove(os.path.realpath(savename)) + return False + do_generate = filenode.GetProperty('generate_thunk') + if not do_generate: + return False + + thunk_out = IDLOutFile(savename) + body, meta = self.GenerateBody(thunk_out, filenode, releases, options) + # TODO(teravest): How do we handle repeated values? + if filenode.GetProperty('thunk_include'): + meta.AddInclude(filenode.GetProperty('thunk_include')) + self.WriteHead(thunk_out, filenode, releases, options, meta) + thunk_out.Write('\n\n'.join(body)) + self.WriteTail(thunk_out, filenode, releases, options) + thunk_out.ClangFormat() + return thunk_out.Close() + + def WriteHead(self, out, filenode, releases, options, meta): + __pychecker__ = 'unusednames=options' + cgen = CGen() + + cright_node = filenode.GetChildren()[0] + assert(cright_node.IsA('Copyright')) + out.Write('%s\n' % cgen.Copyright(cright_node, cpp_style=True)) + + from_text = 'From %s' % ( + filenode.GetProperty('NAME').replace(os.sep,'/')) + modified_text = 'modified %s.' % ( + filenode.GetProperty('DATETIME')) + out.Write('// %s %s\n\n' % (from_text, modified_text)) + + if meta.BuiltinIncludes(): + for include in sorted(meta.BuiltinIncludes()): + out.Write('#include <%s>\n' % include) + out.Write('\n') + + # TODO(teravest): Don't emit includes we don't need. + includes = ['ppapi/c/pp_errors.h', + 'ppapi/shared_impl/tracked_callback.h', + 'ppapi/thunk/enter.h', + 'ppapi/thunk/ppapi_thunk_export.h'] + includes.append(_GetHeaderFileName(filenode)) + for api in meta.Apis(): + includes.append('%s' % api.lower()) + for i in meta.Includes(): + includes.append(i) + for include in sorted(includes): + out.Write('#include "%s"\n' % include) + out.Write('\n') + out.Write('namespace ppapi {\n') + out.Write('namespace thunk {\n') + out.Write('\n') + out.Write('namespace {\n') + out.Write('\n') + + def GenerateBody(self, out, filenode, releases, options): + """Generates a member function lines to be written and metadata. + + Returns a tuple of (body, meta) where: + body - a list of lines with member function bodies + meta - a ThunkMetadata instance for hinting which headers are needed. + """ + __pychecker__ = 'unusednames=options' + out_members = [] + meta = ThunkBodyMetadata() + for node in filenode.GetListOf('Interface'): + # Skip if this node is not in this release + if not node.InReleases(releases): + print "Skipping %s" % node + continue + + # Generate Member functions + if node.IsA('Interface'): + members = node.GetListOf('Member') + for child in members: + build_list = child.GetUniqueReleases(releases) + # We have to filter out releases this node isn't in. + build_list = filter(lambda r: child.InReleases([r]), build_list) + if len(build_list) == 0: + continue + release = build_list[-1] + include_version = not _IsNewestMember(child, members, releases) + member = DefineMember(filenode, node, child, release, include_version, + meta) + if not member: + continue + out_members.append(member) + return (out_members, meta) + + def WriteTail(self, out, filenode, releases, options): + __pychecker__ = 'unusednames=options' + cgen = CGen() + + version_list = [] + out.Write('\n\n') + for node in filenode.GetListOf('Interface'): + build_list = node.GetUniqueReleases(releases) + for build in build_list: + version = node.GetVersion(build).replace('.', '_') + thunk_name = 'g_' + node.GetName().lower() + '_thunk_' + \ + version + thunk_type = '_'.join((node.GetName(), version)) + version_list.append((thunk_type, thunk_name)) + + out.Write('const %s %s = {\n' % (thunk_type, thunk_name)) + generated_functions = [] + members = node.GetListOf('Member') + for child in members: + rtype, name, arrays, args = cgen.GetComponents( + child, build, 'return') + if child.InReleases([build]): + if not _IsNewestMember(child, members, releases): + version = child.GetVersion( + child.first_release[build]).replace('.', '_') + name += '_' + version + generated_functions.append(name) + out.Write(',\n'.join([' &%s' % f for f in generated_functions])) + out.Write('\n};\n\n') + + out.Write('} // namespace\n') + out.Write('\n') + for thunk_type, thunk_name in version_list: + out.Write('PPAPI_THUNK_EXPORT const %s* Get%s_Thunk() {\n' % + (thunk_type, thunk_type)) + out.Write(' return &%s;\n' % thunk_name) + out.Write('}\n') + out.Write('\n') + out.Write('} // namespace thunk\n') + out.Write('} // namespace ppapi\n') + + +tgen = TGen() + + +def Main(args): + # Default invocation will verify the golden files are unchanged. + failed = 0 + if not args: + args = ['--wnone', '--diff', '--test', '--thunkroot=.'] + + ParseOptions(args) + + idldir = os.path.split(sys.argv[0])[0] + idldir = os.path.join(idldir, 'test_thunk', '*.idl') + filenames = glob.glob(idldir) + ast = ParseFiles(filenames) + if tgen.GenerateRange(ast, ['M13', 'M14', 'M15'], {}): + print "Golden file for M13-M15 failed." + failed = 1 + else: + print "Golden file for M13-M15 passed." + + return failed + + +if __name__ == '__main__': + sys.exit(Main(sys.argv[1:])) diff --git a/browser/extensions/mortar/ppapi/generators/idl_visitor.py b/browser/extensions/mortar/ppapi/generators/idl_visitor.py new file mode 100644 index 000000000000..7945f613dc9a --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/idl_visitor.py @@ -0,0 +1,45 @@ +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +""" Visitor Object for traversing AST """ + +# +# IDLVisitor +# +# The IDLVisitor class will traverse an AST truncating portions of the tree +# when 'VisitFilter' returns false. After the filter returns true, for each +# node, the visitor will call the 'Arrive' member passing in the node and +# and generic data object from the parent call. The returned value is then +# passed to all children who's results are aggregated into a list. The child +# results along with the original Arrive result are passed to the Depart +# function which returns the final result of the Visit. By default this is +# the exact value that was return from the original arrive. +# + +class IDLVisitor(object): + def __init__(self): + pass + + # Return TRUE if the node should be visited + def VisitFilter(self, node, data): + return True + + def Visit(self, node, data): + if not self.VisitFilter(node, data): return None + + childdata = [] + newdata = self.Arrive(node, data) + for child in node.GetChildren(): + ret = self.Visit(child, newdata) + if ret is not None: + childdata.append(ret) + return self.Depart(node, newdata, childdata) + + def Arrive(self, node, data): + __pychecker__ = 'unusednames=node' + return data + + def Depart(self, node, data, childdata): + __pychecker__ = 'unusednames=node,childdata' + return data diff --git a/browser/extensions/mortar/ppapi/generators/test_cgen/enum_typedef.h b/browser/extensions/mortar/ppapi/generators/test_cgen/enum_typedef.h new file mode 100644 index 000000000000..6eb1a0c8fc38 --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/test_cgen/enum_typedef.h @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2011 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* From test_cgen/enum_typedef.idl modified Wed Dec 5 13:08:05 2012. */ + +#ifndef PPAPI_C_TEST_CGEN_ENUM_TYPEDEF_H_ +#define PPAPI_C_TEST_CGEN_ENUM_TYPEDEF_H_ + +#include "ppapi/c/pp_macros.h" +#include "ppapi/c/test_cgen/stdint.h" + +/** + * @file + * This file will test that the IDL snippet matches the comment. + */ + + +/** + * @addtogroup Enums + * @{ + */ +/* typedef enum { A = 1, B = 2, C = 3, D = A + B, E = ~D } et1; */ +typedef enum { + A = 1, + B = 2, + C = 3, + D = A + B, + E = ~D +} et1; +/** + * @} + */ + +/** + * @addtogroup Typedefs + * @{ + */ +/* typedef int32_t i; */ +typedef int32_t i; + +/* typedef int32_t i2[3]; */ +typedef int32_t i2[3]; + +/* typedef int32_t (*i_func)(void); */ +typedef int32_t (*i_func)(void); + +/* typedef int32_t (*i_func_i)(int32_t i); */ +typedef int32_t (*i_func_i)(int32_t i); + +/* typedef et1 et4[4]; */ +typedef et1 et4[4]; + +/* + * typedef int8_t (*PPB_Audio_Callback)(const void* sample_buffer, + * uint32_t buffer_size_in_bytes, + * const void* user_data); + */ +typedef int8_t (*PPB_Audio_Callback)(const void* sample_buffer, + uint32_t buffer_size_in_bytes, + const void* user_data); +/** + * @} + */ + +#endif /* PPAPI_C_TEST_CGEN_ENUM_TYPEDEF_H_ */ + diff --git a/browser/extensions/mortar/ppapi/generators/test_cgen/enum_typedef.idl b/browser/extensions/mortar/ppapi/generators/test_cgen/enum_typedef.idl new file mode 100644 index 000000000000..60d0a6729d48 --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/test_cgen/enum_typedef.idl @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2011 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file will test that the IDL snippet matches the comment. + */ + +/* typedef enum { A = 1, B = 2, C = 3, D = A + B, E = ~D } et1; */ +enum et1 { A=1, B=2, C=3, D=A+B, E=~D }; + +/* typedef int32_t i; */ +typedef int32_t i; + +/* typedef int32_t i2[3]; */ +typedef int32_t[3] i2; + +/* typedef int32_t (*i_func)(void); */ +typedef int32_t i_func(); + +/* typedef int32_t (*i_func_i)(int32_t i); */ +typedef int32_t i_func_i([in] int32_t i); + +/* typedef et1 et4[4]; */ +typedef et1[4] et4; + +/* + * typedef int8_t (*PPB_Audio_Callback)(const void* sample_buffer, + * uint32_t buffer_size_in_bytes, + * const void* user_data); + */ +typedef int8_t PPB_Audio_Callback([in] mem_t sample_buffer, + [in] uint32_t buffer_size_in_bytes, + [in] mem_t user_data); + diff --git a/browser/extensions/mortar/ppapi/generators/test_cgen/interface.h b/browser/extensions/mortar/ppapi/generators/test_cgen/interface.h new file mode 100644 index 000000000000..7288830ea53a --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/test_cgen/interface.h @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2011 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* From test_cgen/interface.idl modified Wed Nov 21 14:22:50 2012. */ + +#ifndef PPAPI_C_TEST_CGEN_INTERFACE_H_ +#define PPAPI_C_TEST_CGEN_INTERFACE_H_ + +#include "ppapi/c/pp_macros.h" +#include "ppapi/c/test_cgen/stdint.h" + +#define IFACEFOO_INTERFACE_1_0 "ifaceFoo;1.0" +#define IFACEFOO_INTERFACE IFACEFOO_INTERFACE_1_0 + +#define IFACEBAR_INTERFACE_1_0 "ifaceBar;1.0" +#define IFACEBAR_INTERFACE IFACEBAR_INTERFACE_1_0 + +/** + * @file + * This file will test that the IDL snippet matches the comment. + */ + + +/** + * @addtogroup Structs + * @{ + */ +/* struct ist { void* X; }; */ +struct ist { + void* X; +}; +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/* + * struct ifaceFoo_1_0 { + * int8_t (*mem1)(int16_t x, int32_t y); + * int32_t (*mem2)(const struct ist* a); + * int32_t (*mem3)(struct ist* b); + * int32_t (*mem4)(const void** ptr); + * int32_t (*mem5)(void** ptr); + * }; + * typedef struct ifaceFoo_1_0 ifaceFoo; + */ +struct ifaceFoo_1_0 { + int8_t (*mem1)(int16_t x, int32_t y); + int32_t (*mem2)(const struct ist* a); + int32_t (*mem3)(struct ist* b); + int32_t (*mem4)(const void** ptr); + int32_t (*mem5)(void** ptr); +}; + +typedef struct ifaceFoo_1_0 ifaceFoo; + +struct ifaceBar_1_0 { + int8_t (*testIface)(const struct ifaceFoo_1_0* foo, int32_t y); + struct ifaceFoo_1_0* (*createIface)(const char* name); +}; + +typedef struct ifaceBar_1_0 ifaceBar; + +struct ifaceNoString_1_0 { + void (*mem)(void); +}; + +typedef struct ifaceNoString_1_0 ifaceNoString; +/** + * @} + */ + +/** + * @addtogroup Structs + * @{ + */ +struct struct2 { + struct ifaceBar_1_0* bar; +}; +/** + * @} + */ + +#endif /* PPAPI_C_TEST_CGEN_INTERFACE_H_ */ + diff --git a/browser/extensions/mortar/ppapi/generators/test_cgen/interface.idl b/browser/extensions/mortar/ppapi/generators/test_cgen/interface.idl new file mode 100644 index 000000000000..202a73a0dacb --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/test_cgen/interface.idl @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2011 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file will test that the IDL snippet matches the comment. + */ + +label Chrome { + M14 = 1.0, + M15 = 2.0 +}; +/* struct ist { void* X; }; */ +struct ist { + mem_t X; +}; + +/* + * struct ifaceFoo_1_0 { + * int8_t (*mem1)(int16_t x, int32_t y); + * int32_t (*mem2)(const struct ist* a); + * int32_t (*mem3)(struct ist* b); + * int32_t (*mem4)(const void** ptr); + * int32_t (*mem5)(void** ptr); + * }; + * typedef struct ifaceFoo_1_0 ifaceFoo; + */ +interface ifaceFoo { + int8_t mem1([in] int16_t x, [in] int32_t y); + int32_t mem2([in] ist a); + int32_t mem3([out] ist b); + int32_t mem4([in] blob_t ptr); + int32_t mem5([out] blob_t ptr); + [version=2.0] int32_t mem6([inout] blob_t ptr); +}; + +interface ifaceBar { + int8_t testIface([in] ifaceFoo foo, [in] int32_t y); + ifaceFoo createIface([in] str_t name); +}; + +[no_interface_string] +interface ifaceNoString { + void mem(); +}; + +struct struct2 { + ifaceBar bar; +}; + diff --git a/browser/extensions/mortar/ppapi/generators/test_cgen/stdint.h b/browser/extensions/mortar/ppapi/generators/test_cgen/stdint.h new file mode 100644 index 000000000000..e49f0c0b9474 --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/test_cgen/stdint.h @@ -0,0 +1,21 @@ +/* Copyright (c) 2011 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* From test_cgen/stdint.idl modified Thu Aug 18 16:20:46 2011. */ + +#ifndef PPAPI_C_TEST_CGEN_STDINT_H_ +#define PPAPI_C_TEST_CGEN_STDINT_H_ + +#include "ppapi/c/pp_macros.h" + +/** + * @file + * This file provides a definition of C99 sized types + * for Microsoft compilers. These definitions only apply + * for trusted modules. + */ + +#endif /* PPAPI_C_TEST_CGEN_STDINT_H_ */ + diff --git a/browser/extensions/mortar/ppapi/generators/test_cgen/stdint.idl b/browser/extensions/mortar/ppapi/generators/test_cgen/stdint.idl new file mode 100644 index 000000000000..f63a66a46ed3 --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/test_cgen/stdint.idl @@ -0,0 +1,54 @@ +/* Copyright (c) 2011 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file provides a definition of C99 sized types + * for Microsoft compilers. These definitions only apply + * for trusted modules. + */ + +label Chrome { + M13 = 0.0, + M14 = 1.0, + M15 = 2.0 +}; + +[version=0.0] +describe { + /** Standard Ints. */ + int8_t; + int16_t; + int32_t; + int64_t; + uint8_t; + uint16_t; + uint32_t; + uint64_t; + /** Small and large floats. */ + double_t; + float_t; + + /** Native file handle (int). */ + handle_t; + + /** Interface object (void *). */ + interface_t; + + /** Used for padding, should be (u)int8_t */ + char; + + /** Pointer to memory (void *). */ + mem_t; + + /** Pointer to null terminated string (char *). */ + str_t; + + /** No return value. */ + void; + + /** Pointer to pointer to memory (void **). */ + blob_t; +}; + diff --git a/browser/extensions/mortar/ppapi/generators/test_cgen/structs.h b/browser/extensions/mortar/ppapi/generators/test_cgen/structs.h new file mode 100644 index 000000000000..352e08e890c7 --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/test_cgen/structs.h @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2011 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* From test_cgen/structs.idl modified Wed Nov 21 11:02:50 2012. */ + +#ifndef PPAPI_C_TEST_CGEN_STRUCTS_H_ +#define PPAPI_C_TEST_CGEN_STRUCTS_H_ + +#include "ppapi/c/pp_macros.h" +#include "ppapi/c/test_cgen/stdint.h" + +/** + * @file + * This file will test that the IDL snippet matches the comment. + */ + + +/** + * @addtogroup Typedefs + * @{ + */ +/* typedef uint8_t s_array[3]; */ +typedef uint8_t s_array[3]; +/** + * @} + */ + +/** + * @addtogroup Enums + * @{ + */ +/* typedef enum { esv1 = 1, esv2 = 2 } senum; */ +typedef enum { + esv1 = 1, + esv2 = 2 +} senum; +/** + * @} + */ + +/** + * @addtogroup Structs + * @{ + */ +/* struct st1 { int32_t i; senum j; }; */ +struct st1 { + int32_t i; + senum j; +}; + +/* struct st2 { s_array pixels[640][480]; }; */ +struct st2 { + s_array pixels[640][480]; +}; +/** + * @} + */ + +/** + * @addtogroup Typedefs + * @{ + */ +/* typedef float (*func_t)(const s_array data); */ +typedef float (*func_t)(const s_array data); + +/* typedef func_t (*findfunc_t)(const char* x); */ +typedef func_t (*findfunc_t)(const char* x); +/** + * @} + */ + +/** + * @addtogroup Structs + * @{ + */ +/* + * struct sfoo { + * s_array screen[480][640]; + * findfunc_t myfunc; + * }; + */ +struct sfoo { + s_array screen[480][640]; + findfunc_t myfunc; +}; +/** + * @} + */ + +#endif /* PPAPI_C_TEST_CGEN_STRUCTS_H_ */ + diff --git a/browser/extensions/mortar/ppapi/generators/test_cgen/structs.idl b/browser/extensions/mortar/ppapi/generators/test_cgen/structs.idl new file mode 100644 index 000000000000..b91949c61aa5 --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/test_cgen/structs.idl @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2011 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file will test that the IDL snippet matches the comment. + */ + +label Chrome { + M14=1.0 +}; + +/* typedef uint8_t s_array[3]; */ +typedef uint8_t[3] s_array; + +/* typedef enum { esv1 = 1, esv2 = 2 } senum; */ +enum senum { + esv1=1, + esv2=2 +}; + +/* struct st1 { int32_t i; senum j; }; */ +struct st1 { + int32_t i; + senum j; +}; + +/* struct st2 { s_array pixels[640][480]; }; */ +struct st2 { + s_array[640][480] pixels; +}; + +/* typedef float (*func_t)(const s_array data); */ +typedef float_t func_t([in] s_array data); + +/* typedef func_t (*findfunc_t)(const char* x); */ +typedef func_t findfunc_t([in] str_t x); + +/* + * struct sfoo { + * s_array screen[480][640]; + * findfunc_t myfunc; + * }; + */ +struct sfoo { + s_array[480][640] screen; + findfunc_t myfunc; +}; diff --git a/browser/extensions/mortar/ppapi/generators/test_cgen_range/dev_channel_interface.h b/browser/extensions/mortar/ppapi/generators/test_cgen_range/dev_channel_interface.h new file mode 100644 index 000000000000..325a770a765a --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/test_cgen_range/dev_channel_interface.h @@ -0,0 +1,101 @@ +/* Copyright 2013 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* From test_cgen_range/dev_channel_interface.idl, + * modified Tue Dec 3 14:58:15 2013. + */ + +#ifndef PPAPI_C_TEST_CGEN_RANGE_DEV_CHANNEL_INTERFACE_H_ +#define PPAPI_C_TEST_CGEN_RANGE_DEV_CHANNEL_INTERFACE_H_ + +#include "ppapi/c/pp_macros.h" + +#define TESTDEV_INTERFACE_1_0 "TestDev;1.0" +#define TESTDEV_INTERFACE_1_2 "TestDev;1.2" +#define TESTDEV_INTERFACE_1_3 "TestDev;1.3" /* dev */ +#define TESTDEV_INTERFACE TESTDEV_INTERFACE_1_2 + +#define TESTDEVTOSTABLE_INTERFACE_1_0 "TestDevToStable;1.0" +#define TESTDEVTOSTABLE_INTERFACE_1_1 "TestDevToStable;1.1" /* dev */ +#define TESTDEVTOSTABLE_INTERFACE_1_2 "TestDevToStable;1.2" +#define TESTDEVTOSTABLE_INTERFACE TESTDEVTOSTABLE_INTERFACE_1_2 + +/** + * @file + */ + + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * TestDev + */ +struct TestDev_1_3 { /* dev */ + /** + * TestDev1() + */ + void (*TestDev1)(void); + /** + * TestDev2() + */ + void (*TestDev2)(void); + /** + * TestDev3() + */ + void (*TestDev3)(void); + /** + * TestDev4() + */ + void (*TestDev4)(void); +}; + +struct TestDev_1_0 { + void (*TestDev1)(void); +}; + +struct TestDev_1_2 { + void (*TestDev1)(void); + void (*TestDev3)(void); +}; + +typedef struct TestDev_1_2 TestDev; + +/** + * TestDevToStable + */ +struct TestDevToStable_1_2 { + /** + * Foo() comment. + */ + void (*Foo)(int32_t x); + /** + * Bar() comment. + */ + void (*Bar)(int32_t x); + /** + * Baz() comment. + */ + void (*Baz)(int32_t x); +}; + +typedef struct TestDevToStable_1_2 TestDevToStable; + +struct TestDevToStable_1_0 { + void (*Foo)(int32_t x); +}; + +struct TestDevToStable_1_1 { /* dev */ + void (*Foo)(int32_t x); + void (*Bar)(int32_t x); + void (*Baz)(int32_t x); +}; +/** + * @} + */ + +#endif /* PPAPI_C_TEST_CGEN_RANGE_DEV_CHANNEL_INTERFACE_H_ */ + diff --git a/browser/extensions/mortar/ppapi/generators/test_cgen_range/dev_channel_interface.idl b/browser/extensions/mortar/ppapi/generators/test_cgen_range/dev_channel_interface.idl new file mode 100644 index 000000000000..d3ae0ec4d81f --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/test_cgen_range/dev_channel_interface.idl @@ -0,0 +1,67 @@ +/* Copyright 2013 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +label Chrome { + M13 = 1.0, + [channel=dev] M14 = 1.1, + M15 = 1.2, + [channel=dev] M16 = 1.3, + M17 = 1.4 +}; + +describe { + int32_t; + void; +}; + +/** + * TestDev + */ +interface TestDev { + /** + * TestDev1() + */ + void TestDev1(); + + /** + * TestDev2() + */ + [dev_version=1.1] + void TestDev2(); + + /** + * TestDev3() + */ + [version=1.2] + void TestDev3(); + + /** + * TestDev4() + */ + [dev_version=1.3] + void TestDev4(); +}; + +/** + * TestDevToStable + */ +interface TestDevToStable { + /** + * Foo() comment. + */ + void Foo([in] int32_t x); + + /** + * Bar() comment. + */ + [dev_version=1.1, version=1.2] + void Bar([in] int32_t x); + + /** + * Baz() comment. + */ + [dev_version=1.1, version=1.2] + void Baz([in] int32_t x); +}; diff --git a/browser/extensions/mortar/ppapi/generators/test_cgen_range/versions.h b/browser/extensions/mortar/ppapi/generators/test_cgen_range/versions.h new file mode 100644 index 000000000000..9d837db872da --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/test_cgen_range/versions.h @@ -0,0 +1,50 @@ +/* Copyright (c) 2011 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* From test_cgen_range/versions.idl modified Wed Nov 21 15:18:23 2012. */ + +#ifndef PPAPI_C_TEST_CGEN_RANGE_VERSIONS_H_ +#define PPAPI_C_TEST_CGEN_RANGE_VERSIONS_H_ + +#include "ppapi/c/pp_macros.h" +#include "ppapi/c/test_cgen_range/dev_channel_interface.h" + +#define FOO_INTERFACE_0_0 "Foo;0.0" +#define FOO_INTERFACE_1_0 "Foo;1.0" +#define FOO_INTERFACE_2_0 "Foo;2.0" +#define FOO_INTERFACE FOO_INTERFACE_2_0 + +/** + * @file + * File Comment. */ + + +/** + * @addtogroup Interfaces + * @{ + */ +/* Bogus Interface Foo */ +struct Foo_2_0 { + /** + * Comment for function x,y,z + */ + int32_t (*Bar)(int32_t x, int32_t y, int32_t z); +}; + +typedef struct Foo_2_0 Foo; + +struct Foo_0_0 { + int32_t (*Bar)(int32_t x); +}; + +struct Foo_1_0 { + int32_t (*Bar)(int32_t x, int32_t y); +}; +/** + * @} + */ + +#endif /* PPAPI_C_TEST_CGEN_RANGE_VERSIONS_H_ */ + diff --git a/browser/extensions/mortar/ppapi/generators/test_cgen_range/versions.idl b/browser/extensions/mortar/ppapi/generators/test_cgen_range/versions.idl new file mode 100644 index 000000000000..e00686e654f6 --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/test_cgen_range/versions.idl @@ -0,0 +1,32 @@ +/* Copyright (c) 2011 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* File Comment. */ + +label Chrome { + M13 = 0.0, + M14 = 1.0, + M15 = 2.0, + M16 = 3.0, + M17 = 4.0 +}; + +/* Bogus Interface Foo */ +[version=0.0] +interface Foo { + /** + * Comment for function x + */ + [version=0.0] int32_t Bar(int32_t x); + /** + * Comment for function x,y + */ + [version=1.0] int32_t Bar(int32_t x, int32_t y); + /** + * Comment for function x,y,z + */ + [version=2.0] int32_t Bar(int32_t x, int32_t y, int32_t z); +}; + diff --git a/browser/extensions/mortar/ppapi/generators/test_gen_pnacl/test_interfaces.idl b/browser/extensions/mortar/ppapi/generators/test_gen_pnacl/test_interfaces.idl new file mode 100644 index 000000000000..0abe79934a7c --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/test_gen_pnacl/test_interfaces.idl @@ -0,0 +1,161 @@ +/* + * Copyright (c) 2011 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file will test that the pnacl-generated wrapper functions match + * the comments in this IDL. + */ + +label Chrome { + M13 = 0.0, + M14 = 1.0, + M15 = 2.0 +}; + +describe { + void; + mem_t; + int32_t; +}; + +[passByValue, returnByValue] struct some_struct { + mem_t X; + int32_t Y; +}; + +struct some_struct2 { + mem_t X; + int32_t Y; +}; + +[union, passByValue, returnByValue] struct some_union { + mem_t X; + int32_t Y; +}; + +/* + * static int32_t + * Pnacl_M15_PPB_Iface_struct_wrap_foo1(int32_t a, struct some_struct* b) { + * const struct PPB_Iface_struct_wrap_2_0 *iface = + * Pnacl_WrapperInfo_PPB_Iface_struct_wrap_2_0.real_iface; + * return iface->foo1(a, *b); + * } + */ +[version=2.0] +interface PPB_Iface_struct_wrap { + int32_t foo1(int32_t a, [in] some_struct b); +}; + +/* + * static int32_t + * Pnacl_M15_PPB_Iface_union_wrap_foo1(int32_t a, union some_union* b) { + * const struct PPB_Iface_union_wrap_2_0 *iface = + * Pnacl_WrapperInfo_PPB_Iface_union_wrap_2_0.real_iface; + * return iface->foo1(a, *b); + * } + */ +[version=2.0] +interface PPB_Iface_union_wrap { + int32_t foo1(int32_t a, [in] some_union b); +}; + + +[version=2.0] +interface PPB_Iface_nowrap { + int32_t foo1(int32_t a, [in] some_struct2 b); +}; + + +/* + * static + * int32_t Pnacl_M13_PPB_SomeWrap_foo1(struct some_struct* a) { + * const struct PPB_SomeWrap_0_0 *iface = + * Pnacl_WrapperInfo_PPB_SomeWrap_0_0.real_iface; + * return iface->foo1(*a); + * } + * + * static + * void Pnacl_M13_PPB_SomeWrap_foo2(struct some_struct* _struct_result, + * int32_t a) { + * const struct PPB_SomeWrap_0_0 *iface = + * Pnacl_WrapperInfo_PPB_SomeWrap_0_0.real_iface; + * *_struct_result = iface->foo2(a); + * } + */ +[version=0.0] +interface PPB_SomeWrap { + int32_t foo1([in] some_struct a); + some_struct foo2([in] int32_t a); + + /* Not generating wrapper methods for PPB_SomeWrap_1_0 */ + [version=1.0] + int32_t foo1([in] some_struct[] a); + [version=1.0] + void foo2([in] int32_t a, [out] some_struct b); + + /* Not generating wrapper methods for PPB_SomeWrap */ + [version=2.0] + int32_t foo1([in] some_struct2 a); +}; + + +/* + * static int32_t Pnacl_M13_PPP_SomeWrap_foo1(struct some_struct a) { + * const struct PPP_SomeWrap_0_0 *iface = + * Pnacl_WrapperInfo_PPP_SomeWrap_0_0.real_iface; + * int32_t (*temp_fp)(struct some_struct* a) = + * ((int32_t (*)(struct some_struct* a))iface->foo1); + * return temp_fp(&a); + * } + * + * static struct some_struct Pnacl_M13_PPP_SomeWrap_foo2(int32_t a) { + * const struct PPP_SomeWrap_0_0 *iface = + * Pnacl_WrapperInfo_PPP_SomeWrap_0_0.real_iface; + * void (*temp_fp)(struct some_struct* _struct_result, int32_t a) = + * ((void (*)(struct some_struct* _struct_result, int32_t a))iface->foo2); + * struct some_struct _struct_result; + * temp_fp(&_struct_result, a); + * return _struct_result; + * } + * + * static struct some_struct Pnacl_M14_PPP_SomeWrap_foo2(int32_t a) { + * const struct PPP_SomeWrap_1_0 *iface = + * Pnacl_WrapperInfo_PPP_SomeWrap_1_0.real_iface; + * void (*temp_fp)(struct some_struct* _struct_result, int32_t a) = + * ((void (*)(struct some_struct* _struct_result, int32_t a))iface->foo2); + * struct some_struct _struct_result; + * temp_fp(&_struct_result, a); + * return _struct_result; + * } + * + * static int32_t Pnacl_M14_PPP_SomeWrap_foo1(const struct some_struct a[]) { + * const struct PPP_SomeWrap_1_0 *iface = + * Pnacl_WrapperInfo_PPP_SomeWrap_1_0.real_iface; + * int32_t (*temp_fp)(const struct some_struct a[]) = + * ((int32_t (*)(const struct some_struct a[]))iface->foo1); + * return temp_fp(a); + * } + */ +[version=0.0] +interface PPP_SomeWrap { + int32_t foo1([in] some_struct a); + some_struct foo2([in] int32_t a); + + [version=1.0] + int32_t foo1([in] some_struct[] a); + + /* Not generating wrapper interface for PPP_SomeWrap */ + [version=2.0] + int32_t foo1([in] some_struct2 a); + [version=2.0] + void foo2([in] int32_t a); +}; + +[no_interface_string] +interface PPP_NoIFString { + int32_t Dummy([in] some_struct a); +}; + diff --git a/browser/extensions/mortar/ppapi/generators/test_namespace/bar.idl b/browser/extensions/mortar/ppapi/generators/test_namespace/bar.idl new file mode 100644 index 000000000000..0e1d76ba17d7 --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/test_namespace/bar.idl @@ -0,0 +1,33 @@ +/* Copyright (c) 2011 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* This file tests the namespace functions in the parser. */ + +label Chrome { + M14 = 1.0 +}; + +/* PPAPI ID */ +typedef int32_t PP_Instance; + +/* PPAPI ID */ +typedef int32_t PP_Resource; + +/* Interface test */ +interface PPB_Bar_0_3 { + /* Face create */ + PP_Resource Create( + [in] PP_Instance instance, + [in] PP_Size size, + [in] PP_Bool is_always_opaque); + + /* Returns PP_TRUE if the given resource is a valid Graphics2D, PP_FALSE if it + * is an invalid resource or is a resource of another type. + */ + PP_Bool IsGraphics2D( + [in] PP_Resource resource); +}; + + diff --git a/browser/extensions/mortar/ppapi/generators/test_namespace/foo.idl b/browser/extensions/mortar/ppapi/generators/test_namespace/foo.idl new file mode 100644 index 000000000000..a027b93a9228 --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/test_namespace/foo.idl @@ -0,0 +1,26 @@ +/* Copyright (c) 2011 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* File Comment */ + +describe { + int32_t; +}; + +/* PPAPI Structure */ +struct PP_Size { + /* This value represents the width of the rectangle. */ + int32_t width; + /* This value represents the height of the rectangle. */ + int32_t height; +}; + +/* PPAPI Enum */ +enum PP_Bool { + /* Decalare False */ + PP_FALSE = 0, + /* Decalare True */ + PP_TRUE = 1 +}; diff --git a/browser/extensions/mortar/ppapi/generators/test_parser/dictionary.idl b/browser/extensions/mortar/ppapi/generators/test_parser/dictionary.idl new file mode 100644 index 000000000000..1035cd1c3553 --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/test_parser/dictionary.idl @@ -0,0 +1,17 @@ +/* Copyright 2013 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +dictionary MyDict { + /* OK Member(setString) */ + DOMString setString; + /* OK Member(unsetLong) */ + long unsetLong; +}; + +/* FAIL Unexpected "}" after symbol unsetLong. */ +dictionary MyDict { + DOMString setString; + long unsetLong +}; diff --git a/browser/extensions/mortar/ppapi/generators/test_parser/enum.idl b/browser/extensions/mortar/ppapi/generators/test_parser/enum.idl new file mode 100644 index 000000000000..7048d4f562c5 --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/test_parser/enum.idl @@ -0,0 +1,108 @@ +/* Copyright (c) 2011 The Chromium Authors. All rights reserved. + Use of this source code is governed by a BSD-style license that can be + found in the LICENSE file. */ + +/* This file tests parsing of enumerations under different conditions */ + +/* OK Enum(Es1) */ +enum Es1 { + /* OK EnumItem(E1) */ + E1 = 1, + /* OK EnumItem(E2) */ + E2 = 2 +}; + +/* FAIL Enum missing name. */ +enum { + E3 = 3, + E4 = 4 +}; + +/* OK Enum(Es3) */ +enum Es3 { + E5 = 1 << 1, + E6 = 3 << 2 +}; + +/* FAIL Unexpected empty block. */ +enum Es4 { +}; + +/* OK Enum(Es5) */ +enum Es5 { + /* OK EnumItem(E9) */ + E9 = 9, + /* OK EnumItem(E10) */ + /* FAIL Trailing comma in block. */ + E10 = 10, +}; + +/* FAIL Unexpected trailing comment. */ +enum Es6 { + E5 = 11, + E6 = 12 +} + +/* Bad comment because of Es6 */ +enum Es7 { + E11 = 11 +}; + + +/* OK Enum(Es8) */ +enum Es8 { + /* OK EnumItem(E12) */ + E12 = 12, + /* OK EnumItem(E13) */ + /* FAIL Unexpected value 13.0 after "=". */ + E13 = 13.0, + /* FAIL Unexpected string "hello" after "=". */ + /* OK EnumItem(E14) */ + E14 = "hello", + /* OK EnumItem(E15) */ + E15 = 0x400 +}; + +/* OK Enum(Es9) */ +enum Es9 { + /* OK EnumItem(Es9_1) */ + Es9_1 = 0, + /* OK EnumItem(Es9_2) */ + Es9_2 = Es9_1, + /* OK EnumItem(Es9_3) */ + Es9_3 = Es9_1 << Es9_2, + /* OK EnumItem(Es9_3a) */ + /* FAIL Unexpected symbol Es9_2 after symbol Es9_1. */ + Es9_3a = Es9_1 Es9_2, + /* OK EnumItem(Es9_4) */ + Es9_4 = Es9_1 >> Es9_2, + /* OK EnumItem(Es9_5) */ + Es9_5 = Es9_1 | Es9_2, + /* OK EnumItem(Es9_6) */ + Es9_6 = Es9_1 & Es9_2, + /* OK EnumItem(Es9_7) */ + Es9_7 = Es9_1 ^ Es9_2, + /* OK EnumItem(Es9_8) */ + Es9_8 = Es9_1 + Es9_2, + /* OK EnumItem(Es9_9) */ + Es9_9 = Es9_1 - Es9_2, + /* OK EnumItem(Es9_10) */ + Es9_10 = Es9_1 * Es9_2, + /* OK EnumItem(Es9_11) */ + Es9_11 = Es9_1 / Es9_2, + /* OK EnumItem(Es9_12) */ + Es9_12 = -Es9_1, + /* OK EnumItem(Es9_13) */ + Es9_13 = ~Es9_1, + /* OK EnumItem(Es9_14) */ + Es9_14 = (Es9_1), + /* OK EnumItem(Es9_14a) */ + /* FAIL Unexpected ,. */ + Es9_14a = (Es9_1, + /* OK EnumItem(Es9_15) */ + Es9_15 = (Es9_1 + Es9_2) << Es9_3 + 1, + /* OK EnumItem(Es9_16) */ + Es9_16 = Es9_1 + -Es9_2 +}; + + diff --git a/browser/extensions/mortar/ppapi/generators/test_parser/interface.idl b/browser/extensions/mortar/ppapi/generators/test_parser/interface.idl new file mode 100644 index 000000000000..712027a88d8b --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/test_parser/interface.idl @@ -0,0 +1,59 @@ +/* Copyright (c) 2011 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* Tests for interface */ + +/* OK Interface(Interface1) */ +interface Interface1 { + /* OK Member(OneParam) */ + PP_Bool OneParam( + /* OK Param(resource) */ + [in] PP_Resource resource); + + /* OK Member(TwoParam) */ + PP_Resource TwoParam( + /* OK Param(instance) */ + [in] PP_Instance instance, + /* OK Param(size) */ + [in] PP_Size size); + + /* OK Member(ThreeParam) */ + PP_Bool ThreeParam( + /* OK Param(graphics_2d) */ + [in] PP_Resource graphics_2d, + /* OK Param(size) */ + [out] PP_Size size, + /* OK Param(is_always_opaque) */ + [out] PP_Bool is_always_opaque); + + /* OK Member(ReturnArray) */ + PP_Resource[] ReturnArray(); +}; + + +/* OK Interface(Interface2) */ +interface Interface2 { + /* OK Member(OneParam) */ + PP_Bool OneParam( + /* OK Param(resource) */ + [in] PP_Resource resource); + + /* OK Member(TwoParam) */ + PP_Resource TwoParam( + /* OK Param(instance) */ + [in] PP_Instance instance, + /* OK Param(size) */ + /* FAIL Missing argument. */ + [in] PP_Size size, ); + + /* OK Member(ThreeParam) */ + PP_Bool ThreeParam( + /* OK Param(graphics_2d) */ + [in] PP_Resource graphics_2d, + /* FAIL Unexpected "," after symbol PP_Size. */ + [out] PP_Size, + /* OK Param(is_always_opaque) */ + [out] PP_Bool is_always_opaque); +}; diff --git a/browser/extensions/mortar/ppapi/generators/test_parser/struct.idl b/browser/extensions/mortar/ppapi/generators/test_parser/struct.idl new file mode 100644 index 000000000000..22fc40ff9a36 --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/test_parser/struct.idl @@ -0,0 +1,34 @@ +/* Copyright (c) 2011 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* Tests for structures */ + +/* OK Struct(S1) */ +struct S1 { + /* OK Member(Mem1) */ + PP_Bool Mem1; + /* OK Member(Mem2) */ + PP_Resource Mem2; +}; + +typedef int func([in] int x, [in] int y); + +/* OK Struct(S2) */ +struct S2 { + /* OK Member(Mem1) */ + PP_Bool Mem1; + /* OK Member(Mem2) */ + PP_Resource Mem2; + /* OK Member(Mem3) */ + [attr1, attr2] PP_Resource Mem3; + /* OK Member(foo) */ + FuncFoo foo; +}; + +/* FAIL Struct missing name. */ +struct { + PP_Bool Mem1; + PP_Resource Mem2; +}; \ No newline at end of file diff --git a/browser/extensions/mortar/ppapi/generators/test_parser/typedef.idl b/browser/extensions/mortar/ppapi/generators/test_parser/typedef.idl new file mode 100644 index 000000000000..88389cea19ec --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/test_parser/typedef.idl @@ -0,0 +1,46 @@ +/* Copyright (c) 2011 The Chromium Authors. All rights reserved. + Use of this source code is governed by a BSD-style license that can be + found in the LICENSE file. */ + +/* This file tests parsing of typedefs under different conditions */ + +/* OK Typedef(T1) */ +typedef int32_t T1; + +/* FAIL Unexpected comment after symbol T2. */ +typedef int32_t T2 + +/* OK Typedef(T3) */ +typedef int32_t[] T3; + +/* OK Typedef(T4) */ +typedef int32_t[][4] T4; + +/* FAIL Unexpected "(" after symbol T5. */ +typedef int32_t[4] T5(); + +/* OK Typedef(T6) */ +typedef int32_t T6([in] int32_t x); + +/* OK Typedef(T7) */ +typedef int32_t T7( + /* OK Param(x) */ + [in] int32_t x, + /* OK Param(y) */ + [in] int32_t y); + +/* OK Typedef(T8) */ +typedef T3 T8( + /* OK Param(x) */ + [in] int x, + /* OK Param(y) */ + [in] int y, + /* OK Param(z) */ + /* FAIL Missing argument. */ + [in] int z,); + +/* FAIL Unexpected keyword "enum" after symbol int32_t. */ +typedef int32_t enum; + +/* FAIL Unexpected ";" after symbol foo. */ +typedef foo; diff --git a/browser/extensions/mortar/ppapi/generators/test_thunk/basic_test_types.idl b/browser/extensions/mortar/ppapi/generators/test_thunk/basic_test_types.idl new file mode 100644 index 000000000000..0f424668b0a7 --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/test_thunk/basic_test_types.idl @@ -0,0 +1,58 @@ +/* Copyright (c) 2011 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines some basic types for use in testing. + */ + +label Chrome { + M13 = 0.0, + M14 = 1.0, + M15 = 2.0 +}; + +[version=0.0] +describe { + /** Standard Ints. */ + int8_t; + int16_t; + int32_t; + int64_t; + uint8_t; + uint16_t; + uint32_t; + uint64_t; + /** Small and large floats. */ + double_t; + float_t; + + /** Native file handle (int). */ + handle_t; + + /** Interface object (void *). */ + interface_t; + + /** Used for padding, should be (u)int8_t */ + char; + + /** Pointer to memory (void *). */ + mem_t; + + /** Pointer to null terminated string (char *). */ + str_t; + + /** No return value. */ + void; + + /** Pointer to pointer to memory (void **). */ + blob_t; + + /** Pepper types */ + PP_Bool; + PP_Instance; + PP_Resource; + PP_Var; +}; + diff --git a/browser/extensions/mortar/ppapi/generators/test_thunk/simple.idl b/browser/extensions/mortar/ppapi/generators/test_thunk/simple.idl new file mode 100644 index 000000000000..c4ce7b9f4a99 --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/test_thunk/simple.idl @@ -0,0 +1,39 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +[generate_thunk] + +/** + * This file defines the PPB_Simple interface. + */ + +label Chrome { + M13 = 0.5, + M14 = 1.0, + M15 = 1.5 +}; + +interface PPB_Simple { + PP_Resource Create([in] PP_Instance instance); + + PP_Bool IsSimple([in] PP_Resource resource); + + [deprecate=1.0] + void PostMessage([in] PP_Instance instance, [in] PP_Var message); + + uint32_t DoUint32Instance([in] PP_Instance instance); + + [version=1.5] + uint32_t DoUint32Instance([in] PP_Instance instance, + [in] PP_Resource resource); + + uint32_t DoUint32Resource([in] PP_Resource instance); + + [report_errors=False] + uint32_t DoUint32ResourceNoErrors([in] PP_Resource instance); + + [version=1.0, on_failure="12"] + int32_t OnFailure12([in] PP_Instance instance); +}; diff --git a/browser/extensions/mortar/ppapi/generators/test_thunk/simple_thunk.cc b/browser/extensions/mortar/ppapi/generators/test_thunk/simple_thunk.cc new file mode 100644 index 000000000000..8fc2ba26aba2 --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/test_thunk/simple_thunk.cc @@ -0,0 +1,125 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// From ../test_thunk/simple.idl modified Fri Nov 16 11:26:06 2012. + +#include "ppapi/c/../test_thunk/simple.h" +#include "ppapi/c/pp_errors.h" +#include "ppapi/shared_impl/tracked_callback.h" +#include "ppapi/thunk/enter.h" +#include "ppapi/thunk/ppb_instance_api.h" +#include "ppapi/thunk/resource_creation_api.h" +#include "ppapi/thunk/simple_api.h" +#include "ppapi/thunk/thunk.h" + +namespace ppapi { +namespace thunk { + +namespace { + +PP_Resource Create(PP_Instance instance) { + VLOG(4) << "PPB_Simple::Create()"; + EnterResourceCreation enter(instance); + if (enter.failed()) + return 0; + return enter.functions()->CreateSimple(instance); +} + +PP_Bool IsSimple(PP_Resource resource) { + VLOG(4) << "PPB_Simple::IsSimple()"; + EnterResource enter(resource, false); + return PP_FromBool(enter.succeeded()); +} + +void PostMessage(PP_Instance instance, PP_Var message) { + VLOG(4) << "PPB_Simple::PostMessage()"; + EnterInstance enter(instance); + if (enter.failed()) + return; + enter.functions()->PostMessage(instance, message); +} + +uint32_t DoUint32Instance_0_5(PP_Instance instance) { + VLOG(4) << "PPB_Simple::DoUint32Instance()"; + EnterInstance enter(instance); + if (enter.failed()) + return 0; + return enter.functions()->DoUint32Instance0_5(instance); +} + +uint32_t DoUint32Instance(PP_Instance instance, PP_Resource resource) { + VLOG(4) << "PPB_Simple::DoUint32Instance()"; + EnterInstance enter(instance); + if (enter.failed()) + return 0; + return enter.functions()->DoUint32Instance(instance, resource); +} + +uint32_t DoUint32Resource(PP_Resource instance) { + VLOG(4) << "PPB_Simple::DoUint32Resource()"; + EnterResource enter(instance, true); + if (enter.failed()) + return 0; + return enter.object()->DoUint32Resource(); +} + +uint32_t DoUint32ResourceNoErrors(PP_Resource instance) { + VLOG(4) << "PPB_Simple::DoUint32ResourceNoErrors()"; + EnterResource enter(instance, false); + if (enter.failed()) + return 0; + return enter.object()->DoUint32ResourceNoErrors(); +} + +int32_t OnFailure12(PP_Instance instance) { + VLOG(4) << "PPB_Simple::OnFailure12()"; + EnterInstance enter(instance); + if (enter.failed()) + return 12; + return enter.functions()->OnFailure12(instance); +} + +const PPB_Simple_0_5 g_ppb_simple_thunk_0_5 = { + &Create, + &IsSimple, + &PostMessage, + &DoUint32Instance_0_5, + &DoUint32Resource, + &DoUint32ResourceNoErrors +}; + +const PPB_Simple_1_0 g_ppb_simple_thunk_1_0 = { + &Create, + &IsSimple, + &DoUint32Instance_0_5, + &DoUint32Resource, + &DoUint32ResourceNoErrors, + &OnFailure12 +}; + +const PPB_Simple_1_5 g_ppb_simple_thunk_1_5 = { + &Create, + &IsSimple, + &DoUint32Instance, + &DoUint32Resource, + &DoUint32ResourceNoErrors, + &OnFailure12 +}; + +} // namespace + +const PPB_Simple_0_5* GetPPB_Simple_0_5_Thunk() { + return &g_ppb_simple_thunk_0_5; +} + +const PPB_Simple_1_0* GetPPB_Simple_1_0_Thunk() { + return &g_ppb_simple_thunk_1_0; +} + +const PPB_Simple_1_5* GetPPB_Simple_1_5_Thunk() { + return &g_ppb_simple_thunk_1_5; +} + +} // namespace thunk +} // namespace ppapi diff --git a/browser/extensions/mortar/ppapi/generators/test_version/versions.idl b/browser/extensions/mortar/ppapi/generators/test_version/versions.idl new file mode 100644 index 000000000000..4d1a42fc13d2 --- /dev/null +++ b/browser/extensions/mortar/ppapi/generators/test_version/versions.idl @@ -0,0 +1,66 @@ +/* Copyright (c) 2011 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* File Comment. */ + +label Chrome { + M13 = 0.0, + M14 = 1.0, + M15 = 2.0 +}; + +describe { + int32_t; +}; + +/*REL: M13 M15 */ +[version=0.0] +interface iFoo { + /** + * Comment for function x + */ + [version=0.0] int32_t Bar([in] int32_t x); + /** + * Comment for function x,y,z + */ + [version=2.0] int32_t Bar([in] int32_t x, [in] int32_t y, [in] int32_t z); +}; + + +/*REL: M13 M15 */ +[version=0.0] +struct iBar { + /** + * Comment for function x + */ + [version=0.0] iFoo x; +}; + +/*REL: M13 M14 M15 */ +[version=0.0] +struct iX { + /** + * Comment for function x + */ + [version=0.0] iFoo x; + /** + * Comment for member y + */ + [version=1.0] int32_t y; +}; + + +/** + * Typedef to generate M13-M14, M15 + */ +typedef int32_t callback_t([in] int32_t x, [in, version=2.0] int32_t y); + +/*REL: M13 M14 M15 */ +interface iFooX { + /** + * Comment for function Bar + */ + int32_t Bar([in, version=1.0] callback_t cb); +}; \ No newline at end of file diff --git a/browser/extensions/mortar/ppapi/out/rpc.cc b/browser/extensions/mortar/ppapi/out/rpc.cc new file mode 100644 index 000000000000..62f11010114d --- /dev/null +++ b/browser/extensions/mortar/ppapi/out/rpc.cc @@ -0,0 +1,61332 @@ +/* + * DO NOT EDIT. THIS FILE IS GENERATED. + */ + +/* pp_macros.idl */ + +/* + * @addtogroup PP + * @{ + */ + +/* Use PP_INLINE to tell the compiler to inline functions. The main purpose of + * inline functions in ppapi is to allow us to define convenience functions in + * the ppapi header files, without requiring clients or implementers to link a + * PPAPI C library. The "inline" keyword is not supported by pre-C99 C + * compilers (such as MS Visual Studio 2008 and older versions of GCC). MSVS + * supports __forceinline and GCC supports __inline__. Use of the static + * keyword ensures (in C) that the function is not compiled on its own, which + * could cause multiple definition errors. + * http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx + * http://gcc.gnu.org/onlinedocs/gcc/Inline.html + */ +#if defined(__cplusplus) +/* The inline keyword is part of C++ and guarantees we won't get multiple + * definition errors. + */ +# define PP_INLINE inline +#else +# if defined(_MSC_VER) +# define PP_INLINE static __forceinline +# else +# define PP_INLINE static __inline__ +# endif +#endif + +/* This is a compile-time assertion useful for ensuring that a given type is + a given number of bytes wide. The size of the array is designed to be 1 + (which should always be valid) if the enum's size is SIZE, and otherwise the + size of the array will be -1 (which all/most compilers should flag as an + error). This is wrapped inside a struct, because if it is a simple global + we get multiple definition errors at link time. + + NAME is the name of the type without any spaces or the struct or enum + keywords. + + CTYPENAME is the typename required by C. I.e., for a struct or enum, the + appropriate keyword must be included. + + SIZE is the expected size in bytes. + */ +#define PP_COMPILE_ASSERT_SIZE_IN_BYTES_IMPL(NAME, CTYPENAME, SIZE) \ +struct PP_Dummy_Struct_For_##NAME { \ +char _COMPILE_ASSERT_FAILED_The_type_named_ \ +## NAME ## _is_not_ ## SIZE ## \ +_bytes_wide[(sizeof(CTYPENAME) == SIZE) ? 1 : -1]; } + +/* PP_COMPILE_ASSERT_SIZE_IN_BYTES is for typenames that contain no spaces. + E.g.: + PP_COMPILE_ASSERT_SIZE_IN_BYTES(int, 4); + typedef struct { int a; } Foo; + PP_COMPILE_ASSERT_SIZE_IN_BYTES(Foo, 4); + */ +#define PP_COMPILE_ASSERT_SIZE_IN_BYTES(NAME, SIZE) \ +PP_COMPILE_ASSERT_SIZE_IN_BYTES_IMPL(NAME, NAME, SIZE) + +/* PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES is for typenames that contain 'struct' + in C. That is, struct names that are not typedefs. + E.g.: + struct Foo { int a; }; + PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(Foo, 4); + */ +#define PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(NAME, SIZE) \ +PP_COMPILE_ASSERT_SIZE_IN_BYTES_IMPL(NAME, struct NAME, SIZE) + +/* PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES is for typenames that contain 'enum' + in C. That is, enum names that are not typedefs. + E.g.: + enum Bar { A = 0, B = 1 }; + PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(Foo, 4); + */ +#define PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(NAME, SIZE) \ +PP_COMPILE_ASSERT_SIZE_IN_BYTES_IMPL(NAME, enum NAME, SIZE) + +/** + * @} + * End of addtogroup PP + */ + +/* pp_stdint.idl */ + +/** + * + * @addtogroup Typedefs + * @{ + */ +#if defined(_MSC_VER) + +/** This value represents a guaranteed unsigned 8 bit integer. */ +typedef unsigned char uint8_t; + +/** This value represents a guaranteed signed 8 bit integer. */ +typedef signed char int8_t; + +/** This value represents a guaranteed unsigned 16 bit short. */ +typedef unsigned short uint16_t; + +/** This value represents a guaranteed signed 16 bit short. */ +typedef short int16_t; + +/** This value represents a guaranteed unsigned 32 bit integer. */ +typedef unsigned int uint32_t; + +/** This value represents a guaranteed signed 32 bit integer. */ +typedef int int32_t; + +/** This value represents a guaranteed signed 64 bit integer. */ +typedef __int64 int64_t; + +/** This value represents a guaranteed unsigned 64 bit integer. */ +typedef unsigned __int64 uint64_t; + +#else +#include +#endif +/** + * @} + */ + +/* pp_array_output.idl */ +/** + * @addtogroup Typedefs + * @{ + */ +typedef void* (*PP_ArrayOutput_GetDataBuffer)(void* user_data, + uint32_t element_count, + uint32_t element_size); +/** + * @} + */ + +/** + * @addtogroup Structs + * @{ + */ +/** + * A structure that defines a way for the browser to return arrays of data + * to the plugin. The browser can not allocate memory on behalf of the plugin + * because the plugin and browser may have different allocators. + * + * Array output works by having the browser call to the plugin to allocate a + * buffer, and then the browser will copy the contents of the array into that + * buffer. + * + * In C, you would typically implement this as follows: + * + * @code + * struct MyArrayOutput { + * void* data; + * int element_count; + * }; + * void* MyGetDataBuffer(void* user_data, uint32_t count, uint32_t size) { + * MyArrayOutput* output = (MyArrayOutput*)user_data; + * output->element_count = count; + * if (size) { + * output->data = malloc(count * size); + * if (!output->data) // Be careful to set size properly on malloc failure. + * output->element_count = 0; + * } else { + * output->data = NULL; + * } + * return output->data; + * } + * void MyFunction() { + * MyArrayOutput array = { NULL, 0 }; + * PP_ArrayOutput output = { &MyGetDataBuffer, &array }; + * ppb_foo->GetData(&output); + * } + * @endcode + */ +struct PP_ArrayOutput { + /** + * A pointer to the allocation function that the browser will call. + */ + PP_ArrayOutput_GetDataBuffer GetDataBuffer; + /** + * Data that is passed to the allocation function. Typically, this is used + * to communicate how the data should be stored. + */ + void* user_data; +}; +/** + * @} + */ + +/* pp_bool.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * The PP_Bool enum is a boolean value for use in PPAPI C headers. + * The standard bool type is not available to pre-C99 compilers, and is not + * guaranteed to be compatible between C and C++, whereas the PPAPI C headers + * can be included from C or C++ code. + */ +typedef enum { + PP_FALSE = 0, + PP_TRUE = 1 +} PP_Bool; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Bool, 4); +/** + * @} + */ + +#ifdef __cplusplus +/** + * Converts a C++ "bool" type to a PP_Bool. + * + * @param[in] b A C++ "bool" type. + * + * @return A PP_Bool. + */ +inline PP_Bool PP_FromBool(bool b) { + return b ? PP_TRUE : PP_FALSE; +} + +/** + * Converts a PP_Bool to a C++ "bool" type. + * + * @param[in] b A PP_Bool. + * + * @return A C++ "bool" type. + */ +inline bool PP_ToBool(PP_Bool b) { + return (b != PP_FALSE); +} + +#endif /* __cplusplus */ + +/* pp_point.idl */ +/** + * @addtogroup Structs + * @{ + */ +/** + * The PP_Point structure defines the integer x and y coordinates of a point. + */ +struct PP_Point { + /** + * This value represents the horizontal coordinate of a point, starting with 0 + * as the left-most coordinate. + */ + int32_t x; + /** + * This value represents the vertical coordinate of a point, starting with 0 + * as the top-most coordinate. + */ + int32_t y; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_Point, 8); + +/** + * The PP_FloatPoint structure defines the floating-point x and y coordinates + * of a point. + */ +struct PP_FloatPoint { + float x; + float y; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_FloatPoint, 8); +/** + * @} + */ + +/** + * @addtogroup Functions + * @{ + */ + +/** + * PP_MakePoint() creates a PP_Point given the x and y coordinates + * as int32_t values. + * + * @param[in] x An int32_t value representing a horizontal coordinate of a + * point, starting with 0 as the left-most coordinate. + * @param[in] y An int32_t value representing a vertical coordinate of a point, + * starting with 0 as the top-most coordinate. + * + * @return A PP_Point structure. + */ +PP_INLINE struct PP_Point PP_MakePoint(int32_t x, int32_t y) { + struct PP_Point ret; + ret.x = x; + ret.y = y; + return ret; +} + +PP_INLINE struct PP_FloatPoint PP_MakeFloatPoint(float x, float y) { + struct PP_FloatPoint ret; + ret.x = x; + ret.y = y; + return ret; +} +/** + * @} + */ + +/* pp_size.idl */ +/** + * @addtogroup Structs + * @{ + */ +/** + * The PP_Size struct contains the size of a 2D rectangle. + */ +struct PP_Size { + /** This value represents the width of the rectangle. */ + int32_t width; + /** This value represents the height of the rectangle. */ + int32_t height; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_Size, 8); + +/** + * The PP_FloatSize struct contains the size of a 2D rectangle. + */ +struct PP_FloatSize { + /** This value represents the width of the rectangle. */ + float width; + /** This value represents the height of the rectangle. */ + float height; +}; +/** + * @} + */ + +/** + * @addtogroup Functions + * @{ + */ + +/** + * PP_MakeSize() creates a PP_Size given a width and height as + * int32_t values. + * + * @param[in] w An int32_t value representing a width. + * @param[in] h An int32_t value representing a height. + * + * @return A PP_Size structure. + */ +PP_INLINE struct PP_Size PP_MakeSize(int32_t w, int32_t h) { + struct PP_Size ret; + ret.width = w; + ret.height = h; + return ret; +} + +/** + * PP_MakeFloatSize() creates a PP_FloatSize given a + * width and height as float values. + * + * @param[in] w An float value representing a width. + * @param[in] h An float value representing a height. + * + * @return A PP_FloatSize structure. + */ +PP_INLINE struct PP_FloatSize PP_MakeFloatSize(float w, float h) { + struct PP_FloatSize ret; + ret.width = w; + ret.height = h; + return ret; +} +/** + * @} + */ +/* pp_rect.idl */ +/** + * @addtogroup Structs + * @{ + */ +/** + * The PP_Rect struct contains the size and location of a 2D + * rectangle. + */ +struct PP_Rect { + /** + * This value represents the x and y coordinates of the upper-left corner of + * the rectangle. + */ + struct PP_Point point; + /** This value represents the width and height of the rectangle. */ + struct PP_Size size; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_Rect, 16); + +/** + * The PP_FloatRect struct contains the size and location of a 2D + * rectangle. + */ +struct PP_FloatRect { + /** + * This value represents the x and y coordinates of the upper-left corner of + * the rectangle. + */ + struct PP_FloatPoint point; + /** This value represents the width and height of the rectangle. */ + struct PP_FloatSize size; +}; +/** + * @} + */ + + +/** + * @addtogroup Functions + * @{ + */ + +/** + * PP_MakeRectFromXYWH() creates a PP_Rect given x and y + * coordinates and width and height dimensions as int32_t values. + * + * @param[in] x An int32_t value representing a horizontal coordinate of a + * point, starting with 0 as the left-most coordinate. + * @param[in] y An int32_t value representing a vertical coordinate of a point, + * starting with 0 as the top-most coordinate. + * @param[in] w An int32_t value representing a width. + * @param[in] h An int32_t value representing a height. + * + * @return A PP_Rect structure. + */ +PP_INLINE struct PP_Rect PP_MakeRectFromXYWH(int32_t x, int32_t y, + int32_t w, int32_t h) { + struct PP_Rect ret; + ret.point.x = x; + ret.point.y = y; + ret.size.width = w; + ret.size.height = h; + return ret; +} + +/** + * PP_MakeFloatRectFromXYWH() creates a PP_FloatRect given x and y + * coordinates and width and height dimensions as float values. + * + * @param[in] x An float value representing a horizontal coordinate of a + * point, starting with 0 as the left-most coordinate. + * @param[in] y An float value representing a vertical coordinate of a point, + * starting with 0 as the top-most coordinate. + * @param[in] w An float value representing a width. + * @param[in] h An float value representing a height. + * + * @return A PP_FloatRect structure. + */ +PP_INLINE struct PP_FloatRect PP_MakeFloatRectFromXYWH(float x, float y, + float w, float h) { + struct PP_FloatRect ret; + ret.point.x = x; + ret.point.y = y; + ret.size.width = w; + ret.size.height = h; + return ret; +} + +/** + * @} + */ + +/* pp_codecs.idl */ +/** + * @addtogroup Enums + * @{ + */ +typedef enum { + PP_VIDEOPROFILE_H264BASELINE = 0, + PP_VIDEOPROFILE_H264MAIN = 1, + PP_VIDEOPROFILE_H264EXTENDED = 2, + PP_VIDEOPROFILE_H264HIGH = 3, + PP_VIDEOPROFILE_H264HIGH10PROFILE = 4, + PP_VIDEOPROFILE_H264HIGH422PROFILE = 5, + PP_VIDEOPROFILE_H264HIGH444PREDICTIVEPROFILE = 6, + PP_VIDEOPROFILE_H264SCALABLEBASELINE = 7, + PP_VIDEOPROFILE_H264SCALABLEHIGH = 8, + PP_VIDEOPROFILE_H264STEREOHIGH = 9, + PP_VIDEOPROFILE_H264MULTIVIEWHIGH = 10, + PP_VIDEOPROFILE_VP8_ANY = 11, + PP_VIDEOPROFILE_VP9_ANY = 12, + PP_VIDEOPROFILE_MAX = PP_VIDEOPROFILE_VP9_ANY +} PP_VideoProfile; + +/** + * Audio profiles. + */ +typedef enum { + PP_AUDIOPROFILE_OPUS = 0, + PP_AUDIOPROFILE_MAX = PP_AUDIOPROFILE_OPUS +} PP_AudioProfile; + +/** + * Hardware acceleration options. + */ +typedef enum { + /** Create a hardware accelerated resource only. */ + PP_HARDWAREACCELERATION_ONLY = 0, + /** + * Create a hardware accelerated resource if possible. Otherwise, fall back + * to the software implementation. + */ + PP_HARDWAREACCELERATION_WITHFALLBACK = 1, + /** Create the software implementation only. */ + PP_HARDWAREACCELERATION_NONE = 2, + PP_HARDWAREACCELERATION_LAST = PP_HARDWAREACCELERATION_NONE +} PP_HardwareAcceleration; +/** + * @} + */ + +/** + * @addtogroup Structs + * @{ + */ +/** + * Struct describing a decoded video picture. The decoded picture data is stored + * in the GL texture corresponding to |texture_id|. The plugin can determine + * which Decode call generated the picture using |decode_id|. + */ +struct PP_VideoPicture { + /** + * |decode_id| parameter of the Decode call which generated this picture. + * See the PPB_VideoDecoder function Decode() for more details. + */ + uint32_t decode_id; + /** + * Texture ID in the plugin's GL context. The plugin can use this to render + * the decoded picture. + */ + uint32_t texture_id; + /** + * The GL texture target for the decoded picture. Possible values are: + * GL_TEXTURE_2D + * GL_TEXTURE_RECTANGLE_ARB + * GL_TEXTURE_EXTERNAL_OES + * + * The pixel format of the texture is GL_RGBA. + */ + uint32_t texture_target; + /** + * Dimensions of the texture holding the decoded picture. + */ + struct PP_Size texture_size; + /** + * The visible subrectangle of the picture. The plugin should display only + * this part of the picture. + */ + struct PP_Rect visible_rect; +}; + +/** + * Struct describing a decoded video picture. The decoded picture data is stored + * in the GL texture corresponding to |texture_id|. The plugin can determine + * which Decode call generated the picture using |decode_id|. + */ +struct PP_VideoPicture_0_1 { + /** + * |decode_id| parameter of the Decode call which generated this picture. + * See the PPB_VideoDecoder function Decode() for more details. + */ + uint32_t decode_id; + /** + * Texture ID in the plugin's GL context. The plugin can use this to render + * the decoded picture. + */ + uint32_t texture_id; + /** + * The GL texture target for the decoded picture. Possible values are: + * GL_TEXTURE_2D + * GL_TEXTURE_RECTANGLE_ARB + * GL_TEXTURE_EXTERNAL_OES + * + * The pixel format of the texture is GL_RGBA. + */ + uint32_t texture_target; + /** + * Dimensions of the texture holding the decoded picture. + */ + struct PP_Size texture_size; +}; + +/** + * Supported video profile information. See the PPB_VideoEncoder function + * GetSupportedProfiles() for more details. + */ +struct PP_VideoProfileDescription { + /** + * The codec profile. + */ + PP_VideoProfile profile; + /** + * Dimensions of the maximum resolution of video frames, in pixels. + */ + struct PP_Size max_resolution; + /** + * The numerator of the maximum frame rate. + */ + uint32_t max_framerate_numerator; + /** + * The denominator of the maximum frame rate. + */ + uint32_t max_framerate_denominator; + /** + * Whether the profile is hardware accelerated. + */ + PP_Bool hardware_accelerated; +}; + +/** + * Supported video profile information. See the PPB_VideoEncoder function + * GetSupportedProfiles() for more details. + */ +struct PP_VideoProfileDescription_0_1 { + /** + * The codec profile. + */ + PP_VideoProfile profile; + /** + * Dimensions of the maximum resolution of video frames, in pixels. + */ + struct PP_Size max_resolution; + /** + * The numerator of the maximum frame rate. + */ + uint32_t max_framerate_numerator; + /** + * The denominator of the maximum frame rate. + */ + uint32_t max_framerate_denominator; + /** + * A value indicating if the profile is available in hardware, software, or + * both. + */ + PP_HardwareAcceleration acceleration; +}; + +/** + * Supported audio profile information. See the PPB_AudioEncoder function + * GetSupportedProfiles() for more details. + */ +struct PP_AudioProfileDescription { + /** + * The codec profile. + */ + PP_AudioProfile profile; + /** + * Maximum number of channels that can be encoded. + */ + uint32_t max_channels; + /** + * Sample size. + */ + uint32_t sample_size; + /** + * Sampling rate that can be encoded + */ + uint32_t sample_rate; + /** + * Whether the profile is hardware accelerated. + */ + PP_Bool hardware_accelerated; +}; + +/** + * Struct describing a bitstream buffer. + */ +struct PP_BitstreamBuffer { + /** + * The size, in bytes, of the bitstream data. + */ + uint32_t size; + /** + * The base address of the bitstream data. + */ + void* buffer; + /** + * Whether the buffer represents a key frame. + */ + PP_Bool key_frame; +}; + +/** + * Struct describing an audio bitstream buffer. + */ +struct PP_AudioBitstreamBuffer { + /** + * The size, in bytes, of the bitstream data. + */ + uint32_t size; + /** + * The base address of the bitstream data. + */ + void* buffer; +}; +/** + * @} + */ + +/* pp_completion_callback.idl */ +/** + * @addtogroup Typedefs + * @{ + */ +/** + * This typedef defines the signature that you implement to receive callbacks + * on asynchronous completion of an operation. + * + * @param[in] user_data A pointer to user data passed to a callback function. + * @param[in] result If result is 0 (PP_OK), the operation succeeded. Negative + * values (other than -1 or PP_OK_COMPLETE) indicate error and are specified + * in pp_errors.h. Positive values for result usually indicate success and have + * some operation-dependent meaning (such as bytes read). + */ +typedef void (*PP_CompletionCallback_Func)(void* user_data, int32_t result); +/** + * @} + */ + +/** + * @addtogroup Enums + * @{ + */ +/** + * This enumeration contains flags used to control how non-NULL callbacks are + * scheduled by asynchronous methods. + */ +typedef enum { + /** + * By default any non-NULL callback will always invoked asynchronously, + * on success or error, even if the operation could complete synchronously + * without blocking. + * + * The method taking such callback will always return PP_OK_COMPLETIONPENDING. + * The callback will be invoked on the same thread on which the method was + * invoked. + * + * NOTE: If the method taking the callback is invoked on a background + * thread that has no valid PPB_MessageLoop resource attached, the system has + * no way to run the callback on the correct thread. In this case, a log + * message will be emitted and the plugin will be made to crash. + */ + PP_COMPLETIONCALLBACK_FLAG_NONE = 0 << 0, + /** + * This flag allows any method taking such callback to complete synchronously + * and not call the callback if the operation would not block. This is useful + * when performance is an issue, and the operation bandwidth should not be + * limited to the processing speed of the message loop. + * + * On synchronous method completion, the completion result will be returned + * by the method itself. Otherwise, the method will return + * PP_OK_COMPLETIONPENDING, and the callback will be invoked asynchronously on + * the same thread on which the method was invoked. If there is no valid + * PPB_MessageLoop attached to that thread, and the callback would normally + * run asynchronously, the invoked method will return + * PP_ERROR_NO_MESSAGE_LOOP. + */ + PP_COMPLETIONCALLBACK_FLAG_OPTIONAL = 1 << 0 +} PP_CompletionCallback_Flag; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_CompletionCallback_Flag, 4); +/** + * @} + */ + +/** + * @addtogroup Structs + * @{ + */ +/** + * PP_CompletionCallback is a common mechanism for supporting + * potentially asynchronous calls in browser interfaces. Any method that takes a + * PP_CompletionCallback can be used in one of three different + * ways: + * - Required: The callback will always be invoked asynchronously on the + * thread where the associated PPB method was invoked. The method + * will always return PP_OK_COMPLETIONPENDING when a required + * callback, and the callback will be invoked later (barring + * system or thread shutdown; see PPB_MessageLoop for details). + * Required callbacks are the default. + *

+ * NOTE: If you use a required callback on a background thread, + * you must have created and attached a PPB_MessageLoop. + * Otherwise, the system can not run your callback on that thread, + * and will instead emit a log message and crash your plugin to + * make the problem more obvious. + * + * - Optional: The callback may be invoked asynchronously, or the PPB method + * may complete synchronously if it can do so without blocking. + * If the method will complete asynchronously, it will return + * PP_OK_COMPLETIONPENDING. Otherwise, it will complete + * synchronously and return an appropriate code (see below for + * more information on the return code). Optional callbacks are + * generally more difficult to use correctly than Required + * callbacks, but can provide better performance for some APIs + * (especially APIs with buffered reads, such as PPB_URLLoader or + * PPB_FileIO). + *

+ * NOTE: If you use an optional callback on a background thread, + * and you have not created and attached a PPB_MessageLoop, then + * the method you invoke will fail without running and return + * PP_ERROR_NO_MESSAGE_LOOP. + * + * - Blocking: In this case, the callback's function pointer is NULL, and the + * invoked method must complete synchronously. The method will + * run to completion and return an appropriate code when finished + * (see below for more information). Blocking completion + * callbacks are only supported on background threads. + *

+ * PP_BlockUntilComplete() provides a convenient way + * to specify blocking behavior. Refer to + * PP_BlockUntilComplete for more information. + * + * When the callback is run asynchronously, the result parameter passed to + * func is an int32_t that, if negative indicates an error code + * whose meaning is specific to the calling method (refer to + * pp_error.h for further information). A positive or 0 value is a + * return result indicating success whose meaning depends on the calling method + * (e.g. number of bytes read). + */ +struct PP_CompletionCallback { + /** + * This value is a callback function that will be called, or NULL if this is + * a blocking completion callback. + */ + PP_CompletionCallback_Func func; + /** + * This value is a pointer to user data passed to a callback function. + */ + void* user_data; + /** + * Flags used to control how non-NULL callbacks are scheduled by + * asynchronous methods. + */ + int32_t flags; +}; +/** + * @} + */ + +#include + +/** + * @addtogroup Functions + * @{ + */ +/** + * PP_MakeCompletionCallback() is used to create a + * PP_CompletionCallback. + * + * Example, creating a Required callback: + * + * @code + * struct PP_CompletionCallback cc = PP_MakeCompletionCallback(Foo, NULL); + * @endcode + * + * Example, creating an Optional callback: + * + * @code + * struct PP_CompletionCallback cc = PP_MakeCompletionCallback(Foo, NULL); + * cc.flags = cc.flags | PP_COMPLETIONCALLBACK_FLAG_OPTIONAL; + * @endcode + * + * @param[in] func A PP_CompletionCallback_Func that will be + * called. + * @param[in] user_data A pointer to user data passed to your callback + * function. This is optional and is typically used to help track state + * when you may have multiple callbacks pending. + * + * @return A PP_CompletionCallback structure. + */ +PP_INLINE struct PP_CompletionCallback PP_MakeCompletionCallback( + PP_CompletionCallback_Func func, + void* user_data) { + struct PP_CompletionCallback cc; + cc.func = func; + cc.user_data = user_data; + cc.flags = PP_COMPLETIONCALLBACK_FLAG_NONE; + return cc; +} + +/** + * PP_MakeOptionalCompletionCallback() is used to create a PP_CompletionCallback + * with PP_COMPLETIONCALLBACK_FLAG_OPTIONAL set. + * + * @param[in] func A PP_CompletionCallback_Func to be called on completion. + * @param[in] user_data A pointer to user data passed to be passed to the + * callback function. This is optional and is typically used to help track state + * in case of multiple pending callbacks. + * + * @return A PP_CompletionCallback structure. + */ +PP_INLINE struct PP_CompletionCallback PP_MakeOptionalCompletionCallback( + PP_CompletionCallback_Func func, + void* user_data) { + struct PP_CompletionCallback cc = PP_MakeCompletionCallback(func, user_data); + cc.flags = cc.flags | PP_COMPLETIONCALLBACK_FLAG_OPTIONAL; + return cc; +} +/** + * @} + */ + +/** + * @addtogroup Functions + * @{ + */ + +/** + * PP_RunCompletionCallback() is used to run a callback. It invokes + * the callback function passing it user data specified on creation and + * completion |result|. + * + * @param[in] cc A pointer to a PP_CompletionCallback that will be + * run. + * @param[in] result The result of the operation. Non-positive values correspond + * to the error codes from pp_errors.h (excluding PP_OK_COMPLETIONPENDING). + * Positive values indicate additional information such as bytes read. + */ +PP_INLINE void PP_RunCompletionCallback(struct PP_CompletionCallback* cc, + int32_t result) { + cc->func(cc->user_data, result); +} + +/** + * @} + */ + +/** + * @addtogroup Functions + * @{ + */ + + /** + * PP_BlockUntilComplete() is used in place of an actual completion callback + * to request blocking behavior. If specified, the calling thread will block + * until the function completes. Blocking completion callbacks are only allowed + * from background threads. + * + * @return A PP_CompletionCallback structure. + */ +PP_INLINE struct PP_CompletionCallback PP_BlockUntilComplete(void) { + return PP_MakeCompletionCallback(NULL, NULL); +} + +/** + * PP_RunAndClearCompletionCallback() runs a callback and clears the reference + * to that callback. + * + * This function is used when the null-ness of a completion callback is used as + * a signal for whether a completion callback has been registered. In this + * case, after the execution of the callback, it should be cleared. However, + * this introduces a conflict if the completion callback wants to schedule more + * work that involves the same completion callback again (for example, when + * reading data from an URLLoader, one would typically queue up another read + * callback). As a result, this function clears the pointer + * before the provided callback is executed. + */ +PP_INLINE void PP_RunAndClearCompletionCallback( + struct PP_CompletionCallback* cc, + int32_t res) { + struct PP_CompletionCallback temp = *cc; + *cc = PP_BlockUntilComplete(); + PP_RunCompletionCallback(&temp, res); +} +/** + * @} + */ + +/* pp_time.idl */ +/** + * @addtogroup Typedefs + * @{ + */ +/** + * The PP_Time type represents the "wall clock time" according + * to the browser and is defined as the number of seconds since the Epoch + * (00:00:00 UTC, January 1, 1970). + */ +typedef double PP_Time; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Time, 8); + +/** + * A PP_TimeTicks value represents time ticks which are measured + * in seconds and are used for indicating the time that certain messages were + * received. In contrast to PP_Time, PP_TimeTicks + * does not correspond to any actual wall clock time and will not change + * discontinuously if the user changes their computer clock. + * + * The units are in seconds, but are not measured relative to any particular + * epoch, so the most you can do is compare two values. + */ +typedef double PP_TimeTicks; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_TimeTicks, 8); + +/** + * A PP_TimeDelta value represents a duration of time which is + * measured in seconds. + */ +typedef double PP_TimeDelta; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_TimeDelta, 8); +/** + * @} + */ + +/* pp_file_info.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * The PP_FileType enum contains file type constants. + */ +typedef enum { + /** A regular file type */ + PP_FILETYPE_REGULAR = 0, + /** A directory */ + PP_FILETYPE_DIRECTORY = 1, + /** A catch-all for unidentified types */ + PP_FILETYPE_OTHER = 2 +} PP_FileType; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_FileType, 4); + +/** + * The PP_FileSystemType enum contains file system type constants. + */ +typedef enum { + /** For identified invalid return values */ + PP_FILESYSTEMTYPE_INVALID = 0, + /** For external file system types */ + PP_FILESYSTEMTYPE_EXTERNAL = 1, + /** For local persistent file system types */ + PP_FILESYSTEMTYPE_LOCALPERSISTENT = 2, + /** For local temporary file system types */ + PP_FILESYSTEMTYPE_LOCALTEMPORARY = 3, + /** For isolated file system types */ + PP_FILESYSTEMTYPE_ISOLATED = 4 +} PP_FileSystemType; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_FileSystemType, 4); +/** + * @} + */ + +/** + * @addtogroup Structs + * @{ + */ +/** + * The PP_FileInfo struct represents all information about a file, + * such as size, type, and creation time. + */ +struct PP_FileInfo { + /** This value represents the size of the file measured in bytes */ + int64_t size; + /** + * This value represents the type of file as defined by the + * PP_FileType enum + */ + PP_FileType type; + /** + * This value represents the file system type of the file as defined by the + * PP_FileSystemType enum. + */ + PP_FileSystemType system_type; + /** + * This value represents the creation time of the file. + */ + PP_Time creation_time; + /** + * This value represents the last time the file was accessed. + */ + PP_Time last_access_time; + /** + * This value represents the last time the file was modified. + */ + PP_Time last_modified_time; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_FileInfo, 40); +/** + * @} + */ + +/* pp_resource.idl */ +/** + * @addtogroup Typedefs + * @{ + */ +/** + * This typedef represents an opaque handle assigned by the browser to the + * resource. The handle is guaranteed never to be 0 for a valid resource, so a + * module can initialize it to 0 to indicate a "NULL handle." Some interfaces + * may return a NULL resource to indicate failure. + * + * While a Var represents something callable to JS or from the module to + * the DOM, a resource has no meaning or visibility outside of the module + * interface. + * + * Resources are reference counted. Use AddRefResource() + * and ReleaseResource() in ppb_core.h to manage the + * reference count of a resource. The data will be automatically destroyed when + * the internal reference count reaches 0. + */ +typedef int32_t PP_Resource; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Resource, 4); +/** + * @} + */ + +/* pp_directory_entry.idl */ +/** + * @addtogroup Structs + * @{ + */ +struct PP_DirectoryEntry { + PP_Resource file_ref; + PP_FileType file_type; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_DirectoryEntry, 8); +/** + * @} + */ + +/* pp_errors.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * This enumeration contains enumerators of all PPAPI error codes. + * + * Errors are negative valued. Callers should treat all negative values as a + * failure, even if it's not in the list, since the possible errors are likely + * to expand and change over time. + */ +enum { + /** + * This value is returned by a function on successful synchronous completion + * or is passed as a result to a PP_CompletionCallback_Func on successful + * asynchronous completion. + */ + PP_OK = 0, + /** + * This value is returned by a function that accepts a PP_CompletionCallback + * and cannot complete synchronously. This code indicates that the given + * callback will be asynchronously notified of the final result once it is + * available. + */ + PP_OK_COMPLETIONPENDING = -1, + /**This value indicates failure for unspecified reasons. */ + PP_ERROR_FAILED = -2, + /** + * This value indicates failure due to an asynchronous operation being + * interrupted. The most common cause of this error code is destroying a + * resource that still has a callback pending. All callbacks are guaranteed + * to execute, so any callbacks pending on a destroyed resource will be + * issued with PP_ERROR_ABORTED. + * + * If you get an aborted notification that you aren't expecting, check to + * make sure that the resource you're using is still in scope. A common + * mistake is to create a resource on the stack, which will destroy the + * resource as soon as the function returns. + */ + PP_ERROR_ABORTED = -3, + /** This value indicates failure due to an invalid argument. */ + PP_ERROR_BADARGUMENT = -4, + /** This value indicates failure due to an invalid PP_Resource. */ + PP_ERROR_BADRESOURCE = -5, + /** This value indicates failure due to an unavailable PPAPI interface. */ + PP_ERROR_NOINTERFACE = -6, + /** This value indicates failure due to insufficient privileges. */ + PP_ERROR_NOACCESS = -7, + /** This value indicates failure due to insufficient memory. */ + PP_ERROR_NOMEMORY = -8, + /** This value indicates failure due to insufficient storage space. */ + PP_ERROR_NOSPACE = -9, + /** This value indicates failure due to insufficient storage quota. */ + PP_ERROR_NOQUOTA = -10, + /** + * This value indicates failure due to an action already being in + * progress. + */ + PP_ERROR_INPROGRESS = -11, + /** + * The requested command is not supported by the browser. + */ + PP_ERROR_NOTSUPPORTED = -12, + /** + * Returned if you try to use a null completion callback to "block until + * complete" on the main thread. Blocking the main thread is not permitted + * to keep the browser responsive (otherwise, you may not be able to handle + * input events, and there are reentrancy and deadlock issues). + */ + PP_ERROR_BLOCKS_MAIN_THREAD = -13, + /** + * This value indicates that the plugin sent bad input data to a resource, + * leaving it in an invalid state. The resource can't be used after returning + * this error and should be released. + */ + PP_ERROR_MALFORMED_INPUT = -14, + /** + * This value indicates that a resource has failed. The resource can't be + * used after returning this error and should be released. + */ + PP_ERROR_RESOURCE_FAILED = -15, + /** This value indicates failure due to a file that does not exist. */ + PP_ERROR_FILENOTFOUND = -20, + /** This value indicates failure due to a file that already exists. */ + PP_ERROR_FILEEXISTS = -21, + /** This value indicates failure due to a file that is too big. */ + PP_ERROR_FILETOOBIG = -22, + /** + * This value indicates failure due to a file having been modified + * unexpectedly. + */ + PP_ERROR_FILECHANGED = -23, + /** This value indicates that the pathname does not reference a file. */ + PP_ERROR_NOTAFILE = -24, + /** This value indicates failure due to a time limit being exceeded. */ + PP_ERROR_TIMEDOUT = -30, + /** + * This value indicates that the user cancelled rather than providing + * expected input. + */ + PP_ERROR_USERCANCEL = -40, + /** + * This value indicates failure due to lack of a user gesture such as a + * mouse click or key input event. Examples of actions requiring a user + * gesture are showing the file chooser dialog and going into fullscreen + * mode. + */ + PP_ERROR_NO_USER_GESTURE = -41, + /** + * This value indicates that the graphics context was lost due to a + * power management event. + */ + PP_ERROR_CONTEXT_LOST = -50, + /** + * Indicates an attempt to make a PPAPI call on a thread without previously + * registering a message loop via PPB_MessageLoop.AttachToCurrentThread. + * Without this registration step, no PPAPI calls are supported. + */ + PP_ERROR_NO_MESSAGE_LOOP = -51, + /** + * Indicates that the requested operation is not permitted on the current + * thread. + */ + PP_ERROR_WRONG_THREAD = -52, + /** + * Indicates that a null completion callback was used on a thread handling a + * blocking message from JavaScript. Null completion callbacks "block until + * complete", which could cause the main JavaScript thread to be blocked + * excessively. + */ + PP_ERROR_WOULD_BLOCK_THREAD = -53, + /** + * This value indicates that the connection was closed. For TCP sockets, it + * corresponds to a TCP FIN. + */ + PP_ERROR_CONNECTION_CLOSED = -100, + /** + * This value indicates that the connection was reset. For TCP sockets, it + * corresponds to a TCP RST. + */ + PP_ERROR_CONNECTION_RESET = -101, + /** + * This value indicates that the connection attempt was refused. + */ + PP_ERROR_CONNECTION_REFUSED = -102, + /** + * This value indicates that the connection was aborted. For TCP sockets, it + * means the connection timed out as a result of not receiving an ACK for data + * sent. This can include a FIN packet that did not get ACK'd. + */ + PP_ERROR_CONNECTION_ABORTED = -103, + /** + * This value indicates that the connection attempt failed. + */ + PP_ERROR_CONNECTION_FAILED = -104, + /** + * This value indicates that the connection attempt timed out. + */ + PP_ERROR_CONNECTION_TIMEDOUT = -105, + /** + * This value indicates that the IP address or port number is invalid. + */ + PP_ERROR_ADDRESS_INVALID = -106, + /** + * This value indicates that the IP address is unreachable. This usually means + * that there is no route to the specified host or network. + */ + PP_ERROR_ADDRESS_UNREACHABLE = -107, + /** + * This value is returned when attempting to bind an address that is already + * in use. + */ + PP_ERROR_ADDRESS_IN_USE = -108, + /** + * This value indicates that the message was too large for the transport. + */ + PP_ERROR_MESSAGE_TOO_BIG = -109, + /** + * This value indicates that the host name could not be resolved. + */ + PP_ERROR_NAME_NOT_RESOLVED = -110 +}; +/** + * @} + */ + +/* pp_graphics_3d.idl */ +/** + * @addtogroup Enums + * @{ + */ +typedef enum { + /** + * Bits of Alpha in the color buffer. + */ + PP_GRAPHICS3DATTRIB_ALPHA_SIZE = 0x3021, + /** + * Bits of Blue in the color buffer. + */ + PP_GRAPHICS3DATTRIB_BLUE_SIZE = 0x3022, + /** + * Bits of Green in the color buffer. + */ + PP_GRAPHICS3DATTRIB_GREEN_SIZE = 0x3023, + /** + * Bits of Red in the color buffer. + */ + PP_GRAPHICS3DATTRIB_RED_SIZE = 0x3024, + /** + * Bits of Z in the depth buffer. + */ + PP_GRAPHICS3DATTRIB_DEPTH_SIZE = 0x3025, + /** + * Bits of Stencil in the stencil buffer. + */ + PP_GRAPHICS3DATTRIB_STENCIL_SIZE = 0x3026, + /** + * Number of samples per pixel. + */ + PP_GRAPHICS3DATTRIB_SAMPLES = 0x3031, + /** + * Number of multisample buffers. + */ + PP_GRAPHICS3DATTRIB_SAMPLE_BUFFERS = 0x3032, + /** + * Attrib list terminator. + */ + PP_GRAPHICS3DATTRIB_NONE = 0x3038, + /** + * Height of surface in pixels. + */ + PP_GRAPHICS3DATTRIB_HEIGHT = 0x3056, + /** + * Width of surface in pixels. + */ + PP_GRAPHICS3DATTRIB_WIDTH = 0x3057, + /** + * Specifies the effect on the color buffer of posting a surface + * with SwapBuffers. The initial value is chosen by the implementation. + */ + PP_GRAPHICS3DATTRIB_SWAP_BEHAVIOR = 0x3093, + /** + * Indicates that color buffer contents are unaffected. + */ + PP_GRAPHICS3DATTRIB_BUFFER_PRESERVED = 0x3094, + /** + * Indicates that color buffer contents may be destroyed or changed. + */ + PP_GRAPHICS3DATTRIB_BUFFER_DESTROYED = 0x3095, + /** + * Specifies whether the context is intended to be low-power or + * high-performance. The initial value is + * PP_GRAPHICS3DATTRIB_GPU_PREFERENCE_PERFORMANCE. + */ + PP_GRAPHICS3DATTRIB_GPU_PREFERENCE = 0x11000, + /** + * The context should be low-power, and may be created on an integrated gpu. + */ + PP_GRAPHICS3DATTRIB_GPU_PREFERENCE_LOW_POWER = 0x11001, + /** + * The context may be high-power and may be created on a discrete gpu. + */ + PP_GRAPHICS3DATTRIB_GPU_PREFERENCE_PERFORMANCE = 0x11002 +} PP_Graphics3DAttrib; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Graphics3DAttrib, 4); +/** + * @} + */ + +/* pp_var.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * The PP_VarType is an enumeration of the different types that + * can be contained within a PP_Var structure. + */ +typedef enum { + /** + * An undefined value. + */ + PP_VARTYPE_UNDEFINED = 0, + /** + * A NULL value. This is similar to undefined, but JavaScript differentiates + * the two so it is exposed here as well. + */ + PP_VARTYPE_NULL = 1, + /** + * A boolean value, use the as_bool member of the var. + */ + PP_VARTYPE_BOOL = 2, + /** + * A 32-bit integer value. Use the as_int member of the var. + */ + PP_VARTYPE_INT32 = 3, + /** + * A double-precision floating point value. Use the as_double + * member of the var. + */ + PP_VARTYPE_DOUBLE = 4, + /** + * The Var represents a string. The as_id field is used to + * identify the string, which may be created and retrieved from the + * PPB_Var interface. These objects are reference counted, so + * AddRef() and Release() must be used properly to avoid memory leaks. + */ + PP_VARTYPE_STRING = 5, + /** + * Represents a JavaScript object. This vartype is not currently usable + * from modules, although it is used internally for some tasks. These objects + * are reference counted, so AddRef() and Release() must be used properly to + * avoid memory leaks. + */ + PP_VARTYPE_OBJECT = 6, + /** + * Represents an array of Vars. The as_id field is used to + * identify the array, which may be created and manipulated from the + * PPB_VarArray interface. These objects are reference counted, + * so AddRef() and Release() must be used properly to avoid memory leaks. + */ + PP_VARTYPE_ARRAY = 7, + /** + * Represents a mapping from strings to Vars. The as_id field is + * used to identify the dictionary, which may be created and manipulated from + * the PPB_VarDictionary interface. These objects are reference + * counted, so AddRef() and Release() must be used properly to avoid memory + * leaks. + */ + PP_VARTYPE_DICTIONARY = 8, + /** + * ArrayBuffer represents a JavaScript ArrayBuffer. This is the type which + * represents Typed Arrays in JavaScript. Unlike JavaScript 'Array', it is + * only meant to contain basic numeric types, and is always stored + * contiguously. See PPB_VarArrayBuffer_Dev for functions special to + * ArrayBuffer vars. These objects are reference counted, so AddRef() and + * Release() must be used properly to avoid memory leaks. + */ + PP_VARTYPE_ARRAY_BUFFER = 9, + /** + * This type allows the PP_Var to wrap a PP_Resource + * . This can be useful for sending or receiving some types of + * PP_Resource using PPB_Messaging or + * PPP_Messaging. + * + * These objects are reference counted, so AddRef() and Release() must be used + * properly to avoid memory leaks. Under normal circumstances, the + * PP_Var will implicitly hold a reference count on the + * PP_Resource on your behalf. For example, if you call + * VarFromResource(), it implicitly calls PPB_Core::AddRefResource() on the + * PP_Resource. Likewise, PPB_Var::Release() on a Resource + * PP_Var will invoke PPB_Core::ReleaseResource() when the Var + * reference count goes to zero. + */ + PP_VARTYPE_RESOURCE = 10 +} PP_VarType; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_VarType, 4); +/** + * @} + */ + +/** + * @addtogroup Structs + * @{ + */ +/** + * The PP_VarValue union stores the data for any one of the types listed + * in the PP_VarType enum. + */ +union PP_VarValue { + /** + * If type is PP_VARTYPE_BOOL, + * as_bool represents the value of this PP_Var as + * PP_Bool. + */ + PP_Bool as_bool; + /** + * If type is PP_VARTYPE_INT32, + * as_int represents the value of this PP_Var as + * int32_t. + */ + int32_t as_int; + /** + * If type is PP_VARTYPE_DOUBLE, + * as_double represents the value of this PP_Var + * as double. + */ + double as_double; + /** + * If type is PP_VARTYPE_STRING, + * PP_VARTYPE_OBJECT, PP_VARTYPE_ARRAY, + * PP_VARTYPE_DICTIONARY, PP_VARTYPE_ARRAY_BUFFER, + * or PP_VARTYPE_RESOURCE, as_id represents the + * value of this PP_Var as an opaque handle assigned by the + * browser. This handle is guaranteed never to be 0, so a module can + * initialize this ID to 0 to indicate a "NULL handle." + */ + int64_t as_id; +}; + +/** + * The PP_VAR struct is a variant data type and can contain any + * value of one of the types named in the PP_VarType enum. This + * structure is for passing data between native code which can be strongly + * typed and the browser (JavaScript) which isn't strongly typed. + * + * JavaScript has a "number" type for holding a number, and does not + * differentiate between floating point and integer numbers. The + * JavaScript operations will try to optimize operations by using + * integers when possible, but could end up with doubles. Therefore, + * you can't assume a numeric PP_Var will be the type you expect. + * Your code should be capable of handling either int32_t or double for numeric + * PP_Vars sent from JavaScript. + */ +struct PP_Var { + PP_VarType type; + /** + * The padding ensures value is aligned on an + * 8-byte boundary relative to the start of the struct. Some compilers + * align doubles on 8-byte boundaries for 32-bit x86, and some align on + * 4-byte boundaries. + */ + int32_t padding; + /** + * This value represents the contents of the PP_Var. Only one of + * the fields of value is valid at a time based upon + * type. + */ + union PP_VarValue value; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_Var, 16); +/** + * @} + */ + +/** + * @addtogroup Functions + * @{ + */ + +/** + * PP_MakeUndefined() is used to wrap an undefined value into a + * PP_Var struct for passing to the browser. + * + * @return A PP_Var structure. + */ +PP_INLINE struct PP_Var PP_MakeUndefined(void) { + struct PP_Var result = { PP_VARTYPE_UNDEFINED, 0, {PP_FALSE} }; + return result; +} + +/** + * PP_MakeNull() is used to wrap a null value into a + * PP_Var struct for passing to the browser. + * + * @return A PP_Var structure, + */ +PP_INLINE struct PP_Var PP_MakeNull(void) { + struct PP_Var result = { PP_VARTYPE_NULL, 0, {PP_FALSE} }; + return result; +} + +/** + * PP_MakeBool() is used to wrap a boolean value into a + * PP_Var struct for passing to the browser. + * + * @param[in] value A PP_Bool enumeration to + * wrap. + * + * @return A PP_Var structure. + */ +PP_INLINE struct PP_Var PP_MakeBool(PP_Bool value) { + struct PP_Var result = { PP_VARTYPE_BOOL, 0, {PP_FALSE} }; + result.value.as_bool = value; + return result; +} + +/** + * PP_MakeInt32() is used to wrap a 32 bit integer value + * into a PP_Var struct for passing to the browser. + * + * @param[in] value An int32 to wrap. + * + * @return A PP_Var structure. + */ +PP_INLINE struct PP_Var PP_MakeInt32(int32_t value) { + struct PP_Var result = { PP_VARTYPE_INT32, 0, {PP_FALSE} }; + result.value.as_int = value; + return result; +} + +/** + * PP_MakeDouble() is used to wrap a double value into a + * PP_Var struct for passing to the browser. + * + * @param[in] value A double to wrap. + * + * @return A PP_Var structure. + */ +PP_INLINE struct PP_Var PP_MakeDouble(double value) { + struct PP_Var result = { PP_VARTYPE_DOUBLE, 0, {PP_FALSE} }; + result.value.as_double = value; + return result; +} +/** + * @} + */ + +/* pp_touch_point.idl */ +/** + * @addtogroup Structs + * @{ + */ +/** + * The PP_TouchPoint struct represents all information about a + * single touch point, such as position, id, rotation angle, and pressure. + */ +struct PP_TouchPoint { + /** + * This value represents the identifier for this TouchPoint. The id + * corresponds to the order in which the points were pressed. For example, + * the first point to be pressed has an id of 0, the second has an id of 1, + * and so on. An id can be reused when a touch point is released. For + * example, if two fingers are down, with id 0 and 1, and finger 0 releases, + * the next finger to be pressed can be assigned to id 0. + */ + uint32_t id; + /** + * This value represents the x and y pixel position of this TouchPoint + * relative to the upper-left of the module instance receiving the event. + */ + struct PP_FloatPoint position; + /** + * This value represents the elliptical radii, in screen pixels, in the x + * and y direction of this TouchPoint. + */ + struct PP_FloatPoint radius; + /** + * This value represents the angle of rotation in degrees of the elliptical + * model of this TouchPoint clockwise from "up." + */ + float rotation_angle; + /** + * This value represents the pressure applied to this TouchPoint. This value + * is typically between 0 and 1, with 0 indicating no pressure and 1 + * indicating some maximum pressure. Scaling differs depending on the + * hardware and the value is not guaranteed to stay within that range. + */ + float pressure; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_TouchPoint, 28); +/** + * @} + */ + +/** + * @addtogroup Functions + * @{ + */ + +/** + * PP_MakeTouchPoint() creates a PP_TouchPoint. + * + * @return A PP_TouchPoint structure. + */ +PP_INLINE struct PP_TouchPoint PP_MakeTouchPoint(void) { + struct PP_TouchPoint result = { 0, {0, 0}, {0, 0}, 0, 0 }; + return result; +} +/** + * @} + */ + +/* pp_instance.idl */ +/** + * @addtogroup Typedefs + * @{ + */ +/** + * The PP_Instance value uniquely identifies one instance of a + * module (.nexe/PP_Module). There will be one module instance for every + * \ tag on a page. + * + * This identifier is an opaque handle assigned by the browser to the module. + * It is guaranteed never to be 0, so a module can initialize it to 0 to + * indicate a "NULL handle." + */ +typedef int32_t PP_Instance; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Instance, 4); +/** + * @} + */ + +/* ppb_input_event.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * This enumeration contains the types of input events. + */ +typedef enum { + PP_INPUTEVENT_TYPE_UNDEFINED = -1, + /** + * Notification that a mouse button was pressed. + * + * Register for this event using the PP_INPUTEVENT_CLASS_MOUSE class. + */ + PP_INPUTEVENT_TYPE_MOUSEDOWN = 0, + /** + * Notification that a mouse button was released. + * + * Register for this event using the PP_INPUTEVENT_CLASS_MOUSE class. + */ + PP_INPUTEVENT_TYPE_MOUSEUP = 1, + /** + * Notification that a mouse button was moved when it is over the instance + * or dragged out of it. + * + * Register for this event using the PP_INPUTEVENT_CLASS_MOUSE class. + */ + PP_INPUTEVENT_TYPE_MOUSEMOVE = 2, + /** + * Notification that the mouse entered the instance's bounds. + * + * Register for this event using the PP_INPUTEVENT_CLASS_MOUSE class. + */ + PP_INPUTEVENT_TYPE_MOUSEENTER = 3, + /** + * Notification that a mouse left the instance's bounds. + * + * Register for this event using the PP_INPUTEVENT_CLASS_MOUSE class. + */ + PP_INPUTEVENT_TYPE_MOUSELEAVE = 4, + /** + * Notification that the scroll wheel was used. + * + * Register for this event using the PP_INPUTEVENT_CLASS_WHEEL class. + */ + PP_INPUTEVENT_TYPE_WHEEL = 5, + /** + * Notification that a key transitioned from "up" to "down". + * + * Register for this event using the PP_INPUTEVENT_CLASS_KEYBOARD class. + */ + PP_INPUTEVENT_TYPE_RAWKEYDOWN = 6, + /** + * Notification that a key was pressed. This does not necessarily correspond + * to a character depending on the key and language. Use the + * PP_INPUTEVENT_TYPE_CHAR for character input. + * + * Register for this event using the PP_INPUTEVENT_CLASS_KEYBOARD class. + */ + PP_INPUTEVENT_TYPE_KEYDOWN = 7, + /** + * Notification that a key was released. + * + * Register for this event using the PP_INPUTEVENT_CLASS_KEYBOARD class. + */ + PP_INPUTEVENT_TYPE_KEYUP = 8, + /** + * Notification that a character was typed. Use this for text input. Key + * down events may generate 0, 1, or more than one character event depending + * on the key, locale, and operating system. + * + * Register for this event using the PP_INPUTEVENT_CLASS_KEYBOARD class. + */ + PP_INPUTEVENT_TYPE_CHAR = 9, + /** + * Notification that a context menu should be shown. + * + * This message will be sent when the user right-clicks or performs another + * OS-specific mouse command that should open a context menu. When this event + * is delivered depends on the system, on some systems (Mac) it will + * delivered after the mouse down event, and on others (Windows) it will be + * delivered after the mouse up event. + * + * You will always get the normal mouse events. For example, you may see + * MOUSEDOWN,CONTEXTMENU,MOUSEUP or MOUSEDOWN,MOUSEUP,CONTEXTMENU. + * + * The return value from the event handler determines if the context menu + * event will be passed to the page when you are using filtered input events + * (via RequestFilteringInputEvents()). In non-filtering mode the event will + * never be propagated and no context menu will be displayed. If you are + * handling mouse events in filtering mode, you may want to return true from + * this event even if you do not support a context menu to suppress the + * default one. + * + * Register for this event using the PP_INPUTEVENT_CLASS_MOUSE class. + */ + PP_INPUTEVENT_TYPE_CONTEXTMENU = 10, + /** + * Notification that an input method composition process has just started. + * + * Register for this event using the PP_INPUTEVENT_CLASS_IME class. + */ + PP_INPUTEVENT_TYPE_IME_COMPOSITION_START = 11, + /** + * Notification that the input method composition string is updated. + * + * Register for this event using the PP_INPUTEVENT_CLASS_IME class. + */ + PP_INPUTEVENT_TYPE_IME_COMPOSITION_UPDATE = 12, + /** + * Notification that an input method composition process has completed. + * + * Register for this event using the PP_INPUTEVENT_CLASS_IME class. + */ + PP_INPUTEVENT_TYPE_IME_COMPOSITION_END = 13, + /** + * Notification that an input method committed a string. + * + * Register for this event using the PP_INPUTEVENT_CLASS_IME class. + */ + PP_INPUTEVENT_TYPE_IME_TEXT = 14, + /** + * Notification that a finger was placed on a touch-enabled device. + * + * Register for this event using the PP_INPUTEVENT_CLASS_TOUCH class. + */ + PP_INPUTEVENT_TYPE_TOUCHSTART = 15, + /** + * Notification that a finger was moved on a touch-enabled device. + * + * Register for this event using the PP_INPUTEVENT_CLASS_TOUCH class. + */ + PP_INPUTEVENT_TYPE_TOUCHMOVE = 16, + /** + * Notification that a finger was released on a touch-enabled device. + * + * Register for this event using the PP_INPUTEVENT_CLASS_TOUCH class. + */ + PP_INPUTEVENT_TYPE_TOUCHEND = 17, + /** + * Notification that a touch event was canceled. + * + * Register for this event using the PP_INPUTEVENT_CLASS_TOUCH class. + */ + PP_INPUTEVENT_TYPE_TOUCHCANCEL = 18 +} PP_InputEvent_Type; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_InputEvent_Type, 4); + +/** + * This enumeration contains event modifier constants. Each modifier is one + * bit. Retrieve the modifiers from an input event using the GetEventModifiers + * function on PPB_InputEvent. + */ +typedef enum { + PP_INPUTEVENT_MODIFIER_SHIFTKEY = 1 << 0, + PP_INPUTEVENT_MODIFIER_CONTROLKEY = 1 << 1, + PP_INPUTEVENT_MODIFIER_ALTKEY = 1 << 2, + PP_INPUTEVENT_MODIFIER_METAKEY = 1 << 3, + PP_INPUTEVENT_MODIFIER_ISKEYPAD = 1 << 4, + PP_INPUTEVENT_MODIFIER_ISAUTOREPEAT = 1 << 5, + PP_INPUTEVENT_MODIFIER_LEFTBUTTONDOWN = 1 << 6, + PP_INPUTEVENT_MODIFIER_MIDDLEBUTTONDOWN = 1 << 7, + PP_INPUTEVENT_MODIFIER_RIGHTBUTTONDOWN = 1 << 8, + PP_INPUTEVENT_MODIFIER_CAPSLOCKKEY = 1 << 9, + PP_INPUTEVENT_MODIFIER_NUMLOCKKEY = 1 << 10, + PP_INPUTEVENT_MODIFIER_ISLEFT = 1 << 11, + PP_INPUTEVENT_MODIFIER_ISRIGHT = 1 << 12, + PP_INPUTEVENT_MODIFIER_ISPEN = 1 << 13, + PP_INPUTEVENT_MODIFIER_ISERASER = 1 << 14 +} PP_InputEvent_Modifier; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_InputEvent_Modifier, 4); + +/** + * This enumeration contains constants representing each mouse button. To get + * the mouse button for a mouse down or up event, use GetMouseButton on + * PPB_InputEvent. + */ +typedef enum { + PP_INPUTEVENT_MOUSEBUTTON_NONE = -1, + PP_INPUTEVENT_MOUSEBUTTON_LEFT = 0, + PP_INPUTEVENT_MOUSEBUTTON_MIDDLE = 1, + PP_INPUTEVENT_MOUSEBUTTON_RIGHT = 2 +} PP_InputEvent_MouseButton; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_InputEvent_MouseButton, 4); + +typedef enum { + /** + * Request mouse input events. + * + * Normally you will request mouse events by calling RequestInputEvents(). + * The only use case for filtered events (via RequestFilteringInputEvents()) + * is for instances that have irregular outlines and you want to perform hit + * testing, which is very uncommon. Requesting non-filtered mouse events will + * lead to higher performance. + */ + PP_INPUTEVENT_CLASS_MOUSE = 1 << 0, + /** + * Requests keyboard events. Often you will want to request filtered mode + * (via RequestFilteringInputEvents) for keyboard events so you can pass on + * events (by returning false) that you don't handle. For example, if you + * don't request filtered mode and the user pressed "Page Down" when your + * instance has focus, the page won't scroll which will be a poor experience. + * + * A small number of tab and window management commands like Alt-F4 are never + * sent to the page. You can not request these keyboard commands since it + * would allow pages to trap users on a page. + */ + PP_INPUTEVENT_CLASS_KEYBOARD = 1 << 1, + /** + * Identifies scroll wheel input event. Wheel events must be requested in + * filtering mode via RequestFilteringInputEvents(). This is because many + * wheel commands should be forwarded to the page. + * + * Most instances will not need this event. Consuming wheel events by + * returning true from your filtered event handler will prevent the user from + * scrolling the page when the mouse is over the instance which can be very + * annoying. + * + * If you handle wheel events (for example, you have a document viewer which + * the user can scroll), the recommended behavior is to return false only if + * the wheel event actually causes your document to scroll. When the user + * reaches the end of the document, return false to indicating that the event + * was not handled. This will then forward the event to the containing page + * for scrolling, producing the nested scrolling behavior users expect from + * frames in a page. + */ + PP_INPUTEVENT_CLASS_WHEEL = 1 << 2, + /** + * Identifies touch input events. + * + * Request touch events only if you intend to handle them. If the browser + * knows you do not need to handle touch events, it can handle them at a + * higher level and achieve higher performance. If the plugin does not + * register for touch-events, then it will receive synthetic mouse events that + * are generated from the touch events (e.g. mouse-down for touch-start, + * mouse-move for touch-move (with left-button down), and mouse-up for + * touch-end. If the plugin does register for touch events, then the synthetic + * mouse events are not created. + */ + PP_INPUTEVENT_CLASS_TOUCH = 1 << 3, + /** + * Identifies IME composition input events. + * + * Request this input event class if you allow on-the-spot IME input. + */ + PP_INPUTEVENT_CLASS_IME = 1 << 4 +} PP_InputEvent_Class; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_InputEvent_Class, 4); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_InputEvent interface contains pointers to several + * functions related to generic input events on the browser. + */ +struct PPB_InputEvent_1_0 { + /** + * RequestInputEvent() requests that input events corresponding to the given + * input events are delivered to the instance. + * + * It's recommended that you use RequestFilteringInputEvents() for keyboard + * events instead of this function so that you don't interfere with normal + * browser accelerators. + * + * By default, no input events are delivered. Call this function with the + * classes of events you are interested in to have them be delivered to + * the instance. Calling this function will override any previous setting for + * each specified class of input events (for example, if you previously + * called RequestFilteringInputEvents(), this function will set those events + * to non-filtering mode). + * + * Input events may have high overhead, so you should only request input + * events that your plugin will actually handle. For example, the browser may + * do optimizations for scroll or touch events that can be processed + * substantially faster if it knows there are no non-default receivers for + * that message. Requesting that such messages be delivered, even if they are + * processed very quickly, may have a noticeable effect on the performance of + * the page. + * + * Note that synthetic mouse events will be generated from touch events if + * (and only if) you do not request touch events. + * + * When requesting input events through this function, the events will be + * delivered and not bubbled to the default handlers. + * + * Example: + * @code + * RequestInputEvents(instance, PP_INPUTEVENT_CLASS_MOUSE); + * RequestFilteringInputEvents(instance, + * PP_INPUTEVENT_CLASS_WHEEL | PP_INPUTEVENT_CLASS_KEYBOARD); + * @endcode + * + * @param instance The PP_Instance of the instance requesting + * the given events. + * + * @param event_classes A combination of flags from + * PP_InputEvent_Class that identifies the classes of events the + * instance is requesting. The flags are combined by logically ORing their + * values. + * + * @return PP_OK if the operation succeeded, + * PP_ERROR_BADARGUMENT if instance is invalid, or + * PP_ERROR_NOTSUPPORTED if one of the event class bits were + * illegal. In the case of an invalid bit, all valid bits will be applied + * and only the illegal bits will be ignored. The most common cause of a + * PP_ERROR_NOTSUPPORTED return value is requesting keyboard + * events, these must use RequestFilteringInputEvents(). + */ + int32_t (*RequestInputEvents)(PP_Instance instance, uint32_t event_classes); + /** + * RequestFilteringInputEvents() requests that input events corresponding to + * the given input events are delivered to the instance for filtering. + * + * By default, no input events are delivered. In most cases you would + * register to receive events by calling RequestInputEvents(). In some cases, + * however, you may wish to filter events such that they can be bubbled up + * to the default handlers. In this case, register for those classes of + * events using this function instead of RequestInputEvents(). + * + * Filtering input events requires significantly more overhead than just + * delivering them to the instance. As such, you should only request + * filtering in those cases where it's absolutely necessary. The reason is + * that it requires the browser to stop and block for the instance to handle + * the input event, rather than sending the input event asynchronously. This + * can have significant overhead. + * + * Example: + * @code + * RequestInputEvents(instance, PP_INPUTEVENT_CLASS_MOUSE); + * RequestFilteringInputEvents(instance, + * PP_INPUTEVENT_CLASS_WHEEL | PP_INPUTEVENT_CLASS_KEYBOARD); + * @endcode + * + * @return PP_OK if the operation succeeded, + * PP_ERROR_BADARGUMENT if instance is invalid, or + * PP_ERROR_NOTSUPPORTED if one of the event class bits were + * illegal. In the case of an invalid bit, all valid bits will be applied + * and only the illegal bits will be ignored. + */ + int32_t (*RequestFilteringInputEvents)(PP_Instance instance, + uint32_t event_classes); + /** + * ClearInputEventRequest() requests that input events corresponding to the + * given input classes no longer be delivered to the instance. + * + * By default, no input events are delivered. If you have previously + * requested input events via RequestInputEvents() or + * RequestFilteringInputEvents(), this function will unregister handling + * for the given instance. This will allow greater browser performance for + * those events. + * + * Note that you may still get some input events after clearing the flag if + * they were dispatched before the request was cleared. For example, if + * there are 3 mouse move events waiting to be delivered, and you clear the + * mouse event class during the processing of the first one, you'll still + * receive the next two. You just won't get more events generated. + * + * @param instance The PP_Instance of the instance requesting + * to no longer receive the given events. + * + * @param event_classes A combination of flags from + * PP_InputEvent_Class that identify the classes of events the + * instance is no longer interested in. + */ + void (*ClearInputEventRequest)(PP_Instance instance, uint32_t event_classes); + /** + * IsInputEvent() returns true if the given resource is a valid input event + * resource. + * + * @param[in] resource A PP_Resource corresponding to a generic + * resource. + * + * @return PP_TRUE if the given resource is a valid input event + * resource. + */ + PP_Bool (*IsInputEvent)(PP_Resource resource); + /** + * GetType() returns the type of input event for the given input event + * resource. + * + * @param[in] resource A PP_Resource corresponding to an input + * event. + * + * @return A PP_InputEvent_Type if its a valid input event or + * PP_INPUTEVENT_TYPE_UNDEFINED if the resource is invalid. + */ + PP_InputEvent_Type (*GetType)(PP_Resource event); + /** + * GetTimeStamp() Returns the time that the event was generated. This will be + * before the current time since processing and dispatching the event has + * some overhead. Use this value to compare the times the user generated two + * events without being sensitive to variable processing time. + * + * @param[in] resource A PP_Resource corresponding to the event. + * + * @return The return value is in time ticks, which is a monotonically + * increasing clock not related to the wall clock time. It will not change + * if the user changes their clock or daylight savings time starts, so can + * be reliably used to compare events. This means, however, that you can't + * correlate event times to a particular time of day on the system clock. + */ + PP_TimeTicks (*GetTimeStamp)(PP_Resource event); + /** + * GetModifiers() returns a bitfield indicating which modifiers were down + * at the time of the event. This is a combination of the flags in the + * PP_InputEvent_Modifier enum. + * + * @param[in] resource A PP_Resource corresponding to an input + * event. + * + * @return The modifiers associated with the event, or 0 if the given + * resource is not a valid event resource. + */ + uint32_t (*GetModifiers)(PP_Resource event); +}; + +typedef struct PPB_InputEvent_1_0 PPB_InputEvent; + +/** + * The PPB_MouseInputEvent interface contains pointers to several + * functions related to mouse input events. + */ +struct PPB_MouseInputEvent_1_1 { + /** + * Create() creates a mouse input event with the given parameters. Normally + * you will get a mouse event passed through the + * HandleInputEvent and will not need to create them, but some + * applications may want to create their own for internal use. The type must + * be one of the mouse event types. + * + * @param[in] instance The instance for which this event occurred. + * + * @param[in] type A PP_InputEvent_Type identifying the type of + * input event. + * + * @param[in] time_stamp A PP_TimeTicks indicating the time + * when the event occurred. + * + * @param[in] modifiers A bit field combination of the + * PP_InputEvent_Modifier flags. + * + * @param[in] mouse_button The button that changed for mouse down or up + * events. This value will be PP_EVENT_MOUSEBUTTON_NONE for + * mouse move, enter, and leave events. + * + * @param[in] mouse_position A Point containing the x and y + * position of the mouse when the event occurred. + * + * @param[in] mouse_movement The change in position of the mouse. + * + * @return A PP_Resource containing the new mouse input event. + */ + PP_Resource (*Create)(PP_Instance instance, + PP_InputEvent_Type type, + PP_TimeTicks time_stamp, + uint32_t modifiers, + PP_InputEvent_MouseButton mouse_button, + const struct PP_Point* mouse_position, + int32_t click_count, + const struct PP_Point* mouse_movement); + /** + * IsMouseInputEvent() determines if a resource is a mouse event. + * + * @param[in] resource A PP_Resource corresponding to an event. + * + * @return PP_TRUE if the given resource is a valid mouse input + * event, otherwise PP_FALSE. + */ + PP_Bool (*IsMouseInputEvent)(PP_Resource resource); + /** + * GetButton() returns the mouse button that generated a mouse down or up + * event. + * + * @param[in] mouse_event A PP_Resource corresponding to a + * mouse event. + * + * @return The mouse button associated with mouse down and up events. This + * value will be PP_EVENT_MOUSEBUTTON_NONE for mouse move, + * enter, and leave events, and for all non-mouse events. + */ + PP_InputEvent_MouseButton (*GetButton)(PP_Resource mouse_event); + /** + * GetPosition() returns the pixel location of a mouse input event. When + * the mouse is locked, it returns the last known mouse position just as + * mouse lock was entered. + * + * @param[in] mouse_event A PP_Resource corresponding to a + * mouse event. + * + * @return The point associated with the mouse event, relative to the upper- + * left of the instance receiving the event. These values can be negative for + * mouse drags. The return value will be (0, 0) for non-mouse events. + */ + struct PP_Point (*GetPosition)(PP_Resource mouse_event); + int32_t (*GetClickCount)(PP_Resource mouse_event); + /** + * Returns the change in position of the mouse. When the mouse is locked, + * although the mouse position doesn't actually change, this function + * still provides movement information, which indicates what the change in + * position would be had the mouse not been locked. + * + * @param[in] mouse_event A PP_Resource corresponding to a + * mouse event. + * + * @return The change in position of the mouse, relative to the previous + * position. + */ + struct PP_Point (*GetMovement)(PP_Resource mouse_event); +}; + +typedef struct PPB_MouseInputEvent_1_1 PPB_MouseInputEvent; + +struct PPB_MouseInputEvent_1_0 { + PP_Resource (*Create)(PP_Instance instance, + PP_InputEvent_Type type, + PP_TimeTicks time_stamp, + uint32_t modifiers, + PP_InputEvent_MouseButton mouse_button, + const struct PP_Point* mouse_position, + int32_t click_count); + PP_Bool (*IsMouseInputEvent)(PP_Resource resource); + PP_InputEvent_MouseButton (*GetButton)(PP_Resource mouse_event); + struct PP_Point (*GetPosition)(PP_Resource mouse_event); + int32_t (*GetClickCount)(PP_Resource mouse_event); +}; + +/** + * The PPB_WheelIputEvent interface contains pointers to several + * functions related to wheel input events. + */ +struct PPB_WheelInputEvent_1_0 { + /** + * Create() creates a wheel input event with the given parameters. Normally + * you will get a wheel event passed through the + * HandleInputEvent and will not need to create them, but some + * applications may want to create their own for internal use. + * + * @param[in] instance The instance for which this event occurred. + * + * @param[in] time_stamp A PP_TimeTicks indicating the time + * when the event occurred. + * + * @param[in] modifiers A bit field combination of the + * PP_InputEvent_Modifier flags. + * + * @param[in] wheel_delta The scroll wheel's horizontal and vertical scroll + * amounts. + * + * @param[in] wheel_ticks The number of "clicks" of the scroll wheel that + * have produced the event. + * + * @param[in] scroll_by_page When true, the user is requesting to scroll + * by pages. When false, the user is requesting to scroll by lines. + * + * @return A PP_Resource containing the new wheel input event. + */ + PP_Resource (*Create)(PP_Instance instance, + PP_TimeTicks time_stamp, + uint32_t modifiers, + const struct PP_FloatPoint* wheel_delta, + const struct PP_FloatPoint* wheel_ticks, + PP_Bool scroll_by_page); + /** + * IsWheelInputEvent() determines if a resource is a wheel event. + * + * @param[in] wheel_event A PP_Resource corresponding to an + * event. + * + * @return PP_TRUE if the given resource is a valid wheel input + * event. + */ + PP_Bool (*IsWheelInputEvent)(PP_Resource resource); + /** + * GetDelta() returns the amount vertically and horizontally the user has + * requested to scroll by with their mouse wheel. A scroll down or to the + * right (where the content moves up or left) is represented as positive + * values, and a scroll up or to the left (where the content moves down or + * right) is represented as negative values. + * + * This amount is system dependent and will take into account the user's + * preferred scroll sensitivity and potentially also nonlinear acceleration + * based on the speed of the scrolling. + * + * Devices will be of varying resolution. Some mice with large detents will + * only generate integer scroll amounts. But fractional values are also + * possible, for example, on some trackpads and newer mice that don't have + * "clicks". + * + * @param[in] wheel_event A PP_Resource corresponding to a wheel + * event. + * + * @return The vertical and horizontal scroll values. The units are either in + * pixels (when scroll_by_page is false) or pages (when scroll_by_page is + * true). For example, y = -3 means scroll up 3 pixels when scroll_by_page + * is false, and scroll up 3 pages when scroll_by_page is true. + */ + struct PP_FloatPoint (*GetDelta)(PP_Resource wheel_event); + /** + * GetTicks() returns the number of "clicks" of the scroll wheel + * that have produced the event. The value may have system-specific + * acceleration applied to it, depending on the device. The positive and + * negative meanings are the same as for GetDelta(). + * + * If you are scrolling, you probably want to use the delta values. These + * tick events can be useful if you aren't doing actual scrolling and don't + * want or pixel values. An example may be cycling between different items in + * a game. + * + * @param[in] wheel_event A PP_Resource corresponding to a wheel + * event. + * + * @return The number of "clicks" of the scroll wheel. You may receive + * fractional values for the wheel ticks if the mouse wheel is high + * resolution or doesn't have "clicks". If your program wants discrete + * events (as in the "picking items" example) you should accumulate + * fractional click values from multiple messages until the total value + * reaches positive or negative one. This should represent a similar amount + * of scrolling as for a mouse that has a discrete mouse wheel. + */ + struct PP_FloatPoint (*GetTicks)(PP_Resource wheel_event); + /** + * GetScrollByPage() indicates if the scroll delta x/y indicates pages or + * lines to scroll by. + * + * @param[in] wheel_event A PP_Resource corresponding to a wheel + * event. + * + * @return PP_TRUE if the event is a wheel event and the user is + * scrolling by pages. PP_FALSE if not or if the resource is not + * a wheel event. + */ + PP_Bool (*GetScrollByPage)(PP_Resource wheel_event); +}; + +typedef struct PPB_WheelInputEvent_1_0 PPB_WheelInputEvent; + +/** + * The PPB_KeyboardInputEvent interface contains pointers to + * several functions related to keyboard input events. + */ +struct PPB_KeyboardInputEvent_1_2 { + /** + * Creates a keyboard input event with the given parameters. Normally you + * will get a keyboard event passed through the HandleInputEvent and will not + * need to create them, but some applications may want to create their own + * for internal use. The type must be one of the keyboard event types. + * + * @param[in] instance The instance for which this event occurred. + * + * @param[in] type A PP_InputEvent_Type identifying the type of + * input event. + * + * @param[in] time_stamp A PP_TimeTicks indicating the time + * when the event occurred. + * + * @param[in] modifiers A bit field combination of the + * PP_InputEvent_Modifier flags. + * + * @param[in] key_code This value reflects the DOM KeyboardEvent + * keyCode field, which is the Windows-style Virtual Key + * code of the key. + * + * @param[in] character_text This value represents the typed character as a + * UTF-8 string. + * + * @param[in] code This value represents the DOM3 |code| string that + * corresponds to the physical key being pressed. + * + * @return A PP_Resource containing the new keyboard input + * event. + */ + PP_Resource (*Create)(PP_Instance instance, + PP_InputEvent_Type type, + PP_TimeTicks time_stamp, + uint32_t modifiers, + uint32_t key_code, + struct PP_Var character_text, + struct PP_Var code); + /** + * IsKeyboardInputEvent() determines if a resource is a keyboard event. + * + * @param[in] resource A PP_Resource corresponding to an event. + * + * @return PP_TRUE if the given resource is a valid input event. + */ + PP_Bool (*IsKeyboardInputEvent)(PP_Resource resource); + /** + * GetKeyCode() returns the DOM keyCode field for the keyboard event. + * Chrome populates this with the Windows-style Virtual Key code of the key. + * + * @param[in] key_event A PP_Resource corresponding to a + * keyboard event. + * + * @return The DOM keyCode field for the keyboard event. + */ + uint32_t (*GetKeyCode)(PP_Resource key_event); + /** + * GetCharacterText() returns the typed character as a UTF-8 string for the + * given character event. + * + * @param[in] character_event A PP_Resource corresponding to a + * keyboard event. + * + * @return A string var representing a single typed character for character + * input events. For non-character input events the return value will be an + * undefined var. + */ + struct PP_Var (*GetCharacterText)(PP_Resource character_event); + /** + * GetCode() returns the DOM |code| field for this keyboard event, as + * defined in the DOM3 Events spec: + * http://www.w3.org/TR/DOM-Level-3-Events/ + * + * @param[in] key_event The key event for which to return the key code. + * + * @return The string that contains the DOM |code| for the keyboard event. + */ + struct PP_Var (*GetCode)(PP_Resource key_event); +}; + +typedef struct PPB_KeyboardInputEvent_1_2 PPB_KeyboardInputEvent; + +struct PPB_KeyboardInputEvent_1_0 { + PP_Resource (*Create)(PP_Instance instance, + PP_InputEvent_Type type, + PP_TimeTicks time_stamp, + uint32_t modifiers, + uint32_t key_code, + struct PP_Var character_text); + PP_Bool (*IsKeyboardInputEvent)(PP_Resource resource); + uint32_t (*GetKeyCode)(PP_Resource key_event); + struct PP_Var (*GetCharacterText)(PP_Resource character_event); +}; +/** + * @} + */ + +/** + * @addtogroup Enums + * @{ + */ +typedef enum { + /** + * The list of all TouchPoints which are currently down. + */ + PP_TOUCHLIST_TYPE_TOUCHES = 0, + /** + * The list of all TouchPoints whose state has changed since the last + * TouchInputEvent. + */ + PP_TOUCHLIST_TYPE_CHANGEDTOUCHES = 1, + /** + * The list of all TouchPoints which are targeting this plugin. This is a + * subset of Touches. + */ + PP_TOUCHLIST_TYPE_TARGETTOUCHES = 2 +} PP_TouchListType; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_TouchListType, 4); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_TouchInputEvent interface contains pointers to several + * functions related to touch events. + */ +struct PPB_TouchInputEvent_1_0 { + /** + * Creates a touch input event with the given parameters. Normally you + * will get a touch event passed through the HandleInputEvent and will not + * need to create them, but some applications may want to create their own + * for internal use. The type must be one of the touch event types. + * This newly created touch input event does not have any touch point in any + * of the touch-point lists. AddTouchPoint should be called to + * add the touch-points. + * + * @param[in] instance The instance for which this event occurred. + * + * @param[in] type A PP_InputEvent_Type identifying the type of + * input event. + * + * @param[in] time_stamp A PP_TimeTicks indicating the time + * when the event occurred. + * + * @param[in] modifiers A bit field combination of the + * PP_InputEvent_Modifier flags. + * + * @return A PP_Resource containing the new touch input event. + */ + PP_Resource (*Create)(PP_Instance instance, + PP_InputEvent_Type type, + PP_TimeTicks time_stamp, + uint32_t modifiers); + /** + * Adds a touch point to the touch event in the specified touch-list. + * + * @param[in] touch_event A PP_Resource corresponding to a touch + * event. + * + * @param[in] list The list to add the touch point to. + * + * @param[in] point The point to add to the list. + */ + void (*AddTouchPoint)(PP_Resource touch_event, + PP_TouchListType list, + const struct PP_TouchPoint* point); + /** + * IsTouchInputEvent() determines if a resource is a touch event. + * + * @param[in] resource A PP_Resource corresponding to an event. + * + * @return PP_TRUE if the given resource is a valid touch input + * event, otherwise PP_FALSE. + */ + PP_Bool (*IsTouchInputEvent)(PP_Resource resource); + /** + * Returns the number of touch-points in the specified list. + * + * @param[in] resource A PP_Resource corresponding to a touch + * event. + * + * @param[in] list The list. + * + * @return The number of touch-points in the specified list. + */ + uint32_t (*GetTouchCount)(PP_Resource resource, PP_TouchListType list); + /** + * Returns the touch-point at the specified index from the specified list. + * + * @param[in] resource A PP_Resource corresponding to a touch + * event. + * + * @param[in] list The list. + * + * @param[in] index The index. + * + * @return A PP_TouchPoint representing the touch-point. + */ + struct PP_TouchPoint (*GetTouchByIndex)(PP_Resource resource, + PP_TouchListType list, + uint32_t index); + /** + * Returns the touch-point with the specified touch-id in the specified list. + * + * @param[in] resource A PP_Resource corresponding to a touch + * event. + * + * @param[in] list The list. + * + * @param[in] touch_id The id of the touch-point. + * + * @return A PP_TouchPoint representing the touch-point. + */ + struct PP_TouchPoint (*GetTouchById)(PP_Resource resource, + PP_TouchListType list, + uint32_t touch_id); +}; + +typedef struct PPB_TouchInputEvent_1_0 PPB_TouchInputEvent; + +struct PPB_IMEInputEvent_1_0 { + /** + * Create() creates an IME input event with the given parameters. Normally + * you will get an IME event passed through the HandleInputEvent + * and will not need to create them, but some applications may want to create + * their own for internal use. + * + * @param[in] instance The instance for which this event occurred. + * + * @param[in] type A PP_InputEvent_Type identifying the type of + * input event. The type must be one of the IME event types. + * + * @param[in] time_stamp A PP_TimeTicks indicating the time + * when the event occurred. + * + * @param[in] text The string returned by GetText. + * + * @param[in] segment_number The number returned by + * GetSegmentNumber. + * + * @param[in] segment_offsets The array of numbers returned by + * GetSegmentOffset. If segment_number is zero, + * the number of elements of the array should be zero. If + * segment_number is non-zero, the length of the array must be + * segment_number + 1. + * + * @param[in] target_segment The number returned by + * GetTargetSegment. + * + * @param[in] selection_start The start index returned by + * GetSelection. + * + * @param[in] selection_end The end index returned by + * GetSelection. + * + * @return A PP_Resource containing the new IME input event. + */ + PP_Resource (*Create)(PP_Instance instance, + PP_InputEvent_Type type, + PP_TimeTicks time_stamp, + struct PP_Var text, + uint32_t segment_number, + const uint32_t segment_offsets[], + int32_t target_segment, + uint32_t selection_start, + uint32_t selection_end); + /** + * IsIMEInputEvent() determines if a resource is an IME event. + * + * @param[in] resource A PP_Resource corresponding to an event. + * + * @return PP_TRUE if the given resource is a valid input event. + */ + PP_Bool (*IsIMEInputEvent)(PP_Resource resource); + /** + * GetText() returns the composition text as a UTF-8 string for the given IME + * event. + * + * @param[in] ime_event A PP_Resource corresponding to an IME + * event. + * + * @return A string var representing the composition text. For non-IME input + * events the return value will be an undefined var. + */ + struct PP_Var (*GetText)(PP_Resource ime_event); + /** + * GetSegmentNumber() returns the number of segments in the composition text. + * + * @param[in] ime_event A PP_Resource corresponding to an IME + * event. + * + * @return The number of segments. For events other than COMPOSITION_UPDATE, + * returns 0. + */ + uint32_t (*GetSegmentNumber)(PP_Resource ime_event); + /** + * GetSegmentOffset() returns the position of the index-th segmentation point + * in the composition text. The position is given by a byte-offset (not a + * character-offset) of the string returned by GetText(). It always satisfies + * 0=GetSegmentOffset(0) < ... < GetSegmentOffset(i) < GetSegmentOffset(i+1) + * < ... < GetSegmentOffset(GetSegmentNumber())=(byte-length of GetText()). + * Note that [GetSegmentOffset(i), GetSegmentOffset(i+1)) represents the range + * of the i-th segment, and hence GetSegmentNumber() can be a valid argument + * to this function instead of an off-by-1 error. + * + * @param[in] ime_event A PP_Resource corresponding to an IME + * event. + * + * @param[in] index An integer indicating a segment. + * + * @return The byte-offset of the segmentation point. If the event is not + * COMPOSITION_UPDATE or index is out of range, returns 0. + */ + uint32_t (*GetSegmentOffset)(PP_Resource ime_event, uint32_t index); + /** + * GetTargetSegment() returns the index of the current target segment of + * composition. + * + * @param[in] ime_event A PP_Resource corresponding to an IME + * event. + * + * @return An integer indicating the index of the target segment. When there + * is no active target segment, or the event is not COMPOSITION_UPDATE, + * returns -1. + */ + int32_t (*GetTargetSegment)(PP_Resource ime_event); + /** + * GetSelection() returns the range selected by caret in the composition text. + * + * @param[in] ime_event A PP_Resource corresponding to an IME + * event. + * + * @param[out] start The start position of the current selection. + * + * @param[out] end The end position of the current selection. + */ + void (*GetSelection)(PP_Resource ime_event, uint32_t* start, uint32_t* end); +}; + +typedef struct PPB_IMEInputEvent_1_0 PPB_IMEInputEvent; +/** + * @} + */ + +/* pp_input_event.idl */ +/** + * @addtogroup Structs + * @{ + */ +/** + * The PP_InputEvent_Key struct represents a key up or key down + * event. + * + * Key up and key down events correspond to physical keys on the keyboard. The + * actual character that the user typed (if any) will be delivered in a + * "character" event. + * + * If the user loses focus on the module while a key is down, a key up + * event might not occur. For example, if the module has focus and the user + * presses and holds the shift key, the module will see a "shift down" message. + * Then if the user clicks elsewhere on the web page, the module's focus will + * be lost and no more input events will be delivered. + * + * If your module depends on receiving key up events, it should also handle + * "lost focus" as the equivalent of "all keys up." + */ +struct PP_InputEvent_Key { + /** This value is a bit field combination of the EVENT_MODIFIER flags. */ + uint32_t modifier; + /** + * This value reflects the DOM KeyboardEvent keyCode field. + * Chrome populates this with the Windows-style Virtual Key code of the key. + */ + uint32_t key_code; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_InputEvent_Key, 8); + +/** + * The PP_InputEvent_Character struct represents a typed character + * event. + * + * Normally, the program will receive a key down event, followed by a character + * event, followed by a key up event. The character event will have any + * modifier keys applied. Obvious examples are symbols, where Shift-5 gives you + * a '%'. The key down and up events will give you the scan code for the "5" + * key, and the character event will give you the '%' character. + * + * You may not get a character event for all key down events if the key doesn't + * generate a character. Likewise, you may actually get multiple character + * events in a row. For example, some locales have an accent key that modifies + * the next character typed. You might get this stream of events: accent down, + * accent up (it didn't generate a character), letter key down, letter with + * accent character event (it was modified by the previous accent key), letter + * key up. If the letter can't be combined with the accent, like an umlaut and + * an 'R', the system might send umlaut down, umlaut up, 'R' key down, umlaut + * character (can't combine it with 'R', so just send the raw umlaut so it + * isn't lost"), 'R' character event, 'R' key up. + */ +struct PP_InputEvent_Character { + /** A combination of the PP_InputEvent_Modifier flags. */ + uint32_t modifier; + /** + * This value represents the typed character as a single null-terminated UTF-8 + * character. Any unused bytes will be filled with null bytes. Since the + * maximum UTF-8 character is 4 bytes, there will always be at least one null + * at the end so you can treat this as a null-terminated UTF-8 string. + */ + int8_t text[5]; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_InputEvent_Character, 12); + +/** + * The PP_InputEvent_Mouse struct represents all mouse events + * except mouse wheel events. + */ +struct PP_InputEvent_Mouse { + /** + * This value is a bit field combination of the + * PP_InputEvent_Modifier flags. + */ + uint32_t modifier; + /** + * This value represents the button that changed for mouse down or up events. + * This value will be PP_EVENT_MOUSEBUTTON_NONE for mouse move, + * enter, and leave events. + */ + PP_InputEvent_MouseButton button; + /** + * This values represents the x coordinate of the mouse when the event + * occurred. + * + * In most, but not all, cases these coordinates will just be integers. + * For example, the plugin element might be arbitrarily scaled or transformed + * in the DOM, and translating a mouse event into the coordinate space of the + * plugin will give non-integer values. + */ + float x; + /** + * This values represents the y coordinate of the mouse when the event + * occurred. + * + * In most, but not all, cases these coordinates will just be integers. + * For example, the plugin element might be arbitrarily scaled or transformed + * in the DOM, and translating a mouse event into the coordinate space of the + * plugin will give non-integer values. + */ + float y; + int32_t click_count; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_InputEvent_Mouse, 20); + +/** + * The PP_InputEvent_Wheel struct represents all mouse wheel + * events. + */ +struct PP_InputEvent_Wheel { + /** + * This value represents a combination of the EVENT_MODIFIER + * flags. + */ + uint32_t modifier; + /** + * The mouse wheel's horizontal scroll amount. A scroll to the right + * (where the content moves left) is represented as positive values, + * and a scroll to the left (where the content moves right) is + * represented as negative values. + * + * The units are either in pixels (when scroll_by_page is false) or pages + * (when scroll_by_page is true). For example, delta_y = -3 means scroll up 3 + * pixels when scroll_by_page is false, and scroll up 3 pages when + * scroll_by_page is true. + * + * This amount is system dependent and will take into account the user's + * preferred scroll sensitivity and potentially also nonlinear acceleration + * based on the speed of the scrolling. + * + * Devices will be of varying resolution. Some mice with large detents will + * only generate integer scroll amounts. But fractional values are also + * possible, for example, on some trackpads and newer mice that don't have + * "clicks". + */ + float delta_x; + /** + * The mouse wheel's vertical scroll amount. A scroll down (where the + * content moves up) is represented as positive values, and a scroll up + * (where the content moves down) is represented as negative values. + * + * The units are either in pixels (when scroll_by_page is false) or pages + * (when scroll_by_page is true). For example, delta_y = -3 means scroll up 3 + * pixels when scroll_by_page is false, and scroll up 3 pages when + * scroll_by_page is true. + * + * This amount is system dependent and will take into account the user's + * preferred scroll sensitivity and potentially also nonlinear acceleration + * based on the speed of the scrolling. + * + * Devices will be of varying resolution. Some mice with large detents will + * only generate integer scroll amounts. But fractional values are also + * possible, for example, on some trackpads and newer mice that don't have + * "clicks". + */ + float delta_y; + /** + * The number of "clicks" of the scroll wheel that have produced the + * event. The value may have system-specific acceleration applied to it, + * depending on the device. The positive and negative meanings are the same + * as for delta_x and delta_y. + * + * If you are scrolling, you probably want to use the delta values above. + * These tick events can be useful if you aren't doing actual scrolling and + * don't want or pixel values. An example may be cycling between different + * items in a game. + * + * You may receive fractional values for the wheel ticks if the mouse wheel + * is high resolution or doesn't have "clicks". If your program wants + * discrete events (as in the "picking items" example) you should accumulate + * fractional click values from multiple messages until the total value + * reaches positive or negative one. This should represent a similar amount + * of scrolling as for a mouse that has a discrete mouse wheel. + */ + float wheel_ticks_x; + /** This value represents */ + float wheel_ticks_y; + /** + * Indicates if the scroll delta_x/delta_y + * indicates pages or lines to scroll by. When true, the user is requesting + * to scroll by pages. + */ + PP_Bool scroll_by_page; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_InputEvent_Wheel, 24); +/** + * @} + */ + +/* pp_module.idl */ +/** + * @addtogroup Typedefs + * @{ + */ +/** + * The PP_Module value uniquely identifies the module or .nexe. + * + * This identifier is an opaque handle assigned by the browser to the module. It + * is guaranteed never to be 0, so a module can initialize it to 0 to + * indicate a "NULL handle." + */ +typedef int32_t PP_Module; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Module, 4); +/** + * @} + */ + +/* ppb.idl */ +/** + * @addtogroup Typedefs + * @{ + */ +/** + * This function pointer type defines the signature for the + * PPB_GetInterface function. A generic + * PPB_GetInterface pointer is passed to + * PPP_InitializedModule when your module is loaded. You can use + * this pointer to request a pointer to a specific browser interface. Browser + * interface names are ASCII strings and are generally defined in the header + * file for the interface, such as PPB_AUDIO_INTERFACE found in + * ppb.audio.h or + * PPB_GRAPHICS_2D_INTERFACE in ppb_graphics_2d.h. + * Click + *
here for a complete list of interface + * names. + * + * This value will be NULL if the interface is not supported on the browser. + */ +typedef const void* (*PPB_GetInterface)(const char* interface_name); +/** + * @} + */ + +/* ppb_audio.idl */ +/** + * @addtogroup Typedefs + * @{ + */ +/** + * PPB_Audio_Callback defines the type of an audio callback + * function used to fill the audio buffer with data. Please see the + * Create() function in the PPB_Audio interface for + * more details on this callback. + * + * @param[in] sample_buffer A buffer to fill with audio data. + * @param[in] buffer_size_in_bytes The size of the buffer in bytes. + * @param[in] latency How long before the audio data is to be presented. + * @param[inout] user_data An opaque pointer that was passed into + * PPB_Audio.Create(). + */ +typedef void (*PPB_Audio_Callback)(void* sample_buffer, + uint32_t buffer_size_in_bytes, + PP_TimeDelta latency, + void* user_data); + +typedef void (*PPB_Audio_Callback_1_0)(void* sample_buffer, + uint32_t buffer_size_in_bytes, + void* user_data); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_Audio interface contains pointers to several functions + * for handling audio resources. Refer to the + * Audio + * chapter in the Developer's Guide for information on using this interface. + * Please see descriptions for each PPB_Audio and + * PPB_AudioConfig function for more details. A C example using + * PPB_Audio and PPB_AudioConfig follows. + * + * Example: + * + * @code + * void audio_callback(void* sample_buffer, + * uint32_t buffer_size_in_bytes, + * void* user_data) { + * ... quickly fill in the buffer with samples and return to caller ... + * } + * + * ...Assume the application has cached the audio configuration interface in + * audio_config_interface and the audio interface in + * audio_interface... + * + * uint32_t count = audio_config_interface->RecommendSampleFrameCount( + * PP_AUDIOSAMPLERATE_44100, 4096); + * PP_Resource pp_audio_config = audio_config_interface->CreateStereo16Bit( + * pp_instance, PP_AUDIOSAMPLERATE_44100, count); + * PP_Resource pp_audio = audio_interface->Create(pp_instance, pp_audio_config, + * audio_callback, NULL); + * audio_interface->StartPlayback(pp_audio); + * + * ...audio_callback() will now be periodically invoked on a separate thread... + * @endcode + */ +struct PPB_Audio_1_1 { + /** + * Create() creates an audio resource. No sound will be heard until + * StartPlayback() is called. The callback is called with the buffer address + * and given user data whenever the buffer needs to be filled. From within the + * callback, you should not call PPB_Audio functions. The + * callback will be called on a different thread than the one which created + * the interface. For performance-critical applications (i.e. low-latency + * audio), the callback should avoid blocking or calling functions that can + * obtain locks, such as malloc. The layout and the size of the buffer passed + * to the audio callback will be determined by the device configuration and is + * specified in the AudioConfig documentation. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * @param[in] config A PP_Resource corresponding to an audio + * config resource. + * @param[in] audio_callback A PPB_Audio_Callback callback + * function that the browser calls when it needs more samples to play. + * @param[in] user_data A pointer to user data used in the callback function. + * + * @return A PP_Resource containing the audio resource if + * successful or 0 if the configuration cannot be honored or the callback is + * null. + */ + PP_Resource (*Create)(PP_Instance instance, + PP_Resource config, + PPB_Audio_Callback audio_callback, + void* user_data); + /** + * IsAudio() determines if the provided resource is an audio resource. + * + * @param[in] resource A PP_Resource corresponding to a generic + * resource. + * + * @return A PP_Bool containing containing PP_TRUE + * if the given resource is an Audio resource, otherwise + * PP_FALSE. + */ + PP_Bool (*IsAudio)(PP_Resource resource); + /** + * GetCurrrentConfig() returns an audio config resource for the given audio + * resource. + * + * @param[in] config A PP_Resource corresponding to an audio + * resource. + * + * @return A PP_Resource containing the audio config resource if + * successful. + */ + PP_Resource (*GetCurrentConfig)(PP_Resource audio); + /** + * StartPlayback() starts the playback of the audio resource and begins + * periodically calling the callback. + * + * @param[in] config A PP_Resource corresponding to an audio + * resource. + * + * @return A PP_Bool containing PP_TRUE if + * successful, otherwise PP_FALSE. Also returns + * PP_TRUE (and be a no-op) if called while playback is already + * in progress. + */ + PP_Bool (*StartPlayback)(PP_Resource audio); + /** + * StopPlayback() stops the playback of the audio resource. + * + * @param[in] config A PP_Resource corresponding to an audio + * resource. + * + * @return A PP_Bool containing PP_TRUE if + * successful, otherwise PP_FALSE. Also returns + * PP_TRUE (and is a no-op) if called while playback is already + * stopped. If a callback is in progress, StopPlayback() will block until the + * callback completes. + */ + PP_Bool (*StopPlayback)(PP_Resource audio); +}; + +typedef struct PPB_Audio_1_1 PPB_Audio; + +struct PPB_Audio_1_0 { + PP_Resource (*Create)(PP_Instance instance, + PP_Resource config, + PPB_Audio_Callback_1_0 audio_callback, + void* user_data); + PP_Bool (*IsAudio)(PP_Resource resource); + PP_Resource (*GetCurrentConfig)(PP_Resource audio); + PP_Bool (*StartPlayback)(PP_Resource audio); + PP_Bool (*StopPlayback)(PP_Resource audio); +}; +/** + * @} + */ + +/* ppb_audio_buffer.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * PP_AudioBuffer_SampleRate is an enumeration of the different audio sample + * rates. + */ +typedef enum { + PP_AUDIOBUFFER_SAMPLERATE_UNKNOWN = 0, + PP_AUDIOBUFFER_SAMPLERATE_8000 = 8000, + PP_AUDIOBUFFER_SAMPLERATE_16000 = 16000, + PP_AUDIOBUFFER_SAMPLERATE_22050 = 22050, + PP_AUDIOBUFFER_SAMPLERATE_32000 = 32000, + PP_AUDIOBUFFER_SAMPLERATE_44100 = 44100, + PP_AUDIOBUFFER_SAMPLERATE_48000 = 48000, + PP_AUDIOBUFFER_SAMPLERATE_96000 = 96000, + PP_AUDIOBUFFER_SAMPLERATE_192000 = 192000 +} PP_AudioBuffer_SampleRate; + +/** + * PP_AudioBuffer_SampleSize is an enumeration of the different audio sample + * sizes. + */ +typedef enum { + PP_AUDIOBUFFER_SAMPLESIZE_UNKNOWN = 0, + PP_AUDIOBUFFER_SAMPLESIZE_16_BITS = 2 +} PP_AudioBuffer_SampleSize; +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_AudioBuffer_0_1 { + /** + * Determines if a resource is an AudioBuffer resource. + * + * @param[in] resource The PP_Resource to test. + * + * @return A PP_Bool with PP_TRUE if the given + * resource is an AudioBuffer resource or PP_FALSE otherwise. + */ + PP_Bool (*IsAudioBuffer)(PP_Resource resource); + /** + * Gets the timestamp of the audio buffer. + * + * @param[in] buffer A PP_Resource corresponding to an audio + * buffer resource. + * + * @return A PP_TimeDelta containing the timestamp of the audio + * buffer. Given in seconds since the start of the containing audio stream. + */ + PP_TimeDelta (*GetTimestamp)(PP_Resource buffer); + /** + * Sets the timestamp of the audio buffer. + * + * @param[in] buffer A PP_Resource corresponding to an audio + * buffer resource. + * @param[in] timestamp A PP_TimeDelta containing the timestamp + * of the audio buffer. Given in seconds since the start of the containing + * audio stream. + */ + void (*SetTimestamp)(PP_Resource buffer, PP_TimeDelta timestamp); + /** + * Gets the sample rate of the audio buffer. + * + * @param[in] buffer A PP_Resource corresponding to an audio + * buffer resource. + * + * @return The sample rate of the audio buffer. + */ + PP_AudioBuffer_SampleRate (*GetSampleRate)(PP_Resource buffer); + /** + * Gets the sample size of the audio buffer. + * + * @param[in] buffer A PP_Resource corresponding to an audio + * buffer resource. + * + * @return The sample size of the audio buffer. + */ + PP_AudioBuffer_SampleSize (*GetSampleSize)(PP_Resource buffer); + /** + * Gets the number of channels in the audio buffer. + * + * @param[in] buffer A PP_Resource corresponding to an audio + * buffer resource. + * + * @return The number of channels in the audio buffer. + */ + uint32_t (*GetNumberOfChannels)(PP_Resource buffer); + /** + * Gets the number of samples in the audio buffer. + * + * @param[in] buffer A PP_Resource corresponding to an audio + * buffer resource. + * + * @return The number of samples in the audio buffer. + * For example, at a sampling rate of 44,100 Hz in stereo audio, a buffer + * containing 4410 * 2 samples would have a duration of 100 milliseconds. + */ + uint32_t (*GetNumberOfSamples)(PP_Resource buffer); + /** + * Gets the data buffer containing the audio samples. + * + * @param[in] buffer A PP_Resource corresponding to an audio + * buffer resource. + * + * @return A pointer to the beginning of the data buffer. + */ + void* (*GetDataBuffer)(PP_Resource buffer); + /** + * Gets the size of the data buffer in bytes. + * + * @param[in] buffer A PP_Resource corresponding to an audio + * buffer resource. + * + * @return The size of the data buffer in bytes. + */ + uint32_t (*GetDataBufferSize)(PP_Resource buffer); +}; + +typedef struct PPB_AudioBuffer_0_1 PPB_AudioBuffer; +/** + * @} + */ + +/* ppb_audio_config.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * This enumeration contains audio frame count constants. + * PP_AUDIOMINSAMPLEFRAMECOUNT is the minimum possible frame + * count. PP_AUDIOMAXSAMPLEFRAMECOUNT is the maximum possible + * frame count. + */ +enum { + PP_AUDIOMINSAMPLEFRAMECOUNT = 64, + PP_AUDIOMAXSAMPLEFRAMECOUNT = 32768 +}; + +/** + * PP_AudioSampleRate is an enumeration of the different audio sampling rates. + * PP_AUDIOSAMPLERATE_44100 is the sample rate used on CDs and + * PP_AUDIOSAMPLERATE_48000 is the sample rate used on DVDs and + * Digital Audio Tapes. + */ +typedef enum { + PP_AUDIOSAMPLERATE_NONE = 0, + PP_AUDIOSAMPLERATE_44100 = 44100, + PP_AUDIOSAMPLERATE_48000 = 48000 +} PP_AudioSampleRate; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_AudioSampleRate, 4); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_AudioConfig interface contains pointers to several + * functions for establishing your audio configuration within the browser. + * This interface only supports 16-bit stereo output. + * + * Refer to the + * Audio + * chapter in the Developer's Guide for information on using this + * interface. + */ +struct PPB_AudioConfig_1_1 { + /** + * CreateStereo16bit() creates a 16 bit audio configuration resource. The + * sample_rate should be the result of calling + * RecommendSampleRate and sample_frame_count should + * be the result of calling RecommendSampleFrameCount. If the + * sample frame count or bit rate isn't supported, this function will fail and + * return a null resource. + * + * A single sample frame on a stereo device means one value for the left + * channel and one value for the right channel. + * + * Buffer layout for a stereo int16 configuration: + * int16_t *buffer16; + * buffer16[0] is the first left channel sample. + * buffer16[1] is the first right channel sample. + * buffer16[2] is the second left channel sample. + * buffer16[3] is the second right channel sample. + * ... + * buffer16[2 * (sample_frame_count - 1)] is the last left + * channel sample. + * buffer16[2 * (sample_frame_count - 1) + 1] is the last + * right channel sample. + * Data will always be in the native endian format of the platform. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * @param[in] sample_rate A PP_AudioSampleRate which is either + * PP_AUDIOSAMPLERATE_44100 or + * PP_AUDIOSAMPLERATE_48000. + * @param[in] sample_frame_count A uint32_t frame count returned + * from the RecommendSampleFrameCount function. + * + * @return A PP_Resource containing the + * PPB_Audio_Config if successful or a null resource if the + * sample frame count or bit rate are not supported. + */ + PP_Resource (*CreateStereo16Bit)(PP_Instance instance, + PP_AudioSampleRate sample_rate, + uint32_t sample_frame_count); + /** + * RecommendSampleFrameCount() returns the supported sample frame count + * closest to the requested count. The sample frame count determines the + * overall latency of audio. Since one "frame" is always buffered in advance, + * smaller frame counts will yield lower latency, but higher CPU utilization. + * + * Supported sample frame counts will vary by hardware and system (consider + * that the local system might be anywhere from a cell phone or a high-end + * audio workstation). Sample counts less than + * PP_AUDIOMINSAMPLEFRAMECOUNT and greater than + * PP_AUDIOMAXSAMPLEFRAMECOUNT are never supported on any + * system, but values in between aren't necessarily valid. This function + * will return a supported count closest to the requested frame count. + * + * RecommendSampleFrameCount() result is intended for audio output devices. + * + * @param[in] instance + * @param[in] sample_rate A PP_AudioSampleRate which is either + * PP_AUDIOSAMPLERATE_44100 or + * PP_AUDIOSAMPLERATE_48000. + * @param[in] requested_sample_frame_count A uint_32t requested + * frame count. + * + * @return A uint32_t containing the recommended sample frame + * count if successful. + */ + uint32_t (*RecommendSampleFrameCount)( + PP_Instance instance, + PP_AudioSampleRate sample_rate, + uint32_t requested_sample_frame_count); + /** + * IsAudioConfig() determines if the given resource is a + * PPB_Audio_Config. + * + * @param[in] resource A PP_Resource corresponding to an audio + * config resource. + * + * @return A PP_Bool containing PP_TRUE if the given + * resource is an AudioConfig resource, otherwise + * PP_FALSE. + */ + PP_Bool (*IsAudioConfig)(PP_Resource resource); + /** + * GetSampleRate() returns the sample rate for the given + * PPB_Audio_Config. + * + * @param[in] config A PP_Resource corresponding to a + * PPB_Audio_Config. + * + * @return A PP_AudioSampleRate containing sample rate or + * PP_AUDIOSAMPLERATE_NONE if the resource is invalid. + */ + PP_AudioSampleRate (*GetSampleRate)(PP_Resource config); + /** + * GetSampleFrameCount() returns the sample frame count for the given + * PPB_Audio_Config. + * + * @param[in] config A PP_Resource corresponding to an audio + * config resource. + * + * @return A uint32_t containing sample frame count or + * 0 if the resource is invalid. Refer to + * RecommendSampleFrameCount() for more on sample frame counts. + */ + uint32_t (*GetSampleFrameCount)(PP_Resource config); + /** + * RecommendSampleRate() returns the native sample rate that the browser + * is using in the backend. Applications that use the recommended sample + * rate will have potentially better latency and fidelity. The return value + * is intended for audio output devices. If the output sample rate cannot be + * determined, this function can return PP_AUDIOSAMPLERATE_NONE. + * + * @param[in] instance + * + * @return A uint32_t containing the recommended sample frame + * count if successful. + */ + PP_AudioSampleRate (*RecommendSampleRate)(PP_Instance instance); +}; + +typedef struct PPB_AudioConfig_1_1 PPB_AudioConfig; + +struct PPB_AudioConfig_1_0 { + PP_Resource (*CreateStereo16Bit)(PP_Instance instance, + PP_AudioSampleRate sample_rate, + uint32_t sample_frame_count); + uint32_t (*RecommendSampleFrameCount)( + PP_AudioSampleRate sample_rate, + uint32_t requested_sample_frame_count); + PP_Bool (*IsAudioConfig)(PP_Resource resource); + PP_AudioSampleRate (*GetSampleRate)(PP_Resource config); + uint32_t (*GetSampleFrameCount)(PP_Resource config); +}; +/** + * @} + */ + +/* ppb_audio_encoder.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * Audio encoder interface. + * + * Typical usage: + * - Call Create() to create a new audio encoder resource. + * - Call GetSupportedProfiles() to determine which codecs and profiles are + * available. + * - Call Initialize() to initialize the encoder for a supported profile. + * - Call GetBuffer() to get an empty buffer and fill it in, or get an audio + * buffer from another resource, e.g. PPB_MediaStreamAudioTrack. + * - Call Encode() to push the audio buffer to the encoder. If an external + * buffer is pushed, wait for completion to recycle the buffer. + * - Call GetBitstreamBuffer() continuously (waiting for each previous call to + * complete) to pull encoded buffers from the encoder. + * - Call RecycleBitstreamBuffer() after consuming the data in the bitstream + * buffer. + * - To destroy the encoder, the plugin should release all of its references to + * it. Any pending callbacks will abort before the encoder is destroyed. + * + * Available audio codecs vary by platform. + * All: opus. + */ +struct PPB_AudioEncoder_0_1 { /* dev */ + /** + * Creates a new audio encoder resource. + * + * @param[in] instance A PP_Instance identifying the instance + * with the audio encoder. + * + * @return A PP_Resource corresponding to an audio encoder if + * successful or 0 otherwise. + */ + PP_Resource (*Create)(PP_Instance instance); + /** + * Determines if the given resource is an audio encoder. + * + * @param[in] resource A PP_Resource identifying a resource. + * + * @return PP_TRUE if the resource is a + * PPB_AudioEncoder, PP_FALSE if the resource is + * invalid or some other type. + */ + PP_Bool (*IsAudioEncoder)(PP_Resource resource); + /** + * Gets an array of supported audio encoder profiles. + * These can be used to choose a profile before calling Initialize(). + * + * @param[in] audio_encoder A PP_Resource identifying the audio + * encoder. + * @param[in] output A PP_ArrayOutput to receive the supported + * PP_AudioProfileDescription structs. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return If >= 0, the number of supported profiles returned, otherwise an + * error code from pp_errors.h. + */ + int32_t (*GetSupportedProfiles)(PP_Resource audio_encoder, + struct PP_ArrayOutput output, + struct PP_CompletionCallback callback); + /** + * Initializes an audio encoder resource. The plugin should call Initialize() + * successfully before calling any of the functions below. + * + * @param[in] audio_encoder A PP_Resource identifying the audio + * encoder. + * @param[in] channels The number of audio channels to encode. + * @param[in] input_sampling_rate The sampling rate of the input audio buffer. + * @param[in] input_sample_size The sample size of the input audio buffer. + * @param[in] output_profile A PP_AudioProfile specifying the + * codec profile of the encoded output stream. + * @param[in] initial_bitrate The initial bitrate for the encoder. + * @param[in] acceleration A PP_HardwareAcceleration specifying + * whether to use a hardware accelerated or a software implementation. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_NOTSUPPORTED if audio encoding is not available, or the + * requested codec profile is not supported. + */ + int32_t (*Initialize)(PP_Resource audio_encoder, + uint32_t channels, + PP_AudioBuffer_SampleRate input_sample_rate, + PP_AudioBuffer_SampleSize input_sample_size, + PP_AudioProfile output_profile, + uint32_t initial_bitrate, + PP_HardwareAcceleration acceleration, + struct PP_CompletionCallback callback); + /** + * Gets the number of audio samples per channel that audio buffers must + * contain in order to be processed by the encoder. This will be the number of + * samples per channels contained in buffers returned by GetBuffer(). + * + * @param[in] audio_encoder A PP_Resource identifying the audio + * encoder. + * @return An int32_t containing the number of samples required, or an error + * code from pp_errors.h. + * Returns PP_ERROR_FAILED if Initialize() has not successfully completed. + */ + int32_t (*GetNumberOfSamples)(PP_Resource audio_encoder); + /** + * Gets a blank audio buffer (with metadata given by the Initialize() + * call) which can be filled with audio data and passed to the encoder. + * + * @param[in] audio_encoder A PP_Resource identifying the audio + * encoder. + * @param[out] audio_buffer A blank PPB_AudioBuffer resource. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_FAILED if Initialize() has not successfully completed. + */ + int32_t (*GetBuffer)(PP_Resource audio_encoder, + PP_Resource* audio_buffer, + struct PP_CompletionCallback callback); + /** + * Encodes an audio buffer. + * + * @param[in] audio_encoder A PP_Resource identifying the audio + * encoder. + * @param[in] audio_buffer The PPB_AudioBuffer to be encoded. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. Plugins that pass PPB_AudioBuffer resources owned + * by other resources should wait for completion before reusing them. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_FAILED if Initialize() has not successfully completed. + */ + int32_t (*Encode)(PP_Resource audio_encoder, + PP_Resource audio_buffer, + struct PP_CompletionCallback callback); + /** + * Gets the next encoded bitstream buffer from the encoder. + * + * @param[in] audio_encoder A PP_Resource identifying the audio + * encoder. + * @param[out] bitstream_buffer A PP_BitstreamBuffer containing + * encoded audio data. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. The plugin can call GetBitstreamBuffer from the callback in + * order to continuously "pull" bitstream buffers from the encoder. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_FAILED if Initialize() has not successfully completed. + * Returns PP_ERROR_INPROGRESS if a prior call to GetBitstreamBuffer() has + * not completed. + */ + int32_t (*GetBitstreamBuffer)( + PP_Resource audio_encoder, + struct PP_AudioBitstreamBuffer* bitstream_buffer, + struct PP_CompletionCallback callback); + /** + * Recycles a bitstream buffer back to the encoder. + * + * @param[in] audio_encoder A PP_Resource identifying the audio + * encoder. + * @param[in] bitstream_buffer A PP_BitstreamBuffer that is no + * longer needed by the plugin. + */ + void (*RecycleBitstreamBuffer)( + PP_Resource audio_encoder, + const struct PP_AudioBitstreamBuffer* bitstream_buffer); + /** + * Requests a change to the encoding bitrate. This is only a request, + * fulfilled on a best-effort basis. + * + * @param[in] audio_encoder A PP_Resource identifying the audio + * encoder. + * @param[in] bitrate The requested new bitrate, in bits per second. + */ + void (*RequestBitrateChange)(PP_Resource audio_encoder, uint32_t bitrate); + /** + * Closes the audio encoder, and cancels any pending encodes. Any pending + * callbacks will still run, reporting PP_ERROR_ABORTED . It is + * not valid to call any encoder functions after a call to this method. + * Note: Destroying the audio encoder closes it implicitly, + * so you are not required to call Close(). + * + * @param[in] audio_encoder A PP_Resource identifying the audio + * encoder. + */ + void (*Close)(PP_Resource audio_encoder); +}; +/** + * @} + */ + +/* ppb_compositor.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * Defines the PPB_Compositor interface. Used for setting + * PPB_CompositorLayer layers to the Chromium compositor for + * compositing. This allows a plugin to combine different sources of visual + * data efficiently, such as PPB_ImageData images and + * OpenGL textures. See also PPB_CompositorLayer for more + * information. + * This interface is still in development (Dev API status) and may change, + * so is only supported on Dev channel and Canary currently. + * + * Example usage from plugin code: + * + * Setup: + * @code + * PP_Resource compositor; + * compositor = compositor_if->Create(instance); + * instance_if->BindGraphics(instance, compositor); + * @endcode + * + * Setup layer stack: + * @code + * PP_Resource color_layer = compositor_if->AddLayer(compositor); + * PP_Resource texture_layer = compositor_if->AddLayer(compositor); + * @endcode + * + * Present one frame: + * layer_if->SetColor(color_layer, 255, 255, 0, 255, PP_MakeSize(400, 400)); + * PP_CompletionCallback release_callback = { + * TextureReleasedCallback, 0, PP_COMPLETIONCALLBACK_FLAG_NONE, + * }; + * layer_if->SetTexture(texture_layer, graphics3d, texture_id, + * PP_MakeSize(300, 300), release_callback); + * + * PP_CompletionCallback callback = { + * DidFinishCommitLayersCallback, + * (void*) texture_id, + * PP_COMPLETIONCALLBACK_FLAG_NONE, + * }; + * compositor_if->CommitLayers(compositor, callback); + * @endcode + * + * release callback + * void ReleaseCallback(int32_t result, void* user_data) { + * if (result == PP_OK) { + * uint32_t texture_id = (uint32_t) user_data; + * // reuse the texture or delete it. + * } + * } + * + * Shutdown: + * @code + * core->ReleaseResource(color_layer); + * core->ReleaseResource(texture_layer); + * core->ReleaseResource(compositor); + * @endcode + */ +struct PPB_Compositor_0_1 { /* dev */ + /** + * Determines if a resource is a compositor resource. + * + * @param[in] resource The PP_Resource to test. + * + * @return A PP_Bool with PP_TRUE if the given + * resource is a compositor resource or PP_FALSE otherwise. + */ + PP_Bool (*IsCompositor)(PP_Resource resource); + /** + * Creates a Compositor resource. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * + * @return A PP_Resource containing the compositor resource if + * successful or 0 otherwise. + */ + PP_Resource (*Create)(PP_Instance instance); + /** + * Creates a new PPB_CompositorLayer and adds it to the end + * of the layer stack. A PP_Resource containing the layer is + * returned. It is uninitialized, SetColor(), + * SetTexture or SetImage should be used to + * initialize it. The layer will appear above other pre-existing layers. + * If ResetLayers is called or the PPB_Compositor is + * released, the returned layer will be invalidated, and any further calls on + * the layer will return PP_ERROR_BADRESOURCE. + * + * param[in] compositor A PP_Resource corresponding to + * a compositor layer resource. + * + * @return A PP_Resource containing the compositor layer + * resource if successful or 0 otherwise. + */ + PP_Resource (*AddLayer)(PP_Resource compositor); + /** + * Commits layers added by AddLayer() to the chromium compositor. + * + * param[in] compositor A PP_Resource corresponding to + * a compositor layer resource. + * @param[in] cc A PP_CompletionCallback to be called when + * layers have been represented on screen. + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t (*CommitLayers)(PP_Resource compositor, + struct PP_CompletionCallback cc); + /** + * Resets layers added by AddLayer(). + * + * param[in] compositor A PP_Resource corresponding to + * a compositor layer resource. + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t (*ResetLayers)(PP_Resource compositor); +}; +/** + * @} + */ + +/* ppb_compositor_layer.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * This enumeration contains blend modes used for computing the result pixels + * based on the source RGBA values in layers with the RGBA values that are + * already in the destination framebuffer. + * alpha_src, color_src: source alpha and color. + * alpha_dst, color_dst: destination alpha and color (before compositing). + * Below descriptions of the blend modes assume the colors are pre-multiplied. + * This interface is still in development (Dev API status) and may change, + * so is only supported on Dev channel and Canary currently. + */ +typedef enum { + /** + * No blending, copy source to the destination directly. + */ + PP_BLENDMODE_NONE, + /** + * Source is placed over the destination. + * Resulting alpha = alpha_src + alpha_dst - alpha_src * alpha_dst + * Resulting color = color_src + color_dst * (1 - alpha_src) + */ + PP_BLENDMODE_SRC_OVER, + /** + * The last blend mode. + */ + PP_BLENDMODE_LAST = PP_BLENDMODE_SRC_OVER +} PP_BlendMode; +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * Defines the PPB_CompositorLayer interface. It is used by + * PPB_Compositor. + */ +struct PPB_CompositorLayer_0_2 { /* dev */ + /** + * Determines if a resource is a compositor layer resource. + * + * @param[in] resource The PP_Resource to test. + * + * @return A PP_Bool with PP_TRUE if the given + * resource is a compositor layer resource or PP_FALSE + * otherwise. + */ + PP_Bool (*IsCompositorLayer)(PP_Resource resource); + /** + * Sets the color of a solid color layer. If the layer is uninitialized, + * it will initialize the layer first, and then set its color. + * If the layer has been initialized to another kind of layer, the layer will + * not be changed, and PP_ERROR_BADARGUMENT will be returned. + * + * param[in] layer A PP_Resource corresponding to a compositor + * layer resource. + * param[in] red A float for the red color component. It will be + * clamped to [0, 1]. + * param[in] green A float for the green color component. It will + * be clamped to [0, 1]. + * param[in] blue A float for the blue color component. It will + * be clamped to [0, 1]. + * param[in] alpha A float for the alpha color component. It will + * be clamped to [0, 1]. + * param[in] size A PP_Size for the size of the layer before + * transform. + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t (*SetColor)(PP_Resource layer, + float red, + float green, + float blue, + float alpha, + const struct PP_Size* size); + /** + * Sets the texture of a texture layer. If the layer is uninitialized, + * it will initialize the layer first, and then set its texture. + * The source rect will be set to ((0, 0), (1, 1)). If the layer has been + * initialized to another kind of layer, the layer will not be changed, + * and PP_ERROR_BADARGUMENT will be returned. + * + * param[in] layer A PP_Resource corresponding to a compositor + * layer resource. + * param[in] context A PP_Resource corresponding to a graphics + * 3d resource which owns the GL texture. + * param[in] target GL texture target (GL_TEXTURE_2D, etc). + * param[in] texture A GL texture object id. + * param[in] size A PP_Size for the size of the layer before + * transform. + * param[in] cc A PP_CompletionCallback to be called when + * the texture is released by Chromium compositor. + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t (*SetTexture)(PP_Resource layer, + PP_Resource context, + uint32_t target, + uint32_t texture, + const struct PP_Size* size, + struct PP_CompletionCallback cc); + /** + * Sets the image of an image layer. If the layer is uninitialized, + * it will initialize the layer first, and then set its image. + * The layer size will be set to the image's size. The source rect will be set + * to the full image. If the layer has been initialized to another kind of + * layer, the layer will not be changed, and PP_ERROR_BADARGUMENT + * will be returned. + * + * param[in] layer A PP_Resource corresponding to a compositor + * layer resource. + * param[in] image_data A PP_Resource corresponding to + * an image data resource. + * param[in] size A PP_Size for the size of the layer before + * transform. If NULL, the image's size will be used. + * param[in] cc A PP_CompletionCallback to be called when + * the image data is released by Chromium compositor. + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t (*SetImage)(PP_Resource layer, + PP_Resource image_data, + const struct PP_Size* size, + struct PP_CompletionCallback cc); + /** + * Sets a clip rectangle for a compositor layer. The Chromium compositor + * applies a transform matrix on the layer first, and then clips the layer + * with the rectangle. + * + * param[in] layer A PP_Resource corresponding to a compositor + * layer resource. + * param[in] rect The clip rectangle. The origin is top-left corner of + * the plugin. + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t (*SetClipRect)(PP_Resource layer, const struct PP_Rect* rect); + /** + * Sets a transform matrix which is used to composite the layer. + * + * param[in] layer A PP_Resource corresponding to a compositor + * layer resource. + * param[in] matrix A float array with 16 elements. The matrix is + * column major. The default transform matrix is an identity matrix. + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t (*SetTransform)(PP_Resource layer, const float matrix[16]); + /** + * Sets the opacity value which will be applied to the layer. The effective + * value of each pixel is computed as: + * + * if (premult_alpha) + * pixel.rgb = pixel.rgb * opacity; + * pixel.a = pixel.a * opactiy; + * + * param[in] layer A PP_Resource corresponding to a compositor + * layer resource. + * param[in] opacity A float for the opacity value, The default + * value is 1.0f. + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t (*SetOpacity)(PP_Resource layer, float opacity); + /** + * Sets the blend mode which is used to composite the layer. + * + * param[in] layer A PP_Resource corresponding to a compositor + * layer resource. + * param[in] mode A PP_BlendMode. The default mode is + * PP_BLENDMODE_SRC_OVER. + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t (*SetBlendMode)(PP_Resource layer, PP_BlendMode mode); + /** + * Sets a source rectangle for a texture layer or an image layer. + * + * param[in] layer A PP_Resource corresponding to a compositor + * layer resource. + * param[in] rect A PP_FloatRect for an area of the source to + * consider. For a texture layer, rect is in uv coordinates. For an image + * layer, rect is in pixels. If the rect is beyond the dimensions of the + * texture or image, PP_ERROR_BADARGUMENT will be returned. + * If the layer size does not match the source rect size, bilinear scaling + * will be used. + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t (*SetSourceRect)(PP_Resource layer, const struct PP_FloatRect* rect); + /** + * Sets the premultiplied alpha for an texture layer. + * + * param[in] layer A PP_Resource corresponding to a compositor + * layer resource. + * param[in] premult A PP_Bool with PP_TRUE if + * pre-multiplied alpha is used. + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t (*SetPremultipliedAlpha)(PP_Resource layer, PP_Bool premult); +}; + +struct PPB_CompositorLayer_0_1 { /* dev */ + PP_Bool (*IsCompositorLayer)(PP_Resource resource); + int32_t (*SetColor)(PP_Resource layer, + float red, + float green, + float blue, + float alpha, + const struct PP_Size* size); + int32_t (*SetTexture)(PP_Resource layer, + PP_Resource context, + uint32_t texture, + const struct PP_Size* size, + struct PP_CompletionCallback cc); + int32_t (*SetImage)(PP_Resource layer, + PP_Resource image_data, + const struct PP_Size* size, + struct PP_CompletionCallback cc); + int32_t (*SetClipRect)(PP_Resource layer, const struct PP_Rect* rect); + int32_t (*SetTransform)(PP_Resource layer, const float matrix[16]); + int32_t (*SetOpacity)(PP_Resource layer, float opacity); + int32_t (*SetBlendMode)(PP_Resource layer, PP_BlendMode mode); + int32_t (*SetSourceRect)(PP_Resource layer, const struct PP_FloatRect* rect); + int32_t (*SetPremultipliedAlpha)(PP_Resource layer, PP_Bool premult); +}; +/** + * @} + */ + +/* ppb_console.idl */ +/** + * @addtogroup Enums + * @{ + */ +typedef enum { + PP_LOGLEVEL_TIP = 0, + PP_LOGLEVEL_LOG = 1, + PP_LOGLEVEL_WARNING = 2, + PP_LOGLEVEL_ERROR = 3 +} PP_LogLevel; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_LogLevel, 4); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_Console_1_0 { + /** + * Logs the given message to the JavaScript console associated with the + * given plugin instance with the given logging level. The name of the plugin + * issuing the log message will be automatically prepended to the message. + * The value may be any type of Var. + */ + void (*Log)(PP_Instance instance, PP_LogLevel level, struct PP_Var value); + /** + * Logs a message to the console with the given source information rather + * than using the internal PPAPI plugin name. The name must be a string var. + * + * The regular log function will automatically prepend the name of your + * plugin to the message as the "source" of the message. Some plugins may + * wish to override this. For example, if your plugin is a Python + * interpreter, you would want log messages to contain the source .py file + * doing the log statement rather than have "python" show up in the console. + */ + void (*LogWithSource)(PP_Instance instance, + PP_LogLevel level, + struct PP_Var source, + struct PP_Var value); +}; + +typedef struct PPB_Console_1_0 PPB_Console; +/** + * @} + */ + +/* ppb_core.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_Core interface contains pointers to functions related + * to memory management, time, and threads on the browser. + * + */ +struct PPB_Core_1_0 { + /** + * + * AddRefResource() adds a reference to a resource. + * + * @param[in] config A PP_Resource corresponding to a + * resource. + */ + void (*AddRefResource)(PP_Resource resource); + /** + * ReleaseResource() removes a reference from a resource. + * + * @param[in] config A PP_Resource corresponding to a + * resource. + */ + void (*ReleaseResource)(PP_Resource resource); + /** + * GetTime() returns the "wall clock time" according to the + * browser. + * + * @return A PP_Time containing the "wall clock time" according + * to the browser. + */ + PP_Time (*GetTime)(void); + /** + * GetTimeTicks() returns the "tick time" according to the browser. + * This clock is used by the browser when passing some event times to the + * module (e.g. using the PP_InputEvent::time_stamp_seconds + * field). It is not correlated to any actual wall clock time + * (like GetTime()). Because of this, it will not run change if the user + * changes their computer clock. + * + * @return A PP_TimeTicks containing the "tick time" according + * to the browser. + */ + PP_TimeTicks (*GetTimeTicks)(void); + /** + * CallOnMainThread() schedules work to be executed on the main module thread + * after the specified delay. The delay may be 0 to specify a call back as + * soon as possible. + * + * The result parameter will just be passed as the second + * argument to the callback. Many applications won't need this, but it allows + * a module to emulate calls of some callbacks which do use this value. + * + * Note: CallOnMainThread, even when used from the main + * thread with a delay of 0 milliseconds, will never directly invoke the + * callback. Even in this case, the callback will be scheduled + * asynchronously. + * + * Note: If the browser is shutting down or if the module + * has no instances, then the callback function may not be called. + * + * @param[in] delay_in_milliseconds An int32_t delay in milliseconds. + * @param[in] callback A PP_CompletionCallback callback function + * that the browser will call after the specified delay. + * @param[in] result An int32_t that the browser will pass to the given + * PP_CompletionCallback. + */ + void (*CallOnMainThread)(int32_t delay_in_milliseconds, + struct PP_CompletionCallback callback, + int32_t result); + /** + * IsMainThread() returns true if the current thread is the main pepper + * thread. + * + * This function is useful for implementing sanity checks, and deciding if + * dispatching using CallOnMainThread() is required. + * + * @return A PP_Bool containing PP_TRUE if the + * current thread is the main pepper thread, otherwise PP_FALSE. + */ + PP_Bool (*IsMainThread)(void); +}; + +typedef struct PPB_Core_1_0 PPB_Core; +/** + * @} + */ + +/* ppb_file_io.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * The PP_FileOpenFlags enum contains file open constants. + */ +typedef enum { + /** Requests read access to a file. */ + PP_FILEOPENFLAG_READ = 1 << 0, + /** + * Requests write access to a file. May be combined with + * PP_FILEOPENFLAG_READ to request read and write access. + */ + PP_FILEOPENFLAG_WRITE = 1 << 1, + /** + * Requests that the file be created if it does not exist. If the file + * already exists, then this flag is ignored unless + * PP_FILEOPENFLAG_EXCLUSIVE was also specified, in which case + * FileIO::Open() will fail. + */ + PP_FILEOPENFLAG_CREATE = 1 << 2, + /** + * Requests that the file be truncated to length 0 if it exists and is a + * regular file. PP_FILEOPENFLAG_WRITE must also be specified. + */ + PP_FILEOPENFLAG_TRUNCATE = 1 << 3, + /** + * Requests that the file is created when this flag is combined with + * PP_FILEOPENFLAG_CREATE. If this flag is specified, and the + * file already exists, then the FileIO::Open() call will fail. + */ + PP_FILEOPENFLAG_EXCLUSIVE = 1 << 4, + /** + * Requests write access to a file, but writes will always occur at the end of + * the file. Mututally exclusive with PP_FILEOPENFLAG_WRITE. + * + * This is only supported in version 1.2 (Chrome 29) and later. + */ + PP_FILEOPENFLAG_APPEND = 1 << 5 +} PP_FileOpenFlags; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_FileOpenFlags, 4); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_FileIO struct is used to operate on a regular file + * (PP_FileType_Regular). + */ +struct PPB_FileIO_1_1 { + /** + * Create() creates a new FileIO object. + * + * @param[in] instance A PP_Instance identifying the instance + * with the file. + * + * @return A PP_Resource corresponding to a FileIO if + * successful or 0 if the module is invalid. + */ + PP_Resource (*Create)(PP_Instance instance); + /** + * IsFileIO() determines if the provided resource is a FileIO. + * + * @param[in] resource A PP_Resource corresponding to a FileIO. + * + * @return PP_TRUE if the resource is a + * PPB_FileIO, PP_FALSE if the resource is + * invalid or some type other than PPB_FileIO. + */ + PP_Bool (*IsFileIO)(PP_Resource resource); + /** + * Open() opens the specified regular file for I/O according to the given + * open flags, which is a bit-mask of the PP_FileOpenFlags + * values. Upon success, the corresponding file is classified as "in use" + * by this FileIO object until such time as the FileIO object is closed + * or destroyed. + * + * @param[in] file_io A PP_Resource corresponding to a + * FileIO. + * @param[in] file_ref A PP_Resource corresponding to a file + * reference. + * @param[in] open_flags A bit-mask of the PP_FileOpenFlags + * values. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Open(). + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t (*Open)(PP_Resource file_io, + PP_Resource file_ref, + int32_t open_flags, + struct PP_CompletionCallback callback); + /** + * Query() queries info about the file opened by this FileIO object. The + * FileIO object must be opened, and there must be no other operations + * pending. + * + * @param[in] file_io A PP_Resource corresponding to a + * FileIO. + * @param[out] info The PP_FileInfo structure representing all + * information about the file. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Query(). info must remain valid until after the + * callback runs. If you pass a blocking callback, info must + * remain valid until after Query() returns. + * + * @return An int32_t containing an error code from pp_errors.h. + * PP_ERROR_FAILED will be returned if the file isn't opened, and + * PP_ERROR_INPROGRESS will be returned if there is another operation pending. + */ + int32_t (*Query)(PP_Resource file_io, + struct PP_FileInfo* info, + struct PP_CompletionCallback callback); + /** + * Touch() Updates time stamps for the file opened by this FileIO object. + * This function will fail if the FileIO object has not been opened. The + * FileIO object must be opened, and there must be no other operations + * pending. + * + * @param[in] file_io A PP_Resource corresponding to a file + * FileIO. + * @param[in] last_access_time The last time the FileIO was accessed. + * @param[in] last_modified_time The last time the FileIO was modified. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Touch(). + * + * @return An int32_t containing an error code from pp_errors.h. + * PP_ERROR_FAILED will be returned if the file isn't opened, and + * PP_ERROR_INPROGRESS will be returned if there is another operation pending. + */ + int32_t (*Touch)(PP_Resource file_io, + PP_Time last_access_time, + PP_Time last_modified_time, + struct PP_CompletionCallback callback); + /** + * Read() reads from an offset in the file. The size of the buffer must be + * large enough to hold the specified number of bytes to read. This function + * might perform a partial read, meaning all the requested bytes + * might not be returned, even if the end of the file has not been reached. + * The FileIO object must have been opened with read access. + * + * ReadToArray() is preferred to Read() when doing asynchronous operations. + * + * @param[in] file_io A PP_Resource corresponding to a file + * FileIO. + * @param[in] offset The offset into the file. + * @param[in] buffer The buffer to hold the specified number of bytes read. + * @param[in] bytes_to_read The number of bytes to read from + * offset. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Read(). buffer must remain valid until after + * the callback runs. If you pass a blocking callback, buffer + * must remain valid until after Read() returns. + * + * @return The number of bytes read or an error code from + * pp_errors.h. If the return value is 0, then end-of-file was + * reached. It is valid to call Read() multiple times with a completion + * callback to queue up parallel reads from the file, but pending reads + * cannot be interleaved with other operations. + */ + int32_t (*Read)(PP_Resource file_io, + int64_t offset, + char* buffer, + int32_t bytes_to_read, + struct PP_CompletionCallback callback); + /** + * Write() writes to an offset in the file. This function might perform a + * partial write. The FileIO object must have been opened with write access. + * + * @param[in] file_io A PP_Resource corresponding to a file + * FileIO. + * @param[in] offset The offset into the file. + * @param[in] buffer The buffer to hold the specified number of bytes read. + * @param[in] bytes_to_write The number of bytes to write to + * offset. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Write(). + * + * @return The number of bytes written or an error code from + * pp_errors.h. If the return value is 0, then end-of-file was + * reached. It is valid to call Write() multiple times with a completion + * callback to queue up parallel writes to the file, but pending writes + * cannot be interleaved with other operations. + */ + int32_t (*Write)(PP_Resource file_io, + int64_t offset, + const char* buffer, + int32_t bytes_to_write, + struct PP_CompletionCallback callback); + /** + * SetLength() sets the length of the file. If the file size is extended, + * then the extended area of the file is zero-filled. The FileIO object must + * have been opened with write access and there must be no other operations + * pending. + * + * @param[in] file_io A PP_Resource corresponding to a file + * FileIO. + * @param[in] length The length of the file to be set. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of SetLength(). + * + * @return An int32_t containing an error code from pp_errors.h. + * PP_ERROR_FAILED will be returned if the file isn't opened, and + * PP_ERROR_INPROGRESS will be returned if there is another operation pending. + */ + int32_t (*SetLength)(PP_Resource file_io, + int64_t length, + struct PP_CompletionCallback callback); + /** + * Flush() flushes changes to disk. This call can be very expensive! The + * FileIO object must have been opened with write access and there must be no + * other operations pending. + * + * @param[in] file_io A PP_Resource corresponding to a file + * FileIO. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Flush(). + * + * @return An int32_t containing an error code from pp_errors.h. + * PP_ERROR_FAILED will be returned if the file isn't opened, and + * PP_ERROR_INPROGRESS will be returned if there is another operation pending. + */ + int32_t (*Flush)(PP_Resource file_io, struct PP_CompletionCallback callback); + /** + * Close() cancels any IO that may be pending, and closes the FileIO object. + * Any pending callbacks will still run, reporting + * PP_ERROR_ABORTED if pending IO was interrupted. It is not + * valid to call Open() again after a call to this method. + * Note: If the FileIO object is destroyed, and it is still + * open, then it will be implicitly closed, so you are not required to call + * Close(). + * + * @param[in] file_io A PP_Resource corresponding to a file + * FileIO. + */ + void (*Close)(PP_Resource file_io); + /** + * ReadToArray() reads from an offset in the file. A PP_ArrayOutput must be + * provided so that output will be stored in its allocated buffer. This + * function might perform a partial read. The FileIO object must have been + * opened with read access. + * + * @param[in] file_io A PP_Resource corresponding to a file + * FileIO. + * @param[in] offset The offset into the file. + * @param[in] max_read_length The maximum number of bytes to read from + * offset. + * @param[in] output A PP_ArrayOutput to hold the output data. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of ReadToArray(). + * + * @return The number of bytes read or an error code from + * pp_errors.h. If the return value is 0, then end-of-file was + * reached. It is valid to call ReadToArray() multiple times with a completion + * callback to queue up parallel reads from the file, but pending reads + * cannot be interleaved with other operations. + */ + int32_t (*ReadToArray)(PP_Resource file_io, + int64_t offset, + int32_t max_read_length, + struct PP_ArrayOutput* output, + struct PP_CompletionCallback callback); +}; + +typedef struct PPB_FileIO_1_1 PPB_FileIO; + +struct PPB_FileIO_1_0 { + PP_Resource (*Create)(PP_Instance instance); + PP_Bool (*IsFileIO)(PP_Resource resource); + int32_t (*Open)(PP_Resource file_io, + PP_Resource file_ref, + int32_t open_flags, + struct PP_CompletionCallback callback); + int32_t (*Query)(PP_Resource file_io, + struct PP_FileInfo* info, + struct PP_CompletionCallback callback); + int32_t (*Touch)(PP_Resource file_io, + PP_Time last_access_time, + PP_Time last_modified_time, + struct PP_CompletionCallback callback); + int32_t (*Read)(PP_Resource file_io, + int64_t offset, + char* buffer, + int32_t bytes_to_read, + struct PP_CompletionCallback callback); + int32_t (*Write)(PP_Resource file_io, + int64_t offset, + const char* buffer, + int32_t bytes_to_write, + struct PP_CompletionCallback callback); + int32_t (*SetLength)(PP_Resource file_io, + int64_t length, + struct PP_CompletionCallback callback); + int32_t (*Flush)(PP_Resource file_io, struct PP_CompletionCallback callback); + void (*Close)(PP_Resource file_io); +}; +/** + * @} + */ + +/* ppb_file_ref.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * The PP_MakeDirectoryFlags enum contains flags used to control + * behavior of PPB_FileRef.MakeDirectory(). + */ +typedef enum { + PP_MAKEDIRECTORYFLAG_NONE = 0 << 0, + /** Requests that ancestor directories are created if they do not exist. */ + PP_MAKEDIRECTORYFLAG_WITH_ANCESTORS = 1 << 0, + /** + * Requests that the PPB_FileRef.MakeDirectory() call fails if the directory + * already exists. + */ + PP_MAKEDIRECTORYFLAG_EXCLUSIVE = 1 << 1 +} PP_MakeDirectoryFlags; +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_FileRef struct represents a "weak pointer" to a file in + * a file system. This struct contains a PP_FileSystemType + * identifier and a file path string. + */ +struct PPB_FileRef_1_2 { + /** + * Create() creates a weak pointer to a file in the given file system. File + * paths are POSIX style. + * + * @param[in] resource A PP_Resource corresponding to a file + * system. + * @param[in] path A path to the file. Must begin with a '/' character. + * + * @return A PP_Resource corresponding to a file reference if + * successful or 0 if the path is malformed. + */ + PP_Resource (*Create)(PP_Resource file_system, const char* path); + /** + * IsFileRef() determines if the provided resource is a file reference. + * + * @param[in] resource A PP_Resource corresponding to a file + * reference. + * + * @return PP_TRUE if the resource is a + * PPB_FileRef, PP_FALSE if the resource is + * invalid or some type other than PPB_FileRef. + */ + PP_Bool (*IsFileRef)(PP_Resource resource); + /** + * GetFileSystemType() returns the type of the file system. + * + * @param[in] file_ref A PP_Resource corresponding to a file + * reference. + * + * @return A PP_FileSystemType with the file system type if + * valid or PP_FILESYSTEMTYPE_INVALID if the provided resource + * is not a valid file reference. + */ + PP_FileSystemType (*GetFileSystemType)(PP_Resource file_ref); + /** + * GetName() returns the name of the file. + * + * @param[in] file_ref A PP_Resource corresponding to a file + * reference. + * + * @return A PP_Var containing the name of the file. The value + * returned by this function does not include any path components (such as + * the name of the parent directory, for example). It is just the name of the + * file. Use GetPath() to get the full file path. + */ + struct PP_Var (*GetName)(PP_Resource file_ref); + /** + * GetPath() returns the absolute path of the file. + * + * @param[in] file_ref A PP_Resource corresponding to a file + * reference. + * + * @return A PP_Var containing the absolute path of the file. + * This function fails if the file system type is + * PP_FileSystemType_External. + */ + struct PP_Var (*GetPath)(PP_Resource file_ref); + /** + * GetParent() returns the parent directory of this file. If + * file_ref points to the root of the filesystem, then the root + * is returned. + * + * @param[in] file_ref A PP_Resource corresponding to a file + * reference. + * + * @return A PP_Resource containing the parent directory of the + * file. This function fails if the file system type is + * PP_FileSystemType_External. + */ + PP_Resource (*GetParent)(PP_Resource file_ref); + /** + * MakeDirectory() makes a new directory in the file system according to the + * given make_directory_flags, which is a bit-mask of the + * PP_MakeDirectoryFlags values. It is not valid to make a + * directory in the external file system. + * + * @param[in] file_ref A PP_Resource corresponding to a file + * reference. + * @param[in] make_directory_flags A bit-mask of the + * PP_MakeDirectoryFlags values. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of MakeDirectory(). + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t (*MakeDirectory)(PP_Resource directory_ref, + int32_t make_directory_flags, + struct PP_CompletionCallback callback); + /** + * Touch() Updates time stamps for a file. You must have write access to the + * file if it exists in the external filesystem. + * + * @param[in] file_ref A PP_Resource corresponding to a file + * reference. + * @param[in] last_access_time The last time the file was accessed. + * @param[in] last_modified_time The last time the file was modified. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Touch(). + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t (*Touch)(PP_Resource file_ref, + PP_Time last_access_time, + PP_Time last_modified_time, + struct PP_CompletionCallback callback); + /** + * Delete() deletes a file or directory. If file_ref refers to + * a directory, then the directory must be empty. It is an error to delete a + * file or directory that is in use. It is not valid to delete a file in + * the external file system. + * + * @param[in] file_ref A PP_Resource corresponding to a file + * reference. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Delete(). + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t (*Delete)(PP_Resource file_ref, + struct PP_CompletionCallback callback); + /** + * Rename() renames a file or directory. Arguments file_ref and + * new_file_ref must both refer to files in the same file + * system. It is an error to rename a file or directory that is in use. It + * is not valid to rename a file in the external file system. + * + * @param[in] file_ref A PP_Resource corresponding to a file + * reference. + * @param[in] new_file_ref A PP_Resource corresponding to a new + * file reference. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Rename(). + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t (*Rename)(PP_Resource file_ref, + PP_Resource new_file_ref, + struct PP_CompletionCallback callback); + /** + * Query() queries info about a file or directory. You must have access to + * read this file or directory if it exists in the external filesystem. + * + * @param[in] file_ref A PP_Resource corresponding to a file + * reference. + * @param[out] info A pointer to a PP_FileInfo which will be + * populated with information about the file or directory. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Query(). + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t (*Query)(PP_Resource file_ref, + struct PP_FileInfo* info, + struct PP_CompletionCallback callback); + /** + * ReadDirectoryEntries() reads all entries in a directory. + * + * @param[in] file_ref A PP_Resource corresponding to a directory + * reference. + * @param[in] output An output array which will receive + * PP_DirectoryEntry objects on success. + * @param[in] callback A PP_CompletionCallback to run on + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t (*ReadDirectoryEntries)(PP_Resource file_ref, + struct PP_ArrayOutput output, + struct PP_CompletionCallback callback); +}; + +typedef struct PPB_FileRef_1_2 PPB_FileRef; + +struct PPB_FileRef_1_0 { + PP_Resource (*Create)(PP_Resource file_system, const char* path); + PP_Bool (*IsFileRef)(PP_Resource resource); + PP_FileSystemType (*GetFileSystemType)(PP_Resource file_ref); + struct PP_Var (*GetName)(PP_Resource file_ref); + struct PP_Var (*GetPath)(PP_Resource file_ref); + PP_Resource (*GetParent)(PP_Resource file_ref); + int32_t (*MakeDirectory)(PP_Resource directory_ref, + PP_Bool make_ancestors, + struct PP_CompletionCallback callback); + int32_t (*Touch)(PP_Resource file_ref, + PP_Time last_access_time, + PP_Time last_modified_time, + struct PP_CompletionCallback callback); + int32_t (*Delete)(PP_Resource file_ref, + struct PP_CompletionCallback callback); + int32_t (*Rename)(PP_Resource file_ref, + PP_Resource new_file_ref, + struct PP_CompletionCallback callback); +}; + +struct PPB_FileRef_1_1 { + PP_Resource (*Create)(PP_Resource file_system, const char* path); + PP_Bool (*IsFileRef)(PP_Resource resource); + PP_FileSystemType (*GetFileSystemType)(PP_Resource file_ref); + struct PP_Var (*GetName)(PP_Resource file_ref); + struct PP_Var (*GetPath)(PP_Resource file_ref); + PP_Resource (*GetParent)(PP_Resource file_ref); + int32_t (*MakeDirectory)(PP_Resource directory_ref, + PP_Bool make_ancestors, + struct PP_CompletionCallback callback); + int32_t (*Touch)(PP_Resource file_ref, + PP_Time last_access_time, + PP_Time last_modified_time, + struct PP_CompletionCallback callback); + int32_t (*Delete)(PP_Resource file_ref, + struct PP_CompletionCallback callback); + int32_t (*Rename)(PP_Resource file_ref, + PP_Resource new_file_ref, + struct PP_CompletionCallback callback); + int32_t (*Query)(PP_Resource file_ref, + struct PP_FileInfo* info, + struct PP_CompletionCallback callback); + int32_t (*ReadDirectoryEntries)(PP_Resource file_ref, + struct PP_ArrayOutput output, + struct PP_CompletionCallback callback); +}; +/** + * @} + */ + +/* ppb_file_system.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_FileSystem struct identifies the file system type + * associated with a file. + */ +struct PPB_FileSystem_1_0 { + /** Create() creates a file system object of the given type. + * + * @param[in] instance A PP_Instance identifying the instance + * with the file. + * @param[in] type A file system type as defined by + * PP_FileSystemType enum (except PP_FILESYSTEMTYPE_ISOLATED, + * which is currently not supported). + * @return A PP_Resource corresponding to a file system if + * successful. + */ + PP_Resource (*Create)(PP_Instance instance, PP_FileSystemType type); + /** + * IsFileSystem() determines if the provided resource is a file system. + * + * @param[in] resource A PP_Resource corresponding to a file + * system. + * + * @return PP_TRUE if the resource is a + * PPB_FileSystem, PP_FALSE if the resource is + * invalid or some type other than PPB_FileSystem. + */ + PP_Bool (*IsFileSystem)(PP_Resource resource); + /** + * Open() opens the file system. A file system must be opened before running + * any other operation on it. + * + * @param[in] file_system A PP_Resource corresponding to a file + * system. + * + * @param[in] expected_size The expected size of the file system. Note that + * this does not request quota; to do that, you must either invoke + * requestQuota from JavaScript: + * http://www.html5rocks.com/en/tutorials/file/filesystem/#toc-requesting-quota + * or set the unlimitedStorage permission for Chrome Web Store apps: + * http://code.google.com/chrome/extensions/manifest.html#permissions + * + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Open(). + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t (*Open)(PP_Resource file_system, + int64_t expected_size, + struct PP_CompletionCallback callback); + /** + * GetType() returns the type of the provided file system. + * + * @param[in] file_system A PP_Resource corresponding to a file + * system. + * + * @return A PP_FileSystemType with the file system type if + * valid or PP_FILESYSTEMTYPE_INVALID if the provided resource + * is not a valid file system. It is valid to call this function even before + * Open() completes. + */ + PP_FileSystemType (*GetType)(PP_Resource file_system); +}; + +typedef struct PPB_FileSystem_1_0 PPB_FileSystem; +/** + * @} + */ + +/* ppb_fullscreen.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_Fullscreen interface is implemented by the browser. + * This interface provides a way of checking the current screen mode and + * toggling fullscreen mode. + */ +struct PPB_Fullscreen_1_0 { + /** + * IsFullscreen() checks whether the module instance is currently in + * fullscreen mode. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * + * @return PP_TRUE if the module instance is in fullscreen mode, + * PP_FALSE if the module instance is not in fullscreen mode. + */ + PP_Bool (*IsFullscreen)(PP_Instance instance); + /** + * SetFullscreen() switches the module instance to and from fullscreen + * mode. + * + * The transition to and from fullscreen mode is asynchronous. During the + * transition, IsFullscreen() will return the previous value and + * no 2D or 3D device can be bound. The transition ends at DidChangeView() + * when IsFullscreen() returns the new value. You might receive other + * DidChangeView() calls while in transition. + * + * The transition to fullscreen mode can only occur while the browser is + * processing a user gesture, even if PP_TRUE is returned. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * @param[in] fullscreen PP_TRUE to enter fullscreen mode, or + * PP_FALSE to exit fullscreen mode. + * + * @return PP_TRUE on success or PP_FALSE on + * failure. + */ + PP_Bool (*SetFullscreen)(PP_Instance instance, PP_Bool fullscreen); + /** + * GetScreenSize() gets the size of the screen in pixels. The module instance + * will be resized to this size when SetFullscreen() is called to enter + * fullscreen mode. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * @param[out] size The size of the entire screen in pixels. + * + * @return PP_TRUE on success or PP_FALSE on + * failure. + */ + PP_Bool (*GetScreenSize)(PP_Instance instance, struct PP_Size* size); +}; + +typedef struct PPB_Fullscreen_1_0 PPB_Fullscreen; +/** + * @} + */ + +/* ppb_gamepad.idl */ +/** + * @addtogroup Structs + * @{ + */ +/** + * The data for one gamepad device. + */ +struct PP_GamepadSampleData { + /** + * Number of valid elements in the |axes| array. + */ + uint32_t axes_length; + /** + * Normalized values for the axes, indices valid up to |axes_length|-1. Axis + * values range from -1..1, and are in order of "importance". + */ + float axes[16]; + /** + * Number of valid elements in the |buttons| array. + */ + uint32_t buttons_length; + /** + * Normalized values for the buttons, indices valid up to |buttons_length| + * - 1. Button values range from 0..1, and are in order of importance. + */ + float buttons[32]; + /** + * Monotonically increasing value that is incremented when the data have + * been updated. + */ + double timestamp; + /** + * Identifier for the type of device/manufacturer. + */ + uint16_t id[128]; + /** + * Is there a gamepad connected at this index? If this is false, no other + * data in this structure is valid. + */ + PP_Bool connected; + /* Padding to make the struct the same size between 64 and 32. */ + int8_t unused_pad_[4]; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_GamepadSampleData, 472); + +/** + * The data for all gamepads connected to the system. + */ +struct PP_GamepadsSampleData { + /** + * Number of valid elements in the |items| array. + */ + uint32_t length; + /* Padding to make the struct the same size between 64 and 32. */ + int8_t unused_pad_[4]; + /** + * Data for an individual gamepad device connected to the system. + */ + struct PP_GamepadSampleData items[4]; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_GamepadsSampleData, 1896); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_Gamepad interface allows retrieving data from + * gamepad/joystick devices that are connected to the system. + */ +struct PPB_Gamepad_1_0 { + /** + * Samples the current state of the available gamepads. + */ + void (*Sample)(PP_Instance instance, struct PP_GamepadsSampleData* data); +}; + +typedef struct PPB_Gamepad_1_0 PPB_Gamepad; +/** + * @} + */ + +/* ppb_graphics_2d.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * PPB_Graphics2D defines the interface for a 2D graphics context. + */ +struct PPB_Graphics2D_1_2 { + /** + * Create() creates a 2D graphics context. The returned graphics context will + * not be bound to the module instance on creation (call BindGraphics() on + * the module instance to bind the returned graphics context to the module + * instance). + * + * @param[in] instance The module instance. + * @param[in] size The size of the graphic context. + * @param[in] is_always_opaque Set the is_always_opaque flag to + * PP_TRUE if you know that you will be painting only opaque + * data to this context. This option will disable blending when compositing + * the module with the web page, which might give higher performance on some + * computers. + * + * If you set is_always_opaque, your alpha channel should always + * be set to 0xFF or there may be painting artifacts. The alpha values + * overwrite the destination alpha values without blending when + * is_always_opaque is true. + * + * @return A PP_Resource containing the 2D graphics context if + * successful or 0 if unsuccessful. + */ + PP_Resource (*Create)(PP_Instance instance, + const struct PP_Size* size, + PP_Bool is_always_opaque); + /** + * IsGraphics2D() determines if the given resource is a valid + * Graphics2D. + * + * @param[in] resource A Graphics2D context resource. + * + * @return PP_TRUE if the given resource is a valid Graphics2D, + * PP_FALSE if it is an invalid resource or is a resource of + * another type. + */ + PP_Bool (*IsGraphics2D)(PP_Resource resource); + /** + * Describe() retrieves the configuration for the given graphics context, + * filling the given values (which must not be NULL). + * + * @param[in] resource The 2D Graphics resource. + * @param[in,out] size The size of the 2D graphics context in the browser. + * @param[in,out] is_always_opaque Identifies whether only opaque data + * will be painted. + * + * @return Returns PP_TRUE on success or PP_FALSE if + * the resource is invalid. The output parameters will be set to 0 on a + * PP_FALSE. + */ + PP_Bool (*Describe)(PP_Resource graphics_2d, + struct PP_Size* size, + PP_Bool* is_always_opaque); + /** + * PaintImageData() enqueues a paint of the given image into the context. + * This function has no effect until you call Flush() As a result, what + * counts is the contents of the bitmap when you call Flush(), not when + * you call this function. + * + * The provided image will be placed at top_left from the top + * left of the context's internal backing store. Then the pixels contained + * in src_rect will be copied into the backing store. This + * means that the rectangle being painted will be at src_rect + * offset by top_left. + * + * The src_rect is specified in the coordinate system of the + * image being painted, not the context. For the common case of copying the + * entire image, you may specify an empty src_rect. + * + * The painted area of the source bitmap must fall entirely within the + * context. Attempting to paint outside of the context will result in an + * error. However, the source bitmap may fall outside the context, as long + * as the src_rect subset of it falls entirely within the + * context. + * + * There are two methods most modules will use for painting. The first + * method is to generate a new ImageData and then paint it. In + * this case, you'll set the location of your painting to + * top_left and set src_rect to NULL. + * The second is that you're generating small invalid regions out of a larger + * bitmap representing your entire instance. In this case, you would set the + * location of your image to (0,0) and then set src_rect to the + * pixels you changed. + * + * @param[in] resource The 2D Graphics resource. + * @param[in] image The ImageData to be painted. + * @param[in] top_left A Point representing the + * top_left location where the ImageData will be + * painted. + * @param[in] src_rect The rectangular area where the ImageData + * will be painted. + */ + void (*PaintImageData)(PP_Resource graphics_2d, + PP_Resource image_data, + const struct PP_Point* top_left, + const struct PP_Rect* src_rect); + /** + * Scroll() enqueues a scroll of the context's backing store. This + * function has no effect until you call Flush(). The data within the + * provided clipping rectangle will be shifted by (dx, dy) pixels. + * + * This function will result in some exposed region which will have undefined + * contents. The module should call PaintImageData() on these exposed regions + * to give the correct contents. + * + * The scroll can be larger than the area of the clipping rectangle, which + * means the current image will be scrolled out of the rectangle. This + * scenario is not an error but will result in a no-op. + * + * @param[in] graphics_2d The 2D Graphics resource. + * @param[in] clip The clipping rectangle. + * @param[in] amount The amount the area in the clipping rectangle will + * shifted. + */ + void (*Scroll)(PP_Resource graphics_2d, + const struct PP_Rect* clip_rect, + const struct PP_Point* amount); + /** + * ReplaceContents() provides a slightly more efficient way to paint the + * entire module's image. Normally, calling PaintImageData() requires that + * the browser copy the pixels out of the image and into the graphics + * context's backing store. This function replaces the graphics context's + * backing store with the given image, avoiding the copy. + * + * The new image must be the exact same size as this graphics context. If the + * new image uses a different image format than the browser's native bitmap + * format (use PPB_ImageData.GetNativeImageDataFormat() to + * retrieve the format), then a conversion will be done inside the browser + * which may slow the performance a little bit. + * + * Note: The new image will not be painted until you call + * Flush(). + * + * After this call, you should take care to release your references to the + * image. If you paint to the image after ReplaceContents(), there is the + * possibility of significant painting artifacts because the page might use + * partially-rendered data when copying out of the backing store. + * + * In the case of an animation, you will want to allocate a new image for the + * next frame. It is best if you wait until the flush callback has executed + * before allocating this bitmap. This gives the browser the option of + * caching the previous backing store and handing it back to you (assuming + * the sizes match). In the optimal case, this means no bitmaps are allocated + * during the animation, and the backing store and "front buffer" (which the + * plugin is painting into) are just being swapped back and forth. + * + * @param[in] graphics_2d The 2D Graphics resource. + * @param[in] image The ImageData to be painted. + */ + void (*ReplaceContents)(PP_Resource graphics_2d, PP_Resource image_data); + /** + * Flush() flushes any enqueued paint, scroll, and replace commands to the + * backing store. This function actually executes the updates, and causes a + * repaint of the webpage, assuming this graphics context is bound to a module + * instance. + * + * Flush() runs in asynchronous mode. Specify a callback function and the + * argument for that callback function. The callback function will be + * executed on the calling thread when the image has been painted to the + * screen. While you are waiting for a flush callback, additional calls to + * Flush() will fail. + * + * Because the callback is executed (or thread unblocked) only when the + * instance's image is actually on the screen, this function provides + * a way to rate limit animations. By waiting until the image is on the + * screen before painting the next frame, you can ensure you're not + * flushing 2D graphics faster than the screen can be updated. + * + * Unbound contexts + * If the context is not bound to a module instance, you will + * still get a callback. The callback will execute after Flush() returns + * to avoid reentrancy. The callback will not wait until anything is + * painted to the screen because there will be nothing on the screen. The + * timing of this callback is not guaranteed and may be deprioritized by + * the browser because it is not affecting the user experience. + * + * Off-screen instances + * If the context is bound to an instance that is currently not visible (for + * example, scrolled out of view) it will behave like the "unbound context" + * case. + * + * Detaching a context + * If you detach a context from a module instance, any pending flush + * callbacks will be converted into the "unbound context" case. + * + * Released contexts + * A callback may or may not get called even if you have released all + * of your references to the context. This scenario can occur if there are + * internal references to the context suggesting it has not been internally + * destroyed (for example, if it is still bound to an instance) or due to + * other implementation details. As a result, you should be careful to + * check that flush callbacks are for the context you expect and that + * you're capable of handling callbacks for unreferenced contexts. + * + * Shutdown + * If a module instance is removed when a flush is pending, the + * callback will not be executed. + * + * @param[in] graphics_2d The 2D Graphics resource. + * @param[in] callback A CompletionCallback to be called when + * the image has been painted on the screen. + * + * @return Returns PP_OK on success or + * PP_ERROR_BADRESOURCE if the graphics context is invalid, + * PP_ERROR_BADARGUMENT if the callback is null and flush is + * being called from the main thread of the module, or + * PP_ERROR_INPROGRESS if a flush is already pending that has + * not issued its callback yet. In the failure case, nothing will be updated + * and no callback will be scheduled. + */ + int32_t (*Flush)(PP_Resource graphics_2d, + struct PP_CompletionCallback callback); + /** + * SetScale() sets the scale factor that will be applied when painting the + * graphics context onto the output device. Typically, if rendering at device + * resolution is desired, the context would be created with the width and + * height scaled up by the view's GetDeviceScale and SetScale called with a + * scale of 1.0 / GetDeviceScale(). For example, if the view resource passed + * to DidChangeView has a rectangle of (w=200, h=100) and a device scale of + * 2.0, one would call Create with a size of (w=400, h=200) and then call + * SetScale with 0.5. One would then treat each pixel in the context as a + * single device pixel. + * + * @param[in] resource A Graphics2D context resource. + * @param[in] scale The scale to apply when painting. + * + * @return Returns PP_TRUE on success or PP_FALSE if + * the resource is invalid or the scale factor is 0 or less. + */ + PP_Bool (*SetScale)(PP_Resource resource, float scale); + /*** + * GetScale() gets the scale factor that will be applied when painting the + * graphics context onto the output device. + * + * @param[in] resource A Graphics2D context resource. + * + * @return Returns the scale factor for the graphics context. If the resource + * is not a valid Graphics2D context, this will return 0.0. + */ + float (*GetScale)(PP_Resource resource); + /** + * SetLayerTransform() sets a transformation factor that will be applied for + * the current graphics context displayed on the output device. If both + * SetScale and SetLayerTransform will be used, they are going to get combined + * for the final result. + * + * This function has no effect until you call Flush(). + * + * @param[in] scale The scale to be applied. + * @param[in] origin The origin of the scale. + * @param[in] translate The translation to be applied. + * + * @return Returns PP_TRUE on success or PP_FALSE + * if the resource is invalid or the scale factor is 0 or less. + */ + PP_Bool (*SetLayerTransform)(PP_Resource resource, + float scale, + const struct PP_Point* origin, + const struct PP_Point* translate); +}; + +typedef struct PPB_Graphics2D_1_2 PPB_Graphics2D; + +struct PPB_Graphics2D_1_0 { + PP_Resource (*Create)(PP_Instance instance, + const struct PP_Size* size, + PP_Bool is_always_opaque); + PP_Bool (*IsGraphics2D)(PP_Resource resource); + PP_Bool (*Describe)(PP_Resource graphics_2d, + struct PP_Size* size, + PP_Bool* is_always_opaque); + void (*PaintImageData)(PP_Resource graphics_2d, + PP_Resource image_data, + const struct PP_Point* top_left, + const struct PP_Rect* src_rect); + void (*Scroll)(PP_Resource graphics_2d, + const struct PP_Rect* clip_rect, + const struct PP_Point* amount); + void (*ReplaceContents)(PP_Resource graphics_2d, PP_Resource image_data); + int32_t (*Flush)(PP_Resource graphics_2d, + struct PP_CompletionCallback callback); +}; + +struct PPB_Graphics2D_1_1 { + PP_Resource (*Create)(PP_Instance instance, + const struct PP_Size* size, + PP_Bool is_always_opaque); + PP_Bool (*IsGraphics2D)(PP_Resource resource); + PP_Bool (*Describe)(PP_Resource graphics_2d, + struct PP_Size* size, + PP_Bool* is_always_opaque); + void (*PaintImageData)(PP_Resource graphics_2d, + PP_Resource image_data, + const struct PP_Point* top_left, + const struct PP_Rect* src_rect); + void (*Scroll)(PP_Resource graphics_2d, + const struct PP_Rect* clip_rect, + const struct PP_Point* amount); + void (*ReplaceContents)(PP_Resource graphics_2d, PP_Resource image_data); + int32_t (*Flush)(PP_Resource graphics_2d, + struct PP_CompletionCallback callback); + PP_Bool (*SetScale)(PP_Resource resource, float scale); + float (*GetScale)(PP_Resource resource); +}; +/** + * @} + */ + +/* ppb_graphics_3d.idl */ +/* Add 3D graphics enums */ +#include "ppapi/c/pp_graphics_3d.h" + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * PPB_Graphics3D defines the interface for a 3D graphics context. + * Example usage from plugin code: + * + * Setup: + * @code + * PP_Resource context; + * int32_t attribs[] = {PP_GRAPHICS3DATTRIB_WIDTH, 800, + * PP_GRAPHICS3DATTRIB_HEIGHT, 800, + * PP_GRAPHICS3DATTRIB_NONE}; + * context = g3d->Create(instance, 0, attribs); + * inst->BindGraphics(instance, context); + * @endcode + * + * Present one frame: + * @code + * PP_CompletionCallback callback = { + * DidFinishSwappingBuffers, 0, PP_COMPLETIONCALLBACK_FLAG_NONE, + * }; + * gles2->Clear(context, GL_COLOR_BUFFER_BIT); + * g3d->SwapBuffers(context, callback); + * @endcode + * + * Shutdown: + * @code + * core->ReleaseResource(context); + * @endcode + */ +struct PPB_Graphics3D_1_0 { + /** + * GetAttribMaxValue() retrieves the maximum supported value for the + * given attribute. This function may be used to check if a particular + * attribute value is supported before attempting to create a context. + * + * @param[in] instance The module instance. + * @param[in] attribute The attribute for which maximum value is queried. + * Attributes that can be queried for include: + * - PP_GRAPHICS3DATTRIB_ALPHA_SIZE + * - PP_GRAPHICS3DATTRIB_BLUE_SIZE + * - PP_GRAPHICS3DATTRIB_GREEN_SIZE + * - PP_GRAPHICS3DATTRIB_RED_SIZE + * - PP_GRAPHICS3DATTRIB_DEPTH_SIZE + * - PP_GRAPHICS3DATTRIB_STENCIL_SIZE + * - PP_GRAPHICS3DATTRIB_SAMPLES + * - PP_GRAPHICS3DATTRIB_SAMPLE_BUFFERS + * - PP_GRAPHICS3DATTRIB_WIDTH + * - PP_GRAPHICS3DATTRIB_HEIGHT + * @param[out] value The maximum supported value for attribute + * + * @return Returns PP_TRUE on success or the following on error: + * - PP_ERROR_BADRESOURCE if instance is invalid + * - PP_ERROR_BADARGUMENT if attribute is invalid + * or value is 0 + */ + int32_t (*GetAttribMaxValue)(PP_Resource instance, + int32_t attribute, + int32_t* value); + /** + * Create() creates and initializes a 3D rendering context. + * The returned context is off-screen to start with. It must be attached to + * a plugin instance using PPB_Instance::BindGraphics to draw + * on the web page. + * + * @param[in] instance The module instance. + * + * @param[in] share_context The 3D context with which the created context + * would share resources. If share_context is not 0, then all + * shareable data, as defined by the client API (note that for OpenGL and + * OpenGL ES, shareable data excludes texture objects named 0) will be shared + * by share_context, all other contexts share_context + * already shares with, and the newly created context. An arbitrary number of + * PPB_Graphics3D can share data in this fashion. + * + * @param[in] attrib_list specifies a list of attributes for the context. + * It is a list of attribute name-value pairs in which each attribute is + * immediately followed by the corresponding desired value. The list is + * terminated with PP_GRAPHICS3DATTRIB_NONE. + * The attrib_list may be 0 or empty (first attribute is + * PP_GRAPHICS3DATTRIB_NONE). If an attribute is not + * specified in attrib_list, then the default value is used + * (it is said to be specified implicitly). + * Attributes for the context are chosen according to an attribute-specific + * criteria. Attributes can be classified into two categories: + * - AtLeast: The attribute value in the returned context meets or exceeds + * the value specified in attrib_list. + * - Exact: The attribute value in the returned context is equal to + * the value specified in attrib_list. + * + * Attributes that can be specified in attrib_list include: + * - PP_GRAPHICS3DATTRIB_ALPHA_SIZE: + * Category: AtLeast Default: 0. + * - PP_GRAPHICS3DATTRIB_BLUE_SIZE: + * Category: AtLeast Default: 0. + * - PP_GRAPHICS3DATTRIB_GREEN_SIZE: + * Category: AtLeast Default: 0. + * - PP_GRAPHICS3DATTRIB_RED_SIZE: + * Category: AtLeast Default: 0. + * - PP_GRAPHICS3DATTRIB_DEPTH_SIZE: + * Category: AtLeast Default: 0. + * - PP_GRAPHICS3DATTRIB_STENCIL_SIZE: + * Category: AtLeast Default: 0. + * - PP_GRAPHICS3DATTRIB_SAMPLES: + * Category: AtLeast Default: 0. + * - PP_GRAPHICS3DATTRIB_SAMPLE_BUFFERS: + * Category: AtLeast Default: 0. + * - PP_GRAPHICS3DATTRIB_WIDTH: + * Category: Exact Default: 0. + * - PP_GRAPHICS3DATTRIB_HEIGHT: + * Category: Exact Default: 0. + * - PP_GRAPHICS3DATTRIB_SWAP_BEHAVIOR: + * Category: Exact Default: Implementation defined. + * + * @return A PP_Resource containing the 3D graphics context if + * successful or 0 if unsuccessful. + */ + PP_Resource (*Create)(PP_Instance instance, + PP_Resource share_context, + const int32_t attrib_list[]); + /** + * IsGraphics3D() determines if the given resource is a valid + * Graphics3D context. + * + * @param[in] resource A Graphics3D context resource. + * + * @return PP_TRUE if the given resource is a valid Graphics3D, + * PP_FALSE if it is an invalid resource or is a resource of + * another type. + */ + PP_Bool (*IsGraphics3D)(PP_Resource resource); + /** + * GetAttribs() retrieves the value for each attribute in + * attrib_list. + * + * @param[in] context The 3D graphics context. + * @param[in,out] attrib_list The list of attributes that are queried. + * attrib_list has the same structure as described for + * PPB_Graphics3D::Create. It is both input and output + * structure for this function. All attributes specified in + * PPB_Graphics3D::Create can be queried for. + * + * @return Returns PP_OK on success or: + * - PP_ERROR_BADRESOURCE if context is invalid + * - PP_ERROR_BADARGUMENT if attrib_list is 0 or any attribute + * in the attrib_list is not a valid attribute. + * + * Example usage: To get the values for rgb bits in the + * color buffer, this function must be called as following: + * @code + * int attrib_list[] = {PP_GRAPHICS3DATTRIB_RED_SIZE, 0, + * PP_GRAPHICS3DATTRIB_GREEN_SIZE, 0, + * PP_GRAPHICS3DATTRIB_BLUE_SIZE, 0, + * PP_GRAPHICS3DATTRIB_NONE}; + * GetAttribs(context, attrib_list); + * int red_bits = attrib_list[1]; + * int green_bits = attrib_list[3]; + * int blue_bits = attrib_list[5]; + * @endcode + */ + int32_t (*GetAttribs)(PP_Resource context, int32_t attrib_list[]); + /** + * SetAttribs() sets the values for each attribute in + * attrib_list. + * + * @param[in] context The 3D graphics context. + * @param[in] attrib_list The list of attributes whose values need to be set. + * attrib_list has the same structure as described for + * PPB_Graphics3D::Create. + * Attributes that can be specified are: + * - PP_GRAPHICS3DATTRIB_SWAP_BEHAVIOR + * + * @return Returns PP_OK on success or: + * - PP_ERROR_BADRESOURCE if context is invalid. + * - PP_ERROR_BADARGUMENT if attrib_list is 0 or + * any attribute in the attrib_list is not a valid attribute. + */ + int32_t (*SetAttribs)(PP_Resource context, const int32_t attrib_list[]); + /** + * GetError() returns the current state of the given 3D context. + * + * The recoverable error conditions that have no side effect are + * detected and returned immediately by all functions in this interface. + * In addition the implementation may get into a fatal state while + * processing a command. In this case the application must destroy the + * context and reinitialize client API state and objects to continue + * rendering. + * + * Note that the same error code is also returned in the SwapBuffers callback. + * It is recommended to handle error in the SwapBuffers callback because + * GetError is synchronous. This function may be useful in rare cases where + * drawing a frame is expensive and you want to verify the result of + * ResizeBuffers before attempting to draw a frame. + * + * @param[in] The 3D graphics context. + * @return Returns: + * - PP_OK if no error + * - PP_ERROR_NOMEMORY + * - PP_ERROR_CONTEXT_LOST + */ + int32_t (*GetError)(PP_Resource context); + /** + * ResizeBuffers() resizes the backing surface for context. + * + * If the surface could not be resized due to insufficient resources, + * PP_ERROR_NOMEMORY error is returned on the next + * SwapBuffers callback. + * + * @param[in] context The 3D graphics context. + * @param[in] width The width of the backing surface. + * @param[in] height The height of the backing surface. + * @return Returns PP_OK on success or: + * - PP_ERROR_BADRESOURCE if context is invalid. + * - PP_ERROR_BADARGUMENT if the value specified for + * width or height is less than zero. + */ + int32_t (*ResizeBuffers)(PP_Resource context, int32_t width, int32_t height); + /** + * SwapBuffers() makes the contents of the color buffer available for + * compositing. This function has no effect on off-screen surfaces - ones not + * bound to any plugin instance. The contents of ancillary buffers are always + * undefined after calling SwapBuffers. The contents of the color + * buffer are undefined if the value of the + * PP_GRAPHICS3DATTRIB_SWAP_BEHAVIOR attribute of context is not + * PP_GRAPHICS3DATTRIB_BUFFER_PRESERVED. + * + * SwapBuffers runs in asynchronous mode. Specify a callback + * function and the argument for that callback function. The callback function + * will be executed on the calling thread after the color buffer has been + * composited with rest of the html page. While you are waiting for a + * SwapBuffers callback, additional calls to SwapBuffers will fail. + * + * Because the callback is executed (or thread unblocked) only when the + * plugin's current state is actually on the screen, this function provides a + * way to rate limit animations. By waiting until the image is on the screen + * before painting the next frame, you can ensure you're not generating + * updates faster than the screen can be updated. + * + * SwapBuffers performs an implicit flush operation on context. + * If the context gets into an unrecoverable error condition while + * processing a command, the error code will be returned as the argument + * for the callback. The callback may return the following error codes: + * - PP_ERROR_NOMEMORY + * - PP_ERROR_CONTEXT_LOST + * Note that the same error code may also be obtained by calling GetError. + * + * @param[in] context The 3D graphics context. + * @param[in] callback The callback that will executed when + * SwapBuffers completes. + * + * @return Returns PP_OK on success or: + * - PP_ERROR_BADRESOURCE if context is invalid. + * - PP_ERROR_BADARGUMENT if callback is invalid. + * + */ + int32_t (*SwapBuffers)(PP_Resource context, + struct PP_CompletionCallback callback); +}; + +typedef struct PPB_Graphics3D_1_0 PPB_Graphics3D; +/** + * @} + */ + +/* ppb_net_address.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * Network address family types. + */ +typedef enum { + /** + * The address family is unspecified. + */ + PP_NETADDRESS_FAMILY_UNSPECIFIED = 0, + /** + * The Internet Protocol version 4 (IPv4) address family. + */ + PP_NETADDRESS_FAMILY_IPV4 = 1, + /** + * The Internet Protocol version 6 (IPv6) address family. + */ + PP_NETADDRESS_FAMILY_IPV6 = 2 +} PP_NetAddress_Family; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_NetAddress_Family, 4); +/** + * @} + */ + +/** + * @addtogroup Structs + * @{ + */ +/** + * All members are expressed in network byte order. + */ +struct PP_NetAddress_IPv4 { + /** + * Port number. + */ + uint16_t port; + /** + * IPv4 address. + */ + uint8_t addr[4]; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_NetAddress_IPv4, 6); + +/** + * All members are expressed in network byte order. + */ +struct PP_NetAddress_IPv6 { + /** + * Port number. + */ + uint16_t port; + /** + * IPv6 address. + */ + uint8_t addr[16]; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_NetAddress_IPv6, 18); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_NetAddress interface provides operations on network + * addresses. + */ +struct PPB_NetAddress_1_0 { + /** + * Creates a PPB_NetAddress resource with the specified IPv4 + * address. + * + * @param[in] instance A PP_Instance identifying one instance of + * a module. + * @param[in] ipv4_addr An IPv4 address. + * + * @return A PP_Resource representing the same address as + * ipv4_addr or 0 on failure. + */ + PP_Resource (*CreateFromIPv4Address)( + PP_Instance instance, + const struct PP_NetAddress_IPv4* ipv4_addr); + /** + * Creates a PPB_NetAddress resource with the specified IPv6 + * address. + * + * @param[in] instance A PP_Instance identifying one instance of + * a module. + * @param[in] ipv6_addr An IPv6 address. + * + * @return A PP_Resource representing the same address as + * ipv6_addr or 0 on failure. + */ + PP_Resource (*CreateFromIPv6Address)( + PP_Instance instance, + const struct PP_NetAddress_IPv6* ipv6_addr); + /** + * Determines if a given resource is a network address. + * + * @param[in] resource A PP_Resource to check. + * + * @return PP_TRUE if the input is a PPB_NetAddress + * resource; PP_FALSE otherwise. + */ + PP_Bool (*IsNetAddress)(PP_Resource resource); + /** + * Gets the address family. + * + * @param[in] addr A PP_Resource corresponding to a network + * address. + * + * @return The address family on success; + * PP_NETADDRESS_FAMILY_UNSPECIFIED on failure. + */ + PP_NetAddress_Family (*GetFamily)(PP_Resource addr); + /** + * Returns a human-readable description of the network address. The + * description is in the form of host [ ":" port ] and conforms to + * http://tools.ietf.org/html/rfc3986#section-3.2 for IPv4 and IPv6 addresses + * (e.g., "192.168.0.1", "192.168.0.1:99", or "[::1]:80"). + * + * @param[in] addr A PP_Resource corresponding to a network + * address. + * @param[in] include_port Whether to include the port number in the + * description. + * + * @return A string PP_Var on success; an undefined + * PP_Var on failure. + */ + struct PP_Var (*DescribeAsString)(PP_Resource addr, PP_Bool include_port); + /** + * Fills a PP_NetAddress_IPv4 structure if the network address is + * of PP_NETADDRESS_FAMILY_IPV4 address family. + * Note that passing a network address of + * PP_NETADDRESS_FAMILY_IPV6 address family will fail even if the + * address is an IPv4-mapped IPv6 address. + * + * @param[in] addr A PP_Resource corresponding to a network + * address. + * @param[out] ipv4_addr A PP_NetAddress_IPv4 structure to store + * the result. + * + * @return A PP_Bool value indicating whether the operation + * succeeded. + */ + PP_Bool (*DescribeAsIPv4Address)(PP_Resource addr, + struct PP_NetAddress_IPv4* ipv4_addr); + /** + * Fills a PP_NetAddress_IPv6 structure if the network address is + * of PP_NETADDRESS_FAMILY_IPV6 address family. + * Note that passing a network address of + * PP_NETADDRESS_FAMILY_IPV4 address family will fail - this + * method doesn't map it to an IPv6 address. + * + * @param[in] addr A PP_Resource corresponding to a network + * address. + * @param[out] ipv6_addr A PP_NetAddress_IPv6 structure to store + * the result. + * + * @return A PP_Bool value indicating whether the operation + * succeeded. + */ + PP_Bool (*DescribeAsIPv6Address)(PP_Resource addr, + struct PP_NetAddress_IPv6* ipv6_addr); +}; + +typedef struct PPB_NetAddress_1_0 PPB_NetAddress; +/** + * @} + */ + +/* ppb_host_resolver.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * PP_HostResolver_Flag is an enumeration of flags which can be + * OR-ed and passed to the host resolver. Currently there is only one flag + * defined. + */ +typedef enum { + /** + * Hint to request the canonical name of the host, which can be retrieved by + * GetCanonicalName(). + */ + PP_HOSTRESOLVER_FLAG_CANONNAME = 1 << 0 +} PP_HostResolver_Flag; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_HostResolver_Flag, 4); +/** + * @} + */ + +/** + * @addtogroup Structs + * @{ + */ +/** + * PP_HostResolver_Hint represents hints for host resolution. + */ +struct PP_HostResolver_Hint { + /** + * Network address family. + */ + PP_NetAddress_Family family; + /** + * Combination of flags from PP_HostResolver_Flag. + */ + int32_t flags; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_HostResolver_Hint, 8); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_HostResolver interface supports host name + * resolution. + * + * Permissions: In order to run Resolve(), apps permission + * socket with subrule resolve-host is required. + * For more details about network communication permissions, please see: + * http://developer.chrome.com/apps/app_network.html + */ +struct PPB_HostResolver_1_0 { + /** + * Creates a host resolver resource. + * + * @param[in] instance A PP_Instance identifying one instance of + * a module. + * + * @return A PP_Resource corresponding to a host reslover or 0 + * on failure. + */ + PP_Resource (*Create)(PP_Instance instance); + /** + * Determines if a given resource is a host resolver. + * + * @param[in] resource A PP_Resource to check. + * + * @return PP_TRUE if the input is a + * PPB_HostResolver resource; PP_FALSE otherwise. + */ + PP_Bool (*IsHostResolver)(PP_Resource resource); + /** + * Requests resolution of a host name. If the call completes successfully, the + * results can be retrieved by GetCanonicalName(), + * GetNetAddressCount() and GetNetAddress(). + * + * @param[in] host_resolver A PP_Resource corresponding to a host + * resolver. + * @param[in] host The host name (or IP address literal) to resolve. + * @param[in] port The port number to be set in the resulting network + * addresses. + * @param[in] hint A PP_HostResolver_Hint structure providing + * hints for host resolution. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * PP_ERROR_NOACCESS will be returned if the caller doesn't have + * required permissions. PP_ERROR_NAME_NOT_RESOLVED will be + * returned if the host name couldn't be resolved. + */ + int32_t (*Resolve)(PP_Resource host_resolver, + const char* host, + uint16_t port, + const struct PP_HostResolver_Hint* hint, + struct PP_CompletionCallback callback); + /** + * Gets the canonical name of the host. + * + * @param[in] host_resolver A PP_Resource corresponding to a host + * resolver. + * + * @return A string PP_Var on success, which is an empty string + * if PP_HOSTRESOLVER_FLAG_CANONNAME is not set in the hint flags + * when calling Resolve(); an undefined PP_Var if + * there is a pending Resolve() call or the previous + * Resolve() call failed. + */ + struct PP_Var (*GetCanonicalName)(PP_Resource host_resolver); + /** + * Gets the number of network addresses. + * + * @param[in] host_resolver A PP_Resource corresponding to a host + * resolver. + * + * @return The number of available network addresses on success; 0 if there is + * a pending Resolve() call or the previous + * Resolve() call failed. + */ + uint32_t (*GetNetAddressCount)(PP_Resource host_resolver); + /** + * Gets a network address. + * + * @param[in] host_resolver A PP_Resource corresponding to a host + * resolver. + * @param[in] index An index indicating which address to return. + * + * @return A PPB_NetAddress resource on success; 0 if there is a + * pending Resolve() call or the previous Resolve() + * call failed, or the specified index is out of range. + */ + PP_Resource (*GetNetAddress)(PP_Resource host_resolver, uint32_t index); +}; + +typedef struct PPB_HostResolver_1_0 PPB_HostResolver; +/** + * @} + */ + +/* ppb_image_data.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * PP_ImageDataFormat is an enumeration of the different types of + * image data formats. + * + * The third part of each enumeration value describes the memory layout from + * the lowest address to the highest. For example, BGRA means the B component + * is stored in the lowest address, no matter what endianness the platform is + * using. + * + * The PREMUL suffix implies pre-multiplied alpha is used. In this mode, the + * red, green and blue color components of the pixel data supplied to an image + * data should be pre-multiplied by their alpha value. For example: starting + * with floating point color components, here is how to convert them to 8-bit + * premultiplied components for image data: + * + * ...components of a pixel, floats ranging from 0 to 1... + * float red = 1.0f; + * float green = 0.50f; + * float blue = 0.0f; + * float alpha = 0.75f; + * ...components for image data are 8-bit values ranging from 0 to 255... + * uint8_t image_data_red_premul = (uint8_t)(red * alpha * 255.0f); + * + * uint8_t image_data_green_premul = (uint8_t)(green * alpha * 255.0f); + * + * uint8_t image_data_blue_premul = (uint8_t)(blue * alpha * 255.0f); + * + * uint8_t image_data_alpha_premul = (uint8_t)(alpha * 255.0f); + * + * Note: The resulting pre-multiplied red, green and blue + * components should not be greater than the alpha value. + */ +typedef enum { + PP_IMAGEDATAFORMAT_BGRA_PREMUL, + PP_IMAGEDATAFORMAT_RGBA_PREMUL +} PP_ImageDataFormat; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_ImageDataFormat, 4); +/** + * @} + */ + +/** + * @addtogroup Structs + * @{ + */ +/** + * The PP_ImageDataDesc structure represents a description of + * image data. + */ +struct PP_ImageDataDesc { + /** + * This value represents one of the image data types in the + * PP_ImageDataFormat enum. + */ + PP_ImageDataFormat format; + /** This value represents the size of the bitmap in pixels. */ + struct PP_Size size; + /** + * This value represents the row width in bytes. This may be different than + * width * 4 since there may be padding at the end of the lines. + */ + int32_t stride; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_ImageDataDesc, 16); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_ImageData interface contains pointers to several + * functions for determining the browser's treatment of image data. + */ +struct PPB_ImageData_1_0 { + /** + * GetNativeImageDataFormat() returns the browser's preferred format for + * image data. The browser uses this format internally for painting. Other + * formats may require internal conversions to paint or may have additional + * restrictions depending on the function. + * + * @return A PP_ImageDataFormat containing the preferred format. + */ + PP_ImageDataFormat (*GetNativeImageDataFormat)(void); + /** + * IsImageDataFormatSupported() determines if the given image data format is + * supported by the browser. Note: PP_IMAGEDATAFORMAT_BGRA_PREMUL + * and PP_IMAGEDATAFORMAT_RGBA_PREMUL formats are always + * supported. Other image formats do not make this guarantee, and should be + * checked first with IsImageDataFormatSupported() before using. + * + * @param[in] format The image data format. + * + * @return A PP_Bool with PP_TRUE if the given + * image data format is supported by the browser. + */ + PP_Bool (*IsImageDataFormatSupported)(PP_ImageDataFormat format); + /** + * Create() allocates an image data resource with the given format and size. + * + * For security reasons, if uninitialized, the bitmap will not contain random + * memory, but may contain data from a previous image produced by the same + * module if the bitmap was cached and re-used. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * @param[in] format The desired image data format. + * @param[in] size A pointer to a PP_Size containing the image + * size. + * @param[in] init_to_zero A PP_Bool to determine transparency + * at creation. + * Set the init_to_zero flag if you want the bitmap initialized + * to transparent during the creation process. If this flag is not set, the + * current contents of the bitmap will be undefined, and the module should + * be sure to set all the pixels. + * + * @return A PP_Resource with a nonzero ID on success or zero on + * failure. Failure means the instance, image size, or format was invalid. + */ + PP_Resource (*Create)(PP_Instance instance, + PP_ImageDataFormat format, + const struct PP_Size* size, + PP_Bool init_to_zero); + /** + * IsImageData() determines if a given resource is image data. + * + * @param[in] image_data A PP_Resource corresponding to image + * data. + * + * @return A PP_Bool with PP_TRUE if the given + * resource is an image data or PP_FALSE if the resource is + * invalid or some type other than image data. + */ + PP_Bool (*IsImageData)(PP_Resource image_data); + /** + * Describe() computes the description of the + * image data. + * + * @param[in] image_data A PP_Resource corresponding to image + * data. + * @param[in,out] desc A pointer to a PP_ImageDataDesc + * containing the description. + * + * @return A PP_Bool with PP_TRUE on success or + * PP_FALSE if the resource is not an image data. On + * PP_FALSE, the desc structure will be filled + * with 0. + */ + PP_Bool (*Describe)(PP_Resource image_data, struct PP_ImageDataDesc* desc); + /** + * Map() maps an image data into the module address space. + * + * @param[in] image_data A PP_Resource corresponding to image + * data. + * + * @return A pointer to the beginning of the data. + */ + void* (*Map)(PP_Resource image_data); + /** + * Unmap is a pointer to a function that unmaps an image data from the module + * address space. + * + * @param[in] image_data A PP_Resource corresponding to image + * data. + */ + void (*Unmap)(PP_Resource image_data); +}; + +typedef struct PPB_ImageData_1_0 PPB_ImageData; +/** + * @} + */ + +/* ppb_instance.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_Instance interface contains pointers to functions + * related to the module instance on a web page. + */ +struct PPB_Instance_1_0 { + /** + * BindGraphics() binds the given graphics as the current display surface. + * The contents of this device is what will be displayed in the instance's + * area on the web page. The device must be a 2D or a 3D device. + * + * You can pass a NULL resource as the device parameter to + * unbind all devices from the given instance. The instance will then appear + * transparent. Re-binding the same device will return PP_TRUE + * and will do nothing. + * + * Any previously-bound device will be released. It is an error to bind + * a device when it is already bound to another instance. If you want + * to move a device between instances, first unbind it from the old one, and + * then rebind it to the new one. + * + * Binding a device will invalidate that portion of the web page to flush the + * contents of the new device to the screen. + * + * @param[in] instance A PP_Instance identifying one instance of a module. + * @param[in] device A PP_Resource corresponding to a graphics device. + * + * @return PP_Bool containing PP_TRUE if bind was + * successful or PP_FALSE if the device was not the correct + * type. On success, a reference to the device will be held by the + * instance, so the caller can release its reference if it chooses. + */ + PP_Bool (*BindGraphics)(PP_Instance instance, PP_Resource device); + /** + * IsFullFrame() determines if the instance is full-frame. Such an instance + * represents the entire document in a frame rather than an embedded + * resource. This can happen if the user does a top-level navigation or the + * page specifies an iframe to a resource with a MIME type registered by the + * module. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * + * @return A PP_Bool containing PP_TRUE if the + * instance is full-frame. + */ + PP_Bool (*IsFullFrame)(PP_Instance instance); +}; + +typedef struct PPB_Instance_1_0 PPB_Instance; +/** + * @} + */ + +/* ppb_media_stream_audio_track.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * This enumeration contains audio track attributes which are used by + * Configure(). + */ +typedef enum { + /** + * Attribute list terminator. + */ + PP_MEDIASTREAMAUDIOTRACK_ATTRIB_NONE = 0, + /** + * The maximum number of buffers to hold audio samples. + * Note: this is only used as advisory; the browser may allocate more or fewer + * based on available resources. How many buffers depends on usage - + * request at least 2 to make sure latency doesn't cause lost samples. If + * the plugin expects to hold on to more than one buffer at a time (e.g. to do + * multi-buffer processing), it should request that many more. + */ + PP_MEDIASTREAMAUDIOTRACK_ATTRIB_BUFFERS = 1, + /** + * The sample rate of audio data in buffers. The attribute value is a + * PP_AudioBuffer_SampleRate. + */ + PP_MEDIASTREAMAUDIOTRACK_ATTRIB_SAMPLE_RATE = 2, + /** + * The sample size of audio data in buffers in bytes. The attribute value is a + * PP_AudioBuffer_SampleSize. + */ + PP_MEDIASTREAMAUDIOTRACK_ATTRIB_SAMPLE_SIZE = 3, + /** + * The number of channels in audio buffers. + * + * Supported values: 1, 2 + */ + PP_MEDIASTREAMAUDIOTRACK_ATTRIB_CHANNELS = 4, + /** + * The duration of an audio buffer in milliseconds. + * + * Valid range: 10 to 10000 + */ + PP_MEDIASTREAMAUDIOTRACK_ATTRIB_DURATION = 5 +} PP_MediaStreamAudioTrack_Attrib; +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_MediaStreamAudioTrack_0_1 { + /** + * Determines if a resource is a MediaStream audio track resource. + * + * @param[in] resource The PP_Resource to test. + * + * @return A PP_Bool with PP_TRUE if the given + * resource is a Mediastream audio track resource or PP_FALSE + * otherwise. + */ + PP_Bool (*IsMediaStreamAudioTrack)(PP_Resource resource); + /** + * Configures underlying buffers for incoming audio samples. + * If the application doesn't want to drop samples, then the + * PP_MEDIASTREAMAUDIOTRACK_ATTRIB_BUFFERS should be + * chosen such that inter-buffer processing time variability won't overrun all + * the input buffers. If all buffers are filled, then samples will be + * dropped. The application can detect this by examining the timestamp on + * returned buffers. If Configure() is not called, default + * settings will be used. Calls to Configure while the plugin holds + * buffers will fail. + * Example usage from plugin code: + * @code + * int32_t attribs[] = { + * PP_MEDIASTREAMAUDIOTRACK_ATTRIB_BUFFERS, 4, + * PP_MEDIASTREAMAUDIOTRACK_ATTRIB_DURATION, 10, + * PP_MEDIASTREAMAUDIOTRACK_ATTRIB_NONE}; + * track_if->Configure(track, attribs, callback); + * @endcode + * + * @param[in] audio_track A PP_Resource corresponding to an audio + * resource. + * @param[in] attrib_list A list of attribute name-value pairs in which each + * attribute is immediately followed by the corresponding desired value. + * The list is terminated by + * PP_MEDIASTREAMAUDIOTRACK_ATTRIB_NONE. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Configure(). + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t (*Configure)(PP_Resource audio_track, + const int32_t attrib_list[], + struct PP_CompletionCallback callback); + /** + * Gets attribute value for a given attribute name. + * + * @param[in] audio_track A PP_Resource corresponding to an audio + * resource. + * @param[in] attrib A PP_MediaStreamAudioTrack_Attrib for + * querying. + * @param[out] value A int32_t for storing the attribute value on success. + * Otherwise, the value will not be changed. + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t (*GetAttrib)(PP_Resource audio_track, + PP_MediaStreamAudioTrack_Attrib attrib, + int32_t* value); + /** + * Returns the track ID of the underlying MediaStream audio track. + * + * @param[in] audio_track The PP_Resource to check. + * + * @return A PP_Var containing the MediaStream track ID as + * a string. + */ + struct PP_Var (*GetId)(PP_Resource audio_track); + /** + * Checks whether the underlying MediaStream track has ended. + * Calls to GetBuffer while the track has ended are safe to make and will + * complete, but will fail. + * + * @param[in] audio_track The PP_Resource to check. + * + * @return A PP_Bool with PP_TRUE if the given + * MediaStream track has ended or PP_FALSE otherwise. + */ + PP_Bool (*HasEnded)(PP_Resource audio_track); + /** + * Gets the next audio buffer from the MediaStream track. + * If internal processing is slower than the incoming buffer rate, new buffers + * will be dropped from the incoming stream. Once all buffers are full, + * audio samples will be dropped until RecycleBuffer() is called + * to free a slot for another buffer. + * If there are no audio data in the input buffer, + * PP_OK_COMPLETIONPENDING will be returned immediately and the + * callback will be called, when a new buffer of audio samples + * is received or an error happens. + * + * @param[in] audio_track A PP_Resource corresponding to an audio + * resource. + * @param[out] buffer A PP_Resource corresponding to + * an AudioBuffer resource. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of GetBuffer(). + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t (*GetBuffer)(PP_Resource audio_track, + PP_Resource* buffer, + struct PP_CompletionCallback callback); + /** + * Recycles a buffer returned by GetBuffer(), so the track can + * reuse the buffer. And the buffer will become invalid. The caller should + * release all references it holds to buffer and not use it + * anymore. + * + * @param[in] audio_track A PP_Resource corresponding to an audio + * resource. + * @param[in] buffer A PP_Resource corresponding to + * an AudioBuffer resource returned by GetBuffer(). + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t (*RecycleBuffer)(PP_Resource audio_track, PP_Resource buffer); + /** + * Closes the MediaStream audio track and disconnects it from the audio + * source. After calling Close(), no new buffers will be + * received. + * + * @param[in] audio_track A PP_Resource corresponding to a + * MediaStream audio track resource. + */ + void (*Close)(PP_Resource audio_track); +}; + +typedef struct PPB_MediaStreamAudioTrack_0_1 PPB_MediaStreamAudioTrack; +/** + * @} + */ + +/* ppb_media_stream_video_track.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * This enumeration contains video track attributes which are used by + * Configure(). + */ +typedef enum { + /** + * Attribute list terminator. + */ + PP_MEDIASTREAMVIDEOTRACK_ATTRIB_NONE = 0, + /** + * The maximum number of frames to hold in the input buffer. + * Note: this is only used as advisory; the browser may allocate more or fewer + * based on available resources. How many frames to buffer depends on usage - + * request at least 2 to make sure latency doesn't cause lost frames. If + * the plugin expects to hold on to more than one frame at a time (e.g. to do + * multi-frame processing), it should request that many more. + * If this attribute is not specified or value 0 is specified for this + * attribute, the default value will be used. + */ + PP_MEDIASTREAMVIDEOTRACK_ATTRIB_BUFFERED_FRAMES = 1, + /** + * The width of video frames in pixels. It should be a multiple of 4. + * If the specified size is different from the video source (webcam), + * frames will be scaled to specified size. + * If this attribute is not specified or value 0 is specified, the original + * frame size of the video track will be used. + * + * Maximum value: 4096 (4K resolution). + */ + PP_MEDIASTREAMVIDEOTRACK_ATTRIB_WIDTH = 2, + /** + * The height of video frames in pixels. It should be a multiple of 4. + * If the specified size is different from the video source (webcam), + * frames will be scaled to specified size. + * If this attribute is not specified or value 0 is specified, the original + * frame size of the video track will be used. + * + * Maximum value: 4096 (4K resolution). + */ + PP_MEDIASTREAMVIDEOTRACK_ATTRIB_HEIGHT = 3, + /** + * The format of video frames. The attribute value is + * a PP_VideoFrame_Format. If the specified format is different + * from the video source (webcam), frames will be converted to specified + * format. + * If this attribute is not specified or value + * PP_VIDEOFRAME_FORMAT_UNKNOWN is specified, the orignal frame + * format of the video track will be used. + */ + PP_MEDIASTREAMVIDEOTRACK_ATTRIB_FORMAT = 4 +} PP_MediaStreamVideoTrack_Attrib; +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_MediaStreamVideoTrack_1_0 { /* dev */ + /** + * Creates a PPB_MediaStreamVideoTrack resource for video output. Call this + * when you will be creating frames and putting them to the track. + * + * @param[in] instance A PP_Instance identifying one instance of + * a module. + * + * @return A PP_Resource corresponding to a + * PPB_MediaStreamVideoTrack resource if successful, 0 if failed. + */ + PP_Resource (*Create)(PP_Instance instance); + /** + * Determines if a resource is a MediaStream video track resource. + * + * @param[in] resource The PP_Resource to test. + * + * @return A PP_Bool with PP_TRUE if the given + * resource is a Mediastream video track resource or PP_FALSE + * otherwise. + */ + PP_Bool (*IsMediaStreamVideoTrack)(PP_Resource resource); + /** + * Configures underlying frame buffers for incoming frames. + * If the application doesn't want to drop frames, then the + * PP_MEDIASTREAMVIDEOTRACK_ATTRIB_BUFFERED_FRAMES should be + * chosen such that inter-frame processing time variability won't overrun the + * input buffer. If the buffer is overfilled, then frames will be dropped. + * The application can detect this by examining the timestamp on returned + * frames. If some attributes are not specified, default values will be used + * for those unspecified attributes. If Configure() is not + * called, default settings will be used. + * Example usage from plugin code: + * @code + * int32_t attribs[] = { + * PP_MEDIASTREAMVIDEOTRACK_ATTRIB_BUFFERED_FRAMES, 4, + * PP_MEDIASTREAMVIDEOTRACK_ATTRIB_NONE}; + * track_if->Configure(track, attribs, callback); + * @endcode + * + * @param[in] video_track A PP_Resource corresponding to a video + * resource. + * @param[in] attrib_list A list of attribute name-value pairs in which each + * attribute is immediately followed by the corresponding desired value. + * The list is terminated by + * PP_MEDIASTREAMVIDEOTRACK_ATTRIB_NONE. + * @param[in] callback PP_CompletionCallback to be called upon + * completion of Configure(). + * + * @return An int32_t containing a result code from pp_errors.h. + * Returns PP_ERROR_INPROGRESS if there is a pending call of + * Configure() or GetFrame(), or the plugin + * holds some frames which are not recycled with RecycleFrame(). + * If an error is returned, all attributes and the underlying buffer will not + * be changed. + */ + int32_t (*Configure)(PP_Resource video_track, + const int32_t attrib_list[], + struct PP_CompletionCallback callback); + /** + * Gets attribute value for a given attribute name. + * + * @param[in] video_track A PP_Resource corresponding to a video + * resource. + * @param[in] attrib A PP_MediaStreamVideoTrack_Attrib for + * querying. + * @param[out] value A int32_t for storing the attribute value on success. + * Otherwise, the value will not be changed. + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t (*GetAttrib)(PP_Resource video_track, + PP_MediaStreamVideoTrack_Attrib attrib, + int32_t* value); + /** + * Returns the track ID of the underlying MediaStream video track. + * + * @param[in] video_track The PP_Resource to check. + * + * @return A PP_Var containing the MediaStream track ID as + * a string. + */ + struct PP_Var (*GetId)(PP_Resource video_track); + /** + * Checks whether the underlying MediaStream track has ended. + * Calls to GetFrame while the track has ended are safe to make and will + * complete, but will fail. + * + * @param[in] video_track The PP_Resource to check. + * + * @return A PP_Bool with PP_TRUE if the given + * MediaStream track has ended or PP_FALSE otherwise. + */ + PP_Bool (*HasEnded)(PP_Resource video_track); + /** + * Gets the next video frame from the MediaStream track. + * If internal processing is slower than the incoming frame rate, new frames + * will be dropped from the incoming stream. Once the input buffer is full, + * frames will be dropped until RecycleFrame() is called to free + * a spot for another frame to be buffered. + * If there are no frames in the input buffer, + * PP_OK_COMPLETIONPENDING will be returned immediately and the + * callback will be called when a new frame is received or an + * error happens. + * + * @param[in] video_track A PP_Resource corresponding to a video + * resource. + * @param[out] frame A PP_Resource corresponding to a VideoFrame + * resource. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of GetFrame(). + * + * @return An int32_t containing a result code from pp_errors.h. + * Returns PP_ERROR_NOMEMORY if max_buffered_frames frames buffer + * was not allocated successfully. + */ + int32_t (*GetFrame)(PP_Resource video_track, + PP_Resource* frame, + struct PP_CompletionCallback callback); + /** + * Recycles a frame returned by GetFrame(), so the track can + * reuse the underlying buffer of this frame. And the frame will become + * invalid. The caller should release all references it holds to + * frame and not use it anymore. + * + * @param[in] video_track A PP_Resource corresponding to a video + * resource. + * @param[in] frame A PP_Resource corresponding to a VideoFrame + * resource returned by GetFrame(). + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t (*RecycleFrame)(PP_Resource video_track, PP_Resource frame); + /** + * Closes the MediaStream video track and disconnects it from video source. + * After calling Close(), no new frames will be received. + * + * @param[in] video_track A PP_Resource corresponding to a + * MediaStream video track resource. + */ + void (*Close)(PP_Resource video_track); + /** + * Gets a free frame for output. The frame is allocated by + * Configure(). The caller should fill it with frame data, and + * then use |PutFrame()| to send the frame back. + */ + int32_t (*GetEmptyFrame)(PP_Resource video_track, + PP_Resource* frame, + struct PP_CompletionCallback callback); + /** + * Sends a frame returned by |GetEmptyFrame()| to the output track. + * After this function, the |frame| should not be used anymore and the + * caller should release the reference that it holds. + */ + int32_t (*PutFrame)(PP_Resource video_track, PP_Resource frame); +}; + +struct PPB_MediaStreamVideoTrack_0_1 { + PP_Bool (*IsMediaStreamVideoTrack)(PP_Resource resource); + int32_t (*Configure)(PP_Resource video_track, + const int32_t attrib_list[], + struct PP_CompletionCallback callback); + int32_t (*GetAttrib)(PP_Resource video_track, + PP_MediaStreamVideoTrack_Attrib attrib, + int32_t* value); + struct PP_Var (*GetId)(PP_Resource video_track); + PP_Bool (*HasEnded)(PP_Resource video_track); + int32_t (*GetFrame)(PP_Resource video_track, + PP_Resource* frame, + struct PP_CompletionCallback callback); + int32_t (*RecycleFrame)(PP_Resource video_track, PP_Resource frame); + void (*Close)(PP_Resource video_track); +}; + +typedef struct PPB_MediaStreamVideoTrack_0_1 PPB_MediaStreamVideoTrack; +/** + * @} + */ + +/* ppb_message_loop.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * A message loop allows PPAPI calls to be issued on a thread. You may not + * issue any API calls on a thread without creating a message loop. It also + * allows you to post work to the message loop for a thread. + * + * To process work posted to the message loop, as well as completion callbacks + * for asynchronous operations, you must run the message loop via Run(). + * + * Note the system manages the lifetime of the instance (and all associated + * resources). If the instance is deleted from the page, background threads may + * suddenly see their PP_Resource handles become invalid. In this case, calls + * will fail with PP_ERROR_BADRESOURCE. If you need to access data associated + * with your instance, you will probably want to create some kind of threadsafe + * proxy object that can handle asynchronous destruction of the instance object. + * + * Typical usage: + * On the main thread: + * - Create the thread yourself (using pthreads). + * - Create the message loop resource. + * - Pass the message loop resource to your thread's main function. + * - Call PostWork() on the message loop to run functions on the thread. + * + * From the background thread's main function: + * - Call AttachToCurrentThread() with the message loop resource. + * - Call Run() with the message loop resource. + * + * Your callbacks should look like this: + * @code + * void DoMyWork(void* user_data, int32_t status) { + * if (status != PP_OK) { + * Cleanup(); // e.g. free user_data. + * return; + * } + * ... do your work... + * } + * @endcode + * For a C++ example, see ppapi/utility/threading/simple_thread.h + * + * (You can also create the message loop resource on the background thread, + * but then the main thread will have no reference to it should you want to + * call PostWork()). + * + * + * THREAD HANDLING + * + * The main thread has an implicitly created message loop. The main thread is + * the thread where PPP_InitializeModule and PPP_Instance functions are called. + * You can retrieve a reference to this message loop by calling + * GetForMainThread() or, if your code is on the main thread, GetCurrent() will + * also work. + * + * Some special threads created by the system can not have message loops. In + * particular, the background thread created for audio processing has this + * requirement because it's intended to be highly responsive to keep up with + * the realtime requirements of audio processing. You can not make PPAPI calls + * from these threads. + * + * Once you associate a message loop with a thread, you don't have to keep a + * reference to it. The system will hold a reference to the message loop for as + * long as the thread is running. The current message loop can be retrieved + * using the GetCurrent() function. + * + * It is legal to create threads in your plugin without message loops, but + * PPAPI calls will fail unless explicitly noted in the documentation. + * + * You can create a message loop object on a thread and never actually run the + * message loop. This will allow you to call blocking PPAPI calls (via + * PP_BlockUntilComplete()). If you make any asynchronous calls, the callbacks + * from those calls will be queued in the message loop and never run. The same + * thing will happen if work is scheduled after the message loop exits and + * the message loop is not run again. + * + * + * DESTRUCTION AND ERROR HANDLING + * + * Often, your application will associate memory with completion callbacks. For + * example, the C++ CompletionCallbackFactory has a small amount of + * heap-allocated memory for each callback. This memory will be leaked if the + * callback is never run. To avoid this memory leak, you need to be careful + * about error handling and shutdown. + * + * There are a number of cases where posted callbacks will never be run: + * + * - You tear down the thread (via pthreads) without "destroying" the message + * loop (via PostQuit with should_destroy = PP_TRUE). In this case, any + * tasks in the message queue will be lost. + * + * - You create a message loop, post callbacks to it, and never run it. + * + * - You quit the message loop via PostQuit with should_destroy set to + * PP_FALSE. In this case, the system will assume the message loop will be + * run again later and keep your tasks. + * + * To do proper shutdown, call PostQuit with should_destroy = PP_TRUE. This + * will prohibit future work from being posted, and will allow the message loop + * to run until all pending tasks are run. + * + * If you post a callback to a message loop that's been destroyed, or to an + * invalid message loop, PostWork will return an error and will not run the + * callback. This is true even for callbacks with the "required" flag set, + * since the system may not even know what thread to issue the error callback + * on. + * + * Therefore, you should check for errors from PostWork and destroy any + * associated memory to avoid leaks. If you're using the C++ + * CompletionCallbackFactory, use the following pattern: + * @code + * pp::CompletionCallback callback = factory_.NewOptionalCallback(...); + * int32_t result = message_loop.PostWork(callback); + * if (result != PP_OK) + * callback.Run(result); + * @endcode + * This will run the callback with an error value, and assumes that the + * implementation of your callback checks the "result" argument and returns + * immediately on error. + */ +struct PPB_MessageLoop_1_0 { + /** + * Creates a message loop resource. + * + * This may be called from any thread. After your thread starts but before + * issuing any other PPAPI calls on it, you must associate it with a message + * loop by calling AttachToCurrentThread. + */ + PP_Resource (*Create)(PP_Instance instance); + /** + * Returns a resource identifying the message loop for the main thread. The + * main thread always has a message loop created by the system. + */ + PP_Resource (*GetForMainThread)(void); + /** + * Returns a reference to the PPB_MessageLoop object attached to the current + * thread. If there is no attached message loop, the return value will be 0. + */ + PP_Resource (*GetCurrent)(void); + /** + * Sets the given message loop resource as being the associated message loop + * for the currently running thread. + * + * You must call this function exactly once on a thread before making any + * PPAPI calls. A message loop can only be attached to one thread, and the + * message loop can not be changed later. The message loop will be attached + * as long as the thread is running or until you quit with should_destroy + * set to PP_TRUE. + * + * If this function fails, attempting to run the message loop will fail. + * Note that you can still post work to the message loop: it will get queued + * up should the message loop eventually be successfully attached and run. + * + * @return + * - PP_OK: The message loop was successfully attached to the thread and is + * ready to use. + * - PP_ERROR_BADRESOURCE: The given message loop resource is invalid. + * - PP_ERROR_INPROGRESS: The current thread already has a message loop + * attached. This will always be the case for the main thread, which has + * an implicit system-created message loop attached. + * - PP_ERROR_WRONG_THREAD: The current thread type can not have a message + * loop attached to it. See the interface level discussion about these + * special threads, which include realtime audio threads. + */ + int32_t (*AttachToCurrentThread)(PP_Resource message_loop); + /** + * Runs the thread message loop. Running the message loop is required for you + * to get issued completion callbacks on the thread. + * + * The message loop identified by the argument must have been previously + * successfully attached to the current thread. + * + * You may not run nested message loops. Since the main thread has an + * implicit message loop that the system runs, you may not call Run on the + * main thread. + * + * @return + * - PP_OK: The message loop was successfully run. Note that on + * success, the message loop will only exit when you call PostQuit(). + * - PP_ERROR_BADRESOURCE: The given message loop resource is invalid. + * - PP_ERROR_WRONG_THREAD: You are attempting to run a message loop that + * has not been successfully attached to the current thread. Call + * AttachToCurrentThread(). + * - PP_ERROR_INPROGRESS: You are attempting to call Run in a nested + * fashion (Run is already on the stack). This will occur if you attempt + * to call run on the main thread's message loop (see above). + */ + int32_t (*Run)(PP_Resource message_loop); + /** + * Schedules work to run on the given message loop. This may be called from + * any thread. Posted work will be executed in the order it was posted when + * the message loop is Run(). + * + * @param message_loop The message loop resource. + * + * @param callback The completion callback to execute from the message loop. + * + * @param delay_ms The number of milliseconds to delay execution of the given + * completion callback. Passing 0 means it will get queued normally and + * executed in order. + * + * + * The completion callback will be called with PP_OK as the "result" parameter + * if it is run normally. It is good practice to check for PP_OK and return + * early otherwise. + * + * The "required" flag on the completion callback is ignored. If there is an + * error posting your callback, the error will be returned from PostWork and + * the callback will never be run (because there is no appropriate place to + * run your callback with an error without causing unexpected threading + * problems). If you associate memory with the completion callback (for + * example, you're using the C++ CompletionCallbackFactory), you will need to + * free this or manually run the callback. See "Destruction and error + * handling" above. + * + * + * You can call this function before the message loop has started and the + * work will get queued until the message loop is run. You can also post + * work after the message loop has exited as long as should_destroy was + * PP_FALSE. It will be queued until the next invocation of Run(). + * + * @return + * - PP_OK: The work was posted to the message loop's queue. As described + * above, this does not mean that the work has been or will be executed + * (if you never run the message loop after posting). + * - PP_ERROR_BADRESOURCE: The given message loop resource is invalid. + * - PP_ERROR_BADARGUMENT: The function pointer for the completion callback + * is null (this will be the case if you pass PP_BlockUntilComplete()). + * - PP_ERROR_FAILED: The message loop has been destroyed. + */ + int32_t (*PostWork)(PP_Resource message_loop, + struct PP_CompletionCallback callback, + int64_t delay_ms); + /** + * Posts a quit message to the given message loop's work queue. Work posted + * before that point will be processed before quitting. + * + * This may be called on the message loop registered for the current thread, + * or it may be called on the message loop registered for another thread. It + * is an error to attempt to PostQuit() the main thread loop. + * + * @param should_destroy Marks the message loop as being in a destroyed state + * and prevents further posting of messages. + * + * If you quit a message loop without setting should_destroy, it will still + * be attached to the thread and you can still run it again by calling Run() + * again. If you destroy it, it will be detached from the current thread. + * + * @return + * - PP_OK: The request to quit was successfully posted. + * - PP_ERROR_BADRESOURCE: The message loop was invalid. + * - PP_ERROR_WRONG_THREAD: You are attempting to quit the main thread. + * The main thread's message loop is managed by the system and can't be + * quit. + */ + int32_t (*PostQuit)(PP_Resource message_loop, PP_Bool should_destroy); +}; + +typedef struct PPB_MessageLoop_1_0 PPB_MessageLoop; +/** + * @} + */ + +/* ppp_message_handler.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPP_MessageHandler interface is implemented by the plugin + * if the plugin wants to receive messages from a thread other than the main + * Pepper thread, or if the plugin wants to handle blocking messages which + * JavaScript may send via postMessageAndAwaitResponse(). + * + * This interface struct should not be returned by PPP_GetInterface; instead it + * must be passed as a parameter to PPB_Messaging::RegisterMessageHandler. + */ +struct PPP_MessageHandler_0_2 { + /** + * Invoked as a result of JavaScript invoking postMessage() on the plugin's + * DOM element. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * @param[in] user_data is the same pointer which was provided by a call to + * RegisterMessageHandler(). + * @param[in] message A copy of the parameter that JavaScript provided to + * postMessage(). + */ + void (*HandleMessage)(PP_Instance instance, + void* user_data, + const struct PP_Var* message); + /** + * Invoked as a result of JavaScript invoking postMessageAndAwaitResponse() + * on the plugin's DOM element. + * + * NOTE: JavaScript execution is blocked during the duration of this call. + * Hence, the plugin should respond as quickly as possible. For this reason, + * blocking completion callbacks are disallowed while handling a blocking + * message. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * @param[in] user_data is the same pointer which was provided by a call to + * RegisterMessageHandler(). + * @param[in] message is a copy of the parameter that JavaScript provided + * to postMessageAndAwaitResponse(). + * @param[out] response will be copied to a JavaScript object which is + * returned as the result of postMessageAndAwaitResponse() to the invoking + * + */ + void (*HandleBlockingMessage)(PP_Instance instance, + void* user_data, + const struct PP_Var* message, + struct PP_Var* response); + /** + * Invoked when the handler object is no longer needed. After this, no more + * calls will be made which pass this same value for instance + * and user_data. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * @param[in] user_data is the same pointer which was provided by a call to + * RegisterMessageHandler. + */ + void (*Destroy)(PP_Instance instance, void* user_data); +}; + +typedef struct PPP_MessageHandler_0_2 PPP_MessageHandler; +/** + * @} + */ + +/* ppb_messaging.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_Messaging interface is implemented by the browser + * and is related to sending messages to JavaScript message event listeners on + * the DOM element associated with specific module instance. + */ +struct PPB_Messaging_1_2 { + /** + * PostMessage() asynchronously invokes any listeners for message events on + * the DOM element for the given module instance. A call to PostMessage() + * will not block while the message is processed. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * @param[in] message A PP_Var containing the data to be sent to + * JavaScript. + * message can be any PP_Var type except + * PP_VARTYPE_OBJECT. Array/Dictionary types are supported from + * Chrome M29 onward. All var types are copied when passing them to + * JavaScript. + * + * When passing array or dictionary PP_Vars, the entire reference + * graph will be converted and transferred. If the reference graph has cycles, + * the message will not be sent and an error will be logged to the console. + * + * Listeners for message events in JavaScript code will receive an object + * conforming to the HTML 5 MessageEvent interface. + * Specifically, the value of message will be contained as a property called + * data in the received MessageEvent. + * + * This messaging system is similar to the system used for listening for + * messages from Web Workers. Refer to + * http://www.whatwg.org/specs/web-workers/current-work/ for + * further information. + * + * Example: + * + * @code + * + * + * + * + * + * + * @endcode + * + * The module instance then invokes PostMessage() as follows: + * + * @code + * + * char hello_world[] = "Hello world!"; + * PP_Var hello_var = ppb_var_interface->VarFromUtf8(instance, + * hello_world, + * sizeof(hello_world)); + * ppb_messaging_interface->PostMessage(instance, hello_var); // Copies var. + * ppb_var_interface->Release(hello_var); + * + * @endcode + * + * The browser will pop-up an alert saying "Hello world!" + */ + void (*PostMessage)(PP_Instance instance, struct PP_Var message); + /** + * Registers a handler for receiving messages from JavaScript. If a handler + * is registered this way, it will replace PPP_Messaging, and all messages + * sent from JavaScript via postMessage and postMessageAndAwaitResponse will + * be dispatched to handler. + * + * The function calls will be dispatched via message_loop. This + * means that the functions will be invoked on the thread to which + * message_loop is attached, when message_loop is + * run. It is illegal to pass the main thread message loop; + * RegisterMessageHandler will return PP_ERROR_WRONG_THREAD in that case. + * If you quit message_loop before calling Unregister(), + * the browser will not be able to call functions in the plugin's message + * handler any more. That could mean missing some messages or could cause a + * leak if you depend on Destroy() to free hander data. So you should, + * whenever possible, Unregister() the handler prior to quitting its event + * loop. + * + * Attempting to register a message handler when one is already registered + * will cause the current MessageHandler to be unregistered and replaced. In + * that case, no messages will be sent to the "default" message handler + * (PPP_Messaging). Messages will stop arriving at the prior message handler + * and will begin to be dispatched at the new message handler. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * @param[in] user_data A pointer the plugin may choose to use when handling + * calls to functions within PPP_MessageHandler. The browser will pass this + * same pointer when invoking functions within PPP_MessageHandler. + * @param[in] handler The plugin-provided set of functions for handling + * messages. + * @param[in] message_loop Represents the message loop on which + * PPP_MessageHandler functions should be invoked. + * @return PP_OK on success, or an error from pp_errors.h. + */ + int32_t (*RegisterMessageHandler)( + PP_Instance instance, + void* user_data, + const struct PPP_MessageHandler_0_2* handler, + PP_Resource message_loop); + /** + * Unregisters the current message handler for instance if one + * is registered. After this call, the message handler (if one was + * registered) will have "Destroy" called on it and will receive no further + * messages after that point. After that point, all messages sent from + * JavaScript using postMessage() will be dispatched to PPP_Messaging (if + * the plugin supports PPP_MESSAGING_INTERFACE). Attempts to call + * postMessageAndAwaitResponse() from JavaScript will fail. + * + * Attempting to unregister a message handler when none is registered has no + * effect. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + */ + void (*UnregisterMessageHandler)(PP_Instance instance); +}; + +typedef struct PPB_Messaging_1_2 PPB_Messaging; + +struct PPB_Messaging_1_0 { + void (*PostMessage)(PP_Instance instance, struct PP_Var message); +}; +/** + * @} + */ + +/* ppb_mouse_cursor.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * The PP_MouseCursor_Type enumeration lists the available stock + * cursor types. + */ +enum PP_MouseCursor_Type { + PP_MOUSECURSOR_TYPE_CUSTOM = -1, + PP_MOUSECURSOR_TYPE_POINTER = 0, + PP_MOUSECURSOR_TYPE_CROSS = 1, + PP_MOUSECURSOR_TYPE_HAND = 2, + PP_MOUSECURSOR_TYPE_IBEAM = 3, + PP_MOUSECURSOR_TYPE_WAIT = 4, + PP_MOUSECURSOR_TYPE_HELP = 5, + PP_MOUSECURSOR_TYPE_EASTRESIZE = 6, + PP_MOUSECURSOR_TYPE_NORTHRESIZE = 7, + PP_MOUSECURSOR_TYPE_NORTHEASTRESIZE = 8, + PP_MOUSECURSOR_TYPE_NORTHWESTRESIZE = 9, + PP_MOUSECURSOR_TYPE_SOUTHRESIZE = 10, + PP_MOUSECURSOR_TYPE_SOUTHEASTRESIZE = 11, + PP_MOUSECURSOR_TYPE_SOUTHWESTRESIZE = 12, + PP_MOUSECURSOR_TYPE_WESTRESIZE = 13, + PP_MOUSECURSOR_TYPE_NORTHSOUTHRESIZE = 14, + PP_MOUSECURSOR_TYPE_EASTWESTRESIZE = 15, + PP_MOUSECURSOR_TYPE_NORTHEASTSOUTHWESTRESIZE = 16, + PP_MOUSECURSOR_TYPE_NORTHWESTSOUTHEASTRESIZE = 17, + PP_MOUSECURSOR_TYPE_COLUMNRESIZE = 18, + PP_MOUSECURSOR_TYPE_ROWRESIZE = 19, + PP_MOUSECURSOR_TYPE_MIDDLEPANNING = 20, + PP_MOUSECURSOR_TYPE_EASTPANNING = 21, + PP_MOUSECURSOR_TYPE_NORTHPANNING = 22, + PP_MOUSECURSOR_TYPE_NORTHEASTPANNING = 23, + PP_MOUSECURSOR_TYPE_NORTHWESTPANNING = 24, + PP_MOUSECURSOR_TYPE_SOUTHPANNING = 25, + PP_MOUSECURSOR_TYPE_SOUTHEASTPANNING = 26, + PP_MOUSECURSOR_TYPE_SOUTHWESTPANNING = 27, + PP_MOUSECURSOR_TYPE_WESTPANNING = 28, + PP_MOUSECURSOR_TYPE_MOVE = 29, + PP_MOUSECURSOR_TYPE_VERTICALTEXT = 30, + PP_MOUSECURSOR_TYPE_CELL = 31, + PP_MOUSECURSOR_TYPE_CONTEXTMENU = 32, + PP_MOUSECURSOR_TYPE_ALIAS = 33, + PP_MOUSECURSOR_TYPE_PROGRESS = 34, + PP_MOUSECURSOR_TYPE_NODROP = 35, + PP_MOUSECURSOR_TYPE_COPY = 36, + PP_MOUSECURSOR_TYPE_NONE = 37, + PP_MOUSECURSOR_TYPE_NOTALLOWED = 38, + PP_MOUSECURSOR_TYPE_ZOOMIN = 39, + PP_MOUSECURSOR_TYPE_ZOOMOUT = 40, + PP_MOUSECURSOR_TYPE_GRAB = 41, + PP_MOUSECURSOR_TYPE_GRABBING = 42 +}; +PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_MouseCursor_Type, 4); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_MouseCursor allows setting the mouse cursor. + */ +struct PPB_MouseCursor_1_0 { + /** + * Sets the given mouse cursor. The mouse cursor will be in effect whenever + * the mouse is over the given instance until it is set again by another + * call. Note that you can hide the mouse cursor by setting it to the + * PP_MOUSECURSOR_TYPE_NONE type. + * + * This function allows setting both system defined mouse cursors and + * custom cursors. To set a system-defined cursor, pass the type you want + * and set the custom image to 0 and the hot spot to NULL. To set a custom + * cursor, set the type to PP_MOUSECURSOR_TYPE_CUSTOM and + * specify your image and hot spot. + * + * @param[in] instance A PP_Instance identifying the instance + * that the mouse cursor will affect. + * + * @param[in] type A PP_MouseCursor_Type identifying the type of + * mouse cursor to show. + * + * @param[in] image A PPB_ImageData resource identifying the + * custom image to set when the type is + * PP_MOUSECURSOR_TYPE_CUSTOM. The image must be less than 32 + * pixels in each direction and must be of the system's native image format. + * When you are specifying a predefined cursor, this parameter must be 0. + * + * @param[in] hot_spot When setting a custom cursor, this identifies the + * pixel position within the given image of the "hot spot" of the cursor. + * When specifying a stock cursor, this parameter is ignored. + * + * @return PP_TRUE on success, or PP_FALSE if the instance or cursor type + * is invalid, or if the image is too large. + */ + PP_Bool (*SetCursor)(PP_Instance instance, + enum PP_MouseCursor_Type type, + PP_Resource image, + const struct PP_Point* hot_spot); +}; + +typedef struct PPB_MouseCursor_1_0 PPB_MouseCursor; +/** + * @} + */ + +/* ppb_mouse_lock.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_MouseLock interface is implemented by the browser. + * This interface provides a way of locking the target of mouse events to a + * single module instance and removing the cursor from view. This mode is + * useful for certain classes of applications, especially first-person + * perspective 3D applications and 3D modeling software. + */ +struct PPB_MouseLock_1_0 { + /** + * LockMouse() requests the mouse to be locked. + * + * While the mouse is locked, the cursor is implicitly hidden from the user. + * Any movement of the mouse will generate a + * PP_INPUTEVENT_TYPE_MOUSEMOVE event. The + * GetPosition() function in the PPB_MouseInputEvent + * interface reports the last known mouse position just as mouse lock was + * entered. The GetMovement() function provides relative movement + * information indicating what the change in position of the mouse would be + * had it not been locked. + * + * The browser may revoke the mouse lock for reasons including (but not + * limited to) the user pressing the ESC key, the user activating another + * program using a reserved keystroke (e.g. ALT+TAB), or some other system + * event. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t (*LockMouse)(PP_Instance instance, + struct PP_CompletionCallback callback); + /** + * UnlockMouse() causes the mouse to be unlocked, allowing it to track user + * movement again. This is an asynchronous operation. The module instance + * will be notified using the PPP_MouseLock interface when it + * has lost the mouse lock. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + */ + void (*UnlockMouse)(PP_Instance instance); +}; + +typedef struct PPB_MouseLock_1_0 PPB_MouseLock; +/** + * @} + */ + +/* ppb_network_list.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * Type of a network interface. + */ +typedef enum { + /** + * Type of the network interface is not known. + */ + PP_NETWORKLIST_TYPE_UNKNOWN = 0, + /** + * Wired Ethernet network. + */ + PP_NETWORKLIST_TYPE_ETHERNET = 1, + /** + * Wireless Wi-Fi network. + */ + PP_NETWORKLIST_TYPE_WIFI = 2, + /** + * Cellular network (e.g. LTE). + */ + PP_NETWORKLIST_TYPE_CELLULAR = 3 +} PP_NetworkList_Type; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_NetworkList_Type, 4); + +/** + * State of a network interface. + */ +typedef enum { + /** + * Network interface is down. + */ + PP_NETWORKLIST_STATE_DOWN = 0, + /** + * Network interface is up. + */ + PP_NETWORKLIST_STATE_UP = 1 +} PP_NetworkList_State; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_NetworkList_State, 4); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_NetworkList is used to represent a list of + * network interfaces and their configuration. The content of the list + * is immutable. The current networks configuration can be received + * using the PPB_NetworkMonitor interface. + */ +struct PPB_NetworkList_1_0 { + /** + * Determines if the specified resource is a + * NetworkList object. + * + * @param[in] resource A PP_Resource resource. + * + * @return Returns PP_TRUE if resource is + * a PPB_NetworkList, PP_FALSE + * otherwise. + */ + PP_Bool (*IsNetworkList)(PP_Resource resource); + /** + * Gets number of interfaces in the list. + * + * @param[in] resource A PP_Resource corresponding to a + * network list. + * + * @return Returns number of available network interfaces or 0 if + * the list has never been updated. + */ + uint32_t (*GetCount)(PP_Resource resource); + /** + * Gets name of a network interface. + * + * @param[in] resource A PP_Resource corresponding to a + * network list. + * @param[in] index Index of the network interface. + * + * @return Returns name for the network interface with the specified + * index. + */ + struct PP_Var (*GetName)(PP_Resource resource, uint32_t index); + /** + * Gets type of a network interface. + * + * @param[in] resource A PP_Resource corresponding to a + * network list. + * @param[in] index Index of the network interface. + * + * @return Returns type of the network interface with the specified + * index. + */ + PP_NetworkList_Type (*GetType)(PP_Resource resource, uint32_t index); + /** + * Gets state of a network interface. + * + * @param[in] resource A PP_Resource corresponding to a + * network list. + * @param[in] index Index of the network interface. + * + * @return Returns current state of the network interface with the + * specified index. + */ + PP_NetworkList_State (*GetState)(PP_Resource resource, uint32_t index); + /** + * Gets list of IP addresses for a network interface. + * + * @param[in] resource A PP_Resource corresponding to a + * network list. + * @param[in] index Index of the network interface. + * @param[in] output An output array which will receive + * PPB_NetAddress resources on success. Please note that the + * ref count of those resources has already been increased by 1 for the + * caller. + * + * @return An error code from pp_errors.h. + */ + int32_t (*GetIpAddresses)(PP_Resource resource, + uint32_t index, + struct PP_ArrayOutput output); + /** + * Gets display name of a network interface. + * + * @param[in] resource A PP_Resource corresponding to a + * network list. + * @param[in] index Index of the network interface. + * + * @return Returns display name for the network interface with the + * specified index. + */ + struct PP_Var (*GetDisplayName)(PP_Resource resource, uint32_t index); + /** + * Gets MTU (Maximum Transmission Unit) of a network interface. + * + * @param[in] resource A PP_Resource corresponding to a + * network list. + * @param[in] index Index of the network interface. + * + * @return Returns MTU for the network interface with the specified + * index or 0 if MTU is unknown. + */ + uint32_t (*GetMTU)(PP_Resource resource, uint32_t index); +}; + +typedef struct PPB_NetworkList_1_0 PPB_NetworkList; +/** + * @} + */ + +/* ppb_network_monitor.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_NetworkMonitor allows to get network interfaces + * configuration and monitor network configuration changes. + * + * Permissions: Apps permission socket with subrule + * network-state is required for UpdateNetworkList(). + * For more details about network communication permissions, please see: + * http://developer.chrome.com/apps/app_network.html + */ +struct PPB_NetworkMonitor_1_0 { + /** + * Creates a Network Monitor resource. + * + * @param[in] instance A PP_Instance identifying one instance of + * a module. + * + * @return A PP_Resource corresponding to a network monitor or 0 + * on failure. + */ + PP_Resource (*Create)(PP_Instance instance); + /** + * Gets current network configuration. When called for the first time, + * completes as soon as the current network configuration is received from + * the browser. Each consequent call will wait for network list changes, + * returning a new PPB_NetworkList resource every time. + * + * @param[in] network_monitor A PP_Resource corresponding to a + * network monitor. + * @param[out] network_list The PPB_NetworkList resource with the + * current state of network interfaces. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * PP_ERROR_NOACCESS will be returned if the caller doesn't have + * required permissions. + */ + int32_t (*UpdateNetworkList)(PP_Resource network_monitor, + PP_Resource* network_list, + struct PP_CompletionCallback callback); + /** + * Determines if the specified resource is a + * NetworkMonitor object. + * + * @param[in] resource A PP_Resource resource. + * + * @return Returns PP_TRUE if resource is a + * PPB_NetworkMonitor, PP_FALSE otherwise. + */ + PP_Bool (*IsNetworkMonitor)(PP_Resource resource); +}; + +typedef struct PPB_NetworkMonitor_1_0 PPB_NetworkMonitor; +/** + * @} + */ + +/* ppb_network_proxy.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * This interface provides a way to determine the appropriate proxy settings + * for a given URL. + * + * Permissions: Apps permission socket with subrule + * resolve-proxy is required for using this API. + * For more details about network communication permissions, please see: + * http://developer.chrome.com/apps/app_network.html + */ +struct PPB_NetworkProxy_1_0 { + /** + * Retrieves the proxy that will be used for the given URL. The result will + * be a string in PAC format. For more details about PAC format, please see + * http://en.wikipedia.org/wiki/Proxy_auto-config + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * + * @param[in] url A string PP_Var containing a URL. + * + * @param[out] proxy_string A PP_Var that GetProxyForURL will + * set upon successful completion. If the call fails, proxy_string + * will be unchanged. Otherwise, it will be set to a string + * PP_Var containing the appropriate PAC string for url. + * If set, proxy_string will have a reference count of 1 which + * the plugin must manage. + * + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t (*GetProxyForURL)(PP_Instance instance, + struct PP_Var url, + struct PP_Var* proxy_string, + struct PP_CompletionCallback callback); +}; + +typedef struct PPB_NetworkProxy_1_0 PPB_NetworkProxy; +/** + * @} + */ + +/* ppb_opengles2.idl */ +#include "ppapi/c/pp_resource.h" + +#ifndef __gl2_h_ +typedef void GLvoid; +typedef int GLsizei; +typedef unsigned short GLushort; +typedef short GLshort; +typedef unsigned char GLubyte; +typedef unsigned int GLenum; +typedef int GLint; +typedef unsigned char GLboolean; +typedef unsigned int GLbitfield; +typedef float GLfloat; +typedef float GLclampf; +typedef signed char GLbyte; +typedef unsigned int GLuint; +typedef int GLfixed; +typedef int GLclampx; +#ifdef _WIN64 +typedef long long int GLintptr; +typedef long long int GLsizeiptr; +#else +typedef long int GLintptr; +typedef long int GLsizeiptr; +#endif // _WIN64 +#endif // __gl2_h_ + + +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_OpenGLES2_1_0 { + void (*ActiveTexture)(PP_Resource context, GLenum texture); + void (*AttachShader)(PP_Resource context, GLuint program, GLuint shader); + void (*BindAttribLocation)(PP_Resource context, + GLuint program, + GLuint index, + const char* name); + void (*BindBuffer)(PP_Resource context, GLenum target, GLuint buffer); + void (*BindFramebuffer)(PP_Resource context, + GLenum target, + GLuint framebuffer); + void (*BindRenderbuffer)(PP_Resource context, + GLenum target, + GLuint renderbuffer); + void (*BindTexture)(PP_Resource context, GLenum target, GLuint texture); + void (*BlendColor)(PP_Resource context, + GLclampf red, + GLclampf green, + GLclampf blue, + GLclampf alpha); + void (*BlendEquation)(PP_Resource context, GLenum mode); + void (*BlendEquationSeparate)(PP_Resource context, + GLenum modeRGB, + GLenum modeAlpha); + void (*BlendFunc)(PP_Resource context, GLenum sfactor, GLenum dfactor); + void (*BlendFuncSeparate)(PP_Resource context, + GLenum srcRGB, + GLenum dstRGB, + GLenum srcAlpha, + GLenum dstAlpha); + void (*BufferData)(PP_Resource context, + GLenum target, + GLsizeiptr size, + const void* data, + GLenum usage); + void (*BufferSubData)(PP_Resource context, + GLenum target, + GLintptr offset, + GLsizeiptr size, + const void* data); + GLenum (*CheckFramebufferStatus)(PP_Resource context, GLenum target); + void (*Clear)(PP_Resource context, GLbitfield mask); + void (*ClearColor)(PP_Resource context, + GLclampf red, + GLclampf green, + GLclampf blue, + GLclampf alpha); + void (*ClearDepthf)(PP_Resource context, GLclampf depth); + void (*ClearStencil)(PP_Resource context, GLint s); + void (*ColorMask)(PP_Resource context, + GLboolean red, + GLboolean green, + GLboolean blue, + GLboolean alpha); + void (*CompileShader)(PP_Resource context, GLuint shader); + void (*CompressedTexImage2D)(PP_Resource context, + GLenum target, + GLint level, + GLenum internalformat, + GLsizei width, + GLsizei height, + GLint border, + GLsizei imageSize, + const void* data); + void (*CompressedTexSubImage2D)(PP_Resource context, + GLenum target, + GLint level, + GLint xoffset, + GLint yoffset, + GLsizei width, + GLsizei height, + GLenum format, + GLsizei imageSize, + const void* data); + void (*CopyTexImage2D)(PP_Resource context, + GLenum target, + GLint level, + GLenum internalformat, + GLint x, + GLint y, + GLsizei width, + GLsizei height, + GLint border); + void (*CopyTexSubImage2D)(PP_Resource context, + GLenum target, + GLint level, + GLint xoffset, + GLint yoffset, + GLint x, + GLint y, + GLsizei width, + GLsizei height); + GLuint (*CreateProgram)(PP_Resource context); + GLuint (*CreateShader)(PP_Resource context, GLenum type); + void (*CullFace)(PP_Resource context, GLenum mode); + void (*DeleteBuffers)(PP_Resource context, GLsizei n, const GLuint* buffers); + void (*DeleteFramebuffers)(PP_Resource context, + GLsizei n, + const GLuint* framebuffers); + void (*DeleteProgram)(PP_Resource context, GLuint program); + void (*DeleteRenderbuffers)(PP_Resource context, + GLsizei n, + const GLuint* renderbuffers); + void (*DeleteShader)(PP_Resource context, GLuint shader); + void (*DeleteTextures)(PP_Resource context, + GLsizei n, + const GLuint* textures); + void (*DepthFunc)(PP_Resource context, GLenum func); + void (*DepthMask)(PP_Resource context, GLboolean flag); + void (*DepthRangef)(PP_Resource context, GLclampf zNear, GLclampf zFar); + void (*DetachShader)(PP_Resource context, GLuint program, GLuint shader); + void (*Disable)(PP_Resource context, GLenum cap); + void (*DisableVertexAttribArray)(PP_Resource context, GLuint index); + void (*DrawArrays)(PP_Resource context, + GLenum mode, + GLint first, + GLsizei count); + void (*DrawElements)(PP_Resource context, + GLenum mode, + GLsizei count, + GLenum type, + const void* indices); + void (*Enable)(PP_Resource context, GLenum cap); + void (*EnableVertexAttribArray)(PP_Resource context, GLuint index); + void (*Finish)(PP_Resource context); + void (*Flush)(PP_Resource context); + void (*FramebufferRenderbuffer)(PP_Resource context, + GLenum target, + GLenum attachment, + GLenum renderbuffertarget, + GLuint renderbuffer); + void (*FramebufferTexture2D)(PP_Resource context, + GLenum target, + GLenum attachment, + GLenum textarget, + GLuint texture, + GLint level); + void (*FrontFace)(PP_Resource context, GLenum mode); + void (*GenBuffers)(PP_Resource context, GLsizei n, GLuint* buffers); + void (*GenerateMipmap)(PP_Resource context, GLenum target); + void (*GenFramebuffers)(PP_Resource context, GLsizei n, GLuint* framebuffers); + void (*GenRenderbuffers)(PP_Resource context, + GLsizei n, + GLuint* renderbuffers); + void (*GenTextures)(PP_Resource context, GLsizei n, GLuint* textures); + void (*GetActiveAttrib)(PP_Resource context, + GLuint program, + GLuint index, + GLsizei bufsize, + GLsizei* length, + GLint* size, + GLenum* type, + char* name); + void (*GetActiveUniform)(PP_Resource context, + GLuint program, + GLuint index, + GLsizei bufsize, + GLsizei* length, + GLint* size, + GLenum* type, + char* name); + void (*GetAttachedShaders)(PP_Resource context, + GLuint program, + GLsizei maxcount, + GLsizei* count, + GLuint* shaders); + GLint (*GetAttribLocation)(PP_Resource context, + GLuint program, + const char* name); + void (*GetBooleanv)(PP_Resource context, GLenum pname, GLboolean* params); + void (*GetBufferParameteriv)(PP_Resource context, + GLenum target, + GLenum pname, + GLint* params); + GLenum (*GetError)(PP_Resource context); + void (*GetFloatv)(PP_Resource context, GLenum pname, GLfloat* params); + void (*GetFramebufferAttachmentParameteriv)(PP_Resource context, + GLenum target, + GLenum attachment, + GLenum pname, + GLint* params); + void (*GetIntegerv)(PP_Resource context, GLenum pname, GLint* params); + void (*GetProgramiv)(PP_Resource context, + GLuint program, + GLenum pname, + GLint* params); + void (*GetProgramInfoLog)(PP_Resource context, + GLuint program, + GLsizei bufsize, + GLsizei* length, + char* infolog); + void (*GetRenderbufferParameteriv)(PP_Resource context, + GLenum target, + GLenum pname, + GLint* params); + void (*GetShaderiv)(PP_Resource context, + GLuint shader, + GLenum pname, + GLint* params); + void (*GetShaderInfoLog)(PP_Resource context, + GLuint shader, + GLsizei bufsize, + GLsizei* length, + char* infolog); + void (*GetShaderPrecisionFormat)(PP_Resource context, + GLenum shadertype, + GLenum precisiontype, + GLint* range, + GLint* precision); + void (*GetShaderSource)(PP_Resource context, + GLuint shader, + GLsizei bufsize, + GLsizei* length, + char* source); + const GLubyte* (*GetString)(PP_Resource context, GLenum name); + void (*GetTexParameterfv)(PP_Resource context, + GLenum target, + GLenum pname, + GLfloat* params); + void (*GetTexParameteriv)(PP_Resource context, + GLenum target, + GLenum pname, + GLint* params); + void (*GetUniformfv)(PP_Resource context, + GLuint program, + GLint location, + GLfloat* params); + void (*GetUniformiv)(PP_Resource context, + GLuint program, + GLint location, + GLint* params); + GLint (*GetUniformLocation)(PP_Resource context, + GLuint program, + const char* name); + void (*GetVertexAttribfv)(PP_Resource context, + GLuint index, + GLenum pname, + GLfloat* params); + void (*GetVertexAttribiv)(PP_Resource context, + GLuint index, + GLenum pname, + GLint* params); + void (*GetVertexAttribPointerv)(PP_Resource context, + GLuint index, + GLenum pname, + void** pointer); + void (*Hint)(PP_Resource context, GLenum target, GLenum mode); + GLboolean (*IsBuffer)(PP_Resource context, GLuint buffer); + GLboolean (*IsEnabled)(PP_Resource context, GLenum cap); + GLboolean (*IsFramebuffer)(PP_Resource context, GLuint framebuffer); + GLboolean (*IsProgram)(PP_Resource context, GLuint program); + GLboolean (*IsRenderbuffer)(PP_Resource context, GLuint renderbuffer); + GLboolean (*IsShader)(PP_Resource context, GLuint shader); + GLboolean (*IsTexture)(PP_Resource context, GLuint texture); + void (*LineWidth)(PP_Resource context, GLfloat width); + void (*LinkProgram)(PP_Resource context, GLuint program); + void (*PixelStorei)(PP_Resource context, GLenum pname, GLint param); + void (*PolygonOffset)(PP_Resource context, GLfloat factor, GLfloat units); + void (*ReadPixels)(PP_Resource context, + GLint x, + GLint y, + GLsizei width, + GLsizei height, + GLenum format, + GLenum type, + void* pixels); + void (*ReleaseShaderCompiler)(PP_Resource context); + void (*RenderbufferStorage)(PP_Resource context, + GLenum target, + GLenum internalformat, + GLsizei width, + GLsizei height); + void (*SampleCoverage)(PP_Resource context, GLclampf value, GLboolean invert); + void (*Scissor)(PP_Resource context, + GLint x, + GLint y, + GLsizei width, + GLsizei height); + void (*ShaderBinary)(PP_Resource context, + GLsizei n, + const GLuint* shaders, + GLenum binaryformat, + const void* binary, + GLsizei length); + void (*ShaderSource)(PP_Resource context, + GLuint shader, + GLsizei count, + const char** str, + const GLint* length); + void (*StencilFunc)(PP_Resource context, GLenum func, GLint ref, GLuint mask); + void (*StencilFuncSeparate)(PP_Resource context, + GLenum face, + GLenum func, + GLint ref, + GLuint mask); + void (*StencilMask)(PP_Resource context, GLuint mask); + void (*StencilMaskSeparate)(PP_Resource context, GLenum face, GLuint mask); + void (*StencilOp)(PP_Resource context, + GLenum fail, + GLenum zfail, + GLenum zpass); + void (*StencilOpSeparate)(PP_Resource context, + GLenum face, + GLenum fail, + GLenum zfail, + GLenum zpass); + void (*TexImage2D)(PP_Resource context, + GLenum target, + GLint level, + GLint internalformat, + GLsizei width, + GLsizei height, + GLint border, + GLenum format, + GLenum type, + const void* pixels); + void (*TexParameterf)(PP_Resource context, + GLenum target, + GLenum pname, + GLfloat param); + void (*TexParameterfv)(PP_Resource context, + GLenum target, + GLenum pname, + const GLfloat* params); + void (*TexParameteri)(PP_Resource context, + GLenum target, + GLenum pname, + GLint param); + void (*TexParameteriv)(PP_Resource context, + GLenum target, + GLenum pname, + const GLint* params); + void (*TexSubImage2D)(PP_Resource context, + GLenum target, + GLint level, + GLint xoffset, + GLint yoffset, + GLsizei width, + GLsizei height, + GLenum format, + GLenum type, + const void* pixels); + void (*Uniform1f)(PP_Resource context, GLint location, GLfloat x); + void (*Uniform1fv)(PP_Resource context, + GLint location, + GLsizei count, + const GLfloat* v); + void (*Uniform1i)(PP_Resource context, GLint location, GLint x); + void (*Uniform1iv)(PP_Resource context, + GLint location, + GLsizei count, + const GLint* v); + void (*Uniform2f)(PP_Resource context, GLint location, GLfloat x, GLfloat y); + void (*Uniform2fv)(PP_Resource context, + GLint location, + GLsizei count, + const GLfloat* v); + void (*Uniform2i)(PP_Resource context, GLint location, GLint x, GLint y); + void (*Uniform2iv)(PP_Resource context, + GLint location, + GLsizei count, + const GLint* v); + void (*Uniform3f)(PP_Resource context, + GLint location, + GLfloat x, + GLfloat y, + GLfloat z); + void (*Uniform3fv)(PP_Resource context, + GLint location, + GLsizei count, + const GLfloat* v); + void (*Uniform3i)(PP_Resource context, + GLint location, + GLint x, + GLint y, + GLint z); + void (*Uniform3iv)(PP_Resource context, + GLint location, + GLsizei count, + const GLint* v); + void (*Uniform4f)(PP_Resource context, + GLint location, + GLfloat x, + GLfloat y, + GLfloat z, + GLfloat w); + void (*Uniform4fv)(PP_Resource context, + GLint location, + GLsizei count, + const GLfloat* v); + void (*Uniform4i)(PP_Resource context, + GLint location, + GLint x, + GLint y, + GLint z, + GLint w); + void (*Uniform4iv)(PP_Resource context, + GLint location, + GLsizei count, + const GLint* v); + void (*UniformMatrix2fv)(PP_Resource context, + GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat* value); + void (*UniformMatrix3fv)(PP_Resource context, + GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat* value); + void (*UniformMatrix4fv)(PP_Resource context, + GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat* value); + void (*UseProgram)(PP_Resource context, GLuint program); + void (*ValidateProgram)(PP_Resource context, GLuint program); + void (*VertexAttrib1f)(PP_Resource context, GLuint indx, GLfloat x); + void (*VertexAttrib1fv)(PP_Resource context, + GLuint indx, + const GLfloat* values); + void (*VertexAttrib2f)(PP_Resource context, + GLuint indx, + GLfloat x, + GLfloat y); + void (*VertexAttrib2fv)(PP_Resource context, + GLuint indx, + const GLfloat* values); + void (*VertexAttrib3f)(PP_Resource context, + GLuint indx, + GLfloat x, + GLfloat y, + GLfloat z); + void (*VertexAttrib3fv)(PP_Resource context, + GLuint indx, + const GLfloat* values); + void (*VertexAttrib4f)(PP_Resource context, + GLuint indx, + GLfloat x, + GLfloat y, + GLfloat z, + GLfloat w); + void (*VertexAttrib4fv)(PP_Resource context, + GLuint indx, + const GLfloat* values); + void (*VertexAttribPointer)(PP_Resource context, + GLuint indx, + GLint size, + GLenum type, + GLboolean normalized, + GLsizei stride, + const void* ptr); + void (*Viewport)(PP_Resource context, + GLint x, + GLint y, + GLsizei width, + GLsizei height); +}; + +struct PPB_OpenGLES2 { + void (*ActiveTexture)(PP_Resource context, GLenum texture); + void (*AttachShader)(PP_Resource context, GLuint program, GLuint shader); + void (*BindAttribLocation)(PP_Resource context, + GLuint program, + GLuint index, + const char* name); + void (*BindBuffer)(PP_Resource context, GLenum target, GLuint buffer); + void (*BindFramebuffer)(PP_Resource context, + GLenum target, + GLuint framebuffer); + void (*BindRenderbuffer)(PP_Resource context, + GLenum target, + GLuint renderbuffer); + void (*BindTexture)(PP_Resource context, GLenum target, GLuint texture); + void (*BlendColor)(PP_Resource context, + GLclampf red, + GLclampf green, + GLclampf blue, + GLclampf alpha); + void (*BlendEquation)(PP_Resource context, GLenum mode); + void (*BlendEquationSeparate)(PP_Resource context, + GLenum modeRGB, + GLenum modeAlpha); + void (*BlendFunc)(PP_Resource context, GLenum sfactor, GLenum dfactor); + void (*BlendFuncSeparate)(PP_Resource context, + GLenum srcRGB, + GLenum dstRGB, + GLenum srcAlpha, + GLenum dstAlpha); + void (*BufferData)(PP_Resource context, + GLenum target, + GLsizeiptr size, + const void* data, + GLenum usage); + void (*BufferSubData)(PP_Resource context, + GLenum target, + GLintptr offset, + GLsizeiptr size, + const void* data); + GLenum (*CheckFramebufferStatus)(PP_Resource context, GLenum target); + void (*Clear)(PP_Resource context, GLbitfield mask); + void (*ClearColor)(PP_Resource context, + GLclampf red, + GLclampf green, + GLclampf blue, + GLclampf alpha); + void (*ClearDepthf)(PP_Resource context, GLclampf depth); + void (*ClearStencil)(PP_Resource context, GLint s); + void (*ColorMask)(PP_Resource context, + GLboolean red, + GLboolean green, + GLboolean blue, + GLboolean alpha); + void (*CompileShader)(PP_Resource context, GLuint shader); + void (*CompressedTexImage2D)(PP_Resource context, + GLenum target, + GLint level, + GLenum internalformat, + GLsizei width, + GLsizei height, + GLint border, + GLsizei imageSize, + const void* data); + void (*CompressedTexSubImage2D)(PP_Resource context, + GLenum target, + GLint level, + GLint xoffset, + GLint yoffset, + GLsizei width, + GLsizei height, + GLenum format, + GLsizei imageSize, + const void* data); + void (*CopyTexImage2D)(PP_Resource context, + GLenum target, + GLint level, + GLenum internalformat, + GLint x, + GLint y, + GLsizei width, + GLsizei height, + GLint border); + void (*CopyTexSubImage2D)(PP_Resource context, + GLenum target, + GLint level, + GLint xoffset, + GLint yoffset, + GLint x, + GLint y, + GLsizei width, + GLsizei height); + GLuint (*CreateProgram)(PP_Resource context); + GLuint (*CreateShader)(PP_Resource context, GLenum type); + void (*CullFace)(PP_Resource context, GLenum mode); + void (*DeleteBuffers)(PP_Resource context, GLsizei n, const GLuint* buffers); + void (*DeleteFramebuffers)(PP_Resource context, + GLsizei n, + const GLuint* framebuffers); + void (*DeleteProgram)(PP_Resource context, GLuint program); + void (*DeleteRenderbuffers)(PP_Resource context, + GLsizei n, + const GLuint* renderbuffers); + void (*DeleteShader)(PP_Resource context, GLuint shader); + void (*DeleteTextures)(PP_Resource context, + GLsizei n, + const GLuint* textures); + void (*DepthFunc)(PP_Resource context, GLenum func); + void (*DepthMask)(PP_Resource context, GLboolean flag); + void (*DepthRangef)(PP_Resource context, GLclampf zNear, GLclampf zFar); + void (*DetachShader)(PP_Resource context, GLuint program, GLuint shader); + void (*Disable)(PP_Resource context, GLenum cap); + void (*DisableVertexAttribArray)(PP_Resource context, GLuint index); + void (*DrawArrays)(PP_Resource context, + GLenum mode, + GLint first, + GLsizei count); + void (*DrawElements)(PP_Resource context, + GLenum mode, + GLsizei count, + GLenum type, + const void* indices); + void (*Enable)(PP_Resource context, GLenum cap); + void (*EnableVertexAttribArray)(PP_Resource context, GLuint index); + void (*Finish)(PP_Resource context); + void (*Flush)(PP_Resource context); + void (*FramebufferRenderbuffer)(PP_Resource context, + GLenum target, + GLenum attachment, + GLenum renderbuffertarget, + GLuint renderbuffer); + void (*FramebufferTexture2D)(PP_Resource context, + GLenum target, + GLenum attachment, + GLenum textarget, + GLuint texture, + GLint level); + void (*FrontFace)(PP_Resource context, GLenum mode); + void (*GenBuffers)(PP_Resource context, GLsizei n, GLuint* buffers); + void (*GenerateMipmap)(PP_Resource context, GLenum target); + void (*GenFramebuffers)(PP_Resource context, GLsizei n, GLuint* framebuffers); + void (*GenRenderbuffers)(PP_Resource context, + GLsizei n, + GLuint* renderbuffers); + void (*GenTextures)(PP_Resource context, GLsizei n, GLuint* textures); + void (*GetActiveAttrib)(PP_Resource context, + GLuint program, + GLuint index, + GLsizei bufsize, + GLsizei* length, + GLint* size, + GLenum* type, + char* name); + void (*GetActiveUniform)(PP_Resource context, + GLuint program, + GLuint index, + GLsizei bufsize, + GLsizei* length, + GLint* size, + GLenum* type, + char* name); + void (*GetAttachedShaders)(PP_Resource context, + GLuint program, + GLsizei maxcount, + GLsizei* count, + GLuint* shaders); + GLint (*GetAttribLocation)(PP_Resource context, + GLuint program, + const char* name); + void (*GetBooleanv)(PP_Resource context, GLenum pname, GLboolean* params); + void (*GetBufferParameteriv)(PP_Resource context, + GLenum target, + GLenum pname, + GLint* params); + GLenum (*GetError)(PP_Resource context); + void (*GetFloatv)(PP_Resource context, GLenum pname, GLfloat* params); + void (*GetFramebufferAttachmentParameteriv)(PP_Resource context, + GLenum target, + GLenum attachment, + GLenum pname, + GLint* params); + void (*GetIntegerv)(PP_Resource context, GLenum pname, GLint* params); + void (*GetProgramiv)(PP_Resource context, + GLuint program, + GLenum pname, + GLint* params); + void (*GetProgramInfoLog)(PP_Resource context, + GLuint program, + GLsizei bufsize, + GLsizei* length, + char* infolog); + void (*GetRenderbufferParameteriv)(PP_Resource context, + GLenum target, + GLenum pname, + GLint* params); + void (*GetShaderiv)(PP_Resource context, + GLuint shader, + GLenum pname, + GLint* params); + void (*GetShaderInfoLog)(PP_Resource context, + GLuint shader, + GLsizei bufsize, + GLsizei* length, + char* infolog); + void (*GetShaderPrecisionFormat)(PP_Resource context, + GLenum shadertype, + GLenum precisiontype, + GLint* range, + GLint* precision); + void (*GetShaderSource)(PP_Resource context, + GLuint shader, + GLsizei bufsize, + GLsizei* length, + char* source); + const GLubyte* (*GetString)(PP_Resource context, GLenum name); + void (*GetTexParameterfv)(PP_Resource context, + GLenum target, + GLenum pname, + GLfloat* params); + void (*GetTexParameteriv)(PP_Resource context, + GLenum target, + GLenum pname, + GLint* params); + void (*GetUniformfv)(PP_Resource context, + GLuint program, + GLint location, + GLfloat* params); + void (*GetUniformiv)(PP_Resource context, + GLuint program, + GLint location, + GLint* params); + GLint (*GetUniformLocation)(PP_Resource context, + GLuint program, + const char* name); + void (*GetVertexAttribfv)(PP_Resource context, + GLuint index, + GLenum pname, + GLfloat* params); + void (*GetVertexAttribiv)(PP_Resource context, + GLuint index, + GLenum pname, + GLint* params); + void (*GetVertexAttribPointerv)(PP_Resource context, + GLuint index, + GLenum pname, + void** pointer); + void (*Hint)(PP_Resource context, GLenum target, GLenum mode); + GLboolean (*IsBuffer)(PP_Resource context, GLuint buffer); + GLboolean (*IsEnabled)(PP_Resource context, GLenum cap); + GLboolean (*IsFramebuffer)(PP_Resource context, GLuint framebuffer); + GLboolean (*IsProgram)(PP_Resource context, GLuint program); + GLboolean (*IsRenderbuffer)(PP_Resource context, GLuint renderbuffer); + GLboolean (*IsShader)(PP_Resource context, GLuint shader); + GLboolean (*IsTexture)(PP_Resource context, GLuint texture); + void (*LineWidth)(PP_Resource context, GLfloat width); + void (*LinkProgram)(PP_Resource context, GLuint program); + void (*PixelStorei)(PP_Resource context, GLenum pname, GLint param); + void (*PolygonOffset)(PP_Resource context, GLfloat factor, GLfloat units); + void (*ReadPixels)(PP_Resource context, + GLint x, + GLint y, + GLsizei width, + GLsizei height, + GLenum format, + GLenum type, + void* pixels); + void (*ReleaseShaderCompiler)(PP_Resource context); + void (*RenderbufferStorage)(PP_Resource context, + GLenum target, + GLenum internalformat, + GLsizei width, + GLsizei height); + void (*SampleCoverage)(PP_Resource context, GLclampf value, GLboolean invert); + void (*Scissor)(PP_Resource context, + GLint x, + GLint y, + GLsizei width, + GLsizei height); + void (*ShaderBinary)(PP_Resource context, + GLsizei n, + const GLuint* shaders, + GLenum binaryformat, + const void* binary, + GLsizei length); + void (*ShaderSource)(PP_Resource context, + GLuint shader, + GLsizei count, + const char** str, + const GLint* length); + void (*StencilFunc)(PP_Resource context, GLenum func, GLint ref, GLuint mask); + void (*StencilFuncSeparate)(PP_Resource context, + GLenum face, + GLenum func, + GLint ref, + GLuint mask); + void (*StencilMask)(PP_Resource context, GLuint mask); + void (*StencilMaskSeparate)(PP_Resource context, GLenum face, GLuint mask); + void (*StencilOp)(PP_Resource context, + GLenum fail, + GLenum zfail, + GLenum zpass); + void (*StencilOpSeparate)(PP_Resource context, + GLenum face, + GLenum fail, + GLenum zfail, + GLenum zpass); + void (*TexImage2D)(PP_Resource context, + GLenum target, + GLint level, + GLint internalformat, + GLsizei width, + GLsizei height, + GLint border, + GLenum format, + GLenum type, + const void* pixels); + void (*TexParameterf)(PP_Resource context, + GLenum target, + GLenum pname, + GLfloat param); + void (*TexParameterfv)(PP_Resource context, + GLenum target, + GLenum pname, + const GLfloat* params); + void (*TexParameteri)(PP_Resource context, + GLenum target, + GLenum pname, + GLint param); + void (*TexParameteriv)(PP_Resource context, + GLenum target, + GLenum pname, + const GLint* params); + void (*TexSubImage2D)(PP_Resource context, + GLenum target, + GLint level, + GLint xoffset, + GLint yoffset, + GLsizei width, + GLsizei height, + GLenum format, + GLenum type, + const void* pixels); + void (*Uniform1f)(PP_Resource context, GLint location, GLfloat x); + void (*Uniform1fv)(PP_Resource context, + GLint location, + GLsizei count, + const GLfloat* v); + void (*Uniform1i)(PP_Resource context, GLint location, GLint x); + void (*Uniform1iv)(PP_Resource context, + GLint location, + GLsizei count, + const GLint* v); + void (*Uniform2f)(PP_Resource context, GLint location, GLfloat x, GLfloat y); + void (*Uniform2fv)(PP_Resource context, + GLint location, + GLsizei count, + const GLfloat* v); + void (*Uniform2i)(PP_Resource context, GLint location, GLint x, GLint y); + void (*Uniform2iv)(PP_Resource context, + GLint location, + GLsizei count, + const GLint* v); + void (*Uniform3f)(PP_Resource context, + GLint location, + GLfloat x, + GLfloat y, + GLfloat z); + void (*Uniform3fv)(PP_Resource context, + GLint location, + GLsizei count, + const GLfloat* v); + void (*Uniform3i)(PP_Resource context, + GLint location, + GLint x, + GLint y, + GLint z); + void (*Uniform3iv)(PP_Resource context, + GLint location, + GLsizei count, + const GLint* v); + void (*Uniform4f)(PP_Resource context, + GLint location, + GLfloat x, + GLfloat y, + GLfloat z, + GLfloat w); + void (*Uniform4fv)(PP_Resource context, + GLint location, + GLsizei count, + const GLfloat* v); + void (*Uniform4i)(PP_Resource context, + GLint location, + GLint x, + GLint y, + GLint z, + GLint w); + void (*Uniform4iv)(PP_Resource context, + GLint location, + GLsizei count, + const GLint* v); + void (*UniformMatrix2fv)(PP_Resource context, + GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat* value); + void (*UniformMatrix3fv)(PP_Resource context, + GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat* value); + void (*UniformMatrix4fv)(PP_Resource context, + GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat* value); + void (*UseProgram)(PP_Resource context, GLuint program); + void (*ValidateProgram)(PP_Resource context, GLuint program); + void (*VertexAttrib1f)(PP_Resource context, GLuint indx, GLfloat x); + void (*VertexAttrib1fv)(PP_Resource context, + GLuint indx, + const GLfloat* values); + void (*VertexAttrib2f)(PP_Resource context, + GLuint indx, + GLfloat x, + GLfloat y); + void (*VertexAttrib2fv)(PP_Resource context, + GLuint indx, + const GLfloat* values); + void (*VertexAttrib3f)(PP_Resource context, + GLuint indx, + GLfloat x, + GLfloat y, + GLfloat z); + void (*VertexAttrib3fv)(PP_Resource context, + GLuint indx, + const GLfloat* values); + void (*VertexAttrib4f)(PP_Resource context, + GLuint indx, + GLfloat x, + GLfloat y, + GLfloat z, + GLfloat w); + void (*VertexAttrib4fv)(PP_Resource context, + GLuint indx, + const GLfloat* values); + void (*VertexAttribPointer)(PP_Resource context, + GLuint indx, + GLint size, + GLenum type, + GLboolean normalized, + GLsizei stride, + const void* ptr); + void (*Viewport)(PP_Resource context, + GLint x, + GLint y, + GLsizei width, + GLsizei height); +}; + +struct PPB_OpenGLES2InstancedArrays_1_0 { + void (*DrawArraysInstancedANGLE)(PP_Resource context, + GLenum mode, + GLint first, + GLsizei count, + GLsizei primcount); + void (*DrawElementsInstancedANGLE)(PP_Resource context, + GLenum mode, + GLsizei count, + GLenum type, + const void* indices, + GLsizei primcount); + void (*VertexAttribDivisorANGLE)(PP_Resource context, + GLuint index, + GLuint divisor); +}; + +struct PPB_OpenGLES2InstancedArrays { + void (*DrawArraysInstancedANGLE)(PP_Resource context, + GLenum mode, + GLint first, + GLsizei count, + GLsizei primcount); + void (*DrawElementsInstancedANGLE)(PP_Resource context, + GLenum mode, + GLsizei count, + GLenum type, + const void* indices, + GLsizei primcount); + void (*VertexAttribDivisorANGLE)(PP_Resource context, + GLuint index, + GLuint divisor); +}; + +struct PPB_OpenGLES2FramebufferBlit_1_0 { + void (*BlitFramebufferEXT)(PP_Resource context, + GLint srcX0, + GLint srcY0, + GLint srcX1, + GLint srcY1, + GLint dstX0, + GLint dstY0, + GLint dstX1, + GLint dstY1, + GLbitfield mask, + GLenum filter); +}; + +struct PPB_OpenGLES2FramebufferBlit { + void (*BlitFramebufferEXT)(PP_Resource context, + GLint srcX0, + GLint srcY0, + GLint srcX1, + GLint srcY1, + GLint dstX0, + GLint dstY0, + GLint dstX1, + GLint dstY1, + GLbitfield mask, + GLenum filter); +}; + +struct PPB_OpenGLES2FramebufferMultisample_1_0 { + void (*RenderbufferStorageMultisampleEXT)(PP_Resource context, + GLenum target, + GLsizei samples, + GLenum internalformat, + GLsizei width, + GLsizei height); +}; + +struct PPB_OpenGLES2FramebufferMultisample { + void (*RenderbufferStorageMultisampleEXT)(PP_Resource context, + GLenum target, + GLsizei samples, + GLenum internalformat, + GLsizei width, + GLsizei height); +}; + +struct PPB_OpenGLES2ChromiumEnableFeature_1_0 { + GLboolean (*EnableFeatureCHROMIUM)(PP_Resource context, const char* feature); +}; + +struct PPB_OpenGLES2ChromiumEnableFeature { + GLboolean (*EnableFeatureCHROMIUM)(PP_Resource context, const char* feature); +}; + +struct PPB_OpenGLES2ChromiumMapSub_1_0 { + void* (*MapBufferSubDataCHROMIUM)(PP_Resource context, + GLuint target, + GLintptr offset, + GLsizeiptr size, + GLenum access); + void (*UnmapBufferSubDataCHROMIUM)(PP_Resource context, const void* mem); + void* (*MapTexSubImage2DCHROMIUM)(PP_Resource context, + GLenum target, + GLint level, + GLint xoffset, + GLint yoffset, + GLsizei width, + GLsizei height, + GLenum format, + GLenum type, + GLenum access); + void (*UnmapTexSubImage2DCHROMIUM)(PP_Resource context, const void* mem); +}; + +struct PPB_OpenGLES2ChromiumMapSub { + void* (*MapBufferSubDataCHROMIUM)(PP_Resource context, + GLuint target, + GLintptr offset, + GLsizeiptr size, + GLenum access); + void (*UnmapBufferSubDataCHROMIUM)(PP_Resource context, const void* mem); + void* (*MapTexSubImage2DCHROMIUM)(PP_Resource context, + GLenum target, + GLint level, + GLint xoffset, + GLint yoffset, + GLsizei width, + GLsizei height, + GLenum format, + GLenum type, + GLenum access); + void (*UnmapTexSubImage2DCHROMIUM)(PP_Resource context, const void* mem); +}; + +struct PPB_OpenGLES2Query_1_0 { + void (*GenQueriesEXT)(PP_Resource context, GLsizei n, GLuint* queries); + void (*DeleteQueriesEXT)(PP_Resource context, + GLsizei n, + const GLuint* queries); + GLboolean (*IsQueryEXT)(PP_Resource context, GLuint id); + void (*BeginQueryEXT)(PP_Resource context, GLenum target, GLuint id); + void (*EndQueryEXT)(PP_Resource context, GLenum target); + void (*GetQueryivEXT)(PP_Resource context, + GLenum target, + GLenum pname, + GLint* params); + void (*GetQueryObjectuivEXT)(PP_Resource context, + GLuint id, + GLenum pname, + GLuint* params); +}; + +struct PPB_OpenGLES2Query { + void (*GenQueriesEXT)(PP_Resource context, GLsizei n, GLuint* queries); + void (*DeleteQueriesEXT)(PP_Resource context, + GLsizei n, + const GLuint* queries); + GLboolean (*IsQueryEXT)(PP_Resource context, GLuint id); + void (*BeginQueryEXT)(PP_Resource context, GLenum target, GLuint id); + void (*EndQueryEXT)(PP_Resource context, GLenum target); + void (*GetQueryivEXT)(PP_Resource context, + GLenum target, + GLenum pname, + GLint* params); + void (*GetQueryObjectuivEXT)(PP_Resource context, + GLuint id, + GLenum pname, + GLuint* params); +}; + +struct PPB_OpenGLES2VertexArrayObject_1_0 { + void (*GenVertexArraysOES)(PP_Resource context, GLsizei n, GLuint* arrays); + void (*DeleteVertexArraysOES)(PP_Resource context, + GLsizei n, + const GLuint* arrays); + GLboolean (*IsVertexArrayOES)(PP_Resource context, GLuint array); + void (*BindVertexArrayOES)(PP_Resource context, GLuint array); +}; + +struct PPB_OpenGLES2VertexArrayObject { + void (*GenVertexArraysOES)(PP_Resource context, GLsizei n, GLuint* arrays); + void (*DeleteVertexArraysOES)(PP_Resource context, + GLsizei n, + const GLuint* arrays); + GLboolean (*IsVertexArrayOES)(PP_Resource context, GLuint array); + void (*BindVertexArrayOES)(PP_Resource context, GLuint array); +}; +/** + * @} + */ + +/* ppb_tcp_socket.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * Option names used by SetOption(). + */ +typedef enum { + /** + * Disables coalescing of small writes to make TCP segments, and instead + * delivers data immediately. Value's type is PP_VARTYPE_BOOL. + * On version 1.1 or earlier, this option can only be set after a successful + * Connect() call. On version 1.2 or later, there is no such + * limitation. + */ + PP_TCPSOCKET_OPTION_NO_DELAY = 0, + /** + * Specifies the total per-socket buffer space reserved for sends. Value's + * type should be PP_VARTYPE_INT32. + * On version 1.1 or earlier, this option can only be set after a successful + * Connect() call. On version 1.2 or later, there is no such + * limitation. + * + * Note: This is only treated as a hint for the browser to set the buffer + * size. Even if SetOption() succeeds, the browser doesn't + * guarantee it will conform to the size. + */ + PP_TCPSOCKET_OPTION_SEND_BUFFER_SIZE = 1, + /** + * Specifies the total per-socket buffer space reserved for receives. Value's + * type should be PP_VARTYPE_INT32. + * On version 1.1 or earlier, this option can only be set after a successful + * Connect() call. On version 1.2 or later, there is no such + * limitation. + * + * Note: This is only treated as a hint for the browser to set the buffer + * size. Even if SetOption() succeeds, the browser doesn't + * guarantee it will conform to the size. + */ + PP_TCPSOCKET_OPTION_RECV_BUFFER_SIZE = 2 +} PP_TCPSocket_Option; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_TCPSocket_Option, 4); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_TCPSocket interface provides TCP socket operations. + * + * Permissions: Apps permission socket with subrule + * tcp-connect is required for Connect(); subrule + * tcp-listen is required for Listen(). + * For more details about network communication permissions, please see: + * http://developer.chrome.com/apps/app_network.html + */ +struct PPB_TCPSocket_1_2 { + /** + * Creates a TCP socket resource. + * + * @param[in] instance A PP_Instance identifying one instance of + * a module. + * + * @return A PP_Resource corresponding to a TCP socket or 0 + * on failure. + */ + PP_Resource (*Create)(PP_Instance instance); + /** + * Determines if a given resource is a TCP socket. + * + * @param[in] resource A PP_Resource to check. + * + * @return PP_TRUE if the input is a + * PPB_TCPSocket resource; PP_FALSE otherwise. + */ + PP_Bool (*IsTCPSocket)(PP_Resource resource); + /** + * Binds the socket to the given address. The socket must not be bound. + * + * @param[in] tcp_socket A PP_Resource corresponding to a TCP + * socket. + * @param[in] addr A PPB_NetAddress resource. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h, + * including (but not limited to): + * - PP_ERROR_ADDRESS_IN_USE: the address is already in use. + * - PP_ERROR_ADDRESS_INVALID: the address is invalid. + */ + int32_t (*Bind)(PP_Resource tcp_socket, + PP_Resource addr, + struct PP_CompletionCallback callback); + /** + * Connects the socket to the given address. The socket must not be listening. + * Binding the socket beforehand is optional. + * + * @param[in] tcp_socket A PP_Resource corresponding to a TCP + * socket. + * @param[in] addr A PPB_NetAddress resource. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h, + * including (but not limited to): + * - PP_ERROR_NOACCESS: the caller doesn't have required + * permissions. + * - PP_ERROR_ADDRESS_UNREACHABLE: addr is + * unreachable. + * - PP_ERROR_CONNECTION_REFUSED: the connection attempt was + * refused. + * - PP_ERROR_CONNECTION_FAILED: the connection attempt failed. + * - PP_ERROR_CONNECTION_TIMEDOUT: the connection attempt timed + * out. + * + * Since version 1.1, if the socket is listening/connected or has a pending + * listen/connect request, Connect() will fail without starting a + * connection attempt; otherwise, any failure during the connection attempt + * will cause the socket to be closed. + */ + int32_t (*Connect)(PP_Resource tcp_socket, + PP_Resource addr, + struct PP_CompletionCallback callback); + /** + * Gets the local address of the socket, if it is bound. + * + * @param[in] tcp_socket A PP_Resource corresponding to a TCP + * socket. + * + * @return A PPB_NetAddress resource on success or 0 on failure. + */ + PP_Resource (*GetLocalAddress)(PP_Resource tcp_socket); + /** + * Gets the remote address of the socket, if it is connected. + * + * @param[in] tcp_socket A PP_Resource corresponding to a TCP + * socket. + * + * @return A PPB_NetAddress resource on success or 0 on failure. + */ + PP_Resource (*GetRemoteAddress)(PP_Resource tcp_socket); + /** + * Reads data from the socket. The socket must be connected. It may perform a + * partial read. + * + * @param[in] tcp_socket A PP_Resource corresponding to a TCP + * socket. + * @param[out] buffer The buffer to store the received data on success. It + * must be at least as large as bytes_to_read. + * @param[in] bytes_to_read The number of bytes to read. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return A non-negative number on success to indicate how many bytes have + * been read, 0 means that end-of-file was reached; otherwise, an error code + * from pp_errors.h. + */ + int32_t (*Read)(PP_Resource tcp_socket, + char* buffer, + int32_t bytes_to_read, + struct PP_CompletionCallback callback); + /** + * Writes data to the socket. The socket must be connected. It may perform a + * partial write. + * + * @param[in] tcp_socket A PP_Resource corresponding to a TCP + * socket. + * @param[in] buffer The buffer containing the data to write. + * @param[in] bytes_to_write The number of bytes to write. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return A non-negative number on success to indicate how many bytes have + * been written; otherwise, an error code from pp_errors.h. + */ + int32_t (*Write)(PP_Resource tcp_socket, + const char* buffer, + int32_t bytes_to_write, + struct PP_CompletionCallback callback); + /** + * Starts listening. The socket must be bound and not connected. + * + * @param[in] tcp_socket A PP_Resource corresponding to a TCP + * socket. + * @param[in] backlog A hint to determine the maximum length to which the + * queue of pending connections may grow. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h, + * including (but not limited to): + * - PP_ERROR_NOACCESS: the caller doesn't have required + * permissions. + * - PP_ERROR_ADDRESS_IN_USE: Another socket is already listening + * on the same port. + */ + int32_t (*Listen)(PP_Resource tcp_socket, + int32_t backlog, + struct PP_CompletionCallback callback); + /** + * Accepts a connection. The socket must be listening. + * + * @param[in] tcp_socket A PP_Resource corresponding to a TCP + * socket. + * @param[out] accepted_tcp_socket Stores the accepted TCP socket on success. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h, + * including (but not limited to): + * - PP_ERROR_CONNECTION_ABORTED: A connection has been aborted. + */ + int32_t (*Accept)(PP_Resource tcp_socket, + PP_Resource* accepted_tcp_socket, + struct PP_CompletionCallback callback); + /** + * Cancels all pending operations and closes the socket. Any pending callbacks + * will still run, reporting PP_ERROR_ABORTED if pending IO was + * interrupted. After a call to this method, no output buffer pointers passed + * into previous Read() or Accept() calls will be + * accessed. It is not valid to call Connect() or + * Listen() again. + * + * The socket is implicitly closed if it is destroyed, so you are not required + * to call this method. + * + * @param[in] tcp_socket A PP_Resource corresponding to a TCP + * socket. + */ + void (*Close)(PP_Resource tcp_socket); + /** + * Sets a socket option on the TCP socket. + * Please see the PP_TCPSocket_Option description for option + * names, value types and allowed values. + * + * @param[in] tcp_socket A PP_Resource corresponding to a TCP + * socket. + * @param[in] name The option to set. + * @param[in] value The option value to set. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t (*SetOption)(PP_Resource tcp_socket, + PP_TCPSocket_Option name, + struct PP_Var value, + struct PP_CompletionCallback callback); +}; + +typedef struct PPB_TCPSocket_1_2 PPB_TCPSocket; + +struct PPB_TCPSocket_1_0 { + PP_Resource (*Create)(PP_Instance instance); + PP_Bool (*IsTCPSocket)(PP_Resource resource); + int32_t (*Connect)(PP_Resource tcp_socket, + PP_Resource addr, + struct PP_CompletionCallback callback); + PP_Resource (*GetLocalAddress)(PP_Resource tcp_socket); + PP_Resource (*GetRemoteAddress)(PP_Resource tcp_socket); + int32_t (*Read)(PP_Resource tcp_socket, + char* buffer, + int32_t bytes_to_read, + struct PP_CompletionCallback callback); + int32_t (*Write)(PP_Resource tcp_socket, + const char* buffer, + int32_t bytes_to_write, + struct PP_CompletionCallback callback); + void (*Close)(PP_Resource tcp_socket); + int32_t (*SetOption)(PP_Resource tcp_socket, + PP_TCPSocket_Option name, + struct PP_Var value, + struct PP_CompletionCallback callback); +}; + +struct PPB_TCPSocket_1_1 { + PP_Resource (*Create)(PP_Instance instance); + PP_Bool (*IsTCPSocket)(PP_Resource resource); + int32_t (*Bind)(PP_Resource tcp_socket, + PP_Resource addr, + struct PP_CompletionCallback callback); + int32_t (*Connect)(PP_Resource tcp_socket, + PP_Resource addr, + struct PP_CompletionCallback callback); + PP_Resource (*GetLocalAddress)(PP_Resource tcp_socket); + PP_Resource (*GetRemoteAddress)(PP_Resource tcp_socket); + int32_t (*Read)(PP_Resource tcp_socket, + char* buffer, + int32_t bytes_to_read, + struct PP_CompletionCallback callback); + int32_t (*Write)(PP_Resource tcp_socket, + const char* buffer, + int32_t bytes_to_write, + struct PP_CompletionCallback callback); + int32_t (*Listen)(PP_Resource tcp_socket, + int32_t backlog, + struct PP_CompletionCallback callback); + int32_t (*Accept)(PP_Resource tcp_socket, + PP_Resource* accepted_tcp_socket, + struct PP_CompletionCallback callback); + void (*Close)(PP_Resource tcp_socket); + int32_t (*SetOption)(PP_Resource tcp_socket, + PP_TCPSocket_Option name, + struct PP_Var value, + struct PP_CompletionCallback callback); +}; +/** + * @} + */ + +/* ppb_text_input_controller.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * PP_TextInput_Type is used to indicate the status of a plugin in regard to + * text input. + */ +typedef enum { + /** + * Input caret is not in an editable mode, no input method shall be used. + */ + PP_TEXTINPUT_TYPE_NONE = 0, + /** + * Input caret is in a normal editable mode, any input method can be used. + */ + PP_TEXTINPUT_TYPE_TEXT = 1, + /** + * Input caret is in a password box, an input method may be used only if + * it's suitable for password input. + */ + PP_TEXTINPUT_TYPE_PASSWORD = 2, + PP_TEXTINPUT_TYPE_SEARCH = 3, + PP_TEXTINPUT_TYPE_EMAIL = 4, + PP_TEXTINPUT_TYPE_NUMBER = 5, + PP_TEXTINPUT_TYPE_TELEPHONE = 6, + PP_TEXTINPUT_TYPE_URL = 7 +} PP_TextInput_Type; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_TextInput_Type, 4); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * PPB_TextInputController provides a set of functions for giving + * hints to the browser about the text input status of plugins, and functions + * for controlling input method editors (IMEs). + */ +struct PPB_TextInputController_1_0 { + /** + * Informs the browser about the current text input mode of the plugin. + * Typical use of this information in the browser is to properly + * display/suppress tools for supporting text inputs (such as virtual + * keyboards in touch screen based devices, or input method editors often + * used for composing East Asian characters). + */ + void (*SetTextInputType)(PP_Instance instance, PP_TextInput_Type type); + /** + * Informs the browser about the coordinates of the text input caret area. + * Typical use of this information in the browser is to layout IME windows + * etc. + */ + void (*UpdateCaretPosition)(PP_Instance instance, + const struct PP_Rect* caret); + /** + * Cancels the current composition in IME. + */ + void (*CancelCompositionText)(PP_Instance instance); + /** + * Informs the browser about the current text selection and surrounding + * text. text is a UTF-8 string that contains the current range + * of text selection in the plugin. caret is the byte-index of + * the caret position within text. anchor is the + * byte-index of the anchor position (i.e., if a range of text is selected, + * it is the other edge of selection different from caret. If + * there are no selection, anchor is equal to caret. + * + * Typical use of this information in the browser is to enable "reconversion" + * features of IME that puts back the already committed text into the + * pre-commit composition state. Another use is to improve the precision + * of suggestion of IME by taking the context into account (e.g., if the caret + * looks to be on the beginning of a sentence, suggest capital letters in a + * virtual keyboard). + * + * When the focus is not on text, call this function setting text + * to an empty string and caret and anchor to zero. + * Also, the plugin should send the empty text when it does not want to reveal + * the selection to IME (e.g., when the surrounding text is containing + * password text). + */ + void (*UpdateSurroundingText)(PP_Instance instance, + struct PP_Var text, + uint32_t caret, + uint32_t anchor); +}; + +typedef struct PPB_TextInputController_1_0 PPB_TextInputController; +/** + * @} + */ + +/* ppb_udp_socket.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * Option names used by SetOption(). + */ +typedef enum { + /** + * Allows the socket to share the local address to which it will be bound with + * other processes. Value's type should be PP_VARTYPE_BOOL. + * This option can only be set before calling Bind(). + */ + PP_UDPSOCKET_OPTION_ADDRESS_REUSE = 0, + /** + * Allows sending and receiving packets to and from broadcast addresses. + * Value's type should be PP_VARTYPE_BOOL. + * On version 1.0, this option can only be set before calling + * Bind(). On version 1.1 or later, there is no such limitation. + */ + PP_UDPSOCKET_OPTION_BROADCAST = 1, + /** + * Specifies the total per-socket buffer space reserved for sends. Value's + * type should be PP_VARTYPE_INT32. + * On version 1.0, this option can only be set after a successful + * Bind() call. On version 1.1 or later, there is no such + * limitation. + * + * Note: This is only treated as a hint for the browser to set the buffer + * size. Even if SetOption() succeeds, the browser doesn't + * guarantee it will conform to the size. + */ + PP_UDPSOCKET_OPTION_SEND_BUFFER_SIZE = 2, + /** + * Specifies the total per-socket buffer space reserved for receives. Value's + * type should be PP_VARTYPE_INT32. + * On version 1.0, this option can only be set after a successful + * Bind() call. On version 1.1 or later, there is no such + * limitation. + * + * Note: This is only treated as a hint for the browser to set the buffer + * size. Even if SetOption() succeeds, the browser doesn't + * guarantee it will conform to the size. + */ + PP_UDPSOCKET_OPTION_RECV_BUFFER_SIZE = 3, + /** + * Specifies whether the packets sent from the host to the multicast group + * should be looped back to the host or not. Value's type should be + * PP_VARTYPE_BOOL. + * This option can only be set before calling Bind(). + * + * This is only supported in version 1.2 of the API (Chrome 43) and later. + */ + PP_UDPSOCKET_OPTION_MULTICAST_LOOP = 4, + /** + * Specifies the time-to-live for packets sent to the multicast group. The + * value should be within 0 to 255 range. The default value is 1 and means + * that packets will not be routed beyond the local network. Value's type + * should be PP_VARTYPE_INT32. + * This option can only be set before calling Bind(). + * + * This is only supported in version 1.2 of the API (Chrome 43) and later. + */ + PP_UDPSOCKET_OPTION_MULTICAST_TTL = 5 +} PP_UDPSocket_Option; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_UDPSocket_Option, 4); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_UDPSocket interface provides UDP socket operations. + * + * Permissions: Apps permission socket with subrule + * udp-bind is required for Bind(); subrule + * udp-send-to is required for SendTo(). + * For more details about network communication permissions, please see: + * http://developer.chrome.com/apps/app_network.html + */ +struct PPB_UDPSocket_1_2 { + /** + * Creates a UDP socket resource. + * + * @param[in] instance A PP_Instance identifying one instance of + * a module. + * + * @return A PP_Resource corresponding to a UDP socket or 0 + * on failure. + */ + PP_Resource (*Create)(PP_Instance instance); + /** + * Determines if a given resource is a UDP socket. + * + * @param[in] resource A PP_Resource to check. + * + * @return PP_TRUE if the input is a PPB_UDPSocket + * resource; PP_FALSE otherwise. + */ + PP_Bool (*IsUDPSocket)(PP_Resource resource); + /** + * Binds the socket to the given address. + * + * @param[in] udp_socket A PP_Resource corresponding to a UDP + * socket. + * @param[in] addr A PPB_NetAddress resource. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * PP_ERROR_NOACCESS will be returned if the caller doesn't have + * required permissions. PP_ERROR_ADDRESS_IN_USE will be returned + * if the address is already in use. + */ + int32_t (*Bind)(PP_Resource udp_socket, + PP_Resource addr, + struct PP_CompletionCallback callback); + /** + * Gets the address that the socket is bound to. The socket must be bound. + * + * @param[in] udp_socket A PP_Resource corresponding to a UDP + * socket. + * + * @return A PPB_NetAddress resource on success or 0 on failure. + */ + PP_Resource (*GetBoundAddress)(PP_Resource udp_socket); + /** + * Receives data from the socket and stores the source address. The socket + * must be bound. + * + * @param[in] udp_socket A PP_Resource corresponding to a UDP + * socket. + * @param[out] buffer The buffer to store the received data on success. It + * must be at least as large as num_bytes. + * @param[in] num_bytes The number of bytes to receive. + * @param[out] addr A PPB_NetAddress resource to store the source + * address on success. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return A non-negative number on success to indicate how many bytes have + * been received; otherwise, an error code from pp_errors.h. + */ + int32_t (*RecvFrom)(PP_Resource udp_socket, + char* buffer, + int32_t num_bytes, + PP_Resource* addr, + struct PP_CompletionCallback callback); + /** + * Sends data to a specific destination. The socket must be bound. + * + * @param[in] udp_socket A PP_Resource corresponding to a UDP + * socket. + * @param[in] buffer The buffer containing the data to send. + * @param[in] num_bytes The number of bytes to send. + * @param[in] addr A PPB_NetAddress resource holding the + * destination address. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return A non-negative number on success to indicate how many bytes have + * been sent; otherwise, an error code from pp_errors.h. + * PP_ERROR_NOACCESS will be returned if the caller doesn't have + * required permissions. + * PP_ERROR_INPROGRESS will be returned if the socket is busy + * sending. The caller should wait until a pending send completes before + * retrying. + */ + int32_t (*SendTo)(PP_Resource udp_socket, + const char* buffer, + int32_t num_bytes, + PP_Resource addr, + struct PP_CompletionCallback callback); + /** + * Cancels all pending reads and writes, and closes the socket. Any pending + * callbacks will still run, reporting PP_ERROR_ABORTED if + * pending IO was interrupted. After a call to this method, no output + * parameters passed into previous RecvFrom() calls will be + * accessed. It is not valid to call Bind() again. + * + * The socket is implicitly closed if it is destroyed, so you are not + * required to call this method. + * + * @param[in] udp_socket A PP_Resource corresponding to a UDP + * socket. + */ + void (*Close)(PP_Resource udp_socket); + /** + * Sets a socket option on the UDP socket. + * Please see the PP_UDPSocket_Option description for option + * names, value types and allowed values. + * + * @param[in] udp_socket A PP_Resource corresponding to a UDP + * socket. + * @param[in] name The option to set. + * @param[in] value The option value to set. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t (*SetOption)(PP_Resource udp_socket, + PP_UDPSocket_Option name, + struct PP_Var value, + struct PP_CompletionCallback callback); + /** + * Joins the multicast group with address specified by group + * parameter, which is expected to be a PPB_NetAddress object. + * + * @param[in] udp_socket A PP_Resource corresponding to a UDP + * socket. + * @param[in] group A PP_Resource corresponding to the network + * address of the multicast group. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t (*JoinGroup)(PP_Resource udp_socket, + PP_Resource group, + struct PP_CompletionCallback callback); + /** + * Leaves the multicast group with address specified by group + * parameter, which is expected to be a PPB_NetAddress object. + * + * @param[in] udp_socket A PP_Resource corresponding to a UDP + * socket. + * @param[in] group A PP_Resource corresponding to the network + * address of the multicast group. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t (*LeaveGroup)(PP_Resource udp_socket, + PP_Resource group, + struct PP_CompletionCallback callback); +}; + +typedef struct PPB_UDPSocket_1_2 PPB_UDPSocket; + +struct PPB_UDPSocket_1_0 { + PP_Resource (*Create)(PP_Instance instance); + PP_Bool (*IsUDPSocket)(PP_Resource resource); + int32_t (*Bind)(PP_Resource udp_socket, + PP_Resource addr, + struct PP_CompletionCallback callback); + PP_Resource (*GetBoundAddress)(PP_Resource udp_socket); + int32_t (*RecvFrom)(PP_Resource udp_socket, + char* buffer, + int32_t num_bytes, + PP_Resource* addr, + struct PP_CompletionCallback callback); + int32_t (*SendTo)(PP_Resource udp_socket, + const char* buffer, + int32_t num_bytes, + PP_Resource addr, + struct PP_CompletionCallback callback); + void (*Close)(PP_Resource udp_socket); + int32_t (*SetOption)(PP_Resource udp_socket, + PP_UDPSocket_Option name, + struct PP_Var value, + struct PP_CompletionCallback callback); +}; + +struct PPB_UDPSocket_1_1 { + PP_Resource (*Create)(PP_Instance instance); + PP_Bool (*IsUDPSocket)(PP_Resource resource); + int32_t (*Bind)(PP_Resource udp_socket, + PP_Resource addr, + struct PP_CompletionCallback callback); + PP_Resource (*GetBoundAddress)(PP_Resource udp_socket); + int32_t (*RecvFrom)(PP_Resource udp_socket, + char* buffer, + int32_t num_bytes, + PP_Resource* addr, + struct PP_CompletionCallback callback); + int32_t (*SendTo)(PP_Resource udp_socket, + const char* buffer, + int32_t num_bytes, + PP_Resource addr, + struct PP_CompletionCallback callback); + void (*Close)(PP_Resource udp_socket); + int32_t (*SetOption)(PP_Resource udp_socket, + PP_UDPSocket_Option name, + struct PP_Var value, + struct PP_CompletionCallback callback); +}; +/** + * @} + */ + +/* ppb_url_loader.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_URLLoader interface contains pointers to functions + * for loading URLs. The typical steps for loading a URL are: + * + * -# Call Create() to create a URLLoader object. + * -# Create a URLRequestInfo object and set properties on it. + * Refer to PPB_URLRequestInfo for further information. + * -# Call Open() with the URLRequestInfo as an argument. + * -# When Open() completes, call GetResponseInfo() to examine the response + * headers. Refer to PPB_URLResponseInfo for further information. + * -# Call ReadResponseBody() to stream the data for the response. + * + * Alternatively, if PP_URLREQUESTPROPERTY_STREAMTOFILE was set on + * the URLRequestInfo in step #2: + * - Call FinishStreamingToFile(), after examining the response headers + * (step #4), to wait for the downloaded file to be complete. + * - Then, access the downloaded file using the GetBodyAsFileRef() function of + * the URLResponseInfo returned in step #4. + */ +struct PPB_URLLoader_1_0 { + /** + * Create() creates a new URLLoader object. The + * URLLoader is associated with a particular instance, so that + * any UI dialogs that need to be shown to the user can be positioned + * relative to the window containing the instance. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * + * @return A PP_Resource corresponding to a URLLoader if + * successful, 0 if the instance is invalid. + */ + PP_Resource (*Create)(PP_Instance instance); + /** + * IsURLLoader() determines if a resource is an URLLoader. + * + * @param[in] resource A PP_Resource corresponding to a + * URLLoader. + * + * @return PP_TRUE if the resource is a URLLoader, + * PP_FALSE if the resource is invalid or some type other + * than URLLoader. + */ + PP_Bool (*IsURLLoader)(PP_Resource resource); + /** + * Open() begins loading the URLRequestInfo. The operation + * completes when response headers are received or when an error occurs. Use + * GetResponseInfo() to access the response headers. + * + * @param[in] loader A PP_Resource corresponding to a + * URLLoader. + * @param[in] resource A PP_Resource corresponding to a + * URLRequestInfo. + * @param[in] callback A PP_CompletionCallback to run on + * asynchronous completion of Open(). This callback will run when response + * headers for the url are received or error occurred. This callback + * will only run if Open() returns PP_OK_COMPLETIONPENDING. + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t (*Open)(PP_Resource loader, + PP_Resource request_info, + struct PP_CompletionCallback callback); + /** + * FollowRedirect() can be invoked to follow a redirect after Open() + * completed on receiving redirect headers. + * + * @param[in] loader A PP_Resource corresponding to a + * URLLoader. + * @param[in] callback A PP_CompletionCallback to run on + * asynchronous completion of FollowRedirect(). This callback will run when + * response headers for the redirect url are received or error occurred. This + * callback will only run if FollowRedirect() returns + * PP_OK_COMPLETIONPENDING. + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t (*FollowRedirect)(PP_Resource loader, + struct PP_CompletionCallback callback); + /** + * GetUploadProgress() returns the current upload progress (which is + * meaningful after Open() has been called). Progress only refers to the + * request body and does not include the headers. + * + * This data is only available if the URLRequestInfo passed + * to Open() had the PP_URLREQUESTPROPERTY_REPORTUPLOADPROGRESS + * property set to PP_TRUE. + * + * @param[in] loader A PP_Resource corresponding to a + * URLLoader. + * @param[in] bytes_sent The number of bytes sent thus far. + * @param[in] total_bytes_to_be_sent The total number of bytes to be sent. + * + * @return PP_TRUE if the upload progress is available, + * PP_FALSE if it is not available. + */ + PP_Bool (*GetUploadProgress)(PP_Resource loader, + int64_t* bytes_sent, + int64_t* total_bytes_to_be_sent); + /** + * GetDownloadProgress() returns the current download progress, which is + * meaningful after Open() has been called. Progress only refers to the + * response body and does not include the headers. + * + * This data is only available if the URLRequestInfo passed to + * Open() had the PP_URLREQUESTPROPERTY_REPORTDOWNLOADPROGRESS + * property set to PP_TRUE. + * + * @param[in] loader A PP_Resource corresponding to a + * URLLoader. + * @param[in] bytes_received The number of bytes received thus far. + * @param[in] total_bytes_to_be_received The total number of bytes to be + * received. The total bytes to be received may be unknown, in which case + * total_bytes_to_be_received will be set to -1. + * + * @return PP_TRUE if the download progress is available, + * PP_FALSE if it is not available. + */ + PP_Bool (*GetDownloadProgress)(PP_Resource loader, + int64_t* bytes_received, + int64_t* total_bytes_to_be_received); + /** + * GetResponseInfo() returns the current URLResponseInfo object. + * + * @param[in] instance A PP_Resource corresponding to a + * URLLoader. + * + * @return A PP_Resource corresponding to the + * URLResponseInfo if successful, 0 if the loader is not a valid + * resource or if Open() has not been called. + */ + PP_Resource (*GetResponseInfo)(PP_Resource loader); + /** + * ReadResponseBody() is used to read the response body. The size of the + * buffer must be large enough to hold the specified number of bytes to read. + * This function might perform a partial read. + * + * @param[in] loader A PP_Resource corresponding to a + * URLLoader. + * @param[in,out] buffer A pointer to the buffer for the response body. + * @param[in] bytes_to_read The number of bytes to read. + * @param[in] callback A PP_CompletionCallback to run on + * asynchronous completion. The callback will run if the bytes (full or + * partial) are read or an error occurs asynchronously. This callback will + * run only if this function returns PP_OK_COMPLETIONPENDING. + * + * @return An int32_t containing the number of bytes read or an error code + * from pp_errors.h. + */ + int32_t (*ReadResponseBody)(PP_Resource loader, + void* buffer, + int32_t bytes_to_read, + struct PP_CompletionCallback callback); + /** + * FinishStreamingToFile() is used to wait for the response body to be + * completely downloaded to the file provided by the GetBodyAsFileRef() + * in the current URLResponseInfo. This function is only used if + * PP_URLREQUESTPROPERTY_STREAMTOFILE was set on the + * URLRequestInfo passed to Open(). + * + * @param[in] loader A PP_Resource corresponding to a + * URLLoader. + * @param[in] callback A PP_CompletionCallback to run on + * asynchronous completion. This callback will run when body is downloaded + * or an error occurs after FinishStreamingToFile() returns + * PP_OK_COMPLETIONPENDING. + * + * @return An int32_t containing the number of bytes read or an error code + * from pp_errors.h. + */ + int32_t (*FinishStreamingToFile)(PP_Resource loader, + struct PP_CompletionCallback callback); + /** + * Close is a pointer to a function used to cancel any pending IO and close + * the URLLoader object. Any pending callbacks will still run, + * reporting PP_ERROR_ABORTED if pending IO was interrupted. + * It is NOT valid to call Open() again after a call to this function. + * + * Note: If the URLLoader object is destroyed + * while it is still open, then it will be implicitly closed so you are not + * required to call Close(). + * + * @param[in] loader A PP_Resource corresponding to a + * URLLoader. + */ + void (*Close)(PP_Resource loader); +}; + +typedef struct PPB_URLLoader_1_0 PPB_URLLoader; +/** + * @} + */ + +/* ppb_url_request_info.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * This enumeration contains properties that can be set on a URL request. + */ +typedef enum { + /** This corresponds to a string (PP_VARTYPE_STRING). */ + PP_URLREQUESTPROPERTY_URL = 0, + /** + * This corresponds to a string (PP_VARTYPE_STRING); either + * POST or GET. Refer to the + * HTTP + * Methods documentation for further information. + * + */ + PP_URLREQUESTPROPERTY_METHOD = 1, + /** + * This corresponds to a string (PP_VARTYPE_STRING); \n + * delimited. Refer to the + * documentation for further information. + */ + PP_URLREQUESTPROPERTY_HEADERS = 2, + /** + * This corresponds to a PP_Bool (PP_VARTYPE_BOOL; + * default=PP_FALSE). + * Set this value to PP_TRUE if you want to download the data + * to a file. Use PPB_URLLoader.FinishStreamingToFile() to complete the + * download. + */ + PP_URLREQUESTPROPERTY_STREAMTOFILE = 3, + /** + * This corresponds to a PP_Bool (PP_VARTYPE_BOOL; + * default=PP_TRUE). + * Set this value to PP_FALSE if you want to use + * PPB_URLLoader.FollowRedirects() to follow the redirects only after + * examining redirect headers. + */ + PP_URLREQUESTPROPERTY_FOLLOWREDIRECTS = 4, + /** + * This corresponds to a PP_Bool (PP_VARTYPE_BOOL; + * default=PP_FALSE). + * Set this value to PP_TRUE if you want to be able to poll the + * download progress using PPB_URLLoader.GetDownloadProgress(). + */ + PP_URLREQUESTPROPERTY_RECORDDOWNLOADPROGRESS = 5, + /** + * This corresponds to a PP_Bool + * (default=PP_FALSE). Set this value to PP_TRUE if + * you want to be able to poll the upload progress using + * PPB_URLLoader.GetUploadProgress(). + */ + PP_URLREQUESTPROPERTY_RECORDUPLOADPROGRESS = 6, + /** + * This corresponds to a string (PP_VARTYPE_STRING) or may be + * undefined (PP_VARTYPE_UNDEFINED; default). + * Set it to a string to set a custom referrer (if empty, the referrer header + * will be omitted), or to undefined to use the default referrer. Only loaders + * with universal access (only available on trusted implementations) will + * accept URLRequestInfo objects that try to set a custom + * referrer; if given to a loader without universal access, + * PP_ERROR_NOACCESS will result. + */ + PP_URLREQUESTPROPERTY_CUSTOMREFERRERURL = 7, + /** + * This corresponds to a PP_Bool (PP_VARTYPE_BOOL; + * default=PP_FALSE). Whether cross-origin requests are allowed. + * Cross-origin requests are made using the CORS (Cross-Origin Resource + * Sharing) algorithm to check whether the request should be allowed. For the + * complete CORS algorithm, refer to + * the Cross-Origin Resource + * Sharing documentation. + */ + PP_URLREQUESTPROPERTY_ALLOWCROSSORIGINREQUESTS = 8, + /** + * This corresponds to a PP_Bool (PP_VARTYPE_BOOL; + * default=PP_FALSE). + * Whether HTTP credentials are sent with cross-origin requests. If false, + * no credentials are sent with the request and cookies are ignored in the + * response. If the request is not cross-origin, this property is ignored. + */ + PP_URLREQUESTPROPERTY_ALLOWCREDENTIALS = 9, + /** + * This corresponds to a string (PP_VARTYPE_STRING) or may be + * undefined (PP_VARTYPE_UNDEFINED; default). + * Set it to a string to set a custom content-transfer-encoding header (if + * empty, that header will be omitted), or to undefined to use the default + * (if any). Only loaders with universal access (only available on trusted + * implementations) will accept URLRequestInfo objects that try + * to set a custom content transfer encoding; if given to a loader without + * universal access, PP_ERROR_NOACCESS will result. + */ + PP_URLREQUESTPROPERTY_CUSTOMCONTENTTRANSFERENCODING = 10, + /** + * This corresponds to an integer (PP_VARTYPE_INT32); default + * is not defined and is set by the browser, possibly depending on system + * capabilities. Set it to an integer to set an upper threshold for the + * prefetched buffer of an asynchronous load. When exceeded, the browser will + * defer loading until + * PP_URLREQUESTPROPERTY_PREFETCHBUFFERLOWERERTHRESHOLD is hit, + * at which time it will begin prefetching again. When setting this property, + * PP_URLREQUESTPROPERTY_PREFETCHBUFFERLOWERERTHRESHOLD must also + * be set. Behavior is undefined if the former is <= the latter. + */ + PP_URLREQUESTPROPERTY_PREFETCHBUFFERUPPERTHRESHOLD = 11, + /** + * This corresponds to an integer (PP_VARTYPE_INT32); default is + * not defined and is set by the browser to a value appropriate for the + * default PP_URLREQUESTPROPERTY_PREFETCHBUFFERUPPERTHRESHOLD. + * Set it to an integer to set a lower threshold for the prefetched buffer + * of an asynchronous load. When reached, the browser will resume loading if + * If PP_URLREQUESTPROPERTY_PREFETCHBUFFERLOWERERTHRESHOLD had + * previously been reached. + * When setting this property, + * PP_URLREQUESTPROPERTY_PREFETCHBUFFERUPPERTHRESHOLD must also + * be set. Behavior is undefined if the former is >= the latter. + */ + PP_URLREQUESTPROPERTY_PREFETCHBUFFERLOWERTHRESHOLD = 12, + /** + * This corresponds to a string (PP_VARTYPE_STRING) or may be + * undefined (PP_VARTYPE_UNDEFINED; default). Set it to a string + * to set a custom user-agent header (if empty, that header will be omitted), + * or to undefined to use the default. Only loaders with universal access + * (only available on trusted implementations) will accept + * URLRequestInfo objects that try to set a custom user agent; if + * given to a loader without universal access, PP_ERROR_NOACCESS + * will result. + */ + PP_URLREQUESTPROPERTY_CUSTOMUSERAGENT = 13 +} PP_URLRequestProperty; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_URLRequestProperty, 4); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_URLRequestInfo interface is used to create + * and handle URL requests. This API is used in conjunction with + * PPB_URLLoader. Refer to PPB_URLLoader for further + * information. + */ +struct PPB_URLRequestInfo_1_0 { + /** + * Create() creates a new URLRequestInfo object. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * + * @return A PP_Resource identifying the + * URLRequestInfo if successful, 0 if the instance is invalid. + */ + PP_Resource (*Create)(PP_Instance instance); + /** + * IsURLRequestInfo() determines if a resource is a + * URLRequestInfo. + * + * @param[in] resource A PP_Resource corresponding to a + * URLRequestInfo. + * + * @return PP_TRUE if the resource is a + * URLRequestInfo, PP_FALSE if the resource is + * invalid or some type other than URLRequestInfo. + */ + PP_Bool (*IsURLRequestInfo)(PP_Resource resource); + /** + * SetProperty() sets a request property. The value of the property must be + * the correct type according to the property being set. + * + * @param[in] request A PP_Resource corresponding to a + * URLRequestInfo. + * @param[in] property A PP_URLRequestProperty identifying the + * property to set. + * @param[in] value A PP_Var containing the property value. + * + * @return PP_TRUE if successful, PP_FALSE if any + * of the parameters are invalid. + */ + PP_Bool (*SetProperty)(PP_Resource request, + PP_URLRequestProperty property, + struct PP_Var value); + /** + * AppendDataToBody() appends data to the request body. A Content-Length + * request header will be automatically generated. + * + * @param[in] request A PP_Resource corresponding to a + * URLRequestInfo. + * @param[in] data A pointer to a buffer holding the data. + * @param[in] len The length, in bytes, of the data. + * + * @return PP_TRUE if successful, PP_FALSE if any + * of the parameters are invalid. + * + * + */ + PP_Bool (*AppendDataToBody)(PP_Resource request, + const void* data, + uint32_t len); + /** + * AppendFileToBody() appends a file, to be uploaded, to the request body. + * A content-length request header will be automatically generated. + * + * @param[in] request A PP_Resource corresponding to a + * URLRequestInfo. + * @param[in] file_ref A PP_Resource corresponding to a file + * reference. + * @param[in] start_offset An optional starting point offset within the + * file. + * @param[in] number_of_bytes An optional number of bytes of the file to + * be included. If number_of_bytes is -1, then the sub-range + * to upload extends to the end of the file. + * @param[in] expected_last_modified_time An optional (non-zero) last + * modified time stamp used to validate that the file was not modified since + * the given time before it was uploaded. The upload will fail with an error + * code of PP_ERROR_FILECHANGED if the file has been modified + * since the given time. If expected_last_modified_time is 0, + * then no validation is performed. + * + * @return PP_TRUE if successful, PP_FALSE if any + * of the parameters are invalid. + */ + PP_Bool (*AppendFileToBody)(PP_Resource request, + PP_Resource file_ref, + int64_t start_offset, + int64_t number_of_bytes, + PP_Time expected_last_modified_time); +}; + +typedef struct PPB_URLRequestInfo_1_0 PPB_URLRequestInfo; +/** + * @} + */ + +/* ppb_url_response_info.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * This enumeration contains properties set on a URL response. + */ +typedef enum { + /** + * This corresponds to a string (PP_VARTYPE_STRING); an absolute URL formed by + * resolving the relative request URL with the absolute document URL. Refer + * to the + * + * HTTP Request URI and + * + * HTML Resolving Relative URIs documentation for further information. + */ + PP_URLRESPONSEPROPERTY_URL = 0, + /** + * This corresponds to a string (PP_VARTYPE_STRING); the absolute URL returned + * in the response header's 'Location' field if this is a redirect response, + * an empty string otherwise. Refer to the + * + * HTTP Status Codes - Redirection documentation for further information. + */ + PP_URLRESPONSEPROPERTY_REDIRECTURL = 1, + /** + * This corresponds to a string (PP_VARTYPE_STRING); the HTTP method to be + * used in a new request if this is a redirect response, an empty string + * otherwise. Refer to the + * + * HTTP Status Codes - Redirection documentation for further information. + */ + PP_URLRESPONSEPROPERTY_REDIRECTMETHOD = 2, + /** + * This corresponds to an int32 (PP_VARETYPE_INT32); the status code from the + * response, e.g., 200 if the request was successful. Refer to the + * + * HTTP Status Code and Reason Phrase documentation for further + * information. + */ + PP_URLRESPONSEPROPERTY_STATUSCODE = 3, + /** + * This corresponds to a string (PP_VARTYPE_STRING); the status line + * from the response. Refer to the + * + * HTTP Response Status Line documentation for further information. + */ + PP_URLRESPONSEPROPERTY_STATUSLINE = 4, + /** + * This corresponds to a string(PP_VARTYPE_STRING), a \n-delimited list of + * header field/value pairs of the form "field: value", returned by the + * server. Refer to the + * + * HTTP Header Field Definitions documentation for further information. + */ + PP_URLRESPONSEPROPERTY_HEADERS = 5 +} PP_URLResponseProperty; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_URLResponseProperty, 4); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_URLResponseInfo interface contains APIs for + * examining URL responses. Refer to PPB_URLLoader for further + * information. + */ +struct PPB_URLResponseInfo_1_0 { + /** + * IsURLResponseInfo() determines if a response is a + * URLResponseInfo. + * + * @param[in] resource A PP_Resource corresponding to a + * URLResponseInfo. + * + * @return PP_TRUE if the resource is a + * URLResponseInfo, PP_FALSE if the resource is + * invalid or some type other than URLResponseInfo. + */ + PP_Bool (*IsURLResponseInfo)(PP_Resource resource); + /** + * GetProperty() gets a response property. + * + * @param[in] request A PP_Resource corresponding to a + * URLResponseInfo. + * @param[in] property A PP_URLResponseProperty identifying + * the type of property in the response. + * + * @return A PP_Var containing the response property value if + * successful, PP_VARTYPE_VOID if an input parameter is invalid. + */ + struct PP_Var (*GetProperty)(PP_Resource response, + PP_URLResponseProperty property); + /** + * GetBodyAsFileRef() returns a FileRef pointing to the file containing the + * response body. This is only valid if + * PP_URLREQUESTPROPERTY_STREAMTOFILE was set on the + * URLRequestInfo used to produce this response. This file + * remains valid until the URLLoader associated with this + * URLResponseInfo is closed or destroyed. + * + * @param[in] request A PP_Resource corresponding to a + * URLResponseInfo. + * + * @return A PP_Resource corresponding to a FileRef + * if successful, 0 if PP_URLREQUESTPROPERTY_STREAMTOFILE was + * not requested or if the URLLoader has not been opened yet. + */ + PP_Resource (*GetBodyAsFileRef)(PP_Resource response); +}; + +typedef struct PPB_URLResponseInfo_1_0 PPB_URLResponseInfo; +/** + * @} + */ + +/* ppb_var.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * PPB_Var API + */ +struct PPB_Var_1_2 { + /** + * AddRef() adds a reference to the given var. If this is not a refcounted + * object, this function will do nothing so you can always call it no matter + * what the type. + * + * @param[in] var A PP_Var that will have a reference added. + */ + void (*AddRef)(struct PP_Var var); + /** + * Release() removes a reference to given var, deleting it if the internal + * reference count becomes 0. If the PP_Var is of type + * PP_VARTYPE_RESOURCE, + * it will implicitly release a reference count on the + * PP_Resource (equivalent to PPB_Core::ReleaseResource()). + * + * If the given var is not a refcounted object, this function will do nothing + * so you can always call it no matter what the type. + * + * @param[in] var A PP_Var that will have a reference removed. + */ + void (*Release)(struct PP_Var var); + /** + * VarFromUtf8() creates a string var from a string. The string must be + * encoded in valid UTF-8 and is NOT NULL-terminated, the length must be + * specified in len. It is an error if the string is not + * valid UTF-8. + * + * If the length is 0, the *data pointer will not be dereferenced + * and may be NULL. Note, however if length is 0, the + * "NULL-ness" will not be preserved, as VarToUtf8() will never return + * NULL on success, even for empty strings. + * + * The resulting object will be a refcounted string object. It will be + * AddRef'ed for the caller. When the caller is done with it, it should be + * Released. + * + * On error (basically out of memory to allocate the string, or input that + * is not valid UTF-8), this function will return a Null var. + * + * @param[in] data A string + * @param[in] len The length of the string. + * + * @return A PP_Var structure containing a reference counted + * string object. + */ + struct PP_Var (*VarFromUtf8)(const char* data, uint32_t len); + /** + * VarToUtf8() converts a string-type var to a char* encoded in UTF-8. This + * string is NOT NULL-terminated. The length will be placed in + * *len. If the string is valid but empty the return value will + * be non-NULL, but *len will still be 0. + * + * If the var is not a string, this function will return NULL and + * *len will be 0. + * + * The returned buffer will be valid as long as the underlying var is alive. + * If the instance frees its reference, the string will be freed and the + * pointer will be to arbitrary memory. + * + * @param[in] var A PP_Var struct containing a string-type var. + * @param[in,out] len A pointer to the length of the string-type var. + * + * @return A char* encoded in UTF-8. + */ + const char* (*VarToUtf8)(struct PP_Var var, uint32_t* len); + /** + * Converts a resource-type var to a PP_Resource. + * + * @param[in] var A PP_Var struct containing a resource-type var. + * + * @return A PP_Resource retrieved from the var, or 0 if the var + * is not a resource. The reference count of the resource is incremented on + * behalf of the caller. + */ + PP_Resource (*VarToResource)(struct PP_Var var); + /** + * Creates a new PP_Var from a given resource. Implicitly adds a + * reference count on the PP_Resource (equivalent to + * PPB_Core::AddRefResource(resource)). + * + * @param[in] resource A PP_Resource to be wrapped in a var. + * + * @return A PP_Var created for this resource, with type + * PP_VARTYPE_RESOURCE. The reference count of the var is set to + * 1 on behalf of the caller. + */ + struct PP_Var (*VarFromResource)(PP_Resource resource); +}; + +typedef struct PPB_Var_1_2 PPB_Var; + +struct PPB_Var_1_0 { + void (*AddRef)(struct PP_Var var); + void (*Release)(struct PP_Var var); + struct PP_Var (*VarFromUtf8)(PP_Module module, + const char* data, + uint32_t len); + const char* (*VarToUtf8)(struct PP_Var var, uint32_t* len); +}; + +struct PPB_Var_1_1 { + void (*AddRef)(struct PP_Var var); + void (*Release)(struct PP_Var var); + struct PP_Var (*VarFromUtf8)(const char* data, uint32_t len); + const char* (*VarToUtf8)(struct PP_Var var, uint32_t* len); +}; +/** + * @} + */ + +/* ppb_var_array.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_VarArray_1_0 { + /** + * Creates an array var, i.e., a PP_Var with type set to + * PP_VARTYPE_ARRAY. The array length is set to 0. + * + * @return An empty array var, whose reference count is set to 1 on behalf of + * the caller. + */ + struct PP_Var (*Create)(void); + /** + * Gets an element from the array. + * + * @param[in] array An array var. + * @param[in] index An index indicating which element to return. + * + * @return The element at the specified position. The reference count of the + * element returned is incremented on behalf of the caller. If + * index is larger than or equal to the array length, an + * undefined var is returned. + */ + struct PP_Var (*Get)(struct PP_Var array, uint32_t index); + /** + * Sets the value of an element in the array. + * + * @param[in] array An array var. + * @param[in] index An index indicating which element to modify. If + * index is larger than or equal to the array length, the length + * is updated to be index + 1. Any position in the array that + * hasn't been set before is set to undefined, i.e., PP_Var of + * type PP_VARTYPE_UNDEFINED. + * @param[in] value The value to set. The array holds a reference to it on + * success. + * + * @return A PP_Bool indicating whether the operation succeeds. + */ + PP_Bool (*Set)(struct PP_Var array, uint32_t index, struct PP_Var value); + /** + * Gets the array length. + * + * @param[in] array An array var. + * + * @return The array length. + */ + uint32_t (*GetLength)(struct PP_Var array); + /** + * Sets the array length. + * + * @param[in] array An array var. + * @param[in] length The new array length. If length is smaller + * than its current value, the array is truncated to the new length; any + * elements that no longer fit are removed and the references to them will be + * released. If length is larger than its current value, + * undefined vars are appended to increase the array to the specified length. + * + * @return A PP_Bool indicating whether the operation succeeds. + */ + PP_Bool (*SetLength)(struct PP_Var array, uint32_t length); +}; + +typedef struct PPB_VarArray_1_0 PPB_VarArray; +/** + * @} + */ + +/* ppb_var_array_buffer.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_VarArrayBuffer interface provides a way to interact + * with JavaScript ArrayBuffers, which represent a contiguous sequence of + * bytes. Use PPB_Var to manage the reference count for a + * VarArrayBuffer. Note that these Vars are not part of the + * embedding page's DOM, and can only be shared with JavaScript using the + * PostMessage and HandleMessage functions of + * pp::Instance. + */ +struct PPB_VarArrayBuffer_1_0 { + /** + * Create() creates a zero-initialized VarArrayBuffer. + * + * @param[in] size_in_bytes The size of the ArrayBuffer to + * be created. + * + * @return A PP_Var representing a VarArrayBuffer + * of the requested size and with a reference count of 1. + */ + struct PP_Var (*Create)(uint32_t size_in_bytes); + /** + * ByteLength() retrieves the length of the VarArrayBuffer in + * bytes. On success, byte_length is set to the length of the + * given ArrayBuffer var. On failure, byte_length + * is unchanged (this could happen, for instance, if the given + * PP_Var is not of type PP_VARTYPE_ARRAY_BUFFER). + * Note that ByteLength() will successfully retrieve the size of an + * ArrayBuffer even if the ArrayBuffer is not + * currently mapped. + * + * @param[in] array The ArrayBuffer whose length should be + * returned. + * + * @param[out] byte_length A variable which is set to the length of the given + * ArrayBuffer on success. + * + * @return PP_TRUE on success, PP_FALSE on failure. + */ + PP_Bool (*ByteLength)(struct PP_Var array, uint32_t* byte_length); + /** + * Map() maps the ArrayBuffer in to the module's address space + * and returns a pointer to the beginning of the buffer for the given + * ArrayBuffer PP_Var. ArrayBuffers are copied when transmitted, + * so changes to the underlying memory are not automatically available to + * the embedding page. + * + * Note that calling Map() can be a relatively expensive operation. Use care + * when calling it in performance-critical code. For example, you should call + * it only once when looping over an ArrayBuffer. + * + * Example: + * + * @code + * char* data = (char*)(array_buffer_if.Map(array_buffer_var)); + * uint32_t byte_length = 0; + * PP_Bool ok = array_buffer_if.ByteLength(array_buffer_var, &byte_length); + * if (!ok) + * return DoSomethingBecauseMyVarIsNotAnArrayBuffer(); + * for (uint32_t i = 0; i < byte_length; ++i) + * data[i] = 'A'; + * @endcode + * + * @param[in] array The ArrayBuffer whose internal buffer should + * be returned. + * + * @return A pointer to the internal buffer for this + * ArrayBuffer. Returns NULL + * if the given PP_Var is not of type + * PP_VARTYPE_ARRAY_BUFFER. + */ + void* (*Map)(struct PP_Var array); + /** + * Unmap() unmaps the given ArrayBuffer var from the module + * address space. Use this if you want to save memory but might want to call + * Map() to map the buffer again later. The PP_Var remains valid + * and should still be released using PPB_Var when you are done + * with the ArrayBuffer. + * + * @param[in] array The ArrayBuffer to be released. + */ + void (*Unmap)(struct PP_Var array); +}; + +typedef struct PPB_VarArrayBuffer_1_0 PPB_VarArrayBuffer; +/** + * @} + */ + +/* ppb_var_dictionary.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * A dictionary var contains key-value pairs with unique keys. The keys are + * strings while the values can be arbitrary vars. Key comparison is always + * done by value instead of by reference. + */ +struct PPB_VarDictionary_1_0 { + /** + * Creates a dictionary var, i.e., a PP_Var with type set to + * PP_VARTYPE_DICTIONARY. + * + * @return An empty dictionary var, whose reference count is set to 1 on + * behalf of the caller. + */ + struct PP_Var (*Create)(void); + /** + * Gets the value associated with the specified key. + * + * @param[in] dict A dictionary var. + * @param[in] key A string var. + * + * @return The value that is associated with key. The reference + * count of the element returned is incremented on behalf of the caller. If + * key is not a string var, or it doesn't exist in + * dict, an undefined var is returned. + */ + struct PP_Var (*Get)(struct PP_Var dict, struct PP_Var key); + /** + * Sets the value associated with the specified key. + * + * @param[in] dict A dictionary var. + * @param[in] key A string var. If this key hasn't existed in + * dict, it is added and associated with value; + * otherwise, the previous value is replaced with value. + * @param[in] value The value to set. The dictionary holds a reference to it + * on success. + * + * @return A PP_Bool indicating whether the operation succeeds. + */ + PP_Bool (*Set)(struct PP_Var dict, struct PP_Var key, struct PP_Var value); + /** + * Deletes the specified key and its associated value, if the key exists. The + * reference to the element will be released. + * + * @param[in] dict A dictionary var. + * @param[in] key A string var. + */ + void (*Delete)(struct PP_Var dict, struct PP_Var key); + /** + * Checks whether a key exists. + * + * @param[in] dict A dictionary var. + * @param[in] key A string var. + * + * @return A PP_Bool indicating whether the key exists. + */ + PP_Bool (*HasKey)(struct PP_Var dict, struct PP_Var key); + /** + * Gets all the keys in a dictionary. Please note that for each key that you + * set into the dictionary, a string var with the same contents is returned; + * but it may not be the same string var (i.e., value.as_id may + * be different). + * + * @param[in] dict A dictionary var. + * + * @return An array var which contains all the keys of dict. Its + * reference count is incremented on behalf of the caller. The elements are + * string vars. Returns a null var if failed. + */ + struct PP_Var (*GetKeys)(struct PP_Var dict); +}; + +typedef struct PPB_VarDictionary_1_0 PPB_VarDictionary; +/** + * @} + */ + +/* ppb_video_decoder.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * Video decoder interface. + * + * Typical usage: + * - Call Create() to create a new video decoder resource. + * - Call Initialize() to initialize it with a 3d graphics context and the + * desired codec profile. + * - Call Decode() continuously (waiting for each previous call to complete) to + * push bitstream buffers to the decoder. + * - Call GetPicture() continuously (waiting for each previous call to complete) + * to pull decoded pictures from the decoder. + * - Call Flush() to signal end of stream to the decoder and perform shutdown + * when it completes. + * - Call Reset() to quickly stop the decoder (e.g. to implement Seek) and wait + * for the callback before restarting decoding at another point. + * - To destroy the decoder, the plugin should release all of its references to + * it. Any pending callbacks will abort before the decoder is destroyed. + * + * Available video codecs vary by platform. + * All: theora, vorbis, vp8. + * Chrome and ChromeOS: aac, h264. + * ChromeOS: mpeg4. + */ +struct PPB_VideoDecoder_1_1 { + /** + * Creates a new video decoder resource. + * + * @param[in] instance A PP_Instance identifying the instance + * with the video decoder. + * + * @return A PP_Resource corresponding to a video decoder if + * successful or 0 otherwise. + */ + PP_Resource (*Create)(PP_Instance instance); + /** + * Determines if the given resource is a video decoder. + * + * @param[in] resource A PP_Resource identifying a resource. + * + * @return PP_TRUE if the resource is a + * PPB_VideoDecoder, PP_FALSE if the resource is + * invalid or some other type. + */ + PP_Bool (*IsVideoDecoder)(PP_Resource resource); + /** + * Initializes a video decoder resource. This should be called after Create() + * and before any other functions. + * + * @param[in] video_decoder A PP_Resource identifying the video + * decoder. + * @param[in] graphics3d_context A PPB_Graphics3D resource to use + * during decoding. + * @param[in] profile A PP_VideoProfile specifying the video + * codec profile. + * @param[in] acceleration A PP_HardwareAcceleration specifying + * whether to use a hardware accelerated or a software implementation. + * @param[in] min_picture_count A count of pictures the plugin would like to + * have in flight. This is effectively the number of times the plugin can + * call GetPicture() and get a decoded frame without calling + * RecyclePicture(). The decoder has its own internal minimum count, and will + * take the larger of its internal and this value. A client that doesn't care + * can therefore just pass in zero for this argument. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_NOTSUPPORTED if video decoding is not available, or the + * requested profile is not supported. In this case, the client may call + * Initialize() again with different parameters to find a good configuration. + * Returns PP_ERROR_BADARGUMENT if the requested minimum picture count is + * unreasonably large. + */ + int32_t (*Initialize)(PP_Resource video_decoder, + PP_Resource graphics3d_context, + PP_VideoProfile profile, + PP_HardwareAcceleration acceleration, + uint32_t min_picture_count, + struct PP_CompletionCallback callback); + /** + * Decodes a bitstream buffer. Copies |size| bytes of data from the plugin's + * |buffer|. The plugin should wait until the decoder signals completion by + * returning PP_OK or by running |callback| before calling Decode() again. + * + * In general, each bitstream buffer should contain a demuxed bitstream frame + * for the selected video codec. For example, H264 decoders expect to receive + * one AnnexB NAL unit, including the 4 byte start code prefix, while VP8 + * decoders expect to receive a bitstream frame without the IVF frame header. + * + * If the call to Decode() eventually results in a picture, the |decode_id| + * parameter is copied into the returned picture. The plugin can use this to + * associate decoded pictures with Decode() calls (e.g. to assign timestamps + * or frame numbers to pictures.) This value is opaque to the API so the + * plugin is free to pass any value. + * + * @param[in] video_decoder A PP_Resource identifying the video + * decoder. + * @param[in] decode_id An optional value, chosen by the plugin, that can be + * used to associate calls to Decode() with decoded pictures returned by + * GetPicture(). + * @param[in] size Buffer size in bytes. + * @param[in] buffer Starting address of buffer. + * @param[in] callback A PP_CompletionCallback to be called on + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_FAILED if the decoder isn't initialized or if a Flush() + * or Reset() call is pending. + * Returns PP_ERROR_INPROGRESS if there is another Decode() call pending. + * Returns PP_ERROR_NOMEMORY if a bitstream buffer can't be created. + * Returns PP_ERROR_ABORTED when Reset() is called while Decode() is pending. + */ + int32_t (*Decode)(PP_Resource video_decoder, + uint32_t decode_id, + uint32_t size, + const void* buffer, + struct PP_CompletionCallback callback); + /** + * Gets the next picture from the decoder. The picture is valid after the + * decoder signals completion by returning PP_OK or running |callback|. The + * plugin can call GetPicture() again after the decoder signals completion. + * When the plugin is finished using the picture, it should return it to the + * system by calling RecyclePicture(). + * + * @param[in] video_decoder A PP_Resource identifying the video + * decoder. + * @param[out] picture A PP_VideoPicture to hold the decoded + * picture. + * @param[in] callback A PP_CompletionCallback to be called on + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_FAILED if the decoder isn't initialized or if a Reset() + * call is pending. + * Returns PP_ERROR_INPROGRESS if there is another GetPicture() call pending. + * Returns PP_ERROR_ABORTED when Reset() is called, or if a call to Flush() + * completes while GetPicture() is pending. + */ + int32_t (*GetPicture)(PP_Resource video_decoder, + struct PP_VideoPicture* picture, + struct PP_CompletionCallback callback); + /** + * Recycles a picture that the plugin has received from the decoder. + * The plugin should call this as soon as it has finished using the texture so + * the decoder can decode more pictures. + * + * @param[in] video_decoder A PP_Resource identifying the video + * decoder. + * @param[in] picture A PP_VideoPicture to return to + * the decoder. + */ + void (*RecyclePicture)(PP_Resource video_decoder, + const struct PP_VideoPicture* picture); + /** + * Flushes the decoder. The plugin should call Flush() when it reaches the + * end of its video stream in order to stop cleanly. The decoder will run any + * pending Decode() call to completion. The plugin should make no further + * calls to the decoder other than GetPicture() and RecyclePicture() until + * the decoder signals completion by running |callback|. Just before + * completion, any pending GetPicture() call will complete by running its + * callback with result PP_ERROR_ABORTED to signal that no more pictures are + * available. Any pictures held by the plugin remain valid during and after + * the flush and should be recycled back to the decoder. + * + * @param[in] video_decoder A PP_Resource identifying the video + * decoder. + * @param[in] callback A PP_CompletionCallback to be called on + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_FAILED if the decoder isn't initialized. + */ + int32_t (*Flush)(PP_Resource video_decoder, + struct PP_CompletionCallback callback); + /** + * Resets the decoder as quickly as possible. The plugin can call Reset() to + * skip to another position in the video stream. After Reset() returns, any + * pending calls to Decode() and GetPicture()) abort, causing their callbacks + * to run with PP_ERROR_ABORTED. The plugin should not make further calls to + * the decoder other than RecyclePicture() until the decoder signals + * completion by running |callback|. Any pictures held by the plugin remain + * valid during and after the reset and should be recycled back to the + * decoder. + * + * @param[in] video_decoder A PP_Resource identifying the video + * decoder. + * @param[in] callback A PP_CompletionCallback to be called on + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_FAILED if the decoder isn't initialized. + */ + int32_t (*Reset)(PP_Resource video_decoder, + struct PP_CompletionCallback callback); +}; + +typedef struct PPB_VideoDecoder_1_1 PPB_VideoDecoder; + +struct PPB_VideoDecoder_0_1 { + PP_Resource (*Create)(PP_Instance instance); + PP_Bool (*IsVideoDecoder)(PP_Resource resource); + int32_t (*Initialize)(PP_Resource video_decoder, + PP_Resource graphics3d_context, + PP_VideoProfile profile, + PP_Bool allow_software_fallback, + struct PP_CompletionCallback callback); + int32_t (*Decode)(PP_Resource video_decoder, + uint32_t decode_id, + uint32_t size, + const void* buffer, + struct PP_CompletionCallback callback); + int32_t (*GetPicture)(PP_Resource video_decoder, + struct PP_VideoPicture_0_1* picture, + struct PP_CompletionCallback callback); + void (*RecyclePicture)(PP_Resource video_decoder, + const struct PP_VideoPicture* picture); + int32_t (*Flush)(PP_Resource video_decoder, + struct PP_CompletionCallback callback); + int32_t (*Reset)(PP_Resource video_decoder, + struct PP_CompletionCallback callback); +}; + +struct PPB_VideoDecoder_0_2 { + PP_Resource (*Create)(PP_Instance instance); + PP_Bool (*IsVideoDecoder)(PP_Resource resource); + int32_t (*Initialize)(PP_Resource video_decoder, + PP_Resource graphics3d_context, + PP_VideoProfile profile, + PP_HardwareAcceleration acceleration, + struct PP_CompletionCallback callback); + int32_t (*Decode)(PP_Resource video_decoder, + uint32_t decode_id, + uint32_t size, + const void* buffer, + struct PP_CompletionCallback callback); + int32_t (*GetPicture)(PP_Resource video_decoder, + struct PP_VideoPicture_0_1* picture, + struct PP_CompletionCallback callback); + void (*RecyclePicture)(PP_Resource video_decoder, + const struct PP_VideoPicture* picture); + int32_t (*Flush)(PP_Resource video_decoder, + struct PP_CompletionCallback callback); + int32_t (*Reset)(PP_Resource video_decoder, + struct PP_CompletionCallback callback); +}; + +struct PPB_VideoDecoder_1_0 { + PP_Resource (*Create)(PP_Instance instance); + PP_Bool (*IsVideoDecoder)(PP_Resource resource); + int32_t (*Initialize)(PP_Resource video_decoder, + PP_Resource graphics3d_context, + PP_VideoProfile profile, + PP_HardwareAcceleration acceleration, + struct PP_CompletionCallback callback); + int32_t (*Decode)(PP_Resource video_decoder, + uint32_t decode_id, + uint32_t size, + const void* buffer, + struct PP_CompletionCallback callback); + int32_t (*GetPicture)(PP_Resource video_decoder, + struct PP_VideoPicture* picture, + struct PP_CompletionCallback callback); + void (*RecyclePicture)(PP_Resource video_decoder, + const struct PP_VideoPicture* picture); + int32_t (*Flush)(PP_Resource video_decoder, + struct PP_CompletionCallback callback); + int32_t (*Reset)(PP_Resource video_decoder, + struct PP_CompletionCallback callback); +}; +/** + * @} + */ + +/* ppb_video_frame.idl */ +/** + * @addtogroup Enums + * @{ + */ +typedef enum { + /** + * Unknown format value. + */ + PP_VIDEOFRAME_FORMAT_UNKNOWN = 0, + /** + * 12bpp YVU planar 1x1 Y, 2x2 VU samples. + */ + PP_VIDEOFRAME_FORMAT_YV12 = 1, + /** + * 12bpp YUV planar 1x1 Y, 2x2 UV samples. + */ + PP_VIDEOFRAME_FORMAT_I420 = 2, + /** + * 32bpp BGRA. + */ + PP_VIDEOFRAME_FORMAT_BGRA = 3, + /** + * The last format. + */ + PP_VIDEOFRAME_FORMAT_LAST = PP_VIDEOFRAME_FORMAT_BGRA +} PP_VideoFrame_Format; +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_VideoFrame_0_1 { + /** + * Determines if a resource is a VideoFrame resource. + * + * @param[in] resource The PP_Resource to test. + * + * @return A PP_Bool with PP_TRUE if the given + * resource is a VideoFrame resource or PP_FALSE otherwise. + */ + PP_Bool (*IsVideoFrame)(PP_Resource resource); + /** + * Gets the timestamp of the video frame. + * + * @param[in] frame A PP_Resource corresponding to a video frame + * resource. + * + * @return A PP_TimeDelta containing the timestamp of the video + * frame. Given in seconds since the start of the containing video stream. + */ + PP_TimeDelta (*GetTimestamp)(PP_Resource frame); + /** + * Sets the timestamp of the video frame. Given in seconds since the + * start of the containing video stream. + * + * @param[in] frame A PP_Resource corresponding to a video frame + * resource. + * @param[in] timestamp A PP_TimeDelta containing the timestamp + * of the video frame. Given in seconds since the start of the containing + * video stream. + */ + void (*SetTimestamp)(PP_Resource frame, PP_TimeDelta timestamp); + /** + * Gets the format of the video frame. + * + * @param[in] frame A PP_Resource corresponding to a video frame + * resource. + * + * @return A PP_VideoFrame_Format containing the format of the + * video frame. + */ + PP_VideoFrame_Format (*GetFormat)(PP_Resource frame); + /** + * Gets the size of the video frame. + * + * @param[in] frame A PP_Resource corresponding to a video frame + * resource. + * @param[out] size A PP_Size. + * + * @return A PP_Bool with PP_TRUE on success or + * PP_FALSE on failure. + */ + PP_Bool (*GetSize)(PP_Resource frame, struct PP_Size* size); + /** + * Gets the data buffer for video frame pixels. + * + * @param[in] frame A PP_Resource corresponding to a video frame + * resource. + * + * @return A pointer to the beginning of the data buffer. + */ + void* (*GetDataBuffer)(PP_Resource frame); + /** + * Gets the size of data buffer. + * + * @param[in] frame A PP_Resource corresponding to a video frame + * resource. + * + * @return The size of the data buffer. + */ + uint32_t (*GetDataBufferSize)(PP_Resource frame); +}; + +typedef struct PPB_VideoFrame_0_1 PPB_VideoFrame; +/** + * @} + */ + +/* ppb_video_encoder.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * Video encoder interface. + * + * Typical usage: + * - Call Create() to create a new video encoder resource. + * - Call GetSupportedFormats() to determine which codecs and profiles are + * available. + * - Call Initialize() to initialize the encoder for a supported profile. + * - Call GetVideoFrame() to get a blank frame and fill it in, or get a video + * frame from another resource, e.g. PPB_MediaStreamVideoTrack. + * - Call Encode() to push the video frame to the encoder. If an external frame + * is pushed, wait for completion to recycle the frame. + * - Call GetBitstreamBuffer() continuously (waiting for each previous call to + * complete) to pull encoded pictures from the encoder. + * - Call RecycleBitstreamBuffer() after consuming the data in the bitstream + * buffer. + * - To destroy the encoder, the plugin should release all of its references to + * it. Any pending callbacks will abort before the encoder is destroyed. + * + * Available video codecs vary by platform. + * All: vp8 (software). + * ChromeOS, depending on your device: h264 (hardware), vp8 (hardware) + */ +struct PPB_VideoEncoder_0_2 { + /** + * Creates a new video encoder resource. + * + * @param[in] instance A PP_Instance identifying the instance + * with the video encoder. + * + * @return A PP_Resource corresponding to a video encoder if + * successful or 0 otherwise. + */ + PP_Resource (*Create)(PP_Instance instance); + /** + * Determines if the given resource is a video encoder. + * + * @param[in] resource A PP_Resource identifying a resource. + * + * @return PP_TRUE if the resource is a + * PPB_VideoEncoder, PP_FALSE if the resource is + * invalid or some other type. + */ + PP_Bool (*IsVideoEncoder)(PP_Resource resource); + /** + * Gets an array of supported video encoder profiles. + * These can be used to choose a profile before calling Initialize(). + * + * @param[in] video_encoder A PP_Resource identifying the video + * encoder. + * @param[in] output A PP_ArrayOutput to receive the supported + * PP_VideoProfileDescription structs. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return If >= 0, the number of supported profiles returned, otherwise an + * error code from pp_errors.h. + */ + int32_t (*GetSupportedProfiles)(PP_Resource video_encoder, + struct PP_ArrayOutput output, + struct PP_CompletionCallback callback); + /** + * Initializes a video encoder resource. The plugin should call Initialize() + * successfully before calling any of the functions below. + * + * @param[in] video_encoder A PP_Resource identifying the video + * encoder. + * @param[in] input_format The PP_VideoFrame_Format of the + * frames which will be encoded. + * @param[in] input_visible_size A PP_Size specifying the + * dimensions of the visible part of the input frames. + * @param[in] output_profile A PP_VideoProfile specifying the + * codec profile of the encoded output stream. + * @param[in] acceleration A PP_HardwareAcceleration specifying + * whether to use a hardware accelerated or a software implementation. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_NOTSUPPORTED if video encoding is not available, or the + * requested codec profile is not supported. + */ + int32_t (*Initialize)(PP_Resource video_encoder, + PP_VideoFrame_Format input_format, + const struct PP_Size* input_visible_size, + PP_VideoProfile output_profile, + uint32_t initial_bitrate, + PP_HardwareAcceleration acceleration, + struct PP_CompletionCallback callback); + /** + * Gets the number of input video frames that the encoder may hold while + * encoding. If the plugin is providing the video frames, it should have at + * least this many available. + * + * @param[in] video_encoder A PP_Resource identifying the video + * encoder. + * @return An int32_t containing the number of frames required, or an error + * code from pp_errors.h. + * Returns PP_ERROR_FAILED if Initialize() has not successfully completed. + */ + int32_t (*GetFramesRequired)(PP_Resource video_encoder); + /** + * Gets the coded size of the video frames required by the encoder. Coded + * size is the logical size of the input frames, in pixels. The encoder may + * have hardware alignment requirements that make this different from + * |input_visible_size|, as requested in the call to Initialize(). + * + * @param[in] video_encoder A PP_Resource identifying the video + * encoder. + * @param[in] coded_size A PP_Size to hold the coded size. + * @return An int32_t containing a result code from pp_errors.h. + * Returns PP_ERROR_FAILED if Initialize() has not successfully completed. + */ + int32_t (*GetFrameCodedSize)(PP_Resource video_encoder, + struct PP_Size* coded_size); + /** + * Gets a blank video frame which can be filled with video data and passed + * to the encoder. + * + * @param[in] video_encoder A PP_Resource identifying the video + * encoder. + * @param[out] video_frame A blank PPB_VideoFrame resource. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_FAILED if Initialize() has not successfully completed. + */ + int32_t (*GetVideoFrame)(PP_Resource video_encoder, + PP_Resource* video_frame, + struct PP_CompletionCallback callback); + /** + * Encodes a video frame. + * + * @param[in] video_encoder A PP_Resource identifying the video + * encoder. + * @param[in] video_frame The PPB_VideoFrame to be encoded. + * @param[in] force_keyframe A PP_Bool> specifying whether the encoder + * should emit a key frame for this video frame. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. Plugins that pass PPB_VideoFrame resources owned + * by other resources should wait for completion before reusing them. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_FAILED if Initialize() has not successfully completed. + */ + int32_t (*Encode)(PP_Resource video_encoder, + PP_Resource video_frame, + PP_Bool force_keyframe, + struct PP_CompletionCallback callback); + /** + * Gets the next encoded bitstream buffer from the encoder. + * + * @param[in] video_encoder A PP_Resource identifying the video + * encoder. + * @param[out] bitstream_buffer A PP_BitstreamBuffer containing + * encoded video data. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion. The plugin can call GetBitstreamBuffer from the callback in + * order to continuously "pull" bitstream buffers from the encoder. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_FAILED if Initialize() has not successfully completed. + * Returns PP_ERROR_INPROGRESS if a prior call to GetBitstreamBuffer() has + * not completed. + */ + int32_t (*GetBitstreamBuffer)(PP_Resource video_encoder, + struct PP_BitstreamBuffer* bitstream_buffer, + struct PP_CompletionCallback callback); + /** + * Recycles a bitstream buffer back to the encoder. + * + * @param[in] video_encoder A PP_Resource identifying the video + * encoder. + * @param[in] bitstream_buffer A PP_BitstreamBuffer that is no + * longer needed by the plugin. + */ + void (*RecycleBitstreamBuffer)( + PP_Resource video_encoder, + const struct PP_BitstreamBuffer* bitstream_buffer); + /** + * Requests a change to encoding parameters. This is only a request, + * fulfilled on a best-effort basis. + * + * @param[in] video_encoder A PP_Resource identifying the video + * encoder. + * @param[in] bitrate The requested new bitrate, in bits per second. + * @param[in] framerate The requested new framerate, in frames per second. + */ + void (*RequestEncodingParametersChange)(PP_Resource video_encoder, + uint32_t bitrate, + uint32_t framerate); + /** + * Closes the video encoder, and cancels any pending encodes. Any pending + * callbacks will still run, reporting PP_ERROR_ABORTED . It is + * not valid to call any encoder functions after a call to this method. + * Note: Destroying the video encoder closes it implicitly, + * so you are not required to call Close(). + * + * @param[in] video_encoder A PP_Resource identifying the video + * encoder. + */ + void (*Close)(PP_Resource video_encoder); +}; + +typedef struct PPB_VideoEncoder_0_2 PPB_VideoEncoder; + +struct PPB_VideoEncoder_0_1 { /* dev */ + PP_Resource (*Create)(PP_Instance instance); + PP_Bool (*IsVideoEncoder)(PP_Resource resource); + int32_t (*GetSupportedProfiles)(PP_Resource video_encoder, + struct PP_ArrayOutput output, + struct PP_CompletionCallback callback); + int32_t (*Initialize)(PP_Resource video_encoder, + PP_VideoFrame_Format input_format, + const struct PP_Size* input_visible_size, + PP_VideoProfile output_profile, + uint32_t initial_bitrate, + PP_HardwareAcceleration acceleration, + struct PP_CompletionCallback callback); + int32_t (*GetFramesRequired)(PP_Resource video_encoder); + int32_t (*GetFrameCodedSize)(PP_Resource video_encoder, + struct PP_Size* coded_size); + int32_t (*GetVideoFrame)(PP_Resource video_encoder, + PP_Resource* video_frame, + struct PP_CompletionCallback callback); + int32_t (*Encode)(PP_Resource video_encoder, + PP_Resource video_frame, + PP_Bool force_keyframe, + struct PP_CompletionCallback callback); + int32_t (*GetBitstreamBuffer)(PP_Resource video_encoder, + struct PP_BitstreamBuffer* bitstream_buffer, + struct PP_CompletionCallback callback); + void (*RecycleBitstreamBuffer)( + PP_Resource video_encoder, + const struct PP_BitstreamBuffer* bitstream_buffer); + void (*RequestEncodingParametersChange)(PP_Resource video_encoder, + uint32_t bitrate, + uint32_t framerate); + void (*Close)(PP_Resource video_encoder); +}; +/** + * @} + */ + +/* ppb_view.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * PPB_View represents the state of the view of an instance. + * You will receive new view information using + * PPP_Instance.DidChangeView. + */ +struct PPB_View_1_2 { + /** + * IsView() determines if the given resource is a valid + * PPB_View resource. Note that PPB_ViewChanged + * resources derive from PPB_View and will return true here + * as well. + * + * @param resource A PP_Resource corresponding to a + * PPB_View resource. + * + * @return PP_TRUE if the given resource supports + * PPB_View or PP_FALSE if it is an invalid + * resource or is a resource of another type. + */ + PP_Bool (*IsView)(PP_Resource resource); + /** + * GetRect() retrieves the rectangle of the module instance associated + * with a view changed notification relative to the upper-left of the browser + * viewport. This position changes when the page is scrolled. + * + * The returned rectangle may not be inside the visible portion of the + * viewport if the module instance is scrolled off the page. Therefore, the + * position may be negative or larger than the size of the page. The size will + * always reflect the size of the module were it to be scrolled entirely into + * view. + * + * In general, most modules will not need to worry about the position of the + * module instance in the viewport, and only need to use the size. + * + * @param resource A PP_Resource corresponding to a + * PPB_View resource. + * + * @param rect A PP_Rect receiving the rectangle on success. + * + * @return Returns PP_TRUE if the resource was valid and the + * viewport rectangle was filled in, PP_FALSE if not. + */ + PP_Bool (*GetRect)(PP_Resource resource, struct PP_Rect* rect); + /** + * IsFullscreen() returns whether the instance is currently + * displaying in fullscreen mode. + * + * @param resource A PP_Resource corresponding to a + * PPB_View resource. + * + * @return PP_TRUE if the instance is in full screen mode, + * or PP_FALSE if it's not or the resource is invalid. + */ + PP_Bool (*IsFullscreen)(PP_Resource resource); + /** + * IsVisible() determines whether the module instance might be visible to + * the user. For example, the Chrome window could be minimized or another + * window could be over it. In both of these cases, the module instance + * would not be visible to the user, but IsVisible() will return true. + * + * Use the result to speed up or stop updates for invisible module + * instances. + * + * This function performs the duties of GetRect() (determining whether the + * module instance is scrolled into view and the clip rectangle is nonempty) + * and IsPageVisible() (whether the page is visible to the user). + * + * @param resource A PP_Resource corresponding to a + * PPB_View resource. + * + * @return PP_TRUE if the instance might be visible to the + * user, PP_FALSE if it is definitely not visible. + */ + PP_Bool (*IsVisible)(PP_Resource resource); + /** + * IsPageVisible() determines if the page that contains the module instance + * is visible. The most common cause of invisible pages is that + * the page is in a background tab in the browser. + * + * Most applications should use IsVisible() instead of this function since + * the module instance could be scrolled off of a visible page, and this + * function will still return true. However, depending on how your module + * interacts with the page, there may be certain updates that you may want to + * perform when the page is visible even if your specific module instance is + * not visible. + * + * @param resource A PP_Resource corresponding to a + * PPB_View resource. + * + * @return PP_TRUE if the instance is plausibly visible to the + * user, PP_FALSE if it is definitely not visible. + */ + PP_Bool (*IsPageVisible)(PP_Resource resource); + /** + * GetClipRect() returns the clip rectangle relative to the upper-left corner + * of the module instance. This rectangle indicates the portions of the module + * instance that are scrolled into view. + * + * If the module instance is scrolled off the view, the return value will be + * (0, 0, 0, 0). This clip rectangle does not take into account page + * visibility. Therefore, if the module instance is scrolled into view, but + * the page itself is on a tab that is not visible, the return rectangle will + * contain the visible rectangle as though the page were visible. Refer to + * IsPageVisible() and IsVisible() if you want to account for page + * visibility. + * + * Most applications will not need to worry about the clip rectangle. The + * recommended behavior is to do full updates if the module instance is + * visible, as determined by IsVisible(), and do no updates if it is not + * visible. + * + * However, if the cost for computing pixels is very high for your + * application, or the pages you're targeting frequently have very large + * module instances with small visible portions, you may wish to optimize + * further. In this case, the clip rectangle will tell you which parts of + * the module to update. + * + * Note that painting of the page and sending of view changed updates + * happens asynchronously. This means when the user scrolls, for example, + * it is likely that the previous backing store of the module instance will + * be used for the first paint, and will be updated later when your + * application generates new content with the new clip. This may cause + * flickering at the boundaries when scrolling. If you do choose to do + * partial updates, you may want to think about what color the invisible + * portions of your backing store contain (be it transparent or some + * background color) or to paint a certain region outside the clip to reduce + * the visual distraction when this happens. + * + * @param resource A PP_Resource corresponding to a + * PPB_View resource. + * + * @param clip Output argument receiving the clip rect on success. + * + * @return Returns PP_TRUE if the resource was valid and the + * clip rect was filled in, PP_FALSE if not. + */ + PP_Bool (*GetClipRect)(PP_Resource resource, struct PP_Rect* clip); + /** + * GetDeviceScale returns the scale factor between device pixels and Density + * Independent Pixels (DIPs, also known as logical pixels or UI pixels on + * some platforms). This allows the developer to render their contents at + * device resolution, even as coordinates / sizes are given in DIPs through + * the API. + * + * Note that the coordinate system for Pepper APIs is DIPs. Also note that + * one DIP might not equal one CSS pixel - when page scale/zoom is in effect. + * + * @param[in] resource A PP_Resource corresponding to a + * PPB_View resource. + * + * @return A float value representing the number of device pixels + * per DIP. If the resource is invalid, the value will be 0.0. + */ + float (*GetDeviceScale)(PP_Resource resource); + /** + * GetCSSScale returns the scale factor between DIPs and CSS pixels. This + * allows proper scaling between DIPs - as sent via the Pepper API - and CSS + * pixel coordinates used for Web content. + * + * @param[in] resource A PP_Resource corresponding to a + * PPB_View resource. + * + * @return css_scale A float value representing the number of + * DIPs per CSS pixel. If the resource is invalid, the value will be 0.0. + */ + float (*GetCSSScale)(PP_Resource resource); + /** + * GetScrollOffset returns the scroll offset of the window containing the + * plugin. + * + * @param[in] resource A PP_Resource corresponding to a + * PPB_View resource. + * + * @param[out] offset A PP_Point which will be set to the value + * of the scroll offset in CSS pixels. + * + * @return Returns PP_TRUE if the resource was valid and the + * offset was filled in, PP_FALSE if not. + */ + PP_Bool (*GetScrollOffset)(PP_Resource resource, struct PP_Point* offset); +}; + +typedef struct PPB_View_1_2 PPB_View; + +struct PPB_View_1_0 { + PP_Bool (*IsView)(PP_Resource resource); + PP_Bool (*GetRect)(PP_Resource resource, struct PP_Rect* rect); + PP_Bool (*IsFullscreen)(PP_Resource resource); + PP_Bool (*IsVisible)(PP_Resource resource); + PP_Bool (*IsPageVisible)(PP_Resource resource); + PP_Bool (*GetClipRect)(PP_Resource resource, struct PP_Rect* clip); +}; + +struct PPB_View_1_1 { + PP_Bool (*IsView)(PP_Resource resource); + PP_Bool (*GetRect)(PP_Resource resource, struct PP_Rect* rect); + PP_Bool (*IsFullscreen)(PP_Resource resource); + PP_Bool (*IsVisible)(PP_Resource resource); + PP_Bool (*IsPageVisible)(PP_Resource resource); + PP_Bool (*GetClipRect)(PP_Resource resource, struct PP_Rect* clip); + float (*GetDeviceScale)(PP_Resource resource); + float (*GetCSSScale)(PP_Resource resource); +}; +/** + * @} + */ + +/* ppb_vpn_provider.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * Use the PPB_VpnProvider interface to implement a VPN client. + * Important: This API is available only on Chrome OS. + * + * This interface enhances the chrome.vpnProvider JavaScript API by + * providing a high performance path for packet handling. + * + * Permissions: Apps permission vpnProvider is required for + * PPB_VpnProvider.Bind(). + * + * Typical usage: + * - Create a PPB_VpnProvider instance. + * - Register the callback for PPB_VpnProvider.ReceivePacket(). + * - In the extension follow the usual workflow for configuring a VPN connection + * via the chrome.vpnProvider API until the step for notifying + * the connection state as "connected". + * - Bind to the previously created connection using + * PPB_VpnProvider.Bind(). + * - Notify the connection state as "connected" from JavaScript using + * chrome.vpnProvider.notifyConnectionStateChanged. + * - When the steps above are completed without errors, a virtual tunnel is + * created to the network stack of Chrome OS. IP packets can be sent through + * the tunnel using PPB_VpnProvider.SendPacket() and any packets + * originating on the Chrome OS device will be received using the callback + * registered for PPB_VpnProvider.ReceivePacket(). + * - When the user disconnects from the VPN configuration or there is an error + * the extension will be notfied via + * chrome.vpnProvider.onPlatformMessage. + */ +struct PPB_VpnProvider_0_1 { /* dev */ + /** + * Create() creates a VpnProvider instance. + * + * @param[in] instance A PP_Instance identifying the instance + * with the VpnProvider. + * + * @return A PP_Resource corresponding to a VpnProvider if + * successful. + */ + PP_Resource (*Create)(PP_Instance instance); + /** + * IsVpnProvider() determines if the provided resource is a + * VpnProvider instance. + * + * @param[in] resource A PP_Resource corresponding to a + * VpnProvider. + * + * @return Returns PP_TRUE if resource is a + * PPB_VpnProvider, PP_FALSE if the + * resource is invalid or some type other than + * PPB_VpnProvider. + */ + PP_Bool (*IsVpnProvider)(PP_Resource resource); + /** + * Bind() binds to an existing configuration created from JavaScript by + * chrome.vpnProvider.createConfig. All packets will be routed + * via SendPacket and ReceivePacket. The user should + * register the callback for ReceivePacket before calling + * Bind(). + * + * @param[in] vpn_provider A PP_Resource corresponding to a + * VpnProvider. + * + * @param[in] configuration_id A PP_VARTYPE_STRING representing + * the configuration id from the callback of + * chrome.vpnProvider.createConfig. + * + * @param[in] configuration_name A PP_VARTYPE_STRING representing + * the configuration name as defined by the user when calling + * chrome.vpnProvider.createConfig. + * + * @param[in] callback A PP_CompletionCallback called on + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_INPROGRESS if a previous call to + * Bind() has not completed. + * Returns PP_ERROR_BADARGUMENT if either + * configuration_id or configuration_name are not of + * type PP_VARTYPE_STRING. + * Returns PP_ERROR_NOACCESS if the caller does the have the + * required "vpnProvider" permission. + * Returns PP_ERROR_FAILED if connection_id and + * connection_name could not be matched with the existing + * connection, or if the plugin originates from a different extension than the + * one that created the connection. + */ + int32_t (*Bind)(PP_Resource vpn_provider, + struct PP_Var configuration_id, + struct PP_Var configuration_name, + struct PP_CompletionCallback callback); + /** + * SendPacket() sends an IP packet through the tunnel created for the VPN + * session. This will succeed only when the VPN session is owned by the + * module and the connection is bound. + * + * @param[in] vpn_provider A PP_Resource corresponding to a + * VpnProvider. + * + * @param[in] packet A PP_VARTYPE_ARRAY_BUFFER corresponding to + * an IP packet to be sent to the platform. + * + * @param[in] callback A PP_CompletionCallback called on + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_FAILED if the connection is not bound. + * Returns PP_ERROR_INPROGRESS if a previous call to + * SendPacket() has not completed. + * Returns PP_ERROR_BADARGUMENT if packet is not of + * type PP_VARTYPE_ARRAY_BUFFER. + */ + int32_t (*SendPacket)(PP_Resource vpn_provider, + struct PP_Var packet, + struct PP_CompletionCallback callback); + /** + * ReceivePacket() receives an IP packet from the tunnel for the VPN session. + * This function only returns a single packet. This function must be called at + * least N times to receive N packets, no matter the size of each packet. The + * callback should be registered before calling Bind(). + * + * @param[in] vpn_provider A PP_Resource corresponding to a + * VpnProvider. + * + * @param[out] packet The received packet is copied to provided + * packet. The packet must remain valid until + * ReceivePacket() completes. Its received PP_VarType will be + * PP_VARTYPE_ARRAY_BUFFER. + * + * @param[in] callback A PP_CompletionCallback called on + * completion. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_INPROGRESS if a previous call to + * ReceivePacket() has not completed. + */ + int32_t (*ReceivePacket)(PP_Resource vpn_provider, + struct PP_Var* packet, + struct PP_CompletionCallback callback); +}; +/** + * @} + */ + +/* ppb_websocket.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * This enumeration contains the types representing the WebSocket ready state + * and these states are based on the JavaScript WebSocket API specification. + * GetReadyState() returns one of these states. + */ +typedef enum { + /** + * Ready state is queried on an invalid resource. + */ + PP_WEBSOCKETREADYSTATE_INVALID = -1, + /** + * Ready state that the connection has not yet been established. + */ + PP_WEBSOCKETREADYSTATE_CONNECTING = 0, + /** + * Ready state that the WebSocket connection is established and communication + * is possible. + */ + PP_WEBSOCKETREADYSTATE_OPEN = 1, + /** + * Ready state that the connection is going through the closing handshake. + */ + PP_WEBSOCKETREADYSTATE_CLOSING = 2, + /** + * Ready state that the connection has been closed or could not be opened. + */ + PP_WEBSOCKETREADYSTATE_CLOSED = 3 +} PP_WebSocketReadyState; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_WebSocketReadyState, 4); + +/** + * This enumeration contains status codes. These codes are used in Close() and + * GetCloseCode(). Refer to RFC 6455, The WebSocket Protocol, for further + * information. + * PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE and codes in the range + * PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MIN to + * PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MAX, and + * PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MIN to + * PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MAX are valid for Close(). + */ +typedef enum { + /** + * Indicates to request closing connection without status code and reason. + * + * (Note that the code 1005 is forbidden to send in actual close frames by + * the RFC. PP_WebSocket reuses this code internally and the code will never + * appear in the actual close frames.) + */ + PP_WEBSOCKETSTATUSCODE_NOT_SPECIFIED = 1005, + /** + * Status codes in the range 0-999 are not used. + */ + /** + * Indicates a normal closure. + */ + PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE = 1000, + /** + * Indicates that an endpoint is "going away", such as a server going down. + */ + PP_WEBSOCKETSTATUSCODE_GOING_AWAY = 1001, + /** + * Indicates that an endpoint is terminating the connection due to a protocol + * error. + */ + PP_WEBSOCKETSTATUSCODE_PROTOCOL_ERROR = 1002, + /** + * Indicates that an endpoint is terminating the connection because it has + * received a type of data it cannot accept. + */ + PP_WEBSOCKETSTATUSCODE_UNSUPPORTED_DATA = 1003, + /** + * Status code 1004 is reserved. + */ + /** + * Pseudo code to indicate that receiving close frame doesn't contain any + * status code. + */ + PP_WEBSOCKETSTATUSCODE_NO_STATUS_RECEIVED = 1005, + /** + * Pseudo code to indicate that connection was closed abnormally, e.g., + * without closing handshake. + */ + PP_WEBSOCKETSTATUSCODE_ABNORMAL_CLOSURE = 1006, + /** + * Indicates that an endpoint is terminating the connection because it has + * received data within a message that was not consistent with the type of + * the message (e.g., non-UTF-8 data within a text message). + */ + PP_WEBSOCKETSTATUSCODE_INVALID_FRAME_PAYLOAD_DATA = 1007, + /** + * Indicates that an endpoint is terminating the connection because it has + * received a message that violates its policy. + */ + PP_WEBSOCKETSTATUSCODE_POLICY_VIOLATION = 1008, + /** + * Indicates that an endpoint is terminating the connection because it has + * received a message that is too big for it to process. + */ + PP_WEBSOCKETSTATUSCODE_MESSAGE_TOO_BIG = 1009, + /** + * Indicates that an endpoint (client) is terminating the connection because + * it has expected the server to negotiate one or more extension, but the + * server didn't return them in the response message of the WebSocket + * handshake. + */ + PP_WEBSOCKETSTATUSCODE_MANDATORY_EXTENSION = 1010, + /** + * Indicates that a server is terminating the connection because it + * encountered an unexpected condition. + */ + PP_WEBSOCKETSTATUSCODE_INTERNAL_SERVER_ERROR = 1011, + /** + * Status codes in the range 1012-1014 are reserved. + */ + /** + * Pseudo code to indicate that the connection was closed due to a failure to + * perform a TLS handshake. + */ + PP_WEBSOCKETSTATUSCODE_TLS_HANDSHAKE = 1015, + /** + * Status codes in the range 1016-2999 are reserved. + */ + /** + * Status codes in the range 3000-3999 are reserved for use by libraries, + * frameworks, and applications. These codes are registered directly with + * IANA. + */ + PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MIN = 3000, + PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MAX = 3999, + /** + * Status codes in the range 4000-4999 are reserved for private use. + * Application can use these codes for application specific purposes freely. + */ + PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MIN = 4000, + PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MAX = 4999 +} PP_WebSocketCloseCode; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_WebSocketCloseCode, 4); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_WebSocket interface provides bi-directional, + * full-duplex, communications over a single TCP socket. + */ +struct PPB_WebSocket_1_0 { + /** + * Create() creates a WebSocket instance. + * + * @param[in] instance A PP_Instance identifying the instance + * with the WebSocket. + * + * @return A PP_Resource corresponding to a WebSocket if + * successful. + */ + PP_Resource (*Create)(PP_Instance instance); + /** + * IsWebSocket() determines if the provided resource is a + * WebSocket instance. + * + * @param[in] resource A PP_Resource corresponding to a + * WebSocket. + * + * @return Returns PP_TRUE if resource is a + * PPB_WebSocket, PP_FALSE if the + * resource is invalid or some type other than + * PPB_WebSocket. + */ + PP_Bool (*IsWebSocket)(PP_Resource resource); + /** + * Connect() connects to the specified WebSocket server. You can call this + * function once for a web_socket. + * + * @param[in] web_socket A PP_Resource corresponding to a + * WebSocket. + * + * @param[in] url A PP_Var representing a WebSocket server URL. + * The PP_VarType must be PP_VARTYPE_STRING. + * + * @param[in] protocols A pointer to an array of PP_Var + * specifying sub-protocols. Each PP_Var represents one + * sub-protocol and its PP_VarType must be + * PP_VARTYPE_STRING. This argument can be null only if + * protocol_count is 0. + * + * @param[in] protocol_count The number of sub-protocols in + * protocols. + * + * @param[in] callback A PP_CompletionCallback called + * when a connection is established or an error occurs in establishing + * connection. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_BADARGUMENT if the specified + * url, or protocols contain an invalid string as + * defined in the WebSocket API specification. + * PP_ERROR_BADARGUMENT corresponds to a SyntaxError in the + * WebSocket API specification. + * Returns PP_ERROR_NOACCESS if the protocol specified in the + * url is not a secure protocol, but the origin of the caller + * has a secure scheme. Also returns PP_ERROR_NOACCESS if the + * port specified in the url is a port that the user agent + * is configured to block access to because it is a well-known port like + * SMTP. PP_ERROR_NOACCESS corresponds to a SecurityError of the + * specification. + * Returns PP_ERROR_INPROGRESS if this is not the first call to + * Connect(). + */ + int32_t (*Connect)(PP_Resource web_socket, + struct PP_Var url, + const struct PP_Var protocols[], + uint32_t protocol_count, + struct PP_CompletionCallback callback); + /** + * Close() closes the specified WebSocket connection by specifying + * code and reason. + * + * @param[in] web_socket A PP_Resource corresponding to a + * WebSocket. + * + * @param[in] code The WebSocket close code. This is ignored if it is + * PP_WEBSOCKETSTATUSCODE_NOT_SPECIFIED. + * PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE must be used for the + * usual case. To indicate some specific error cases, codes in the range + * PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MIN to + * PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MAX, and in the range + * PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MIN to + * PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MAX are available. + * + * @param[in] reason A PP_Var representing the WebSocket + * close reason. This is ignored if it is PP_VARTYPE_UNDEFINED. + * Otherwise, its PP_VarType must be + * PP_VARTYPE_STRING. + * + * @param[in] callback A PP_CompletionCallback called + * when the connection is closed or an error occurs in closing the + * connection. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_BADARGUMENT if reason contains + * an invalid character as a UTF-8 string, or is longer than 123 bytes. + * PP_ERROR_BADARGUMENT corresponds to a JavaScript SyntaxError + * in the WebSocket API specification. + * Returns PP_ERROR_NOACCESS if the code is not an integer + * equal to 1000 or in the range 3000 to 4999. PP_ERROR_NOACCESS + * corresponds to an InvalidAccessError in the WebSocket API specification. + * Returns PP_ERROR_INPROGRESS if a previous call to Close() is + * not finished. + */ + int32_t (*Close)(PP_Resource web_socket, + uint16_t code, + struct PP_Var reason, + struct PP_CompletionCallback callback); + /** + * ReceiveMessage() receives a message from the WebSocket server. + * This interface only returns a single message. That is, this interface must + * be called at least N times to receive N messages, no matter the size of + * each message. + * + * @param[in] web_socket A PP_Resource corresponding to a + * WebSocket. + * + * @param[out] message The received message is copied to provided + * message. The message must remain valid until + * ReceiveMessage() completes. Its received PP_VarType will be + * PP_VARTYPE_STRING or PP_VARTYPE_ARRAY_BUFFER. + * + * @param[in] callback A PP_CompletionCallback called + * when ReceiveMessage() completes. This callback is ignored if + * ReceiveMessage() completes synchronously and returns PP_OK. + * + * @return An int32_t containing an error code from pp_errors.h. + * If an error is detected or connection is closed, ReceiveMessage() returns + * PP_ERROR_FAILED after all buffered messages are received. + * Until buffered message become empty, ReceiveMessage() continues to return + * PP_OK as if connection is still established without errors. + */ + int32_t (*ReceiveMessage)(PP_Resource web_socket, + struct PP_Var* message, + struct PP_CompletionCallback callback); + /** + * SendMessage() sends a message to the WebSocket server. + * + * @param[in] web_socket A PP_Resource corresponding to a + * WebSocket. + * + * @param[in] message A message to send. The message is copied to an internal + * buffer, so the caller can free message safely after returning + * from the function. Its sent PP_VarType must be + * PP_VARTYPE_STRING or PP_VARTYPE_ARRAY_BUFFER. + * + * @return An int32_t containing an error code from pp_errors.h. + * Returns PP_ERROR_FAILED if the ReadyState is + * PP_WEBSOCKETREADYSTATE_CONNECTING. + * PP_ERROR_FAILED corresponds to a JavaScript + * InvalidStateError in the WebSocket API specification. + * Returns PP_ERROR_BADARGUMENT if the provided + * message contains an invalid character as a UTF-8 string. + * PP_ERROR_BADARGUMENT corresponds to a JavaScript + * SyntaxError in the WebSocket API specification. + * Otherwise, returns PP_OK, which doesn't necessarily mean + * that the server received the message. + */ + int32_t (*SendMessage)(PP_Resource web_socket, struct PP_Var message); + /** + * GetBufferedAmount() returns the number of bytes of text and binary + * messages that have been queued for the WebSocket connection to send, but + * have not been transmitted to the network yet. + * + * @param[in] web_socket A PP_Resource corresponding to a + * WebSocket. + * + * @return Returns the number of bytes. + */ + uint64_t (*GetBufferedAmount)(PP_Resource web_socket); + /** + * GetCloseCode() returns the connection close code for the WebSocket + * connection. + * + * @param[in] web_socket A PP_Resource corresponding to a + * WebSocket. + * + * @return Returns 0 if called before the close code is set. + */ + uint16_t (*GetCloseCode)(PP_Resource web_socket); + /** + * GetCloseReason() returns the connection close reason for the WebSocket + * connection. + * + * @param[in] web_socket A PP_Resource corresponding to a + * WebSocket. + * + * @return Returns a PP_VARTYPE_STRING var. If called before the + * close reason is set, the return value contains an empty string. Returns a + * PP_VARTYPE_UNDEFINED if called on an invalid resource. + */ + struct PP_Var (*GetCloseReason)(PP_Resource web_socket); + /** + * GetCloseWasClean() returns if the connection was closed cleanly for the + * specified WebSocket connection. + * + * @param[in] web_socket A PP_Resource corresponding to a + * WebSocket. + * + * @return Returns PP_FALSE if called before the connection is + * closed, called on an invalid resource, or closed for abnormal reasons. + * Otherwise, returns PP_TRUE if the connection was closed + * cleanly. + */ + PP_Bool (*GetCloseWasClean)(PP_Resource web_socket); + /** + * GetExtensions() returns the extensions selected by the server for the + * specified WebSocket connection. + * + * @param[in] web_socket A PP_Resource corresponding to a + * WebSocket. + * + * @return Returns a PP_VARTYPE_STRING var. If called before the + * connection is established, the var's data is an empty string. Returns a + * PP_VARTYPE_UNDEFINED if called on an invalid resource. + */ + struct PP_Var (*GetExtensions)(PP_Resource web_socket); + /** + * GetProtocol() returns the sub-protocol chosen by the server for the + * specified WebSocket connection. + * + * @param[in] web_socket A PP_Resource corresponding to a + * WebSocket. + * + * @return Returns a PP_VARTYPE_STRING var. If called before the + * connection is established, the var contains the empty string. Returns a + * PP_VARTYPE_UNDEFINED if called on an invalid resource. + */ + struct PP_Var (*GetProtocol)(PP_Resource web_socket); + /** + * GetReadyState() returns the ready state of the specified WebSocket + * connection. + * + * @param[in] web_socket A PP_Resource corresponding to a + * WebSocket. + * + * @return Returns PP_WEBSOCKETREADYSTATE_INVALID if called + * before Connect() is called, or if this function is called on an + * invalid resource. + */ + PP_WebSocketReadyState (*GetReadyState)(PP_Resource web_socket); + /** + * GetURL() returns the URL associated with specified WebSocket connection. + * + * @param[in] web_socket A PP_Resource corresponding to a + * WebSocket. + * + * @return Returns a PP_VARTYPE_STRING var. If called before the + * connection is established, the var contains the empty string. Returns a + * PP_VARTYPE_UNDEFINED if this function is called on an + * invalid resource. + */ + struct PP_Var (*GetURL)(PP_Resource web_socket); +}; + +typedef struct PPB_WebSocket_1_0 PPB_WebSocket; +/** + * @} + */ + +/* ppp.idl */ + +#include "ppapi/c/pp_module.h" +#include "ppapi/c/pp_stdint.h" +#include "ppapi/c/ppb.h" + +#if __GNUC__ >= 4 +#define PP_EXPORT __attribute__ ((visibility("default"))) +#elif defined(_MSC_VER) +#define PP_EXPORT __declspec(dllexport) +#endif + +/* {PENDING: undefine PP_EXPORT?} */ + +/* We don't want name mangling for these external functions. We only need + * 'extern "C"' if we're compiling with a C++ compiler. + */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @addtogroup Functions + * @{ + */ + +/** + * PPP_InitializeModule() is the entry point for a module and is called by the + * browser when your module loads. Your code must implement this function. + * + * Failure indicates to the browser that this module can not be used. In this + * case, the module will be unloaded and ShutdownModule will NOT be called. + * + * @param[in] module A handle to your module. Generally you should store this + * value since it will be required for other API calls. + * @param[in] get_browser_interface A pointer to the function that you can + * use to query for browser interfaces. Generally you should store this value + * for future use. + * + * @return PP_OK on success. Any other value on failure. + */ +PP_EXPORT int32_t PPP_InitializeModule(PP_Module module, + PPB_GetInterface get_browser_interface); +/** + * @} + */ + +/** + * @addtogroup Functions + * @{ + */ + +/** + * PPP_ShutdownModule() is sometimes called before the module + * is unloaded. It is not recommended that you implement this function. + * + * There is no practical use of this function for third party modules. Its + * existence is because of some internal use cases inside Chrome. + * + * Since your module runs in a separate process, there's no need to free + * allocated memory. There is also no need to free any resources since all of + * resources associated with an instance will be force-freed when that instance + * is deleted. + * + * Note: This function will always be skipped on untrusted + * (Native Client) implementations. This function may be skipped on trusted + * implementations in certain circumstances when Chrome does "fast shutdown" + * of a web page. + */ +PP_EXPORT void PPP_ShutdownModule(void); +/** + * @} + */ + +/** + * @addtogroup Functions + * @{ + */ + +/** + * PPP_GetInterface() is called by the browser to query the module for + * interfaces it supports. + * + * Your module must implement the PPP_Instance interface or it + * will be unloaded. Other interfaces are optional. + * + * This function is called from within browser code whenever an interface is + * needed. This means your plugin could be reentered via this function if you + * make a browser call and it needs an interface. Furthermore, you should not + * make any other browser calls from within your implementation to avoid + * reentering the browser. + * + * As a result, your implementation of this should merely provide a lookup + * from the requested name to an interface pointer, via something like a big + * if/else block or a map, and not do any other work. + * + * @param[in] interface_name A pointer to a "PPP" (plugin) interface name. + * Interface names are null-terminated ASCII strings. + * + * @return A pointer for the interface or NULL if the interface is + * not supported. + */ +PP_EXPORT const void* PPP_GetInterface(const char* interface_name); +/** + * @} + */ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + +/** + * @addtogroup Typedefs + * @{ + */ +/** + * Defines the type of the PPP_InitializeModule function. + */ +typedef int32_t (*PP_InitializeModule_Func)( + PP_Module module, + PPB_GetInterface get_browser_interface); + +/** + * Defines the type of the PPP_ShutdownModule function. + */ +typedef void (*PP_ShutdownModule_Func)(void); + +/** + * Defines the type of the PPP_ShutdownModule function. + */ +typedef const void* (*PP_GetInterface_Func)(const char* interface_name); +/** + * @} + */ + +/* ppp_graphics_3d.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * PPP_Graphics3D defines the notification interface for a 3D + * graphics context. + */ +struct PPP_Graphics3D_1_0 { + /** + * Called when the OpenGL ES window is invalidated and needs to be repainted. + */ + void (*Graphics3DContextLost)(PP_Instance instance); +}; + +typedef struct PPP_Graphics3D_1_0 PPP_Graphics3D; +/** + * @} + */ + +/* ppp_input_event.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +struct PPP_InputEvent_0_1 { + /** + * Function for receiving input events from the browser. + * + * In order to receive input events, you must register for them by calling + * PPB_InputEvent.RequestInputEvents() or RequestFilteringInputEvents(). By + * default, no events are delivered. + * + * If the event was handled, it will not be forwarded to the default handlers + * in the web page. If it was not handled, it may be dispatched to a default + * handler. So it is important that an instance respond accurately with + * whether event propagation should continue. + * + * Event propagation also controls focus. If you handle an event like a mouse + * event, typically the instance will be given focus. Returning false from + * a filtered event handler or not registering for an event type means that + * the click will be given to a lower part of the page and your instance will + * not receive focus. This allows an instance to be partially transparent, + * where clicks on the transparent areas will behave like clicks to the + * underlying page. + * + * In general, you should try to keep input event handling short. Especially + * for filtered input events, the browser or page may be blocked waiting for + * you to respond. + * + * The caller of this function will maintain a reference to the input event + * resource during this call. Unless you take a reference to the resource + * to hold it for later, you don't need to release it. + * + * Note: If you're not receiving input events, make sure you + * register for the event classes you want by calling RequestInputEvents or + * RequestFilteringInputEvents. If you're still not receiving keyboard input + * events, make sure you're returning true (or using a non-filtered event + * handler) for mouse events. Otherwise, the instance will not receive focus + * and keyboard events will not be sent. + * + * \see PPB_InputEvent.RequestInputEvents and + * PPB_InputEvent.RequestFilteringInputEvents + * + * @return PP_TRUE if the event was handled, PP_FALSE if not. If you have + * registered to filter this class of events by calling + * RequestFilteringInputEvents, and you return PP_FALSE, the event will + * be forwarded to the page (and eventually the browser) for the default + * handling. For non-filtered events, the return value will be ignored. + */ + PP_Bool (*HandleInputEvent)(PP_Instance instance, PP_Resource input_event); +}; + +typedef struct PPP_InputEvent_0_1 PPP_InputEvent; +/** + * @} + */ + +/* ppp_instance.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPP_Instance interface contains pointers to a series of + * functions that you must implement in your module. These functions can be + * trivial (simply return the default return value) unless you want your module + * to handle events such as change of focus or input events (keyboard/mouse) + * events. + */ +struct PPP_Instance_1_1 { + /** + * DidCreate() is a creation handler that is called when a new instance is + * created. This function is called for each instantiation on the page, + * corresponding to one \ tag on the page. + * + * Generally you would handle this call by initializing the information + * your module associates with an instance and creating a mapping from the + * given PP_Instance handle to this data. The + * PP_Instance handle will be used in subsequent calls to + * identify which instance the call pertains to. + * + * It's possible for more than one instance to be created in a single module. + * This means that you may get more than one OnCreate without an + * OnDestroy in between, and should be prepared to maintain + * multiple states associated with each instance. + * + * If this function reports a failure (by returning PP_FALSE), + * the instance will be deleted. + * + * @param[in] instance A new PP_Instance identifying one + * instance of a module. This is an opaque handle. + * + * @param[in] argc The number of arguments contained in argn + * and argv. + * + * @param[in] argn An array of argument names. These argument names are + * supplied in the \ tag, for example: + * \ will produce two + * argument names: "id" and "dimensions." + * + * @param[in] argv An array of argument values. These are the values of the + * arguments listed in the \ tag, for example + * \ will produce two + * argument values: "nacl_module" and "2". The indices of these values match + * the indices of the corresponding names in argn. + * + * @return PP_TRUE on success or PP_FALSE on + * failure. + */ + PP_Bool (*DidCreate)(PP_Instance instance, + uint32_t argc, + const char* argn[], + const char* argv[]); + /** + * DidDestroy() is an instance destruction handler. This function is called + * in many cases (see below) when a module instance is destroyed. It will be + * called even if DidCreate() returned failure. + * + * Generally you will handle this call by deallocating the tracking + * information and the PP_Instance mapping you created in the + * DidCreate() call. You can also free resources associated with this + * instance but this isn't required; all resources associated with the deleted + * instance will be automatically freed when this function returns. + * + * The instance identifier will still be valid during this call, so the module + * can perform cleanup-related tasks. Once this function returns, the + * PP_Instance handle will be invalid. This means that you can't + * do any asynchronous operations like network requests, file writes or + * messaging from this function since they will be immediately canceled. + * + * Note: This function will always be skipped on untrusted + * (Native Client) implementations. This function may be skipped on trusted + * implementations in certain circumstances when Chrome does "fast shutdown" + * of a web page. Fast shutdown will happen in some cases when all module + * instances are being deleted, and no cleanup functions will be called. + * The module will just be unloaded and the process terminated. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + */ + void (*DidDestroy)(PP_Instance instance); + /** + * DidChangeView() is called when the position, size, or other view + * attributes of the instance has changed. + */ + void (*DidChangeView)(PP_Instance instance, PP_Resource view); + /** + * DidChangeFocus() is called when an instance has gained or lost focus. + * Having focus means that keyboard events will be sent to the instance. + * An instance's default condition is that it will not have focus. + * + * The focus flag takes into account both browser tab and window focus as + * well as focus of the plugin element on the page. In order to be deemed + * to have focus, the browser window must be topmost, the tab must be + * selected in the window, and the instance must be the focused element on + * the page. + * + * Note:Clicks on instances will give focus only if you + * handle the click event. Return true from + * HandleInputEvent in PPP_InputEvent (or use + * unfiltered events) to signal that the click event was handled. Otherwise, + * the browser will bubble the event and give focus to the element on the page + * that actually did end up consuming it. If you're not getting focus, check + * to make sure you're either requesting them via + * RequestInputEvents() (which implicitly marks all input events + * as consumed) or via RequestFilteringInputEvents() and + * returning true from your event handler. + * + * @param[in] instance A PP_Instance identifying the instance + * receiving the input event. + * + * @param[in] has_focus Indicates the new focused state of the instance. + */ + void (*DidChangeFocus)(PP_Instance instance, PP_Bool has_focus); + /** + * HandleDocumentLoad() is called after initialize for a full-frame + * instance that was instantiated based on the MIME type of a DOMWindow + * navigation. This situation only applies to modules that are pre-registered + * to handle certain MIME types. If you haven't specifically registered to + * handle a MIME type or aren't positive this applies to you, your + * implementation of this function can just return PP_FALSE. + * + * The given url_loader corresponds to a + * PPB_URLLoader instance that is already opened. Its response + * headers may be queried using PPB_URLLoader::GetResponseInfo. + * The reference count for the URL loader is not incremented automatically on + * behalf of the module. You need to increment the reference count yourself + * if you are going to keep a reference to it. + * + * This method returns PP_FALSE if the module cannot handle the + * data. In response to this method, the module should call + * ReadResponseBody() to read the incoming data. + * + * @param[in] instance A PP_Instance identifying the instance + * that should do the load. + * + * @param[in] url_loader An open PPB_URLLoader instance. + * + * @return PP_TRUE if the data was handled, + * PP_FALSE otherwise. If you return false, the load will be + * canceled for you. + */ + PP_Bool (*HandleDocumentLoad)(PP_Instance instance, PP_Resource url_loader); +}; + +typedef struct PPP_Instance_1_1 PPP_Instance; + +struct PPP_Instance_1_0 { + PP_Bool (*DidCreate)(PP_Instance instance, + uint32_t argc, + const char* argn[], + const char* argv[]); + void (*DidDestroy)(PP_Instance instance); + void (*DidChangeView)(PP_Instance instance, + const struct PP_Rect* position, + const struct PP_Rect* clip); + void (*DidChangeFocus)(PP_Instance instance, PP_Bool has_focus); + PP_Bool (*HandleDocumentLoad)(PP_Instance instance, PP_Resource url_loader); +}; +/** + * @} + */ + +/* ppp_messaging.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPP_Messaging interface contains pointers to functions + * that you must implement to handle postMessage events on the associated + * DOM element. + */ +struct PPP_Messaging_1_0 { + /** + * HandleMessage() is a function that the browser calls when PostMessage() + * is invoked on the DOM element for the module instance in JavaScript. Note + * that PostMessage() in the JavaScript interface is asynchronous, meaning + * JavaScript execution will not be blocked while HandleMessage() is + * processing the message. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * @param[in] message A PP_Var which has been converted from a + * JavaScript value. JavaScript array/object types are supported from Chrome + * M29 onward. All JavaScript values are copied when passing them to the + * plugin. + * + * When converting JavaScript arrays, any object properties whose name + * is not an array index are ignored. When passing arrays and objects, the + * entire reference graph will be converted and transferred. If the reference + * graph has cycles, the message will not be sent and an error will be logged + * to the console. + * + * The following JavaScript code invokes HandleMessage, passing + * the module instance on which it was invoked, with message + * being a string PP_Var containing "Hello world!" + * + * Example: + * + * @code + * + * + * + * + * + * + * @endcode + * + */ + void (*HandleMessage)(PP_Instance instance, struct PP_Var message); +}; + +typedef struct PPP_Messaging_1_0 PPP_Messaging; +/** + * @} + */ + +/* ppp_mouse_lock.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPP_MouseLock interface contains a function that you must + * implement to receive mouse lock events from the browser. + */ +struct PPP_MouseLock_1_0 { + /** + * MouseLockLost() is called when the instance loses the mouse lock, such as + * when the user presses the ESC key. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + */ + void (*MouseLockLost)(PP_Instance instance); +}; + +typedef struct PPP_MouseLock_1_0 PPP_MouseLock; +/** + * @} + */ + +/* trusted/ppb_broker_trusted.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_BrokerTrusted interface provides access to a trusted broker + * with greater privileges than the plugin. The interface only supports + * out-of-process plugins and is to be used by proxy implementations. All + * functions should be called from the main thread only. + * + * A PPB_BrokerTrusted resource represents a connection to the broker. Its + * lifetime controls the lifetime of the broker, regardless of whether the + * handle is closed. The handle should be closed before the resource is + * released. + */ +struct PPB_BrokerTrusted_0_3 { + /** + * Returns a trusted broker resource. + */ + PP_Resource (*CreateTrusted)(PP_Instance instance); + /** + * Returns true if the resource is a trusted broker. + */ + PP_Bool (*IsBrokerTrusted)(PP_Resource resource); + /** + * Connects to the trusted broker. It may have already + * been launched by another instance. + * The plugin takes ownership of the handle once the callback has been called + * with a result of PP_OK. The plugin should immediately call GetHandle and + * begin managing it. If the result is not PP_OK, the browser still owns the + * handle. + * + * Returns PP_ERROR_WOULD_BLOCK on success, and invokes + * the |connect_callback| asynchronously to complete. + * As this function should always be invoked from the main thread, + * do not use the blocking variant of PP_CompletionCallback. + * Returns PP_ERROR_FAILED if called from an in-process plugin. + */ + int32_t (*Connect)(PP_Resource broker, + struct PP_CompletionCallback connect_callback); + /** + * Gets the handle to the pipe. Use once Connect has completed. Each instance + * of this interface has its own pipe. + * + * Returns PP_OK on success, and places the result into the given output + * parameter. The handle is only set when returning PP_OK. Calling this + * before connect has completed will return PP_ERROR_FAILED. + */ + int32_t (*GetHandle)(PP_Resource broker, int32_t* handle); + /** + * Returns PP_TRUE if the plugin has permission to launch the broker. A user + * must explicitly grant permission to launch the broker for a particular + * website. This is done through an infobar that is displayed when |Connect| + * is called. This function returns PP_TRUE if the user has already granted + * permission to launch the broker for the website containing this plugin + * instance. Returns PP_FALSE otherwise. + */ + PP_Bool (*IsAllowed)(PP_Resource broker); +}; + +typedef struct PPB_BrokerTrusted_0_3 PPB_BrokerTrusted; + +struct PPB_BrokerTrusted_0_2 { + PP_Resource (*CreateTrusted)(PP_Instance instance); + PP_Bool (*IsBrokerTrusted)(PP_Resource resource); + int32_t (*Connect)(PP_Resource broker, + struct PP_CompletionCallback connect_callback); + int32_t (*GetHandle)(PP_Resource broker, int32_t* handle); +}; +/** + * @} + */ + +/* trusted/ppb_browser_font_trusted.idl */ +/** + * @addtogroup Enums + * @{ + */ +typedef enum { + /** + * Uses the user's default web page font (normally either the default serif + * or sans serif font). + */ + PP_BROWSERFONT_TRUSTED_FAMILY_DEFAULT = 0, + /** + * These families will use the default web page font corresponding to the + * given family. + */ + PP_BROWSERFONT_TRUSTED_FAMILY_SERIF = 1, + PP_BROWSERFONT_TRUSTED_FAMILY_SANSSERIF = 2, + PP_BROWSERFONT_TRUSTED_FAMILY_MONOSPACE = 3 +} PP_BrowserFont_Trusted_Family; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_BrowserFont_Trusted_Family, 4); + +/** + * Specifies the font weight. Normally users will only use NORMAL or BOLD. + */ +typedef enum { + PP_BROWSERFONT_TRUSTED_WEIGHT_100 = 0, + PP_BROWSERFONT_TRUSTED_WEIGHT_200 = 1, + PP_BROWSERFONT_TRUSTED_WEIGHT_300 = 2, + PP_BROWSERFONT_TRUSTED_WEIGHT_400 = 3, + PP_BROWSERFONT_TRUSTED_WEIGHT_500 = 4, + PP_BROWSERFONT_TRUSTED_WEIGHT_600 = 5, + PP_BROWSERFONT_TRUSTED_WEIGHT_700 = 6, + PP_BROWSERFONT_TRUSTED_WEIGHT_800 = 7, + PP_BROWSERFONT_TRUSTED_WEIGHT_900 = 8, + PP_BROWSERFONT_TRUSTED_WEIGHT_NORMAL = PP_BROWSERFONT_TRUSTED_WEIGHT_400, + PP_BROWSERFONT_TRUSTED_WEIGHT_BOLD = PP_BROWSERFONT_TRUSTED_WEIGHT_700 +} PP_BrowserFont_Trusted_Weight; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_BrowserFont_Trusted_Weight, 4); +/** + * @} + */ + +/** + * @addtogroup Structs + * @{ + */ +struct PP_BrowserFont_Trusted_Description { + /** + * Font face name as a string. This can also be an undefined var, in which + * case the generic family will be obeyed. If the face is not available on + * the system, the browser will attempt to do font fallback or pick a default + * font. + */ + struct PP_Var face; + /** + * When Create()ing a font and the face is an undefined var, the family + * specifies the generic font family type to use. If the face is specified, + * this will be ignored. + * + * When Describe()ing a font, the family will be the value you passed in when + * the font was created. In other words, if you specify a face name, the + * family will not be updated to reflect whether the font name you requested + * is serif or sans serif. + */ + PP_BrowserFont_Trusted_Family family; + /** + * Size in pixels. + * + * You can specify 0 to get the default font size. The default font size + * may vary depending on the requested font. The typical example is that + * the user may have a different font size for the default monospace font to + * give it a similar optical size to the proportionally spaced fonts. + */ + uint32_t size; + /** + * Normally you will use either normal or bold. + */ + PP_BrowserFont_Trusted_Weight weight; + PP_Bool italic; + PP_Bool small_caps; + /** + * Adjustment to apply to letter and word spacing, respectively. Initialize + * to 0 to get normal spacing. Negative values bring letters/words closer + * together, positive values separate them. + */ + int32_t letter_spacing; + int32_t word_spacing; + /** + * Ensure that this struct is 48-bytes wide by padding the end. In some + * compilers, PP_Var is 8-byte aligned, so those compilers align this struct + * on 8-byte boundaries as well and pad it to 16 bytes even without this + * padding attribute. This padding makes its size consistent across + * compilers. + */ + int32_t padding; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_BrowserFont_Trusted_Description, 48); + +struct PP_BrowserFont_Trusted_Metrics { + int32_t height; + int32_t ascent; + int32_t descent; + int32_t line_spacing; + int32_t x_height; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_BrowserFont_Trusted_Metrics, 20); + +struct PP_BrowserFont_Trusted_TextRun { + /** + * This var must either be a string or a null/undefined var (which will be + * treated as a 0-length string). + */ + struct PP_Var text; + /** + * Set to PP_TRUE if the text is right-to-left. + */ + PP_Bool rtl; + /** + * Set to PP_TRUE to force the directionality of the text regardless of + * content + */ + PP_Bool override_direction; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_BrowserFont_Trusted_TextRun, 24); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * Provides an interface for native browser text rendering. + * + * This API is "trusted" not for security reasons, but because it can not be + * implemented efficiently when running out-of-process in Browser Client. In + * this case, WebKit is in another process and every text call would require a + * synchronous IPC to the renderer. It is, however, available to native + * (non-NaCl) out-of-process PPAPI plugins since WebKit is available in the + * plugin process. + */ +struct PPB_BrowserFont_Trusted_1_0 { + /** + * Returns a list of all available font families on the system. You can use + * this list to decide whether to Create() a font. + * + * The return value will be a single string with null characters delimiting + * the end of each font name. For example: "Arial\0Courier\0Times\0". + * + * Returns an undefined var on failure (this typically means you passed an + * invalid instance). + */ + struct PP_Var (*GetFontFamilies)(PP_Instance instance); + /** + * Returns a font which best matches the given description. The return value + * will have a non-zero ID on success, or zero on failure. + */ + PP_Resource (*Create)( + PP_Instance instance, + const struct PP_BrowserFont_Trusted_Description* description); + /** + * Returns PP_TRUE if the given resource is a Font. Returns PP_FALSE if the + * resource is invalid or some type other than a Font. + */ + PP_Bool (*IsFont)(PP_Resource resource); + /** + * Loads the description and metrics of the font into the given structures. + * The description will be different than the description the font was + * created with since it will be filled with the real values from the font + * that was actually selected. + * + * The PP_Var in the description should be of type Void on input. On output, + * this will contain the string and will have a reference count of 1. The + * plugin is responsible for calling Release on this var. + * + * Returns PP_TRUE on success, PP_FALSE if the font is invalid or if the Var + * in the description isn't Null (to prevent leaks). + */ + PP_Bool (*Describe)(PP_Resource font, + struct PP_BrowserFont_Trusted_Description* description, + struct PP_BrowserFont_Trusted_Metrics* metrics); + /** + * Draws the text to the image buffer. + * + * The given point represents the baseline of the left edge of the font, + * regardless of whether it is left-to-right or right-to-left (in the case of + * RTL text, this will actually represent the logical end of the text). + * + * The clip is optional and may be NULL. In this case, the text will be + * clipped to the image. + * + * The image_data_is_opaque flag indicates whether subpixel antialiasing can + * be performed, if it is supported. When the image below the text is + * opaque, subpixel antialiasing is supported and you should set this to + * PP_TRUE to pick up the user's default preferences. If your plugin is + * partially transparent, then subpixel antialiasing is not possible and + * grayscale antialiasing will be used instead (assuming the user has + * antialiasing enabled at all). + */ + PP_Bool (*DrawTextAt)(PP_Resource font, + PP_Resource image_data, + const struct PP_BrowserFont_Trusted_TextRun* text, + const struct PP_Point* position, + uint32_t color, + const struct PP_Rect* clip, + PP_Bool image_data_is_opaque); + /** + * Returns the width of the given string. If the font is invalid or the var + * isn't a valid string, this will return -1. + * + * Note that this function handles complex scripts such as Arabic, combining + * accents, etc. so that adding the width of substrings won't necessarily + * produce the correct width of the entire string. + * + * Returns -1 on failure. + */ + int32_t (*MeasureText)(PP_Resource font, + const struct PP_BrowserFont_Trusted_TextRun* text); + /** + * Returns the character at the given pixel X position from the beginning of + * the string. This handles complex scripts such as Arabic, where characters + * may be combined or replaced depending on the context. Returns (uint32)-1 + * on failure. + * + * TODO(brettw) this function may be broken. See the CharPosRTL test. It + * seems to tell you "insertion point" rather than painting position. This + * is useful but maybe not what we intended here. + */ + uint32_t (*CharacterOffsetForPixel)( + PP_Resource font, + const struct PP_BrowserFont_Trusted_TextRun* text, + int32_t pixel_position); + /** + * Returns the horizontal advance to the given character if the string was + * placed at the given position. This handles complex scripts such as Arabic, + * where characters may be combined or replaced depending on context. Returns + * -1 on error. + */ + int32_t (*PixelOffsetForCharacter)( + PP_Resource font, + const struct PP_BrowserFont_Trusted_TextRun* text, + uint32_t char_offset); +}; + +typedef struct PPB_BrowserFont_Trusted_1_0 PPB_BrowserFont_Trusted; +/** + * @} + */ + +/* trusted/ppb_char_set_trusted.idl */ +/** + * @addtogroup Enums + * @{ + */ +typedef enum { + /** + * Causes the entire conversion to fail if an error is encountered. The + * conversion function will return NULL. + */ + PP_CHARSET_TRUSTED_CONVERSIONERROR_FAIL, + /** + * Silently skips over errors. Unrepresentable characters and input encoding + * errors will be removed from the output. + */ + PP_CHARSET_TRUSTED_CONVERSIONERROR_SKIP, + /** + * Replaces the error or unrepresentable character with a substitution + * character. When converting to a Unicode character set (UTF-8 or UTF-16) it + * will use the unicode "substitution character" U+FFFD. When converting to + * another character set, the character will be charset-specific. For many + * languages this will be the representation of the '?' character. + */ + PP_CHARSET_TRUSTED_CONVERSIONERROR_SUBSTITUTE +} PP_CharSet_Trusted_ConversionError; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_CharSet_Trusted_ConversionError, 4); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_CharSet_Trusted interface provides functions for + * converting between character sets. + * + * This inteface is provided for trusted plugins only since in Native Client it + * would require an expensive out-of-process IPC call for each conversion, + * which makes performance unacceptable. Native Client plugins should include + * ICU or some other library if they need this feature. + */ +struct PPB_CharSet_Trusted_1_0 { + /** + * Converts the UTF-16 string pointed to by |*utf16| to an 8-bit string in + * the specified code page. |utf16_len| is measured in UTF-16 units, not + * bytes. This value may not be NULL. + * + * The given output buffer will be filled up to output_length bytes with the + * result. output_length will be updated with the number of bytes required + * for the given string. The output buffer may be null to just retrieve the + * required buffer length. + * + * This function will return PP_FALSE if there was an error converting the + * string and you requested PP_CHARSET_CONVERSIONERROR_FAIL, or the output + * character set was unknown. Otherwise, it will return PP_TRUE. + */ + PP_Bool (*UTF16ToCharSet)(const uint16_t utf16[], + uint32_t utf16_len, + const char* output_char_set, + PP_CharSet_Trusted_ConversionError on_error, + char* output_buffer, + uint32_t* output_length); + /** + * Same as UTF16ToCharSet except converts in the other direction. The input + * is in the given charset, and the |input_len| is the number of bytes in + * the |input| string. + * + * Note that the output_utf16_length is measured in UTF-16 characters. + * + * Since UTF16 can represent every Unicode character, the only time the + * replacement character will be used is if the encoding in the input string + * is incorrect. + */ + PP_Bool (*CharSetToUTF16)(const char* input, + uint32_t input_len, + const char* input_char_set, + PP_CharSet_Trusted_ConversionError on_error, + uint16_t* output_buffer, + uint32_t* output_utf16_length); + /** + * Returns a string var representing the current multi-byte character set of + * the current system. + * + * WARNING: You really shouldn't be using this function unless you're dealing + * with legacy data. You should be using UTF-8 or UTF-16 and you don't have + * to worry about the character sets. + */ + struct PP_Var (*GetDefaultCharSet)(PP_Instance instance); +}; + +typedef struct PPB_CharSet_Trusted_1_0 PPB_CharSet_Trusted; +/** + * @} + */ + +/* trusted/ppb_file_chooser_trusted.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_FileChooserTrusted_0_6 { + /** + * This function displays a previously created file chooser resource as a + * dialog box, prompting the user to choose a file or files to open, or a + * single file for saving. The callback is called with PP_OK on successful + * completion with a file (or files) selected or PP_ERROR_USERCANCEL if the + * user selected no file. + * + * @param[in] chooser The file chooser resource. + * @param[in] save_as A PP_Bool value indicating if this dialog + * is choosing a file for saving. + * @param[in] suggested_file_name If saving, the suggested name for the + * file, otherwise, null or undefined. + * @param[in] callback A CompletionCallback to be called after + * the user has closed the file chooser dialog. + * + * @return PP_OK_COMPLETIONPENDING if request to show the dialog was + * successful, another error code from pp_errors.h on failure. + */ + int32_t (*ShowWithoutUserGesture)(PP_Resource chooser, + PP_Bool save_as, + struct PP_Var suggested_file_name, + struct PP_ArrayOutput output, + struct PP_CompletionCallback callback); +}; + +typedef struct PPB_FileChooserTrusted_0_6 PPB_FileChooserTrusted; + +struct PPB_FileChooserTrusted_0_5 { + int32_t (*ShowWithoutUserGesture)(PP_Resource chooser, + PP_Bool save_as, + struct PP_Var suggested_file_name, + struct PP_CompletionCallback callback); +}; +/** + * @} + */ + +/* trusted/ppb_url_loader_trusted.idl */ +/** + * @addtogroup Typedefs + * @{ + */ +/** + * Callback that indicates the status of the download and upload for the + * given URLLoader resource. + */ +typedef void (*PP_URLLoaderTrusted_StatusCallback)( + PP_Instance pp_instance, + PP_Resource pp_resource, + int64_t bytes_sent, + int64_t total_bytes_to_be_sent, + int64_t bytes_received, + int64_t total_bytes_to_be_received); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/* Available only to trusted implementations. */ +struct PPB_URLLoaderTrusted_0_3 { + /** + * Grant this URLLoader the capability to make unrestricted cross-origin + * requests. + */ + void (*GrantUniversalAccess)(PP_Resource loader); + /** + * Registers that the given function will be called when the upload or + * downloaded byte count has changed. This is not exposed on the untrusted + * interface because it can be quite chatty and encourages people to write + * feedback UIs that update as frequently as the progress updates. + * + * The other serious gotcha with this callback is that the callback must not + * mutate the URL loader or cause it to be destroyed. + * + * However, the proxy layer needs this information to push to the other + * process, so we expose it here. Only one callback can be set per URL + * Loader. Setting to a NULL callback will disable it. + */ + void (*RegisterStatusCallback)(PP_Resource loader, + PP_URLLoaderTrusted_StatusCallback cb); +}; + +typedef struct PPB_URLLoaderTrusted_0_3 PPB_URLLoaderTrusted; +/** + * @} + */ + +/* trusted/ppp_broker.idl */ +// {PENDING: undefine PP_EXPORT?} + +#include "ppapi/c/pp_instance.h" +#include "ppapi/c/pp_stdint.h" + + +#if __GNUC__ >= 4 + +#define PP_EXPORT __attribute__ ((visibility("default"))) +#elif defined(_MSC_VER) +#define PP_EXPORT __declspec(dllexport) +#endif + + + +/* We don't want name mangling for these external functions. We only need + * 'extern "C"' if we're compiling with a C++ compiler. + */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @addtogroup Typedefs + * @{ + */ + +/** + * PP_ConnectInstance_Func defines the signature that you implement to + * receive notifications when a plugin instance connects to the broker. + * The broker should listen on the socket before returning. + * + * @param[in] instance The plugin instance connecting to the broker. + * @param[in] handle Handle to a socket the broker can use to communicate with + * the plugin. + * @return PP_OK on success. Any other value on failure. + */ +typedef int32_t (*PP_ConnectInstance_Func)(PP_Instance instance, + int32_t handle); +/** + * @} + */ + +/** + * @addtogroup Functions + * @{ + */ + +/** + * PPP_InitializeBroker() is the entry point for a broker and is + * called by the browser when your module loads. Your code must implement this + * function. + * + * Failure indicates to the browser that this broker can not be used. In this + * case, the broker will be unloaded. + * + * @param[out] connect_instance_func A pointer to a connect instance function. + * @return PP_OK on success. Any other value on failure. +*/ +PP_EXPORT int32_t PPP_InitializeBroker( + PP_ConnectInstance_Func* connect_instance_func); +/** + * @} + */ + +/** + * @addtogroup Functions + * @{ + */ + +/** PPP_ShutdownBroker() is called before the broker is unloaded. + */ +PP_EXPORT void PPP_ShutdownBroker(); +/** + * @} + */ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +/* dev/pp_cursor_type_dev.idl */ +/** + * @addtogroup Enums + * @{ + */ +enum PP_CursorType_Dev { + PP_CURSORTYPE_CUSTOM = -1, + PP_CURSORTYPE_POINTER = 0, + PP_CURSORTYPE_CROSS = 1, + PP_CURSORTYPE_HAND = 2, + PP_CURSORTYPE_IBEAM = 3, + PP_CURSORTYPE_WAIT = 4, + PP_CURSORTYPE_HELP = 5, + PP_CURSORTYPE_EASTRESIZE = 6, + PP_CURSORTYPE_NORTHRESIZE = 7, + PP_CURSORTYPE_NORTHEASTRESIZE = 8, + PP_CURSORTYPE_NORTHWESTRESIZE = 9, + PP_CURSORTYPE_SOUTHRESIZE = 10, + PP_CURSORTYPE_SOUTHEASTRESIZE = 11, + PP_CURSORTYPE_SOUTHWESTRESIZE = 12, + PP_CURSORTYPE_WESTRESIZE = 13, + PP_CURSORTYPE_NORTHSOUTHRESIZE = 14, + PP_CURSORTYPE_EASTWESTRESIZE = 15, + PP_CURSORTYPE_NORTHEASTSOUTHWESTRESIZE = 16, + PP_CURSORTYPE_NORTHWESTSOUTHEASTRESIZE = 17, + PP_CURSORTYPE_COLUMNRESIZE = 18, + PP_CURSORTYPE_ROWRESIZE = 19, + PP_CURSORTYPE_MIDDLEPANNING = 20, + PP_CURSORTYPE_EASTPANNING = 21, + PP_CURSORTYPE_NORTHPANNING = 22, + PP_CURSORTYPE_NORTHEASTPANNING = 23, + PP_CURSORTYPE_NORTHWESTPANNING = 24, + PP_CURSORTYPE_SOUTHPANNING = 25, + PP_CURSORTYPE_SOUTHEASTPANNING = 26, + PP_CURSORTYPE_SOUTHWESTPANNING = 27, + PP_CURSORTYPE_WESTPANNING = 28, + PP_CURSORTYPE_MOVE = 29, + PP_CURSORTYPE_VERTICALTEXT = 30, + PP_CURSORTYPE_CELL = 31, + PP_CURSORTYPE_CONTEXTMENU = 32, + PP_CURSORTYPE_ALIAS = 33, + PP_CURSORTYPE_PROGRESS = 34, + PP_CURSORTYPE_NODROP = 35, + PP_CURSORTYPE_COPY = 36, + PP_CURSORTYPE_NONE = 37, + PP_CURSORTYPE_NOTALLOWED = 38, + PP_CURSORTYPE_ZOOMIN = 39, + PP_CURSORTYPE_ZOOMOUT = 40, + PP_CURSORTYPE_GRAB = 41, + PP_CURSORTYPE_GRABBING = 42 +}; +PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_CursorType_Dev, 4); +/** + * @} + */ + +/* dev/pp_print_settings_dev.idl */ +/** + * @addtogroup Enums + * @{ + */ +typedef enum { + PP_PRINTORIENTATION_NORMAL = 0, + PP_PRINTORIENTATION_ROTATED_90_CW = 1, + PP_PRINTORIENTATION_ROTATED_180 = 2, + PP_PRINTORIENTATION_ROTATED_90_CCW = 3 +} PP_PrintOrientation_Dev; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_PrintOrientation_Dev, 4); + +typedef enum { + PP_PRINTOUTPUTFORMAT_RASTER = 1u << 0, + PP_PRINTOUTPUTFORMAT_PDF = 1u << 1, + PP_PRINTOUTPUTFORMAT_POSTSCRIPT = 1u << 2, + PP_PRINTOUTPUTFORMAT_EMF = 1u << 3 +} PP_PrintOutputFormat_Dev; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_PrintOutputFormat_Dev, 4); + +typedef enum { + PP_PRINTSCALINGOPTION_NONE = 0, + PP_PRINTSCALINGOPTION_FIT_TO_PRINTABLE_AREA = 1, + PP_PRINTSCALINGOPTION_SOURCE_SIZE = 2 +} PP_PrintScalingOption_Dev; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_PrintScalingOption_Dev, 4); +/** + * @} + */ + +/** + * @addtogroup Structs + * @{ + */ +struct PP_PrintSettings_Dev { + /** This is the size of the printable area in points (1/72 of an inch). */ + struct PP_Rect printable_area; + struct PP_Rect content_area; + struct PP_Size paper_size; + int32_t dpi; + PP_PrintOrientation_Dev orientation; + PP_PrintScalingOption_Dev print_scaling_option; + PP_Bool grayscale; + /** Note that Chrome currently only supports PDF printing. */ + PP_PrintOutputFormat_Dev format; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_PrintSettings_Dev, 60); +/** + * @} + */ + +/* dev/pp_video_capture_dev.idl */ +/** + * @addtogroup Structs + * @{ + */ +/** + * PP_VideoCaptureDeviceInfo_Dev is a structure that represent a video capture + * configuration, such as resolution and frame rate. + */ +struct PP_VideoCaptureDeviceInfo_Dev { + uint32_t width; + uint32_t height; + uint32_t frames_per_second; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_VideoCaptureDeviceInfo_Dev, 12); +/** + * @} + */ + +/** + * @addtogroup Enums + * @{ + */ +/** + * PP_VideoCaptureStatus_Dev is an enumeration that defines the various possible + * states of a VideoCapture. + */ +typedef enum { + /** + * Initial state, capture is stopped. + */ + PP_VIDEO_CAPTURE_STATUS_STOPPED = 0, + /** + * StartCapture has been called, but capture hasn't started yet. + */ + PP_VIDEO_CAPTURE_STATUS_STARTING = 1, + /** + * Capture has been started. + */ + PP_VIDEO_CAPTURE_STATUS_STARTED = 2, + /** + * Capture has been started, but is paused because no buffer is available. + */ + PP_VIDEO_CAPTURE_STATUS_PAUSED = 3, + /** + * StopCapture has been called, but capture hasn't stopped yet. + */ + PP_VIDEO_CAPTURE_STATUS_STOPPING = 4 +} PP_VideoCaptureStatus_Dev; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_VideoCaptureStatus_Dev, 4); +/** + * @} + */ + +/* dev/pp_video_dev.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * Video format. + * + * Keep the values in this enum unique, as they imply format (h.264 vs. VP8, + * for example), and keep the values for a particular format grouped together + * for clarity. + * Note: Keep these in sync with media::VideoCodecProfile. + */ +typedef enum { + PP_VIDEODECODER_PROFILE_UNKNOWN = -1, + PP_VIDEODECODER_H264PROFILE_NONE = 0, + PP_VIDEODECODER_H264PROFILE_BASELINE = 1, + PP_VIDEODECODER_H264PROFILE_MAIN = 2, + PP_VIDEODECODER_H264PROFILE_EXTENDED = 3, + PP_VIDEODECODER_H264PROFILE_HIGH = 4, + PP_VIDEODECODER_H264PROFILE_HIGH10PROFILE = 5, + PP_VIDEODECODER_H264PROFILE_HIGH422PROFILE = 6, + PP_VIDEODECODER_H264PROFILE_HIGH444PREDICTIVEPROFILE = 7, + PP_VIDEODECODER_H264PROFILE_SCALABLEBASELINE = 8, + PP_VIDEODECODER_H264PROFILE_SCALABLEHIGH = 9, + PP_VIDEODECODER_H264PROFILE_STEREOHIGH = 10, + PP_VIDEODECODER_H264PROFILE_MULTIVIEWHIGH = 11, + PP_VIDEODECODER_VP8PROFILE_ANY = 12 +} PP_VideoDecoder_Profile; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_VideoDecoder_Profile, 4); +/** + * @} + */ + +/** + * @addtogroup Structs + * @{ + */ +/** + * The data structure for video bitstream buffer. + */ +struct PP_VideoBitstreamBuffer_Dev { + /** + * Client-specified identifier for the bitstream buffer. Valid values are + * non-negative. + */ + int32_t id; + /** + * Buffer to hold the bitstream data. Should be allocated using the + * PPB_Buffer interface for consistent interprocess behaviour. + */ + PP_Resource data; + /** + * Size of the bitstream contained in buffer (in bytes). + */ + uint32_t size; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_VideoBitstreamBuffer_Dev, 12); + +/** + * Struct for specifying texture-backed picture data. + */ +struct PP_PictureBuffer_Dev { + /** + * Client-specified id for the picture buffer. By using this value client can + * keep track of the buffers it has assigned to the video decoder and how they + * are passed back to it. Valid values are non-negative. + */ + int32_t id; + /** + * Dimensions of the buffer. + */ + struct PP_Size size; + /** + * Texture ID in the given context where picture is stored. + */ + uint32_t texture_id; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_PictureBuffer_Dev, 16); + +/** + * Structure to describe a decoded output frame. + */ +struct PP_Picture_Dev { + /** + * ID of the picture buffer where the picture is stored. + */ + int32_t picture_buffer_id; + /** + * ID of the bitstream from which this data was decoded. + */ + int32_t bitstream_buffer_id; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_Picture_Dev, 8); +/** + * @} + */ + +/** + * @addtogroup Enums + * @{ + */ +/** + * Decoder error codes reported to the plugin. A reasonable naive + * error handling policy is for the plugin to Destroy() the decoder on error. + */ +typedef enum { + /** + * An operation was attempted during an incompatible decoder state. + */ + PP_VIDEODECODERERROR_ILLEGAL_STATE = 1, + /** + * Invalid argument was passed to an API method. + */ + PP_VIDEODECODERERROR_INVALID_ARGUMENT = 2, + /** + * Encoded input is unreadable. + */ + PP_VIDEODECODERERROR_UNREADABLE_INPUT = 3, + /** + * A failure occurred at the browser layer or lower. Examples of such + * failures include GPU hardware failures, GPU driver failures, GPU library + * failures, browser programming errors, and so on. + */ + PP_VIDEODECODERERROR_PLATFORM_FAILURE = 4 +} PP_VideoDecodeError_Dev; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_VideoDecodeError_Dev, 4); +/** + * @} + */ + +/* dev/ppb_device_ref_dev.idl */ +/** + * @addtogroup Typedefs + * @{ + */ +/** + * Defines the callback type to receive device change notifications for + * PPB_AudioInput_Dev.MonitorDeviceChange() and + * PPB_VideoCapture_Dev.MonitorDeviceChange(). + * + * @param[inout] user_data The opaque pointer that the caller passed into + * MonitorDeviceChange(). + * @param[in] device_count How many devices in the array. + * @param[in] devices An array of PPB_DeviceRef_Dev. Please note + * that the ref count of the elements is not increased on behalf of the plugin. + */ +typedef void (*PP_MonitorDeviceChangeCallback)(void* user_data, + uint32_t device_count, + const PP_Resource devices[]); +/** + * @} + */ + +/** + * @addtogroup Enums + * @{ + */ +/** + * Device types. + */ +typedef enum { + PP_DEVICETYPE_DEV_INVALID = 0, + PP_DEVICETYPE_DEV_AUDIOCAPTURE = 1, + PP_DEVICETYPE_DEV_VIDEOCAPTURE = 2 +} PP_DeviceType_Dev; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_DeviceType_Dev, 4); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_DeviceRef_Dev_0_1 { + /** + * Determines if the provided resource is a device reference. + * + * @param[in] resource A PP_Resource corresponding to a generic + * resource. + * + * @return A PP_Bool that is PP_TRUE if the given + * resource is a device reference, otherwise PP_FALSE. + */ + PP_Bool (*IsDeviceRef)(PP_Resource resource); + /** + * Gets the device type. + * + * @param[in] device_ref A PP_Resource corresponding to a device + * reference. + * + * @return A PP_DeviceType_Dev value. + */ + PP_DeviceType_Dev (*GetType)(PP_Resource device_ref); + /** + * Gets the device name. + * + * @param[in] device_ref A PP_Resource corresponding to a device + * reference. + * + * @return A PP_Var of type PP_VARTYPE_STRING + * containing the name of the device if successful; a PP_Var of + * type PP_VARTYPE_UNDEFINED if failed. + */ + struct PP_Var (*GetName)(PP_Resource device_ref); +}; + +typedef struct PPB_DeviceRef_Dev_0_1 PPB_DeviceRef_Dev; +/** + * @} + */ + +/* dev/ppb_audio_input_dev.idl */ +/** + * @addtogroup Typedefs + * @{ + */ +/** + * PPB_AudioInput_Callback defines the type of an audio callback + * function used to provide the audio buffer with data. This callback will be + * called on a separate thread from the creation thread. + * + * @param[in] sample_buffer A buffer providing audio input data. + * @param[in] buffer_size_in_bytes The size of the buffer in bytes. + * @param[in] latency The time that has elapsed since the data was recorded. + * @param[inout] user_data An opaque pointer that was passed into + * PPB_AudioInput_Dev.Open(). + */ +typedef void (*PPB_AudioInput_Callback)(const void* sample_buffer, + uint32_t buffer_size_in_bytes, + PP_TimeDelta latency, + void* user_data); + +typedef void (*PPB_AudioInput_Callback_0_3)(const void* sample_buffer, + uint32_t buffer_size_in_bytes, + void* user_data); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_AudioInput_Dev interface contains pointers to several + * functions for handling audio input resources. + * + * TODO(brettw) before moving out of dev, we need to resolve the issue of + * the mismatch between the current audio config interface and this one. + * + * In particular, the params for input assume stereo, but this class takes + * everything as mono. We either need to not use an audio config resource, or + * add mono support. + * + * In addition, RecommendSampleFrameCount is completely wrong for audio input. + * RecommendSampleFrameCount returns the frame count for the current + * low-latency output device, which is likely inappropriate for a random input + * device. We may want to move the "recommend" functions to the input or output + * classes rather than the config. + */ +struct PPB_AudioInput_Dev_0_4 { + /** + * Creates an audio input resource. + * + * @param[in] instance A PP_Instance identifying one instance of + * a module. + * + * @return A PP_Resource corresponding to an audio input resource + * if successful, 0 if failed. + */ + PP_Resource (*Create)(PP_Instance instance); + /** + * Determines if the given resource is an audio input resource. + * + * @param[in] resource A PP_Resource containing a resource. + * + * @return A PP_Bool containing PP_TRUE if the given + * resource is an audio input resource, otherwise PP_FALSE. + */ + PP_Bool (*IsAudioInput)(PP_Resource resource); + /** + * Enumerates audio input devices. + * + * @param[in] audio_input A PP_Resource corresponding to an audio + * input resource. + * @param[in] output An output array which will receive + * PPB_DeviceRef_Dev resources on success. Please note that the + * ref count of those resources has already been increased by 1 for the + * caller. + * @param[in] callback A PP_CompletionCallback to run on + * completion. + * + * @return An error code from pp_errors.h. + */ + int32_t (*EnumerateDevices)(PP_Resource audio_input, + struct PP_ArrayOutput output, + struct PP_CompletionCallback callback); + /** + * Requests device change notifications. + * + * @param[in] audio_input A PP_Resource corresponding to an audio + * input resource. + * @param[in] callback The callback to receive notifications. If not NULL, it + * will be called once for the currently available devices, and then every + * time the list of available devices changes. All calls will happen on the + * same thread as the one on which MonitorDeviceChange() is called. It will + * receive notifications until audio_input is destroyed or + * MonitorDeviceChange() is called to set a new callback for + * audio_input. You can pass NULL to cancel sending + * notifications. + * @param[inout] user_data An opaque pointer that will be passed to + * callback. + * + * @return An error code from pp_errors.h. + */ + int32_t (*MonitorDeviceChange)(PP_Resource audio_input, + PP_MonitorDeviceChangeCallback callback, + void* user_data); + /** + * Opens an audio input device. No sound will be captured until + * StartCapture() is called. + * + * @param[in] audio_input A PP_Resource corresponding to an audio + * input resource. + * @param[in] device_ref Identifies an audio input device. It could be one of + * the resource in the array returned by EnumerateDevices(), or 0 which means + * the default device. + * @param[in] config A PPB_AudioConfig audio configuration + * resource. + * @param[in] audio_input_callback A PPB_AudioInput_Callback + * function that will be called when data is available. + * @param[inout] user_data An opaque pointer that will be passed into + * audio_input_callback. + * @param[in] callback A PP_CompletionCallback to run when this + * open operation is completed. + * + * @return An error code from pp_errors.h. + */ + int32_t (*Open)(PP_Resource audio_input, + PP_Resource device_ref, + PP_Resource config, + PPB_AudioInput_Callback audio_input_callback, + void* user_data, + struct PP_CompletionCallback callback); + /** + * Returns an audio config resource for the given audio input resource. + * + * @param[in] audio_input A PP_Resource corresponding to an audio + * input resource. + * + * @return A PP_Resource containing the audio config resource if + * successful. + */ + PP_Resource (*GetCurrentConfig)(PP_Resource audio_input); + /** + * Starts the capture of the audio input resource and begins periodically + * calling the callback. + * + * @param[in] audio_input A PP_Resource corresponding to an audio + * input resource. + * + * @return A PP_Bool containing PP_TRUE if + * successful, otherwise PP_FALSE. + * Also returns PP_TRUE (and is a no-op) if called while capture + * is already started. + */ + PP_Bool (*StartCapture)(PP_Resource audio_input); + /** + * Stops the capture of the audio input resource. + * + * @param[in] audio_input A PP_Resource containing the audio input resource. + * + * @return A PP_Bool containing PP_TRUE if + * successful, otherwise PP_FALSE. + * Also returns PP_TRUE (and is a no-op) if called while capture + * is already stopped. If a buffer is being captured, StopCapture will block + * until the call completes. + */ + PP_Bool (*StopCapture)(PP_Resource audio_input); + /** + * Closes the audio input device, and stops capturing if necessary. It is + * not valid to call Open() again after a call to this method. + * If an audio input resource is destroyed while a device is still open, then + * it will be implicitly closed, so you are not required to call this method. + * + * @param[in] audio_input A PP_Resource corresponding to an audio + * input resource. + */ + void (*Close)(PP_Resource audio_input); +}; + +typedef struct PPB_AudioInput_Dev_0_4 PPB_AudioInput_Dev; + +struct PPB_AudioInput_Dev_0_3 { + PP_Resource (*Create)(PP_Instance instance); + PP_Bool (*IsAudioInput)(PP_Resource resource); + int32_t (*EnumerateDevices)(PP_Resource audio_input, + struct PP_ArrayOutput output, + struct PP_CompletionCallback callback); + int32_t (*MonitorDeviceChange)(PP_Resource audio_input, + PP_MonitorDeviceChangeCallback callback, + void* user_data); + int32_t (*Open)(PP_Resource audio_input, + PP_Resource device_ref, + PP_Resource config, + PPB_AudioInput_Callback_0_3 audio_input_callback, + void* user_data, + struct PP_CompletionCallback callback); + PP_Resource (*GetCurrentConfig)(PP_Resource audio_input); + PP_Bool (*StartCapture)(PP_Resource audio_input); + PP_Bool (*StopCapture)(PP_Resource audio_input); + void (*Close)(PP_Resource audio_input); +}; +/** + * @} + */ + +/* dev/ppb_buffer_dev.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_Buffer_Dev_0_4 { + /** + * Allocates a buffer of the given size in bytes. The return value will have + * a non-zero ID on success, or zero on failure. Failure means the module + * handle was invalid. The buffer will be initialized to contain zeroes. + */ + PP_Resource (*Create)(PP_Instance instance, uint32_t size_in_bytes); + /** + * Returns PP_TRUE if the given resource is a Buffer. Returns PP_FALSE if the + * resource is invalid or some type other than a Buffer. + */ + PP_Bool (*IsBuffer)(PP_Resource resource); + /** + * Gets the size of the buffer. Returns PP_TRUE on success, PP_FALSE + * if the resource is not a buffer. On failure, |*size_in_bytes| is not set. + */ + PP_Bool (*Describe)(PP_Resource resource, uint32_t* size_in_bytes); + /** + * Maps this buffer into the plugin address space and returns a pointer to + * the beginning of the data. + */ + void* (*Map)(PP_Resource resource); + /** + * Unmaps this buffer. + */ + void (*Unmap)(PP_Resource resource); +}; + +typedef struct PPB_Buffer_Dev_0_4 PPB_Buffer_Dev; +/** + * @} + */ + +/* dev/ppb_char_set_dev.idl */ +/** + * @addtogroup Enums + * @{ + */ +typedef enum { + /** + * Causes the entire conversion to fail if an error is encountered. The + * conversion function will return NULL. + */ + PP_CHARSET_CONVERSIONERROR_FAIL, + /** + * Silently skips over errors. Unrepresentable characters and input encoding + * errors will be removed from the output. + */ + PP_CHARSET_CONVERSIONERROR_SKIP, + /** + * Replaces the error or unrepresentable character with a substitution + * character. When converting to a Unicode character set (UTF-8 or UTF-16) it + * will use the unicode "substitution character" U+FFFD. When converting to + * another character set, the character will be charset-specific. For many + * languages this will be the representation of the '?' character. + */ + PP_CHARSET_CONVERSIONERROR_SUBSTITUTE +} PP_CharSet_ConversionError; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_CharSet_ConversionError, 4); +/** + * @} + */ + + +typedef uint16_t* uint16_ptr_t; + + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_CharSet_Trusted interface provides functions for + * converting between character sets. + * + * This inteface is provided for trusted plugins only since in Native Client it + * would require an expensive out-of-process IPC call for each conversion, + * which makes performance unacceptable. Native Client plugins should include + * ICU or some other library if they need this feature. + */ +struct PPB_CharSet_Dev_0_4 { + /** + * Converts the UTF-16 string pointed to by |*utf16| to an 8-bit string in + * the specified code page. |utf16_len| is measured in UTF-16 units, not + * bytes. This value may not be NULL. + * + * The given output buffer will be filled up to output_length bytes with the + * result. output_length will be updated with the number of bytes required + * for the given string. The output buffer may be null to just retrieve the + * required buffer length. + * + * This function will return PP_FALSE if there was an error converting the + * string and you requested PP_CHARSET_CONVERSIONERROR_FAIL, or the output + * character set was unknown. Otherwise, it will return PP_TRUE. + */ + const char* (*UTF16ToCharSet)(PP_Instance instance, + const uint16_t utf16[], + uint32_t utf16_len, + const char* output_char_set, + PP_CharSet_ConversionError on_error, + uint32_t* output_length); + /** + * Same as UTF16ToCharSet except converts in the other direction. The input + * is in the given charset, and the |input_len| is the number of bytes in + * the |input| string. + * + * Note that the output_utf16_length is measured in UTF-16 characters. + * + * Since UTF16 can represent every Unicode character, the only time the + * replacement character will be used is if the encoding in the input string + * is incorrect. + */ + uint16_ptr_t (*CharSetToUTF16)(PP_Instance instance, + const char* input, + uint32_t input_len, + const char* input_char_set, + PP_CharSet_ConversionError on_error, + uint32_t* output_utf16_length); + /** + * Returns a string var representing the current multi-byte character set of + * the current system. + * + * WARNING: You really shouldn't be using this function unless you're dealing + * with legacy data. You should be using UTF-8 or UTF-16 and you don't have + * to worry about the character sets. + */ + struct PP_Var (*GetDefaultCharSet)(PP_Instance instance); +}; + +typedef struct PPB_CharSet_Dev_0_4 PPB_CharSet_Dev; +/** + * @} + */ + +/* dev/ppb_crypto_dev.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_Crypto_Dev_0_1 { + /** + * Fills the given buffer with random bytes. This is potentially slow so only + * request the amount of data you need. + */ + void (*GetRandomBytes)(char* buffer, uint32_t num_bytes); +}; + +typedef struct PPB_Crypto_Dev_0_1 PPB_Crypto_Dev; +/** + * @} + */ + +/* dev/ppb_cursor_control_dev.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_CursorControl_Dev_0_4 { + /** + * Set a cursor. If "type" is PP_CURSORTYPE_CUSTOM, then "custom_image" + * must be an ImageData resource containing the cursor and "hot_spot" must + * contain the offset within that image that refers to the cursor's position. + */ + PP_Bool (*SetCursor)(PP_Instance instance, + enum PP_CursorType_Dev type, + PP_Resource custom_image, + const struct PP_Point* hot_spot); + /** + * This method causes the cursor to be moved to the center of the + * instance and be locked, preventing the user from moving it. + * The cursor is implicitly hidden from the user while locked. + * Cursor lock may only be requested in response to a + * PP_InputEvent_MouseDown, and then only if the event was generated via + * user gesture. + * + * While the cursor is locked, any movement of the mouse will + * generate a PP_InputEvent_Type_MouseMove, whose x and y values + * indicate the position the cursor would have been moved to had + * the cursor not been locked, and had the screen been infinite in size. + * + * The browser may revoke cursor lock for reasons including but not + * limited to the user pressing the ESC key, the user activating + * another program via a reserved keystroke (e.g., ALT+TAB), or + * some other system event. + * + * Returns PP_TRUE if the cursor could be locked, PP_FALSE otherwise. + */ + PP_Bool (*LockCursor)(PP_Instance instance); + /** + * Causes the cursor to be unlocked, allowing it to track user + * movement again. + */ + PP_Bool (*UnlockCursor)(PP_Instance instance); + /** + * Returns PP_TRUE if the cursor is locked, PP_FALSE otherwise. + */ + PP_Bool (*HasCursorLock)(PP_Instance instance); + /** + * Returns PP_TRUE if the cursor can be locked, PP_FALSE otherwise. + */ + PP_Bool (*CanLockCursor)(PP_Instance instance); +}; + +typedef struct PPB_CursorControl_Dev_0_4 PPB_CursorControl_Dev; +/** + * @} + */ + +/* dev/ppb_file_chooser_dev.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * This enumeration contains constants to control the behavior of the file + * chooser dialog. + */ +typedef enum { + /** + * Mode for choosing a single existing file. + */ + PP_FILECHOOSERMODE_OPEN = 0, + /** + * Mode for choosing multiple existing files. + */ + PP_FILECHOOSERMODE_OPENMULTIPLE = 1 +} PP_FileChooserMode_Dev; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_FileChooserMode_Dev, 4); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_FileChooser_Dev_0_6 { + /** + * This function creates a file chooser dialog resource. The chooser is + * associated with a particular instance, so that it may be positioned on the + * screen relative to the tab containing the instance. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * @param[in] mode A PP_FileChooserMode_Dev value that controls + * the behavior of the file chooser dialog. + * @param[in] accept_types A comma-separated list of MIME types and file + * extensions such as "audio/ *,text/plain,.html" (note there should be no + * space between the '/' and the '*', but one is added to avoid confusing C++ + * comments). The dialog may restrict selectable files to the specified MIME + * types and file extensions. If a string in the comma-separated list begins + * with a period (.) then the string is interpreted as a file extension, + * otherwise it is interpreted as a MIME-type. An empty string or an undefined + * var may be given to indicate that all types should be accepted. + * + * @return A PP_Resource containing the file chooser if + * successful or 0 if it could not be created. + */ + PP_Resource (*Create)(PP_Instance instance, + PP_FileChooserMode_Dev mode, + struct PP_Var accept_types); + /** + * Determines if the provided resource is a file chooser. + * + * @param[in] resource A PP_Resource corresponding to a generic + * resource. + * + * @return A PP_Bool that is PP_TRUE if the given + * resource is a file chooser resource, otherwise PP_FALSE. + */ + PP_Bool (*IsFileChooser)(PP_Resource resource); + /** + * This function displays a previously created file chooser resource as a + * dialog box, prompting the user to choose a file or files. This function + * must be called in response to a user gesture, such as a mouse click or + * touch event. The callback is called with PP_OK on successful completion + * with a file (or files) selected, PP_ERROR_USERCANCEL if the user selected + * no file, or another error code from pp_errors.h on failure. + * + * Subtle note: This function will only work when the tab containing + * the plugin is visible. Show() will fail if the tab is in the background. + * Since it's not normally possible to get input events while invisible, this + * is not normally an issue. But there is a race condition because events are + * processed asynchronously. If the user clicks and switches tabs very + * quickly, a plugin could believe the tab is visible while Chrome believes + * it is invisible and the Show() call will fail. This will not generally + * cause user confusion since the user will have switched tabs and will not + * want to see a file chooser from a different tab. + * + * @param[in] chooser The file chooser resource. + * + * @param[in] output An output array which will receive PP_Resource(s) + * identifying the PPB_FileRef objects that the user selected on + * success. + * + * @param[in] callback A CompletionCallback to be called after + * the user has closed the file chooser dialog. + * + * @return PP_OK_COMPLETIONPENDING if request to show the dialog was + * successful, another error code from pp_errors.h on failure. + */ + int32_t (*Show)(PP_Resource chooser, + struct PP_ArrayOutput output, + struct PP_CompletionCallback callback); +}; + +typedef struct PPB_FileChooser_Dev_0_6 PPB_FileChooser_Dev; + +struct PPB_FileChooser_Dev_0_5 { + PP_Resource (*Create)(PP_Instance instance, + PP_FileChooserMode_Dev mode, + struct PP_Var accept_types); + PP_Bool (*IsFileChooser)(PP_Resource resource); + int32_t (*Show)(PP_Resource chooser, struct PP_CompletionCallback callback); + PP_Resource (*GetNextChosenFile)(PP_Resource chooser); +}; +/** + * @} + */ + +/* dev/ppb_font_dev.idl */ +/** + * @addtogroup Enums + * @{ + */ +typedef enum { + /** + * Uses the user's default web page font (normally either the default serif + * or sans serif font). + */ + PP_FONTFAMILY_DEFAULT = 0, + /** + * These families will use the default web page font corresponding to the + * given family. + */ + PP_FONTFAMILY_SERIF = 1, + PP_FONTFAMILY_SANSSERIF = 2, + PP_FONTFAMILY_MONOSPACE = 3 +} PP_FontFamily_Dev; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_FontFamily_Dev, 4); + +/** + * Specifies the font weight. Normally users will only use NORMAL or BOLD. + */ +typedef enum { + PP_FONTWEIGHT_100 = 0, + PP_FONTWEIGHT_200 = 1, + PP_FONTWEIGHT_300 = 2, + PP_FONTWEIGHT_400 = 3, + PP_FONTWEIGHT_500 = 4, + PP_FONTWEIGHT_600 = 5, + PP_FONTWEIGHT_700 = 6, + PP_FONTWEIGHT_800 = 7, + PP_FONTWEIGHT_900 = 8, + PP_FONTWEIGHT_NORMAL = PP_FONTWEIGHT_400, + PP_FONTWEIGHT_BOLD = PP_FONTWEIGHT_700 +} PP_FontWeight_Dev; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_FontWeight_Dev, 4); +/** + * @} + */ + +/** + * @addtogroup Structs + * @{ + */ +struct PP_FontDescription_Dev { + /** + * Font face name as a string. This can also be an undefined var, in which + * case the generic family will be obeyed. If the face is not available on + * the system, the browser will attempt to do font fallback or pick a default + * font. + */ + struct PP_Var face; + /** + * When Create()ing a font and the face is an undefined var, the family + * specifies the generic font family type to use. If the face is specified, + * this will be ignored. + * + * When Describe()ing a font, the family will be the value you passed in when + * the font was created. In other words, if you specify a face name, the + * family will not be updated to reflect whether the font name you requested + * is serif or sans serif. + */ + PP_FontFamily_Dev family; + /** + * Size in pixels. + * + * You can specify 0 to get the default font size. The default font size + * may vary depending on the requested font. The typical example is that + * the user may have a different font size for the default monospace font to + * give it a similar optical size to the proportionally spaced fonts. + */ + uint32_t size; + /** + * Normally you will use either PP_FONTWEIGHT_NORMAL or PP_FONTWEIGHT_BOLD. + */ + PP_FontWeight_Dev weight; + PP_Bool italic; + PP_Bool small_caps; + /** + * Adjustment to apply to letter and word spacing, respectively. Initialize + * to 0 to get normal spacing. Negative values bring letters/words closer + * together, positive values separate them. + */ + int32_t letter_spacing; + int32_t word_spacing; + /** + * Ensure that this struct is 48-bytes wide by padding the end. In some + * compilers, PP_Var is 8-byte aligned, so those compilers align this struct + * on 8-byte boundaries as well and pad it to 16 bytes even without this + * padding attribute. This padding makes its size consistent across + * compilers. + */ + int32_t padding; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_FontDescription_Dev, 48); + +struct PP_FontMetrics_Dev { + int32_t height; + int32_t ascent; + int32_t descent; + int32_t line_spacing; + int32_t x_height; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_FontMetrics_Dev, 20); + +struct PP_TextRun_Dev { + /** + * This var must either be a string or a null/undefined var (which will be + * treated as a 0-length string). + */ + struct PP_Var text; + /** + * Set to PP_TRUE if the text is right-to-left. + * + * When override_direction is false, the browser will perform + * the Unicode Bidirectional Algorithm (http://unicode.org/reports/tr9/) on + * the text. The value of the rtl flag specifies the + * directionality of the surrounding environment. This means that Hebrew + * word will always display right to left, even if rtl is false. + * + * When override_direction is true, no autodetection will be done + * and rtl specifies the direction of the text. + * + * TODO(brettw) note that autodetection with rtl = true is currently + * unimplemented. + */ + PP_Bool rtl; + /** + * Set to PP_TRUE to force the directionality of the text regardless of + * content. + * + * If this flag is set, the browser will skip autodetection of the content + * and will display all text in the direction specified by the + * rtl flag. + */ + PP_Bool override_direction; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_TextRun_Dev, 24); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_Font_Dev_0_6 { + /** + * Returns a list of all available font families on the system. You can use + * this list to decide whether to Create() a font. + * + * The return value will be a single string with null characters delimiting + * the end of each font name. For example: "Arial\0Courier\0Times\0". + * + * Returns an undefined var on failure (this typically means you passed an + * invalid instance). + */ + struct PP_Var (*GetFontFamilies)(PP_Instance instance); + /** + * Returns a font which best matches the given description. The return value + * will have a non-zero ID on success, or zero on failure. + */ + PP_Resource (*Create)(PP_Instance instance, + const struct PP_FontDescription_Dev* description); + /** + * Returns PP_TRUE if the given resource is a Font. Returns PP_FALSE if the + * resource is invalid or some type other than a Font. + */ + PP_Bool (*IsFont)(PP_Resource resource); + /** + * Loads the description and metrics of the font into the given structures. + * The description will be different than the description the font was + * created with since it will be filled with the real values from the font + * that was actually selected. + * + * The PP_Var in the description should be of type Void on input. On output, + * this will contain the string and will have a reference count of 1. The + * plugin is responsible for calling Release on this var. + * + * Returns PP_TRUE on success, PP_FALSE if the font is invalid or if the Var + * in the description isn't Null (to prevent leaks). + */ + PP_Bool (*Describe)(PP_Resource font, + struct PP_FontDescription_Dev* description, + struct PP_FontMetrics_Dev* metrics); + /** + * Draws the text to the image buffer. + * + * The given point represents the baseline of the left edge of the font, + * regardless of whether it is left-to-right or right-to-left (in the case of + * RTL text, this will actually represent the logical end of the text). + * + * The clip is optional and may be NULL. In this case, the text will be + * clipped to the image. + * + * The image_data_is_opaque flag indicates whether subpixel antialiasing can + * be performed, if it is supported. When the image below the text is + * opaque, subpixel antialiasing is supported and you should set this to + * PP_TRUE to pick up the user's default preferences. If your plugin is + * partially transparent, then subpixel antialiasing is not possible and + * grayscale antialiasing will be used instead (assuming the user has + * antialiasing enabled at all). + */ + PP_Bool (*DrawTextAt)(PP_Resource font, + PP_Resource image_data, + const struct PP_TextRun_Dev* text, + const struct PP_Point* position, + uint32_t color, + const struct PP_Rect* clip, + PP_Bool image_data_is_opaque); + /** + * Returns the width of the given string. If the font is invalid or the var + * isn't a valid string, this will return -1. + * + * Note that this function handles complex scripts such as Arabic, combining + * accents, etc. so that adding the width of substrings won't necessarily + * produce the correct width of the entire string. + * + * Returns -1 on failure. + */ + int32_t (*MeasureText)(PP_Resource font, const struct PP_TextRun_Dev* text); + /** + * Returns the character at the given pixel X position from the beginning of + * the string. This handles complex scripts such as Arabic, where characters + * may be combined or replaced depending on the context. Returns (uint32)-1 + * on failure. + */ + uint32_t (*CharacterOffsetForPixel)(PP_Resource font, + const struct PP_TextRun_Dev* text, + int32_t pixel_position); + /** + * Returns the horizontal advance to the given character if the string was + * placed at the given position. This handles complex scripts such as Arabic, + * where characters may be combined or replaced depending on context. Returns + * -1 on error. + */ + int32_t (*PixelOffsetForCharacter)(PP_Resource font, + const struct PP_TextRun_Dev* text, + uint32_t char_offset); +}; + +typedef struct PPB_Font_Dev_0_6 PPB_Font_Dev; +/** + * @} + */ + +/* dev/ppb_ime_input_event_dev.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_IMEInputEvent_Dev_0_2 { + /** + * Create() creates an IME input event with the given parameters. Normally + * you will get an IME event passed through the HandleInputEvent + * and will not need to create them, but some applications may want to create + * their own for internal use. + * + * @param[in] instance The instance for which this event occurred. + * + * @param[in] type A PP_InputEvent_Type identifying the type of + * input event. The type must be one of the IME event types. + * + * @param[in] time_stamp A PP_TimeTicks indicating the time + * when the event occurred. + * + * @param[in] text The string returned by GetText. + * + * @param[in] segment_number The number returned by + * GetSegmentNumber. + * + * @param[in] segment_offsets The array of numbers returned by + * GetSegmentOffset. If segment_number is zero, + * the number of elements of the array should be zero. If + * segment_number is non-zero, the length of the array must be + * segment_number + 1. + * + * @param[in] target_segment The number returned by + * GetTargetSegment. + * + * @param[in] selection_start The start index returned by + * GetSelection. + * + * @param[in] selection_end The end index returned by + * GetSelection. + * + * @return A PP_Resource containing the new IME input event. + */ + PP_Resource (*Create)(PP_Instance instance, + PP_InputEvent_Type type, + PP_TimeTicks time_stamp, + struct PP_Var text, + uint32_t segment_number, + const uint32_t segment_offsets[], + int32_t target_segment, + uint32_t selection_start, + uint32_t selection_end); + /** + * IsIMEInputEvent() determines if a resource is an IME event. + * + * @param[in] resource A PP_Resource corresponding to an event. + * + * @return PP_TRUE if the given resource is a valid input event. + */ + PP_Bool (*IsIMEInputEvent)(PP_Resource resource); + /** + * GetText() returns the composition text as a UTF-8 string for the given IME + * event. + * + * @param[in] ime_event A PP_Resource corresponding to an IME + * event. + * + * @return A string var representing the composition text. For non-IME input + * events the return value will be an undefined var. + */ + struct PP_Var (*GetText)(PP_Resource ime_event); + /** + * GetSegmentNumber() returns the number of segments in the composition text. + * + * @param[in] ime_event A PP_Resource corresponding to an IME + * event. + * + * @return The number of segments. For events other than COMPOSITION_UPDATE, + * returns 0. + */ + uint32_t (*GetSegmentNumber)(PP_Resource ime_event); + /** + * GetSegmentOffset() returns the position of the index-th segmentation point + * in the composition text. The position is given by a byte-offset (not a + * character-offset) of the string returned by GetText(). It always satisfies + * 0=GetSegmentOffset(0) < ... < GetSegmentOffset(i) < GetSegmentOffset(i+1) + * < ... < GetSegmentOffset(GetSegmentNumber())=(byte-length of GetText()). + * Note that [GetSegmentOffset(i), GetSegmentOffset(i+1)) represents the range + * of the i-th segment, and hence GetSegmentNumber() can be a valid argument + * to this function instead of an off-by-1 error. + * + * @param[in] ime_event A PP_Resource corresponding to an IME + * event. + * + * @param[in] index An integer indicating a segment. + * + * @return The byte-offset of the segmentation point. If the event is not + * COMPOSITION_UPDATE or index is out of range, returns 0. + */ + uint32_t (*GetSegmentOffset)(PP_Resource ime_event, uint32_t index); + /** + * GetTargetSegment() returns the index of the current target segment of + * composition. + * + * @param[in] ime_event A PP_Resource corresponding to an IME + * event. + * + * @return An integer indicating the index of the target segment. When there + * is no active target segment, or the event is not COMPOSITION_UPDATE, + * returns -1. + */ + int32_t (*GetTargetSegment)(PP_Resource ime_event); + /** + * GetSelection() returns the range selected by caret in the composition text. + * + * @param[in] ime_event A PP_Resource corresponding to an IME + * event. + * + * @param[out] start The start position of the current selection. + * + * @param[out] end The end position of the current selection. + */ + void (*GetSelection)(PP_Resource ime_event, uint32_t* start, uint32_t* end); +}; + +typedef struct PPB_IMEInputEvent_Dev_0_2 PPB_IMEInputEvent_Dev; + +struct PPB_IMEInputEvent_Dev_0_1 { + PP_Bool (*IsIMEInputEvent)(PP_Resource resource); + struct PP_Var (*GetText)(PP_Resource ime_event); + uint32_t (*GetSegmentNumber)(PP_Resource ime_event); + uint32_t (*GetSegmentOffset)(PP_Resource ime_event, uint32_t index); + int32_t (*GetTargetSegment)(PP_Resource ime_event); + void (*GetSelection)(PP_Resource ime_event, uint32_t* start, uint32_t* end); +}; +/** + * @} + */ + +/* dev/ppb_memory_dev.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_Memory_Dev interface contains pointers to functions related to memory + * management. + * + */ +struct PPB_Memory_Dev_0_1 { + /** + * MemAlloc is a pointer to a function that allocate memory. + * + * @param[in] num_bytes A number of bytes to allocate. + * @return A pointer to the memory if successful, NULL If the + * allocation fails. + */ + void* (*MemAlloc)(uint32_t num_bytes); + /** + * MemFree is a pointer to a function that deallocates memory. + * + * @param[in] ptr A pointer to the memory to deallocate. It is safe to + * pass NULL to this function. + */ + void (*MemFree)(void* ptr); +}; + +typedef struct PPB_Memory_Dev_0_1 PPB_Memory_Dev; +/** + * @} + */ + +/* dev/ppb_opengles2ext_dev.idl */ +#include "ppapi/c/pp_resource.h" +#include "ppapi/c/ppb_opengles2.h" + + +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_OpenGLES2DrawBuffers_Dev_1_0 { + void (*DrawBuffersEXT)(PP_Resource context, + GLsizei count, + const GLenum* bufs); +}; + +struct PPB_OpenGLES2DrawBuffers_Dev { + void (*DrawBuffersEXT)(PP_Resource context, + GLsizei count, + const GLenum* bufs); +}; +/** + * @} + */ + +/* dev/ppb_printing_dev.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_Printing_Dev_0_7 { + /** Create a resource for accessing printing functionality. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * + * @return A PP_Resource containing the printing resource if + * successful or 0 if it could not be created. + */ + PP_Resource (*Create)(PP_Instance instance); + /** + * Outputs the default print settings for the default printer into + * print_settings. The callback is called with + * PP_OK when the settings have been retrieved successfully. + * + * @param[in] resource The printing resource. + * + * @param[in] callback A CompletionCallback to be called when + * print_settings have been retrieved. + * + * @return PP_OK_COMPLETIONPENDING if request for the default print settings + * was successful, another error code from pp_errors.h on failure. + */ + int32_t (*GetDefaultPrintSettings)( + PP_Resource resource, + struct PP_PrintSettings_Dev* print_settings, + struct PP_CompletionCallback callback); +}; + +typedef struct PPB_Printing_Dev_0_7 PPB_Printing_Dev; +/** + * @} + */ + +/* dev/ppb_text_input_dev.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * PP_TextInput_Type is used to indicate the status of a plugin in regard to + * text input. + */ +typedef enum { + /** + * Input caret is not in an editable mode, no input method shall be used. + */ + PP_TEXTINPUT_TYPE_DEV_NONE = 0, + /** + * Input caret is in a normal editable mode, any input method can be used. + */ + PP_TEXTINPUT_TYPE_DEV_TEXT = 1, + /** + * Input caret is in a password box, an input method may be used only if + * it's suitable for password input. + */ + PP_TEXTINPUT_TYPE_DEV_PASSWORD = 2, + PP_TEXTINPUT_TYPE_DEV_SEARCH = 3, + PP_TEXTINPUT_TYPE_DEV_EMAIL = 4, + PP_TEXTINPUT_TYPE_DEV_NUMBER = 5, + PP_TEXTINPUT_TYPE_DEV_TELEPHONE = 6, + PP_TEXTINPUT_TYPE_DEV_URL = 7 +} PP_TextInput_Type_Dev; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_TextInput_Type_Dev, 4); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * PPB_TextInput_Dev provides a set of functions for giving hints + * to the browser about the text input status of plugins, and functions for + * controlling input method editors (IMEs). + */ +struct PPB_TextInput_Dev_0_2 { + /** + * Informs the browser about the current text input mode of the plugin. + * Typical use of this information in the browser is to properly + * display/suppress tools for supporting text inputs (such as virtual + * keyboards in touch screen based devices, or input method editors often + * used for composing East Asian characters). + */ + void (*SetTextInputType)(PP_Instance instance, PP_TextInput_Type_Dev type); + /** + * Informs the browser about the coordinates of the text input caret and the + * bounding box of the text input area. Typical use of this information in + * the browser is to layout IME windows etc. + */ + void (*UpdateCaretPosition)(PP_Instance instance, + const struct PP_Rect* caret, + const struct PP_Rect* bounding_box); + /** + * Cancels the current composition in IME. + */ + void (*CancelCompositionText)(PP_Instance instance); + /** + * In response to the PPP_TextInput_Dev::RequestSurroundingText + * call, informs the browser about the current text selection and surrounding + * text. text is a UTF-8 string that contains the current range + * of text selection in the plugin. caret is the byte-index of + * the caret position within text. anchor is the + * byte-index of the anchor position (i.e., if a range of text is selected, + * it is the other edge of selection different from caret. If + * there are no selection, anchor is equal to caret. + * + * Typical use of this information in the browser is to enable "reconversion" + * features of IME that puts back the already committed text into the + * pre-commit composition state. Another use is to improve the precision + * of suggestion of IME by taking the context into account (e.g., if the caret + * looks to be on the beginning of a sentence, suggest capital letters in a + * virtual keyboard). + * + * When the focus is not on text, call this function setting text + * to an empty string and caret and anchor to zero. + * Also, the plugin should send the empty text when it does not want to reveal + * the selection to IME (e.g., when the surrounding text is containing + * password text). + */ + void (*UpdateSurroundingText)(PP_Instance instance, + const char* text, + uint32_t caret, + uint32_t anchor); + /** + * Informs the browser when a range of text selection is changed in a plugin. + * When the browser needs to know the content of the updated selection, it + * pings back by PPP_TextInput_Dev::RequestSurroundingText. The + * plugin then should send the information with + * UpdateSurroundingText. + */ + void (*SelectionChanged)(PP_Instance instance); +}; + +typedef struct PPB_TextInput_Dev_0_2 PPB_TextInput_Dev; + +struct PPB_TextInput_Dev_0_1 { + void (*SetTextInputType)(PP_Instance instance, PP_TextInput_Type_Dev type); + void (*UpdateCaretPosition)(PP_Instance instance, + const struct PP_Rect* caret, + const struct PP_Rect* bounding_box); + void (*CancelCompositionText)(PP_Instance instance); +}; +/** + * @} + */ + +/* dev/ppb_trace_event_dev.idl */ +/** + * @addtogroup Typedefs + * @{ + */ +/** + * A trace event timestamp. + */ +typedef int64_t PP_TraceEventTime; +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_Trace_Event_Dev_0_2 { + /** + * Gets a pointer to a character for identifying a category name in the + * tracing system as well as for being able to early exit in client-side + * tracing code. + * + * NB: This mem_t return value should technically be const, but return values + * for Pepper IDL of mem_t type are not const. The same is true for the arg + * |category_enabled| for AddTraceEvent. + */ + void* (*GetCategoryEnabled)(const char* category_name); + /** + * Adds a trace event to the platform tracing system. This function call is + * usually the result of a TRACE_* macro from trace_event.h when tracing and + * the category of the particular trace are enabled. It is not advisable to + * call this function on its own; it is really only meant to be used by the + * trace macros. + */ + void (*AddTraceEvent)(int8_t phase, + const void* category_enabled, + const char* name, + uint64_t id, + uint32_t num_args, + const char* arg_names[], + const uint8_t arg_types[], + const uint64_t arg_values[], + uint8_t flags); + /** + * Version of the above interface that allows specifying a custom thread id + * and timestamp. This is useful for when tracing data cannot be registered + * in real time. For example, this could be used by storing timestamps + * internally and then registering the events retroactively. + */ + void (*AddTraceEventWithThreadIdAndTimestamp)(int8_t phase, + const void* category_enabled, + const char* name, + uint64_t id, + int32_t thread_id, + PP_TraceEventTime timestamp, + uint32_t num_args, + const char* arg_names[], + const uint8_t arg_types[], + const uint64_t arg_values[], + uint8_t flags); + /** + * Get the current clock value. Since this uses the same function as the trace + * events use internally, it can be used to create events with explicit time + * stamps. + */ + PP_TraceEventTime (*Now)(void); + /** + * Sets the thread name of the calling thread in the tracing system so it will + * show up properly in chrome://tracing. + */ + void (*SetThreadName)(const char* thread_name); +}; + +typedef struct PPB_Trace_Event_Dev_0_2 PPB_Trace_Event_Dev; + +struct PPB_Trace_Event_Dev_0_1 { + void* (*GetCategoryEnabled)(const char* category_name); + void (*AddTraceEvent)(int8_t phase, + const void* category_enabled, + const char* name, + uint64_t id, + uint32_t num_args, + const char* arg_names[], + const uint8_t arg_types[], + const uint64_t arg_values[], + uint8_t flags); + void (*SetThreadName)(const char* thread_name); +}; +/** + * @} + */ + +/* dev/ppb_truetype_font_dev.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * The PP_TrueTypeFontFamily_Dev defines generic font families. These can be + * used to create generic fonts consistent with the user's browser settings. + */ +typedef enum { + /** + * For a description of these default families, see the + * + * 3.1.1 Generic font families documentation. + */ + PP_TRUETYPEFONTFAMILY_SERIF = 0, + PP_TRUETYPEFONTFAMILY_SANSSERIF = 1, + PP_TRUETYPEFONTFAMILY_CURSIVE = 2, + PP_TRUETYPEFONTFAMILY_FANTASY = 3, + PP_TRUETYPEFONTFAMILY_MONOSPACE = 4 +} PP_TrueTypeFontFamily_Dev; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_TrueTypeFontFamily_Dev, 4); + +/** + * The PP_TrueTypeFontStyle_Dev enum defines font styles. + */ +typedef enum { + PP_TRUETYPEFONTSTYLE_NORMAL = 0, + PP_TRUETYPEFONTSTYLE_ITALIC = 1 +} PP_TrueTypeFontStyle_Dev; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_TrueTypeFontStyle_Dev, 4); + +/** + * The PP_TrueTypeFontWeight_Dev enum defines font weights. + */ +typedef enum { + PP_TRUETYPEFONTWEIGHT_THIN = 100, + PP_TRUETYPEFONTWEIGHT_ULTRALIGHT = 200, + PP_TRUETYPEFONTWEIGHT_LIGHT = 300, + PP_TRUETYPEFONTWEIGHT_NORMAL = 400, + PP_TRUETYPEFONTWEIGHT_MEDIUM = 500, + PP_TRUETYPEFONTWEIGHT_SEMIBOLD = 600, + PP_TRUETYPEFONTWEIGHT_BOLD = 700, + PP_TRUETYPEFONTWEIGHT_ULTRABOLD = 800, + PP_TRUETYPEFONTWEIGHT_HEAVY = 900 +} PP_TrueTypeFontWeight_Dev; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_TrueTypeFontWeight_Dev, 4); + +/** + * The PP_TrueTypeFontWidth_Dev enum defines font widths. + */ +typedef enum { + PP_TRUETYPEFONTWIDTH_ULTRACONDENSED = 0, + PP_TRUETYPEFONTWIDTH_EXTRACONDENSED = 1, + PP_TRUETYPEFONTWIDTH_CONDENSED = 2, + PP_TRUETYPEFONTWIDTH_SEMICONDENSED = 3, + PP_TRUETYPEFONTWIDTH_NORMAL = 4, + PP_TRUETYPEFONTWIDTH_SEMIEXPANDED = 5, + PP_TRUETYPEFONTWIDTH_EXPANDED = 6, + PP_TRUETYPEFONTWIDTH_EXTRAEXPANDED = 7, + PP_TRUETYPEFONTWIDTH_ULTRAEXPANDED = 8 +} PP_TrueTypeFontWidth_Dev; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_TrueTypeFontWidth_Dev, 4); + +/** + * The PP_TrueTypeFontCharset enum defines font character sets. + */ +typedef enum { + PP_TRUETYPEFONTCHARSET_ANSI = 0, + PP_TRUETYPEFONTCHARSET_DEFAULT = 1, + PP_TRUETYPEFONTCHARSET_SYMBOL = 2, + PP_TRUETYPEFONTCHARSET_MAC = 77, + PP_TRUETYPEFONTCHARSET_SHIFTJIS = 128, + PP_TRUETYPEFONTCHARSET_HANGUL = 129, + PP_TRUETYPEFONTCHARSET_JOHAB = 130, + PP_TRUETYPEFONTCHARSET_GB2312 = 134, + PP_TRUETYPEFONTCHARSET_CHINESEBIG5 = 136, + PP_TRUETYPEFONTCHARSET_GREEK = 161, + PP_TRUETYPEFONTCHARSET_TURKISH = 162, + PP_TRUETYPEFONTCHARSET_VIETNAMESE = 163, + PP_TRUETYPEFONTCHARSET_HEBREW = 177, + PP_TRUETYPEFONTCHARSET_ARABIC = 178, + PP_TRUETYPEFONTCHARSET_BALTIC = 186, + PP_TRUETYPEFONTCHARSET_RUSSIAN = 204, + PP_TRUETYPEFONTCHARSET_THAI = 222, + PP_TRUETYPEFONTCHARSET_EASTEUROPE = 238, + PP_TRUETYPEFONTCHARSET_OEM = 255 +} PP_TrueTypeFontCharset_Dev; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_TrueTypeFontCharset_Dev, 4); +/** + * @} + */ + +/** + * @addtogroup Structs + * @{ + */ +/** + * The PP_TrueTypeFontDesc struct describes a TrueType font. It is + * passed to Create(), and returned by Describe(). + */ +struct PP_TrueTypeFontDesc_Dev { + /** + * Font family name as a string. This can also be an undefined var, in which + * case the generic family will be obeyed. If the face is not available on + * the system, the browser will attempt to do font fallback or pick a default + * font. + */ + struct PP_Var family; + /** This value specifies a generic font family. If a family name string is + * provided when creating a font, this is ignored. */ + PP_TrueTypeFontFamily_Dev generic_family; + /** This value specifies the font style. */ + PP_TrueTypeFontStyle_Dev style; + /** This value specifies the font weight. */ + PP_TrueTypeFontWeight_Dev weight; + /** This value specifies the font width, for condensed or expanded fonts */ + PP_TrueTypeFontWidth_Dev width; + /** This value specifies a character set. */ + PP_TrueTypeFontCharset_Dev charset; + /** + * Ensure that this struct is 40-bytes wide by padding the end. In some + * compilers, PP_Var is 8-byte aligned, so those compilers align this struct + * on 8-byte boundaries as well and pad it to 16 bytes even without this + * padding attribute. This padding makes its size consistent across + * compilers. + */ + int32_t padding; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_TrueTypeFontDesc_Dev, 40); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_TrueTypeFont_Dev_0_1 { + /** + * Gets an array of TrueType font family names available on the host. + * These names can be used to create a font from a specific family. + * + * @param[in] instance A PP_Instance requesting the family names. + * @param[in] output A PP_ArrayOutput to hold the names. + * The output is an array of PP_Vars, each holding a family name. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of GetFontFamilies. + * + * @return If >= 0, the number of family names returned, otherwise an error + * code from pp_errors.h. + */ + int32_t (*GetFontFamilies)(PP_Instance instance, + struct PP_ArrayOutput output, + struct PP_CompletionCallback callback); + /** + * Gets an array of TrueType font descriptors for a given font family. These + * descriptors can be used to create a font in that family and matching the + * descriptor attributes. + * + * @param[in] instance A PP_Instance requesting the font + * descriptors. + * @param[in] family A PP_Var holding a string specifying the + * font family. + * @param[in] output A PP_ArrayOutput to hold the descriptors. + * The output is an array of PP_TrueTypeFontDesc structs. Each + * desc contains a PP_Var for the family name which must be released. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of GetFontsInFamily. + * + * @return If >= 0, the number of font descriptors returned, otherwise an + * error code from pp_errors.h. + */ + int32_t (*GetFontsInFamily)(PP_Instance instance, + struct PP_Var family, + struct PP_ArrayOutput output, + struct PP_CompletionCallback callback); + /** + * Creates a font resource matching the given font characteristics. The + * resource id will be non-zero on success, or zero on failure. + * + * @param[in] instance A PP_Instance to own the font. + * @param[in] desc A pointer to a PP_TrueTypeFontDesc describing + * the font. + */ + PP_Resource (*Create)(PP_Instance instance, + const struct PP_TrueTypeFontDesc_Dev* desc); + /** + * Determines if the given resource is a TrueType font. + * + * @param[in] resource A PP_Resource corresponding to a resource. + * + * @return PP_TRUE if the resource is a + * PPB_TrueTypeFont_Dev, PP_FALSE otherwise. + */ + PP_Bool (*IsTrueTypeFont)(PP_Resource resource); + /** + * Returns a description of the given font resource. This description may + * differ from the description passed to Create, reflecting the host's font + * matching and fallback algorithm. + * + * @param[in] font A PP_Resource corresponding to a font. + * @param[out] desc A pointer to a PP_TrueTypeFontDesc to hold + * the description. The internal 'family' PP_Var should be set to undefined, + * since this function overwrites the PP_TrueTypeFontDesc. After + * successful completion, the family will be set to a PP_Var with a single + * reference, which the caller must release after use. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Describe. + * + * @return A return code from pp_errors.h. If an error code is + * returned, the PP_TrueTypeFontDesc will be unchanged. + */ + int32_t (*Describe)(PP_Resource font, + struct PP_TrueTypeFontDesc_Dev* desc, + struct PP_CompletionCallback callback); + /** + * Gets an array of identifying tags for each table in the font. These tags + * can be used to request specific tables using GetTable. + * + * @param[in] font A PP_Resource corresponding to a font. + * @param[in] output A PP_ArrayOutput to hold the tags. + * The output is an array of 4 byte integers, each representing a table tag. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of GetTableTags. + * + * @return If >= 0, the number of table tags returned, otherwise an error + * code from pp_errors.h. + */ + int32_t (*GetTableTags)(PP_Resource font, + struct PP_ArrayOutput output, + struct PP_CompletionCallback callback); + /** + * Copies the given font table into client memory. + * + * @param[in] font A PP_Resource corresponding to a font. + * @param[in] table A 4 byte value indicating which table to copy. + * For example, 'glyf' will cause the outline table to be copied into the + * output array. A zero tag value will cause the entire font to be copied. + * @param[in] offset The offset into the font table. Passing an offset + * greater than or equal to the table size will succeed with 0 bytes copied. + * @param[in] max_data_length The maximum number of bytes to transfer from + * offset. + * @param[in] output A PP_ArrayOutput to hold the font data. + * The output is an array of bytes. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of GetTable. + * + * @return If >= 0, the table size in bytes, otherwise an error code from + * pp_errors.h. + */ + int32_t (*GetTable)(PP_Resource font, + uint32_t table, + int32_t offset, + int32_t max_data_length, + struct PP_ArrayOutput output, + struct PP_CompletionCallback callback); +}; + +typedef struct PPB_TrueTypeFont_Dev_0_1 PPB_TrueTypeFont_Dev; +/** + * @} + */ + +/* dev/ppb_url_util_dev.idl */ +/** + * @addtogroup Structs + * @{ + */ +/* + * A component specifies the range of the part of the URL. The begin specifies + * the index into the string of the first character of that component. The len + * specifies the length of that component. + * + * This range does not include any special delimiter for that component, so + * the scheme doesn't include the trailing colon, the username and password + * don't include the @ and :, the port doesn't include the colon, the query + * doesn't include the ?, and the ref doesn't include the #. + * + * The exception is that the path *does* include the first /, since that's an + * integral part of the path. + * + * If the component is not present at all, begin will be 0 and len will be -1. + * If the component is present but empty, the length will be 0 instead. Example: + * http://foo/search -> query = (0, -1) + * http://foo/search? -> query = (18, 0) + */ +struct PP_URLComponent_Dev { + int32_t begin; + int32_t len; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_URLComponent_Dev, 8); + +struct PP_URLComponents_Dev { + struct PP_URLComponent_Dev scheme; + struct PP_URLComponent_Dev username; + struct PP_URLComponent_Dev password; + struct PP_URLComponent_Dev host; + struct PP_URLComponent_Dev port; + struct PP_URLComponent_Dev path; + struct PP_URLComponent_Dev query; + struct PP_URLComponent_Dev ref; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_URLComponents_Dev, 64); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/* + * URL encoding: URLs are supplied to this interface as NULL-terminated 8-bit + * strings. You can pass non-ASCII characters which will be interpreted as + * UTF-8. Canonicalized URL strings returned by these functions will be ASCII + * except for the reference fragment (stuff after the '#') which will be + * encoded as UTF-8. + */ +struct PPB_URLUtil_Dev_0_7 { + /* + * Canonicalizes the given URL string according to the rules of the host + * browser. If the URL is invalid or the var is not a string, this will + * return a Null var and the components structure will be unchanged. + * + * The components pointer, if non-NULL and the canonicalized URL is valid, + * will identify the components of the resulting URL. Components may be NULL + * to specify that no component information is necessary. + */ + struct PP_Var (*Canonicalize)(struct PP_Var url, + struct PP_URLComponents_Dev* components); + /* + * Resolves the given URL relative to the given base URL. The resulting URL + * is returned as a string. If the resolution is invalid or either of the + * inputs are not strings, a Null var will be returned. The resulting URL + * will also be canonicalized according to the rules of the browser. + * + * Note that the "relative" URL may in fact be absolute, in which case it + * will be returned. This function is identical to resolving the full URL + * for an on a web page. Attempting to resolve a relative URL + * on a base URL that doesn't support this (e.g. "data") will fail and will + * return a Null var, unless the relative URL is itself absolute. + * + * The components pointer, if non-NULL and the canonicalized URL is valid, + * will identify the components of the resulting URL. Components may be NULL + * to specify that no component information is necessary. + */ + struct PP_Var (*ResolveRelativeToURL)( + struct PP_Var base_url, + struct PP_Var relative_string, + struct PP_URLComponents_Dev* components); + /* + * Identical to ResolveRelativeToURL except that the base URL is the base + * URL of the document containing the given plugin instance. + * + * Danger: This will be identical to resolving a relative URL on the page, + * and might be overridden by the page to something different than its actual + * URL via the tag. Therefore, resolving a relative URL of "" won't + * necessarily give you the URL of the page! + */ + struct PP_Var (*ResolveRelativeToDocument)( + PP_Instance instance, + struct PP_Var relative_string, + struct PP_URLComponents_Dev* components); + /* + * Checks whether the given two URLs are in the same security origin. Returns + * FALSE if either of the URLs are invalid. + */ + PP_Bool (*IsSameSecurityOrigin)(struct PP_Var url_a, struct PP_Var url_b); + /* + * Checks whether the document hosting the given plugin instance can access + * the given URL according to the same origin policy of the browser. Returns + * PP_FALSE if the instance or the URL is invalid. + */ + PP_Bool (*DocumentCanRequest)(PP_Instance instance, struct PP_Var url); + /* + * Checks whether the document containing the |active| plugin instance can + * access the document containing the |target| plugin instance according to + * the security policy of the browser. This includes the same origin policy + * and any cross-origin capabilities enabled by the document. If either of + * the plugin instances are invalid, returns PP_FALSE. + */ + PP_Bool (*DocumentCanAccessDocument)(PP_Instance active, PP_Instance target); + /* + * Returns the URL for the document. This is a safe way to retrieve + * window.location.href. + * The components pointer, if non-NULL and the canonicalized URL is valid, + * will identify the components of the resulting URL. Components may be NULL + * to specify that no component information is necessary. + */ + struct PP_Var (*GetDocumentURL)(PP_Instance instance, + struct PP_URLComponents_Dev* components); + /* + * Returns the Source URL for the plugin. This returns the URL that would be + * streamed to the plugin if it were a NPAPI plugin. This is usually the src + * attribute on the element, but the rules are obscure and different + * based on whether the plugin is loaded from an element or an + * element. + * The components pointer, if non-NULL and the canonicalized URL is valid, + * will identify the components of the resulting URL. Components may be NULL + * to specify that no component information is necessary. + */ + struct PP_Var (*GetPluginInstanceURL)( + PP_Instance instance, + struct PP_URLComponents_Dev* components); + /* + * Returns the Referrer URL of the HTTP request that loaded the plugin. This + * is the value of the 'Referer' header of the request. An undefined value + * means the 'Referer' header was absent. + * The components pointer, if non-NULL and the canonicalized URL is valid, + * will identify the components of the resulting URL. Components may be NULL + * to specify that no component information is necessary. + */ + struct PP_Var (*GetPluginReferrerURL)( + PP_Instance instance, + struct PP_URLComponents_Dev* components); +}; + +typedef struct PPB_URLUtil_Dev_0_7 PPB_URLUtil_Dev; + +struct PPB_URLUtil_Dev_0_6 { + struct PP_Var (*Canonicalize)(struct PP_Var url, + struct PP_URLComponents_Dev* components); + struct PP_Var (*ResolveRelativeToURL)( + struct PP_Var base_url, + struct PP_Var relative_string, + struct PP_URLComponents_Dev* components); + struct PP_Var (*ResolveRelativeToDocument)( + PP_Instance instance, + struct PP_Var relative_string, + struct PP_URLComponents_Dev* components); + PP_Bool (*IsSameSecurityOrigin)(struct PP_Var url_a, struct PP_Var url_b); + PP_Bool (*DocumentCanRequest)(PP_Instance instance, struct PP_Var url); + PP_Bool (*DocumentCanAccessDocument)(PP_Instance active, PP_Instance target); + struct PP_Var (*GetDocumentURL)(PP_Instance instance, + struct PP_URLComponents_Dev* components); + struct PP_Var (*GetPluginInstanceURL)( + PP_Instance instance, + struct PP_URLComponents_Dev* components); +}; +/** + * @} + */ + +/* dev/ppp_class_deprecated.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * Interface for the plugin to implement JavaScript-accessible objects. + * + * This interface has no interface name. Instead, the plugin passes a pointer + * to this interface to PPB_Var_Deprecated.CreateObject that corresponds to the + * object being implemented. + * + * See the PPB_Var_Deprecated interface for more information on these functions. + * This interface just allows you to implement the "back end" of those + * functions, so most of the contract is specified in that interface. + * + * See + * http://code.google.com/p/ppapi/wiki/InterfacingWithJavaScript + * for general information on using and implementing vars. + */ +struct PPP_Class_Deprecated_1_0 { + /** + * |name| is guaranteed to be an integer or string type var. Exception is + * guaranteed non-NULL. An integer is used for |name| when implementing + * array access into the object. This test should only return true for + * properties that are not methods. Use HasMethod() to handle methods. + */ + PP_Bool (*HasProperty)(const void* object, + struct PP_Var name, + struct PP_Var* exception); + /** + * |name| is guaranteed to be a string-type. Exception is guaranteed non-NULL. + * If the method does not exist, return false and don't set the exception. + * Errors in this function will probably not occur in general usage, but + * if you need to throw an exception, still return false. + */ + PP_Bool (*HasMethod)(const void* object, + struct PP_Var name, + struct PP_Var* exception); + /** + * |name| is guaranteed to be a string-type or an integer-type var. Exception + * is guaranteed non-NULL. An integer is used for |name| when implementing + * array access into the object. If the property does not exist, set the + * exception and return a var of type Void. A property does not exist if + * a call HasProperty() for the same |name| would return false. + */ + struct PP_Var (*GetProperty)(const void* object, + struct PP_Var name, + struct PP_Var* exception); + /** + * Exception is guaranteed non-NULL. + * + * This should include all enumerable properties, including methods. Be sure + * to set |*property_count| to 0 and |properties| to NULL in all failure + * cases, these should never be unset when calling this function. The + * pointers passed in are guaranteed not to be NULL, so you don't have to + * NULL check them. + * + * If you have any properties, allocate the property array with + * PPB_Core.MemAlloc(sizeof(PP_Var) * property_count) and add a reference + * to each property on behalf of the caller. The caller is responsible for + * Release()ing each var and calling PPB_Core.MemFree on the property pointer. + */ + void (*GetAllPropertyNames)(const void* object, + uint32_t* property_count, + struct PP_Var** properties, + struct PP_Var* exception); + /** + * |name| is guaranteed to be an integer or string type var. Exception is + * guaranteed non-NULL. + */ + void (*SetProperty)(const void* object, + struct PP_Var name, + struct PP_Var value, + struct PP_Var* exception); + /** + * |name| is guaranteed to be an integer or string type var. Exception is + * guaranteed non-NULL. + */ + void (*RemoveProperty)(const void* object, + struct PP_Var name, + struct PP_Var* exception); + /* TODO(brettw) need native array access here. */ + /** + * |name| is guaranteed to be a string type var. Exception is guaranteed + * non-NULL + */ + struct PP_Var (*Call)(const void* object, + struct PP_Var method_name, + uint32_t argc, + const struct PP_Var argv[], + struct PP_Var* exception); + /** Exception is guaranteed non-NULL. */ + struct PP_Var (*Construct)(const void* object, + uint32_t argc, + const struct PP_Var argv[], + struct PP_Var* exception); + /** + * Called when the reference count of the object reaches 0. Normally, plugins + * would free their internal data pointed to by the |object| pointer. + */ + void (*Deallocate)(const void* object); +}; + +typedef struct PPP_Class_Deprecated_1_0 PPP_Class_Deprecated; +/** + * @} + */ + +/* dev/ppb_var_deprecated.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_Var_Deprecated_0_3 { + /** + * Adds a reference to the given var. If this is not a refcounted object, + * this function will do nothing so you can always call it no matter what the + * type. + */ + void (*AddRef)(struct PP_Var var); + /** + * Removes a reference to given var, deleting it if the internal refcount + * becomes 0. If the given var is not a refcounted object, this function will + * do nothing so you can always call it no matter what the type. + */ + void (*Release)(struct PP_Var var); + /** + * Creates a string var from a string. The string must be encoded in valid + * UTF-8 and is NOT NULL-terminated, the length must be specified in |len|. + * It is an error if the string is not valid UTF-8. + * + * If the length is 0, the |data| pointer will not be dereferenced and may + * be NULL. Note, however, that if you do this, the "NULL-ness" will not be + * preserved, as VarToUtf8 will never return NULL on success, even for empty + * strings. + * + * The resulting object will be a refcounted string object. It will be + * AddRef()ed for the caller. When the caller is done with it, it should be + * Release()d. + * + * On error (basically out of memory to allocate the string, or input that + * is not valid UTF-8), this function will return a Null var. + */ + struct PP_Var (*VarFromUtf8)(PP_Module module, + const char* data, + uint32_t len); + /** + * Converts a string-type var to a char* encoded in UTF-8. This string is NOT + * NULL-terminated. The length will be placed in |*len|. If the string is + * valid but empty the return value will be non-NULL, but |*len| will still + * be 0. + * + * If the var is not a string, this function will return NULL and |*len| will + * be 0. + * + * The returned buffer will be valid as long as the underlying var is alive. + * If the plugin frees its reference, the string will be freed and the pointer + * will be to random memory. + */ + const char* (*VarToUtf8)(struct PP_Var var, uint32_t* len); + /** + * Returns true if the property with the given name exists on the given + * object, false if it does not. Methods are also counted as properties. + * + * The name can either be a string or an integer var. It is an error to pass + * another type of var as the name. + * + * If you pass an invalid name or object, the exception will be set (if it is + * non-NULL, and the return value will be false). + */ + PP_Bool (*HasProperty)(struct PP_Var object, + struct PP_Var name, + struct PP_Var* exception); + /** + * Identical to HasProperty, except that HasMethod additionally checks if the + * property is a function. + */ + PP_Bool (*HasMethod)(struct PP_Var object, + struct PP_Var name, + struct PP_Var* exception); + /** + * Returns the value of the given property. If the property doesn't exist, the + * exception (if non-NULL) will be set and a "Void" var will be returned. + */ + struct PP_Var (*GetProperty)(struct PP_Var object, + struct PP_Var name, + struct PP_Var* exception); + /** + * Retrieves all property names on the given object. Property names include + * methods. + * + * If there is a failure, the given exception will be set (if it is non-NULL). + * On failure, |*properties| will be set to NULL and |*property_count| will be + * set to 0. + * + * A pointer to the array of property names will be placesd in |*properties|. + * The caller is responsible for calling Release() on each of these properties + * (as per normal refcounted memory management) as well as freeing the array + * pointer with PPB_Core.MemFree(). + * + * This function returns all "enumerable" properties. Some JavaScript + * properties are "hidden" and these properties won't be retrieved by this + * function, yet you can still set and get them. + * + * Example: + *
  uint32_t count;
+   *   PP_Var* properties;
+   *   ppb_var.GetAllPropertyNames(object, &count, &properties);
+   *
+   *   ...use the properties here...
+   *
+   *   for (uint32_t i = 0; i < count; i++)
+   *     ppb_var.Release(properties[i]);
+   *   ppb_core.MemFree(properties); 
+ */ + void (*GetAllPropertyNames)(struct PP_Var object, + uint32_t* property_count, + struct PP_Var** properties, + struct PP_Var* exception); + /** + * Sets the property with the given name on the given object. The exception + * will be set, if it is non-NULL, on failure. + */ + void (*SetProperty)(struct PP_Var object, + struct PP_Var name, + struct PP_Var value, + struct PP_Var* exception); + /** + * Removes the given property from the given object. The property name must + * be an string or integer var, using other types will throw an exception + * (assuming the exception pointer is non-NULL). + */ + void (*RemoveProperty)(struct PP_Var object, + struct PP_Var name, + struct PP_Var* exception); + /* TODO(brettw) need native array access here. */ + /** + * Invoke the function |method_name| on the given object. If |method_name| + * is a Null var, the default method will be invoked, which is how you can + * invoke function objects. + * + * Unless it is type Null, |method_name| must be a string. Unlike other + * Var functions, integer lookup is not supported since you can't call + * functions on integers in JavaScript. + * + * Pass the arguments to the function in order in the |argv| array, and the + * number of arguments in the |argc| parameter. |argv| can be NULL if |argc| + * is zero. + * + * Example: + * Call(obj, VarFromUtf8("DoIt"), 0, NULL, NULL) = obj.DoIt() in JavaScript. + * Call(obj, PP_MakeNull(), 0, NULL, NULL) = obj() in JavaScript. + */ + struct PP_Var (*Call)(struct PP_Var object, + struct PP_Var method_name, + uint32_t argc, + const struct PP_Var argv[], + struct PP_Var* exception); + /** + * Invoke the object as a constructor. + * + * For example, if |object| is |String|, this is like saying |new String| in + * JavaScript. + */ + struct PP_Var (*Construct)(struct PP_Var object, + uint32_t argc, + const struct PP_Var argv[], + struct PP_Var* exception); + /** + * If the object is an instance of the given class, then this method returns + * true and sets *object_data to the value passed to CreateObject provided + * object_data is non-NULL. Otherwise, this method returns false. + */ + PP_Bool (*IsInstanceOf)(struct PP_Var var, + const struct PPP_Class_Deprecated_1_0* object_class, + void* object_data); + /** + * Creates an object that the plugin implements. The plugin supplies a + * pointer to the class interface it implements for that object, and its + * associated internal data that represents that object. This object data + * must be unique among all "live" objects. + * + * The returned object will have a reference count of 1. When the reference + * count reached 0, the class' Destruct function wlil be called. + * + * On failure, this will return a null var. This probably means the module + * was invalid. + * + * Example: Say we're implementing a "Point" object. + *
  void PointDestruct(void* object) {
+   *     delete (Point*)object;
+   *   }
+   *
+   *   const PPP_Class_Deprecated point_class = {
+   *     ... all the other class functions go here ...
+   *     &PointDestruct
+   *   };
+   *
+   *    * The plugin's internal object associated with the point.
+   *   class Point {
+   *     ...
+   *   };
+   *
+   *   PP_Var MakePoint(int x, int y) {
+   *     return CreateObject(&point_class, new Point(x, y));
+   *   }
+ */ + struct PP_Var (*CreateObject)( + PP_Instance instance, + const struct PPP_Class_Deprecated_1_0* object_class, + void* object_data); + /* Like CreateObject but takes a module. This will be deleted when all callers + * can be changed to use the PP_Instance CreateObject one. */ + struct PP_Var (*CreateObjectWithModuleDeprecated)( + PP_Module module, + const struct PPP_Class_Deprecated_1_0* object_class, + void* object_data); +}; + +typedef struct PPB_Var_Deprecated_0_3 PPB_Var_Deprecated; +/** + * @} + */ + +/* dev/ppb_video_capture_dev.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * Video capture interface. It goes hand-in-hand with PPP_VideoCapture_Dev. + * + * Theory of operation: + * 1- Create a VideoCapture resource using Create. + * 2- Find available video capture devices using EnumerateDevices. + * 3- Open a video capture device. In addition to a device reference (0 can be + * used to indicate the default device), you pass in the requested info + * (resolution, frame rate), as well as suggest a number of buffers you will + * need. + * 4- Start the capture using StartCapture. + * 5- Receive the OnDeviceInfo callback, in PPP_VideoCapture_Dev, which will + * give you the actual capture info (the requested one is not guaranteed), as + * well as an array of buffers allocated by the browser. + * 6- On every frame captured by the browser, OnBufferReady (in + * PPP_VideoCapture_Dev) is called with the index of the buffer from the array + * containing the new frame. The buffer is now "owned" by the plugin, and the + * browser won't reuse it until ReuseBuffer is called. + * 7- When the plugin is done with the buffer, call ReuseBuffer. + * 8- Stop the capture using StopCapture. + * 9- Close the device. + * + * The browser may change the resolution based on the constraints of the system, + * in which case OnDeviceInfo will be called again, with new buffers. + * + * The buffers contain the pixel data for a frame. The format is planar YUV + * 4:2:0, one byte per pixel, tightly packed (width x height Y values, then + * width/2 x height/2 U values, then width/2 x height/2 V values). + */ +struct PPB_VideoCapture_Dev_0_3 { + /** + * Creates a new VideoCapture. + */ + PP_Resource (*Create)(PP_Instance instance); + /** + * Returns PP_TRUE if the given resource is a VideoCapture. + */ + PP_Bool (*IsVideoCapture)(PP_Resource video_capture); + /** + * Enumerates video capture devices. + * + * @param[in] video_capture A PP_Resource corresponding to a + * video capture resource. + * @param[in] output An output array which will receive + * PPB_DeviceRef_Dev resources on success. Please note that the + * ref count of those resources has already been increased by 1 for the + * caller. + * @param[in] callback A PP_CompletionCallback to run on + * completion. + * + * @return An error code from pp_errors.h. + */ + int32_t (*EnumerateDevices)(PP_Resource video_capture, + struct PP_ArrayOutput output, + struct PP_CompletionCallback callback); + /** + * Requests device change notifications. + * + * @param[in] video_capture A PP_Resource corresponding to a + * video capture resource. + * @param[in] callback The callback to receive notifications. If not NULL, it + * will be called once for the currently available devices, and then every + * time the list of available devices changes. All calls will happen on the + * same thread as the one on which MonitorDeviceChange() is called. It will + * receive notifications until video_capture is destroyed or + * MonitorDeviceChange() is called to set a new callback for + * video_capture. You can pass NULL to cancel sending + * notifications. + * @param[inout] user_data An opaque pointer that will be passed to + * callback. + * + * @return An error code from pp_errors.h. + */ + int32_t (*MonitorDeviceChange)(PP_Resource video_capture, + PP_MonitorDeviceChangeCallback callback, + void* user_data); + /** + * Opens a video capture device. |device_ref| identifies a video capture + * device. It could be one of the resource in the array returned by + * |EnumerateDevices()|, or 0 which means the default device. + * |requested_info| is a pointer to a structure containing the requested + * resolution and frame rate. |buffer_count| is the number of buffers + * requested by the plugin. Note: it is only used as advisory, the browser may + * allocate more or fewer based on available resources. How many buffers + * depends on usage. At least 2 to make sure latency doesn't cause lost + * frames. If the plugin expects to hold on to more than one buffer at a time + * (e.g. to do multi-frame processing, like video encoding), it should request + * that many more. + */ + int32_t (*Open)(PP_Resource video_capture, + PP_Resource device_ref, + const struct PP_VideoCaptureDeviceInfo_Dev* requested_info, + uint32_t buffer_count, + struct PP_CompletionCallback callback); + /** + * Starts the capture. + * + * Returns PP_ERROR_FAILED if called when the capture was already started, or + * PP_OK on success. + */ + int32_t (*StartCapture)(PP_Resource video_capture); + /** + * Allows the browser to reuse a buffer that was previously sent by + * PPP_VideoCapture_Dev.OnBufferReady. |buffer| is the index of the buffer in + * the array returned by PPP_VideoCapture_Dev.OnDeviceInfo. + * + * Returns PP_ERROR_BADARGUMENT if buffer is out of range (greater than the + * number of buffers returned by PPP_VideoCapture_Dev.OnDeviceInfo), or if it + * is not currently owned by the plugin. Returns PP_OK otherwise. + */ + int32_t (*ReuseBuffer)(PP_Resource video_capture, uint32_t buffer); + /** + * Stops the capture. + * + * Returns PP_ERROR_FAILED if the capture wasn't already started, or PP_OK on + * success. + */ + int32_t (*StopCapture)(PP_Resource video_capture); + /** + * Closes the video capture device, and stops capturing if necessary. It is + * not valid to call |Open()| again after a call to this method. + * If a video capture resource is destroyed while a device is still open, then + * it will be implicitly closed, so you are not required to call this method. + */ + void (*Close)(PP_Resource video_capture); +}; + +typedef struct PPB_VideoCapture_Dev_0_3 PPB_VideoCapture_Dev; +/** + * @} + */ + +/* dev/ppb_video_decoder_dev.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * Video decoder interface. + * + * Typical usage: + * - Use Create() to create & configure a new PPB_VideoDecoder_Dev resource. + * - Call Decode() to decode some video data. + * - Receive ProvidePictureBuffers callback + * - Supply the decoder with textures using AssignPictureBuffers. + * - Receive PictureReady callbacks + * - Hand the textures back to the decoder using ReusePictureBuffer. + * - To signal EOS to the decoder: call Flush() and wait for NotifyFlushDone + * callback. + * - To reset the decoder (e.g. to implement Seek): call Reset() and wait for + * NotifyResetDone callback. + * - To tear down the decoder call Destroy(). + * + * See PPP_VideoDecoder_Dev for the notifications the decoder may send the + * plugin. + */ +struct PPB_VideoDecoder_Dev_0_16 { + /** + * Creates & initializes a video decoder. + * + * Parameters: + * |instance| pointer to the plugin instance. + * |context| a PPB_Graphics3D resource in which decoding will happen. + * |profile| the video stream's format profile. + * + * The created decoder is returned as PP_Resource. 0 means failure. + */ + PP_Resource (*Create)(PP_Instance instance, + PP_Resource context, + PP_VideoDecoder_Profile profile); + /** + * Tests whether |resource| is a video decoder created through Create + * function of this interface. + * + * Parameters: + * |resource| is handle to resource to test. + * + * Returns true if is a video decoder, false otherwise. + */ + PP_Bool (*IsVideoDecoder)(PP_Resource resource); + /** + * Dispatches bitstream buffer to the decoder. + * + * Parameters: + * |video_decoder| is the previously created handle to the decoder resource. + * |bitstream_buffer| is the bitstream buffer that contains at most one + * input frame. + * |callback| will be called when |bitstream_buffer| has been processed by + * the decoder. + * + * Returns an error code from pp_errors.h. + */ + int32_t (*Decode)(PP_Resource video_decoder, + const struct PP_VideoBitstreamBuffer_Dev* bitstream_buffer, + struct PP_CompletionCallback callback); + /** + * Provides the decoder with texture-backed picture buffers for video + * decoding. + * + * This function should be called when the plugin has its + * ProvidePictureBuffers method called. The decoder will stall until it has + * received all the buffers it's asked for. + * + * Parameters: + * |video_decoder| is the previously created handle to the decoder resource. + * |no_of_buffers| how many buffers are behind picture buffer pointer. + * |buffers| contains the reference to the picture buffer that was + * allocated. + */ + void (*AssignPictureBuffers)(PP_Resource video_decoder, + uint32_t no_of_buffers, + const struct PP_PictureBuffer_Dev buffers[]); + /** + * Tells the decoder to reuse the given picture buffer. Typical use of this + * function is to call from PictureReady callback to recycle picture buffer + * back to the decoder after blitting the image so that decoder can use the + * image for output again. + * + * Parameters: + * |video_decoder| is the previously created handle to the decoder resource. + * |picture_buffer_id| contains the id of the picture buffer that was + * processed. + */ + void (*ReusePictureBuffer)(PP_Resource video_decoder, + int32_t picture_buffer_id); + /** + * Flush input and output buffers in the decoder. Any pending inputs are + * decoded and pending outputs are delivered to the plugin. Once done + * flushing, the decoder will call |callback|. + * + * Parameters: + * |video_decoder| is the previously created handle to the decoder resource. + * |callback| is one-time callback that will be called once the flushing + * request has been completed. + * + * Returns an error code from pp_errors.h. + */ + int32_t (*Flush)(PP_Resource video_decoder, + struct PP_CompletionCallback callback); + /** + * Reset the decoder as quickly as possible. Pending inputs and outputs are + * dropped and the decoder is put back into a state ready to receive further + * Decode() calls. |callback| will be called when the reset is done. + * + * Parameters: + * |video_decoder| is the previously created handle to the decoder resource. + * |callback| is one-time callback that will be called once the reset + * request has been completed. + * + * Returns an error code from pp_errors.h. + */ + int32_t (*Reset)(PP_Resource video_decoder, + struct PP_CompletionCallback callback); + /** + * Tear down the decoder as quickly as possible. Pending inputs and outputs + * are dropped and the decoder frees all of its resources. Although resources + * may be freed asynchronously, after this method returns no more callbacks + * will be made on the client. Any resources held by the client at that point + * may be freed. + * + * Parameters: + * |video_decoder| is the previously created handle to the decoder resource. + */ + void (*Destroy)(PP_Resource video_decoder); +}; + +typedef struct PPB_VideoDecoder_Dev_0_16 PPB_VideoDecoder_Dev; +/** + * @} + */ + +/* dev/ppb_view_dev.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/* PPB_View_Dev interface */ +struct PPB_View_Dev_0_1 { + /** + * GetDeviceScale returns the scale factor between device pixels and DIPs + * (also known as logical pixels or UI pixels on some platforms). This allows + * the developer to render their contents at device resolution, even as + * coordinates / sizes are given in DIPs through the API. + * + * Note that the coordinate system for Pepper APIs is DIPs. Also note that + * one DIP might not equal one CSS pixel - when page scale/zoom is in effect. + * + * @param[in] resource A PP_Resource corresponding to a + * PPB_View resource. + * + * @return A float value representing the number of device pixels + * per DIP. If the resource is invalid, the value will be 0.0. + */ + float (*GetDeviceScale)(PP_Resource resource); + /** + * GetCSSScale returns the scale factor between DIPs and CSS pixels. This + * allows proper scaling between DIPs - as sent via the Pepper API - and CSS + * pixel coordinates used for Web content. + * + * @param[in] resource A PP_Resource corresponding to a + * PPB_View resource. + * + * @return css_scale A float value representing the number of + * DIPs per CSS pixel. If the resource is invalid, the value will be 0.0. + */ + float (*GetCSSScale)(PP_Resource resource); +}; + +typedef struct PPB_View_Dev_0_1 PPB_View_Dev; +/** + * @} + */ + +/* dev/ppp_network_state_dev.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +struct PPP_NetworkState_Dev_0_1 { + /** + * Notification that the online state has changed for the user's network. + * This will change as a result of a network cable being plugged or + * unplugged, WiFi connections going up and down, or other events. + * + * Note that being "online" isn't a guarantee that any particular connections + * will succeed. + */ + void (*SetOnLine)(PP_Bool is_online); +}; + +typedef struct PPP_NetworkState_Dev_0_1 PPP_NetworkState_Dev; +/** + * @} + */ + +/* dev/ppp_printing_dev.idl */ +/** + * @addtogroup Structs + * @{ + */ +/** + * Specifies a contiguous range of page numbers to be printed. + * The page numbers use a zero-based index. + */ +struct PP_PrintPageNumberRange_Dev { + uint32_t first_page_number; + uint32_t last_page_number; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_PrintPageNumberRange_Dev, 8); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +struct PPP_Printing_Dev_0_6 { + /** + * Returns a bit field representing the supported print output formats. For + * example, if only PDF and PostScript are supported, + * QuerySupportedFormats returns a value equivalent to: + * (PP_PRINTOUTPUTFORMAT_PDF | PP_PRINTOUTPUTFORMAT_POSTSCRIPT) + */ + uint32_t (*QuerySupportedFormats)(PP_Instance instance); + /** + * Begins a print session with the given print settings. Calls to PrintPages + * can only be made after a successful call to Begin. Returns the number of + * pages required for the print output at the given page size (0 indicates + * a failure). + */ + int32_t (*Begin)(PP_Instance instance, + const struct PP_PrintSettings_Dev* print_settings); + /** + * Prints the specified pages using the format specified in Begin. + * Returns a PPB_Buffer resource that represents the printed output. Returns + * 0 on failure. + */ + PP_Resource (*PrintPages)( + PP_Instance instance, + const struct PP_PrintPageNumberRange_Dev* page_ranges, + uint32_t page_range_count); + /** Ends the print session. Further calls to PrintPages will fail. */ + void (*End)(PP_Instance instance); + /** + * Returns true if the current content should be printed into the full page + * and not scaled down to fit within the printer's printable area. + */ + PP_Bool (*IsScalingDisabled)(PP_Instance instance); +}; + +typedef struct PPP_Printing_Dev_0_6 PPP_Printing_Dev; +/** + * @} + */ + +/* dev/ppp_text_input_dev.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * PPP_TextInput_Dev is a set of function pointers that the + * plugin has to implement to provide hints for text input system (IME). + */ +struct PPP_TextInput_Dev_0_1 { + /** + * Requests the plugin to send back the text around the current caret or + * selection by PPB_TextInput_Dev::UpdateSurroundingText. + * It is recommended to include the desired_number_of_characters + * characters before and after the selection, but not mandatory. + */ + void (*RequestSurroundingText)(PP_Instance instance, + uint32_t desired_number_of_characters); +}; + +typedef struct PPP_TextInput_Dev_0_1 PPP_TextInput_Dev; +/** + * @} + */ + +/* dev/ppp_video_capture_dev.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * Video Capture client interface. See |PPB_VideoCapture_Dev| for general theory + * of operation. + */ +struct PPP_VideoCapture_Dev_0_1 { + /** + * Signals the capture device information, such as resolution and frame rate, + * and the array of buffers that the browser will use to send pixel data. + * + * |info| is a pointer to the PP_VideoCaptureDeviceInfo_Dev structure + * containing resolution and frame rate. + * |buffer_count| is the number of buffers, and |buffers| is the array of + * PPB_Buffer_Dev buffers. + * + * Note: the buffers are passed without an extra reference. The plugin is + * expected to add its own references to the buffers. + */ + void (*OnDeviceInfo)(PP_Instance instance, + PP_Resource video_capture, + const struct PP_VideoCaptureDeviceInfo_Dev* info, + uint32_t buffer_count, + const PP_Resource buffers[]); + /** + * Signals status changes on the VideoCapture. |status| is a + * one of the values from PP_VideoCaptureStatus_Dev; + */ + void (*OnStatus)(PP_Instance instance, + PP_Resource video_capture, + uint32_t status); + /** + * Signals an error from the video capture system. + * + * Errors that can be generated: + * - PP_ERROR_NOMEMORY: not enough memory was available to allocate buffers. + * - PP_ERROR_FAILED: video capture could not start. + */ + void (*OnError)(PP_Instance instance, + PP_Resource video_capture, + uint32_t error_code); + /** + * Signals that a buffer is available for consumption by the plugin. + * + * |buffer| is the index of the buffer, in the array returned by OnDeviceInfo. + */ + void (*OnBufferReady)(PP_Instance instance, + PP_Resource video_capture, + uint32_t buffer); +}; + +typedef struct PPP_VideoCapture_Dev_0_1 PPP_VideoCapture_Dev; +/** + * @} + */ + +/* dev/ppp_video_decoder_dev.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * PPP_VideoDecoder_Dev structure contains the function pointers that the + * plugin MUST implement to provide services needed by the video decoder + * implementation. + * + * See PPB_VideoDecoder_Dev for general usage tips. + */ +struct PPP_VideoDecoder_Dev_0_11 { + /** + * Callback function to provide buffers for the decoded output pictures. If + * succeeds plugin must provide buffers through AssignPictureBuffers function + * to the API. If |req_num_of_bufs| matching exactly the specification + * given in the parameters cannot be allocated decoder should be destroyed. + * + * Decoding will not proceed until buffers have been provided. + * + * Parameters: + * |instance| the plugin instance to which the callback is responding. + * |decoder| the PPB_VideoDecoder_Dev resource. + * |req_num_of_bufs| tells how many buffers are needed by the decoder. + * |dimensions| tells the dimensions of the buffer to allocate. + * |texture_target| the type of texture used. Sample targets in use are + * TEXTURE_2D (most platforms) and TEXTURE_EXTERNAL_OES (on ARM). + */ + void (*ProvidePictureBuffers)(PP_Instance instance, + PP_Resource decoder, + uint32_t req_num_of_bufs, + const struct PP_Size* dimensions, + uint32_t texture_target); + /** + * Callback function for decoder to deliver unneeded picture buffers back to + * the plugin. + * + * Parameters: + * |instance| the plugin instance to which the callback is responding. + * |decoder| the PPB_VideoDecoder_Dev resource. + * |picture_buffer| points to the picture buffer that is no longer needed. + */ + void (*DismissPictureBuffer)(PP_Instance instance, + PP_Resource decoder, + int32_t picture_buffer_id); + /** + * Callback function for decoder to deliver decoded pictures ready to be + * displayed. Decoder expects the plugin to return the buffer back to the + * decoder through ReusePictureBuffer function in PPB Video Decoder API. + * + * Parameters: + * |instance| the plugin instance to which the callback is responding. + * |decoder| the PPB_VideoDecoder_Dev resource. + * |picture| is the picture that is ready. + */ + void (*PictureReady)(PP_Instance instance, + PP_Resource decoder, + const struct PP_Picture_Dev* picture); + /** + * Error handler callback for decoder to deliver information about detected + * errors to the plugin. + * + * Parameters: + * |instance| the plugin instance to which the callback is responding. + * |decoder| the PPB_VideoDecoder_Dev resource. + * |error| error is the enumeration specifying the error. + */ + void (*NotifyError)(PP_Instance instance, + PP_Resource decoder, + PP_VideoDecodeError_Dev error); +}; + +typedef struct PPP_VideoDecoder_Dev_0_11 PPP_VideoDecoder_Dev; +/** + * @} + */ + +/* private/pp_content_decryptor.idl */ +/** + * @addtogroup Structs + * @{ + */ +struct PP_DecryptTrackingInfo { + /** + * Client-specified identifier for the associated decrypt request. By using + * this value, the client can associate the decrypted block with a decryption + * request. + */ + uint32_t request_id; + /** + * A unique buffer ID to identify a PPB_Buffer_Dev. Unlike a PP_Resource, + * this ID is identical at both the renderer side and the plugin side. + * In PPB_ContentDecryptor_Private calls, this is the ID of the + * buffer associated with the decrypted block/frame/samples. + * In PPP_ContentDecryptor_Private calls, this is the ID of a + * buffer that is no longer need at the renderer side, which can be released + * or recycled by the plugin. This ID can be 0 if there is no buffer to be + * released or recycled. + */ + uint32_t buffer_id; + /** + * Timestamp in microseconds of the associated block. By using this value, + * the client can associate the decrypted (and decoded) data with an input + * block. This is needed because buffers may be delivered out of order and + * not in response to the request_id they were provided with. + */ + int64_t timestamp; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_DecryptTrackingInfo, 16); + +/** + * The PP_DecryptSubsampleDescription struct contains information + * to support subsample decryption. + * + * An input block can be split into several continuous subsamples. + * A PP_DecryptSubsampleEntry specifies the number of clear and + * cipher bytes in each subsample. For example, the following block has three + * subsamples: + * + * |<----- subsample1 ----->|<----- subsample2 ----->|<----- subsample3 ----->| + * | clear1 | cipher1 | clear2 | cipher2 | clear3 | cipher3 | + * + * For decryption, all of the cipher bytes in a block should be treated as a + * contiguous (in the subsample order) logical stream. The clear bytes should + * not be considered as part of decryption. + * + * Logical stream to decrypt: | cipher1 | cipher2 | cipher3 | + * Decrypted stream: | decrypted1| decrypted2 | decrypted3 | + * + * After decryption, the decrypted bytes should be copied over the position + * of the corresponding cipher bytes in the original block to form the output + * block. Following the above example, the decrypted block should be: + * + * |<----- subsample1 ----->|<----- subsample2 ----->|<----- subsample3 ----->| + * | clear1 | decrypted1| clear2 | decrypted2 | clear3 | decrypted3 | + */ +struct PP_DecryptSubsampleDescription { + /** + * Size in bytes of clear data in a subsample entry. + */ + uint32_t clear_bytes; + /** + * Size in bytes of encrypted data in a subsample entry. + */ + uint32_t cipher_bytes; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_DecryptSubsampleDescription, 8); + +/** + * The PP_EncryptedBlockInfo struct contains all the information + * needed to decrypt an encrypted block. + */ +struct PP_EncryptedBlockInfo { + /** + * Information needed by the client to track the block to be decrypted. + */ + struct PP_DecryptTrackingInfo tracking_info; + /** + * Size in bytes of data to be decrypted (data_offset included). + */ + uint32_t data_size; + /** + * Key ID of the block to be decrypted. + * + * For WebM the key ID can be as large as 2048 bytes in theory. But it's not + * used in current implementations. If we really need to support it, we should + * move key ID out as a separate parameter, e.g. as a PP_Var, or + * make the whole PP_EncryptedBlockInfo as a + * PP_Resource. + */ + uint8_t key_id[64]; + uint32_t key_id_size; + /** + * Initialization vector of the block to be decrypted. + */ + uint8_t iv[16]; + uint32_t iv_size; + /** + * Subsample information of the block to be decrypted. + * + * We need to have a fixed size of |subsamples| here. Choose 32 because it is + * sufficient for almost all real life scenarios. Note that in theory the + * number of subsamples could be larger than 32. If that happens, playback + * will fail. + */ + struct PP_DecryptSubsampleDescription subsamples[32]; + uint32_t num_subsamples; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_EncryptedBlockInfo, 368); +/** + * @} + */ + +/** + * @addtogroup Enums + * @{ + */ +/** + * PP_DecryptedFrameFormat contains video frame formats. + */ +typedef enum { + PP_DECRYPTEDFRAMEFORMAT_UNKNOWN = 0, + PP_DECRYPTEDFRAMEFORMAT_YV12 = 1, + PP_DECRYPTEDFRAMEFORMAT_I420 = 2 +} PP_DecryptedFrameFormat; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_DecryptedFrameFormat, 4); + +/** + * PP_DecryptedSampleFormat contains audio sample formats. + */ +typedef enum { + PP_DECRYPTEDSAMPLEFORMAT_UNKNOWN = 0, + PP_DECRYPTEDSAMPLEFORMAT_U8 = 1, + PP_DECRYPTEDSAMPLEFORMAT_S16 = 2, + PP_DECRYPTEDSAMPLEFORMAT_S32 = 3, + PP_DECRYPTEDSAMPLEFORMAT_F32 = 4, + PP_DECRYPTEDSAMPLEFORMAT_PLANAR_S16 = 5, + PP_DECRYPTEDSAMPLEFORMAT_PLANAR_F32 = 6 +} PP_DecryptedSampleFormat; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_DecryptedSampleFormat, 4); + +/** + * The PP_DecryptResult enum contains decryption and decoding + * result constants. + */ +typedef enum { + /** The decryption (and/or decoding) operation finished successfully. */ + PP_DECRYPTRESULT_SUCCESS = 0, + /** The decryptor did not have the necessary decryption key. */ + PP_DECRYPTRESULT_DECRYPT_NOKEY = 1, + /** The input was accepted by the decoder but no frame(s) can be produced. */ + PP_DECRYPTRESULT_NEEDMOREDATA = 2, + /** An unexpected error happened during decryption. */ + PP_DECRYPTRESULT_DECRYPT_ERROR = 3, + /** An unexpected error happened during decoding. */ + PP_DECRYPTRESULT_DECODE_ERROR = 4 +} PP_DecryptResult; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_DecryptResult, 4); +/** + * @} + */ + +/** + * @addtogroup Structs + * @{ + */ +/** + * PP_DecryptedBlockInfo struct contains the decryption result and + * tracking info associated with the decrypted block. + */ +struct PP_DecryptedBlockInfo { + /** + * Result of the decryption (and/or decoding) operation. + */ + PP_DecryptResult result; + /** + * Size in bytes of decrypted data, which may be less than the size of the + * corresponding buffer. + */ + uint32_t data_size; + /** + * Information needed by the client to track the block to be decrypted. + */ + struct PP_DecryptTrackingInfo tracking_info; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_DecryptedBlockInfo, 24); +/** + * @} + */ + +/** + * @addtogroup Enums + * @{ + */ +/** + * PP_DecryptedFramePlanes provides YUV plane index values for + * accessing plane offsets stored in PP_DecryptedFrameInfo. + */ +typedef enum { + PP_DECRYPTEDFRAMEPLANES_Y = 0, + PP_DECRYPTEDFRAMEPLANES_U = 1, + PP_DECRYPTEDFRAMEPLANES_V = 2 +} PP_DecryptedFramePlanes; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_DecryptedFramePlanes, 4); +/** + * @} + */ + +/** + * @addtogroup Structs + * @{ + */ +/** + * PP_DecryptedFrameInfo contains the result of the + * decrypt and decode operation on the associated frame, information required + * to access the frame data in buffer, and tracking info. + */ +struct PP_DecryptedFrameInfo { + /** + * Result of the decrypt and decode operation. + */ + PP_DecryptResult result; + /** + * Format of the decrypted frame. + */ + PP_DecryptedFrameFormat format; + /** + * Offsets into the buffer resource for accessing video planes. + */ + int32_t plane_offsets[3]; + /** + * Stride of each plane. + */ + int32_t strides[3]; + /** + * Width of the video frame, in pixels. + */ + int32_t width; + /** + * Height of the video frame, in pixels. + */ + int32_t height; + /** + * Information needed by the client to track the decrypted frame. + */ + struct PP_DecryptTrackingInfo tracking_info; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_DecryptedFrameInfo, 56); + +/** + * PP_DecryptedSampleInfo contains the result of the + * decrypt and decode operation on the associated samples, information required + * to access the sample data in buffer, and tracking info. + */ +struct PP_DecryptedSampleInfo { + /** + * Result of the decrypt and decode operation. + */ + PP_DecryptResult result; + /** + * Format of the decrypted samples. + */ + PP_DecryptedSampleFormat format; + /** + * Size in bytes of decrypted samples. + */ + uint32_t data_size; + /** + * 4-byte padding to make the size of PP_DecryptedSampleInfo + * a multiple of 8 bytes. The value of this field should not be used. + */ + uint32_t padding; + /** + * Information needed by the client to track the decrypted samples. + */ + struct PP_DecryptTrackingInfo tracking_info; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_DecryptedSampleInfo, 32); +/** + * @} + */ + +/** + * @addtogroup Enums + * @{ + */ +/** + * PP_AudioCodec contains audio codec type constants. + */ +typedef enum { + PP_AUDIOCODEC_UNKNOWN = 0, + PP_AUDIOCODEC_VORBIS = 1, + PP_AUDIOCODEC_AAC = 2 +} PP_AudioCodec; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_AudioCodec, 4); +/** + * @} + */ + +/** + * @addtogroup Structs + * @{ + */ +/** + * PP_AudioDecoderConfig contains audio decoder configuration + * information required to initialize audio decoders, and a request ID + * that allows clients to associate a decoder initialization request with a + * status response. Note: When codec requires extra data for + * initialization, the data is sent as a PP_Resource carried + * alongside PP_AudioDecoderConfig. + */ +struct PP_AudioDecoderConfig { + /** + * The audio codec to initialize. + */ + PP_AudioCodec codec; + /** + * Number of audio channels. + */ + int32_t channel_count; + /** + * Size of each audio channel. + */ + int32_t bits_per_channel; + /** + * Audio sampling rate. + */ + int32_t samples_per_second; + /** + * Client-specified identifier for the associated audio decoder initialization + * request. By using this value, the client can associate a decoder + * initialization status response with an initialization request. + */ + uint32_t request_id; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_AudioDecoderConfig, 20); +/** + * @} + */ + +/** + * @addtogroup Enums + * @{ + */ +/** + * PP_VideoCodec contains video codec type constants. + */ +typedef enum { + PP_VIDEOCODEC_UNKNOWN = 0, + PP_VIDEOCODEC_VP8 = 1, + PP_VIDEOCODEC_H264 = 2, + PP_VIDEOCODEC_VP9 = 3 +} PP_VideoCodec; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_VideoCodec, 4); + +/** + * PP_VideoCodecProfile contains video codec profile type + * constants required for video decoder configuration. + *. + */ +typedef enum { + PP_VIDEOCODECPROFILE_UNKNOWN = 0, + PP_VIDEOCODECPROFILE_NOT_NEEDED = 1, + PP_VIDEOCODECPROFILE_H264_BASELINE = 2, + PP_VIDEOCODECPROFILE_H264_MAIN = 3, + PP_VIDEOCODECPROFILE_H264_EXTENDED = 4, + PP_VIDEOCODECPROFILE_H264_HIGH = 5, + PP_VIDEOCODECPROFILE_H264_HIGH_10 = 6, + PP_VIDEOCODECPROFILE_H264_HIGH_422 = 7, + PP_VIDEOCODECPROFILE_H264_HIGH_444_PREDICTIVE = 8 +} PP_VideoCodecProfile; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_VideoCodecProfile, 4); +/** + * @} + */ + +/** + * @addtogroup Structs + * @{ + */ +/** + * PP_VideoDecoderConfig contains video decoder configuration + * information required to initialize video decoders, and a request ID + * that allows clients to associate a decoder initialization request with a + * status response. Note: When codec requires extra data for + * initialization, the data is sent as a PP_Resource carried + * alongside PP_VideoDecoderConfig. + */ +struct PP_VideoDecoderConfig { + /** + * The video codec to initialize. + */ + PP_VideoCodec codec; + /** + * Profile to use when initializing the video codec. + */ + PP_VideoCodecProfile profile; + /** + * Output video format. + */ + PP_DecryptedFrameFormat format; + /** + * Width of decoded video frames, in pixels. + */ + int32_t width; + /** + * Height of decoded video frames, in pixels. + */ + int32_t height; + /** + * Client-specified identifier for the associated video decoder initialization + * request. By using this value, the client can associate a decoder + * initialization status response with an initialization request. + */ + uint32_t request_id; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_VideoDecoderConfig, 24); +/** + * @} + */ + +/** + * @addtogroup Enums + * @{ + */ +/** + * PP_DecryptorStreamType contains stream type constants. + */ +typedef enum { + PP_DECRYPTORSTREAMTYPE_AUDIO = 0, + PP_DECRYPTORSTREAMTYPE_VIDEO = 1 +} PP_DecryptorStreamType; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_DecryptorStreamType, 4); + +/** + * PP_SessionType contains session type constants. + */ +typedef enum { + PP_SESSIONTYPE_TEMPORARY = 0, + PP_SESSIONTYPE_PERSISTENT_LICENSE = 1, + PP_SESSIONTYPE_PERSISTENT_RELEASE = 2 +} PP_SessionType; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_SessionType, 4); + +/** + * PP_InitDataType contains Initialization Data Type constants. + */ +typedef enum { + PP_INITDATATYPE_CENC = 0, + PP_INITDATATYPE_KEYIDS = 1, + PP_INITDATATYPE_WEBM = 2 +} PP_InitDataType; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_InitDataType, 4); + +/** + * PP_CdmExceptionCode contains exception code constants. + */ +typedef enum { + PP_CDMEXCEPTIONCODE_NOTSUPPORTEDERROR = 1, + PP_CDMEXCEPTIONCODE_INVALIDSTATEERROR = 2, + PP_CDMEXCEPTIONCODE_INVALIDACCESSERROR = 3, + PP_CDMEXCEPTIONCODE_QUOTAEXCEEDEDERROR = 4, + PP_CDMEXCEPTIONCODE_UNKNOWNERROR = 5, + PP_CDMEXCEPTIONCODE_CLIENTERROR = 6, + PP_CDMEXCEPTIONCODE_OUTPUTERROR = 7 +} PP_CdmExceptionCode; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_CdmExceptionCode, 4); + +/** + * PP_CdmMessageType contains message type constants. + */ +typedef enum { + PP_CDMMESSAGETYPE_LICENSE_REQUEST = 0, + PP_CDMMESSAGETYPE_LICENSE_RENEWAL = 1, + PP_CDMMESSAGETYPE_LICENSE_RELEASE = 2 +} PP_CdmMessageType; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_CdmMessageType, 4); + +/** + * PP_CdmKeyStatus contains key status constants. + */ +typedef enum { + PP_CDMKEYSTATUS_USABLE = 0, + PP_CDMKEYSTATUS_INVALID = 1, + PP_CDMKEYSTATUS_EXPIRED = 2, + PP_CDMKEYSTATUS_OUTPUTRESTRICTED = 3, + PP_CDMKEYSTATUS_OUTPUTDOWNSCALED = 4, + PP_CDMKEYSTATUS_STATUSPENDING = 5, + PP_CDMKEYSTATUS_RELEASED = 6 +} PP_CdmKeyStatus; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_CdmKeyStatus, 4); +/** + * @} + */ + +/** + * @addtogroup Structs + * @{ + */ +/** + * The PP_KeyInformation struct contains information about a + * key used for decryption. + */ +struct PP_KeyInformation { + /** + * Key ID. + */ + uint8_t key_id[512]; + uint32_t key_id_size; + /** + * Status of this key. + */ + PP_CdmKeyStatus key_status; + /** + * Optional error code for keys that are not usable. + */ + uint32_t system_code; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_KeyInformation, 524); +/** + * @} + */ + +/* private/pp_file_handle.idl */ + +#ifdef _WIN32 +#include +typedef HANDLE PP_FileHandle; +static const PP_FileHandle PP_kInvalidFileHandle = NULL; + +#else +typedef int PP_FileHandle; +static const PP_FileHandle PP_kInvalidFileHandle = -1; +#endif + +/* private/pp_private_font_charset.idl */ +/** + * @addtogroup Enums + * @{ + */ +typedef enum { + PP_PRIVATEFONTCHARSET_ANSI = 0, + PP_PRIVATEFONTCHARSET_DEFAULT = 1, + PP_PRIVATEFONTCHARSET_SYMBOL = 2, + PP_PRIVATEFONTCHARSET_MAC = 77, + PP_PRIVATEFONTCHARSET_SHIFTJIS = 128, + PP_PRIVATEFONTCHARSET_HANGUL = 129, + PP_PRIVATEFONTCHARSET_JOHAB = 130, + PP_PRIVATEFONTCHARSET_GB2312 = 134, + PP_PRIVATEFONTCHARSET_CHINESEBIG5 = 136, + PP_PRIVATEFONTCHARSET_GREEK = 161, + PP_PRIVATEFONTCHARSET_TURKISH = 162, + PP_PRIVATEFONTCHARSET_VIETNAMESE = 163, + PP_PRIVATEFONTCHARSET_HEBREW = 177, + PP_PRIVATEFONTCHARSET_ARABIC = 178, + PP_PRIVATEFONTCHARSET_BALTIC = 186, + PP_PRIVATEFONTCHARSET_RUSSIAN = 204, + PP_PRIVATEFONTCHARSET_THAI = 222, + PP_PRIVATEFONTCHARSET_EASTEUROPE = 238, + PP_PRIVATEFONTCHARSET_OEM = 255 +} PP_PrivateFontCharset; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_PrivateFontCharset, 4); +/** + * @} + */ + +/* private/pp_video_capture_format.idl */ +/** + * @addtogroup Structs + * @{ + */ +/** + * The PP_VideoCaptureFormat struct represents a video capture + * format. + */ +struct PP_VideoCaptureFormat { + /** + * Frame size in pixels. + */ + struct PP_Size frame_size; + /** + * Frame rate in frames per second. + */ + float frame_rate; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_VideoCaptureFormat, 12); +/** + * @} + */ + +/* private/pp_video_frame_private.idl */ +/** + * @addtogroup Structs + * @{ + */ +/** + * The PP_VideoFrame_Private struct represents a video frame. + * Video sources and destinations use frames to transfer video to and from + * the browser. + */ +struct PP_VideoFrame_Private { + /** + * A timestamp placing the frame in a video stream. + */ + PP_TimeTicks timestamp; + /** + * An image data resource to hold the video frame. + */ + PP_Resource image_data; + /** + * Ensure that this struct is 16-bytes wide by padding the end. In some + * compilers, PP_TimeTicks is 8-byte aligned, so those compilers align this + * struct on 8-byte boundaries as well and pad it to 8 bytes even without this + * padding attribute. This padding makes its size consistent across + * compilers. + */ + int32_t padding; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_VideoFrame_Private, 16); +/** + * @} + */ + +/* private/ppb_camera_capabilities_private.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_CameraCapabilities_Private interface contains pointers + * to several functions for getting the image capture capabilities within the + * browser. + */ +struct PPB_CameraCapabilities_Private_0_1 { + /** + * IsCameraCapabilities() determines if the given resource is a + * PPB_CameraCapabilities_Private. + * + * @param[in] resource A PP_Resource corresponding to an image + * capture capabilities resource. + * + * @return A PP_Bool containing PP_TRUE if the given + * resource is an PP_CameraCapabilities_Private resource, + * otherwise PP_FALSE. + */ + PP_Bool (*IsCameraCapabilities)(PP_Resource resource); + /** + * GetSupportedVideoCaptureFormats() returns the supported video capture + * formats for the given PPB_CameraCapabilities_Private. + * + * @param[in] capabilities A PP_Resource corresponding to an + * image capture capabilities resource. + * @param[out] array_size The size of preview size array. + * @param[out] formats An array of PP_VideoCaptureFormat + * corresponding to the supported video capture formats. The ownership of the + * array belongs to PPB_CameraCapabilities_Private and the caller + * should not free it. When a PPB_CameraCapabilities_Private is deleted, the + * array returning from this is no longer valid. + */ + void (*GetSupportedVideoCaptureFormats)( + PP_Resource capabilities, + uint32_t* array_size, + struct PP_VideoCaptureFormat** formats); +}; + +typedef struct PPB_CameraCapabilities_Private_0_1 + PPB_CameraCapabilities_Private; +/** + * @} + */ + +/* private/ppb_camera_device_private.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * To query camera capabilities: + * 1. Get a PPB_CameraDevice_Private object by Create(). + * 2. Open() camera device with track id of MediaStream video track. + * 3. Call GetCameraCapabilities() to get a + * PPB_CameraCapabilities_Private object, which can be used to + * query camera capabilities. + */ +struct PPB_CameraDevice_Private_0_1 { + /** + * Creates a PPB_CameraDevice_Private resource. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * + * @return A PP_Resource corresponding to a + * PPB_CameraDevice_Private resource if successful, 0 if failed. + */ + PP_Resource (*Create)(PP_Instance instance); + /** + * Determines if a resource is a camera device resource. + * + * @param[in] resource The PP_Resource to test. + * + * @return A PP_Bool with PP_TRUE if the given + * resource is a camera device resource or PP_FALSE + * otherwise. + */ + PP_Bool (*IsCameraDevice)(PP_Resource resource); + /** + * Opens a camera device. + * + * @param[in] camera_device A PP_Resource corresponding to a + * camera device resource. + * @param[in] device_id A PP_Var identifying a camera device. The + * type is string. The ID can be obtained from MediaStreamTrack.getSources() + * or MediaStreamVideoTrack.id. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Open(). + * + * @return An error code from pp_errors.h. + */ + int32_t (*Open)(PP_Resource camera_device, + struct PP_Var device_id, + struct PP_CompletionCallback callback); + /** + * Disconnects from the camera and cancels all pending requests. + * After this returns, no callbacks will be called. If + * PPB_CameraDevice_Private is destroyed and is not closed yet, this + * function will be automatically called. Calling this more than once has no + * effect. + * + * @param[in] camera_device A PP_Resource corresponding to a + * camera device resource. + */ + void (*Close)(PP_Resource camera_device); + /** + * Gets the camera capabilities. + * + * The camera capabilities do not change for a given camera source. + * + * @param[in] camera_device A PP_Resource corresponding to a + * camera device resource. + * @param[out] capabilities A PPB_CameraCapabilities_Private for + * storing the camera capabilities on success. Otherwise, the value will not + * be changed. + * @param[in] callback PP_CompletionCallback to be called upon + * completion of GetCameraCapabilities(). + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t (*GetCameraCapabilities)(PP_Resource camera_device, + PP_Resource* capabilities, + struct PP_CompletionCallback callback); +}; + +typedef struct PPB_CameraDevice_Private_0_1 PPB_CameraDevice_Private; +/** + * @} + */ + +/* private/ppb_content_decryptor_private.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * PPB_ContentDecryptor_Private structure contains the function + * pointers the browser must implement to support plugins implementing the + * PPP_ContentDecryptor_Private interface. This interface provides + * browser side support for the Content Decryption Module (CDM) for Encrypted + * Media Extensions: http://www.w3.org/TR/encrypted-media/ + */ +struct PPB_ContentDecryptor_Private_0_14 { + /** + * A promise has been resolved by the CDM. + * + * @param[in] promise_id Identifies the promise that the CDM resolved. + */ + void (*PromiseResolved)(PP_Instance instance, uint32_t promise_id); + /** + * A promise that resulted in a new session has been resolved by the CDM. + * + * @param[in] promise_id Identifies the promise that the CDM resolved. + * + * @param[in] session_id A PP_Var of type + * PP_VARTYPE_STRING containing the session's ID attribute. + */ + void (*PromiseResolvedWithSession)(PP_Instance instance, + uint32_t promise_id, + struct PP_Var session_id); + /** + * A promise has been rejected by the CDM due to an error. + * + * @param[in] promise_id Identifies the promise that the CDM rejected. + * + * @param[in] exception_code A PP_CdmExceptionCode containing + * the exception code. + * + * @param[in] system_code A system error code. + * + * @param[in] error_description A PP_Var of type + * PP_VARTYPE_STRING containing the error description. + */ + void (*PromiseRejected)(PP_Instance instance, + uint32_t promise_id, + PP_CdmExceptionCode exception_code, + uint32_t system_code, + struct PP_Var error_description); + /** + * A message or request has been generated for key_system in the CDM, and + * must be sent to the web application. + * + * For example, when the browser invokes CreateSession() + * on the PPP_ContentDecryptor_Private interface, the plugin + * must send a message containing the license request. + * + * Note that SessionMessage() can be used for purposes other than + * responses to CreateSession() calls. See also the text + * in the comment for SessionReady(), which describes a sequence + * of UpdateSession() and SessionMessage() calls + * required to prepare for decryption. + * + * @param[in] session_id A PP_Var of type + * PP_VARTYPE_STRING containing the ID of a session for + * which this message is intended. + * + * @param[in] message_type A PP_CdmMessageType containing the + * message type. + * + * @param[in] message A PP_Var of type + * PP_VARTYPE_ARRAY_BUFFER that contains the message. + * + * @param[in] legacy_destination_url A PP_Var of type + * PP_VARTYPE_STRING containing the destination URL for the + * message. + */ + void (*SessionMessage)(PP_Instance instance, + struct PP_Var session_id, + PP_CdmMessageType message_type, + struct PP_Var message, + struct PP_Var legacy_destination_url); + /** + * The keys for a session have changed. + * + * @param[in] session_id A PP_Var of type + * PP_VARTYPE_STRING containing the ID of the session that has + * a change in keys. + * + * @param[in] has_additional_usable_key A PP_Bool indicating if + * a new usable key has been added. + * + * @param[in] key_count The number of arguments contained in + * key_information + * + * @param[in] key_information An array of type PP_KeyInformation + * that are the session's key IDs and their status. + */ + void (*SessionKeysChange)(PP_Instance instance, + struct PP_Var session_id, + PP_Bool has_additional_usable_key, + uint32_t key_count, + const struct PP_KeyInformation key_information[]); + /** + * The expiration time for a session has changed. + * + * @param[in] session_id A PP_Var of type + * PP_VARTYPE_STRING containing the ID of the session that has + * a new expiration time. + * + * @param[in] new_expiry_time A PP_Time indicating the new + * expiry time of the session. The value is defined as the number of seconds + * since the Epoch (00:00:00 UTC, January 1, 1970). + */ + void (*SessionExpirationChange)(PP_Instance instance, + struct PP_Var session_id, + PP_Time new_expiry_time); + /** + * The session has been closed as the result of a call to the + * ReleaseSession() method on the + * PPP_ContentDecryptor_Private interface, or due to other + * factors as determined by the CDM. + * + * @param[in] session_id A PP_Var of type + * PP_VARTYPE_STRING containing the session's ID attribute of + * the session that is now closed. + */ + void (*SessionClosed)(PP_Instance instance, struct PP_Var session_id); + /** + * An error occurred in a PPP_ContentDecryptor_Private method, + * or within the plugin implementing the interface. + * + * @param[in] session_id A PP_Var of type + * PP_VARTYPE_STRING containing the session's ID attribute of + * the session that caused the error. + * + * @param[in] exception_code A PP_CdmExceptionCode containing + * the exception code. + * + * @param[in] system_code A system error code. + * + * @param[in] error_description A PP_Var of type + * PP_VARTYPE_STRING containing the error description. + */ + void (*LegacySessionError)(PP_Instance instance, + struct PP_Var session_id, + PP_CdmExceptionCode exception_code, + uint32_t system_code, + struct PP_Var error_description); + /** + * Called after the Decrypt() method on the + * PPP_ContentDecryptor_Private interface completes to + * deliver decrypted_block to the browser for decoding and rendering. + * + * The plugin must not hold a reference to the encrypted buffer resource + * provided to Decrypt() when it calls this method. The browser + * will reuse the buffer in a subsequent Decrypt() call. + * + * @param[in] decrypted_block A PP_Resource corresponding to a + * PPB_Buffer_Dev resource that contains a decrypted data + * block. + * + * @param[in] decrypted_block_info A PP_DecryptedBlockInfo that + * contains the result code and tracking info associated with the + * decrypted_block. + */ + void (*DeliverBlock)( + PP_Instance instance, + PP_Resource decrypted_block, + const struct PP_DecryptedBlockInfo* decrypted_block_info); + /** + * Called after the InitializeAudioDecoder() or + * InitializeVideoDecoder() method on the + * PPP_ContentDecryptor_Private interface completes to report + * decoder initialization status to the browser. + * + * @param[in] success A PP_Bool that is set to + * PP_TRUE when the decoder initialization request associated + * with request_id was successful. + * + * @param[in] decoder_type A PP_DecryptorStreamType identifying + * the decoder type for which this initialization status response was sent. + * + * @param[in] request_id The request_id value passed to + * InitializeAudioDecoder or InitializeVideoDecoder + * in PP_AudioDecoderConfig or + * PP_VideoDecoderConfig. + */ + void (*DecoderInitializeDone)(PP_Instance instance, + PP_DecryptorStreamType decoder_type, + uint32_t request_id, + PP_Bool success); + /** + * Called after the DeinitializeDecoder() method on the + * PPP_ContentDecryptor_Private interface completes to report + * decoder de-initialization completion to the browser. + * + * @param[in] decoder_type The PP_DecryptorStreamType passed to + * DeinitializeDecoder(). + * + * @param[in] request_id The request_id value passed to + * DeinitializeDecoder(). + */ + void (*DecoderDeinitializeDone)(PP_Instance instance, + PP_DecryptorStreamType decoder_type, + uint32_t request_id); + /** + * Called after the ResetDecoder() method on the + * PPP_ContentDecryptor_Private interface completes to report + * decoder reset completion to the browser. + * + * @param[in] decoder_type The PP_DecryptorStreamType passed to + * ResetDecoder(). + * + * @param[in] request_id The request_id value passed to + * ResetDecoder(). + */ + void (*DecoderResetDone)(PP_Instance instance, + PP_DecryptorStreamType decoder_type, + uint32_t request_id); + /** + * Called after the DecryptAndDecode() method on the + * PPP_ContentDecryptor_Private interface completes to deliver + * a decrypted and decoded video frame to the browser for rendering. + * + * The plugin must not hold a reference to the encrypted buffer resource + * provided to DecryptAndDecode() when it calls this method. The + * browser will reuse the buffer in a subsequent + * DecryptAndDecode() call. + * + * @param[in] decrypted_frame A PP_Resource corresponding to a + * PPB_Buffer_Dev resource that contains a video frame. + * + * @param[in] decrypted_frame_info A PP_DecryptedFrameInfo that + * contains the result code, tracking info, and buffer format associated with + * decrypted_frame. + */ + void (*DeliverFrame)( + PP_Instance instance, + PP_Resource decrypted_frame, + const struct PP_DecryptedFrameInfo* decrypted_frame_info); + /** + * Called after the DecryptAndDecode() method on the + * PPP_ContentDecryptor_Private interface completes to deliver + * a buffer of decrypted and decoded audio samples to the browser for + * rendering. + * + * The plugin must not hold a reference to the encrypted buffer resource + * provided to DecryptAndDecode() when it calls this method. The + * browser will reuse the buffer in a subsequent + * DecryptAndDecode() call. + * + * audio_frames can contain multiple audio output buffers. Each + * buffer is serialized in this format: + * + * |<------------------- serialized audio buffer ------------------->| + * | int64_t timestamp | int64_t length | length bytes of audio data | + * + * For example, with three audio output buffers, |audio_frames| will look + * like this: + * + * |<---------------- audio_frames ------------------>| + * | audio buffer 0 | audio buffer 1 | audio buffer 2 | + * + * @param[in] audio_frames A PP_Resource corresponding to a + * PPB_Buffer_Dev resource that contains a decrypted buffer + * of decoded audio samples. + * + * @param[in] decrypted_sample_info A PP_DecryptedSampleInfo that + * contains the tracking info and result code associated with the decrypted + * samples. + */ + void (*DeliverSamples)( + PP_Instance instance, + PP_Resource audio_frames, + const struct PP_DecryptedSampleInfo* decrypted_sample_info); +}; + +typedef struct PPB_ContentDecryptor_Private_0_14 PPB_ContentDecryptor_Private; +/** + * @} + */ + +/* private/ppb_display_color_profile_private.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * PPB_DisplayColorProfile_Private defines the methods for getting + * the display color profile and monitoring its changes. + * + * Setup: + * @code + * PP_ArrayOutput output = { MyAllocatorFunction, color_profile_data }; + * PP_Resource display_cp = display_cp_interface->Create(instance); + * display_cp_interface->GetColorProfile(display_cp, + * output, + * completion_callback); + * @endcode + */ +struct PPB_DisplayColorProfile_Private_0_1 { + /** + * Create() creates a display color profile resource. + * + * @param[in] instance The module instance. + * @return A PP_Resource containing a display color profile + * resource. + */ + PP_Resource (*Create)(PP_Instance instance); + /** + * IsDisplayColorProfile() determines if the given resource is a valid + * DisplayColorProfile resource. + * + * @param[in] resource A DisplayColorProfile context resource. + * @return Returns: + * - PP_TRUE if the given resource is a valid + * DisplayColorProfile + * - PP_FALSE if it is an invalid resource or is a resource + * of another type. + */ + PP_Bool (*IsDisplayColorProfile)(PP_Resource resource); + /** + * GetColorProfile() enqueues a request for the current display color profile. + * + * This method is intended for getting the color profile data of the display + * on which the browser window resides. [However currently Chrome only + * considers the system's primary display color profile when doing its color + * management. For consistency this method will also return the color profile + * that Chrome uses for its browser window.] + * + * @param[in] display_color_profile_res The display color profile resource. + * @param[in] color_profile A PP_OutputArray which on success + * will receive a byte array containing the ICC color profile data (see + * www.color.org for a reference to the ICC color profile specification + * and versions). The returned color profile version is the one supported by + * the host system. + * @param[in] callback The completion callback to be called once the display + * color profile data is available. + * + * @return Returns an error code from pp_errors.h. + */ + int32_t (*GetColorProfile)(PP_Resource display_color_profile_res, + struct PP_ArrayOutput color_profile, + struct PP_CompletionCallback callback); + /** + * RegisterColorProfileChangeCallback() registers a callback to be called next + * time the color profile for the browser window in which the plugin resides + * changes. In order to get notifications for all color profile changes a call + * to RegisterColorProfileChangeCallback() function should be done when the + * previous notification was fired. + * + * There might be 2 scenarios in which the color profile for a window changes: + * a) The window is moved from one display to another; + * b) The user changes the display color space from the system settings. + * + * @param[in] display_color_profile_res The display color profile resource. + * @param[in] callback The callback to be invoked next time the display + * color profile changes. + * + * @return Returns an error code from pp_errors.h. + */ + int32_t (*RegisterColorProfileChangeCallback)( + PP_Resource display_color_profile_res, + struct PP_CompletionCallback callback); +}; + +typedef struct PPB_DisplayColorProfile_Private_0_1 + PPB_DisplayColorProfile_Private; +/** + * @} + */ + +/* private/ppb_ext_crx_file_system_private.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/* PPB_Ext_CrxFileSystem_Private interface */ +struct PPB_Ext_CrxFileSystem_Private_0_1 { + /** + * Open() opens the CRX file system for the current extension. It will fail + * when called from non-extension context. + * + * @param[in] crxfs A PP_Resource corresponding to a + * CrxFileSystem. + * @param[out] file_system An output PP_Resource corresponding + * to a PPB_FileSystem. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Open. + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t (*Open)(PP_Instance instance, + PP_Resource* file_system, + struct PP_CompletionCallback callback); +}; + +typedef struct PPB_Ext_CrxFileSystem_Private_0_1 PPB_Ext_CrxFileSystem_Private; +/** + * @} + */ + +/* private/ppb_file_io_private.idl */ +#include "ppapi/c/private/pp_file_handle.h" + +/** + * @addtogroup Interfaces + * @{ + */ +/* PPB_FileIO_Private interface */ +struct PPB_FileIO_Private_0_1 { + /** + * Returns a file handle corresponding to the given FileIO + * object. The FileIO object must have been opened with a + * successful call to FileIO::Open. The caller gets the ownership + * of the returned file handle and must close it. + */ + int32_t (*RequestOSFileHandle)(PP_Resource file_io, + PP_FileHandle* handle, + struct PP_CompletionCallback callback); +}; + +typedef struct PPB_FileIO_Private_0_1 PPB_FileIO_Private; +/** + * @} + */ + +/* private/ppb_file_ref_private.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/* PPB_FileRefPrivate interface */ +struct PPB_FileRefPrivate_0_1 { + /** + * GetAbsolutePath() returns the absolute path of the file. + * + * @param[in] file_ref A PP_Resource corresponding to a file + * reference. + * + * @return A PP_Var containing the absolute path of the file. + */ + struct PP_Var (*GetAbsolutePath)(PP_Resource file_ref); +}; + +typedef struct PPB_FileRefPrivate_0_1 PPB_FileRefPrivate; +/** + * @} + */ + +/* private/ppb_find_private.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * This is a private interface for doing browser Find in the PDF plugin. + */ +struct PPB_Find_Private_0_3 { + /** + * Sets the instance of this plugin as the mechanism that will be used to + * handle find requests in the renderer. This will only succeed if the plugin + * is embedded within the content of the top level frame. Note that this will + * result in the renderer handing over all responsibility for doing find to + * the plugin and content from the rest of the page will not be searched. + * + * + * In the case that the plugin is loaded directly as the top level document, + * this function does not need to be called. In that case the plugin is + * assumed to handle find requests. + * + * There can only be one plugin which handles find requests. If a plugin calls + * this while an existing plugin is registered, the existing plugin will be + * de-registered and will no longer receive any requests. + */ + void (*SetPluginToHandleFindRequests)(PP_Instance instance); + /** + * Updates the number of find results for the current search term. If + * there are no matches 0 should be passed in. Only when the plugin has + * finished searching should it pass in the final count with final_result set + * to PP_TRUE. + */ + void (*NumberOfFindResultsChanged)(PP_Instance instance, + int32_t total, + PP_Bool final_result); + /** + * Updates the index of the currently selected search item. + */ + void (*SelectedFindResultChanged)(PP_Instance instance, int32_t index); + /** + * Updates the tickmarks on the scrollbar for the find request. |tickmarks| + * contains |count| PP_Rects indicating the tickmark ranges. + */ + void (*SetTickmarks)(PP_Instance instance, + const struct PP_Rect tickmarks[], + uint32_t count); +}; + +typedef struct PPB_Find_Private_0_3 PPB_Find_Private; +/** + * @} + */ + +/* private/ppb_flash.idl */ +/** + * @addtogroup Enums + * @{ + */ +typedef enum { + /** + * No restrictions on Flash LSOs. + */ + PP_FLASHLSORESTRICTIONS_NONE = 1, + /** + * Don't allow access to Flash LSOs. + */ + PP_FLASHLSORESTRICTIONS_BLOCK = 2, + /** + * Store Flash LSOs in memory only. + */ + PP_FLASHLSORESTRICTIONS_IN_MEMORY = 3 +} PP_FlashLSORestrictions; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_FlashLSORestrictions, 4); + +typedef enum { + /** + * Specifies if the system likely supports 3D hardware acceleration. + * + * The result is a boolean PP_Var, depending on the supported nature of 3D + * acceleration. If querying this function returns true, the 3D system will + * normally use the native hardware for rendering which will be much faster. + * + * Having this set to true only means that 3D should be used to draw 2D and + * video elements. PP_FLASHSETTING_STAGE3D_ENABLED should be checked to + * determine if it's ok to use 3D for arbitrary content. + * + * In rare cases (depending on the platform) this value will be true but a + * created 3D context will use emulation because context initialization + * failed. + */ + PP_FLASHSETTING_3DENABLED = 1, + /** + * Specifies if the given instance is in private/incognito/off-the-record mode + * (returns true) or "regular" mode (returns false). Returns an undefined + * PP_Var on invalid instance. + */ + PP_FLASHSETTING_INCOGNITO = 2, + /** + * Specifies if arbitrary 3d commands are supported (returns true), or if 3d + * should only be used for drawing 2d and video (returns false). + * + * This should only be enabled if PP_FLASHSETTING_3DENABLED is true. + */ + PP_FLASHSETTING_STAGE3DENABLED = 3, + /** + * Specifies the string for the language code of the UI of the browser. + * + * For example: "en-US" or "de". + * + * Returns an undefined PP_Var on invalid instance. + */ + PP_FLASHSETTING_LANGUAGE = 4, + /** + * Specifies the number of CPU cores that are present on the system. + */ + PP_FLASHSETTING_NUMCORES = 5, + /** + * Specifies restrictions on how flash should handle LSOs. The result is an + * int from PP_FlashLSORestrictions. + */ + PP_FLASHSETTING_LSORESTRICTIONS = 6, + /** + * Specifies if the driver is reliable enough to use Shader Model 3 commands + * with it. + * + * This should only be enabled if PP_FLASHSETTING_STAGE3DENABLED is true. + */ + PP_FLASHSETTING_STAGE3DBASELINEENABLED = 7 +} PP_FlashSetting; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_FlashSetting, 4); + +/** + * This enum provides keys for setting breakpad crash report data. + */ +typedef enum { + /** + * Specifies the document URL which contains the flash instance. + */ + PP_FLASHCRASHKEY_URL = 1, + /** + * Specifies the URL of the current swf. + */ + PP_FLASHCRASHKEY_RESOURCE_URL = 2 +} PP_FlashCrashKey; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_FlashCrashKey, 4); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_Flash interface contains pointers to various functions + * that are only needed to support Pepper Flash. + */ +struct PPB_Flash_13_0 { + /** + * Sets or clears the rendering hint that the given plugin instance is always + * on top of page content. Somewhat more optimized painting can be used in + * this case. + */ + void (*SetInstanceAlwaysOnTop)(PP_Instance instance, PP_Bool on_top); + /** + * Draws the given pre-laid-out text. It is almost equivalent to Windows' + * ExtTextOut with the addition of the transformation (a 3x3 matrix given the + * transform to apply before drawing). It also adds the allow_subpixel_aa + * flag which when true, will use subpixel antialiasing if enabled in the + * system settings. For this to work properly, the graphics layer that the + * text is being drawn into must be opaque. + */ + PP_Bool (*DrawGlyphs)( + PP_Instance instance, + PP_Resource pp_image_data, + const struct PP_BrowserFont_Trusted_Description* font_desc, + uint32_t color, + const struct PP_Point* position, + const struct PP_Rect* clip, + const float transformation[3][3], + PP_Bool allow_subpixel_aa, + uint32_t glyph_count, + const uint16_t glyph_indices[], + const struct PP_Point glyph_advances[]); + /** + * Retrieves the proxy that will be used for the given URL. The result will + * be a string in PAC format, or an undefined var on error. + */ + struct PP_Var (*GetProxyForURL)(PP_Instance instance, const char* url); + /** + * Navigate to the URL given by the given URLRequestInfo. (This supports GETs, + * POSTs, and javascript: URLs.) May open a new tab if target is not "_self". + */ + int32_t (*Navigate)(PP_Resource request_info, + const char* target, + PP_Bool from_user_action); + /** + * Retrieves the local time zone offset from GM time for the given UTC time. + */ + double (*GetLocalTimeZoneOffset)(PP_Instance instance, PP_Time t); + /** + * Gets a (string) with "command-line" options for Flash; used to pass + * run-time debugging parameters, etc. + */ + struct PP_Var (*GetCommandLineArgs)(PP_Module module); + /** + * Loads the given font in a more privileged process on Windows. Call this if + * Windows is giving errors for font calls. See + * content/renderer/font_cache_dispatcher_win.cc + * + * The parameter is a pointer to a LOGFONTW structure. + * + * On non-Windows platforms, this function does nothing. + */ + void (*PreloadFontWin)(const void* logfontw); + /** + * Returns whether the given rectangle (in the plugin) is topmost, i.e., above + * all other web content. + */ + PP_Bool (*IsRectTopmost)(PP_Instance instance, const struct PP_Rect* rect); + /** + * Indicates that there's activity and, e.g., the screensaver shouldn't kick + * in. + */ + void (*UpdateActivity)(PP_Instance instance); + /** + * Returns the value associated with the given setting. Invalid enums will + * result in an undefined PP_Var return value. + */ + struct PP_Var (*GetSetting)(PP_Instance instance, PP_FlashSetting setting); + /** + * Allows setting breakpad crash data which will be included in plugin crash + * reports. Returns PP_FALSE if crash data could not be set. + */ + PP_Bool (*SetCrashData)(PP_Instance instance, + PP_FlashCrashKey key, + struct PP_Var value); + /** + * Enumerates video capture devices. |video_capture| is a valid + * PPB_VideoCapture_Dev resource. Once the operation has completed + * successfully, |devices| will be set up with an array of + * PPB_DeviceRef_Dev resources. + * + * PP_OK is returned on success and different pepper error code on failure. + * The ref count of the returned |devices| has already been increased by 1 for + * the caller. + * + * NOTE: This method is a synchronous version of |EnumerateDevices| in + * PPB_VideoCapture_Dev. + */ + int32_t (*EnumerateVideoCaptureDevices)(PP_Instance instance, + PP_Resource video_capture, + struct PP_ArrayOutput devices); +}; + +typedef struct PPB_Flash_13_0 PPB_Flash; + +struct PPB_Flash_12_4 { + void (*SetInstanceAlwaysOnTop)(PP_Instance instance, PP_Bool on_top); + PP_Bool (*DrawGlyphs)( + PP_Instance instance, + PP_Resource pp_image_data, + const struct PP_BrowserFont_Trusted_Description* font_desc, + uint32_t color, + const struct PP_Point* position, + const struct PP_Rect* clip, + const float transformation[3][3], + PP_Bool allow_subpixel_aa, + uint32_t glyph_count, + const uint16_t glyph_indices[], + const struct PP_Point glyph_advances[]); + struct PP_Var (*GetProxyForURL)(PP_Instance instance, const char* url); + int32_t (*Navigate)(PP_Resource request_info, + const char* target, + PP_Bool from_user_action); + void (*RunMessageLoop)(PP_Instance instance); + void (*QuitMessageLoop)(PP_Instance instance); + double (*GetLocalTimeZoneOffset)(PP_Instance instance, PP_Time t); + struct PP_Var (*GetCommandLineArgs)(PP_Module module); + void (*PreloadFontWin)(const void* logfontw); + PP_Bool (*IsRectTopmost)(PP_Instance instance, const struct PP_Rect* rect); + int32_t (*InvokePrinting)(PP_Instance instance); + void (*UpdateActivity)(PP_Instance instance); + struct PP_Var (*GetDeviceID)(PP_Instance instance); + int32_t (*GetSettingInt)(PP_Instance instance, PP_FlashSetting setting); + struct PP_Var (*GetSetting)(PP_Instance instance, PP_FlashSetting setting); +}; + +struct PPB_Flash_12_5 { + void (*SetInstanceAlwaysOnTop)(PP_Instance instance, PP_Bool on_top); + PP_Bool (*DrawGlyphs)( + PP_Instance instance, + PP_Resource pp_image_data, + const struct PP_BrowserFont_Trusted_Description* font_desc, + uint32_t color, + const struct PP_Point* position, + const struct PP_Rect* clip, + const float transformation[3][3], + PP_Bool allow_subpixel_aa, + uint32_t glyph_count, + const uint16_t glyph_indices[], + const struct PP_Point glyph_advances[]); + struct PP_Var (*GetProxyForURL)(PP_Instance instance, const char* url); + int32_t (*Navigate)(PP_Resource request_info, + const char* target, + PP_Bool from_user_action); + void (*RunMessageLoop)(PP_Instance instance); + void (*QuitMessageLoop)(PP_Instance instance); + double (*GetLocalTimeZoneOffset)(PP_Instance instance, PP_Time t); + struct PP_Var (*GetCommandLineArgs)(PP_Module module); + void (*PreloadFontWin)(const void* logfontw); + PP_Bool (*IsRectTopmost)(PP_Instance instance, const struct PP_Rect* rect); + int32_t (*InvokePrinting)(PP_Instance instance); + void (*UpdateActivity)(PP_Instance instance); + struct PP_Var (*GetDeviceID)(PP_Instance instance); + int32_t (*GetSettingInt)(PP_Instance instance, PP_FlashSetting setting); + struct PP_Var (*GetSetting)(PP_Instance instance, PP_FlashSetting setting); + PP_Bool (*SetCrashData)(PP_Instance instance, + PP_FlashCrashKey key, + struct PP_Var value); +}; + +struct PPB_Flash_12_6 { + void (*SetInstanceAlwaysOnTop)(PP_Instance instance, PP_Bool on_top); + PP_Bool (*DrawGlyphs)( + PP_Instance instance, + PP_Resource pp_image_data, + const struct PP_BrowserFont_Trusted_Description* font_desc, + uint32_t color, + const struct PP_Point* position, + const struct PP_Rect* clip, + const float transformation[3][3], + PP_Bool allow_subpixel_aa, + uint32_t glyph_count, + const uint16_t glyph_indices[], + const struct PP_Point glyph_advances[]); + struct PP_Var (*GetProxyForURL)(PP_Instance instance, const char* url); + int32_t (*Navigate)(PP_Resource request_info, + const char* target, + PP_Bool from_user_action); + void (*RunMessageLoop)(PP_Instance instance); + void (*QuitMessageLoop)(PP_Instance instance); + double (*GetLocalTimeZoneOffset)(PP_Instance instance, PP_Time t); + struct PP_Var (*GetCommandLineArgs)(PP_Module module); + void (*PreloadFontWin)(const void* logfontw); + PP_Bool (*IsRectTopmost)(PP_Instance instance, const struct PP_Rect* rect); + int32_t (*InvokePrinting)(PP_Instance instance); + void (*UpdateActivity)(PP_Instance instance); + struct PP_Var (*GetDeviceID)(PP_Instance instance); + int32_t (*GetSettingInt)(PP_Instance instance, PP_FlashSetting setting); + struct PP_Var (*GetSetting)(PP_Instance instance, PP_FlashSetting setting); + PP_Bool (*SetCrashData)(PP_Instance instance, + PP_FlashCrashKey key, + struct PP_Var value); + int32_t (*EnumerateVideoCaptureDevices)(PP_Instance instance, + PP_Resource video_capture, + struct PP_ArrayOutput devices); +}; +/** + * @} + */ + +/* private/ppb_flash_clipboard.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * This enumeration contains the types of clipboards that can be accessed. + * These types correspond to clipboard types in WebKit. + */ +typedef enum { + /** The standard clipboard. */ + PP_FLASH_CLIPBOARD_TYPE_STANDARD = 0, + /** The selection clipboard (e.g., on Linux). */ + PP_FLASH_CLIPBOARD_TYPE_SELECTION = 1 +} PP_Flash_Clipboard_Type; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Flash_Clipboard_Type, 4); + +/** + * This enumeration contains the predefined clipboard data formats. + */ +typedef enum { + /** Indicates an invalid or unsupported clipboard data format. */ + PP_FLASH_CLIPBOARD_FORMAT_INVALID = 0, + /** + * Indicates plaintext clipboard data. The format expected/returned is a + * PP_VARTYPE_STRING. + */ + PP_FLASH_CLIPBOARD_FORMAT_PLAINTEXT = 1, + /** + * Indicates HTML clipboard data. The format expected/returned is a + * PP_VARTYPE_STRING. + */ + PP_FLASH_CLIPBOARD_FORMAT_HTML = 2, + /** + * Indicates RTF clipboard data. The format expected/returned is a + * PP_VARTYPE_ARRAY_BUFFER. + */ + PP_FLASH_CLIPBOARD_FORMAT_RTF = 3 +} PP_Flash_Clipboard_Format; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Flash_Clipboard_Format, 4); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_Flash_Clipboard interface contains pointers to functions + * used by Pepper Flash to access the clipboard. + * + */ +struct PPB_Flash_Clipboard_5_1 { + /** + * Registers a custom clipboard format. The format is identified by a + * string. An id identifying the format will be returned if the format is + * successfully registered, which can be used to read/write data of that + * format. If the format has already been registered, the id associated with + * that format will be returned. If the format fails to be registered + * PP_FLASH_CLIPBOARD_FORMAT_INVALID will be returned. + * + * All custom data should be read/written as PP_Var array + * buffers. The clipboard format is pepper-specific meaning that although the + * data will be stored on the system clipboard, it can only be accessed in a + * sensible way by using the pepper API. Data stored in custom formats can + * be safely shared between different applications that use pepper. + */ + uint32_t (*RegisterCustomFormat)(PP_Instance instance_id, + const char* format_name); + /** + * Checks whether a given data format is available from the given clipboard. + * Returns true if the given format is available from the given clipboard. + */ + PP_Bool (*IsFormatAvailable)(PP_Instance instance_id, + PP_Flash_Clipboard_Type clipboard_type, + uint32_t format); + /** + * Reads data in the given format from the clipboard. An + * undefined PP_Var is returned if there is an error in reading + * the clipboard data and a null PP_Var is returned if there is + * no data of the specified format to read. + */ + struct PP_Var (*ReadData)(PP_Instance instance_id, + PP_Flash_Clipboard_Type clipboard_type, + uint32_t format); + /** + * Writes the given array of data items to the clipboard. All existing + * clipboard data in any format is erased before writing this data. Thus, + * passing an array of size 0 has the effect of clearing the clipboard without + * writing any data. Each data item in the array should have a different + * PP_Flash_Clipboard_Format. If multiple data items have the + * same format, only the last item with that format will be written. + * If there is an error writing any of the items in the array to the + * clipboard, none will be written and an error code is returned. + * The error code will be PP_ERROR_NOSPACE if the value is + * too large to be written, PP_ERROR_BADARGUMENT if a PP_Var + * cannot be converted into the format supplied or PP_FAILED + * if the format is not supported. + */ + int32_t (*WriteData)(PP_Instance instance_id, + PP_Flash_Clipboard_Type clipboard_type, + uint32_t data_item_count, + const uint32_t formats[], + const struct PP_Var data_items[]); + /** + * Gets a sequence number which uniquely identifies clipboard state. This can + * be used to version the data on the clipboard and determine whether it has + * changed. The sequence number will be placed in |sequence_number| and + * PP_TRUE returned if the sequence number was retrieved successfully. + */ + PP_Bool (*GetSequenceNumber)(PP_Instance instance_id, + PP_Flash_Clipboard_Type clipboard_type, + uint64_t* sequence_number); +}; + +typedef struct PPB_Flash_Clipboard_5_1 PPB_Flash_Clipboard; + +struct PPB_Flash_Clipboard_4_0 { + PP_Bool (*IsFormatAvailable)(PP_Instance instance_id, + PP_Flash_Clipboard_Type clipboard_type, + PP_Flash_Clipboard_Format format); + struct PP_Var (*ReadData)(PP_Instance instance_id, + PP_Flash_Clipboard_Type clipboard_type, + PP_Flash_Clipboard_Format format); + int32_t (*WriteData)(PP_Instance instance_id, + PP_Flash_Clipboard_Type clipboard_type, + uint32_t data_item_count, + const PP_Flash_Clipboard_Format formats[], + const struct PP_Var data_items[]); +}; + +struct PPB_Flash_Clipboard_5_0 { + uint32_t (*RegisterCustomFormat)(PP_Instance instance_id, + const char* format_name); + PP_Bool (*IsFormatAvailable)(PP_Instance instance_id, + PP_Flash_Clipboard_Type clipboard_type, + uint32_t format); + struct PP_Var (*ReadData)(PP_Instance instance_id, + PP_Flash_Clipboard_Type clipboard_type, + uint32_t format); + int32_t (*WriteData)(PP_Instance instance_id, + PP_Flash_Clipboard_Type clipboard_type, + uint32_t data_item_count, + const uint32_t formats[], + const struct PP_Var data_items[]); +}; +/** + * @} + */ + +/* private/ppb_flash_device_id.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/* TODO(raymes): This is deprecated by the PPB_Flash_DRM interface. Remove this + * interface after a few versions of Chrome have passed. */ +struct PPB_Flash_DeviceID_1_0 { + PP_Resource (*Create)(PP_Instance instance); + /** + * Asynchronously computes the device ID. When available, it will place the + * string in |*id| and will call the completion callback. On failure the + * given var will be PP_VARTYPE_UNDEFINED. + */ + int32_t (*GetDeviceID)(PP_Resource device_id, + struct PP_Var* id, + struct PP_CompletionCallback callback); +}; + +typedef struct PPB_Flash_DeviceID_1_0 PPB_Flash_DeviceID; +/** + * @} + */ + +/* private/ppb_flash_drm.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * A resource for performing Flash DRM-related operations. + */ +struct PPB_Flash_DRM_1_1 { + /** + * Creates a PPB_Flash_DRM resource for performing DRM-related operations in + * Flash. + */ + PP_Resource (*Create)(PP_Instance instance); + /** + * Asynchronously computes the device ID. When available, it will place the + * string in |*id| and will call the completion callback. On failure the + * given var will be PP_VARTYPE_UNDEFINED. + */ + int32_t (*GetDeviceID)(PP_Resource drm, + struct PP_Var* id, + struct PP_CompletionCallback callback); + /** + * Windows and Mac only. Synchronously outputs the HMONITOR or + * CGDirectDisplayID corresponding to the monitor on which the plugin instance + * is displayed in |hmonitor|. This value is queried asynchronously and this + * will return PP_FALSE if the value is not yet available or an error + * occurred. PP_TRUE is returned on success. + */ + PP_Bool (*GetHmonitor)(PP_Resource drm, int64_t* hmonitor); + /** + * Asynchronously returns a PPB_FileRef resource in |file_ref| which points to + * the Voucher file for performing DRM verification. |callback| will be called + * upon completion. + */ + int32_t (*GetVoucherFile)(PP_Resource drm, + PP_Resource* file_ref, + struct PP_CompletionCallback callback); + /** + * Asynchronously returns a value indicating whether the monitor on which the + * plugin instance is displayed is external. |callback| will be called upon + * completion. + */ + int32_t (*MonitorIsExternal)(PP_Resource drm, + PP_Bool* is_external, + struct PP_CompletionCallback callback); +}; + +typedef struct PPB_Flash_DRM_1_1 PPB_Flash_DRM; + +struct PPB_Flash_DRM_1_0 { + PP_Resource (*Create)(PP_Instance instance); + int32_t (*GetDeviceID)(PP_Resource drm, + struct PP_Var* id, + struct PP_CompletionCallback callback); + PP_Bool (*GetHmonitor)(PP_Resource drm, int64_t* hmonitor); + int32_t (*GetVoucherFile)(PP_Resource drm, + PP_Resource* file_ref, + struct PP_CompletionCallback callback); +}; +/** + * @} + */ + +/* private/ppb_flash_file.idl */ +/** + * @addtogroup Structs + * @{ + */ +struct PP_DirEntry_Dev { + char* name; + PP_Bool is_dir; +}; + +/* Directory. */ +struct PP_DirContents_Dev { + int32_t count; + struct PP_DirEntry_Dev *entries; +}; +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/* PPB_Flash_File_ModuleLocal */ +struct PPB_Flash_File_ModuleLocal_3_0 { + /* Deprecated. Returns true. */ + PP_Bool (*CreateThreadAdapterForInstance)(PP_Instance instance); + /* Deprecated. Does nothing. */ + void (*ClearThreadAdapterForInstance)(PP_Instance instance); + /* Opens a module-local file, returning a file descriptor (posix) or a HANDLE + * (win32) into file. Module-local file paths (here and below) are + * '/'-separated UTF-8 strings, relative to a module-specific root. The return + * value is the ppapi error, PP_OK if success, one of the PP_ERROR_* in case + * of failure + */ + int32_t (*OpenFile)(PP_Instance instance, + const char* path, + int32_t mode, + PP_FileHandle* file); + /* Renames a module-local file. The return value is the ppapi error, PP_OK if + * success, one of the PP_ERROR_* in case of failure. + */ + int32_t (*RenameFile)(PP_Instance instance, + const char* path_from, + const char* path_to); + /* Deletes a module-local file or directory. If recursive is set and the path + * points to a directory, deletes all the contents of the directory. The + * return value is the ppapi error, PP_OK if success, one of the PP_ERROR_* in + * case of failure. + */ + int32_t (*DeleteFileOrDir)(PP_Instance instance, + const char* path, + PP_Bool recursive); + /* Creates a module-local directory. The return value is the ppapi error, + * PP_OK if success, one of the PP_ERROR_* in case of failure. + */ + int32_t (*CreateDir)(PP_Instance instance, const char* path); + /* Queries information about a module-local file. The return value is the + * ppapi error, PP_OK if success, one of the PP_ERROR_* in case of failure. + */ + int32_t (*QueryFile)(PP_Instance instance, + const char* path, + struct PP_FileInfo* info); + /* Gets the list of files contained in a module-local directory. The return + * value is the ppapi error, PP_OK if success, one of the PP_ERROR_* in case + * of failure. If non-NULL, the returned contents should be freed with + * FreeDirContents. + */ + int32_t (*GetDirContents)(PP_Instance instance, + const char* path, + struct PP_DirContents_Dev** contents); + /* Frees the data allocated by GetDirContents. */ + void (*FreeDirContents)(PP_Instance instance, + const struct PP_DirContents_Dev* contents); + /* Creates a temporary file. The file will be automatically deleted when all + * handles to it are closed. + * Returns PP_OK if successful, one of the PP_ERROR_* values in case of + * failure. + * If successful, |file| is set to a file descriptor (posix) or a HANDLE + * (win32) to the file. If failed, |file| is not touched. + */ + int32_t (*CreateTemporaryFile)(PP_Instance instance, PP_FileHandle* file); +}; + +typedef struct PPB_Flash_File_ModuleLocal_3_0 PPB_Flash_File_ModuleLocal; + +/** + * This interface provides (for Flash) synchronous access to files whose paths + * are given by a Pepper FileRef. Such FileRefs are typically obtained via the + * Pepper file chooser. + */ +struct PPB_Flash_File_FileRef_2_0 { + /* The functions below correspond exactly to their module-local counterparts + * (except in taking FileRefs instead of paths, of course). We omit the + * functionality which we do not provide for FileRefs. + */ + int32_t (*OpenFile)(PP_Resource file_ref_id, + int32_t mode, + PP_FileHandle* file); + int32_t (*QueryFile)(PP_Resource file_ref_id, struct PP_FileInfo* info); +}; + +typedef struct PPB_Flash_File_FileRef_2_0 PPB_Flash_File_FileRef; +/** + * @} + */ + +/* private/ppb_flash_font_file.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_Flash_FontFile_0_2 { + /* Returns a resource identifying a font file corresponding to the given font + * request after applying the browser-specific fallback. + */ + PP_Resource (*Create)( + PP_Instance instance, + const struct PP_BrowserFont_Trusted_Description* description, + PP_PrivateFontCharset charset); + /* Determines if a given resource is Flash font file. + */ + PP_Bool (*IsFlashFontFile)(PP_Resource resource); + /* Returns the requested font table. + * |output_length| should pass in the size of |output|. And it will return + * the actual length of returned data. |output| could be NULL in order to + * query the size of the buffer size needed. In that case, the input value of + * |output_length| is ignored. + * Note: it is Linux only and fails directly on other platforms. + */ + PP_Bool (*GetFontTable)(PP_Resource font_file, + uint32_t table, + void* output, + uint32_t* output_length); + /** + * Returns whether PPB_Flash_FontFile is supported on Windows. + */ + PP_Bool (*IsSupportedForWindows)(void); +}; + +typedef struct PPB_Flash_FontFile_0_2 PPB_Flash_FontFile; + +struct PPB_Flash_FontFile_0_1 { + PP_Resource (*Create)( + PP_Instance instance, + const struct PP_BrowserFont_Trusted_Description* description, + PP_PrivateFontCharset charset); + PP_Bool (*IsFlashFontFile)(PP_Resource resource); + PP_Bool (*GetFontTable)(PP_Resource font_file, + uint32_t table, + void* output, + uint32_t* output_length); +}; +/** + * @} + */ + +/* private/ppb_flash_fullscreen.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_FlashFullscreen_1_0 { + /** + * Checks whether the plugin instance is currently in fullscreen mode. + */ + PP_Bool (*IsFullscreen)(PP_Instance instance); + /** + * Switches the plugin instance to/from fullscreen mode. Returns PP_TRUE on + * success, PP_FALSE on failure. + * + * This does not unbind the current Graphics2D or Graphics3D. Pending flushes + * and swapbuffers will execute as if the resource was off-screen. The + * transition is asynchronous. During the transition, IsFullscreen will + * return PP_FALSE, and no Graphics2D or Graphics3D can be bound. The + * transition ends at the next DidChangeView when going into fullscreen mode. + * The transition out of fullscreen mode is synchronous. + */ + PP_Bool (*SetFullscreen)(PP_Instance instance, PP_Bool fullscreen); + /** + * Gets the size of the screen in pixels. When going fullscreen, the instance + * will be resized to that size. + */ + PP_Bool (*GetScreenSize)(PP_Instance instance, struct PP_Size* size); +}; + +typedef struct PPB_FlashFullscreen_1_0 PPB_FlashFullscreen; + +struct PPB_FlashFullscreen_0_1 { + PP_Bool (*IsFullscreen)(PP_Instance instance); + PP_Bool (*SetFullscreen)(PP_Instance instance, PP_Bool fullscreen); + PP_Bool (*GetScreenSize)(PP_Instance instance, struct PP_Size* size); +}; +/** + * @} + */ + +/* private/ppb_flash_menu.idl */ +/** + * @addtogroup Enums + * @{ + */ +/* Menu item type. + * + * TODO(viettrungluu): Radio items not supported yet. Will also probably want + * special menu items tied to clipboard access. + */ +typedef enum { + PP_FLASH_MENUITEM_TYPE_NORMAL = 0, + PP_FLASH_MENUITEM_TYPE_CHECKBOX = 1, + PP_FLASH_MENUITEM_TYPE_SEPARATOR = 2, + PP_FLASH_MENUITEM_TYPE_SUBMENU = 3 +} PP_Flash_MenuItem_Type; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Flash_MenuItem_Type, 4); +/** + * @} + */ + +/** + * @addtogroup Structs + * @{ + */ +struct PP_Flash_MenuItem { + PP_Flash_MenuItem_Type type; + char* name; + int32_t id; + PP_Bool enabled; + PP_Bool checked; + struct PP_Flash_Menu* submenu; +}; + +struct PP_Flash_Menu { + uint32_t count; + struct PP_Flash_MenuItem *items; +}; +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_Flash_Menu_0_2 { + PP_Resource (*Create)(PP_Instance instance_id, + const struct PP_Flash_Menu* menu_data); + PP_Bool (*IsFlashMenu)(PP_Resource resource_id); + /* Display a context menu at the given location. If the user selects an item, + * |selected_id| will be set to its |id| and the callback called with |PP_OK|. + * If the user dismisses the menu without selecting an item, + * |PP_ERROR_USERCANCEL| will be indicated. + */ + int32_t (*Show)(PP_Resource menu_id, + const struct PP_Point* location, + int32_t* selected_id, + struct PP_CompletionCallback callback); +}; + +typedef struct PPB_Flash_Menu_0_2 PPB_Flash_Menu; +/** + * @} + */ + +/* private/ppb_flash_message_loop.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_Flash_MessageLoop interface supports Pepper Flash to run + * nested message loops. + */ +struct PPB_Flash_MessageLoop_0_1 { + /** + * Allocates a Flash message loop resource. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * + * @return A PP_Resource that can be used to run a nested message + * loop if successful; 0 if failed. + */ + PP_Resource (*Create)(PP_Instance instance); + /** + * Determines if a given resource is a Flash message loop. + * + * @param[in] resource A PP_Resource corresponding to a generic + * resource. + * + * @return A PP_Bool that is PP_TRUE if the given + * resource is a Flash message loop, otherwise PP_FALSE. + */ + PP_Bool (*IsFlashMessageLoop)(PP_Resource resource); + /** + * Runs a nested message loop. The plugin will be reentered from this call. + * This function is used in places where Flash would normally enter a nested + * message loop (e.g., when displaying context menus), but Pepper provides + * only an asynchronous call. After performing that asynchronous call, call + * Run(). In the callback, call Quit(). + * + * For a given message loop resource, only the first call to + * Run() will start a nested message loop. The subsequent calls + * will return PP_ERROR_FAILED immediately. + * + * @param[in] flash_message_loop The Flash message loop. + * + * @return PP_ERROR_ABORTED if the message loop quits because the + * resource is destroyed; PP_OK if the message loop quits because + * of other reasons (e.g., Quit() is called); + * PP_ERROR_FAILED if this is not the first call to + * Run(). + */ + int32_t (*Run)(PP_Resource flash_message_loop); + /** + * Signals to quit the outermost nested message loop. Use this to exit and + * return back to the caller after you call Run(). + * + * If Quit() is not called to balance the call to + * Run(), the outermost nested message loop will be quitted + * implicitly when the resource is destroyed. + * + * @param[in] flash_message_loop The Flash message loop. + */ + void (*Quit)(PP_Resource flash_message_loop); +}; + +typedef struct PPB_Flash_MessageLoop_0_1 PPB_Flash_MessageLoop; +/** + * @} + */ + +/* private/ppb_flash_print.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_Flash_Print interface contains Flash-specific printing + * functionality. + */ +struct PPB_Flash_Print_1_0 { + /** + * Invokes printing on the given plugin instance. + */ + void (*InvokePrinting)(PP_Instance instance); +}; + +typedef struct PPB_Flash_Print_1_0 PPB_Flash_Print; +/** + * @} + */ + +/* private/ppb_net_address_private.idl */ +/** + * @addtogroup Enums + * @{ + */ +typedef enum { + /** + * The address family is unspecified. + */ + PP_NETADDRESSFAMILY_PRIVATE_UNSPECIFIED = 0, + /** + * The Internet Protocol version 4 (IPv4) address family. + */ + PP_NETADDRESSFAMILY_PRIVATE_IPV4 = 1, + /** + * The Internet Protocol version 6 (IPv6) address family. + */ + PP_NETADDRESSFAMILY_PRIVATE_IPV6 = 2 +} PP_NetAddressFamily_Private; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_NetAddressFamily_Private, 4); +/** + * @} + */ + +/** + * @addtogroup Structs + * @{ + */ +/** + * This is an opaque type holding a network address. Plugins must + * never access members of this struct directly. + */ +struct PP_NetAddress_Private { + uint32_t size; + int8_t data[128]; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_NetAddress_Private, 132); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_NetAddress_Private interface provides operations on + * network addresses. + */ +struct PPB_NetAddress_Private_1_1 { + /** + * Returns PP_TRUE if the two addresses are equal (host and port). + */ + PP_Bool (*AreEqual)(const struct PP_NetAddress_Private* addr1, + const struct PP_NetAddress_Private* addr2); + /** + * Returns PP_TRUE if the two addresses refer to the same host. + */ + PP_Bool (*AreHostsEqual)(const struct PP_NetAddress_Private* addr1, + const struct PP_NetAddress_Private* addr2); + /** + * Returns a human-readable description of the network address, optionally + * including the port (e.g., "192.168.0.1", "192.168.0.1:99", or "[::1]:80"), + * or an undefined var on failure. + */ + struct PP_Var (*Describe)(PP_Module module, + const struct PP_NetAddress_Private* addr, + PP_Bool include_port); + /** + * Replaces the port in the given source address. Returns PP_TRUE on success. + */ + PP_Bool (*ReplacePort)(const struct PP_NetAddress_Private* src_addr, + uint16_t port, + struct PP_NetAddress_Private* addr_out); + /** + * Gets the "any" address (for IPv4 or IPv6); for use with UDP Bind. + */ + void (*GetAnyAddress)(PP_Bool is_ipv6, struct PP_NetAddress_Private* addr); + /** + * Gets the address family. + */ + PP_NetAddressFamily_Private (*GetFamily)( + const struct PP_NetAddress_Private* addr); + /** + * Gets the port. The port is returned in host byte order. + */ + uint16_t (*GetPort)(const struct PP_NetAddress_Private* addr); + /** + * Gets the address. The output, address, must be large enough for the + * current socket family. The output will be the binary representation of an + * address for the current socket family. For IPv4 and IPv6 the address is in + * network byte order. PP_TRUE is returned if the address was successfully + * retrieved. + */ + PP_Bool (*GetAddress)(const struct PP_NetAddress_Private* addr, + void* address, + uint16_t address_size); + /** + * Returns ScopeID for IPv6 addresses or 0 for IPv4. + */ + uint32_t (*GetScopeID)(const struct PP_NetAddress_Private* addr); + /** + * Creates NetAddress with the specified IPv4 address and port + * number. + */ + void (*CreateFromIPv4Address)(const uint8_t ip[4], + uint16_t port, + struct PP_NetAddress_Private* addr_out); + /** + * Creates NetAddress with the specified IPv6 address, scope_id and + * port number. + */ + void (*CreateFromIPv6Address)(const uint8_t ip[16], + uint32_t scope_id, + uint16_t port, + struct PP_NetAddress_Private* addr_out); +}; + +typedef struct PPB_NetAddress_Private_1_1 PPB_NetAddress_Private; + +struct PPB_NetAddress_Private_0_1 { + PP_Bool (*AreEqual)(const struct PP_NetAddress_Private* addr1, + const struct PP_NetAddress_Private* addr2); + PP_Bool (*AreHostsEqual)(const struct PP_NetAddress_Private* addr1, + const struct PP_NetAddress_Private* addr2); + struct PP_Var (*Describe)(PP_Module module, + const struct PP_NetAddress_Private* addr, + PP_Bool include_port); + PP_Bool (*ReplacePort)(const struct PP_NetAddress_Private* src_addr, + uint16_t port, + struct PP_NetAddress_Private* addr_out); + void (*GetAnyAddress)(PP_Bool is_ipv6, struct PP_NetAddress_Private* addr); +}; + +struct PPB_NetAddress_Private_1_0 { + PP_Bool (*AreEqual)(const struct PP_NetAddress_Private* addr1, + const struct PP_NetAddress_Private* addr2); + PP_Bool (*AreHostsEqual)(const struct PP_NetAddress_Private* addr1, + const struct PP_NetAddress_Private* addr2); + struct PP_Var (*Describe)(PP_Module module, + const struct PP_NetAddress_Private* addr, + PP_Bool include_port); + PP_Bool (*ReplacePort)(const struct PP_NetAddress_Private* src_addr, + uint16_t port, + struct PP_NetAddress_Private* addr_out); + void (*GetAnyAddress)(PP_Bool is_ipv6, struct PP_NetAddress_Private* addr); + PP_NetAddressFamily_Private (*GetFamily)( + const struct PP_NetAddress_Private* addr); + uint16_t (*GetPort)(const struct PP_NetAddress_Private* addr); + PP_Bool (*GetAddress)(const struct PP_NetAddress_Private* addr, + void* address, + uint16_t address_size); +}; +/** + * @} + */ + +/* private/ppb_host_resolver_private.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * The PP_HostResolver_Flags is an enumeration of the + * different types of flags, that can be OR-ed and passed to host + * resolver. + */ +typedef enum { + /** + * AI_CANONNAME + */ + PP_HOST_RESOLVER_PRIVATE_FLAGS_CANONNAME = 1 << 0, + /** + * Hint to the resolver that only loopback addresses are configured. + */ + PP_HOST_RESOLVER_PRIVATE_FLAGS_LOOPBACK_ONLY = 1 << 1 +} PP_HostResolver_Private_Flags; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_HostResolver_Private_Flags, 4); +/** + * @} + */ + +/** + * @addtogroup Structs + * @{ + */ +struct PP_HostResolver_Private_Hint { + PP_NetAddressFamily_Private family; + int32_t flags; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_HostResolver_Private_Hint, 8); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_HostResolver_Private_0_1 { + /** + * Allocates a Host Resolver resource. + */ + PP_Resource (*Create)(PP_Instance instance); + /** + * Determines if a given resource is a Host Resolver. + */ + PP_Bool (*IsHostResolver)(PP_Resource resource); + /** + * Creates a new request to Host Resolver. |callback| is invoked + * when request is processed and a list of network addresses is + * obtained. These addresses can be be used in Connect, Bind or + * Listen calls to connect to a given |host| and |port|. + */ + int32_t (*Resolve)(PP_Resource host_resolver, + const char* host, + uint16_t port, + const struct PP_HostResolver_Private_Hint* hint, + struct PP_CompletionCallback callback); + /** + * Returns canonical name of host. + */ + struct PP_Var (*GetCanonicalName)(PP_Resource host_resolver); + /** + * Returns number of network addresses obtained after Resolve call. + */ + uint32_t (*GetSize)(PP_Resource host_resolver); + /** + * Stores in the |addr| |index|-th network address. |addr| can't be + * NULL. Returns PP_TRUE if success or PP_FALSE if the given + * resource is not a Host Resolver or |index| exceeds number of + * available addresses. + */ + PP_Bool (*GetNetAddress)(PP_Resource host_resolver, + uint32_t index, + struct PP_NetAddress_Private* addr); +}; + +typedef struct PPB_HostResolver_Private_0_1 PPB_HostResolver_Private; +/** + * @} + */ + +/* private/ppb_instance_private.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * The PP_ExternalPluginResult enum contains result codes from + * launching an external plugin. + */ +typedef enum { + /** Successful external plugin call */ + PP_EXTERNAL_PLUGIN_OK = 0, + /** Unspecified external plugin error */ + PP_EXTERNAL_PLUGIN_FAILED = 1, + /** Error creating the module */ + PP_EXTERNAL_PLUGIN_ERROR_MODULE = 2, + /** Error creating and initializing the instance */ + PP_EXTERNAL_PLUGIN_ERROR_INSTANCE = 3 +} PP_ExternalPluginResult; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_ExternalPluginResult, 4); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_Instance_Private interface contains functions available only to + * trusted plugin instances. + * + */ +struct PPB_Instance_Private_0_1 { + /** + * GetWindowObject is a pointer to a function that determines + * the DOM window containing this module instance. + * + * @param[in] instance A PP_Instance whose WindowObject should be retrieved. + * @return A PP_Var containing window object on success. + */ + struct PP_Var (*GetWindowObject)(PP_Instance instance); + /** + * GetOwnerElementObject is a pointer to a function that determines + * the DOM element containing this module instance. + * + * @param[in] instance A PP_Instance whose WindowObject should be retrieved. + * @return A PP_Var containing DOM element on success. + */ + struct PP_Var (*GetOwnerElementObject)(PP_Instance instance); + /** + * ExecuteScript is a pointer to a function that executes the given + * script in the context of the frame containing the module. + * + * The exception, if any, will be returned in *exception. As with the PPB_Var + * interface, the exception parameter, if non-NULL, must be initialized + * to a "void" var or the function will immediately return. On success, + * the exception parameter will be set to a "void" var. On failure, the + * return value will be a "void" var. + * + * @param[in] script A string containing the JavaScript to execute. + * @param[in/out] exception PP_Var containing the exception. Initialize + * this to NULL if you don't want exception info; initialize this to a void + * exception if want exception info. + * + * @return The result of the script execution, or a "void" var + * if execution failed. + */ + struct PP_Var (*ExecuteScript)(PP_Instance instance, + struct PP_Var script, + struct PP_Var* exception); +}; + +typedef struct PPB_Instance_Private_0_1 PPB_Instance_Private; +/** + * @} + */ + +/* private/ppb_isolated_file_system_private.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * The PP_IsolatedFileSystemType_Private values indicate the type + * of isolated file systems. + */ +typedef enum { + /** Type for invalid file systems */ + PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_INVALID = 0, + /** Type for CRX file systems */ + PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_CRX = 1, + /** Type for PluginPrivate file systems */ + PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_PLUGINPRIVATE = 2 +} PP_IsolatedFileSystemType_Private; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_IsolatedFileSystemType_Private, 4); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/* PPB_IsolatedFileSystem_Private interface */ +struct PPB_IsolatedFileSystem_Private_0_2 { + /** + * Open() opens a file system corresponding the given file system type. + * + * When opening the CRX file system, this should be called from an extension + * context, otherwise it will fail. + * + * @param[in] instance A PP_Instance identifying the instance + * with the file system. + * @param[in] type A file system type as defined by + * PP_IsolatedFileSystemType_Private enum. + * @param[out] file_system An output PP_Resource corresponding + * to a PPB_FileSystem. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Open. + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t (*Open)(PP_Instance instance, + PP_IsolatedFileSystemType_Private type, + PP_Resource* file_system, + struct PP_CompletionCallback callback); +}; + +typedef struct PPB_IsolatedFileSystem_Private_0_2 + PPB_IsolatedFileSystem_Private; +/** + * @} + */ + +/* private/ppb_output_protection_private.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * Content protection methods applied on video output link. + */ +typedef enum { + PP_OUTPUT_PROTECTION_METHOD_PRIVATE_NONE = 0, + PP_OUTPUT_PROTECTION_METHOD_PRIVATE_HDCP = 1 << 0 +} PP_OutputProtectionMethod_Private; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_OutputProtectionMethod_Private, 4); + +/** + * Video output link types. + */ +typedef enum { + PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_NONE = 0, + PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_UNKNOWN = 1 << 0, + PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_INTERNAL = 1 << 1, + PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_VGA = 1 << 2, + PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_HDMI = 1 << 3, + PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_DVI = 1 << 4, + PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_DISPLAYPORT = 1 << 5, + PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_NETWORK = 1 << 6 +} PP_OutputProtectionLinkType_Private; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_OutputProtectionLinkType_Private, 4); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_OutputProtection_Private interface allows controlling + * output protection. + * + * Example: + * + * @code + * op = output_protection->Create(instance); + * output_protection->QueryStatus(op, &link_mask, &protection_mask, + * done_callback); + * @endcode + * + * In this example, the plugin wants to enforce HDCP for HDMI link. + * @code + * if (link_mask & PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_HDMI) { + * output_protection->EnableProtection( + * op, PP_OUTPUT_PROTECTION_METHOD_PRIVATE_HDCP, done_callback); + * } + * @endcode + * + * After EnableProtection() completes, the plugin has to query protection + * status periodically to make sure the protection is enabled and remains + * enabled. + */ +struct PPB_OutputProtection_Private_0_1 { + /** + * Create() creates a new PPB_OutputProtection_Private object. + * + * @pram[in] instance A PP_Instance identifying one instance of + * a module. + * + * @return A PP_Resource corresponding to a + * PPB_OutputProtection_Private if successful, 0 if creation + * failed. + */ + PP_Resource (*Create)(PP_Instance instance); + /** + * IsOutputProtection() determines if the provided resource is a + * PPB_OutputProtection_Private. + * + * @param[in] resource A PP_Resource corresponding to a + * PPB_OutputProtection_Private. + * + * @return PP_TRUE if the resource is a + * PPB_OutputProtection_Private, PP_FALSE if the + * resource is invalid or some type other than + * PPB_OutputProtection_Private. + */ + PP_Bool (*IsOutputProtection)(PP_Resource resource); + /** + * Query link status and protection status. + * Clients have to query status periodically in order to detect changes. + * + * @param[in] resource A PP_Resource corresponding to a + * PPB_OutputProtection_Private. + * @param[out] link_mask The type of connected output links, which is a + * bit-mask of the PP_OutputProtectionLinkType_Private values. + * @param[out] protection_mask Enabled protection methods, which is a + * bit-mask of the PP_OutputProtectionMethod_Private values. + * @param[in] callback A PP_CompletionCallback to run on + * asynchronous completion of QueryStatus(). This callback will only run if + * QueryStatus() returns PP_OK_COMPLETIONPENDING. + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t (*QueryStatus)(PP_Resource resource, + uint32_t* link_mask, + uint32_t* protection_mask, + struct PP_CompletionCallback callback); + /** + * Set desired protection methods. + * + * When the desired protection method(s) have been applied to all applicable + * output links, the relevant bit(s) of the protection_mask returned by + * QueryStatus() will be set. Otherwise, the relevant bit(s) of + * protection_mask will not be set; there is no separate error code or + * callback. + * + * Protections will be disabled if no longer desired by all instances. + * + * @param[in] resource A PP_Resource corresponding to a + * PPB_OutputProtection_Private. + * @param[in] desired_protection_mask The desired protection methods, which + * is a bit-mask of the PP_OutputProtectionMethod_Private + * values. + * @param[in] callback A PP_CompletionCallback to be called with + * PP_OK when the protection request has been made. This may be + * before the protection have actually been applied. Call QueryStatus to get + * protection status. If it failed to make the protection request, the + * callback is called with PP_ERROR_FAILED and there is no need + * to call QueryStatus(). + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t (*EnableProtection)(PP_Resource resource, + uint32_t desired_protection_mask, + struct PP_CompletionCallback callback); +}; + +typedef struct PPB_OutputProtection_Private_0_1 PPB_OutputProtection_Private; +/** + * @} + */ + +/* private/ppb_pdf.idl */ +/** + * @addtogroup Enums + * @{ + */ +typedef enum { + PP_PDFFEATURE_HIDPI = 0, + PP_PDFFEATURE_PRINTING = 1 +} PP_PDFFeature; +/** + * @} + */ + +/** + * @addtogroup Structs + * @{ + */ +struct PP_PrivateFontFileDescription { + char* face; + uint32_t weight; + PP_Bool italic; +}; + +struct PP_PrivateFindResult { + int32_t start_index; + int32_t length; +}; + +struct PP_PrivateAccessibilityViewportInfo { + double zoom; + struct PP_Point scroll; + struct PP_Point offset; +}; + +struct PP_PrivateAccessibilityDocInfo { + uint32_t page_count; + PP_Bool text_accessible; + PP_Bool text_copyable; +}; +/** + * @} + */ + +/** + * @addtogroup Enums + * @{ + */ +typedef enum { + PP_PRIVATEDIRECTION_NONE = 0, + PP_PRIVATEDIRECTION_LTR = 1, + PP_PRIVATEDIRECTION_RTL = 2, + PP_PRIVATEDIRECTION_TTB = 3, + PP_PRIVATEDIRECTION_BTT = 4, + PP_PRIVATEDIRECTION_LAST = PP_PRIVATEDIRECTION_BTT +} PP_PrivateDirection; +/** + * @} + */ + +/** + * @addtogroup Structs + * @{ + */ +struct PP_PrivateAccessibilityPageInfo { + uint32_t page_index; + struct PP_Rect bounds; + uint32_t text_run_count; + uint32_t char_count; +}; + +struct PP_PrivateAccessibilityTextRunInfo { + uint32_t len; + double font_size; + struct PP_FloatRect bounds; + PP_PrivateDirection direction; +}; + +struct PP_PrivateAccessibilityCharInfo { + uint32_t unicode_character; + double char_width; +}; +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_PDF_0_1 { + /* Returns a resource identifying a font file corresponding to the given font + * request after applying the browser-specific fallback. + * + * Currently Linux-only. + */ + PP_Resource (*GetFontFileWithFallback)( + PP_Instance instance, + const struct PP_BrowserFont_Trusted_Description* description, + PP_PrivateFontCharset charset); + /* Given a resource previously returned by GetFontFileWithFallback, returns + * a pointer to the requested font table. Linux only. + */ + PP_Bool (*GetFontTableForPrivateFontFile)(PP_Resource font_file, + uint32_t table, + void* output, + uint32_t* output_length); + /* Search the given string using ICU. Use PPB_Core's MemFree on results when + * done. + */ + void (*SearchString)(PP_Instance instance, + const void* str, + const void* term, + PP_Bool case_sensitive, + struct PP_PrivateFindResult** results, + int32_t* count); + /* Since WebFrame doesn't know about PPAPI requests, it'll think the page has + * finished loading even if there are outstanding requests by the plugin. + * Take this out once WebFrame knows about requests by PPAPI plugins. + */ + void (*DidStartLoading)(PP_Instance instance); + void (*DidStopLoading)(PP_Instance instance); + /* Sets content restriction for a full-page plugin (i.e. can't copy/print). + * The value is a bitfield of ContentRestriction enums. + */ + void (*SetContentRestriction)(PP_Instance instance, int32_t restrictions); + /* Notifies the browser that the given action has been performed. */ + void (*UserMetricsRecordAction)(PP_Instance instance, struct PP_Var action); + /* Notifies the browser that the PDF has an unsupported feature. */ + void (*HasUnsupportedFeature)(PP_Instance instance); + /*Invoke SaveAs... dialog, similar to the right-click or wrench menu. */ + void (*SaveAs)(PP_Instance instance); + /* Invoke Print dialog for plugin. */ + void (*Print)(PP_Instance instance); + PP_Bool (*IsFeatureEnabled)(PP_Instance instance, PP_PDFFeature feature); + /* Sets the selected text of the plugin. If |selected_text| is empty, then no + * text is selected. */ + void (*SetSelectedText)(PP_Instance instance, const char* selected_text); + /* Sets the link under the cursor. If |url| is empty, then no link is under + * the cursor. */ + void (*SetLinkUnderCursor)(PP_Instance instance, const char* url); + /* Gets pointers to both the mmap'd V8 snapshot files and their sizes. + * This is needed when loading V8's initial snapshot from external files. */ + void (*GetV8ExternalSnapshotData)(PP_Instance instance, + void** natives_data_out, + int32_t* natives_size_out, + void** snapshot_data_out, + int32_t* snapshot_size_out); + /* Sends information about the viewport to the renderer for accessibility + * support. */ + void (*SetAccessibilityViewportInfo)( + PP_Instance instance, + const struct PP_PrivateAccessibilityViewportInfo* viewport_info); + /* Sends information about the PDF document to the renderer for accessibility + * support. */ + void (*SetAccessibilityDocInfo)( + PP_Instance instance, + const struct PP_PrivateAccessibilityDocInfo* doc_info); + /* Sends information about one page in a PDF document to the renderer for + * accessibility support. */ + void (*SetAccessibilityPageInfo)( + PP_Instance instance, + const struct PP_PrivateAccessibilityPageInfo* page_info, + const struct PP_PrivateAccessibilityTextRunInfo text_runs[], + const struct PP_PrivateAccessibilityCharInfo chars[]); + /* Sends information about the PDF's URL and the embedder's URL. */ + void (*SetCrashData)(PP_Instance instance, + const char* pdf_url, + const char* top_level_url); +}; + +typedef struct PPB_PDF_0_1 PPB_PDF; +/** + * @} + */ + +/* private/ppb_platform_verification_private.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_PlatformVerification_Private interface allows authorized + * services to verify that the underlying platform is trusted. An example of a + * trusted platform is a Chrome OS device in verified boot mode. + */ +struct PPB_PlatformVerification_Private_0_2 { + /** + * Create() creates a PPB_PlatformVerification_Private object. + * + * @pram[in] instance A PP_Instance identifying one instance of + * a module. + * + * @return A PP_Resource corresponding to a + * PPB_PlatformVerification_Private if successful, 0 if creation + * failed. + */ + PP_Resource (*Create)(PP_Instance instance); + /** + * IsPlatformVerification() determines if the provided resource is a + * PPB_PlatformVerification_Private. + * + * @param[in] resource A PP_Resource corresponding to a + * PPB_PlatformVerification_Private. + * + * @return PP_TRUE if the resource is a + * PPB_PlatformVerification_Private, PP_FALSE if the + * resource is invalid or some type other than + * PPB_PlatformVerification_Private. + */ + PP_Bool (*IsPlatformVerification)(PP_Resource resource); + /** + * Requests a platform challenge for a given service id. + * + * @param[in] service_id A PP_Var of type + * PP_VARTYPE_STRING containing the service_id for the challenge. + * + * @param[in] challenge A PP_Var of type + * PP_VARTYPE_ARRAY_BUFFER that contains the challenge data. + * + * @param[out] signed_data A PP_Var of type + * PP_VARTYPE_ARRAY_BUFFER that contains the data signed by the + * platform. + * + * @param[out] signed_data_signature A PP_Var of type + * PP_VARTYPE_ARRAY_BUFFER that contains the signature of the + * signed data block. + * + * @param[out] platform_key_certificate A PP_Var of type + * PP_VARTYPE_STRING that contains the device specific + * certificate for the requested service_id. + * + * @param[in] callback A PP_CompletionCallback to be called after + * the platform challenge has been completed. This callback will only run if + * the return code is PP_OK_COMPLETIONPENDING. + * + * @return An int32_t containing an error code from pp_errors.h. + */ + int32_t (*ChallengePlatform)(PP_Resource instance, + struct PP_Var service_id, + struct PP_Var challenge, + struct PP_Var* signed_data, + struct PP_Var* signed_data_signature, + struct PP_Var* platform_key_certificate, + struct PP_CompletionCallback callback); +}; + +typedef struct PPB_PlatformVerification_Private_0_2 + PPB_PlatformVerification_Private; +/** + * @} + */ + +/* private/ppb_tcp_server_socket_private.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_TCPServerSocket_Private interface provides TCP + * server socket operations. + */ +struct PPB_TCPServerSocket_Private_0_2 { + /** + * Allocates a TCP server socket resource. + */ + PP_Resource (*Create)(PP_Instance instance); + /** + * Determines if a given resource is TCP server socket. + */ + PP_Bool (*IsTCPServerSocket)(PP_Resource resource); + /** + * Binds |tcp_server_socket| to the address given by |addr| and + * starts listening. The |backlog| argument defines the maximum + * length to which the queue of pending connections may + * grow. |callback| is invoked when |tcp_server_socket| is ready to + * accept incoming connections or in the case of failure. Returns + * PP_ERROR_NOSPACE if socket can't be initialized, or + * PP_ERROR_FAILED in the case of Listen failure. Otherwise, returns + * PP_OK. + */ + int32_t (*Listen)(PP_Resource tcp_server_socket, + const struct PP_NetAddress_Private* addr, + int32_t backlog, + struct PP_CompletionCallback callback); + /** + * Accepts single connection, creates instance of + * PPB_TCPSocket_Private and stores reference to it in + * |tcp_socket|. |callback| is invoked when connection is accepted + * or in the case of failure. This method can be called only after + * successful Listen call on |tcp_server_socket|. + */ + int32_t (*Accept)(PP_Resource tcp_server_socket, + PP_Resource* tcp_socket, + struct PP_CompletionCallback callback); + /** + * Returns the current address to which the socket is bound, in the + * buffer pointed to by |addr|. This method can be called only after + * successful Listen() call and before StopListening() call. + */ + int32_t (*GetLocalAddress)(PP_Resource tcp_server_socket, + struct PP_NetAddress_Private* addr); + /** + * Cancels all pending callbacks reporting PP_ERROR_ABORTED and + * closes the socket. Note: this method is implicitly called when + * server socket is destroyed. + */ + void (*StopListening)(PP_Resource tcp_server_socket); +}; + +typedef struct PPB_TCPServerSocket_Private_0_2 PPB_TCPServerSocket_Private; + +struct PPB_TCPServerSocket_Private_0_1 { + PP_Resource (*Create)(PP_Instance instance); + PP_Bool (*IsTCPServerSocket)(PP_Resource resource); + int32_t (*Listen)(PP_Resource tcp_server_socket, + const struct PP_NetAddress_Private* addr, + int32_t backlog, + struct PP_CompletionCallback callback); + int32_t (*Accept)(PP_Resource tcp_server_socket, + PP_Resource* tcp_socket, + struct PP_CompletionCallback callback); + void (*StopListening)(PP_Resource tcp_server_socket); +}; +/** + * @} + */ + +/* private/ppb_tcp_socket_private.idl */ +/** + * @addtogroup Enums + * @{ + */ +typedef enum { + /* Special value used for testing. Guaranteed to fail SetOption(). */ + PP_TCPSOCKETOPTION_PRIVATE_INVALID = 0, + /* Disable coalescing of small writes to make TCP segments, and instead + * deliver data immediately. For SSL sockets, this option must be set before + * SSLHandshake() is called. Value type is PP_VARTYPE_BOOL. */ + PP_TCPSOCKETOPTION_PRIVATE_NO_DELAY = 1 +} PP_TCPSocketOption_Private; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_TCPSocketOption_Private, 4); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_TCPSocket_Private interface provides TCP socket + * operations. + */ +struct PPB_TCPSocket_Private_0_5 { + /** + * Allocates a TCP socket resource. + */ + PP_Resource (*Create)(PP_Instance instance); + /** + * Determines if a given resource is TCP socket. + */ + PP_Bool (*IsTCPSocket)(PP_Resource resource); + /** + * Connects to a TCP port given as a host-port pair. + * When a proxy server is used, |host| and |port| refer to the proxy server + * instead of the destination server. + */ + int32_t (*Connect)(PP_Resource tcp_socket, + const char* host, + uint16_t port, + struct PP_CompletionCallback callback); + /** + * Same as Connect(), but connecting to the address given by |addr|. A typical + * use-case would be for reconnections. + */ + int32_t (*ConnectWithNetAddress)(PP_Resource tcp_socket, + const struct PP_NetAddress_Private* addr, + struct PP_CompletionCallback callback); + /** + * Gets the local address of the socket, if it has been connected. + * Returns PP_TRUE on success. + */ + PP_Bool (*GetLocalAddress)(PP_Resource tcp_socket, + struct PP_NetAddress_Private* local_addr); + /** + * Gets the remote address of the socket, if it has been connected. + * Returns PP_TRUE on success. + */ + PP_Bool (*GetRemoteAddress)(PP_Resource tcp_socket, + struct PP_NetAddress_Private* remote_addr); + /** + * Does SSL handshake and moves to sending and receiving encrypted data. The + * socket must have been successfully connected. |server_name| will be + * compared with the name(s) in the server's certificate during the SSL + * handshake. |server_port| is only used to identify an SSL server in the SSL + * session cache. + * When a proxy server is used, |server_name| and |server_port| refer to the + * destination server. + * If the socket is not connected, or there are pending read/write requests, + * SSLHandshake() will fail without starting a handshake. Otherwise, any + * failure during the handshake process will cause the socket to be + * disconnected. + */ + int32_t (*SSLHandshake)(PP_Resource tcp_socket, + const char* server_name, + uint16_t server_port, + struct PP_CompletionCallback callback); + /** + * Returns the server's PPB_X509Certificate_Private for a socket + * connection if an SSL connection has been established using + * SSLHandshake. If no SSL connection has been established, a + * null resource is returned. + */ + PP_Resource (*GetServerCertificate)(PP_Resource tcp_socket); + /** + * NOTE: This function is not implemented and will return + * PP_FALSE. + * Adds a trusted/untrusted chain building certificate to be used for this + * connection. The certificate must be a + * PPB_X509Certificate_Private. PP_TRUE is returned + * upon success. + */ + PP_Bool (*AddChainBuildingCertificate)(PP_Resource tcp_socket, + PP_Resource certificate, + PP_Bool is_trusted); + /** + * Reads data from the socket. The size of |buffer| must be at least as large + * as |bytes_to_read|. May perform a partial read. Returns the number of bytes + * read or an error code. If the return value is 0, then it indicates that + * end-of-file was reached. + * This method won't return more than 1 megabyte, so if |bytes_to_read| + * exceeds 1 megabyte, it will always perform a partial read. + * Multiple outstanding read requests are not supported. + */ + int32_t (*Read)(PP_Resource tcp_socket, + char* buffer, + int32_t bytes_to_read, + struct PP_CompletionCallback callback); + /** + * Writes data to the socket. May perform a partial write. Returns the number + * of bytes written or an error code. + * This method won't write more than 1 megabyte, so if |bytes_to_write| + * exceeds 1 megabyte, it will always perform a partial write. + * Multiple outstanding write requests are not supported. + */ + int32_t (*Write)(PP_Resource tcp_socket, + const char* buffer, + int32_t bytes_to_write, + struct PP_CompletionCallback callback); + /** + * Cancels any IO that may be pending, and disconnects the socket. Any pending + * callbacks will still run, reporting PP_Error_Aborted if pending IO was + * interrupted. It is NOT valid to call Connect() again after a call to this + * method. Note: If the socket is destroyed when it is still connected, then + * it will be implicitly disconnected, so you are not required to call this + * method. + */ + void (*Disconnect)(PP_Resource tcp_socket); + /** + * Sets an option on |tcp_socket|. Supported |name| and |value| parameters + * are as described for PP_TCPSocketOption_Private. |callback| will be + * invoked with PP_OK if setting the option succeeds, or an error code + * otherwise. The socket must be connection before SetOption is called. + */ + int32_t (*SetOption)(PP_Resource tcp_socket, + PP_TCPSocketOption_Private name, + struct PP_Var value, + struct PP_CompletionCallback callback); +}; + +typedef struct PPB_TCPSocket_Private_0_5 PPB_TCPSocket_Private; + +struct PPB_TCPSocket_Private_0_3 { + PP_Resource (*Create)(PP_Instance instance); + PP_Bool (*IsTCPSocket)(PP_Resource resource); + int32_t (*Connect)(PP_Resource tcp_socket, + const char* host, + uint16_t port, + struct PP_CompletionCallback callback); + int32_t (*ConnectWithNetAddress)(PP_Resource tcp_socket, + const struct PP_NetAddress_Private* addr, + struct PP_CompletionCallback callback); + PP_Bool (*GetLocalAddress)(PP_Resource tcp_socket, + struct PP_NetAddress_Private* local_addr); + PP_Bool (*GetRemoteAddress)(PP_Resource tcp_socket, + struct PP_NetAddress_Private* remote_addr); + int32_t (*SSLHandshake)(PP_Resource tcp_socket, + const char* server_name, + uint16_t server_port, + struct PP_CompletionCallback callback); + int32_t (*Read)(PP_Resource tcp_socket, + char* buffer, + int32_t bytes_to_read, + struct PP_CompletionCallback callback); + int32_t (*Write)(PP_Resource tcp_socket, + const char* buffer, + int32_t bytes_to_write, + struct PP_CompletionCallback callback); + void (*Disconnect)(PP_Resource tcp_socket); +}; + +struct PPB_TCPSocket_Private_0_4 { + PP_Resource (*Create)(PP_Instance instance); + PP_Bool (*IsTCPSocket)(PP_Resource resource); + int32_t (*Connect)(PP_Resource tcp_socket, + const char* host, + uint16_t port, + struct PP_CompletionCallback callback); + int32_t (*ConnectWithNetAddress)(PP_Resource tcp_socket, + const struct PP_NetAddress_Private* addr, + struct PP_CompletionCallback callback); + PP_Bool (*GetLocalAddress)(PP_Resource tcp_socket, + struct PP_NetAddress_Private* local_addr); + PP_Bool (*GetRemoteAddress)(PP_Resource tcp_socket, + struct PP_NetAddress_Private* remote_addr); + int32_t (*SSLHandshake)(PP_Resource tcp_socket, + const char* server_name, + uint16_t server_port, + struct PP_CompletionCallback callback); + PP_Resource (*GetServerCertificate)(PP_Resource tcp_socket); + PP_Bool (*AddChainBuildingCertificate)(PP_Resource tcp_socket, + PP_Resource certificate, + PP_Bool is_trusted); + int32_t (*Read)(PP_Resource tcp_socket, + char* buffer, + int32_t bytes_to_read, + struct PP_CompletionCallback callback); + int32_t (*Write)(PP_Resource tcp_socket, + const char* buffer, + int32_t bytes_to_write, + struct PP_CompletionCallback callback); + void (*Disconnect)(PP_Resource tcp_socket); +}; +/** + * @} + */ + +/* private/ppb_testing_private.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_Testing_Private_1_0 { + /** + * Reads the bitmap data out of the backing store for the given + * DeviceContext2D and into the given image. If the data was successfully + * read, it will return PP_TRUE. + * + * This function should not generally be necessary for normal plugin + * operation. If you want to update portions of a device, the expectation is + * that you will either regenerate the data, or maintain a backing store + * pushing updates to the device from your backing store via PaintImageData. + * Using this function will introduce an extra copy which will make your + * plugin slower. In some cases, this may be a very expensive operation (it + * may require slow cross-process transitions or graphics card readbacks). + * + * Data will be read into the image starting at |top_left| in the device + * context, and proceeding down and to the right for as many pixels as the + * image is large. If any part of the image bound would fall outside of the + * backing store of the device if positioned at |top_left|, this function + * will fail and return PP_FALSE. + * + * The image format must be of the format + * PPB_ImageData.GetNativeImageDataFormat() or this function will fail and + * return PP_FALSE. + * + * The returned image data will represent the current status of the backing + * store. This will not include any paint, scroll, or replace operations + * that have not yet been flushed; these operations are only reflected in + * the backing store (and hence ReadImageData) until after a Flush() + * operation has completed. + */ + PP_Bool (*ReadImageData)(PP_Resource device_context_2d, + PP_Resource image, + const struct PP_Point* top_left); + /** + * Runs a nested message loop. The plugin will be reentered from this call. + * This function is used for unit testing the API. The normal pattern is to + * issue some asynchronous call that has a callback. Then you call + * RunMessageLoop which will suspend the plugin and go back to processing + * messages, giving the asynchronous operation time to complete. In your + * callback, you save the data and call QuitMessageLoop, which will then + * pop back up and continue with the test. This avoids having to write a + * complicated state machine for simple tests for asynchronous APIs. + */ + void (*RunMessageLoop)(PP_Instance instance); + /** + * Posts a quit message for the outermost nested message loop. Use this to + * exit and return back to the caller after you call RunMessageLoop. + */ + void (*QuitMessageLoop)(PP_Instance instance); + /** + * Returns the number of live objects (resources + strings + objects) + * associated with this plugin instance. Used for detecting leaks. Returns + * (uint32_t)-1 on failure. + */ + uint32_t (*GetLiveObjectsForInstance)(PP_Instance instance); + /** + * Returns PP_TRUE if the plugin is running out-of-process, PP_FALSE + * otherwise. + */ + PP_Bool (*IsOutOfProcess)(void); + /** + * Posts the plugin's current Power Saver status to JavaScript. The plugin + * itself does not recieve anything. This is not idiomatic for Pepper, + * but convenient for testing. + */ + void (*PostPowerSaverStatus)(PP_Instance instance); + /** + * Subscribes to changes to the plugin's Power Saver status. The status + * changes are not forwarded to the plugin itself, but posted to JavaScript. + * This is not idiomatic for Pepper, but conveienent for testing. + */ + void (*SubscribeToPowerSaverNotifications)(PP_Instance instance); + /** + * Passes the input event to the browser, which sends it back to the + * plugin. The plugin should implement PPP_InputEvent and register for + * the input event type. + * + * This method sends an input event through the browser just as if it had + * come from the user. If the browser determines that it is an event for the + * plugin, it will be sent to be handled by the plugin's PPP_InputEvent + * interface. When generating mouse events, make sure the position is within + * the plugin's area on the page. When generating a keyboard event, make sure + * the plugin is focused. + * + * Note that the browser may generate extra input events in order to + * maintain certain invariants, such as always having a "mouse enter" event + * before any other mouse event. Furthermore, the event the plugin receives + * after sending a simulated event will be slightly different from the + * original event. The browser may change the timestamp, add modifiers, and + * slightly alter the mouse position, due to coordinate transforms it + * performs. + */ + void (*SimulateInputEvent)(PP_Instance instance, PP_Resource input_event); + /** + * Returns the URL for the document. This is a safe way to retrieve + * window.location.href. + * If the canonicalized URL is valid, the method will parse the URL + * and fill in the components structure. This pointer may be NULL + * to specify that no component information is necessary. + */ + struct PP_Var (*GetDocumentURL)(PP_Instance instance, + struct PP_URLComponents_Dev* components); + /** + * Fetches up to |array_size| active PP_Vars in the tracker. Returns the + * number of vars in the tracker. The active vars are written to |live_vars| + * contiguously starting at index 0. The vars are not in any particular order. + * If the number of live vars is greater than |array_size|, then an arbitrary + * subset of |array_size| vars is written to |live_vars|. The reference count + * of the returned PP_Vars will *not* be affected by this call. + */ + uint32_t (*GetLiveVars)(struct PP_Var live_vars[], uint32_t array_size); + /** + * Sets the threshold size at which point we switch from transmitting + * array buffers in IPC messages to using shared memory. This is only used + * for testing purposes where we need to transmit small buffers using shmem + * (in order to have fast tests). Passing a value of 0 resets the threshold + * to its default. The threshold is in bytes. + */ + void (*SetMinimumArrayBufferSizeForShmem)(PP_Instance instance, + uint32_t threshold); + /** + * Run the V8 garbage collector for tests. + */ + void (*RunV8GC)(PP_Instance instance); +}; + +typedef struct PPB_Testing_Private_1_0 PPB_Testing_Private; +/** + * @} + */ + +/* private/ppb_udp_socket_private.idl */ +/** + * @addtogroup Enums + * @{ + */ +typedef enum { + /* Allow the socket to share the local address to which socket will + * be bound with other processes. Value's type should be + * PP_VARTYPE_BOOL. */ + PP_UDPSOCKETFEATURE_PRIVATE_ADDRESS_REUSE = 0, + /* Allow sending and receiving packets sent to and from broadcast + * addresses. Value's type should be PP_VARTYPE_BOOL. */ + PP_UDPSOCKETFEATURE_PRIVATE_BROADCAST = 1, + /* Special value for counting the number of available + * features. Should not be passed to SetSocketFeature(). */ + PP_UDPSOCKETFEATURE_PRIVATE_COUNT = 2 +} PP_UDPSocketFeature_Private; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_UDPSocketFeature_Private, 4); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_UDPSocket_Private_0_4 { + /** + * Creates a UDP socket resource. + */ + PP_Resource (*Create)(PP_Instance instance_id); + /** + * Determines if a given resource is a UDP socket. + */ + PP_Bool (*IsUDPSocket)(PP_Resource resource_id); + /** + * Sets a socket feature to |udp_socket|. Should be called before + * Bind(). Possible values for |name|, |value| and |value|'s type + * are described in PP_UDPSocketFeature_Private description. If no + * error occurs, returns PP_OK. Otherwise, returns + * PP_ERROR_BADRESOURCE (if bad |udp_socket| provided), + * PP_ERROR_BADARGUMENT (if bad name/value/value's type provided) + * or PP_ERROR_FAILED in the case of internal errors. + */ + int32_t (*SetSocketFeature)(PP_Resource udp_socket, + PP_UDPSocketFeature_Private name, + struct PP_Var value); + /* Creates a socket and binds to the address given by |addr|. */ + int32_t (*Bind)(PP_Resource udp_socket, + const struct PP_NetAddress_Private* addr, + struct PP_CompletionCallback callback); + /* Returns the address that the socket has bound to. A successful + * call to Bind must be called first. Returns PP_FALSE if Bind + * fails, or if Close has been called. + */ + PP_Bool (*GetBoundAddress)(PP_Resource udp_socket, + struct PP_NetAddress_Private* addr); + /* Performs a non-blocking recvfrom call on socket. + * Bind must be called first. |callback| is invoked when recvfrom + * reads data. You must call GetRecvFromAddress to recover the + * address the data was retrieved from. + */ + int32_t (*RecvFrom)(PP_Resource udp_socket, + char* buffer, + int32_t num_bytes, + struct PP_CompletionCallback callback); + /* Upon successful completion of RecvFrom, the address that the data + * was received from is stored in |addr|. + */ + PP_Bool (*GetRecvFromAddress)(PP_Resource udp_socket, + struct PP_NetAddress_Private* addr); + /* Performs a non-blocking sendto call on the socket created and + * bound(has already called Bind). The callback |callback| is + * invoked when sendto completes. + */ + int32_t (*SendTo)(PP_Resource udp_socket, + const char* buffer, + int32_t num_bytes, + const struct PP_NetAddress_Private* addr, + struct PP_CompletionCallback callback); + /* Cancels all pending reads and writes, and closes the socket. */ + void (*Close)(PP_Resource udp_socket); +}; + +typedef struct PPB_UDPSocket_Private_0_4 PPB_UDPSocket_Private; + +struct PPB_UDPSocket_Private_0_2 { + PP_Resource (*Create)(PP_Instance instance_id); + PP_Bool (*IsUDPSocket)(PP_Resource resource_id); + int32_t (*Bind)(PP_Resource udp_socket, + const struct PP_NetAddress_Private* addr, + struct PP_CompletionCallback callback); + int32_t (*RecvFrom)(PP_Resource udp_socket, + char* buffer, + int32_t num_bytes, + struct PP_CompletionCallback callback); + PP_Bool (*GetRecvFromAddress)(PP_Resource udp_socket, + struct PP_NetAddress_Private* addr); + int32_t (*SendTo)(PP_Resource udp_socket, + const char* buffer, + int32_t num_bytes, + const struct PP_NetAddress_Private* addr, + struct PP_CompletionCallback callback); + void (*Close)(PP_Resource udp_socket); +}; + +struct PPB_UDPSocket_Private_0_3 { + PP_Resource (*Create)(PP_Instance instance_id); + PP_Bool (*IsUDPSocket)(PP_Resource resource_id); + int32_t (*Bind)(PP_Resource udp_socket, + const struct PP_NetAddress_Private* addr, + struct PP_CompletionCallback callback); + PP_Bool (*GetBoundAddress)(PP_Resource udp_socket, + struct PP_NetAddress_Private* addr); + int32_t (*RecvFrom)(PP_Resource udp_socket, + char* buffer, + int32_t num_bytes, + struct PP_CompletionCallback callback); + PP_Bool (*GetRecvFromAddress)(PP_Resource udp_socket, + struct PP_NetAddress_Private* addr); + int32_t (*SendTo)(PP_Resource udp_socket, + const char* buffer, + int32_t num_bytes, + const struct PP_NetAddress_Private* addr, + struct PP_CompletionCallback callback); + void (*Close)(PP_Resource udp_socket); +}; +/** + * @} + */ + +/* private/ppb_uma_private.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * Contains functions for plugins to report UMA usage stats. + */ +struct PPB_UMA_Private_0_3 { + /** + * HistogramCustomTimes is a pointer to a function which records a time + * sample given in milliseconds in the histogram given by |name|, possibly + * creating the histogram if it does not exist. + */ + void (*HistogramCustomTimes)(PP_Instance instance, + struct PP_Var name, + int64_t sample, + int64_t min, + int64_t max, + uint32_t bucket_count); + /** + * HistogramCustomCounts is a pointer to a function which records a sample + * in the histogram given by |name|, possibly creating the histogram if it + * does not exist. + */ + void (*HistogramCustomCounts)(PP_Instance instance, + struct PP_Var name, + int32_t sample, + int32_t min, + int32_t max, + uint32_t bucket_count); + /** + * HistogramEnumeration is a pointer to a function which records a sample + * in the histogram given by |name|, possibly creating the histogram if it + * does not exist. The sample represents a value in an enumeration bounded + * by |boundary_value|, that is, sample < boundary_value always. + */ + void (*HistogramEnumeration)(PP_Instance instance, + struct PP_Var name, + int32_t sample, + int32_t boundary_value); + /** + * IsCrashReportingEnabled returns PP_OK to the completion callback to + * indicate that the current user has opted-in to crash reporting, or + * PP_ERROR_* on failure or when a user has not opted-in. This can be used to + * gate other reporting processes such as analytics and crash reporting. + */ + int32_t (*IsCrashReportingEnabled)(PP_Instance instance, + struct PP_CompletionCallback callback); +}; + +typedef struct PPB_UMA_Private_0_3 PPB_UMA_Private; +/** + * @} + */ + +/* private/ppb_video_destination_private.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_VideoDestination_Private interface contains pointers to + * several functions for creating video destination resources and using them to + * send video frames to a MediaStream video track in the browser. + */ +struct PPB_VideoDestination_Private_0_1 { + /** + * Creates a video destination resource. + * + * @param[in] instance A PP_Instance identifying an instance of + * a module. + * + * @return A PP_Resource with a nonzero ID on success or zero on + * failure. Failure means the instance was invalid. + */ + PP_Resource (*Create)(PP_Instance instance); + /** + * Determines if a resource is a video destination resource. + * + * @param[in] resource The PP_Resource to test. + * + * @return A PP_Bool with PP_TRUE if the given + * resource is a video destination resource or PP_FALSE + * otherwise. + */ + PP_Bool (*IsVideoDestination)(PP_Resource resource); + /** + * Opens a video destination for putting frames. + * + * @param[in] destination A PP_Resource corresponding to a video + * destination resource. + * @param[in] stream_url A PP_Var string holding a URL + * identifying a MediaStream. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Open(). + * + * @return An int32_t containing a result code from pp_errors.h. + * Returns PP_ERROR_BADRESOURCE if destination isn't a valid video + * destination. + * Returns PP_ERROR_INPROGRESS if destination is already open. + * Returns PP_ERROR_FAILED if the MediaStream doesn't exist or if there is + * some other browser error. + */ + int32_t (*Open)(PP_Resource destination, + struct PP_Var stream_url, + struct PP_CompletionCallback callback); + /** + * Puts a frame to the video destination. + * + * After this call, you should take care to release your references to the + * image embedded in the video frame. If you paint to the image after + * PutFame(), there is the possibility of artifacts because the browser may + * still be copying the frame to the stream. + * + * @param[in] destination A PP_Resource corresponding to a video + * destination resource. + * @param[in] frame A PP_VideoFrame_Private holding the video + * frame to send to the destination. + * + * @return An int32_t containing a result code from pp_errors.h. + * Returns PP_ERROR_BADRESOURCE if destination isn't a valid video + * destination. + * Returns PP_ERROR_FAILED if destination is not open, if the video frame has + * an invalid image data resource, or if some other browser error occurs. + */ + int32_t (*PutFrame)(PP_Resource destination, + const struct PP_VideoFrame_Private* frame); + /** + * Closes the video destination. + * + * @param[in] destination A PP_Resource corresponding to a video + * destination. + */ + void (*Close)(PP_Resource destination); +}; + +typedef struct PPB_VideoDestination_Private_0_1 PPB_VideoDestination_Private; +/** + * @} + */ + +/* private/ppb_video_source_private.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPB_VideoSource_Private interface contains pointers to + * several functions for creating video source resources and using them to + * receive video frames from a MediaStream video track in the browser. + */ +struct PPB_VideoSource_Private_0_1 { + /** + * Creates a video source resource. + * + * @param[in] instance A PP_Instance identifying an instance of + * a module. + * + * @return A PP_Resource with a nonzero ID on success or zero on + * failure. Failure means the instance was invalid. + */ + PP_Resource (*Create)(PP_Instance instance); + /** + * Determines if a resource is a video source resource. + * + * @param[in] resource The PP_Resource to test. + * + * @return A PP_Bool with PP_TRUE if the given + * resource is a video source resource or PP_FALSE otherwise. + */ + PP_Bool (*IsVideoSource)(PP_Resource resource); + /** + * Opens a video source for getting frames. + * + * @param[in] source A PP_Resource corresponding to a video + * source resource. + * @param[in] stream_url A PP_Var string holding a URL + * identifying a MediaStream. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Open(). + * + * @return An int32_t containing a result code from pp_errors.h. + * Returns PP_ERROR_BADRESOURCE if source isn't a valid video source. + * Returns PP_ERROR_INPROGRESS if source is already open. + * Returns PP_ERROR_FAILED if the MediaStream doesn't exist or if there is + * some other browser error. + */ + int32_t (*Open)(PP_Resource source, + struct PP_Var stream_url, + struct PP_CompletionCallback callback); + /** + * Gets a frame from the video source. The returned image data is only valid + * until the next call to GetFrame. + * The image data resource inside the returned frame will have its reference + * count incremented by one and must be managed by the plugin. + * + * @param[in] source A PP_Resource corresponding to a video + * source resource. + * @param[out] frame A PP_VideoFrame_Private to hold a video + * frame from the source. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of GetNextFrame(). + * + * @return An int32_t containing a result code from pp_errors.h. + * Returns PP_ERROR_BADRESOURCE if source isn't a valid video source. + * Returns PP_ERROR_FAILED if the source is not open, or if some other + * browser error occurs. + */ + int32_t (*GetFrame)(PP_Resource source, + struct PP_VideoFrame_Private* frame, + struct PP_CompletionCallback callback); + /** + * Closes the video source. + * + * @param[in] source A PP_Resource corresponding to a video + * source resource. + */ + void (*Close)(PP_Resource source); +}; + +typedef struct PPB_VideoSource_Private_0_1 PPB_VideoSource_Private; +/** + * @} + */ + +/* private/ppb_x509_certificate_private.idl */ +/** + * @addtogroup Enums + * @{ + */ +/** + * This enumeration corresponds to fields of an X509 certificate. Refer to + * PP_TRUE on success, PP_FALSE on failure. + */ + PP_Bool (*DeauthorizeContentLicenses)(const char* plugin_data_path); + /** + * Gets permission settings. callback will be called exactly once + * to return the settings. + * + * @param[in] plugin_data_path String containing the directory where the + * plugin settings are stored. + * @param[in] setting_type What type of setting to retrieve. + * @param[in] callback The callback to return retrieved data. + * @param[inout] user_data An opaque pointer that will be passed to + * callback. + */ + void (*GetPermissionSettings)( + const char* plugin_data_path, + PP_Flash_BrowserOperations_SettingType setting_type, + PPB_Flash_BrowserOperations_GetSettingsCallback callback, + void* user_data); + /** + * Sets default permission. It applies to all sites except those with + * site-specific settings. + * + * @param[in] plugin_data_path String containing the directory where the + * plugin settings are stored. + * @param[in] setting_type What type of setting to set. + * @param[in] permission The default permission. + * @param[in] clear_site_specific Whether to remove all site-specific + * settings. + * + * @return PP_TRUE on success, PP_FALSE on failure. + */ + PP_Bool (*SetDefaultPermission)( + const char* plugin_data_path, + PP_Flash_BrowserOperations_SettingType setting_type, + PP_Flash_BrowserOperations_Permission permission, + PP_Bool clear_site_specific); + /** + * Sets site-specific permission. If a site has already got site-specific + * permission and it is not in sites, it won't be affected. + * + * @param[in] plugin_data_path String containing the directory where the + * plugin settings are stored. + * @param[in] setting_type What type of setting to set. + * @param[in] site_count How many items are there in sites. + * @param[in] sites The site-specific settings. If a site is specified with + * PP_FLASH_BROWSEROPERATIONS_PERMISSION_DEFAULT permission, it + * will be removed from the site-specific list. + * + * @return PP_TRUE on success, PP_FALSE on failure. + */ + PP_Bool (*SetSitePermission)( + const char* plugin_data_path, + PP_Flash_BrowserOperations_SettingType setting_type, + uint32_t site_count, + const struct PP_Flash_BrowserOperations_SiteSetting sites[]); + /** + * Returns a list of sites that have stored data, for use with the + * "Clear site data" feature. + * + * @param[in] plugin_data_path String containing the directory where the + * plugin data is stored. + * @param[out] sites A NULL-terminated array of sites that have stored data. + * Use FreeSiteList on the array when done. + * + * See also the NPP_GetSitesWithData function in NPAPI: + * https://wiki.mozilla.org/NPAPI:ClearSiteData + */ + void (*GetSitesWithData)(const char* plugin_data_path, char*** sites); + /** + * Frees the list of sites returned by GetSitesWithData. + * + * @param[in] sites A NULL-terminated array of strings. + */ + void (*FreeSiteList)(char* sites[]); +}; + +typedef struct PPP_Flash_BrowserOperations_1_3 PPP_Flash_BrowserOperations; + +struct PPP_Flash_BrowserOperations_1_0 { + PP_Bool (*ClearSiteData)(const char* plugin_data_path, + const char* site, + uint64_t flags, + uint64_t max_age); +}; + +struct PPP_Flash_BrowserOperations_1_2 { + PP_Bool (*ClearSiteData)(const char* plugin_data_path, + const char* site, + uint64_t flags, + uint64_t max_age); + PP_Bool (*DeauthorizeContentLicenses)(const char* plugin_data_path); + void (*GetPermissionSettings)( + const char* plugin_data_path, + PP_Flash_BrowserOperations_SettingType setting_type, + PPB_Flash_BrowserOperations_GetSettingsCallback callback, + void* user_data); + PP_Bool (*SetDefaultPermission)( + const char* plugin_data_path, + PP_Flash_BrowserOperations_SettingType setting_type, + PP_Flash_BrowserOperations_Permission permission, + PP_Bool clear_site_specific); + PP_Bool (*SetSitePermission)( + const char* plugin_data_path, + PP_Flash_BrowserOperations_SettingType setting_type, + uint32_t site_count, + const struct PP_Flash_BrowserOperations_SiteSetting sites[]); +}; +/** + * @} + */ + +/* private/ppp_instance_private.idl */ +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The PPP_Instance_Private interface contains pointers to a series of + * functions that may be implemented in a trusted plugin to provide capabilities + * that aren't possible in untrusted modules. + */ +struct PPP_Instance_Private_0_1 { + /** + * GetInstanceObject returns a PP_Var representing the scriptable object for + * the given instance. Normally this will be a PPP_Class_Deprecated object + * that exposes methods and properties to JavaScript. + * + * On Failure, the returned PP_Var should be a "void" var. + * + * The returned PP_Var should have a reference added for the caller, which + * will be responsible for Release()ing that reference. + * + * @param[in] instance A PP_Instance identifying the instance from which the + * instance object is being requested. + * @return A PP_Var containing scriptable object. + */ + struct PP_Var (*GetInstanceObject)(PP_Instance instance); +}; + +typedef struct PPP_Instance_Private_0_1 PPP_Instance_Private; +/** + * @} + */ + +/* private/ppp_pexe_stream_handler.idl */ +#include "ppapi/c/private/pp_file_handle.h" + +/** + * @addtogroup Interfaces + * @{ + */ +struct PPP_PexeStreamHandler_1_0 { + /** + * Invoked as a result of a cache hit for a translated pexe. + */ + void (*DidCacheHit)(void* user_data, PP_FileHandle nexe_file_handle); + /** + * Invoked as a result of a cache miss for a translated pexe. + * Provides the expected length of the pexe, as read from HTTP headers. + */ + void (*DidCacheMiss)(void* user_data, + int64_t expected_total_length, + PP_FileHandle temp_nexe_file); + /** + * Invoked when a block of data has been downloaded. + * Only invoked after DidCacheMiss(). + */ + void (*DidStreamData)(void* user_data, const void* data, int32_t length); + /** + * Invoked when the stream has finished downloading, regardless of whether it + * succeeded. Not invoked if DidCacheHit() was called. + */ + void (*DidFinishStream)(void* user_data, int32_t pp_error); +}; + +typedef struct PPP_PexeStreamHandler_1_0 PPP_PexeStreamHandler; +/** + * @} + */ + +#include "host/rpc.h" +#include "json/json.cpp" +using namespace std; +using namespace JSON; +const string ToString_PP_ArrayOutput_GetDataBuffer(const PP_ArrayOutput_GetDataBuffer &v); +void FromJSON_PP_ArrayOutput_GetDataBuffer(JSONIterator& iterator, PP_ArrayOutput_GetDataBuffer &value); +const string ToString_PP_ArrayOutput(const PP_ArrayOutput *v); +const string ToString_PP_ArrayOutput(const PP_ArrayOutput &v); +void FromJSON_PP_ArrayOutput(JSONIterator& iterator, PP_ArrayOutput &value); +const string ToString_PP_Bool(const PP_Bool *v); +const string ToString_PP_Bool(const PP_Bool &v); +void FromJSON_PP_Bool(JSONIterator& iterator, PP_Bool &value); +const string ToString_PP_VideoProfile(const PP_VideoProfile *v); +const string ToString_PP_VideoProfile(const PP_VideoProfile &v); +void FromJSON_PP_VideoProfile(JSONIterator& iterator, PP_VideoProfile &value); +const string ToString_PP_AudioProfile(const PP_AudioProfile *v); +const string ToString_PP_AudioProfile(const PP_AudioProfile &v); +void FromJSON_PP_AudioProfile(JSONIterator& iterator, PP_AudioProfile &value); +const string ToString_PP_HardwareAcceleration(const PP_HardwareAcceleration *v); +const string ToString_PP_HardwareAcceleration(const PP_HardwareAcceleration &v); +void FromJSON_PP_HardwareAcceleration(JSONIterator& iterator, PP_HardwareAcceleration &value); +const string ToString_PP_VideoPicture(const PP_VideoPicture *v); +const string ToString_PP_VideoPicture(const PP_VideoPicture &v); +void FromJSON_PP_VideoPicture(JSONIterator& iterator, PP_VideoPicture &value); +const string ToString_PP_VideoPicture_0_1(const PP_VideoPicture_0_1 *v); +const string ToString_PP_VideoPicture_0_1(const PP_VideoPicture_0_1 &v); +void FromJSON_PP_VideoPicture_0_1(JSONIterator& iterator, PP_VideoPicture_0_1 &value); +const string ToString_PP_VideoProfileDescription(const PP_VideoProfileDescription *v); +const string ToString_PP_VideoProfileDescription(const PP_VideoProfileDescription &v); +void FromJSON_PP_VideoProfileDescription(JSONIterator& iterator, PP_VideoProfileDescription &value); +const string ToString_PP_VideoProfileDescription_0_1(const PP_VideoProfileDescription_0_1 *v); +const string ToString_PP_VideoProfileDescription_0_1(const PP_VideoProfileDescription_0_1 &v); +void FromJSON_PP_VideoProfileDescription_0_1(JSONIterator& iterator, PP_VideoProfileDescription_0_1 &value); +const string ToString_PP_AudioProfileDescription(const PP_AudioProfileDescription *v); +const string ToString_PP_AudioProfileDescription(const PP_AudioProfileDescription &v); +void FromJSON_PP_AudioProfileDescription(JSONIterator& iterator, PP_AudioProfileDescription &value); +const string ToString_PP_BitstreamBuffer(const PP_BitstreamBuffer *v); +const string ToString_PP_BitstreamBuffer(const PP_BitstreamBuffer &v); +void FromJSON_PP_BitstreamBuffer(JSONIterator& iterator, PP_BitstreamBuffer &value); +const string ToString_PP_AudioBitstreamBuffer(const PP_AudioBitstreamBuffer *v); +const string ToString_PP_AudioBitstreamBuffer(const PP_AudioBitstreamBuffer &v); +void FromJSON_PP_AudioBitstreamBuffer(JSONIterator& iterator, PP_AudioBitstreamBuffer &value); +const string ToString_PP_CompletionCallback_Func(const PP_CompletionCallback_Func &v); +void FromJSON_PP_CompletionCallback_Func(JSONIterator& iterator, PP_CompletionCallback_Func &value); +const string ToString_PP_CompletionCallback_Flag(const PP_CompletionCallback_Flag *v); +const string ToString_PP_CompletionCallback_Flag(const PP_CompletionCallback_Flag &v); +void FromJSON_PP_CompletionCallback_Flag(JSONIterator& iterator, PP_CompletionCallback_Flag &value); +const string ToString_PP_CompletionCallback(const PP_CompletionCallback *v); +const string ToString_PP_CompletionCallback(const PP_CompletionCallback &v); +void FromJSON_PP_CompletionCallback(JSONIterator& iterator, PP_CompletionCallback &value); +const string ToString_PP_DirectoryEntry(const PP_DirectoryEntry *v); +const string ToString_PP_DirectoryEntry(const PP_DirectoryEntry &v); +void FromJSON_PP_DirectoryEntry(JSONIterator& iterator, PP_DirectoryEntry &value); +const string ToString_PP_FileType(const PP_FileType *v); +const string ToString_PP_FileType(const PP_FileType &v); +void FromJSON_PP_FileType(JSONIterator& iterator, PP_FileType &value); +const string ToString_PP_FileSystemType(const PP_FileSystemType *v); +const string ToString_PP_FileSystemType(const PP_FileSystemType &v); +void FromJSON_PP_FileSystemType(JSONIterator& iterator, PP_FileSystemType &value); +const string ToString_PP_FileInfo(const PP_FileInfo *v); +const string ToString_PP_FileInfo(const PP_FileInfo &v); +void FromJSON_PP_FileInfo(JSONIterator& iterator, PP_FileInfo &value); +const string ToString_PP_Graphics3DAttrib(const PP_Graphics3DAttrib *v); +const string ToString_PP_Graphics3DAttrib(const PP_Graphics3DAttrib &v); +void FromJSON_PP_Graphics3DAttrib(JSONIterator& iterator, PP_Graphics3DAttrib &value); +const string ToString_PP_InputEvent_Key(const PP_InputEvent_Key *v); +const string ToString_PP_InputEvent_Key(const PP_InputEvent_Key &v); +void FromJSON_PP_InputEvent_Key(JSONIterator& iterator, PP_InputEvent_Key &value); +const string ToString_PP_InputEvent_Character(const PP_InputEvent_Character *v); +const string ToString_PP_InputEvent_Character(const PP_InputEvent_Character &v); +void FromJSON_PP_InputEvent_Character(JSONIterator& iterator, PP_InputEvent_Character &value); +const string ToString_PP_InputEvent_Mouse(const PP_InputEvent_Mouse *v); +const string ToString_PP_InputEvent_Mouse(const PP_InputEvent_Mouse &v); +void FromJSON_PP_InputEvent_Mouse(JSONIterator& iterator, PP_InputEvent_Mouse &value); +const string ToString_PP_InputEvent_Wheel(const PP_InputEvent_Wheel *v); +const string ToString_PP_InputEvent_Wheel(const PP_InputEvent_Wheel &v); +void FromJSON_PP_InputEvent_Wheel(JSONIterator& iterator, PP_InputEvent_Wheel &value); +const string ToString_PP_Instance(const PP_Instance *v); +const string ToString_PP_Instance(const PP_Instance &v); +void FromJSON_PP_Instance(JSONIterator& iterator, PP_Instance &value); +const string ToString_PP_Module(const PP_Module *v); +const string ToString_PP_Module(const PP_Module &v); +void FromJSON_PP_Module(JSONIterator& iterator, PP_Module &value); +const string ToString_PP_Point(const PP_Point *v); +const string ToString_PP_Point(const PP_Point &v); +void FromJSON_PP_Point(JSONIterator& iterator, PP_Point &value); +const string ToString_PP_FloatPoint(const PP_FloatPoint *v); +const string ToString_PP_FloatPoint(const PP_FloatPoint &v); +void FromJSON_PP_FloatPoint(JSONIterator& iterator, PP_FloatPoint &value); +const string ToString_PP_Rect(const PP_Rect *v); +const string ToString_PP_Rect(const PP_Rect &v); +void FromJSON_PP_Rect(JSONIterator& iterator, PP_Rect &value); +const string ToString_PP_FloatRect(const PP_FloatRect *v); +const string ToString_PP_FloatRect(const PP_FloatRect &v); +void FromJSON_PP_FloatRect(JSONIterator& iterator, PP_FloatRect &value); +const string ToString_PP_Resource(const PP_Resource *v); +const string ToString_PP_Resource(const PP_Resource &v); +void FromJSON_PP_Resource(JSONIterator& iterator, PP_Resource &value); +const string ToString_PP_Size(const PP_Size *v); +const string ToString_PP_Size(const PP_Size &v); +void FromJSON_PP_Size(JSONIterator& iterator, PP_Size &value); +const string ToString_PP_FloatSize(const PP_FloatSize *v); +const string ToString_PP_FloatSize(const PP_FloatSize &v); +void FromJSON_PP_FloatSize(JSONIterator& iterator, PP_FloatSize &value); +const string ToString_PP_Time(const PP_Time *v); +const string ToString_PP_Time(const PP_Time &v); +void FromJSON_PP_Time(JSONIterator& iterator, PP_Time &value); +const string ToString_PP_TimeTicks(const PP_TimeTicks *v); +const string ToString_PP_TimeTicks(const PP_TimeTicks &v); +void FromJSON_PP_TimeTicks(JSONIterator& iterator, PP_TimeTicks &value); +const string ToString_PP_TimeDelta(const PP_TimeDelta *v); +const string ToString_PP_TimeDelta(const PP_TimeDelta &v); +void FromJSON_PP_TimeDelta(JSONIterator& iterator, PP_TimeDelta &value); +const string ToString_PP_TouchPoint(const PP_TouchPoint *v); +const string ToString_PP_TouchPoint(const PP_TouchPoint &v); +void FromJSON_PP_TouchPoint(JSONIterator& iterator, PP_TouchPoint &value); +const string ToString_PP_VarType(const PP_VarType *v); +const string ToString_PP_VarType(const PP_VarType &v); +void FromJSON_PP_VarType(JSONIterator& iterator, PP_VarType &value); +const string ToString_PP_VarValue(const PP_VarValue *v); +const string ToString_PP_VarValue(const PP_VarValue &v); +void FromJSON_PP_VarValue(JSONIterator& iterator, PP_VarValue &value); +const string ToString_PP_Var(const PP_Var *v); +const string ToString_PP_Var(const PP_Var &v); +void FromJSON_PP_Var(JSONIterator& iterator, PP_Var &value); +const string ToString_PPB_GetInterface(const PPB_GetInterface &v); +void FromJSON_PPB_GetInterface(JSONIterator& iterator, PPB_GetInterface &value); +const string ToString_PPB_Audio_Callback(const PPB_Audio_Callback_1_0 &v); +void FromJSON_PPB_Audio_Callback(JSONIterator& iterator, PPB_Audio_Callback_1_0 &value); +const string ToString_PPB_Audio_Callback(const PPB_Audio_Callback &v); +void FromJSON_PPB_Audio_Callback(JSONIterator& iterator, PPB_Audio_Callback &value); +#ifdef INTERPOSE +static PPB_Audio_1_0 *_real_PPB_Audio_1_0; +#endif // INTERPOSE +const string ToString_PPB_Audio(const PPB_Audio_1_0 *v); +#ifdef INTERPOSE +static PPB_Audio_1_1 *_real_PPB_Audio_1_1; +#endif // INTERPOSE +const string ToString_PPB_Audio(const PPB_Audio_1_1 *v); +const string ToString_PP_AudioBuffer_SampleRate(const PP_AudioBuffer_SampleRate *v); +const string ToString_PP_AudioBuffer_SampleRate(const PP_AudioBuffer_SampleRate &v); +void FromJSON_PP_AudioBuffer_SampleRate(JSONIterator& iterator, PP_AudioBuffer_SampleRate &value); +const string ToString_PP_AudioBuffer_SampleSize(const PP_AudioBuffer_SampleSize *v); +const string ToString_PP_AudioBuffer_SampleSize(const PP_AudioBuffer_SampleSize &v); +void FromJSON_PP_AudioBuffer_SampleSize(JSONIterator& iterator, PP_AudioBuffer_SampleSize &value); +#ifdef INTERPOSE +static PPB_AudioBuffer_0_1 *_real_PPB_AudioBuffer_0_1; +#endif // INTERPOSE +const string ToString_PPB_AudioBuffer(const PPB_AudioBuffer_0_1 *v); +const string ToString_PP_AudioSampleRate(const PP_AudioSampleRate *v); +const string ToString_PP_AudioSampleRate(const PP_AudioSampleRate &v); +void FromJSON_PP_AudioSampleRate(JSONIterator& iterator, PP_AudioSampleRate &value); +#ifdef INTERPOSE +static PPB_AudioConfig_1_0 *_real_PPB_AudioConfig_1_0; +#endif // INTERPOSE +const string ToString_PPB_AudioConfig(const PPB_AudioConfig_1_0 *v); +#ifdef INTERPOSE +static PPB_AudioConfig_1_1 *_real_PPB_AudioConfig_1_1; +#endif // INTERPOSE +const string ToString_PPB_AudioConfig(const PPB_AudioConfig_1_1 *v); +#ifdef INTERPOSE +static PPB_AudioEncoder_0_1 *_real_PPB_AudioEncoder_0_1; +#endif // INTERPOSE +const string ToString_PPB_AudioEncoder(const PPB_AudioEncoder_0_1 *v); +#ifdef INTERPOSE +static PPB_Compositor_0_1 *_real_PPB_Compositor_0_1; +#endif // INTERPOSE +const string ToString_PPB_Compositor(const PPB_Compositor_0_1 *v); +const string ToString_PP_BlendMode(const PP_BlendMode *v); +const string ToString_PP_BlendMode(const PP_BlendMode &v); +void FromJSON_PP_BlendMode(JSONIterator& iterator, PP_BlendMode &value); +#ifdef INTERPOSE +static PPB_CompositorLayer_0_1 *_real_PPB_CompositorLayer_0_1; +#endif // INTERPOSE +const string ToString_PPB_CompositorLayer(const PPB_CompositorLayer_0_1 *v); +#ifdef INTERPOSE +static PPB_CompositorLayer_0_2 *_real_PPB_CompositorLayer_0_2; +#endif // INTERPOSE +const string ToString_PPB_CompositorLayer(const PPB_CompositorLayer_0_2 *v); +const string ToString_PP_LogLevel(const PP_LogLevel *v); +const string ToString_PP_LogLevel(const PP_LogLevel &v); +void FromJSON_PP_LogLevel(JSONIterator& iterator, PP_LogLevel &value); +#ifdef INTERPOSE +static PPB_Console_1_0 *_real_PPB_Console_1_0; +#endif // INTERPOSE +const string ToString_PPB_Console(const PPB_Console_1_0 *v); +#ifdef INTERPOSE +static PPB_Core_1_0 *_real_PPB_Core_1_0; +#endif // INTERPOSE +const string ToString_PPB_Core(const PPB_Core_1_0 *v); +const string ToString_PP_FileOpenFlags(const PP_FileOpenFlags *v); +const string ToString_PP_FileOpenFlags(const PP_FileOpenFlags &v); +void FromJSON_PP_FileOpenFlags(JSONIterator& iterator, PP_FileOpenFlags &value); +#ifdef INTERPOSE +static PPB_FileIO_1_0 *_real_PPB_FileIO_1_0; +#endif // INTERPOSE +const string ToString_PPB_FileIO(const PPB_FileIO_1_0 *v); +#ifdef INTERPOSE +static PPB_FileIO_1_1 *_real_PPB_FileIO_1_1; +#endif // INTERPOSE +const string ToString_PPB_FileIO(const PPB_FileIO_1_1 *v); +const string ToString_PP_MakeDirectoryFlags(const PP_MakeDirectoryFlags *v); +const string ToString_PP_MakeDirectoryFlags(const PP_MakeDirectoryFlags &v); +void FromJSON_PP_MakeDirectoryFlags(JSONIterator& iterator, PP_MakeDirectoryFlags &value); +#ifdef INTERPOSE +static PPB_FileRef_1_0 *_real_PPB_FileRef_1_0; +#endif // INTERPOSE +const string ToString_PPB_FileRef(const PPB_FileRef_1_0 *v); +#ifdef INTERPOSE +static PPB_FileRef_1_1 *_real_PPB_FileRef_1_1; +#endif // INTERPOSE +const string ToString_PPB_FileRef(const PPB_FileRef_1_1 *v); +#ifdef INTERPOSE +static PPB_FileRef_1_2 *_real_PPB_FileRef_1_2; +#endif // INTERPOSE +const string ToString_PPB_FileRef(const PPB_FileRef_1_2 *v); +#ifdef INTERPOSE +static PPB_FileSystem_1_0 *_real_PPB_FileSystem_1_0; +#endif // INTERPOSE +const string ToString_PPB_FileSystem(const PPB_FileSystem_1_0 *v); +#ifdef INTERPOSE +static PPB_Fullscreen_1_0 *_real_PPB_Fullscreen_1_0; +#endif // INTERPOSE +const string ToString_PPB_Fullscreen(const PPB_Fullscreen_1_0 *v); +const string ToString_PP_GamepadSampleData(const PP_GamepadSampleData *v); +const string ToString_PP_GamepadSampleData(const PP_GamepadSampleData &v); +void FromJSON_PP_GamepadSampleData(JSONIterator& iterator, PP_GamepadSampleData &value); +const string ToString_PP_GamepadsSampleData(const PP_GamepadsSampleData *v); +const string ToString_PP_GamepadsSampleData(const PP_GamepadsSampleData &v); +void FromJSON_PP_GamepadsSampleData(JSONIterator& iterator, PP_GamepadsSampleData &value); +#ifdef INTERPOSE +static PPB_Gamepad_1_0 *_real_PPB_Gamepad_1_0; +#endif // INTERPOSE +const string ToString_PPB_Gamepad(const PPB_Gamepad_1_0 *v); +#ifdef INTERPOSE +static PPB_Graphics2D_1_0 *_real_PPB_Graphics2D_1_0; +#endif // INTERPOSE +const string ToString_PPB_Graphics2D(const PPB_Graphics2D_1_0 *v); +#ifdef INTERPOSE +static PPB_Graphics2D_1_1 *_real_PPB_Graphics2D_1_1; +#endif // INTERPOSE +const string ToString_PPB_Graphics2D(const PPB_Graphics2D_1_1 *v); +#ifdef INTERPOSE +static PPB_Graphics2D_1_2 *_real_PPB_Graphics2D_1_2; +#endif // INTERPOSE +const string ToString_PPB_Graphics2D(const PPB_Graphics2D_1_2 *v); +#ifdef INTERPOSE +static PPB_Graphics3D_1_0 *_real_PPB_Graphics3D_1_0; +#endif // INTERPOSE +const string ToString_PPB_Graphics3D(const PPB_Graphics3D_1_0 *v); +const string ToString_PP_HostResolver_Flag(const PP_HostResolver_Flag *v); +const string ToString_PP_HostResolver_Flag(const PP_HostResolver_Flag &v); +void FromJSON_PP_HostResolver_Flag(JSONIterator& iterator, PP_HostResolver_Flag &value); +const string ToString_PP_HostResolver_Hint(const PP_HostResolver_Hint *v); +const string ToString_PP_HostResolver_Hint(const PP_HostResolver_Hint &v); +void FromJSON_PP_HostResolver_Hint(JSONIterator& iterator, PP_HostResolver_Hint &value); +#ifdef INTERPOSE +static PPB_HostResolver_1_0 *_real_PPB_HostResolver_1_0; +#endif // INTERPOSE +const string ToString_PPB_HostResolver(const PPB_HostResolver_1_0 *v); +const string ToString_PP_ImageDataFormat(const PP_ImageDataFormat *v); +const string ToString_PP_ImageDataFormat(const PP_ImageDataFormat &v); +void FromJSON_PP_ImageDataFormat(JSONIterator& iterator, PP_ImageDataFormat &value); +const string ToString_PP_ImageDataDesc(const PP_ImageDataDesc *v); +const string ToString_PP_ImageDataDesc(const PP_ImageDataDesc &v); +void FromJSON_PP_ImageDataDesc(JSONIterator& iterator, PP_ImageDataDesc &value); +#ifdef INTERPOSE +static PPB_ImageData_1_0 *_real_PPB_ImageData_1_0; +#endif // INTERPOSE +const string ToString_PPB_ImageData(const PPB_ImageData_1_0 *v); +const string ToString_PP_InputEvent_Type(const PP_InputEvent_Type *v); +const string ToString_PP_InputEvent_Type(const PP_InputEvent_Type &v); +void FromJSON_PP_InputEvent_Type(JSONIterator& iterator, PP_InputEvent_Type &value); +const string ToString_PP_InputEvent_Modifier(const PP_InputEvent_Modifier *v); +const string ToString_PP_InputEvent_Modifier(const PP_InputEvent_Modifier &v); +void FromJSON_PP_InputEvent_Modifier(JSONIterator& iterator, PP_InputEvent_Modifier &value); +const string ToString_PP_InputEvent_MouseButton(const PP_InputEvent_MouseButton *v); +const string ToString_PP_InputEvent_MouseButton(const PP_InputEvent_MouseButton &v); +void FromJSON_PP_InputEvent_MouseButton(JSONIterator& iterator, PP_InputEvent_MouseButton &value); +const string ToString_PP_InputEvent_Class(const PP_InputEvent_Class *v); +const string ToString_PP_InputEvent_Class(const PP_InputEvent_Class &v); +void FromJSON_PP_InputEvent_Class(JSONIterator& iterator, PP_InputEvent_Class &value); +#ifdef INTERPOSE +static PPB_InputEvent_1_0 *_real_PPB_InputEvent_1_0; +#endif // INTERPOSE +const string ToString_PPB_InputEvent(const PPB_InputEvent_1_0 *v); +#ifdef INTERPOSE +static PPB_MouseInputEvent_1_0 *_real_PPB_MouseInputEvent_1_0; +#endif // INTERPOSE +const string ToString_PPB_MouseInputEvent(const PPB_MouseInputEvent_1_0 *v); +#ifdef INTERPOSE +static PPB_MouseInputEvent_1_1 *_real_PPB_MouseInputEvent_1_1; +#endif // INTERPOSE +const string ToString_PPB_MouseInputEvent(const PPB_MouseInputEvent_1_1 *v); +#ifdef INTERPOSE +static PPB_WheelInputEvent_1_0 *_real_PPB_WheelInputEvent_1_0; +#endif // INTERPOSE +const string ToString_PPB_WheelInputEvent(const PPB_WheelInputEvent_1_0 *v); +#ifdef INTERPOSE +static PPB_KeyboardInputEvent_1_0 *_real_PPB_KeyboardInputEvent_1_0; +#endif // INTERPOSE +const string ToString_PPB_KeyboardInputEvent(const PPB_KeyboardInputEvent_1_0 *v); +#ifdef INTERPOSE +static PPB_KeyboardInputEvent_1_2 *_real_PPB_KeyboardInputEvent_1_2; +#endif // INTERPOSE +const string ToString_PPB_KeyboardInputEvent(const PPB_KeyboardInputEvent_1_2 *v); +const string ToString_PP_TouchListType(const PP_TouchListType *v); +const string ToString_PP_TouchListType(const PP_TouchListType &v); +void FromJSON_PP_TouchListType(JSONIterator& iterator, PP_TouchListType &value); +#ifdef INTERPOSE +static PPB_TouchInputEvent_1_0 *_real_PPB_TouchInputEvent_1_0; +#endif // INTERPOSE +const string ToString_PPB_TouchInputEvent(const PPB_TouchInputEvent_1_0 *v); +#ifdef INTERPOSE +static PPB_IMEInputEvent_1_0 *_real_PPB_IMEInputEvent_1_0; +#endif // INTERPOSE +const string ToString_PPB_IMEInputEvent(const PPB_IMEInputEvent_1_0 *v); +#ifdef INTERPOSE +static PPB_Instance_1_0 *_real_PPB_Instance_1_0; +#endif // INTERPOSE +const string ToString_PPB_Instance(const PPB_Instance_1_0 *v); +const string ToString_PP_MediaStreamAudioTrack_Attrib(const PP_MediaStreamAudioTrack_Attrib *v); +const string ToString_PP_MediaStreamAudioTrack_Attrib(const PP_MediaStreamAudioTrack_Attrib &v); +void FromJSON_PP_MediaStreamAudioTrack_Attrib(JSONIterator& iterator, PP_MediaStreamAudioTrack_Attrib &value); +#ifdef INTERPOSE +static PPB_MediaStreamAudioTrack_0_1 *_real_PPB_MediaStreamAudioTrack_0_1; +#endif // INTERPOSE +const string ToString_PPB_MediaStreamAudioTrack(const PPB_MediaStreamAudioTrack_0_1 *v); +const string ToString_PP_MediaStreamVideoTrack_Attrib(const PP_MediaStreamVideoTrack_Attrib *v); +const string ToString_PP_MediaStreamVideoTrack_Attrib(const PP_MediaStreamVideoTrack_Attrib &v); +void FromJSON_PP_MediaStreamVideoTrack_Attrib(JSONIterator& iterator, PP_MediaStreamVideoTrack_Attrib &value); +#ifdef INTERPOSE +static PPB_MediaStreamVideoTrack_0_1 *_real_PPB_MediaStreamVideoTrack_0_1; +#endif // INTERPOSE +const string ToString_PPB_MediaStreamVideoTrack(const PPB_MediaStreamVideoTrack_0_1 *v); +#ifdef INTERPOSE +static PPB_MediaStreamVideoTrack_1_0 *_real_PPB_MediaStreamVideoTrack_1_0; +#endif // INTERPOSE +const string ToString_PPB_MediaStreamVideoTrack(const PPB_MediaStreamVideoTrack_1_0 *v); +#ifdef INTERPOSE +static PPB_MessageLoop_1_0 *_real_PPB_MessageLoop_1_0; +#endif // INTERPOSE +const string ToString_PPB_MessageLoop(const PPB_MessageLoop_1_0 *v); +#ifdef INTERPOSE +static PPB_Messaging_1_0 *_real_PPB_Messaging_1_0; +#endif // INTERPOSE +const string ToString_PPB_Messaging(const PPB_Messaging_1_0 *v); +#ifdef INTERPOSE +static PPB_Messaging_1_2 *_real_PPB_Messaging_1_2; +#endif // INTERPOSE +const string ToString_PPB_Messaging(const PPB_Messaging_1_2 *v); +const string ToString_PP_MouseCursor_Type(const PP_MouseCursor_Type *v); +const string ToString_PP_MouseCursor_Type(const PP_MouseCursor_Type &v); +void FromJSON_PP_MouseCursor_Type(JSONIterator& iterator, PP_MouseCursor_Type &value); +#ifdef INTERPOSE +static PPB_MouseCursor_1_0 *_real_PPB_MouseCursor_1_0; +#endif // INTERPOSE +const string ToString_PPB_MouseCursor(const PPB_MouseCursor_1_0 *v); +#ifdef INTERPOSE +static PPB_MouseLock_1_0 *_real_PPB_MouseLock_1_0; +#endif // INTERPOSE +const string ToString_PPB_MouseLock(const PPB_MouseLock_1_0 *v); +const string ToString_PP_NetAddress_Family(const PP_NetAddress_Family *v); +const string ToString_PP_NetAddress_Family(const PP_NetAddress_Family &v); +void FromJSON_PP_NetAddress_Family(JSONIterator& iterator, PP_NetAddress_Family &value); +const string ToString_PP_NetAddress_IPv4(const PP_NetAddress_IPv4 *v); +const string ToString_PP_NetAddress_IPv4(const PP_NetAddress_IPv4 &v); +void FromJSON_PP_NetAddress_IPv4(JSONIterator& iterator, PP_NetAddress_IPv4 &value); +const string ToString_PP_NetAddress_IPv6(const PP_NetAddress_IPv6 *v); +const string ToString_PP_NetAddress_IPv6(const PP_NetAddress_IPv6 &v); +void FromJSON_PP_NetAddress_IPv6(JSONIterator& iterator, PP_NetAddress_IPv6 &value); +#ifdef INTERPOSE +static PPB_NetAddress_1_0 *_real_PPB_NetAddress_1_0; +#endif // INTERPOSE +const string ToString_PPB_NetAddress(const PPB_NetAddress_1_0 *v); +const string ToString_PP_NetworkList_Type(const PP_NetworkList_Type *v); +const string ToString_PP_NetworkList_Type(const PP_NetworkList_Type &v); +void FromJSON_PP_NetworkList_Type(JSONIterator& iterator, PP_NetworkList_Type &value); +const string ToString_PP_NetworkList_State(const PP_NetworkList_State *v); +const string ToString_PP_NetworkList_State(const PP_NetworkList_State &v); +void FromJSON_PP_NetworkList_State(JSONIterator& iterator, PP_NetworkList_State &value); +#ifdef INTERPOSE +static PPB_NetworkList_1_0 *_real_PPB_NetworkList_1_0; +#endif // INTERPOSE +const string ToString_PPB_NetworkList(const PPB_NetworkList_1_0 *v); +#ifdef INTERPOSE +static PPB_NetworkMonitor_1_0 *_real_PPB_NetworkMonitor_1_0; +#endif // INTERPOSE +const string ToString_PPB_NetworkMonitor(const PPB_NetworkMonitor_1_0 *v); +#ifdef INTERPOSE +static PPB_NetworkProxy_1_0 *_real_PPB_NetworkProxy_1_0; +#endif // INTERPOSE +const string ToString_PPB_NetworkProxy(const PPB_NetworkProxy_1_0 *v); +#ifdef INTERPOSE +static PPB_OpenGLES2_1_0 *_real_PPB_OpenGLES2_1_0; +#endif // INTERPOSE +const string ToString_PPB_OpenGLES2(const PPB_OpenGLES2_1_0 *v); +#ifdef INTERPOSE +static PPB_OpenGLES2InstancedArrays_1_0 *_real_PPB_OpenGLES2InstancedArrays_1_0; +#endif // INTERPOSE +const string ToString_PPB_OpenGLES2InstancedArrays(const PPB_OpenGLES2InstancedArrays_1_0 *v); +#ifdef INTERPOSE +static PPB_OpenGLES2FramebufferBlit_1_0 *_real_PPB_OpenGLES2FramebufferBlit_1_0; +#endif // INTERPOSE +const string ToString_PPB_OpenGLES2FramebufferBlit(const PPB_OpenGLES2FramebufferBlit_1_0 *v); +#ifdef INTERPOSE +static PPB_OpenGLES2FramebufferMultisample_1_0 *_real_PPB_OpenGLES2FramebufferMultisample_1_0; +#endif // INTERPOSE +const string ToString_PPB_OpenGLES2FramebufferMultisample(const PPB_OpenGLES2FramebufferMultisample_1_0 *v); +#ifdef INTERPOSE +static PPB_OpenGLES2ChromiumEnableFeature_1_0 *_real_PPB_OpenGLES2ChromiumEnableFeature_1_0; +#endif // INTERPOSE +const string ToString_PPB_OpenGLES2ChromiumEnableFeature(const PPB_OpenGLES2ChromiumEnableFeature_1_0 *v); +#ifdef INTERPOSE +static PPB_OpenGLES2ChromiumMapSub_1_0 *_real_PPB_OpenGLES2ChromiumMapSub_1_0; +#endif // INTERPOSE +const string ToString_PPB_OpenGLES2ChromiumMapSub(const PPB_OpenGLES2ChromiumMapSub_1_0 *v); +#ifdef INTERPOSE +static PPB_OpenGLES2Query_1_0 *_real_PPB_OpenGLES2Query_1_0; +#endif // INTERPOSE +const string ToString_PPB_OpenGLES2Query(const PPB_OpenGLES2Query_1_0 *v); +#ifdef INTERPOSE +static PPB_OpenGLES2VertexArrayObject_1_0 *_real_PPB_OpenGLES2VertexArrayObject_1_0; +#endif // INTERPOSE +const string ToString_PPB_OpenGLES2VertexArrayObject(const PPB_OpenGLES2VertexArrayObject_1_0 *v); +const string ToString_PP_TCPSocket_Option(const PP_TCPSocket_Option *v); +const string ToString_PP_TCPSocket_Option(const PP_TCPSocket_Option &v); +void FromJSON_PP_TCPSocket_Option(JSONIterator& iterator, PP_TCPSocket_Option &value); +#ifdef INTERPOSE +static PPB_TCPSocket_1_0 *_real_PPB_TCPSocket_1_0; +#endif // INTERPOSE +const string ToString_PPB_TCPSocket(const PPB_TCPSocket_1_0 *v); +#ifdef INTERPOSE +static PPB_TCPSocket_1_1 *_real_PPB_TCPSocket_1_1; +#endif // INTERPOSE +const string ToString_PPB_TCPSocket(const PPB_TCPSocket_1_1 *v); +#ifdef INTERPOSE +static PPB_TCPSocket_1_2 *_real_PPB_TCPSocket_1_2; +#endif // INTERPOSE +const string ToString_PPB_TCPSocket(const PPB_TCPSocket_1_2 *v); +const string ToString_PP_TextInput_Type(const PP_TextInput_Type *v); +const string ToString_PP_TextInput_Type(const PP_TextInput_Type &v); +void FromJSON_PP_TextInput_Type(JSONIterator& iterator, PP_TextInput_Type &value); +#ifdef INTERPOSE +static PPB_TextInputController_1_0 *_real_PPB_TextInputController_1_0; +#endif // INTERPOSE +const string ToString_PPB_TextInputController(const PPB_TextInputController_1_0 *v); +const string ToString_PP_UDPSocket_Option(const PP_UDPSocket_Option *v); +const string ToString_PP_UDPSocket_Option(const PP_UDPSocket_Option &v); +void FromJSON_PP_UDPSocket_Option(JSONIterator& iterator, PP_UDPSocket_Option &value); +#ifdef INTERPOSE +static PPB_UDPSocket_1_0 *_real_PPB_UDPSocket_1_0; +#endif // INTERPOSE +const string ToString_PPB_UDPSocket(const PPB_UDPSocket_1_0 *v); +#ifdef INTERPOSE +static PPB_UDPSocket_1_1 *_real_PPB_UDPSocket_1_1; +#endif // INTERPOSE +const string ToString_PPB_UDPSocket(const PPB_UDPSocket_1_1 *v); +#ifdef INTERPOSE +static PPB_UDPSocket_1_2 *_real_PPB_UDPSocket_1_2; +#endif // INTERPOSE +const string ToString_PPB_UDPSocket(const PPB_UDPSocket_1_2 *v); +#ifdef INTERPOSE +static PPB_URLLoader_1_0 *_real_PPB_URLLoader_1_0; +#endif // INTERPOSE +const string ToString_PPB_URLLoader(const PPB_URLLoader_1_0 *v); +const string ToString_PP_URLRequestProperty(const PP_URLRequestProperty *v); +const string ToString_PP_URLRequestProperty(const PP_URLRequestProperty &v); +void FromJSON_PP_URLRequestProperty(JSONIterator& iterator, PP_URLRequestProperty &value); +#ifdef INTERPOSE +static PPB_URLRequestInfo_1_0 *_real_PPB_URLRequestInfo_1_0; +#endif // INTERPOSE +const string ToString_PPB_URLRequestInfo(const PPB_URLRequestInfo_1_0 *v); +const string ToString_PP_URLResponseProperty(const PP_URLResponseProperty *v); +const string ToString_PP_URLResponseProperty(const PP_URLResponseProperty &v); +void FromJSON_PP_URLResponseProperty(JSONIterator& iterator, PP_URLResponseProperty &value); +#ifdef INTERPOSE +static PPB_URLResponseInfo_1_0 *_real_PPB_URLResponseInfo_1_0; +#endif // INTERPOSE +const string ToString_PPB_URLResponseInfo(const PPB_URLResponseInfo_1_0 *v); +#ifdef INTERPOSE +static PPB_Var_1_0 *_real_PPB_Var_1_0; +#endif // INTERPOSE +const string ToString_PPB_Var(const PPB_Var_1_0 *v); +#ifdef INTERPOSE +static PPB_Var_1_1 *_real_PPB_Var_1_1; +#endif // INTERPOSE +const string ToString_PPB_Var(const PPB_Var_1_1 *v); +#ifdef INTERPOSE +static PPB_Var_1_2 *_real_PPB_Var_1_2; +#endif // INTERPOSE +const string ToString_PPB_Var(const PPB_Var_1_2 *v); +#ifdef INTERPOSE +static PPB_VarArray_1_0 *_real_PPB_VarArray_1_0; +#endif // INTERPOSE +const string ToString_PPB_VarArray(const PPB_VarArray_1_0 *v); +#ifdef INTERPOSE +static PPB_VarArrayBuffer_1_0 *_real_PPB_VarArrayBuffer_1_0; +#endif // INTERPOSE +const string ToString_PPB_VarArrayBuffer(const PPB_VarArrayBuffer_1_0 *v); +#ifdef INTERPOSE +static PPB_VarDictionary_1_0 *_real_PPB_VarDictionary_1_0; +#endif // INTERPOSE +const string ToString_PPB_VarDictionary(const PPB_VarDictionary_1_0 *v); +#ifdef INTERPOSE +static PPB_VideoDecoder_0_1 *_real_PPB_VideoDecoder_0_1; +#endif // INTERPOSE +const string ToString_PPB_VideoDecoder(const PPB_VideoDecoder_0_1 *v); +#ifdef INTERPOSE +static PPB_VideoDecoder_0_2 *_real_PPB_VideoDecoder_0_2; +#endif // INTERPOSE +const string ToString_PPB_VideoDecoder(const PPB_VideoDecoder_0_2 *v); +#ifdef INTERPOSE +static PPB_VideoDecoder_1_0 *_real_PPB_VideoDecoder_1_0; +#endif // INTERPOSE +const string ToString_PPB_VideoDecoder(const PPB_VideoDecoder_1_0 *v); +#ifdef INTERPOSE +static PPB_VideoDecoder_1_1 *_real_PPB_VideoDecoder_1_1; +#endif // INTERPOSE +const string ToString_PPB_VideoDecoder(const PPB_VideoDecoder_1_1 *v); +#ifdef INTERPOSE +static PPB_VideoEncoder_0_1 *_real_PPB_VideoEncoder_0_1; +#endif // INTERPOSE +const string ToString_PPB_VideoEncoder(const PPB_VideoEncoder_0_1 *v); +#ifdef INTERPOSE +static PPB_VideoEncoder_0_2 *_real_PPB_VideoEncoder_0_2; +#endif // INTERPOSE +const string ToString_PPB_VideoEncoder(const PPB_VideoEncoder_0_2 *v); +const string ToString_PP_VideoFrame_Format(const PP_VideoFrame_Format *v); +const string ToString_PP_VideoFrame_Format(const PP_VideoFrame_Format &v); +void FromJSON_PP_VideoFrame_Format(JSONIterator& iterator, PP_VideoFrame_Format &value); +#ifdef INTERPOSE +static PPB_VideoFrame_0_1 *_real_PPB_VideoFrame_0_1; +#endif // INTERPOSE +const string ToString_PPB_VideoFrame(const PPB_VideoFrame_0_1 *v); +#ifdef INTERPOSE +static PPB_View_1_0 *_real_PPB_View_1_0; +#endif // INTERPOSE +const string ToString_PPB_View(const PPB_View_1_0 *v); +#ifdef INTERPOSE +static PPB_View_1_1 *_real_PPB_View_1_1; +#endif // INTERPOSE +const string ToString_PPB_View(const PPB_View_1_1 *v); +#ifdef INTERPOSE +static PPB_View_1_2 *_real_PPB_View_1_2; +#endif // INTERPOSE +const string ToString_PPB_View(const PPB_View_1_2 *v); +#ifdef INTERPOSE +static PPB_VpnProvider_0_1 *_real_PPB_VpnProvider_0_1; +#endif // INTERPOSE +const string ToString_PPB_VpnProvider(const PPB_VpnProvider_0_1 *v); +const string ToString_PP_WebSocketReadyState(const PP_WebSocketReadyState *v); +const string ToString_PP_WebSocketReadyState(const PP_WebSocketReadyState &v); +void FromJSON_PP_WebSocketReadyState(JSONIterator& iterator, PP_WebSocketReadyState &value); +const string ToString_PP_WebSocketCloseCode(const PP_WebSocketCloseCode *v); +const string ToString_PP_WebSocketCloseCode(const PP_WebSocketCloseCode &v); +void FromJSON_PP_WebSocketCloseCode(JSONIterator& iterator, PP_WebSocketCloseCode &value); +#ifdef INTERPOSE +static PPB_WebSocket_1_0 *_real_PPB_WebSocket_1_0; +#endif // INTERPOSE +const string ToString_PPB_WebSocket(const PPB_WebSocket_1_0 *v); +const string ToString_PP_InitializeModule_Func(const PP_InitializeModule_Func &v); +void FromJSON_PP_InitializeModule_Func(JSONIterator& iterator, PP_InitializeModule_Func &value); +const string ToString_PP_ShutdownModule_Func(const PP_ShutdownModule_Func &v); +void FromJSON_PP_ShutdownModule_Func(JSONIterator& iterator, PP_ShutdownModule_Func &value); +const string ToString_PP_GetInterface_Func(const PP_GetInterface_Func &v); +void FromJSON_PP_GetInterface_Func(JSONIterator& iterator, PP_GetInterface_Func &value); +#ifdef INTERPOSE +static PPP_Graphics3D_1_0 *_real_PPP_Graphics3D_1_0; +#endif // INTERPOSE +static char* Call_PPP_Graphics3D(void* _interface, JSONIterator& iterator); +#ifdef INTERPOSE +static PPP_InputEvent_0_1 *_real_PPP_InputEvent_0_1; +#endif // INTERPOSE +static char* Call_PPP_InputEvent(void* _interface, JSONIterator& iterator); +#ifdef INTERPOSE +static PPP_Instance_1_0 *_real_PPP_Instance_1_0; +#endif // INTERPOSE +static char* Call_PPP_Instance_1_0(void* _interface, JSONIterator& iterator); +#ifdef INTERPOSE +static PPP_Instance_1_1 *_real_PPP_Instance_1_1; +#endif // INTERPOSE +static char* Call_PPP_Instance(void* _interface, JSONIterator& iterator); +#ifdef INTERPOSE +static PPP_MessageHandler_0_2 *_real_PPP_MessageHandler_0_2; +#endif // INTERPOSE +static char* Call_PPP_MessageHandler(void* _interface, JSONIterator& iterator); +#ifdef INTERPOSE +static PPP_Messaging_1_0 *_real_PPP_Messaging_1_0; +#endif // INTERPOSE +static char* Call_PPP_Messaging(void* _interface, JSONIterator& iterator); +#ifdef INTERPOSE +static PPP_MouseLock_1_0 *_real_PPP_MouseLock_1_0; +#endif // INTERPOSE +static char* Call_PPP_MouseLock(void* _interface, JSONIterator& iterator); +#ifdef INTERPOSE +static PPB_BrokerTrusted_0_2 *_real_PPB_BrokerTrusted_0_2; +#endif // INTERPOSE +const string ToString_PPB_BrokerTrusted(const PPB_BrokerTrusted_0_2 *v); +#ifdef INTERPOSE +static PPB_BrokerTrusted_0_3 *_real_PPB_BrokerTrusted_0_3; +#endif // INTERPOSE +const string ToString_PPB_BrokerTrusted(const PPB_BrokerTrusted_0_3 *v); +const string ToString_PP_BrowserFont_Trusted_Family(const PP_BrowserFont_Trusted_Family *v); +const string ToString_PP_BrowserFont_Trusted_Family(const PP_BrowserFont_Trusted_Family &v); +void FromJSON_PP_BrowserFont_Trusted_Family(JSONIterator& iterator, PP_BrowserFont_Trusted_Family &value); +const string ToString_PP_BrowserFont_Trusted_Weight(const PP_BrowserFont_Trusted_Weight *v); +const string ToString_PP_BrowserFont_Trusted_Weight(const PP_BrowserFont_Trusted_Weight &v); +void FromJSON_PP_BrowserFont_Trusted_Weight(JSONIterator& iterator, PP_BrowserFont_Trusted_Weight &value); +const string ToString_PP_BrowserFont_Trusted_Description(const PP_BrowserFont_Trusted_Description *v); +const string ToString_PP_BrowserFont_Trusted_Description(const PP_BrowserFont_Trusted_Description &v); +void FromJSON_PP_BrowserFont_Trusted_Description(JSONIterator& iterator, PP_BrowserFont_Trusted_Description &value); +const string ToString_PP_BrowserFont_Trusted_Metrics(const PP_BrowserFont_Trusted_Metrics *v); +const string ToString_PP_BrowserFont_Trusted_Metrics(const PP_BrowserFont_Trusted_Metrics &v); +void FromJSON_PP_BrowserFont_Trusted_Metrics(JSONIterator& iterator, PP_BrowserFont_Trusted_Metrics &value); +const string ToString_PP_BrowserFont_Trusted_TextRun(const PP_BrowserFont_Trusted_TextRun *v); +const string ToString_PP_BrowserFont_Trusted_TextRun(const PP_BrowserFont_Trusted_TextRun &v); +void FromJSON_PP_BrowserFont_Trusted_TextRun(JSONIterator& iterator, PP_BrowserFont_Trusted_TextRun &value); +#ifdef INTERPOSE +static PPB_BrowserFont_Trusted_1_0 *_real_PPB_BrowserFont_Trusted_1_0; +#endif // INTERPOSE +const string ToString_PPB_BrowserFont_Trusted(const PPB_BrowserFont_Trusted_1_0 *v); +const string ToString_PP_CharSet_Trusted_ConversionError(const PP_CharSet_Trusted_ConversionError *v); +const string ToString_PP_CharSet_Trusted_ConversionError(const PP_CharSet_Trusted_ConversionError &v); +void FromJSON_PP_CharSet_Trusted_ConversionError(JSONIterator& iterator, PP_CharSet_Trusted_ConversionError &value); +#ifdef INTERPOSE +static PPB_CharSet_Trusted_1_0 *_real_PPB_CharSet_Trusted_1_0; +#endif // INTERPOSE +const string ToString_PPB_CharSet_Trusted(const PPB_CharSet_Trusted_1_0 *v); +#ifdef INTERPOSE +static PPB_FileChooserTrusted_0_5 *_real_PPB_FileChooserTrusted_0_5; +#endif // INTERPOSE +const string ToString_PPB_FileChooserTrusted(const PPB_FileChooserTrusted_0_5 *v); +#ifdef INTERPOSE +static PPB_FileChooserTrusted_0_6 *_real_PPB_FileChooserTrusted_0_6; +#endif // INTERPOSE +const string ToString_PPB_FileChooserTrusted(const PPB_FileChooserTrusted_0_6 *v); +const string ToString_PP_URLLoaderTrusted_StatusCallback(const PP_URLLoaderTrusted_StatusCallback &v); +void FromJSON_PP_URLLoaderTrusted_StatusCallback(JSONIterator& iterator, PP_URLLoaderTrusted_StatusCallback &value); +#ifdef INTERPOSE +static PPB_URLLoaderTrusted_0_3 *_real_PPB_URLLoaderTrusted_0_3; +#endif // INTERPOSE +const string ToString_PPB_URLLoaderTrusted(const PPB_URLLoaderTrusted_0_3 *v); +const string ToString_PP_CursorType_Dev(const PP_CursorType_Dev *v); +const string ToString_PP_CursorType_Dev(const PP_CursorType_Dev &v); +void FromJSON_PP_CursorType_Dev(JSONIterator& iterator, PP_CursorType_Dev &value); +const string ToString_PP_PrintOrientation_Dev(const PP_PrintOrientation_Dev *v); +const string ToString_PP_PrintOrientation_Dev(const PP_PrintOrientation_Dev &v); +void FromJSON_PP_PrintOrientation_Dev(JSONIterator& iterator, PP_PrintOrientation_Dev &value); +const string ToString_PP_PrintOutputFormat_Dev(const PP_PrintOutputFormat_Dev *v); +const string ToString_PP_PrintOutputFormat_Dev(const PP_PrintOutputFormat_Dev &v); +void FromJSON_PP_PrintOutputFormat_Dev(JSONIterator& iterator, PP_PrintOutputFormat_Dev &value); +const string ToString_PP_PrintScalingOption_Dev(const PP_PrintScalingOption_Dev *v); +const string ToString_PP_PrintScalingOption_Dev(const PP_PrintScalingOption_Dev &v); +void FromJSON_PP_PrintScalingOption_Dev(JSONIterator& iterator, PP_PrintScalingOption_Dev &value); +const string ToString_PP_PrintSettings_Dev(const PP_PrintSettings_Dev *v); +const string ToString_PP_PrintSettings_Dev(const PP_PrintSettings_Dev &v); +void FromJSON_PP_PrintSettings_Dev(JSONIterator& iterator, PP_PrintSettings_Dev &value); +const string ToString_PP_VideoCaptureDeviceInfo_Dev(const PP_VideoCaptureDeviceInfo_Dev *v); +const string ToString_PP_VideoCaptureDeviceInfo_Dev(const PP_VideoCaptureDeviceInfo_Dev &v); +void FromJSON_PP_VideoCaptureDeviceInfo_Dev(JSONIterator& iterator, PP_VideoCaptureDeviceInfo_Dev &value); +const string ToString_PP_VideoCaptureStatus_Dev(const PP_VideoCaptureStatus_Dev *v); +const string ToString_PP_VideoCaptureStatus_Dev(const PP_VideoCaptureStatus_Dev &v); +void FromJSON_PP_VideoCaptureStatus_Dev(JSONIterator& iterator, PP_VideoCaptureStatus_Dev &value); +const string ToString_PP_VideoDecoder_Profile(const PP_VideoDecoder_Profile *v); +const string ToString_PP_VideoDecoder_Profile(const PP_VideoDecoder_Profile &v); +void FromJSON_PP_VideoDecoder_Profile(JSONIterator& iterator, PP_VideoDecoder_Profile &value); +const string ToString_PP_VideoBitstreamBuffer_Dev(const PP_VideoBitstreamBuffer_Dev *v); +const string ToString_PP_VideoBitstreamBuffer_Dev(const PP_VideoBitstreamBuffer_Dev &v); +void FromJSON_PP_VideoBitstreamBuffer_Dev(JSONIterator& iterator, PP_VideoBitstreamBuffer_Dev &value); +const string ToString_PP_PictureBuffer_Dev(const PP_PictureBuffer_Dev *v); +const string ToString_PP_PictureBuffer_Dev(const PP_PictureBuffer_Dev &v); +void FromJSON_PP_PictureBuffer_Dev(JSONIterator& iterator, PP_PictureBuffer_Dev &value); +const string ToString_PP_Picture_Dev(const PP_Picture_Dev *v); +const string ToString_PP_Picture_Dev(const PP_Picture_Dev &v); +void FromJSON_PP_Picture_Dev(JSONIterator& iterator, PP_Picture_Dev &value); +const string ToString_PP_VideoDecodeError_Dev(const PP_VideoDecodeError_Dev *v); +const string ToString_PP_VideoDecodeError_Dev(const PP_VideoDecodeError_Dev &v); +void FromJSON_PP_VideoDecodeError_Dev(JSONIterator& iterator, PP_VideoDecodeError_Dev &value); +const string ToString_PPB_AudioInput_Callback(const PPB_AudioInput_Callback_0_3 &v); +void FromJSON_PPB_AudioInput_Callback(JSONIterator& iterator, PPB_AudioInput_Callback_0_3 &value); +const string ToString_PPB_AudioInput_Callback(const PPB_AudioInput_Callback &v); +void FromJSON_PPB_AudioInput_Callback(JSONIterator& iterator, PPB_AudioInput_Callback &value); +#ifdef INTERPOSE +static PPB_AudioInput_Dev_0_3 *_real_PPB_AudioInput_Dev_0_3; +#endif // INTERPOSE +const string ToString_PPB_AudioInput_Dev(const PPB_AudioInput_Dev_0_3 *v); +#ifdef INTERPOSE +static PPB_AudioInput_Dev_0_4 *_real_PPB_AudioInput_Dev_0_4; +#endif // INTERPOSE +const string ToString_PPB_AudioInput_Dev(const PPB_AudioInput_Dev_0_4 *v); +#ifdef INTERPOSE +static PPB_Buffer_Dev_0_4 *_real_PPB_Buffer_Dev_0_4; +#endif // INTERPOSE +const string ToString_PPB_Buffer_Dev(const PPB_Buffer_Dev_0_4 *v); +const string ToString_PP_CharSet_ConversionError(const PP_CharSet_ConversionError *v); +const string ToString_PP_CharSet_ConversionError(const PP_CharSet_ConversionError &v); +void FromJSON_PP_CharSet_ConversionError(JSONIterator& iterator, PP_CharSet_ConversionError &value); +#ifdef INTERPOSE +static PPB_CharSet_Dev_0_4 *_real_PPB_CharSet_Dev_0_4; +#endif // INTERPOSE +const string ToString_PPB_CharSet_Dev(const PPB_CharSet_Dev_0_4 *v); +#ifdef INTERPOSE +static PPB_Crypto_Dev_0_1 *_real_PPB_Crypto_Dev_0_1; +#endif // INTERPOSE +const string ToString_PPB_Crypto_Dev(const PPB_Crypto_Dev_0_1 *v); +#ifdef INTERPOSE +static PPB_CursorControl_Dev_0_4 *_real_PPB_CursorControl_Dev_0_4; +#endif // INTERPOSE +const string ToString_PPB_CursorControl_Dev(const PPB_CursorControl_Dev_0_4 *v); +const string ToString_PP_MonitorDeviceChangeCallback(const PP_MonitorDeviceChangeCallback &v); +void FromJSON_PP_MonitorDeviceChangeCallback(JSONIterator& iterator, PP_MonitorDeviceChangeCallback &value); +const string ToString_PP_DeviceType_Dev(const PP_DeviceType_Dev *v); +const string ToString_PP_DeviceType_Dev(const PP_DeviceType_Dev &v); +void FromJSON_PP_DeviceType_Dev(JSONIterator& iterator, PP_DeviceType_Dev &value); +#ifdef INTERPOSE +static PPB_DeviceRef_Dev_0_1 *_real_PPB_DeviceRef_Dev_0_1; +#endif // INTERPOSE +const string ToString_PPB_DeviceRef_Dev(const PPB_DeviceRef_Dev_0_1 *v); +const string ToString_PP_FileChooserMode_Dev(const PP_FileChooserMode_Dev *v); +const string ToString_PP_FileChooserMode_Dev(const PP_FileChooserMode_Dev &v); +void FromJSON_PP_FileChooserMode_Dev(JSONIterator& iterator, PP_FileChooserMode_Dev &value); +#ifdef INTERPOSE +static PPB_FileChooser_Dev_0_5 *_real_PPB_FileChooser_Dev_0_5; +#endif // INTERPOSE +const string ToString_PPB_FileChooser_Dev(const PPB_FileChooser_Dev_0_5 *v); +#ifdef INTERPOSE +static PPB_FileChooser_Dev_0_6 *_real_PPB_FileChooser_Dev_0_6; +#endif // INTERPOSE +const string ToString_PPB_FileChooser_Dev(const PPB_FileChooser_Dev_0_6 *v); +const string ToString_PP_FontFamily_Dev(const PP_FontFamily_Dev *v); +const string ToString_PP_FontFamily_Dev(const PP_FontFamily_Dev &v); +void FromJSON_PP_FontFamily_Dev(JSONIterator& iterator, PP_FontFamily_Dev &value); +const string ToString_PP_FontWeight_Dev(const PP_FontWeight_Dev *v); +const string ToString_PP_FontWeight_Dev(const PP_FontWeight_Dev &v); +void FromJSON_PP_FontWeight_Dev(JSONIterator& iterator, PP_FontWeight_Dev &value); +const string ToString_PP_FontDescription_Dev(const PP_FontDescription_Dev *v); +const string ToString_PP_FontDescription_Dev(const PP_FontDescription_Dev &v); +void FromJSON_PP_FontDescription_Dev(JSONIterator& iterator, PP_FontDescription_Dev &value); +const string ToString_PP_FontMetrics_Dev(const PP_FontMetrics_Dev *v); +const string ToString_PP_FontMetrics_Dev(const PP_FontMetrics_Dev &v); +void FromJSON_PP_FontMetrics_Dev(JSONIterator& iterator, PP_FontMetrics_Dev &value); +const string ToString_PP_TextRun_Dev(const PP_TextRun_Dev *v); +const string ToString_PP_TextRun_Dev(const PP_TextRun_Dev &v); +void FromJSON_PP_TextRun_Dev(JSONIterator& iterator, PP_TextRun_Dev &value); +#ifdef INTERPOSE +static PPB_Font_Dev_0_6 *_real_PPB_Font_Dev_0_6; +#endif // INTERPOSE +const string ToString_PPB_Font_Dev(const PPB_Font_Dev_0_6 *v); +#ifdef INTERPOSE +static PPB_IMEInputEvent_Dev_0_1 *_real_PPB_IMEInputEvent_Dev_0_1; +#endif // INTERPOSE +const string ToString_PPB_IMEInputEvent_Dev(const PPB_IMEInputEvent_Dev_0_1 *v); +#ifdef INTERPOSE +static PPB_IMEInputEvent_Dev_0_2 *_real_PPB_IMEInputEvent_Dev_0_2; +#endif // INTERPOSE +const string ToString_PPB_IMEInputEvent_Dev(const PPB_IMEInputEvent_Dev_0_2 *v); +#ifdef INTERPOSE +static PPB_Memory_Dev_0_1 *_real_PPB_Memory_Dev_0_1; +#endif // INTERPOSE +const string ToString_PPB_Memory_Dev(const PPB_Memory_Dev_0_1 *v); +#ifdef INTERPOSE +static PPB_OpenGLES2DrawBuffers_Dev_1_0 *_real_PPB_OpenGLES2DrawBuffers_Dev_1_0; +#endif // INTERPOSE +const string ToString_PPB_OpenGLES2DrawBuffers_Dev(const PPB_OpenGLES2DrawBuffers_Dev_1_0 *v); +#ifdef INTERPOSE +static PPB_Printing_Dev_0_7 *_real_PPB_Printing_Dev_0_7; +#endif // INTERPOSE +const string ToString_PPB_Printing_Dev(const PPB_Printing_Dev_0_7 *v); +const string ToString_PP_TextInput_Type_Dev(const PP_TextInput_Type_Dev *v); +const string ToString_PP_TextInput_Type_Dev(const PP_TextInput_Type_Dev &v); +void FromJSON_PP_TextInput_Type_Dev(JSONIterator& iterator, PP_TextInput_Type_Dev &value); +#ifdef INTERPOSE +static PPB_TextInput_Dev_0_1 *_real_PPB_TextInput_Dev_0_1; +#endif // INTERPOSE +const string ToString_PPB_TextInput_Dev(const PPB_TextInput_Dev_0_1 *v); +#ifdef INTERPOSE +static PPB_TextInput_Dev_0_2 *_real_PPB_TextInput_Dev_0_2; +#endif // INTERPOSE +const string ToString_PPB_TextInput_Dev(const PPB_TextInput_Dev_0_2 *v); +const string ToString_PP_TraceEventTime(const PP_TraceEventTime *v); +const string ToString_PP_TraceEventTime(const PP_TraceEventTime &v); +void FromJSON_PP_TraceEventTime(JSONIterator& iterator, PP_TraceEventTime &value); +#ifdef INTERPOSE +static PPB_Trace_Event_Dev_0_1 *_real_PPB_Trace_Event_Dev_0_1; +#endif // INTERPOSE +const string ToString_PPB_Trace_Event_Dev(const PPB_Trace_Event_Dev_0_1 *v); +#ifdef INTERPOSE +static PPB_Trace_Event_Dev_0_2 *_real_PPB_Trace_Event_Dev_0_2; +#endif // INTERPOSE +const string ToString_PPB_Trace_Event_Dev(const PPB_Trace_Event_Dev_0_2 *v); +const string ToString_PP_TrueTypeFontFamily_Dev(const PP_TrueTypeFontFamily_Dev *v); +const string ToString_PP_TrueTypeFontFamily_Dev(const PP_TrueTypeFontFamily_Dev &v); +void FromJSON_PP_TrueTypeFontFamily_Dev(JSONIterator& iterator, PP_TrueTypeFontFamily_Dev &value); +const string ToString_PP_TrueTypeFontStyle_Dev(const PP_TrueTypeFontStyle_Dev *v); +const string ToString_PP_TrueTypeFontStyle_Dev(const PP_TrueTypeFontStyle_Dev &v); +void FromJSON_PP_TrueTypeFontStyle_Dev(JSONIterator& iterator, PP_TrueTypeFontStyle_Dev &value); +const string ToString_PP_TrueTypeFontWeight_Dev(const PP_TrueTypeFontWeight_Dev *v); +const string ToString_PP_TrueTypeFontWeight_Dev(const PP_TrueTypeFontWeight_Dev &v); +void FromJSON_PP_TrueTypeFontWeight_Dev(JSONIterator& iterator, PP_TrueTypeFontWeight_Dev &value); +const string ToString_PP_TrueTypeFontWidth_Dev(const PP_TrueTypeFontWidth_Dev *v); +const string ToString_PP_TrueTypeFontWidth_Dev(const PP_TrueTypeFontWidth_Dev &v); +void FromJSON_PP_TrueTypeFontWidth_Dev(JSONIterator& iterator, PP_TrueTypeFontWidth_Dev &value); +const string ToString_PP_TrueTypeFontCharset_Dev(const PP_TrueTypeFontCharset_Dev *v); +const string ToString_PP_TrueTypeFontCharset_Dev(const PP_TrueTypeFontCharset_Dev &v); +void FromJSON_PP_TrueTypeFontCharset_Dev(JSONIterator& iterator, PP_TrueTypeFontCharset_Dev &value); +const string ToString_PP_TrueTypeFontDesc_Dev(const PP_TrueTypeFontDesc_Dev *v); +const string ToString_PP_TrueTypeFontDesc_Dev(const PP_TrueTypeFontDesc_Dev &v); +void FromJSON_PP_TrueTypeFontDesc_Dev(JSONIterator& iterator, PP_TrueTypeFontDesc_Dev &value); +#ifdef INTERPOSE +static PPB_TrueTypeFont_Dev_0_1 *_real_PPB_TrueTypeFont_Dev_0_1; +#endif // INTERPOSE +const string ToString_PPB_TrueTypeFont_Dev(const PPB_TrueTypeFont_Dev_0_1 *v); +const string ToString_PP_URLComponent_Dev(const PP_URLComponent_Dev *v); +const string ToString_PP_URLComponent_Dev(const PP_URLComponent_Dev &v); +void FromJSON_PP_URLComponent_Dev(JSONIterator& iterator, PP_URLComponent_Dev &value); +const string ToString_PP_URLComponents_Dev(const PP_URLComponents_Dev *v); +const string ToString_PP_URLComponents_Dev(const PP_URLComponents_Dev &v); +void FromJSON_PP_URLComponents_Dev(JSONIterator& iterator, PP_URLComponents_Dev &value); +#ifdef INTERPOSE +static PPB_URLUtil_Dev_0_6 *_real_PPB_URLUtil_Dev_0_6; +#endif // INTERPOSE +const string ToString_PPB_URLUtil_Dev(const PPB_URLUtil_Dev_0_6 *v); +#ifdef INTERPOSE +static PPB_URLUtil_Dev_0_7 *_real_PPB_URLUtil_Dev_0_7; +#endif // INTERPOSE +const string ToString_PPB_URLUtil_Dev(const PPB_URLUtil_Dev_0_7 *v); +#ifdef INTERPOSE +static PPB_Var_Deprecated_0_3 *_real_PPB_Var_Deprecated_0_3; +#endif // INTERPOSE +const string ToString_PPB_Var_Deprecated(const PPB_Var_Deprecated_0_3 *v); +#ifdef INTERPOSE +static PPB_VideoCapture_Dev_0_3 *_real_PPB_VideoCapture_Dev_0_3; +#endif // INTERPOSE +const string ToString_PPB_VideoCapture_Dev(const PPB_VideoCapture_Dev_0_3 *v); +#ifdef INTERPOSE +static PPB_VideoDecoder_Dev_0_16 *_real_PPB_VideoDecoder_Dev_0_16; +#endif // INTERPOSE +const string ToString_PPB_VideoDecoder_Dev(const PPB_VideoDecoder_Dev_0_16 *v); +#ifdef INTERPOSE +static PPB_View_Dev_0_1 *_real_PPB_View_Dev_0_1; +#endif // INTERPOSE +const string ToString_PPB_View_Dev(const PPB_View_Dev_0_1 *v); +#ifdef INTERPOSE +static PPP_Class_Deprecated_1_0 *_real_PPP_Class_Deprecated_1_0; +#endif // INTERPOSE +static char* Call_PPP_Class_Deprecated(void* _interface, JSONIterator& iterator); +#ifdef INTERPOSE +static PPP_NetworkState_Dev_0_1 *_real_PPP_NetworkState_Dev_0_1; +#endif // INTERPOSE +static char* Call_PPP_NetworkState_Dev(void* _interface, JSONIterator& iterator); +const string ToString_PP_PrintPageNumberRange_Dev(const PP_PrintPageNumberRange_Dev *v); +const string ToString_PP_PrintPageNumberRange_Dev(const PP_PrintPageNumberRange_Dev &v); +void FromJSON_PP_PrintPageNumberRange_Dev(JSONIterator& iterator, PP_PrintPageNumberRange_Dev &value); +#ifdef INTERPOSE +static PPP_Printing_Dev_0_6 *_real_PPP_Printing_Dev_0_6; +#endif // INTERPOSE +static char* Call_PPP_Printing_Dev(void* _interface, JSONIterator& iterator); +#ifdef INTERPOSE +static PPP_TextInput_Dev_0_1 *_real_PPP_TextInput_Dev_0_1; +#endif // INTERPOSE +static char* Call_PPP_TextInput_Dev(void* _interface, JSONIterator& iterator); +#ifdef INTERPOSE +static PPP_VideoCapture_Dev_0_1 *_real_PPP_VideoCapture_Dev_0_1; +#endif // INTERPOSE +static char* Call_PPP_VideoCapture_Dev(void* _interface, JSONIterator& iterator); +#ifdef INTERPOSE +static PPP_VideoDecoder_Dev_0_11 *_real_PPP_VideoDecoder_Dev_0_11; +#endif // INTERPOSE +static char* Call_PPP_VideoDecoder_Dev(void* _interface, JSONIterator& iterator); +const string ToString_PP_DecryptTrackingInfo(const PP_DecryptTrackingInfo *v); +const string ToString_PP_DecryptTrackingInfo(const PP_DecryptTrackingInfo &v); +void FromJSON_PP_DecryptTrackingInfo(JSONIterator& iterator, PP_DecryptTrackingInfo &value); +const string ToString_PP_DecryptSubsampleDescription(const PP_DecryptSubsampleDescription *v); +const string ToString_PP_DecryptSubsampleDescription(const PP_DecryptSubsampleDescription &v); +void FromJSON_PP_DecryptSubsampleDescription(JSONIterator& iterator, PP_DecryptSubsampleDescription &value); +const string ToString_PP_EncryptedBlockInfo(const PP_EncryptedBlockInfo *v); +const string ToString_PP_EncryptedBlockInfo(const PP_EncryptedBlockInfo &v); +void FromJSON_PP_EncryptedBlockInfo(JSONIterator& iterator, PP_EncryptedBlockInfo &value); +const string ToString_PP_DecryptedFrameFormat(const PP_DecryptedFrameFormat *v); +const string ToString_PP_DecryptedFrameFormat(const PP_DecryptedFrameFormat &v); +void FromJSON_PP_DecryptedFrameFormat(JSONIterator& iterator, PP_DecryptedFrameFormat &value); +const string ToString_PP_DecryptedSampleFormat(const PP_DecryptedSampleFormat *v); +const string ToString_PP_DecryptedSampleFormat(const PP_DecryptedSampleFormat &v); +void FromJSON_PP_DecryptedSampleFormat(JSONIterator& iterator, PP_DecryptedSampleFormat &value); +const string ToString_PP_DecryptResult(const PP_DecryptResult *v); +const string ToString_PP_DecryptResult(const PP_DecryptResult &v); +void FromJSON_PP_DecryptResult(JSONIterator& iterator, PP_DecryptResult &value); +const string ToString_PP_DecryptedBlockInfo(const PP_DecryptedBlockInfo *v); +const string ToString_PP_DecryptedBlockInfo(const PP_DecryptedBlockInfo &v); +void FromJSON_PP_DecryptedBlockInfo(JSONIterator& iterator, PP_DecryptedBlockInfo &value); +const string ToString_PP_DecryptedFramePlanes(const PP_DecryptedFramePlanes *v); +const string ToString_PP_DecryptedFramePlanes(const PP_DecryptedFramePlanes &v); +void FromJSON_PP_DecryptedFramePlanes(JSONIterator& iterator, PP_DecryptedFramePlanes &value); +const string ToString_PP_DecryptedFrameInfo(const PP_DecryptedFrameInfo *v); +const string ToString_PP_DecryptedFrameInfo(const PP_DecryptedFrameInfo &v); +void FromJSON_PP_DecryptedFrameInfo(JSONIterator& iterator, PP_DecryptedFrameInfo &value); +const string ToString_PP_DecryptedSampleInfo(const PP_DecryptedSampleInfo *v); +const string ToString_PP_DecryptedSampleInfo(const PP_DecryptedSampleInfo &v); +void FromJSON_PP_DecryptedSampleInfo(JSONIterator& iterator, PP_DecryptedSampleInfo &value); +const string ToString_PP_AudioCodec(const PP_AudioCodec *v); +const string ToString_PP_AudioCodec(const PP_AudioCodec &v); +void FromJSON_PP_AudioCodec(JSONIterator& iterator, PP_AudioCodec &value); +const string ToString_PP_AudioDecoderConfig(const PP_AudioDecoderConfig *v); +const string ToString_PP_AudioDecoderConfig(const PP_AudioDecoderConfig &v); +void FromJSON_PP_AudioDecoderConfig(JSONIterator& iterator, PP_AudioDecoderConfig &value); +const string ToString_PP_VideoCodec(const PP_VideoCodec *v); +const string ToString_PP_VideoCodec(const PP_VideoCodec &v); +void FromJSON_PP_VideoCodec(JSONIterator& iterator, PP_VideoCodec &value); +const string ToString_PP_VideoCodecProfile(const PP_VideoCodecProfile *v); +const string ToString_PP_VideoCodecProfile(const PP_VideoCodecProfile &v); +void FromJSON_PP_VideoCodecProfile(JSONIterator& iterator, PP_VideoCodecProfile &value); +const string ToString_PP_VideoDecoderConfig(const PP_VideoDecoderConfig *v); +const string ToString_PP_VideoDecoderConfig(const PP_VideoDecoderConfig &v); +void FromJSON_PP_VideoDecoderConfig(JSONIterator& iterator, PP_VideoDecoderConfig &value); +const string ToString_PP_DecryptorStreamType(const PP_DecryptorStreamType *v); +const string ToString_PP_DecryptorStreamType(const PP_DecryptorStreamType &v); +void FromJSON_PP_DecryptorStreamType(JSONIterator& iterator, PP_DecryptorStreamType &value); +const string ToString_PP_SessionType(const PP_SessionType *v); +const string ToString_PP_SessionType(const PP_SessionType &v); +void FromJSON_PP_SessionType(JSONIterator& iterator, PP_SessionType &value); +const string ToString_PP_InitDataType(const PP_InitDataType *v); +const string ToString_PP_InitDataType(const PP_InitDataType &v); +void FromJSON_PP_InitDataType(JSONIterator& iterator, PP_InitDataType &value); +const string ToString_PP_CdmExceptionCode(const PP_CdmExceptionCode *v); +const string ToString_PP_CdmExceptionCode(const PP_CdmExceptionCode &v); +void FromJSON_PP_CdmExceptionCode(JSONIterator& iterator, PP_CdmExceptionCode &value); +const string ToString_PP_CdmMessageType(const PP_CdmMessageType *v); +const string ToString_PP_CdmMessageType(const PP_CdmMessageType &v); +void FromJSON_PP_CdmMessageType(JSONIterator& iterator, PP_CdmMessageType &value); +const string ToString_PP_CdmKeyStatus(const PP_CdmKeyStatus *v); +const string ToString_PP_CdmKeyStatus(const PP_CdmKeyStatus &v); +void FromJSON_PP_CdmKeyStatus(JSONIterator& iterator, PP_CdmKeyStatus &value); +const string ToString_PP_KeyInformation(const PP_KeyInformation *v); +const string ToString_PP_KeyInformation(const PP_KeyInformation &v); +void FromJSON_PP_KeyInformation(JSONIterator& iterator, PP_KeyInformation &value); +const string ToString_PP_PrivateFontCharset(const PP_PrivateFontCharset *v); +const string ToString_PP_PrivateFontCharset(const PP_PrivateFontCharset &v); +void FromJSON_PP_PrivateFontCharset(JSONIterator& iterator, PP_PrivateFontCharset &value); +const string ToString_PP_VideoCaptureFormat(const PP_VideoCaptureFormat *v); +const string ToString_PP_VideoCaptureFormat(const PP_VideoCaptureFormat &v); +void FromJSON_PP_VideoCaptureFormat(JSONIterator& iterator, PP_VideoCaptureFormat &value); +const string ToString_PP_VideoFrame_Private(const PP_VideoFrame_Private *v); +const string ToString_PP_VideoFrame_Private(const PP_VideoFrame_Private &v); +void FromJSON_PP_VideoFrame_Private(JSONIterator& iterator, PP_VideoFrame_Private &value); +#ifdef INTERPOSE +static PPB_CameraCapabilities_Private_0_1 *_real_PPB_CameraCapabilities_Private_0_1; +#endif // INTERPOSE +const string ToString_PPB_CameraCapabilities_Private(const PPB_CameraCapabilities_Private_0_1 *v); +#ifdef INTERPOSE +static PPB_CameraDevice_Private_0_1 *_real_PPB_CameraDevice_Private_0_1; +#endif // INTERPOSE +const string ToString_PPB_CameraDevice_Private(const PPB_CameraDevice_Private_0_1 *v); +#ifdef INTERPOSE +static PPB_ContentDecryptor_Private_0_14 *_real_PPB_ContentDecryptor_Private_0_14; +#endif // INTERPOSE +const string ToString_PPB_ContentDecryptor_Private(const PPB_ContentDecryptor_Private_0_14 *v); +#ifdef INTERPOSE +static PPB_DisplayColorProfile_Private_0_1 *_real_PPB_DisplayColorProfile_Private_0_1; +#endif // INTERPOSE +const string ToString_PPB_DisplayColorProfile_Private(const PPB_DisplayColorProfile_Private_0_1 *v); +#ifdef INTERPOSE +static PPB_Ext_CrxFileSystem_Private_0_1 *_real_PPB_Ext_CrxFileSystem_Private_0_1; +#endif // INTERPOSE +const string ToString_PPB_Ext_CrxFileSystem_Private(const PPB_Ext_CrxFileSystem_Private_0_1 *v); +#ifdef INTERPOSE +static PPB_FileIO_Private_0_1 *_real_PPB_FileIO_Private_0_1; +#endif // INTERPOSE +const string ToString_PPB_FileIO_Private(const PPB_FileIO_Private_0_1 *v); +#ifdef INTERPOSE +static PPB_FileRefPrivate_0_1 *_real_PPB_FileRefPrivate_0_1; +#endif // INTERPOSE +const string ToString_PPB_FileRefPrivate(const PPB_FileRefPrivate_0_1 *v); +#ifdef INTERPOSE +static PPB_Find_Private_0_3 *_real_PPB_Find_Private_0_3; +#endif // INTERPOSE +const string ToString_PPB_Find_Private(const PPB_Find_Private_0_3 *v); +const string ToString_PP_FlashLSORestrictions(const PP_FlashLSORestrictions *v); +const string ToString_PP_FlashLSORestrictions(const PP_FlashLSORestrictions &v); +void FromJSON_PP_FlashLSORestrictions(JSONIterator& iterator, PP_FlashLSORestrictions &value); +const string ToString_PP_FlashSetting(const PP_FlashSetting *v); +const string ToString_PP_FlashSetting(const PP_FlashSetting &v); +void FromJSON_PP_FlashSetting(JSONIterator& iterator, PP_FlashSetting &value); +const string ToString_PP_FlashCrashKey(const PP_FlashCrashKey *v); +const string ToString_PP_FlashCrashKey(const PP_FlashCrashKey &v); +void FromJSON_PP_FlashCrashKey(JSONIterator& iterator, PP_FlashCrashKey &value); +#ifdef INTERPOSE +static PPB_Flash_12_4 *_real_PPB_Flash_12_4; +#endif // INTERPOSE +const string ToString_PPB_Flash(const PPB_Flash_12_4 *v); +#ifdef INTERPOSE +static PPB_Flash_12_5 *_real_PPB_Flash_12_5; +#endif // INTERPOSE +const string ToString_PPB_Flash(const PPB_Flash_12_5 *v); +#ifdef INTERPOSE +static PPB_Flash_12_6 *_real_PPB_Flash_12_6; +#endif // INTERPOSE +const string ToString_PPB_Flash(const PPB_Flash_12_6 *v); +#ifdef INTERPOSE +static PPB_Flash_13_0 *_real_PPB_Flash_13_0; +#endif // INTERPOSE +const string ToString_PPB_Flash(const PPB_Flash_13_0 *v); +const string ToString_PP_Flash_Clipboard_Type(const PP_Flash_Clipboard_Type *v); +const string ToString_PP_Flash_Clipboard_Type(const PP_Flash_Clipboard_Type &v); +void FromJSON_PP_Flash_Clipboard_Type(JSONIterator& iterator, PP_Flash_Clipboard_Type &value); +const string ToString_PP_Flash_Clipboard_Format(const PP_Flash_Clipboard_Format *v); +const string ToString_PP_Flash_Clipboard_Format(const PP_Flash_Clipboard_Format &v); +void FromJSON_PP_Flash_Clipboard_Format(JSONIterator& iterator, PP_Flash_Clipboard_Format &value); +#ifdef INTERPOSE +static PPB_Flash_Clipboard_4_0 *_real_PPB_Flash_Clipboard_4_0; +#endif // INTERPOSE +const string ToString_PPB_Flash_Clipboard(const PPB_Flash_Clipboard_4_0 *v); +#ifdef INTERPOSE +static PPB_Flash_Clipboard_5_0 *_real_PPB_Flash_Clipboard_5_0; +#endif // INTERPOSE +const string ToString_PPB_Flash_Clipboard(const PPB_Flash_Clipboard_5_0 *v); +#ifdef INTERPOSE +static PPB_Flash_Clipboard_5_1 *_real_PPB_Flash_Clipboard_5_1; +#endif // INTERPOSE +const string ToString_PPB_Flash_Clipboard(const PPB_Flash_Clipboard_5_1 *v); +#ifdef INTERPOSE +static PPB_Flash_DeviceID_1_0 *_real_PPB_Flash_DeviceID_1_0; +#endif // INTERPOSE +const string ToString_PPB_Flash_DeviceID(const PPB_Flash_DeviceID_1_0 *v); +#ifdef INTERPOSE +static PPB_Flash_DRM_1_0 *_real_PPB_Flash_DRM_1_0; +#endif // INTERPOSE +const string ToString_PPB_Flash_DRM(const PPB_Flash_DRM_1_0 *v); +#ifdef INTERPOSE +static PPB_Flash_DRM_1_1 *_real_PPB_Flash_DRM_1_1; +#endif // INTERPOSE +const string ToString_PPB_Flash_DRM(const PPB_Flash_DRM_1_1 *v); +const string ToString_PP_DirEntry_Dev(const PP_DirEntry_Dev *v); +const string ToString_PP_DirEntry_Dev(const PP_DirEntry_Dev &v); +void FromJSON_PP_DirEntry_Dev(JSONIterator& iterator, PP_DirEntry_Dev &value); +const string ToString_PP_DirContents_Dev(const PP_DirContents_Dev *v); +const string ToString_PP_DirContents_Dev(const PP_DirContents_Dev &v); +void FromJSON_PP_DirContents_Dev(JSONIterator& iterator, PP_DirContents_Dev &value); +#ifdef INTERPOSE +static PPB_Flash_File_ModuleLocal_3_0 *_real_PPB_Flash_File_ModuleLocal_3_0; +#endif // INTERPOSE +const string ToString_PPB_Flash_File_ModuleLocal(const PPB_Flash_File_ModuleLocal_3_0 *v); +#ifdef INTERPOSE +static PPB_Flash_File_FileRef_2_0 *_real_PPB_Flash_File_FileRef_2_0; +#endif // INTERPOSE +const string ToString_PPB_Flash_File_FileRef(const PPB_Flash_File_FileRef_2_0 *v); +#ifdef INTERPOSE +static PPB_Flash_FontFile_0_1 *_real_PPB_Flash_FontFile_0_1; +#endif // INTERPOSE +const string ToString_PPB_Flash_FontFile(const PPB_Flash_FontFile_0_1 *v); +#ifdef INTERPOSE +static PPB_Flash_FontFile_0_2 *_real_PPB_Flash_FontFile_0_2; +#endif // INTERPOSE +const string ToString_PPB_Flash_FontFile(const PPB_Flash_FontFile_0_2 *v); +#ifdef INTERPOSE +static PPB_FlashFullscreen_0_1 *_real_PPB_FlashFullscreen_0_1; +#endif // INTERPOSE +const string ToString_PPB_FlashFullscreen(const PPB_FlashFullscreen_0_1 *v); +#ifdef INTERPOSE +static PPB_FlashFullscreen_1_0 *_real_PPB_FlashFullscreen_1_0; +#endif // INTERPOSE +const string ToString_PPB_FlashFullscreen(const PPB_FlashFullscreen_1_0 *v); +const string ToString_PP_Flash_MenuItem_Type(const PP_Flash_MenuItem_Type *v); +const string ToString_PP_Flash_MenuItem_Type(const PP_Flash_MenuItem_Type &v); +void FromJSON_PP_Flash_MenuItem_Type(JSONIterator& iterator, PP_Flash_MenuItem_Type &value); +const string ToString_PP_Flash_MenuItem(const PP_Flash_MenuItem *v); +const string ToString_PP_Flash_MenuItem(const PP_Flash_MenuItem &v); +void FromJSON_PP_Flash_MenuItem(JSONIterator& iterator, PP_Flash_MenuItem &value); +const string ToString_PP_Flash_Menu(const PP_Flash_Menu *v); +const string ToString_PP_Flash_Menu(const PP_Flash_Menu &v); +void FromJSON_PP_Flash_Menu(JSONIterator& iterator, PP_Flash_Menu &value); +#ifdef INTERPOSE +static PPB_Flash_Menu_0_2 *_real_PPB_Flash_Menu_0_2; +#endif // INTERPOSE +const string ToString_PPB_Flash_Menu(const PPB_Flash_Menu_0_2 *v); +#ifdef INTERPOSE +static PPB_Flash_MessageLoop_0_1 *_real_PPB_Flash_MessageLoop_0_1; +#endif // INTERPOSE +const string ToString_PPB_Flash_MessageLoop(const PPB_Flash_MessageLoop_0_1 *v); +#ifdef INTERPOSE +static PPB_Flash_Print_1_0 *_real_PPB_Flash_Print_1_0; +#endif // INTERPOSE +const string ToString_PPB_Flash_Print(const PPB_Flash_Print_1_0 *v); +const string ToString_PP_HostResolver_Private_Flags(const PP_HostResolver_Private_Flags *v); +const string ToString_PP_HostResolver_Private_Flags(const PP_HostResolver_Private_Flags &v); +void FromJSON_PP_HostResolver_Private_Flags(JSONIterator& iterator, PP_HostResolver_Private_Flags &value); +const string ToString_PP_HostResolver_Private_Hint(const PP_HostResolver_Private_Hint *v); +const string ToString_PP_HostResolver_Private_Hint(const PP_HostResolver_Private_Hint &v); +void FromJSON_PP_HostResolver_Private_Hint(JSONIterator& iterator, PP_HostResolver_Private_Hint &value); +#ifdef INTERPOSE +static PPB_HostResolver_Private_0_1 *_real_PPB_HostResolver_Private_0_1; +#endif // INTERPOSE +const string ToString_PPB_HostResolver_Private(const PPB_HostResolver_Private_0_1 *v); +const string ToString_PP_ExternalPluginResult(const PP_ExternalPluginResult *v); +const string ToString_PP_ExternalPluginResult(const PP_ExternalPluginResult &v); +void FromJSON_PP_ExternalPluginResult(JSONIterator& iterator, PP_ExternalPluginResult &value); +#ifdef INTERPOSE +static PPB_Instance_Private_0_1 *_real_PPB_Instance_Private_0_1; +#endif // INTERPOSE +const string ToString_PPB_Instance_Private(const PPB_Instance_Private_0_1 *v); +const string ToString_PP_IsolatedFileSystemType_Private(const PP_IsolatedFileSystemType_Private *v); +const string ToString_PP_IsolatedFileSystemType_Private(const PP_IsolatedFileSystemType_Private &v); +void FromJSON_PP_IsolatedFileSystemType_Private(JSONIterator& iterator, PP_IsolatedFileSystemType_Private &value); +#ifdef INTERPOSE +static PPB_IsolatedFileSystem_Private_0_2 *_real_PPB_IsolatedFileSystem_Private_0_2; +#endif // INTERPOSE +const string ToString_PPB_IsolatedFileSystem_Private(const PPB_IsolatedFileSystem_Private_0_2 *v); +const string ToString_PP_NetAddressFamily_Private(const PP_NetAddressFamily_Private *v); +const string ToString_PP_NetAddressFamily_Private(const PP_NetAddressFamily_Private &v); +void FromJSON_PP_NetAddressFamily_Private(JSONIterator& iterator, PP_NetAddressFamily_Private &value); +const string ToString_PP_NetAddress_Private(const PP_NetAddress_Private *v); +const string ToString_PP_NetAddress_Private(const PP_NetAddress_Private &v); +void FromJSON_PP_NetAddress_Private(JSONIterator& iterator, PP_NetAddress_Private &value); +#ifdef INTERPOSE +static PPB_NetAddress_Private_0_1 *_real_PPB_NetAddress_Private_0_1; +#endif // INTERPOSE +const string ToString_PPB_NetAddress_Private(const PPB_NetAddress_Private_0_1 *v); +#ifdef INTERPOSE +static PPB_NetAddress_Private_1_0 *_real_PPB_NetAddress_Private_1_0; +#endif // INTERPOSE +const string ToString_PPB_NetAddress_Private(const PPB_NetAddress_Private_1_0 *v); +#ifdef INTERPOSE +static PPB_NetAddress_Private_1_1 *_real_PPB_NetAddress_Private_1_1; +#endif // INTERPOSE +const string ToString_PPB_NetAddress_Private(const PPB_NetAddress_Private_1_1 *v); +const string ToString_PP_OutputProtectionMethod_Private(const PP_OutputProtectionMethod_Private *v); +const string ToString_PP_OutputProtectionMethod_Private(const PP_OutputProtectionMethod_Private &v); +void FromJSON_PP_OutputProtectionMethod_Private(JSONIterator& iterator, PP_OutputProtectionMethod_Private &value); +const string ToString_PP_OutputProtectionLinkType_Private(const PP_OutputProtectionLinkType_Private *v); +const string ToString_PP_OutputProtectionLinkType_Private(const PP_OutputProtectionLinkType_Private &v); +void FromJSON_PP_OutputProtectionLinkType_Private(JSONIterator& iterator, PP_OutputProtectionLinkType_Private &value); +#ifdef INTERPOSE +static PPB_OutputProtection_Private_0_1 *_real_PPB_OutputProtection_Private_0_1; +#endif // INTERPOSE +const string ToString_PPB_OutputProtection_Private(const PPB_OutputProtection_Private_0_1 *v); +const string ToString_PP_PDFFeature(const PP_PDFFeature *v); +const string ToString_PP_PDFFeature(const PP_PDFFeature &v); +void FromJSON_PP_PDFFeature(JSONIterator& iterator, PP_PDFFeature &value); +const string ToString_PP_PrivateFontFileDescription(const PP_PrivateFontFileDescription *v); +const string ToString_PP_PrivateFontFileDescription(const PP_PrivateFontFileDescription &v); +void FromJSON_PP_PrivateFontFileDescription(JSONIterator& iterator, PP_PrivateFontFileDescription &value); +const string ToString_PP_PrivateFindResult(const PP_PrivateFindResult *v); +const string ToString_PP_PrivateFindResult(const PP_PrivateFindResult &v); +void FromJSON_PP_PrivateFindResult(JSONIterator& iterator, PP_PrivateFindResult &value); +const string ToString_PP_PrivateAccessibilityViewportInfo(const PP_PrivateAccessibilityViewportInfo *v); +const string ToString_PP_PrivateAccessibilityViewportInfo(const PP_PrivateAccessibilityViewportInfo &v); +void FromJSON_PP_PrivateAccessibilityViewportInfo(JSONIterator& iterator, PP_PrivateAccessibilityViewportInfo &value); +const string ToString_PP_PrivateAccessibilityDocInfo(const PP_PrivateAccessibilityDocInfo *v); +const string ToString_PP_PrivateAccessibilityDocInfo(const PP_PrivateAccessibilityDocInfo &v); +void FromJSON_PP_PrivateAccessibilityDocInfo(JSONIterator& iterator, PP_PrivateAccessibilityDocInfo &value); +const string ToString_PP_PrivateDirection(const PP_PrivateDirection *v); +const string ToString_PP_PrivateDirection(const PP_PrivateDirection &v); +void FromJSON_PP_PrivateDirection(JSONIterator& iterator, PP_PrivateDirection &value); +const string ToString_PP_PrivateAccessibilityPageInfo(const PP_PrivateAccessibilityPageInfo *v); +const string ToString_PP_PrivateAccessibilityPageInfo(const PP_PrivateAccessibilityPageInfo &v); +void FromJSON_PP_PrivateAccessibilityPageInfo(JSONIterator& iterator, PP_PrivateAccessibilityPageInfo &value); +const string ToString_PP_PrivateAccessibilityTextRunInfo(const PP_PrivateAccessibilityTextRunInfo *v); +const string ToString_PP_PrivateAccessibilityTextRunInfo(const PP_PrivateAccessibilityTextRunInfo &v); +void FromJSON_PP_PrivateAccessibilityTextRunInfo(JSONIterator& iterator, PP_PrivateAccessibilityTextRunInfo &value); +const string ToString_PP_PrivateAccessibilityCharInfo(const PP_PrivateAccessibilityCharInfo *v); +const string ToString_PP_PrivateAccessibilityCharInfo(const PP_PrivateAccessibilityCharInfo &v); +void FromJSON_PP_PrivateAccessibilityCharInfo(JSONIterator& iterator, PP_PrivateAccessibilityCharInfo &value); +#ifdef INTERPOSE +static PPB_PDF_0_1 *_real_PPB_PDF_0_1; +#endif // INTERPOSE +const string ToString_PPB_PDF(const PPB_PDF_0_1 *v); +#ifdef INTERPOSE +static PPB_PlatformVerification_Private_0_2 *_real_PPB_PlatformVerification_Private_0_2; +#endif // INTERPOSE +const string ToString_PPB_PlatformVerification_Private(const PPB_PlatformVerification_Private_0_2 *v); +#ifdef INTERPOSE +static PPB_TCPServerSocket_Private_0_1 *_real_PPB_TCPServerSocket_Private_0_1; +#endif // INTERPOSE +const string ToString_PPB_TCPServerSocket_Private(const PPB_TCPServerSocket_Private_0_1 *v); +#ifdef INTERPOSE +static PPB_TCPServerSocket_Private_0_2 *_real_PPB_TCPServerSocket_Private_0_2; +#endif // INTERPOSE +const string ToString_PPB_TCPServerSocket_Private(const PPB_TCPServerSocket_Private_0_2 *v); +const string ToString_PP_TCPSocketOption_Private(const PP_TCPSocketOption_Private *v); +const string ToString_PP_TCPSocketOption_Private(const PP_TCPSocketOption_Private &v); +void FromJSON_PP_TCPSocketOption_Private(JSONIterator& iterator, PP_TCPSocketOption_Private &value); +#ifdef INTERPOSE +static PPB_TCPSocket_Private_0_3 *_real_PPB_TCPSocket_Private_0_3; +#endif // INTERPOSE +const string ToString_PPB_TCPSocket_Private(const PPB_TCPSocket_Private_0_3 *v); +#ifdef INTERPOSE +static PPB_TCPSocket_Private_0_4 *_real_PPB_TCPSocket_Private_0_4; +#endif // INTERPOSE +const string ToString_PPB_TCPSocket_Private(const PPB_TCPSocket_Private_0_4 *v); +#ifdef INTERPOSE +static PPB_TCPSocket_Private_0_5 *_real_PPB_TCPSocket_Private_0_5; +#endif // INTERPOSE +const string ToString_PPB_TCPSocket_Private(const PPB_TCPSocket_Private_0_5 *v); +#ifdef INTERPOSE +static PPB_Testing_Private_1_0 *_real_PPB_Testing_Private_1_0; +#endif // INTERPOSE +const string ToString_PPB_Testing_Private(const PPB_Testing_Private_1_0 *v); +const string ToString_PP_UDPSocketFeature_Private(const PP_UDPSocketFeature_Private *v); +const string ToString_PP_UDPSocketFeature_Private(const PP_UDPSocketFeature_Private &v); +void FromJSON_PP_UDPSocketFeature_Private(JSONIterator& iterator, PP_UDPSocketFeature_Private &value); +#ifdef INTERPOSE +static PPB_UDPSocket_Private_0_2 *_real_PPB_UDPSocket_Private_0_2; +#endif // INTERPOSE +const string ToString_PPB_UDPSocket_Private(const PPB_UDPSocket_Private_0_2 *v); +#ifdef INTERPOSE +static PPB_UDPSocket_Private_0_3 *_real_PPB_UDPSocket_Private_0_3; +#endif // INTERPOSE +const string ToString_PPB_UDPSocket_Private(const PPB_UDPSocket_Private_0_3 *v); +#ifdef INTERPOSE +static PPB_UDPSocket_Private_0_4 *_real_PPB_UDPSocket_Private_0_4; +#endif // INTERPOSE +const string ToString_PPB_UDPSocket_Private(const PPB_UDPSocket_Private_0_4 *v); +#ifdef INTERPOSE +static PPB_UMA_Private_0_3 *_real_PPB_UMA_Private_0_3; +#endif // INTERPOSE +const string ToString_PPB_UMA_Private(const PPB_UMA_Private_0_3 *v); +#ifdef INTERPOSE +static PPB_VideoDestination_Private_0_1 *_real_PPB_VideoDestination_Private_0_1; +#endif // INTERPOSE +const string ToString_PPB_VideoDestination_Private(const PPB_VideoDestination_Private_0_1 *v); +#ifdef INTERPOSE +static PPB_VideoSource_Private_0_1 *_real_PPB_VideoSource_Private_0_1; +#endif // INTERPOSE +const string ToString_PPB_VideoSource_Private(const PPB_VideoSource_Private_0_1 *v); +const string ToString_PP_X509Certificate_Private_Field(const PP_X509Certificate_Private_Field *v); +const string ToString_PP_X509Certificate_Private_Field(const PP_X509Certificate_Private_Field &v); +void FromJSON_PP_X509Certificate_Private_Field(JSONIterator& iterator, PP_X509Certificate_Private_Field &value); +const string ToString_PPB_X509Certificate_Private_Version(const PPB_X509Certificate_Private_Version *v); +const string ToString_PPB_X509Certificate_Private_Version(const PPB_X509Certificate_Private_Version &v); +void FromJSON_PPB_X509Certificate_Private_Version(JSONIterator& iterator, PPB_X509Certificate_Private_Version &value); +#ifdef INTERPOSE +static PPB_X509Certificate_Private_0_1 *_real_PPB_X509Certificate_Private_0_1; +#endif // INTERPOSE +const string ToString_PPB_X509Certificate_Private(const PPB_X509Certificate_Private_0_1 *v); +#ifdef INTERPOSE +static PPP_ContentDecryptor_Private_0_16 *_real_PPP_ContentDecryptor_Private_0_16; +#endif // INTERPOSE +static char* Call_PPP_ContentDecryptor_Private(void* _interface, JSONIterator& iterator); +#ifdef INTERPOSE +static PPP_Find_Private_0_3 *_real_PPP_Find_Private_0_3; +#endif // INTERPOSE +static char* Call_PPP_Find_Private(void* _interface, JSONIterator& iterator); +const string ToString_PP_Flash_BrowserOperations_SettingType(const PP_Flash_BrowserOperations_SettingType *v); +const string ToString_PP_Flash_BrowserOperations_SettingType(const PP_Flash_BrowserOperations_SettingType &v); +void FromJSON_PP_Flash_BrowserOperations_SettingType(JSONIterator& iterator, PP_Flash_BrowserOperations_SettingType &value); +const string ToString_PP_Flash_BrowserOperations_Permission(const PP_Flash_BrowserOperations_Permission *v); +const string ToString_PP_Flash_BrowserOperations_Permission(const PP_Flash_BrowserOperations_Permission &v); +void FromJSON_PP_Flash_BrowserOperations_Permission(JSONIterator& iterator, PP_Flash_BrowserOperations_Permission &value); +const string ToString_PP_Flash_BrowserOperations_SiteSetting(const PP_Flash_BrowserOperations_SiteSetting *v); +const string ToString_PP_Flash_BrowserOperations_SiteSetting(const PP_Flash_BrowserOperations_SiteSetting &v); +void FromJSON_PP_Flash_BrowserOperations_SiteSetting(JSONIterator& iterator, PP_Flash_BrowserOperations_SiteSetting &value); +const string ToString_PPB_Flash_BrowserOperations_GetSettingsCallback(const PPB_Flash_BrowserOperations_GetSettingsCallback &v); +void FromJSON_PPB_Flash_BrowserOperations_GetSettingsCallback(JSONIterator& iterator, PPB_Flash_BrowserOperations_GetSettingsCallback &value); +#ifdef INTERPOSE +static PPP_Flash_BrowserOperations_1_0 *_real_PPP_Flash_BrowserOperations_1_0; +#endif // INTERPOSE +static char* Call_PPP_Flash_BrowserOperations_1_0(void* _interface, JSONIterator& iterator); +#ifdef INTERPOSE +static PPP_Flash_BrowserOperations_1_2 *_real_PPP_Flash_BrowserOperations_1_2; +#endif // INTERPOSE +static char* Call_PPP_Flash_BrowserOperations_1_2(void* _interface, JSONIterator& iterator); +#ifdef INTERPOSE +static PPP_Flash_BrowserOperations_1_3 *_real_PPP_Flash_BrowserOperations_1_3; +#endif // INTERPOSE +static char* Call_PPP_Flash_BrowserOperations(void* _interface, JSONIterator& iterator); +#ifdef INTERPOSE +static PPP_Instance_Private_0_1 *_real_PPP_Instance_Private_0_1; +#endif // INTERPOSE +static char* Call_PPP_Instance_Private(void* _interface, JSONIterator& iterator); +#ifdef INTERPOSE +static PPP_PexeStreamHandler_1_0 *_real_PPP_PexeStreamHandler_1_0; +#endif // INTERPOSE +static char* Call_PPP_PexeStreamHandler(void* _interface, JSONIterator& iterator); +const string ToString_PP_ArrayOutput_GetDataBuffer(const PP_ArrayOutput_GetDataBuffer &v) { + return PointerToString(v); +} +void FromJSON_PP_ArrayOutput_GetDataBuffer(JSONIterator& iterator, PP_ArrayOutput_GetDataBuffer &value) { + PointerValueFromJSON(iterator, value); +} +const string ToString_PP_ArrayOutput(const PP_ArrayOutput *v) { + if (!v) { + return "null"; + } + return ToString_PP_ArrayOutput(*v); +} +const string ToString_PP_ArrayOutput(const PP_ArrayOutput &v) { + stringstream x; + BeginProps(x); + AddProp(x, "GetDataBuffer", ToString_PP_ArrayOutput_GetDataBuffer(v.GetDataBuffer)); + AddProp(x, "user_data", ToString_mem_t(v.user_data)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_ArrayOutput(JSONIterator& iterator, PP_ArrayOutput &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_PP_ArrayOutput_GetDataBuffer(iterator, value.GetDataBuffer); + iterator.skip(); + FromJSON_mem_t(iterator, value.user_data); +} +const string ToString_PP_Bool(const PP_Bool *v) { + switch (*v) { + case 0: + return "\"PP_FALSE\""; + case 1: + return "\"PP_TRUE\""; + default: + return "\"???\""; + } +} +const string ToString_PP_Bool(const PP_Bool &v) { + return ToString_PP_Bool(&v); +} +void FromJSON_PP_Bool(JSONIterator& iterator, PP_Bool &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_Bool(v); +} +const string ToString_PP_VideoProfile(const PP_VideoProfile *v) { + switch (*v) { + case 0: + return "\"PP_VIDEOPROFILE_H264BASELINE\""; + case 1: + return "\"PP_VIDEOPROFILE_H264MAIN\""; + case 2: + return "\"PP_VIDEOPROFILE_H264EXTENDED\""; + case 3: + return "\"PP_VIDEOPROFILE_H264HIGH\""; + case 4: + return "\"PP_VIDEOPROFILE_H264HIGH10PROFILE\""; + case 5: + return "\"PP_VIDEOPROFILE_H264HIGH422PROFILE\""; + case 6: + return "\"PP_VIDEOPROFILE_H264HIGH444PREDICTIVEPROFILE\""; + case 7: + return "\"PP_VIDEOPROFILE_H264SCALABLEBASELINE\""; + case 8: + return "\"PP_VIDEOPROFILE_H264SCALABLEHIGH\""; + case 9: + return "\"PP_VIDEOPROFILE_H264STEREOHIGH\""; + case 10: + return "\"PP_VIDEOPROFILE_H264MULTIVIEWHIGH\""; + case 11: + return "\"PP_VIDEOPROFILE_VP8_ANY\""; + case 12: + return "\"PP_VIDEOPROFILE_VP9_ANY\""; + default: + return "\"???\""; + } +} +const string ToString_PP_VideoProfile(const PP_VideoProfile &v) { + return ToString_PP_VideoProfile(&v); +} +void FromJSON_PP_VideoProfile(JSONIterator& iterator, PP_VideoProfile &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_VideoProfile(v); +} +const string ToString_PP_AudioProfile(const PP_AudioProfile *v) { + switch (*v) { + case 0: + return "\"PP_AUDIOPROFILE_OPUS\""; + default: + return "\"???\""; + } +} +const string ToString_PP_AudioProfile(const PP_AudioProfile &v) { + return ToString_PP_AudioProfile(&v); +} +void FromJSON_PP_AudioProfile(JSONIterator& iterator, PP_AudioProfile &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_AudioProfile(v); +} +const string ToString_PP_HardwareAcceleration(const PP_HardwareAcceleration *v) { + switch (*v) { + case 0: + return "\"PP_HARDWAREACCELERATION_ONLY\""; + case 1: + return "\"PP_HARDWAREACCELERATION_WITHFALLBACK\""; + case 2: + return "\"PP_HARDWAREACCELERATION_NONE\""; + default: + return "\"???\""; + } +} +const string ToString_PP_HardwareAcceleration(const PP_HardwareAcceleration &v) { + return ToString_PP_HardwareAcceleration(&v); +} +void FromJSON_PP_HardwareAcceleration(JSONIterator& iterator, PP_HardwareAcceleration &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_HardwareAcceleration(v); +} +const string ToString_PP_VideoPicture(const PP_VideoPicture *v) { + if (!v) { + return "null"; + } + return ToString_PP_VideoPicture(*v); +} +const string ToString_PP_VideoPicture(const PP_VideoPicture &v) { + stringstream x; + BeginProps(x); + AddProp(x, "decode_id", ToString_uint32_t(v.decode_id)); + AddProp(x, "texture_id", ToString_uint32_t(v.texture_id)); + AddProp(x, "texture_target", ToString_uint32_t(v.texture_target)); + AddProp(x, "texture_size", ToString_PP_Size(v.texture_size)); + AddProp(x, "visible_rect", ToString_PP_Rect(v.visible_rect)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_VideoPicture(JSONIterator& iterator, PP_VideoPicture &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_uint32_t(iterator, value.decode_id); + iterator.skip(); + FromJSON_uint32_t(iterator, value.texture_id); + iterator.skip(); + FromJSON_uint32_t(iterator, value.texture_target); + iterator.skip(); + FromJSON_PP_Size(iterator, value.texture_size); + iterator.skip(); + FromJSON_PP_Rect(iterator, value.visible_rect); +} +const string ToString_PP_VideoPicture_0_1(const PP_VideoPicture_0_1 *v) { + if (!v) { + return "null"; + } + return ToString_PP_VideoPicture_0_1(*v); +} +const string ToString_PP_VideoPicture_0_1(const PP_VideoPicture_0_1 &v) { + stringstream x; + BeginProps(x); + AddProp(x, "decode_id", ToString_uint32_t(v.decode_id)); + AddProp(x, "texture_id", ToString_uint32_t(v.texture_id)); + AddProp(x, "texture_target", ToString_uint32_t(v.texture_target)); + AddProp(x, "texture_size", ToString_PP_Size(v.texture_size)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_VideoPicture_0_1(JSONIterator& iterator, PP_VideoPicture_0_1 &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_uint32_t(iterator, value.decode_id); + iterator.skip(); + FromJSON_uint32_t(iterator, value.texture_id); + iterator.skip(); + FromJSON_uint32_t(iterator, value.texture_target); + iterator.skip(); + FromJSON_PP_Size(iterator, value.texture_size); +} +const string ToString_PP_VideoProfileDescription(const PP_VideoProfileDescription *v) { + if (!v) { + return "null"; + } + return ToString_PP_VideoProfileDescription(*v); +} +const string ToString_PP_VideoProfileDescription(const PP_VideoProfileDescription &v) { + stringstream x; + BeginProps(x); + AddProp(x, "profile", ToString_PP_VideoProfile(v.profile)); + AddProp(x, "max_resolution", ToString_PP_Size(v.max_resolution)); + AddProp(x, "max_framerate_numerator", ToString_uint32_t(v.max_framerate_numerator)); + AddProp(x, "max_framerate_denominator", ToString_uint32_t(v.max_framerate_denominator)); + AddProp(x, "hardware_accelerated", ToString_PP_Bool(v.hardware_accelerated)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_VideoProfileDescription(JSONIterator& iterator, PP_VideoProfileDescription &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_PP_VideoProfile(iterator, value.profile); + iterator.skip(); + FromJSON_PP_Size(iterator, value.max_resolution); + iterator.skip(); + FromJSON_uint32_t(iterator, value.max_framerate_numerator); + iterator.skip(); + FromJSON_uint32_t(iterator, value.max_framerate_denominator); + iterator.skip(); + FromJSON_PP_Bool(iterator, value.hardware_accelerated); +} +const string ToString_PP_VideoProfileDescription_0_1(const PP_VideoProfileDescription_0_1 *v) { + if (!v) { + return "null"; + } + return ToString_PP_VideoProfileDescription_0_1(*v); +} +const string ToString_PP_VideoProfileDescription_0_1(const PP_VideoProfileDescription_0_1 &v) { + stringstream x; + BeginProps(x); + AddProp(x, "profile", ToString_PP_VideoProfile(v.profile)); + AddProp(x, "max_resolution", ToString_PP_Size(v.max_resolution)); + AddProp(x, "max_framerate_numerator", ToString_uint32_t(v.max_framerate_numerator)); + AddProp(x, "max_framerate_denominator", ToString_uint32_t(v.max_framerate_denominator)); + AddProp(x, "acceleration", ToString_PP_HardwareAcceleration(v.acceleration)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_VideoProfileDescription_0_1(JSONIterator& iterator, PP_VideoProfileDescription_0_1 &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_PP_VideoProfile(iterator, value.profile); + iterator.skip(); + FromJSON_PP_Size(iterator, value.max_resolution); + iterator.skip(); + FromJSON_uint32_t(iterator, value.max_framerate_numerator); + iterator.skip(); + FromJSON_uint32_t(iterator, value.max_framerate_denominator); + iterator.skip(); + FromJSON_PP_HardwareAcceleration(iterator, value.acceleration); +} +const string ToString_PP_AudioProfileDescription(const PP_AudioProfileDescription *v) { + if (!v) { + return "null"; + } + return ToString_PP_AudioProfileDescription(*v); +} +const string ToString_PP_AudioProfileDescription(const PP_AudioProfileDescription &v) { + stringstream x; + BeginProps(x); + AddProp(x, "profile", ToString_PP_AudioProfile(v.profile)); + AddProp(x, "max_channels", ToString_uint32_t(v.max_channels)); + AddProp(x, "sample_size", ToString_uint32_t(v.sample_size)); + AddProp(x, "sample_rate", ToString_uint32_t(v.sample_rate)); + AddProp(x, "hardware_accelerated", ToString_PP_Bool(v.hardware_accelerated)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_AudioProfileDescription(JSONIterator& iterator, PP_AudioProfileDescription &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_PP_AudioProfile(iterator, value.profile); + iterator.skip(); + FromJSON_uint32_t(iterator, value.max_channels); + iterator.skip(); + FromJSON_uint32_t(iterator, value.sample_size); + iterator.skip(); + FromJSON_uint32_t(iterator, value.sample_rate); + iterator.skip(); + FromJSON_PP_Bool(iterator, value.hardware_accelerated); +} +const string ToString_PP_BitstreamBuffer(const PP_BitstreamBuffer *v) { + if (!v) { + return "null"; + } + return ToString_PP_BitstreamBuffer(*v); +} +const string ToString_PP_BitstreamBuffer(const PP_BitstreamBuffer &v) { + stringstream x; + BeginProps(x); + AddProp(x, "size", ToString_uint32_t(v.size)); + AddProp(x, "buffer", ToString_mem_t(v.buffer)); + AddProp(x, "key_frame", ToString_PP_Bool(v.key_frame)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_BitstreamBuffer(JSONIterator& iterator, PP_BitstreamBuffer &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_uint32_t(iterator, value.size); + iterator.skip(); + FromJSON_mem_t(iterator, value.buffer); + iterator.skip(); + FromJSON_PP_Bool(iterator, value.key_frame); +} +const string ToString_PP_AudioBitstreamBuffer(const PP_AudioBitstreamBuffer *v) { + if (!v) { + return "null"; + } + return ToString_PP_AudioBitstreamBuffer(*v); +} +const string ToString_PP_AudioBitstreamBuffer(const PP_AudioBitstreamBuffer &v) { + stringstream x; + BeginProps(x); + AddProp(x, "size", ToString_uint32_t(v.size)); + AddProp(x, "buffer", ToString_mem_t(v.buffer)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_AudioBitstreamBuffer(JSONIterator& iterator, PP_AudioBitstreamBuffer &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_uint32_t(iterator, value.size); + iterator.skip(); + FromJSON_mem_t(iterator, value.buffer); +} +const string ToString_PP_CompletionCallback_Func(const PP_CompletionCallback_Func &v) { + return PointerToString(v); +} +void FromJSON_PP_CompletionCallback_Func(JSONIterator& iterator, PP_CompletionCallback_Func &value) { + PointerValueFromJSON(iterator, value); +} +const string ToString_PP_CompletionCallback_Flag(const PP_CompletionCallback_Flag *v) { + switch (*v) { + case 0 << 0: + return "\"PP_COMPLETIONCALLBACK_FLAG_NONE\""; + case 1 << 0: + return "\"PP_COMPLETIONCALLBACK_FLAG_OPTIONAL\""; + default: + return "\"???\""; + } +} +const string ToString_PP_CompletionCallback_Flag(const PP_CompletionCallback_Flag &v) { + return ToString_PP_CompletionCallback_Flag(&v); +} +void FromJSON_PP_CompletionCallback_Flag(JSONIterator& iterator, PP_CompletionCallback_Flag &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_CompletionCallback_Flag(v); +} +const string ToString_PP_CompletionCallback(const PP_CompletionCallback *v) { + if (!v) { + return "null"; + } + return ToString_PP_CompletionCallback(*v); +} +const string ToString_PP_CompletionCallback(const PP_CompletionCallback &v) { + stringstream x; + BeginProps(x); + AddProp(x, "func", ToString_PP_CompletionCallback_Func(v.func)); + AddProp(x, "user_data", ToString_mem_t(v.user_data)); + AddProp(x, "flags", ToString_int32_t(v.flags)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_CompletionCallback(JSONIterator& iterator, PP_CompletionCallback &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_PP_CompletionCallback_Func(iterator, value.func); + iterator.skip(); + FromJSON_mem_t(iterator, value.user_data); + iterator.skip(); + FromJSON_int32_t(iterator, value.flags); +} +const string ToString_PP_DirectoryEntry(const PP_DirectoryEntry *v) { + if (!v) { + return "null"; + } + return ToString_PP_DirectoryEntry(*v); +} +const string ToString_PP_DirectoryEntry(const PP_DirectoryEntry &v) { + stringstream x; + BeginProps(x); + AddProp(x, "file_ref", ToString_PP_Resource(v.file_ref)); + AddProp(x, "file_type", ToString_PP_FileType(v.file_type)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_DirectoryEntry(JSONIterator& iterator, PP_DirectoryEntry &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_PP_Resource(iterator, value.file_ref); + iterator.skip(); + FromJSON_PP_FileType(iterator, value.file_type); +} +const string ToString_PP_FileType(const PP_FileType *v) { + switch (*v) { + case 0: + return "\"PP_FILETYPE_REGULAR\""; + case 1: + return "\"PP_FILETYPE_DIRECTORY\""; + case 2: + return "\"PP_FILETYPE_OTHER\""; + default: + return "\"???\""; + } +} +const string ToString_PP_FileType(const PP_FileType &v) { + return ToString_PP_FileType(&v); +} +void FromJSON_PP_FileType(JSONIterator& iterator, PP_FileType &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_FileType(v); +} +const string ToString_PP_FileSystemType(const PP_FileSystemType *v) { + switch (*v) { + case 0: + return "\"PP_FILESYSTEMTYPE_INVALID\""; + case 1: + return "\"PP_FILESYSTEMTYPE_EXTERNAL\""; + case 2: + return "\"PP_FILESYSTEMTYPE_LOCALPERSISTENT\""; + case 3: + return "\"PP_FILESYSTEMTYPE_LOCALTEMPORARY\""; + case 4: + return "\"PP_FILESYSTEMTYPE_ISOLATED\""; + default: + return "\"???\""; + } +} +const string ToString_PP_FileSystemType(const PP_FileSystemType &v) { + return ToString_PP_FileSystemType(&v); +} +void FromJSON_PP_FileSystemType(JSONIterator& iterator, PP_FileSystemType &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_FileSystemType(v); +} +const string ToString_PP_FileInfo(const PP_FileInfo *v) { + if (!v) { + return "null"; + } + return ToString_PP_FileInfo(*v); +} +const string ToString_PP_FileInfo(const PP_FileInfo &v) { + stringstream x; + BeginProps(x); + AddProp(x, "size", ToString_int64_t(v.size)); + AddProp(x, "type", ToString_PP_FileType(v.type)); + AddProp(x, "system_type", ToString_PP_FileSystemType(v.system_type)); + AddProp(x, "creation_time", ToString_PP_Time(v.creation_time)); + AddProp(x, "last_access_time", ToString_PP_Time(v.last_access_time)); + AddProp(x, "last_modified_time", ToString_PP_Time(v.last_modified_time)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_FileInfo(JSONIterator& iterator, PP_FileInfo &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_int64_t(iterator, value.size); + iterator.skip(); + FromJSON_PP_FileType(iterator, value.type); + iterator.skip(); + FromJSON_PP_FileSystemType(iterator, value.system_type); + iterator.skip(); + FromJSON_PP_Time(iterator, value.creation_time); + iterator.skip(); + FromJSON_PP_Time(iterator, value.last_access_time); + iterator.skip(); + FromJSON_PP_Time(iterator, value.last_modified_time); +} +const string ToString_PP_Graphics3DAttrib(const PP_Graphics3DAttrib *v) { + switch (*v) { + case 0x3021: + return "\"PP_GRAPHICS3DATTRIB_ALPHA_SIZE\""; + case 0x3022: + return "\"PP_GRAPHICS3DATTRIB_BLUE_SIZE\""; + case 0x3023: + return "\"PP_GRAPHICS3DATTRIB_GREEN_SIZE\""; + case 0x3024: + return "\"PP_GRAPHICS3DATTRIB_RED_SIZE\""; + case 0x3025: + return "\"PP_GRAPHICS3DATTRIB_DEPTH_SIZE\""; + case 0x3026: + return "\"PP_GRAPHICS3DATTRIB_STENCIL_SIZE\""; + case 0x3031: + return "\"PP_GRAPHICS3DATTRIB_SAMPLES\""; + case 0x3032: + return "\"PP_GRAPHICS3DATTRIB_SAMPLE_BUFFERS\""; + case 0x3038: + return "\"PP_GRAPHICS3DATTRIB_NONE\""; + case 0x3056: + return "\"PP_GRAPHICS3DATTRIB_HEIGHT\""; + case 0x3057: + return "\"PP_GRAPHICS3DATTRIB_WIDTH\""; + case 0x3093: + return "\"PP_GRAPHICS3DATTRIB_SWAP_BEHAVIOR\""; + case 0x3094: + return "\"PP_GRAPHICS3DATTRIB_BUFFER_PRESERVED\""; + case 0x3095: + return "\"PP_GRAPHICS3DATTRIB_BUFFER_DESTROYED\""; + case 0x11000: + return "\"PP_GRAPHICS3DATTRIB_GPU_PREFERENCE\""; + case 0x11001: + return "\"PP_GRAPHICS3DATTRIB_GPU_PREFERENCE_LOW_POWER\""; + case 0x11002: + return "\"PP_GRAPHICS3DATTRIB_GPU_PREFERENCE_PERFORMANCE\""; + default: + return "\"???\""; + } +} +const string ToString_PP_Graphics3DAttrib(const PP_Graphics3DAttrib &v) { + return ToString_PP_Graphics3DAttrib(&v); +} +void FromJSON_PP_Graphics3DAttrib(JSONIterator& iterator, PP_Graphics3DAttrib &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_Graphics3DAttrib(v); +} +const string ToString_PP_InputEvent_Key(const PP_InputEvent_Key *v) { + if (!v) { + return "null"; + } + return ToString_PP_InputEvent_Key(*v); +} +const string ToString_PP_InputEvent_Key(const PP_InputEvent_Key &v) { + stringstream x; + BeginProps(x); + AddProp(x, "modifier", ToString_uint32_t(v.modifier)); + AddProp(x, "key_code", ToString_uint32_t(v.key_code)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_InputEvent_Key(JSONIterator& iterator, PP_InputEvent_Key &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_uint32_t(iterator, value.modifier); + iterator.skip(); + FromJSON_uint32_t(iterator, value.key_code); +} +const string ToString_PP_InputEvent_Character(const PP_InputEvent_Character *v) { + if (!v) { + return "null"; + } + return ToString_PP_InputEvent_Character(*v); +} +const string ToString_PP_InputEvent_Character(const PP_InputEvent_Character &v) { + stringstream x; + BeginProps(x); + AddProp(x, "modifier", ToString_uint32_t(v.modifier)); + { + BeginProp(x, "text"); + BeginElements(x); + for (uint32_t _n = 0; _n < 5; ++_n) { + AddElement(x, ToString_int8_t(v.text[_n])); + } + EndElements(x); + } + EndProps(x); + return x.str(); +} +void FromJSON_PP_InputEvent_Character(JSONIterator& iterator, PP_InputEvent_Character &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_uint32_t(iterator, value.modifier); + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > 5) { + Fail("Too many items in array\n", ""); + } + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_int8_t(iterator, (value.text)[_n]); + } + // FIXME Null out remaining items? + } +} +const string ToString_PP_InputEvent_Mouse(const PP_InputEvent_Mouse *v) { + if (!v) { + return "null"; + } + return ToString_PP_InputEvent_Mouse(*v); +} +const string ToString_PP_InputEvent_Mouse(const PP_InputEvent_Mouse &v) { + stringstream x; + BeginProps(x); + AddProp(x, "modifier", ToString_uint32_t(v.modifier)); + AddProp(x, "button", ToString_PP_InputEvent_MouseButton(v.button)); + AddProp(x, "x", ToString_float_t(v.x)); + AddProp(x, "y", ToString_float_t(v.y)); + AddProp(x, "click_count", ToString_int32_t(v.click_count)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_InputEvent_Mouse(JSONIterator& iterator, PP_InputEvent_Mouse &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_uint32_t(iterator, value.modifier); + iterator.skip(); + FromJSON_PP_InputEvent_MouseButton(iterator, value.button); + iterator.skip(); + FromJSON_float_t(iterator, value.x); + iterator.skip(); + FromJSON_float_t(iterator, value.y); + iterator.skip(); + FromJSON_int32_t(iterator, value.click_count); +} +const string ToString_PP_InputEvent_Wheel(const PP_InputEvent_Wheel *v) { + if (!v) { + return "null"; + } + return ToString_PP_InputEvent_Wheel(*v); +} +const string ToString_PP_InputEvent_Wheel(const PP_InputEvent_Wheel &v) { + stringstream x; + BeginProps(x); + AddProp(x, "modifier", ToString_uint32_t(v.modifier)); + AddProp(x, "delta_x", ToString_float_t(v.delta_x)); + AddProp(x, "delta_y", ToString_float_t(v.delta_y)); + AddProp(x, "wheel_ticks_x", ToString_float_t(v.wheel_ticks_x)); + AddProp(x, "wheel_ticks_y", ToString_float_t(v.wheel_ticks_y)); + AddProp(x, "scroll_by_page", ToString_PP_Bool(v.scroll_by_page)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_InputEvent_Wheel(JSONIterator& iterator, PP_InputEvent_Wheel &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_uint32_t(iterator, value.modifier); + iterator.skip(); + FromJSON_float_t(iterator, value.delta_x); + iterator.skip(); + FromJSON_float_t(iterator, value.delta_y); + iterator.skip(); + FromJSON_float_t(iterator, value.wheel_ticks_x); + iterator.skip(); + FromJSON_float_t(iterator, value.wheel_ticks_y); + iterator.skip(); + FromJSON_PP_Bool(iterator, value.scroll_by_page); +} +const string ToString_PP_Instance(const PP_Instance *v) { + return ToString_int32_t(v); +} +const string ToString_PP_Instance(const PP_Instance &v) { + return ToString_PP_Instance(&v); +} +void FromJSON_PP_Instance(JSONIterator& iterator, PP_Instance &value) { + FromJSON_int32_t(iterator, value); +} +const string ToString_PP_Module(const PP_Module *v) { + return ToString_int32_t(v); +} +const string ToString_PP_Module(const PP_Module &v) { + return ToString_PP_Module(&v); +} +void FromJSON_PP_Module(JSONIterator& iterator, PP_Module &value) { + FromJSON_int32_t(iterator, value); +} +const string ToString_PP_Point(const PP_Point *v) { + if (!v) { + return "null"; + } + return ToString_PP_Point(*v); +} +const string ToString_PP_Point(const PP_Point &v) { + stringstream x; + BeginProps(x); + AddProp(x, "x", ToString_int32_t(v.x)); + AddProp(x, "y", ToString_int32_t(v.y)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_Point(JSONIterator& iterator, PP_Point &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_int32_t(iterator, value.x); + iterator.skip(); + FromJSON_int32_t(iterator, value.y); +} +const string ToString_PP_FloatPoint(const PP_FloatPoint *v) { + if (!v) { + return "null"; + } + return ToString_PP_FloatPoint(*v); +} +const string ToString_PP_FloatPoint(const PP_FloatPoint &v) { + stringstream x; + BeginProps(x); + AddProp(x, "x", ToString_float_t(v.x)); + AddProp(x, "y", ToString_float_t(v.y)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_FloatPoint(JSONIterator& iterator, PP_FloatPoint &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_float_t(iterator, value.x); + iterator.skip(); + FromJSON_float_t(iterator, value.y); +} +const string ToString_PP_Rect(const PP_Rect *v) { + if (!v) { + return "null"; + } + return ToString_PP_Rect(*v); +} +const string ToString_PP_Rect(const PP_Rect &v) { + stringstream x; + BeginProps(x); + AddProp(x, "point", ToString_PP_Point(v.point)); + AddProp(x, "size", ToString_PP_Size(v.size)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_Rect(JSONIterator& iterator, PP_Rect &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_PP_Point(iterator, value.point); + iterator.skip(); + FromJSON_PP_Size(iterator, value.size); +} +const string ToString_PP_FloatRect(const PP_FloatRect *v) { + if (!v) { + return "null"; + } + return ToString_PP_FloatRect(*v); +} +const string ToString_PP_FloatRect(const PP_FloatRect &v) { + stringstream x; + BeginProps(x); + AddProp(x, "point", ToString_PP_FloatPoint(v.point)); + AddProp(x, "size", ToString_PP_FloatSize(v.size)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_FloatRect(JSONIterator& iterator, PP_FloatRect &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_PP_FloatPoint(iterator, value.point); + iterator.skip(); + FromJSON_PP_FloatSize(iterator, value.size); +} +const string ToString_PP_Resource(const PP_Resource *v) { + return ToString_int32_t(v); +} +const string ToString_PP_Resource(const PP_Resource &v) { + return ToString_PP_Resource(&v); +} +void FromJSON_PP_Resource(JSONIterator& iterator, PP_Resource &value) { + FromJSON_int32_t(iterator, value); +} +const string ToString_PP_Size(const PP_Size *v) { + if (!v) { + return "null"; + } + return ToString_PP_Size(*v); +} +const string ToString_PP_Size(const PP_Size &v) { + stringstream x; + BeginProps(x); + AddProp(x, "width", ToString_int32_t(v.width)); + AddProp(x, "height", ToString_int32_t(v.height)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_Size(JSONIterator& iterator, PP_Size &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_int32_t(iterator, value.width); + iterator.skip(); + FromJSON_int32_t(iterator, value.height); +} +const string ToString_PP_FloatSize(const PP_FloatSize *v) { + if (!v) { + return "null"; + } + return ToString_PP_FloatSize(*v); +} +const string ToString_PP_FloatSize(const PP_FloatSize &v) { + stringstream x; + BeginProps(x); + AddProp(x, "width", ToString_float_t(v.width)); + AddProp(x, "height", ToString_float_t(v.height)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_FloatSize(JSONIterator& iterator, PP_FloatSize &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_float_t(iterator, value.width); + iterator.skip(); + FromJSON_float_t(iterator, value.height); +} +const string ToString_PP_Time(const PP_Time *v) { + return ToString_double_t(v); +} +const string ToString_PP_Time(const PP_Time &v) { + return ToString_PP_Time(&v); +} +void FromJSON_PP_Time(JSONIterator& iterator, PP_Time &value) { + FromJSON_double_t(iterator, value); +} +const string ToString_PP_TimeTicks(const PP_TimeTicks *v) { + return ToString_double_t(v); +} +const string ToString_PP_TimeTicks(const PP_TimeTicks &v) { + return ToString_PP_TimeTicks(&v); +} +void FromJSON_PP_TimeTicks(JSONIterator& iterator, PP_TimeTicks &value) { + FromJSON_double_t(iterator, value); +} +const string ToString_PP_TimeDelta(const PP_TimeDelta *v) { + return ToString_double_t(v); +} +const string ToString_PP_TimeDelta(const PP_TimeDelta &v) { + return ToString_PP_TimeDelta(&v); +} +void FromJSON_PP_TimeDelta(JSONIterator& iterator, PP_TimeDelta &value) { + FromJSON_double_t(iterator, value); +} +const string ToString_PP_TouchPoint(const PP_TouchPoint *v) { + if (!v) { + return "null"; + } + return ToString_PP_TouchPoint(*v); +} +const string ToString_PP_TouchPoint(const PP_TouchPoint &v) { + stringstream x; + BeginProps(x); + AddProp(x, "id", ToString_uint32_t(v.id)); + AddProp(x, "position", ToString_PP_FloatPoint(v.position)); + AddProp(x, "radius", ToString_PP_FloatPoint(v.radius)); + AddProp(x, "rotation_angle", ToString_float_t(v.rotation_angle)); + AddProp(x, "pressure", ToString_float_t(v.pressure)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_TouchPoint(JSONIterator& iterator, PP_TouchPoint &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_uint32_t(iterator, value.id); + iterator.skip(); + FromJSON_PP_FloatPoint(iterator, value.position); + iterator.skip(); + FromJSON_PP_FloatPoint(iterator, value.radius); + iterator.skip(); + FromJSON_float_t(iterator, value.rotation_angle); + iterator.skip(); + FromJSON_float_t(iterator, value.pressure); +} +const string ToString_PP_VarType(const PP_VarType *v) { + switch (*v) { + case 0: + return "\"PP_VARTYPE_UNDEFINED\""; + case 1: + return "\"PP_VARTYPE_NULL\""; + case 2: + return "\"PP_VARTYPE_BOOL\""; + case 3: + return "\"PP_VARTYPE_INT32\""; + case 4: + return "\"PP_VARTYPE_DOUBLE\""; + case 5: + return "\"PP_VARTYPE_STRING\""; + case 6: + return "\"PP_VARTYPE_OBJECT\""; + case 7: + return "\"PP_VARTYPE_ARRAY\""; + case 8: + return "\"PP_VARTYPE_DICTIONARY\""; + case 9: + return "\"PP_VARTYPE_ARRAY_BUFFER\""; + case 10: + return "\"PP_VARTYPE_RESOURCE\""; + default: + return "\"???\""; + } +} +const string ToString_PP_VarType(const PP_VarType &v) { + return ToString_PP_VarType(&v); +} +void FromJSON_PP_VarType(JSONIterator& iterator, PP_VarType &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_VarType(v); +} +const string ToString_PP_VarValue(const PP_VarValue *v) { + if (!v) { + return "null"; + } + return ToString_PP_VarValue(*v); +} +const string ToString_PP_VarValue(const PP_VarValue &v) { + stringstream x; + BeginProps(x); + AddProp(x, "as_bool", ToString_PP_Bool(v.as_bool)); + AddProp(x, "as_int", ToString_int32_t(v.as_int)); + AddProp(x, "as_double", ToString_double_t(v.as_double)); + AddProp(x, "as_id", ToString_int64_t(v.as_id)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_VarValue(JSONIterator& iterator, PP_VarValue &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + string name = iterator.getCurrentStringAndGotoNext().value(); + if (!name.compare("as_bool")) { + FromJSON_PP_Bool(iterator, value.as_bool); + } else if (!name.compare("as_int")) { + FromJSON_int32_t(iterator, value.as_int); + } else if (!name.compare("as_double")) { + FromJSON_double_t(iterator, value.as_double); + } else if (!name.compare("as_id")) { + FromJSON_int64_t(iterator, value.as_id); + } +} +const string ToString_PP_Var(const PP_Var *v) { + if (!v) { + return "null"; + } + return ToString_PP_Var(*v); +} +const string ToString_PP_Var(const PP_Var &v) { + stringstream x; + BeginProps(x); + AddProp(x, "type", ToString_PP_VarType(v.type)); + AddProp(x, "padding", ToString_int32_t(v.padding)); + AddProp(x, "value", ToString_PP_VarValue(v.value)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_Var(JSONIterator& iterator, PP_Var &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_PP_VarType(iterator, value.type); + iterator.skip(); + FromJSON_int32_t(iterator, value.padding); + iterator.skip(); + FromJSON_PP_VarValue(iterator, value.value); +} +const string ToString_PPB_GetInterface(const PPB_GetInterface &v) { + return PointerToString(v); +} +void FromJSON_PPB_GetInterface(JSONIterator& iterator, PPB_GetInterface &value) { + PointerValueFromJSON(iterator, value); +} +const string ToString_PPB_Audio_Callback(const PPB_Audio_Callback_1_0 &v) { + return PointerToString(v); +} +void FromJSON_PPB_Audio_Callback(JSONIterator& iterator, PPB_Audio_Callback_1_0 &value) { + PointerValueFromJSON(iterator, value); +} +const string ToString_PPB_Audio_Callback(const PPB_Audio_Callback &v) { + return PointerToString(v); +} +void FromJSON_PPB_Audio_Callback(JSONIterator& iterator, PPB_Audio_Callback &value) { + PointerValueFromJSON(iterator, value); +} +namespace ns_PPB_Audio_1_0 { +static PP_Resource Create_1_0(PP_Instance instance, PP_Resource config, PPB_Audio_Callback_1_0 audio_callback, void* user_data) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Audio\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "config", ToString_PP_Resource(config)); + AddProp(ss, "audio_callback", ToString_PPB_Audio_Callback(audio_callback)); + AddProp(ss, "user_data", ToString_mem_t(user_data)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + Logging_PPB_Audio_Callback_1_0_holder* audio_callback_holder = new Logging_PPB_Audio_Callback_1_0_holder(); + audio_callback_holder->func = audio_callback; + audio_callback_holder->user_data = user_data; + user_data = audio_callback_holder; + int32_t rval = ((PPB_Audio_1_0*)RealGetInterface("PPB_Audio;1.0"))->Create(instance, config, Logging_PPB_Audio_Callback_1_0, user_data); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsAudio_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Audio\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsAudio\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Audio_1_0*)RealGetInterface("PPB_Audio;1.0"))->IsAudio(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource GetCurrentConfig_1_0(PP_Resource audio) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Audio\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetCurrentConfig\""); + AddProp(ss, "audio", ToString_PP_Resource(audio)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Audio_1_0*)RealGetInterface("PPB_Audio;1.0"))->GetCurrentConfig(audio); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool StartPlayback_1_0(PP_Resource audio) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Audio\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"StartPlayback\""); + AddProp(ss, "audio", ToString_PP_Resource(audio)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Audio_1_0*)RealGetInterface("PPB_Audio;1.0"))->StartPlayback(audio); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool StopPlayback_1_0(PP_Resource audio) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Audio\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"StopPlayback\""); + AddProp(ss, "audio", ToString_PP_Resource(audio)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Audio_1_0*)RealGetInterface("PPB_Audio;1.0"))->StopPlayback(audio); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_Audio_1_0 _PPB_Audio_1_0 = { + ns_PPB_Audio_1_0::Create_1_0, + ns_PPB_Audio_1_0::IsAudio_1_0, + ns_PPB_Audio_1_0::GetCurrentConfig_1_0, + ns_PPB_Audio_1_0::StartPlayback_1_0, + ns_PPB_Audio_1_0::StopPlayback_1_0, +}; +const string ToString_PPB_Audio(const PPB_Audio_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Audio_1_1 { +static PP_Resource Create_1_1(PP_Instance instance, PP_Resource config, PPB_Audio_Callback audio_callback, void* user_data) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Audio\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "config", ToString_PP_Resource(config)); + AddProp(ss, "audio_callback", ToString_PPB_Audio_Callback(audio_callback)); + AddProp(ss, "user_data", ToString_mem_t(user_data)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Audio_1_1*)RealGetInterface("PPB_Audio;1.1"))->Create(instance, config, audio_callback, user_data); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsAudio_1_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Audio\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"IsAudio\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Audio_1_1*)RealGetInterface("PPB_Audio;1.1"))->IsAudio(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource GetCurrentConfig_1_1(PP_Resource audio) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Audio\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"GetCurrentConfig\""); + AddProp(ss, "audio", ToString_PP_Resource(audio)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Audio_1_1*)RealGetInterface("PPB_Audio;1.1"))->GetCurrentConfig(audio); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool StartPlayback_1_1(PP_Resource audio) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Audio\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"StartPlayback\""); + AddProp(ss, "audio", ToString_PP_Resource(audio)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Audio_1_1*)RealGetInterface("PPB_Audio;1.1"))->StartPlayback(audio); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool StopPlayback_1_1(PP_Resource audio) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Audio\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"StopPlayback\""); + AddProp(ss, "audio", ToString_PP_Resource(audio)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Audio_1_1*)RealGetInterface("PPB_Audio;1.1"))->StopPlayback(audio); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_Audio_1_1 _PPB_Audio_1_1 = { + ns_PPB_Audio_1_1::Create_1_1, + ns_PPB_Audio_1_1::IsAudio_1_1, + ns_PPB_Audio_1_1::GetCurrentConfig_1_1, + ns_PPB_Audio_1_1::StartPlayback_1_1, + ns_PPB_Audio_1_1::StopPlayback_1_1, +}; +const string ToString_PPB_Audio(const PPB_Audio_1_1 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_AudioBuffer_SampleRate(const PP_AudioBuffer_SampleRate *v) { + switch (*v) { + case 0: + return "\"PP_AUDIOBUFFER_SAMPLERATE_UNKNOWN\""; + case 8000: + return "\"PP_AUDIOBUFFER_SAMPLERATE_8000\""; + case 16000: + return "\"PP_AUDIOBUFFER_SAMPLERATE_16000\""; + case 22050: + return "\"PP_AUDIOBUFFER_SAMPLERATE_22050\""; + case 32000: + return "\"PP_AUDIOBUFFER_SAMPLERATE_32000\""; + case 44100: + return "\"PP_AUDIOBUFFER_SAMPLERATE_44100\""; + case 48000: + return "\"PP_AUDIOBUFFER_SAMPLERATE_48000\""; + case 96000: + return "\"PP_AUDIOBUFFER_SAMPLERATE_96000\""; + case 192000: + return "\"PP_AUDIOBUFFER_SAMPLERATE_192000\""; + default: + return "\"???\""; + } +} +const string ToString_PP_AudioBuffer_SampleRate(const PP_AudioBuffer_SampleRate &v) { + return ToString_PP_AudioBuffer_SampleRate(&v); +} +void FromJSON_PP_AudioBuffer_SampleRate(JSONIterator& iterator, PP_AudioBuffer_SampleRate &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_AudioBuffer_SampleRate(v); +} +const string ToString_PP_AudioBuffer_SampleSize(const PP_AudioBuffer_SampleSize *v) { + switch (*v) { + case 0: + return "\"PP_AUDIOBUFFER_SAMPLESIZE_UNKNOWN\""; + case 2: + return "\"PP_AUDIOBUFFER_SAMPLESIZE_16_BITS\""; + default: + return "\"???\""; + } +} +const string ToString_PP_AudioBuffer_SampleSize(const PP_AudioBuffer_SampleSize &v) { + return ToString_PP_AudioBuffer_SampleSize(&v); +} +void FromJSON_PP_AudioBuffer_SampleSize(JSONIterator& iterator, PP_AudioBuffer_SampleSize &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_AudioBuffer_SampleSize(v); +} +namespace ns_PPB_AudioBuffer_0_1 { +static PP_Bool IsAudioBuffer_0_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioBuffer\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"IsAudioBuffer\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_AudioBuffer_0_1*)RealGetInterface("PPB_AudioBuffer;0.1"))->IsAudioBuffer(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_TimeDelta GetTimestamp_0_1(PP_Resource buffer) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioBuffer\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetTimestamp\""); + AddProp(ss, "buffer", ToString_PP_Resource(buffer)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + double rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_TimeDelta(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + double rval = ((PPB_AudioBuffer_0_1*)RealGetInterface("PPB_AudioBuffer;0.1"))->GetTimestamp(buffer); + printf("RPC response: ["); + printf("%s", ToString_PP_TimeDelta(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void SetTimestamp_0_1(PP_Resource buffer, PP_TimeDelta timestamp) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioBuffer\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"SetTimestamp\""); + AddProp(ss, "buffer", ToString_PP_Resource(buffer)); + AddProp(ss, "timestamp", ToString_PP_TimeDelta(timestamp)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_AudioBuffer_0_1*)RealGetInterface("PPB_AudioBuffer;0.1"))->SetTimestamp(buffer, timestamp); +#endif // !INTERPOSE +} +static PP_AudioBuffer_SampleRate GetSampleRate_0_1(PP_Resource buffer) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioBuffer\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetSampleRate\""); + AddProp(ss, "buffer", ToString_PP_Resource(buffer)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_AudioBuffer_SampleRate rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_AudioBuffer_SampleRate(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_AudioBuffer_SampleRate rval = ((PPB_AudioBuffer_0_1*)RealGetInterface("PPB_AudioBuffer;0.1"))->GetSampleRate(buffer); + printf("RPC response: ["); + printf("%s", ToString_PP_AudioBuffer_SampleRate(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_AudioBuffer_SampleSize GetSampleSize_0_1(PP_Resource buffer) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioBuffer\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetSampleSize\""); + AddProp(ss, "buffer", ToString_PP_Resource(buffer)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_AudioBuffer_SampleSize rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_AudioBuffer_SampleSize(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_AudioBuffer_SampleSize rval = ((PPB_AudioBuffer_0_1*)RealGetInterface("PPB_AudioBuffer;0.1"))->GetSampleSize(buffer); + printf("RPC response: ["); + printf("%s", ToString_PP_AudioBuffer_SampleSize(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint32_t GetNumberOfChannels_0_1(PP_Resource buffer) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioBuffer\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetNumberOfChannels\""); + AddProp(ss, "buffer", ToString_PP_Resource(buffer)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint32_t rval = ((PPB_AudioBuffer_0_1*)RealGetInterface("PPB_AudioBuffer;0.1"))->GetNumberOfChannels(buffer); + printf("RPC response: ["); + printf("%s", ToString_uint32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint32_t GetNumberOfSamples_0_1(PP_Resource buffer) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioBuffer\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetNumberOfSamples\""); + AddProp(ss, "buffer", ToString_PP_Resource(buffer)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint32_t rval = ((PPB_AudioBuffer_0_1*)RealGetInterface("PPB_AudioBuffer;0.1"))->GetNumberOfSamples(buffer); + printf("RPC response: ["); + printf("%s", ToString_uint32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void* GetDataBuffer_0_1(PP_Resource buffer) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioBuffer\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetDataBuffer\""); + AddProp(ss, "buffer", ToString_PP_Resource(buffer)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + void* rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_mem_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + void* rval = ((PPB_AudioBuffer_0_1*)RealGetInterface("PPB_AudioBuffer;0.1"))->GetDataBuffer(buffer); + printf("RPC response: ["); + printf("%s", ToString_mem_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint32_t GetDataBufferSize_0_1(PP_Resource buffer) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioBuffer\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetDataBufferSize\""); + AddProp(ss, "buffer", ToString_PP_Resource(buffer)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint32_t rval = ((PPB_AudioBuffer_0_1*)RealGetInterface("PPB_AudioBuffer;0.1"))->GetDataBufferSize(buffer); + printf("RPC response: ["); + printf("%s", ToString_uint32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_AudioBuffer_0_1 _PPB_AudioBuffer_0_1 = { + ns_PPB_AudioBuffer_0_1::IsAudioBuffer_0_1, + ns_PPB_AudioBuffer_0_1::GetTimestamp_0_1, + ns_PPB_AudioBuffer_0_1::SetTimestamp_0_1, + ns_PPB_AudioBuffer_0_1::GetSampleRate_0_1, + ns_PPB_AudioBuffer_0_1::GetSampleSize_0_1, + ns_PPB_AudioBuffer_0_1::GetNumberOfChannels_0_1, + ns_PPB_AudioBuffer_0_1::GetNumberOfSamples_0_1, + ns_PPB_AudioBuffer_0_1::GetDataBuffer_0_1, + ns_PPB_AudioBuffer_0_1::GetDataBufferSize_0_1, +}; +const string ToString_PPB_AudioBuffer(const PPB_AudioBuffer_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_AudioSampleRate(const PP_AudioSampleRate *v) { + switch (*v) { + case 0: + return "\"PP_AUDIOSAMPLERATE_NONE\""; + case 44100: + return "\"PP_AUDIOSAMPLERATE_44100\""; + case 48000: + return "\"PP_AUDIOSAMPLERATE_48000\""; + default: + return "\"???\""; + } +} +const string ToString_PP_AudioSampleRate(const PP_AudioSampleRate &v) { + return ToString_PP_AudioSampleRate(&v); +} +void FromJSON_PP_AudioSampleRate(JSONIterator& iterator, PP_AudioSampleRate &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_AudioSampleRate(v); +} +namespace ns_PPB_AudioConfig_1_0 { +static PP_Resource CreateStereo16Bit_1_0(PP_Instance instance, PP_AudioSampleRate sample_rate, uint32_t sample_frame_count) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioConfig\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"CreateStereo16Bit\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "sample_rate", ToString_PP_AudioSampleRate(sample_rate)); + AddProp(ss, "sample_frame_count", ToString_uint32_t(sample_frame_count)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_AudioConfig_1_0*)RealGetInterface("PPB_AudioConfig;1.0"))->CreateStereo16Bit(instance, sample_rate, sample_frame_count); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint32_t RecommendSampleFrameCount_1_0(PP_AudioSampleRate sample_rate, uint32_t requested_sample_frame_count) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioConfig\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"RecommendSampleFrameCount\""); + AddProp(ss, "sample_rate", ToString_PP_AudioSampleRate(sample_rate)); + AddProp(ss, "requested_sample_frame_count", ToString_uint32_t(requested_sample_frame_count)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint32_t rval = ((PPB_AudioConfig_1_0*)RealGetInterface("PPB_AudioConfig;1.0"))->RecommendSampleFrameCount(sample_rate, requested_sample_frame_count); + printf("RPC response: ["); + printf("%s", ToString_uint32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping RecommendSampleFrameCount */ +static PP_Bool IsAudioConfig_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioConfig\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsAudioConfig\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_AudioConfig_1_0*)RealGetInterface("PPB_AudioConfig;1.0"))->IsAudioConfig(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_AudioSampleRate GetSampleRate_1_0(PP_Resource config) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioConfig\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetSampleRate\""); + AddProp(ss, "config", ToString_PP_Resource(config)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_AudioSampleRate rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_AudioSampleRate(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_AudioSampleRate rval = ((PPB_AudioConfig_1_0*)RealGetInterface("PPB_AudioConfig;1.0"))->GetSampleRate(config); + printf("RPC response: ["); + printf("%s", ToString_PP_AudioSampleRate(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint32_t GetSampleFrameCount_1_0(PP_Resource config) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioConfig\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetSampleFrameCount\""); + AddProp(ss, "config", ToString_PP_Resource(config)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint32_t rval = ((PPB_AudioConfig_1_0*)RealGetInterface("PPB_AudioConfig;1.0"))->GetSampleFrameCount(config); + printf("RPC response: ["); + printf("%s", ToString_uint32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping RecommendSampleRate */ +} +static PPB_AudioConfig_1_0 _PPB_AudioConfig_1_0 = { + ns_PPB_AudioConfig_1_0::CreateStereo16Bit_1_0, + ns_PPB_AudioConfig_1_0::RecommendSampleFrameCount_1_0, + ns_PPB_AudioConfig_1_0::IsAudioConfig_1_0, + ns_PPB_AudioConfig_1_0::GetSampleRate_1_0, + ns_PPB_AudioConfig_1_0::GetSampleFrameCount_1_0, +}; +const string ToString_PPB_AudioConfig(const PPB_AudioConfig_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_AudioConfig_1_1 { +static PP_Resource CreateStereo16Bit_1_1(PP_Instance instance, PP_AudioSampleRate sample_rate, uint32_t sample_frame_count) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioConfig\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"CreateStereo16Bit\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "sample_rate", ToString_PP_AudioSampleRate(sample_rate)); + AddProp(ss, "sample_frame_count", ToString_uint32_t(sample_frame_count)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_AudioConfig_1_1*)RealGetInterface("PPB_AudioConfig;1.1"))->CreateStereo16Bit(instance, sample_rate, sample_frame_count); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping RecommendSampleFrameCount */ +static uint32_t RecommendSampleFrameCount_1_1(PP_Instance instance, PP_AudioSampleRate sample_rate, uint32_t requested_sample_frame_count) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioConfig\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"RecommendSampleFrameCount\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "sample_rate", ToString_PP_AudioSampleRate(sample_rate)); + AddProp(ss, "requested_sample_frame_count", ToString_uint32_t(requested_sample_frame_count)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint32_t rval = ((PPB_AudioConfig_1_1*)RealGetInterface("PPB_AudioConfig;1.1"))->RecommendSampleFrameCount(instance, sample_rate, requested_sample_frame_count); + printf("RPC response: ["); + printf("%s", ToString_uint32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsAudioConfig_1_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioConfig\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"IsAudioConfig\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_AudioConfig_1_1*)RealGetInterface("PPB_AudioConfig;1.1"))->IsAudioConfig(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_AudioSampleRate GetSampleRate_1_1(PP_Resource config) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioConfig\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"GetSampleRate\""); + AddProp(ss, "config", ToString_PP_Resource(config)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_AudioSampleRate rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_AudioSampleRate(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_AudioSampleRate rval = ((PPB_AudioConfig_1_1*)RealGetInterface("PPB_AudioConfig;1.1"))->GetSampleRate(config); + printf("RPC response: ["); + printf("%s", ToString_PP_AudioSampleRate(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint32_t GetSampleFrameCount_1_1(PP_Resource config) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioConfig\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"GetSampleFrameCount\""); + AddProp(ss, "config", ToString_PP_Resource(config)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint32_t rval = ((PPB_AudioConfig_1_1*)RealGetInterface("PPB_AudioConfig;1.1"))->GetSampleFrameCount(config); + printf("RPC response: ["); + printf("%s", ToString_uint32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_AudioSampleRate RecommendSampleRate_1_1(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioConfig\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"RecommendSampleRate\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_AudioSampleRate rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_AudioSampleRate(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_AudioSampleRate rval = ((PPB_AudioConfig_1_1*)RealGetInterface("PPB_AudioConfig;1.1"))->RecommendSampleRate(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_AudioSampleRate(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_AudioConfig_1_1 _PPB_AudioConfig_1_1 = { + ns_PPB_AudioConfig_1_1::CreateStereo16Bit_1_1, + ns_PPB_AudioConfig_1_1::RecommendSampleFrameCount_1_1, + ns_PPB_AudioConfig_1_1::IsAudioConfig_1_1, + ns_PPB_AudioConfig_1_1::GetSampleRate_1_1, + ns_PPB_AudioConfig_1_1::GetSampleFrameCount_1_1, + ns_PPB_AudioConfig_1_1::RecommendSampleRate_1_1, +}; +const string ToString_PPB_AudioConfig(const PPB_AudioConfig_1_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_AudioEncoder_0_1 { +static PP_Resource Create_0_1(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioEncoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_AudioEncoder_0_1*)RealGetInterface("PPB_AudioEncoder;0.1"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsAudioEncoder_0_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioEncoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"IsAudioEncoder\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_AudioEncoder_0_1*)RealGetInterface("PPB_AudioEncoder;0.1"))->IsAudioEncoder(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetSupportedProfiles_0_1(PP_Resource audio_encoder, struct PP_ArrayOutput output, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioEncoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetSupportedProfiles\""); + AddProp(ss, "audio_encoder", ToString_PP_Resource(audio_encoder)); + AddProp(ss, "output", ToString_PP_ArrayOutput(output)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_AudioEncoder_0_1*)RealGetInterface("PPB_AudioEncoder;0.1"))->GetSupportedProfiles(audio_encoder, output, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Initialize_0_1(PP_Resource audio_encoder, uint32_t channels, PP_AudioBuffer_SampleRate input_sample_rate, PP_AudioBuffer_SampleSize input_sample_size, PP_AudioProfile output_profile, uint32_t initial_bitrate, PP_HardwareAcceleration acceleration, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioEncoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Initialize\""); + AddProp(ss, "audio_encoder", ToString_PP_Resource(audio_encoder)); + AddProp(ss, "channels", ToString_uint32_t(channels)); + AddProp(ss, "input_sample_rate", ToString_PP_AudioBuffer_SampleRate(input_sample_rate)); + AddProp(ss, "input_sample_size", ToString_PP_AudioBuffer_SampleSize(input_sample_size)); + AddProp(ss, "output_profile", ToString_PP_AudioProfile(output_profile)); + AddProp(ss, "initial_bitrate", ToString_uint32_t(initial_bitrate)); + AddProp(ss, "acceleration", ToString_PP_HardwareAcceleration(acceleration)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_AudioEncoder_0_1*)RealGetInterface("PPB_AudioEncoder;0.1"))->Initialize(audio_encoder, channels, input_sample_rate, input_sample_size, output_profile, initial_bitrate, acceleration, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetNumberOfSamples_0_1(PP_Resource audio_encoder) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioEncoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetNumberOfSamples\""); + AddProp(ss, "audio_encoder", ToString_PP_Resource(audio_encoder)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_AudioEncoder_0_1*)RealGetInterface("PPB_AudioEncoder;0.1"))->GetNumberOfSamples(audio_encoder); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetBuffer_0_1(PP_Resource audio_encoder, PP_Resource* audio_buffer, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioEncoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetBuffer\""); + AddProp(ss, "audio_encoder", ToString_PP_Resource(audio_encoder)); + AddProp(ss, "audio_buffer", PointerToString(audio_buffer)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Resource(iterator, *audio_buffer); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_AudioEncoder_0_1*)RealGetInterface("PPB_AudioEncoder;0.1"))->GetBuffer(audio_encoder, audio_buffer, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!audio_buffer) { + AddProp(os, "audio_buffer", ToString_PP_Resource(audio_buffer)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Encode_0_1(PP_Resource audio_encoder, PP_Resource audio_buffer, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioEncoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Encode\""); + AddProp(ss, "audio_encoder", ToString_PP_Resource(audio_encoder)); + AddProp(ss, "audio_buffer", ToString_PP_Resource(audio_buffer)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_AudioEncoder_0_1*)RealGetInterface("PPB_AudioEncoder;0.1"))->Encode(audio_encoder, audio_buffer, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetBitstreamBuffer_0_1(PP_Resource audio_encoder, struct PP_AudioBitstreamBuffer* bitstream_buffer, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioEncoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetBitstreamBuffer\""); + AddProp(ss, "audio_encoder", ToString_PP_Resource(audio_encoder)); + AddProp(ss, "bitstream_buffer", PointerToString(bitstream_buffer)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!bitstream_buffer) { + iterator.skip(); + FromJSON_PP_AudioBitstreamBuffer(iterator, *bitstream_buffer); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_AudioEncoder_0_1*)RealGetInterface("PPB_AudioEncoder;0.1"))->GetBitstreamBuffer(audio_encoder, bitstream_buffer, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!bitstream_buffer) { + AddProp(os, "bitstream_buffer", ToString_PP_AudioBitstreamBuffer(bitstream_buffer)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void RecycleBitstreamBuffer_0_1(PP_Resource audio_encoder, const struct PP_AudioBitstreamBuffer* bitstream_buffer) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioEncoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"RecycleBitstreamBuffer\""); + AddProp(ss, "audio_encoder", ToString_PP_Resource(audio_encoder)); + AddProp(ss, "bitstream_buffer", ToString_PP_AudioBitstreamBuffer(bitstream_buffer)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_AudioEncoder_0_1*)RealGetInterface("PPB_AudioEncoder;0.1"))->RecycleBitstreamBuffer(audio_encoder, bitstream_buffer); +#endif // !INTERPOSE +} +static void RequestBitrateChange_0_1(PP_Resource audio_encoder, uint32_t bitrate) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioEncoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"RequestBitrateChange\""); + AddProp(ss, "audio_encoder", ToString_PP_Resource(audio_encoder)); + AddProp(ss, "bitrate", ToString_uint32_t(bitrate)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_AudioEncoder_0_1*)RealGetInterface("PPB_AudioEncoder;0.1"))->RequestBitrateChange(audio_encoder, bitrate); +#endif // !INTERPOSE +} +static void Close_0_1(PP_Resource audio_encoder) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioEncoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Close\""); + AddProp(ss, "audio_encoder", ToString_PP_Resource(audio_encoder)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_AudioEncoder_0_1*)RealGetInterface("PPB_AudioEncoder;0.1"))->Close(audio_encoder); +#endif // !INTERPOSE +} +} +static PPB_AudioEncoder_0_1 _PPB_AudioEncoder_0_1 = { + ns_PPB_AudioEncoder_0_1::Create_0_1, + ns_PPB_AudioEncoder_0_1::IsAudioEncoder_0_1, + ns_PPB_AudioEncoder_0_1::GetSupportedProfiles_0_1, + ns_PPB_AudioEncoder_0_1::Initialize_0_1, + ns_PPB_AudioEncoder_0_1::GetNumberOfSamples_0_1, + ns_PPB_AudioEncoder_0_1::GetBuffer_0_1, + ns_PPB_AudioEncoder_0_1::Encode_0_1, + ns_PPB_AudioEncoder_0_1::GetBitstreamBuffer_0_1, + ns_PPB_AudioEncoder_0_1::RecycleBitstreamBuffer_0_1, + ns_PPB_AudioEncoder_0_1::RequestBitrateChange_0_1, + ns_PPB_AudioEncoder_0_1::Close_0_1, +}; +const string ToString_PPB_AudioEncoder(const PPB_AudioEncoder_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Compositor_0_1 { +static PP_Bool IsCompositor_0_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Compositor\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"IsCompositor\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Compositor_0_1*)RealGetInterface("PPB_Compositor;0.1"))->IsCompositor(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource Create_0_1(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Compositor\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Compositor_0_1*)RealGetInterface("PPB_Compositor;0.1"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource AddLayer_0_1(PP_Resource compositor) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Compositor\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"AddLayer\""); + AddProp(ss, "compositor", ToString_PP_Resource(compositor)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Compositor_0_1*)RealGetInterface("PPB_Compositor;0.1"))->AddLayer(compositor); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t CommitLayers_0_1(PP_Resource compositor, struct PP_CompletionCallback cc) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Compositor\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"CommitLayers\""); + AddProp(ss, "compositor", ToString_PP_Resource(compositor)); + AddProp(ss, "cc", ToString_PP_CompletionCallback(cc)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_cc; + logging_cc.func = &Logging_PP_CompletionCallback; + logging_cc.user_data = new PP_CompletionCallback(cc); + logging_cc.flags = cc.flags; + int32_t rval = ((PPB_Compositor_0_1*)RealGetInterface("PPB_Compositor;0.1"))->CommitLayers(compositor, logging_cc); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t ResetLayers_0_1(PP_Resource compositor) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Compositor\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"ResetLayers\""); + AddProp(ss, "compositor", ToString_PP_Resource(compositor)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Compositor_0_1*)RealGetInterface("PPB_Compositor;0.1"))->ResetLayers(compositor); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_Compositor_0_1 _PPB_Compositor_0_1 = { + ns_PPB_Compositor_0_1::IsCompositor_0_1, + ns_PPB_Compositor_0_1::Create_0_1, + ns_PPB_Compositor_0_1::AddLayer_0_1, + ns_PPB_Compositor_0_1::CommitLayers_0_1, + ns_PPB_Compositor_0_1::ResetLayers_0_1, +}; +const string ToString_PPB_Compositor(const PPB_Compositor_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_BlendMode(const PP_BlendMode *v) { + switch (*v) { + case 0: + return "\"PP_BLENDMODE_NONE\""; + case 1: + return "\"PP_BLENDMODE_SRC_OVER\""; + default: + return "\"???\""; + } +} +const string ToString_PP_BlendMode(const PP_BlendMode &v) { + return ToString_PP_BlendMode(&v); +} +void FromJSON_PP_BlendMode(JSONIterator& iterator, PP_BlendMode &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_BlendMode(v); +} +namespace ns_PPB_CompositorLayer_0_1 { +static PP_Bool IsCompositorLayer_0_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CompositorLayer\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"IsCompositorLayer\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_CompositorLayer_0_1*)RealGetInterface("PPB_CompositorLayer;0.1"))->IsCompositorLayer(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SetColor_0_1(PP_Resource layer, float red, float green, float blue, float alpha, const struct PP_Size* size) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CompositorLayer\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"SetColor\""); + AddProp(ss, "layer", ToString_PP_Resource(layer)); + AddProp(ss, "red", ToString_float_t(red)); + AddProp(ss, "green", ToString_float_t(green)); + AddProp(ss, "blue", ToString_float_t(blue)); + AddProp(ss, "alpha", ToString_float_t(alpha)); + AddProp(ss, "size", ToString_PP_Size(size)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_CompositorLayer_0_1*)RealGetInterface("PPB_CompositorLayer;0.1"))->SetColor(layer, red, green, blue, alpha, size); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SetTexture_0_1(PP_Resource layer, PP_Resource context, uint32_t texture, const struct PP_Size* size, struct PP_CompletionCallback cc) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CompositorLayer\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"SetTexture\""); + AddProp(ss, "layer", ToString_PP_Resource(layer)); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "texture", ToString_uint32_t(texture)); + AddProp(ss, "size", ToString_PP_Size(size)); + AddProp(ss, "cc", ToString_PP_CompletionCallback(cc)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_cc; + logging_cc.func = &Logging_PP_CompletionCallback; + logging_cc.user_data = new PP_CompletionCallback(cc); + logging_cc.flags = cc.flags; + int32_t rval = ((PPB_CompositorLayer_0_1*)RealGetInterface("PPB_CompositorLayer;0.1"))->SetTexture(layer, context, texture, size, logging_cc); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping SetTexture */ +static int32_t SetImage_0_1(PP_Resource layer, PP_Resource image_data, const struct PP_Size* size, struct PP_CompletionCallback cc) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CompositorLayer\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"SetImage\""); + AddProp(ss, "layer", ToString_PP_Resource(layer)); + AddProp(ss, "image_data", ToString_PP_Resource(image_data)); + AddProp(ss, "size", ToString_PP_Size(size)); + AddProp(ss, "cc", ToString_PP_CompletionCallback(cc)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_cc; + logging_cc.func = &Logging_PP_CompletionCallback; + logging_cc.user_data = new PP_CompletionCallback(cc); + logging_cc.flags = cc.flags; + int32_t rval = ((PPB_CompositorLayer_0_1*)RealGetInterface("PPB_CompositorLayer;0.1"))->SetImage(layer, image_data, size, logging_cc); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SetClipRect_0_1(PP_Resource layer, const struct PP_Rect* rect) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CompositorLayer\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"SetClipRect\""); + AddProp(ss, "layer", ToString_PP_Resource(layer)); + AddProp(ss, "rect", ToString_PP_Rect(rect)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_CompositorLayer_0_1*)RealGetInterface("PPB_CompositorLayer;0.1"))->SetClipRect(layer, rect); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SetTransform_0_1(PP_Resource layer, const float matrix[16]) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CompositorLayer\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"SetTransform\""); + AddProp(ss, "layer", ToString_PP_Resource(layer)); + { + BeginProp(ss, "matrix"); + BeginElements(ss); + for (uint32_t _n = 0; _n < 16; ++_n) { + AddElement(ss, ToString_float_t(matrix[_n])); + } + EndElements(ss); + } + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_CompositorLayer_0_1*)RealGetInterface("PPB_CompositorLayer;0.1"))->SetTransform(layer, matrix); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SetOpacity_0_1(PP_Resource layer, float opacity) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CompositorLayer\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"SetOpacity\""); + AddProp(ss, "layer", ToString_PP_Resource(layer)); + AddProp(ss, "opacity", ToString_float_t(opacity)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_CompositorLayer_0_1*)RealGetInterface("PPB_CompositorLayer;0.1"))->SetOpacity(layer, opacity); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SetBlendMode_0_1(PP_Resource layer, PP_BlendMode mode) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CompositorLayer\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"SetBlendMode\""); + AddProp(ss, "layer", ToString_PP_Resource(layer)); + AddProp(ss, "mode", ToString_PP_BlendMode(mode)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_CompositorLayer_0_1*)RealGetInterface("PPB_CompositorLayer;0.1"))->SetBlendMode(layer, mode); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SetSourceRect_0_1(PP_Resource layer, const struct PP_FloatRect* rect) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CompositorLayer\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"SetSourceRect\""); + AddProp(ss, "layer", ToString_PP_Resource(layer)); + AddProp(ss, "rect", ToString_PP_FloatRect(rect)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_CompositorLayer_0_1*)RealGetInterface("PPB_CompositorLayer;0.1"))->SetSourceRect(layer, rect); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SetPremultipliedAlpha_0_1(PP_Resource layer, PP_Bool premult) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CompositorLayer\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"SetPremultipliedAlpha\""); + AddProp(ss, "layer", ToString_PP_Resource(layer)); + AddProp(ss, "premult", ToString_PP_Bool(premult)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_CompositorLayer_0_1*)RealGetInterface("PPB_CompositorLayer;0.1"))->SetPremultipliedAlpha(layer, premult); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_CompositorLayer_0_1 _PPB_CompositorLayer_0_1 = { + ns_PPB_CompositorLayer_0_1::IsCompositorLayer_0_1, + ns_PPB_CompositorLayer_0_1::SetColor_0_1, + ns_PPB_CompositorLayer_0_1::SetTexture_0_1, + ns_PPB_CompositorLayer_0_1::SetImage_0_1, + ns_PPB_CompositorLayer_0_1::SetClipRect_0_1, + ns_PPB_CompositorLayer_0_1::SetTransform_0_1, + ns_PPB_CompositorLayer_0_1::SetOpacity_0_1, + ns_PPB_CompositorLayer_0_1::SetBlendMode_0_1, + ns_PPB_CompositorLayer_0_1::SetSourceRect_0_1, + ns_PPB_CompositorLayer_0_1::SetPremultipliedAlpha_0_1, +}; +const string ToString_PPB_CompositorLayer(const PPB_CompositorLayer_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_CompositorLayer_0_2 { +static PP_Bool IsCompositorLayer_0_2(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CompositorLayer\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"IsCompositorLayer\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_CompositorLayer_0_2*)RealGetInterface("PPB_CompositorLayer;0.2"))->IsCompositorLayer(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SetColor_0_2(PP_Resource layer, float red, float green, float blue, float alpha, const struct PP_Size* size) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CompositorLayer\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"SetColor\""); + AddProp(ss, "layer", ToString_PP_Resource(layer)); + AddProp(ss, "red", ToString_float_t(red)); + AddProp(ss, "green", ToString_float_t(green)); + AddProp(ss, "blue", ToString_float_t(blue)); + AddProp(ss, "alpha", ToString_float_t(alpha)); + AddProp(ss, "size", ToString_PP_Size(size)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_CompositorLayer_0_2*)RealGetInterface("PPB_CompositorLayer;0.2"))->SetColor(layer, red, green, blue, alpha, size); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping SetTexture */ +static int32_t SetTexture_0_2(PP_Resource layer, PP_Resource context, uint32_t target, uint32_t texture, const struct PP_Size* size, struct PP_CompletionCallback cc) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CompositorLayer\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"SetTexture\""); + AddProp(ss, "layer", ToString_PP_Resource(layer)); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_uint32_t(target)); + AddProp(ss, "texture", ToString_uint32_t(texture)); + AddProp(ss, "size", ToString_PP_Size(size)); + AddProp(ss, "cc", ToString_PP_CompletionCallback(cc)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_cc; + logging_cc.func = &Logging_PP_CompletionCallback; + logging_cc.user_data = new PP_CompletionCallback(cc); + logging_cc.flags = cc.flags; + int32_t rval = ((PPB_CompositorLayer_0_2*)RealGetInterface("PPB_CompositorLayer;0.2"))->SetTexture(layer, context, target, texture, size, logging_cc); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SetImage_0_2(PP_Resource layer, PP_Resource image_data, const struct PP_Size* size, struct PP_CompletionCallback cc) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CompositorLayer\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"SetImage\""); + AddProp(ss, "layer", ToString_PP_Resource(layer)); + AddProp(ss, "image_data", ToString_PP_Resource(image_data)); + AddProp(ss, "size", ToString_PP_Size(size)); + AddProp(ss, "cc", ToString_PP_CompletionCallback(cc)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_cc; + logging_cc.func = &Logging_PP_CompletionCallback; + logging_cc.user_data = new PP_CompletionCallback(cc); + logging_cc.flags = cc.flags; + int32_t rval = ((PPB_CompositorLayer_0_2*)RealGetInterface("PPB_CompositorLayer;0.2"))->SetImage(layer, image_data, size, logging_cc); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SetClipRect_0_2(PP_Resource layer, const struct PP_Rect* rect) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CompositorLayer\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"SetClipRect\""); + AddProp(ss, "layer", ToString_PP_Resource(layer)); + AddProp(ss, "rect", ToString_PP_Rect(rect)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_CompositorLayer_0_2*)RealGetInterface("PPB_CompositorLayer;0.2"))->SetClipRect(layer, rect); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SetTransform_0_2(PP_Resource layer, const float matrix[16]) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CompositorLayer\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"SetTransform\""); + AddProp(ss, "layer", ToString_PP_Resource(layer)); + { + BeginProp(ss, "matrix"); + BeginElements(ss); + for (uint32_t _n = 0; _n < 16; ++_n) { + AddElement(ss, ToString_float_t(matrix[_n])); + } + EndElements(ss); + } + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_CompositorLayer_0_2*)RealGetInterface("PPB_CompositorLayer;0.2"))->SetTransform(layer, matrix); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SetOpacity_0_2(PP_Resource layer, float opacity) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CompositorLayer\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"SetOpacity\""); + AddProp(ss, "layer", ToString_PP_Resource(layer)); + AddProp(ss, "opacity", ToString_float_t(opacity)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_CompositorLayer_0_2*)RealGetInterface("PPB_CompositorLayer;0.2"))->SetOpacity(layer, opacity); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SetBlendMode_0_2(PP_Resource layer, PP_BlendMode mode) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CompositorLayer\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"SetBlendMode\""); + AddProp(ss, "layer", ToString_PP_Resource(layer)); + AddProp(ss, "mode", ToString_PP_BlendMode(mode)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_CompositorLayer_0_2*)RealGetInterface("PPB_CompositorLayer;0.2"))->SetBlendMode(layer, mode); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SetSourceRect_0_2(PP_Resource layer, const struct PP_FloatRect* rect) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CompositorLayer\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"SetSourceRect\""); + AddProp(ss, "layer", ToString_PP_Resource(layer)); + AddProp(ss, "rect", ToString_PP_FloatRect(rect)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_CompositorLayer_0_2*)RealGetInterface("PPB_CompositorLayer;0.2"))->SetSourceRect(layer, rect); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SetPremultipliedAlpha_0_2(PP_Resource layer, PP_Bool premult) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CompositorLayer\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"SetPremultipliedAlpha\""); + AddProp(ss, "layer", ToString_PP_Resource(layer)); + AddProp(ss, "premult", ToString_PP_Bool(premult)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_CompositorLayer_0_2*)RealGetInterface("PPB_CompositorLayer;0.2"))->SetPremultipliedAlpha(layer, premult); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_CompositorLayer_0_2 _PPB_CompositorLayer_0_2 = { + ns_PPB_CompositorLayer_0_2::IsCompositorLayer_0_2, + ns_PPB_CompositorLayer_0_2::SetColor_0_2, + ns_PPB_CompositorLayer_0_2::SetTexture_0_2, + ns_PPB_CompositorLayer_0_2::SetImage_0_2, + ns_PPB_CompositorLayer_0_2::SetClipRect_0_2, + ns_PPB_CompositorLayer_0_2::SetTransform_0_2, + ns_PPB_CompositorLayer_0_2::SetOpacity_0_2, + ns_PPB_CompositorLayer_0_2::SetBlendMode_0_2, + ns_PPB_CompositorLayer_0_2::SetSourceRect_0_2, + ns_PPB_CompositorLayer_0_2::SetPremultipliedAlpha_0_2, +}; +const string ToString_PPB_CompositorLayer(const PPB_CompositorLayer_0_2 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_LogLevel(const PP_LogLevel *v) { + switch (*v) { + case 0: + return "\"PP_LOGLEVEL_TIP\""; + case 1: + return "\"PP_LOGLEVEL_LOG\""; + case 2: + return "\"PP_LOGLEVEL_WARNING\""; + case 3: + return "\"PP_LOGLEVEL_ERROR\""; + default: + return "\"???\""; + } +} +const string ToString_PP_LogLevel(const PP_LogLevel &v) { + return ToString_PP_LogLevel(&v); +} +void FromJSON_PP_LogLevel(JSONIterator& iterator, PP_LogLevel &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_LogLevel(v); +} +namespace ns_PPB_Console_1_0 { +static void Log_1_0(PP_Instance instance, PP_LogLevel level, struct PP_Var value) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Console\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Log\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "level", ToString_PP_LogLevel(level)); + AddProp(ss, "value", ToString_PP_Var(value)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Console_1_0*)RealGetInterface("PPB_Console;1.0"))->Log(instance, level, value); +#endif // !INTERPOSE +} +static void LogWithSource_1_0(PP_Instance instance, PP_LogLevel level, struct PP_Var source, struct PP_Var value) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Console\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"LogWithSource\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "level", ToString_PP_LogLevel(level)); + AddProp(ss, "source", ToString_PP_Var(source)); + AddProp(ss, "value", ToString_PP_Var(value)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Console_1_0*)RealGetInterface("PPB_Console;1.0"))->LogWithSource(instance, level, source, value); +#endif // !INTERPOSE +} +} +static PPB_Console_1_0 _PPB_Console_1_0 = { + ns_PPB_Console_1_0::Log_1_0, + ns_PPB_Console_1_0::LogWithSource_1_0, +}; +const string ToString_PPB_Console(const PPB_Console_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Core_1_0 { +static void AddRefResource_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Core\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"AddRefResource\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Core_1_0*)RealGetInterface("PPB_Core;1.0"))->AddRefResource(resource); +#endif // !INTERPOSE +} +static void ReleaseResource_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Core\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"ReleaseResource\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Core_1_0*)RealGetInterface("PPB_Core;1.0"))->ReleaseResource(resource); +#endif // !INTERPOSE +} +static PP_Time GetTime_1_0(void) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Core\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetTime\""); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + double rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Time(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + double rval = ((PPB_Core_1_0*)RealGetInterface("PPB_Core;1.0"))->GetTime(); + printf("RPC response: ["); + printf("%s", ToString_PP_Time(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_TimeTicks GetTimeTicks_1_0(void) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Core\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetTimeTicks\""); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + double rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_TimeTicks(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + double rval = ((PPB_Core_1_0*)RealGetInterface("PPB_Core;1.0"))->GetTimeTicks(); + printf("RPC response: ["); + printf("%s", ToString_PP_TimeTicks(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void CallOnMainThread_1_0(int32_t delay_in_milliseconds, struct PP_CompletionCallback callback, int32_t result) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Core\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"CallOnMainThread\""); + AddProp(ss, "delay_in_milliseconds", ToString_int32_t(delay_in_milliseconds)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + AddProp(ss, "result", ToString_int32_t(result)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + ((PPB_Core_1_0*)RealGetInterface("PPB_Core;1.0"))->CallOnMainThread(delay_in_milliseconds, logging_callback, result); +#endif // !INTERPOSE +} +static PP_Bool IsMainThread_1_0(void) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Core\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsMainThread\""); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Core_1_0*)RealGetInterface("PPB_Core;1.0"))->IsMainThread(); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_Core_1_0 _PPB_Core_1_0 = { + ns_PPB_Core_1_0::AddRefResource_1_0, + ns_PPB_Core_1_0::ReleaseResource_1_0, + ns_PPB_Core_1_0::GetTime_1_0, + ns_PPB_Core_1_0::GetTimeTicks_1_0, + ns_PPB_Core_1_0::CallOnMainThread_1_0, + ns_PPB_Core_1_0::IsMainThread_1_0, +}; +const string ToString_PPB_Core(const PPB_Core_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_FileOpenFlags(const PP_FileOpenFlags *v) { + switch (*v) { + case 1 << 0: + return "\"PP_FILEOPENFLAG_READ\""; + case 1 << 1: + return "\"PP_FILEOPENFLAG_WRITE\""; + case 1 << 2: + return "\"PP_FILEOPENFLAG_CREATE\""; + case 1 << 3: + return "\"PP_FILEOPENFLAG_TRUNCATE\""; + case 1 << 4: + return "\"PP_FILEOPENFLAG_EXCLUSIVE\""; + case 1 << 5: + return "\"PP_FILEOPENFLAG_APPEND\""; + default: + return "\"???\""; + } +} +const string ToString_PP_FileOpenFlags(const PP_FileOpenFlags &v) { + return ToString_PP_FileOpenFlags(&v); +} +void FromJSON_PP_FileOpenFlags(JSONIterator& iterator, PP_FileOpenFlags &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_FileOpenFlags(v); +} +namespace ns_PPB_FileIO_1_0 { +static PP_Resource Create_1_0(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileIO\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_FileIO_1_0*)RealGetInterface("PPB_FileIO;1.0"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsFileIO_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileIO\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsFileIO\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_FileIO_1_0*)RealGetInterface("PPB_FileIO;1.0"))->IsFileIO(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Open_1_0(PP_Resource file_io, PP_Resource file_ref, int32_t open_flags, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileIO\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Open\""); + AddProp(ss, "file_io", ToString_PP_Resource(file_io)); + AddProp(ss, "file_ref", ToString_PP_Resource(file_ref)); + AddProp(ss, "open_flags", ToString_int32_t(open_flags)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileIO_1_0*)RealGetInterface("PPB_FileIO;1.0"))->Open(file_io, file_ref, open_flags, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Query_1_0(PP_Resource file_io, struct PP_FileInfo* info, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileIO\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Query\""); + AddProp(ss, "file_io", ToString_PP_Resource(file_io)); + AddProp(ss, "info", PointerToString(info)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!info) { + iterator.skip(); + FromJSON_PP_FileInfo(iterator, *info); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileIO_1_0*)RealGetInterface("PPB_FileIO;1.0"))->Query(file_io, info, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!info) { + AddProp(os, "info", ToString_PP_FileInfo(info)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Touch_1_0(PP_Resource file_io, PP_Time last_access_time, PP_Time last_modified_time, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileIO\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Touch\""); + AddProp(ss, "file_io", ToString_PP_Resource(file_io)); + AddProp(ss, "last_access_time", ToString_PP_Time(last_access_time)); + AddProp(ss, "last_modified_time", ToString_PP_Time(last_modified_time)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileIO_1_0*)RealGetInterface("PPB_FileIO;1.0"))->Touch(file_io, last_access_time, last_modified_time, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Read_1_0(PP_Resource file_io, int64_t offset, char* buffer, int32_t bytes_to_read, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileIO\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Read\""); + AddProp(ss, "file_io", ToString_PP_Resource(file_io)); + AddProp(ss, "offset", ToString_int64_t(offset)); + AddProp(ss, "buffer", ToString_str_t(buffer)); + AddProp(ss, "bytes_to_read", ToString_int32_t(bytes_to_read)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_str_t(iterator, buffer); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileIO_1_0*)RealGetInterface("PPB_FileIO;1.0"))->Read(file_io, offset, buffer, bytes_to_read, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + AddProp(os, "buffer", ToString_str_t(buffer)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Write_1_0(PP_Resource file_io, int64_t offset, const char* buffer, int32_t bytes_to_write, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileIO\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Write\""); + AddProp(ss, "file_io", ToString_PP_Resource(file_io)); + AddProp(ss, "offset", ToString_int64_t(offset)); + AddProp(ss, "buffer", ToString_str_t(buffer)); + AddProp(ss, "bytes_to_write", ToString_int32_t(bytes_to_write)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileIO_1_0*)RealGetInterface("PPB_FileIO;1.0"))->Write(file_io, offset, buffer, bytes_to_write, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SetLength_1_0(PP_Resource file_io, int64_t length, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileIO\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"SetLength\""); + AddProp(ss, "file_io", ToString_PP_Resource(file_io)); + AddProp(ss, "length", ToString_int64_t(length)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileIO_1_0*)RealGetInterface("PPB_FileIO;1.0"))->SetLength(file_io, length, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Flush_1_0(PP_Resource file_io, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileIO\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Flush\""); + AddProp(ss, "file_io", ToString_PP_Resource(file_io)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileIO_1_0*)RealGetInterface("PPB_FileIO;1.0"))->Flush(file_io, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void Close_1_0(PP_Resource file_io) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileIO\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Close\""); + AddProp(ss, "file_io", ToString_PP_Resource(file_io)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_FileIO_1_0*)RealGetInterface("PPB_FileIO;1.0"))->Close(file_io); +#endif // !INTERPOSE +} +/* skipping ReadToArray */ +} +static PPB_FileIO_1_0 _PPB_FileIO_1_0 = { + ns_PPB_FileIO_1_0::Create_1_0, + ns_PPB_FileIO_1_0::IsFileIO_1_0, + ns_PPB_FileIO_1_0::Open_1_0, + ns_PPB_FileIO_1_0::Query_1_0, + ns_PPB_FileIO_1_0::Touch_1_0, + ns_PPB_FileIO_1_0::Read_1_0, + ns_PPB_FileIO_1_0::Write_1_0, + ns_PPB_FileIO_1_0::SetLength_1_0, + ns_PPB_FileIO_1_0::Flush_1_0, + ns_PPB_FileIO_1_0::Close_1_0, +}; +const string ToString_PPB_FileIO(const PPB_FileIO_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_FileIO_1_1 { +static PP_Resource Create_1_1(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileIO\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_FileIO_1_1*)RealGetInterface("PPB_FileIO;1.1"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsFileIO_1_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileIO\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"IsFileIO\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_FileIO_1_1*)RealGetInterface("PPB_FileIO;1.1"))->IsFileIO(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Open_1_1(PP_Resource file_io, PP_Resource file_ref, int32_t open_flags, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileIO\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Open\""); + AddProp(ss, "file_io", ToString_PP_Resource(file_io)); + AddProp(ss, "file_ref", ToString_PP_Resource(file_ref)); + AddProp(ss, "open_flags", ToString_int32_t(open_flags)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileIO_1_1*)RealGetInterface("PPB_FileIO;1.1"))->Open(file_io, file_ref, open_flags, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Query_1_1(PP_Resource file_io, struct PP_FileInfo* info, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileIO\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Query\""); + AddProp(ss, "file_io", ToString_PP_Resource(file_io)); + AddProp(ss, "info", PointerToString(info)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!info) { + iterator.skip(); + FromJSON_PP_FileInfo(iterator, *info); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileIO_1_1*)RealGetInterface("PPB_FileIO;1.1"))->Query(file_io, info, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!info) { + AddProp(os, "info", ToString_PP_FileInfo(info)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Touch_1_1(PP_Resource file_io, PP_Time last_access_time, PP_Time last_modified_time, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileIO\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Touch\""); + AddProp(ss, "file_io", ToString_PP_Resource(file_io)); + AddProp(ss, "last_access_time", ToString_PP_Time(last_access_time)); + AddProp(ss, "last_modified_time", ToString_PP_Time(last_modified_time)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileIO_1_1*)RealGetInterface("PPB_FileIO;1.1"))->Touch(file_io, last_access_time, last_modified_time, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Read_1_1(PP_Resource file_io, int64_t offset, char* buffer, int32_t bytes_to_read, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileIO\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Read\""); + AddProp(ss, "file_io", ToString_PP_Resource(file_io)); + AddProp(ss, "offset", ToString_int64_t(offset)); + AddProp(ss, "buffer", ToString_str_t(buffer)); + AddProp(ss, "bytes_to_read", ToString_int32_t(bytes_to_read)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_str_t(iterator, buffer); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileIO_1_1*)RealGetInterface("PPB_FileIO;1.1"))->Read(file_io, offset, buffer, bytes_to_read, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + AddProp(os, "buffer", ToString_str_t(buffer)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Write_1_1(PP_Resource file_io, int64_t offset, const char* buffer, int32_t bytes_to_write, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileIO\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Write\""); + AddProp(ss, "file_io", ToString_PP_Resource(file_io)); + AddProp(ss, "offset", ToString_int64_t(offset)); + AddProp(ss, "buffer", ToString_str_t(buffer)); + AddProp(ss, "bytes_to_write", ToString_int32_t(bytes_to_write)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileIO_1_1*)RealGetInterface("PPB_FileIO;1.1"))->Write(file_io, offset, buffer, bytes_to_write, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SetLength_1_1(PP_Resource file_io, int64_t length, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileIO\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"SetLength\""); + AddProp(ss, "file_io", ToString_PP_Resource(file_io)); + AddProp(ss, "length", ToString_int64_t(length)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileIO_1_1*)RealGetInterface("PPB_FileIO;1.1"))->SetLength(file_io, length, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Flush_1_1(PP_Resource file_io, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileIO\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Flush\""); + AddProp(ss, "file_io", ToString_PP_Resource(file_io)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileIO_1_1*)RealGetInterface("PPB_FileIO;1.1"))->Flush(file_io, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void Close_1_1(PP_Resource file_io) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileIO\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Close\""); + AddProp(ss, "file_io", ToString_PP_Resource(file_io)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_FileIO_1_1*)RealGetInterface("PPB_FileIO;1.1"))->Close(file_io); +#endif // !INTERPOSE +} +static int32_t ReadToArray_1_1(PP_Resource file_io, int64_t offset, int32_t max_read_length, struct PP_ArrayOutput* output, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileIO\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"ReadToArray\""); + AddProp(ss, "file_io", ToString_PP_Resource(file_io)); + AddProp(ss, "offset", ToString_int64_t(offset)); + AddProp(ss, "max_read_length", ToString_int32_t(max_read_length)); + AddProp(ss, "output", ToString_PP_ArrayOutput(output)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_ArrayOutput(iterator, *output); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileIO_1_1*)RealGetInterface("PPB_FileIO;1.1"))->ReadToArray(file_io, offset, max_read_length, output, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + AddProp(os, "output", ToString_PP_ArrayOutput(output)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_FileIO_1_1 _PPB_FileIO_1_1 = { + ns_PPB_FileIO_1_1::Create_1_1, + ns_PPB_FileIO_1_1::IsFileIO_1_1, + ns_PPB_FileIO_1_1::Open_1_1, + ns_PPB_FileIO_1_1::Query_1_1, + ns_PPB_FileIO_1_1::Touch_1_1, + ns_PPB_FileIO_1_1::Read_1_1, + ns_PPB_FileIO_1_1::Write_1_1, + ns_PPB_FileIO_1_1::SetLength_1_1, + ns_PPB_FileIO_1_1::Flush_1_1, + ns_PPB_FileIO_1_1::Close_1_1, + ns_PPB_FileIO_1_1::ReadToArray_1_1, +}; +const string ToString_PPB_FileIO(const PPB_FileIO_1_1 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_MakeDirectoryFlags(const PP_MakeDirectoryFlags *v) { + switch (*v) { + case 0 << 0: + return "\"PP_MAKEDIRECTORYFLAG_NONE\""; + case 1 << 0: + return "\"PP_MAKEDIRECTORYFLAG_WITH_ANCESTORS\""; + case 1 << 1: + return "\"PP_MAKEDIRECTORYFLAG_EXCLUSIVE\""; + default: + return "\"???\""; + } +} +const string ToString_PP_MakeDirectoryFlags(const PP_MakeDirectoryFlags &v) { + return ToString_PP_MakeDirectoryFlags(&v); +} +void FromJSON_PP_MakeDirectoryFlags(JSONIterator& iterator, PP_MakeDirectoryFlags &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_MakeDirectoryFlags(v); +} +namespace ns_PPB_FileRef_1_0 { +static PP_Resource Create_1_0(PP_Resource file_system, const char* path) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "file_system", ToString_PP_Resource(file_system)); + AddProp(ss, "path", ToString_str_t(path)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_FileRef_1_0*)RealGetInterface("PPB_FileRef;1.0"))->Create(file_system, path); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsFileRef_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsFileRef\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_FileRef_1_0*)RealGetInterface("PPB_FileRef;1.0"))->IsFileRef(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_FileSystemType GetFileSystemType_1_0(PP_Resource file_ref) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetFileSystemType\""); + AddProp(ss, "file_ref", ToString_PP_Resource(file_ref)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_FileSystemType rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_FileSystemType(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_FileSystemType rval = ((PPB_FileRef_1_0*)RealGetInterface("PPB_FileRef;1.0"))->GetFileSystemType(file_ref); + printf("RPC response: ["); + printf("%s", ToString_PP_FileSystemType(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetName_1_0(PP_Resource file_ref) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetName\""); + AddProp(ss, "file_ref", ToString_PP_Resource(file_ref)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_FileRef_1_0*)RealGetInterface("PPB_FileRef;1.0"))->GetName(file_ref); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetPath_1_0(PP_Resource file_ref) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetPath\""); + AddProp(ss, "file_ref", ToString_PP_Resource(file_ref)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_FileRef_1_0*)RealGetInterface("PPB_FileRef;1.0"))->GetPath(file_ref); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource GetParent_1_0(PP_Resource file_ref) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetParent\""); + AddProp(ss, "file_ref", ToString_PP_Resource(file_ref)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_FileRef_1_0*)RealGetInterface("PPB_FileRef;1.0"))->GetParent(file_ref); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t MakeDirectory_1_0(PP_Resource directory_ref, PP_Bool make_ancestors, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"MakeDirectory\""); + AddProp(ss, "directory_ref", ToString_PP_Resource(directory_ref)); + AddProp(ss, "make_ancestors", ToString_PP_Bool(make_ancestors)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileRef_1_0*)RealGetInterface("PPB_FileRef;1.0"))->MakeDirectory(directory_ref, make_ancestors, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping MakeDirectory */ +static int32_t Touch_1_0(PP_Resource file_ref, PP_Time last_access_time, PP_Time last_modified_time, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Touch\""); + AddProp(ss, "file_ref", ToString_PP_Resource(file_ref)); + AddProp(ss, "last_access_time", ToString_PP_Time(last_access_time)); + AddProp(ss, "last_modified_time", ToString_PP_Time(last_modified_time)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileRef_1_0*)RealGetInterface("PPB_FileRef;1.0"))->Touch(file_ref, last_access_time, last_modified_time, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Delete_1_0(PP_Resource file_ref, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Delete\""); + AddProp(ss, "file_ref", ToString_PP_Resource(file_ref)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileRef_1_0*)RealGetInterface("PPB_FileRef;1.0"))->Delete(file_ref, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Rename_1_0(PP_Resource file_ref, PP_Resource new_file_ref, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Rename\""); + AddProp(ss, "file_ref", ToString_PP_Resource(file_ref)); + AddProp(ss, "new_file_ref", ToString_PP_Resource(new_file_ref)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileRef_1_0*)RealGetInterface("PPB_FileRef;1.0"))->Rename(file_ref, new_file_ref, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping Query */ +/* skipping ReadDirectoryEntries */ +} +static PPB_FileRef_1_0 _PPB_FileRef_1_0 = { + ns_PPB_FileRef_1_0::Create_1_0, + ns_PPB_FileRef_1_0::IsFileRef_1_0, + ns_PPB_FileRef_1_0::GetFileSystemType_1_0, + ns_PPB_FileRef_1_0::GetName_1_0, + ns_PPB_FileRef_1_0::GetPath_1_0, + ns_PPB_FileRef_1_0::GetParent_1_0, + ns_PPB_FileRef_1_0::MakeDirectory_1_0, + ns_PPB_FileRef_1_0::Touch_1_0, + ns_PPB_FileRef_1_0::Delete_1_0, + ns_PPB_FileRef_1_0::Rename_1_0, +}; +const string ToString_PPB_FileRef(const PPB_FileRef_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_FileRef_1_1 { +static PP_Resource Create_1_1(PP_Resource file_system, const char* path) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "file_system", ToString_PP_Resource(file_system)); + AddProp(ss, "path", ToString_str_t(path)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_FileRef_1_1*)RealGetInterface("PPB_FileRef;1.1"))->Create(file_system, path); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsFileRef_1_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"IsFileRef\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_FileRef_1_1*)RealGetInterface("PPB_FileRef;1.1"))->IsFileRef(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_FileSystemType GetFileSystemType_1_1(PP_Resource file_ref) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"GetFileSystemType\""); + AddProp(ss, "file_ref", ToString_PP_Resource(file_ref)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_FileSystemType rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_FileSystemType(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_FileSystemType rval = ((PPB_FileRef_1_1*)RealGetInterface("PPB_FileRef;1.1"))->GetFileSystemType(file_ref); + printf("RPC response: ["); + printf("%s", ToString_PP_FileSystemType(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetName_1_1(PP_Resource file_ref) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"GetName\""); + AddProp(ss, "file_ref", ToString_PP_Resource(file_ref)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_FileRef_1_1*)RealGetInterface("PPB_FileRef;1.1"))->GetName(file_ref); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetPath_1_1(PP_Resource file_ref) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"GetPath\""); + AddProp(ss, "file_ref", ToString_PP_Resource(file_ref)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_FileRef_1_1*)RealGetInterface("PPB_FileRef;1.1"))->GetPath(file_ref); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource GetParent_1_1(PP_Resource file_ref) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"GetParent\""); + AddProp(ss, "file_ref", ToString_PP_Resource(file_ref)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_FileRef_1_1*)RealGetInterface("PPB_FileRef;1.1"))->GetParent(file_ref); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t MakeDirectory_1_1(PP_Resource directory_ref, PP_Bool make_ancestors, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"MakeDirectory\""); + AddProp(ss, "directory_ref", ToString_PP_Resource(directory_ref)); + AddProp(ss, "make_ancestors", ToString_PP_Bool(make_ancestors)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileRef_1_1*)RealGetInterface("PPB_FileRef;1.1"))->MakeDirectory(directory_ref, make_ancestors, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping MakeDirectory */ +static int32_t Touch_1_1(PP_Resource file_ref, PP_Time last_access_time, PP_Time last_modified_time, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Touch\""); + AddProp(ss, "file_ref", ToString_PP_Resource(file_ref)); + AddProp(ss, "last_access_time", ToString_PP_Time(last_access_time)); + AddProp(ss, "last_modified_time", ToString_PP_Time(last_modified_time)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileRef_1_1*)RealGetInterface("PPB_FileRef;1.1"))->Touch(file_ref, last_access_time, last_modified_time, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Delete_1_1(PP_Resource file_ref, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Delete\""); + AddProp(ss, "file_ref", ToString_PP_Resource(file_ref)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileRef_1_1*)RealGetInterface("PPB_FileRef;1.1"))->Delete(file_ref, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Rename_1_1(PP_Resource file_ref, PP_Resource new_file_ref, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Rename\""); + AddProp(ss, "file_ref", ToString_PP_Resource(file_ref)); + AddProp(ss, "new_file_ref", ToString_PP_Resource(new_file_ref)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileRef_1_1*)RealGetInterface("PPB_FileRef;1.1"))->Rename(file_ref, new_file_ref, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Query_1_1(PP_Resource file_ref, struct PP_FileInfo* info, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Query\""); + AddProp(ss, "file_ref", ToString_PP_Resource(file_ref)); + AddProp(ss, "info", PointerToString(info)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!info) { + iterator.skip(); + FromJSON_PP_FileInfo(iterator, *info); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileRef_1_1*)RealGetInterface("PPB_FileRef;1.1"))->Query(file_ref, info, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!info) { + AddProp(os, "info", ToString_PP_FileInfo(info)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t ReadDirectoryEntries_1_1(PP_Resource file_ref, struct PP_ArrayOutput output, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"ReadDirectoryEntries\""); + AddProp(ss, "file_ref", ToString_PP_Resource(file_ref)); + AddProp(ss, "output", ToString_PP_ArrayOutput(output)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileRef_1_1*)RealGetInterface("PPB_FileRef;1.1"))->ReadDirectoryEntries(file_ref, output, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_FileRef_1_1 _PPB_FileRef_1_1 = { + ns_PPB_FileRef_1_1::Create_1_1, + ns_PPB_FileRef_1_1::IsFileRef_1_1, + ns_PPB_FileRef_1_1::GetFileSystemType_1_1, + ns_PPB_FileRef_1_1::GetName_1_1, + ns_PPB_FileRef_1_1::GetPath_1_1, + ns_PPB_FileRef_1_1::GetParent_1_1, + ns_PPB_FileRef_1_1::MakeDirectory_1_1, + ns_PPB_FileRef_1_1::Touch_1_1, + ns_PPB_FileRef_1_1::Delete_1_1, + ns_PPB_FileRef_1_1::Rename_1_1, + ns_PPB_FileRef_1_1::Query_1_1, + ns_PPB_FileRef_1_1::ReadDirectoryEntries_1_1, +}; +const string ToString_PPB_FileRef(const PPB_FileRef_1_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_FileRef_1_2 { +static PP_Resource Create_1_2(PP_Resource file_system, const char* path) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "file_system", ToString_PP_Resource(file_system)); + AddProp(ss, "path", ToString_str_t(path)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_FileRef_1_2*)RealGetInterface("PPB_FileRef;1.2"))->Create(file_system, path); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsFileRef_1_2(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"IsFileRef\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_FileRef_1_2*)RealGetInterface("PPB_FileRef;1.2"))->IsFileRef(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_FileSystemType GetFileSystemType_1_2(PP_Resource file_ref) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"GetFileSystemType\""); + AddProp(ss, "file_ref", ToString_PP_Resource(file_ref)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_FileSystemType rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_FileSystemType(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_FileSystemType rval = ((PPB_FileRef_1_2*)RealGetInterface("PPB_FileRef;1.2"))->GetFileSystemType(file_ref); + printf("RPC response: ["); + printf("%s", ToString_PP_FileSystemType(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetName_1_2(PP_Resource file_ref) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"GetName\""); + AddProp(ss, "file_ref", ToString_PP_Resource(file_ref)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_FileRef_1_2*)RealGetInterface("PPB_FileRef;1.2"))->GetName(file_ref); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetPath_1_2(PP_Resource file_ref) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"GetPath\""); + AddProp(ss, "file_ref", ToString_PP_Resource(file_ref)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_FileRef_1_2*)RealGetInterface("PPB_FileRef;1.2"))->GetPath(file_ref); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource GetParent_1_2(PP_Resource file_ref) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"GetParent\""); + AddProp(ss, "file_ref", ToString_PP_Resource(file_ref)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_FileRef_1_2*)RealGetInterface("PPB_FileRef;1.2"))->GetParent(file_ref); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping MakeDirectory */ +static int32_t MakeDirectory_1_2(PP_Resource directory_ref, int32_t make_directory_flags, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"MakeDirectory\""); + AddProp(ss, "directory_ref", ToString_PP_Resource(directory_ref)); + AddProp(ss, "make_directory_flags", ToString_int32_t(make_directory_flags)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileRef_1_2*)RealGetInterface("PPB_FileRef;1.2"))->MakeDirectory(directory_ref, make_directory_flags, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Touch_1_2(PP_Resource file_ref, PP_Time last_access_time, PP_Time last_modified_time, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"Touch\""); + AddProp(ss, "file_ref", ToString_PP_Resource(file_ref)); + AddProp(ss, "last_access_time", ToString_PP_Time(last_access_time)); + AddProp(ss, "last_modified_time", ToString_PP_Time(last_modified_time)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileRef_1_2*)RealGetInterface("PPB_FileRef;1.2"))->Touch(file_ref, last_access_time, last_modified_time, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Delete_1_2(PP_Resource file_ref, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"Delete\""); + AddProp(ss, "file_ref", ToString_PP_Resource(file_ref)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileRef_1_2*)RealGetInterface("PPB_FileRef;1.2"))->Delete(file_ref, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Rename_1_2(PP_Resource file_ref, PP_Resource new_file_ref, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"Rename\""); + AddProp(ss, "file_ref", ToString_PP_Resource(file_ref)); + AddProp(ss, "new_file_ref", ToString_PP_Resource(new_file_ref)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileRef_1_2*)RealGetInterface("PPB_FileRef;1.2"))->Rename(file_ref, new_file_ref, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Query_1_2(PP_Resource file_ref, struct PP_FileInfo* info, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"Query\""); + AddProp(ss, "file_ref", ToString_PP_Resource(file_ref)); + AddProp(ss, "info", PointerToString(info)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!info) { + iterator.skip(); + FromJSON_PP_FileInfo(iterator, *info); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileRef_1_2*)RealGetInterface("PPB_FileRef;1.2"))->Query(file_ref, info, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!info) { + AddProp(os, "info", ToString_PP_FileInfo(info)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t ReadDirectoryEntries_1_2(PP_Resource file_ref, struct PP_ArrayOutput output, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRef\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"ReadDirectoryEntries\""); + AddProp(ss, "file_ref", ToString_PP_Resource(file_ref)); + AddProp(ss, "output", ToString_PP_ArrayOutput(output)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileRef_1_2*)RealGetInterface("PPB_FileRef;1.2"))->ReadDirectoryEntries(file_ref, output, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_FileRef_1_2 _PPB_FileRef_1_2 = { + ns_PPB_FileRef_1_2::Create_1_2, + ns_PPB_FileRef_1_2::IsFileRef_1_2, + ns_PPB_FileRef_1_2::GetFileSystemType_1_2, + ns_PPB_FileRef_1_2::GetName_1_2, + ns_PPB_FileRef_1_2::GetPath_1_2, + ns_PPB_FileRef_1_2::GetParent_1_2, + ns_PPB_FileRef_1_2::MakeDirectory_1_2, + ns_PPB_FileRef_1_2::Touch_1_2, + ns_PPB_FileRef_1_2::Delete_1_2, + ns_PPB_FileRef_1_2::Rename_1_2, + ns_PPB_FileRef_1_2::Query_1_2, + ns_PPB_FileRef_1_2::ReadDirectoryEntries_1_2, +}; +const string ToString_PPB_FileRef(const PPB_FileRef_1_2 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_FileSystem_1_0 { +static PP_Resource Create_1_0(PP_Instance instance, PP_FileSystemType type) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileSystem\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "type", ToString_PP_FileSystemType(type)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_FileSystem_1_0*)RealGetInterface("PPB_FileSystem;1.0"))->Create(instance, type); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsFileSystem_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileSystem\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsFileSystem\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_FileSystem_1_0*)RealGetInterface("PPB_FileSystem;1.0"))->IsFileSystem(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Open_1_0(PP_Resource file_system, int64_t expected_size, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileSystem\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Open\""); + AddProp(ss, "file_system", ToString_PP_Resource(file_system)); + AddProp(ss, "expected_size", ToString_int64_t(expected_size)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileSystem_1_0*)RealGetInterface("PPB_FileSystem;1.0"))->Open(file_system, expected_size, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_FileSystemType GetType_1_0(PP_Resource file_system) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileSystem\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetType\""); + AddProp(ss, "file_system", ToString_PP_Resource(file_system)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_FileSystemType rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_FileSystemType(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_FileSystemType rval = ((PPB_FileSystem_1_0*)RealGetInterface("PPB_FileSystem;1.0"))->GetType(file_system); + printf("RPC response: ["); + printf("%s", ToString_PP_FileSystemType(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_FileSystem_1_0 _PPB_FileSystem_1_0 = { + ns_PPB_FileSystem_1_0::Create_1_0, + ns_PPB_FileSystem_1_0::IsFileSystem_1_0, + ns_PPB_FileSystem_1_0::Open_1_0, + ns_PPB_FileSystem_1_0::GetType_1_0, +}; +const string ToString_PPB_FileSystem(const PPB_FileSystem_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Fullscreen_1_0 { +static PP_Bool IsFullscreen_1_0(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Fullscreen\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsFullscreen\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Fullscreen_1_0*)RealGetInterface("PPB_Fullscreen;1.0"))->IsFullscreen(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool SetFullscreen_1_0(PP_Instance instance, PP_Bool fullscreen) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Fullscreen\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"SetFullscreen\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "fullscreen", ToString_PP_Bool(fullscreen)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Fullscreen_1_0*)RealGetInterface("PPB_Fullscreen;1.0"))->SetFullscreen(instance, fullscreen); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetScreenSize_1_0(PP_Instance instance, struct PP_Size* size) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Fullscreen\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetScreenSize\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "size", PointerToString(size)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!size) { + iterator.skip(); + FromJSON_PP_Size(iterator, *size); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Fullscreen_1_0*)RealGetInterface("PPB_Fullscreen;1.0"))->GetScreenSize(instance, size); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!size) { + AddProp(os, "size", ToString_PP_Size(size)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_Fullscreen_1_0 _PPB_Fullscreen_1_0 = { + ns_PPB_Fullscreen_1_0::IsFullscreen_1_0, + ns_PPB_Fullscreen_1_0::SetFullscreen_1_0, + ns_PPB_Fullscreen_1_0::GetScreenSize_1_0, +}; +const string ToString_PPB_Fullscreen(const PPB_Fullscreen_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_GamepadSampleData(const PP_GamepadSampleData *v) { + if (!v) { + return "null"; + } + return ToString_PP_GamepadSampleData(*v); +} +const string ToString_PP_GamepadSampleData(const PP_GamepadSampleData &v) { + stringstream x; + BeginProps(x); + AddProp(x, "axes_length", ToString_uint32_t(v.axes_length)); + { + BeginProp(x, "axes"); + BeginElements(x); + for (uint32_t _n = 0; _n < 16; ++_n) { + AddElement(x, ToString_float_t(v.axes[_n])); + } + EndElements(x); + } + AddProp(x, "buttons_length", ToString_uint32_t(v.buttons_length)); + { + BeginProp(x, "buttons"); + BeginElements(x); + for (uint32_t _n = 0; _n < 32; ++_n) { + AddElement(x, ToString_float_t(v.buttons[_n])); + } + EndElements(x); + } + AddProp(x, "timestamp", ToString_double_t(v.timestamp)); + { + BeginProp(x, "id"); + BeginElements(x); + for (uint32_t _n = 0; _n < 128; ++_n) { + AddElement(x, ToString_uint16_t(v.id[_n])); + } + EndElements(x); + } + AddProp(x, "connected", ToString_PP_Bool(v.connected)); + { + BeginProp(x, "unused_pad_"); + BeginElements(x); + for (uint32_t _n = 0; _n < 4; ++_n) { + AddElement(x, ToString_int8_t(v.unused_pad_[_n])); + } + EndElements(x); + } + EndProps(x); + return x.str(); +} +void FromJSON_PP_GamepadSampleData(JSONIterator& iterator, PP_GamepadSampleData &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_uint32_t(iterator, value.axes_length); + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > 16) { + Fail("Too many items in array\n", ""); + } + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_float_t(iterator, (value.axes)[_n]); + } + // FIXME Null out remaining items? + } + iterator.skip(); + FromJSON_uint32_t(iterator, value.buttons_length); + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > 32) { + Fail("Too many items in array\n", ""); + } + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_float_t(iterator, (value.buttons)[_n]); + } + // FIXME Null out remaining items? + } + iterator.skip(); + FromJSON_double_t(iterator, value.timestamp); + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > 128) { + Fail("Too many items in array\n", ""); + } + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_uint16_t(iterator, (value.id)[_n]); + } + // FIXME Null out remaining items? + } + iterator.skip(); + FromJSON_PP_Bool(iterator, value.connected); + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > 4) { + Fail("Too many items in array\n", ""); + } + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_int8_t(iterator, (value.unused_pad_)[_n]); + } + // FIXME Null out remaining items? + } +} +const string ToString_PP_GamepadsSampleData(const PP_GamepadsSampleData *v) { + if (!v) { + return "null"; + } + return ToString_PP_GamepadsSampleData(*v); +} +const string ToString_PP_GamepadsSampleData(const PP_GamepadsSampleData &v) { + stringstream x; + BeginProps(x); + AddProp(x, "length", ToString_uint32_t(v.length)); + { + BeginProp(x, "unused_pad_"); + BeginElements(x); + for (uint32_t _n = 0; _n < 4; ++_n) { + AddElement(x, ToString_int8_t(v.unused_pad_[_n])); + } + EndElements(x); + } + { + BeginProp(x, "items"); + BeginElements(x); + for (uint32_t _n = 0; _n < 4; ++_n) { + AddElement(x, ToString_PP_GamepadSampleData(v.items[_n])); + } + EndElements(x); + } + EndProps(x); + return x.str(); +} +void FromJSON_PP_GamepadsSampleData(JSONIterator& iterator, PP_GamepadsSampleData &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_uint32_t(iterator, value.length); + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > 4) { + Fail("Too many items in array\n", ""); + } + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_int8_t(iterator, (value.unused_pad_)[_n]); + } + // FIXME Null out remaining items? + } + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > 4) { + Fail("Too many items in array\n", ""); + } + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_PP_GamepadSampleData(iterator, (value.items)[_n]); + } + // FIXME Null out remaining items? + } +} +namespace ns_PPB_Gamepad_1_0 { +static void Sample_1_0(PP_Instance instance, struct PP_GamepadsSampleData* data) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Gamepad\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Sample\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "data", PointerToString(data)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + if (!!data) { + iterator.skip(); + FromJSON_PP_GamepadsSampleData(iterator, *data); + } +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Gamepad_1_0*)RealGetInterface("PPB_Gamepad;1.0"))->Sample(instance, data); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + if (!!data) { + AddProp(os, "data", ToString_PP_GamepadsSampleData(data)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +} +static PPB_Gamepad_1_0 _PPB_Gamepad_1_0 = { + ns_PPB_Gamepad_1_0::Sample_1_0, +}; +const string ToString_PPB_Gamepad(const PPB_Gamepad_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Graphics2D_1_0 { +static PP_Resource Create_1_0(PP_Instance instance, const struct PP_Size* size, PP_Bool is_always_opaque) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics2D\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "size", ToString_PP_Size(size)); + AddProp(ss, "is_always_opaque", ToString_PP_Bool(is_always_opaque)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Graphics2D_1_0*)RealGetInterface("PPB_Graphics2D;1.0"))->Create(instance, size, is_always_opaque); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsGraphics2D_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics2D\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsGraphics2D\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Graphics2D_1_0*)RealGetInterface("PPB_Graphics2D;1.0"))->IsGraphics2D(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool Describe_1_0(PP_Resource graphics_2d, struct PP_Size* size, PP_Bool* is_always_opaque) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics2D\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Describe\""); + AddProp(ss, "graphics_2d", ToString_PP_Resource(graphics_2d)); + AddProp(ss, "size", PointerToString(size)); + AddProp(ss, "is_always_opaque", PointerToString(is_always_opaque)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!size) { + iterator.skip(); + FromJSON_PP_Size(iterator, *size); + } + iterator.skip(); + FromJSON_PP_Bool(iterator, *is_always_opaque); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Graphics2D_1_0*)RealGetInterface("PPB_Graphics2D;1.0"))->Describe(graphics_2d, size, is_always_opaque); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!size) { + AddProp(os, "size", ToString_PP_Size(size)); + } + AddProp(os, "is_always_opaque", ToString_PP_Bool(is_always_opaque)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void PaintImageData_1_0(PP_Resource graphics_2d, PP_Resource image_data, const struct PP_Point* top_left, const struct PP_Rect* src_rect) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics2D\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"PaintImageData\""); + AddProp(ss, "graphics_2d", ToString_PP_Resource(graphics_2d)); + AddProp(ss, "image_data", ToString_PP_Resource(image_data)); + AddProp(ss, "top_left", ToString_PP_Point(top_left)); + AddProp(ss, "src_rect", ToString_PP_Rect(src_rect)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Graphics2D_1_0*)RealGetInterface("PPB_Graphics2D;1.0"))->PaintImageData(graphics_2d, image_data, top_left, src_rect); +#endif // !INTERPOSE +} +static void Scroll_1_0(PP_Resource graphics_2d, const struct PP_Rect* clip_rect, const struct PP_Point* amount) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics2D\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Scroll\""); + AddProp(ss, "graphics_2d", ToString_PP_Resource(graphics_2d)); + AddProp(ss, "clip_rect", ToString_PP_Rect(clip_rect)); + AddProp(ss, "amount", ToString_PP_Point(amount)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Graphics2D_1_0*)RealGetInterface("PPB_Graphics2D;1.0"))->Scroll(graphics_2d, clip_rect, amount); +#endif // !INTERPOSE +} +static void ReplaceContents_1_0(PP_Resource graphics_2d, PP_Resource image_data) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics2D\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"ReplaceContents\""); + AddProp(ss, "graphics_2d", ToString_PP_Resource(graphics_2d)); + AddProp(ss, "image_data", ToString_PP_Resource(image_data)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Graphics2D_1_0*)RealGetInterface("PPB_Graphics2D;1.0"))->ReplaceContents(graphics_2d, image_data); +#endif // !INTERPOSE +} +static int32_t Flush_1_0(PP_Resource graphics_2d, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics2D\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Flush\""); + AddProp(ss, "graphics_2d", ToString_PP_Resource(graphics_2d)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_Graphics2D_1_0*)RealGetInterface("PPB_Graphics2D;1.0"))->Flush(graphics_2d, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping SetScale */ +/* skipping GetScale */ +/* skipping SetLayerTransform */ +} +static PPB_Graphics2D_1_0 _PPB_Graphics2D_1_0 = { + ns_PPB_Graphics2D_1_0::Create_1_0, + ns_PPB_Graphics2D_1_0::IsGraphics2D_1_0, + ns_PPB_Graphics2D_1_0::Describe_1_0, + ns_PPB_Graphics2D_1_0::PaintImageData_1_0, + ns_PPB_Graphics2D_1_0::Scroll_1_0, + ns_PPB_Graphics2D_1_0::ReplaceContents_1_0, + ns_PPB_Graphics2D_1_0::Flush_1_0, +}; +const string ToString_PPB_Graphics2D(const PPB_Graphics2D_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Graphics2D_1_1 { +static PP_Resource Create_1_1(PP_Instance instance, const struct PP_Size* size, PP_Bool is_always_opaque) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics2D\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "size", ToString_PP_Size(size)); + AddProp(ss, "is_always_opaque", ToString_PP_Bool(is_always_opaque)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Graphics2D_1_1*)RealGetInterface("PPB_Graphics2D;1.1"))->Create(instance, size, is_always_opaque); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsGraphics2D_1_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics2D\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"IsGraphics2D\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Graphics2D_1_1*)RealGetInterface("PPB_Graphics2D;1.1"))->IsGraphics2D(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool Describe_1_1(PP_Resource graphics_2d, struct PP_Size* size, PP_Bool* is_always_opaque) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics2D\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Describe\""); + AddProp(ss, "graphics_2d", ToString_PP_Resource(graphics_2d)); + AddProp(ss, "size", PointerToString(size)); + AddProp(ss, "is_always_opaque", PointerToString(is_always_opaque)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!size) { + iterator.skip(); + FromJSON_PP_Size(iterator, *size); + } + iterator.skip(); + FromJSON_PP_Bool(iterator, *is_always_opaque); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Graphics2D_1_1*)RealGetInterface("PPB_Graphics2D;1.1"))->Describe(graphics_2d, size, is_always_opaque); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!size) { + AddProp(os, "size", ToString_PP_Size(size)); + } + AddProp(os, "is_always_opaque", ToString_PP_Bool(is_always_opaque)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void PaintImageData_1_1(PP_Resource graphics_2d, PP_Resource image_data, const struct PP_Point* top_left, const struct PP_Rect* src_rect) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics2D\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"PaintImageData\""); + AddProp(ss, "graphics_2d", ToString_PP_Resource(graphics_2d)); + AddProp(ss, "image_data", ToString_PP_Resource(image_data)); + AddProp(ss, "top_left", ToString_PP_Point(top_left)); + AddProp(ss, "src_rect", ToString_PP_Rect(src_rect)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Graphics2D_1_1*)RealGetInterface("PPB_Graphics2D;1.1"))->PaintImageData(graphics_2d, image_data, top_left, src_rect); +#endif // !INTERPOSE +} +static void Scroll_1_1(PP_Resource graphics_2d, const struct PP_Rect* clip_rect, const struct PP_Point* amount) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics2D\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Scroll\""); + AddProp(ss, "graphics_2d", ToString_PP_Resource(graphics_2d)); + AddProp(ss, "clip_rect", ToString_PP_Rect(clip_rect)); + AddProp(ss, "amount", ToString_PP_Point(amount)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Graphics2D_1_1*)RealGetInterface("PPB_Graphics2D;1.1"))->Scroll(graphics_2d, clip_rect, amount); +#endif // !INTERPOSE +} +static void ReplaceContents_1_1(PP_Resource graphics_2d, PP_Resource image_data) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics2D\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"ReplaceContents\""); + AddProp(ss, "graphics_2d", ToString_PP_Resource(graphics_2d)); + AddProp(ss, "image_data", ToString_PP_Resource(image_data)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Graphics2D_1_1*)RealGetInterface("PPB_Graphics2D;1.1"))->ReplaceContents(graphics_2d, image_data); +#endif // !INTERPOSE +} +static int32_t Flush_1_1(PP_Resource graphics_2d, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics2D\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Flush\""); + AddProp(ss, "graphics_2d", ToString_PP_Resource(graphics_2d)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_Graphics2D_1_1*)RealGetInterface("PPB_Graphics2D;1.1"))->Flush(graphics_2d, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool SetScale_1_1(PP_Resource resource, float scale) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics2D\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"SetScale\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + AddProp(ss, "scale", ToString_float_t(scale)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Graphics2D_1_1*)RealGetInterface("PPB_Graphics2D;1.1"))->SetScale(resource, scale); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static float GetScale_1_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics2D\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"GetScale\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + float rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_float_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + float rval = ((PPB_Graphics2D_1_1*)RealGetInterface("PPB_Graphics2D;1.1"))->GetScale(resource); + printf("RPC response: ["); + printf("%s", ToString_float_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping SetLayerTransform */ +} +static PPB_Graphics2D_1_1 _PPB_Graphics2D_1_1 = { + ns_PPB_Graphics2D_1_1::Create_1_1, + ns_PPB_Graphics2D_1_1::IsGraphics2D_1_1, + ns_PPB_Graphics2D_1_1::Describe_1_1, + ns_PPB_Graphics2D_1_1::PaintImageData_1_1, + ns_PPB_Graphics2D_1_1::Scroll_1_1, + ns_PPB_Graphics2D_1_1::ReplaceContents_1_1, + ns_PPB_Graphics2D_1_1::Flush_1_1, + ns_PPB_Graphics2D_1_1::SetScale_1_1, + ns_PPB_Graphics2D_1_1::GetScale_1_1, +}; +const string ToString_PPB_Graphics2D(const PPB_Graphics2D_1_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Graphics2D_1_2 { +static PP_Resource Create_1_2(PP_Instance instance, const struct PP_Size* size, PP_Bool is_always_opaque) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics2D\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "size", ToString_PP_Size(size)); + AddProp(ss, "is_always_opaque", ToString_PP_Bool(is_always_opaque)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Graphics2D_1_2*)RealGetInterface("PPB_Graphics2D;1.2"))->Create(instance, size, is_always_opaque); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsGraphics2D_1_2(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics2D\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"IsGraphics2D\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Graphics2D_1_2*)RealGetInterface("PPB_Graphics2D;1.2"))->IsGraphics2D(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool Describe_1_2(PP_Resource graphics_2d, struct PP_Size* size, PP_Bool* is_always_opaque) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics2D\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"Describe\""); + AddProp(ss, "graphics_2d", ToString_PP_Resource(graphics_2d)); + AddProp(ss, "size", PointerToString(size)); + AddProp(ss, "is_always_opaque", PointerToString(is_always_opaque)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!size) { + iterator.skip(); + FromJSON_PP_Size(iterator, *size); + } + iterator.skip(); + FromJSON_PP_Bool(iterator, *is_always_opaque); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Graphics2D_1_2*)RealGetInterface("PPB_Graphics2D;1.2"))->Describe(graphics_2d, size, is_always_opaque); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!size) { + AddProp(os, "size", ToString_PP_Size(size)); + } + AddProp(os, "is_always_opaque", ToString_PP_Bool(is_always_opaque)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void PaintImageData_1_2(PP_Resource graphics_2d, PP_Resource image_data, const struct PP_Point* top_left, const struct PP_Rect* src_rect) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics2D\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"PaintImageData\""); + AddProp(ss, "graphics_2d", ToString_PP_Resource(graphics_2d)); + AddProp(ss, "image_data", ToString_PP_Resource(image_data)); + AddProp(ss, "top_left", ToString_PP_Point(top_left)); + AddProp(ss, "src_rect", ToString_PP_Rect(src_rect)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Graphics2D_1_2*)RealGetInterface("PPB_Graphics2D;1.2"))->PaintImageData(graphics_2d, image_data, top_left, src_rect); +#endif // !INTERPOSE +} +static void Scroll_1_2(PP_Resource graphics_2d, const struct PP_Rect* clip_rect, const struct PP_Point* amount) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics2D\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"Scroll\""); + AddProp(ss, "graphics_2d", ToString_PP_Resource(graphics_2d)); + AddProp(ss, "clip_rect", ToString_PP_Rect(clip_rect)); + AddProp(ss, "amount", ToString_PP_Point(amount)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Graphics2D_1_2*)RealGetInterface("PPB_Graphics2D;1.2"))->Scroll(graphics_2d, clip_rect, amount); +#endif // !INTERPOSE +} +static void ReplaceContents_1_2(PP_Resource graphics_2d, PP_Resource image_data) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics2D\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"ReplaceContents\""); + AddProp(ss, "graphics_2d", ToString_PP_Resource(graphics_2d)); + AddProp(ss, "image_data", ToString_PP_Resource(image_data)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Graphics2D_1_2*)RealGetInterface("PPB_Graphics2D;1.2"))->ReplaceContents(graphics_2d, image_data); +#endif // !INTERPOSE +} +static int32_t Flush_1_2(PP_Resource graphics_2d, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics2D\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"Flush\""); + AddProp(ss, "graphics_2d", ToString_PP_Resource(graphics_2d)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_Graphics2D_1_2*)RealGetInterface("PPB_Graphics2D;1.2"))->Flush(graphics_2d, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool SetScale_1_2(PP_Resource resource, float scale) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics2D\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"SetScale\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + AddProp(ss, "scale", ToString_float_t(scale)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Graphics2D_1_2*)RealGetInterface("PPB_Graphics2D;1.2"))->SetScale(resource, scale); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static float GetScale_1_2(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics2D\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"GetScale\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + float rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_float_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + float rval = ((PPB_Graphics2D_1_2*)RealGetInterface("PPB_Graphics2D;1.2"))->GetScale(resource); + printf("RPC response: ["); + printf("%s", ToString_float_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool SetLayerTransform_1_2(PP_Resource resource, float scale, const struct PP_Point* origin, const struct PP_Point* translate) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics2D\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"SetLayerTransform\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + AddProp(ss, "scale", ToString_float_t(scale)); + AddProp(ss, "origin", ToString_PP_Point(origin)); + AddProp(ss, "translate", ToString_PP_Point(translate)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Graphics2D_1_2*)RealGetInterface("PPB_Graphics2D;1.2"))->SetLayerTransform(resource, scale, origin, translate); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_Graphics2D_1_2 _PPB_Graphics2D_1_2 = { + ns_PPB_Graphics2D_1_2::Create_1_2, + ns_PPB_Graphics2D_1_2::IsGraphics2D_1_2, + ns_PPB_Graphics2D_1_2::Describe_1_2, + ns_PPB_Graphics2D_1_2::PaintImageData_1_2, + ns_PPB_Graphics2D_1_2::Scroll_1_2, + ns_PPB_Graphics2D_1_2::ReplaceContents_1_2, + ns_PPB_Graphics2D_1_2::Flush_1_2, + ns_PPB_Graphics2D_1_2::SetScale_1_2, + ns_PPB_Graphics2D_1_2::GetScale_1_2, + ns_PPB_Graphics2D_1_2::SetLayerTransform_1_2, +}; +const string ToString_PPB_Graphics2D(const PPB_Graphics2D_1_2 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Graphics3D_1_0 { +static int32_t GetAttribMaxValue_1_0(PP_Resource instance, int32_t attribute, int32_t* value) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics3D\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetAttribMaxValue\""); + AddProp(ss, "instance", ToString_PP_Resource(instance)); + AddProp(ss, "attribute", ToString_int32_t(attribute)); + AddProp(ss, "value", PointerToString(value)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_int32_t(iterator, *value); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Graphics3D_1_0*)RealGetInterface("PPB_Graphics3D;1.0"))->GetAttribMaxValue(instance, attribute, value); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!value) { + AddProp(os, "value", ToString_int32_t(value)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource Create_1_0(PP_Instance instance, PP_Resource share_context, const int32_t attrib_list[]) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics3D\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "share_context", ToString_PP_Resource(share_context)); + { + BeginProp(ss, "attrib_list"); + BeginElements(ss); + for (uint32_t _n = 0; attrib_list[_n] != PP_GRAPHICS3DATTRIB_NONE; ++_n) { + AddElement(ss, ToString_int32_t(attrib_list[_n])); + } + EndElements(ss); + } + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Graphics3D_1_0*)RealGetInterface("PPB_Graphics3D;1.0"))->Create(instance, share_context, attrib_list); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsGraphics3D_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics3D\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsGraphics3D\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Graphics3D_1_0*)RealGetInterface("PPB_Graphics3D;1.0"))->IsGraphics3D(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetAttribs_1_0(PP_Resource context, int32_t attrib_list[]) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics3D\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetAttribs\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + { + BeginProp(ss, "attrib_list"); + BeginElements(ss); + for (uint32_t _n = 0; attrib_list[_n] != 0; ++_n) { + AddElement(ss, ToString_int32_t(attrib_list[_n])); + } + EndElements(ss); + } + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_int32_t(iterator, (attrib_list)[_n]); + } + // FIXME Null out remaining items? + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Graphics3D_1_0*)RealGetInterface("PPB_Graphics3D;1.0"))->GetAttribs(context, attrib_list); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + { + BeginProp(os, "attrib_list"); + BeginElements(os); + for (uint32_t _n = 0; attrib_list[_n] != 0; ++_n) { + AddElement(os, ToString_int32_t(attrib_list[_n])); + } + EndElements(os); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SetAttribs_1_0(PP_Resource context, const int32_t attrib_list[]) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics3D\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"SetAttribs\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + { + BeginProp(ss, "attrib_list"); + BeginElements(ss); + for (uint32_t _n = 0; attrib_list[_n] != 0; ++_n) { + AddElement(ss, ToString_int32_t(attrib_list[_n])); + } + EndElements(ss); + } + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Graphics3D_1_0*)RealGetInterface("PPB_Graphics3D;1.0"))->SetAttribs(context, attrib_list); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetError_1_0(PP_Resource context) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics3D\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetError\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Graphics3D_1_0*)RealGetInterface("PPB_Graphics3D;1.0"))->GetError(context); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t ResizeBuffers_1_0(PP_Resource context, int32_t width, int32_t height) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics3D\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"ResizeBuffers\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "width", ToString_int32_t(width)); + AddProp(ss, "height", ToString_int32_t(height)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Graphics3D_1_0*)RealGetInterface("PPB_Graphics3D;1.0"))->ResizeBuffers(context, width, height); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SwapBuffers_1_0(PP_Resource context, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Graphics3D\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"SwapBuffers\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_Graphics3D_1_0*)RealGetInterface("PPB_Graphics3D;1.0"))->SwapBuffers(context, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_Graphics3D_1_0 _PPB_Graphics3D_1_0 = { + ns_PPB_Graphics3D_1_0::GetAttribMaxValue_1_0, + ns_PPB_Graphics3D_1_0::Create_1_0, + ns_PPB_Graphics3D_1_0::IsGraphics3D_1_0, + ns_PPB_Graphics3D_1_0::GetAttribs_1_0, + ns_PPB_Graphics3D_1_0::SetAttribs_1_0, + ns_PPB_Graphics3D_1_0::GetError_1_0, + ns_PPB_Graphics3D_1_0::ResizeBuffers_1_0, + ns_PPB_Graphics3D_1_0::SwapBuffers_1_0, +}; +const string ToString_PPB_Graphics3D(const PPB_Graphics3D_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_HostResolver_Flag(const PP_HostResolver_Flag *v) { + switch (*v) { + case 1 << 0: + return "\"PP_HOSTRESOLVER_FLAG_CANONNAME\""; + default: + return "\"???\""; + } +} +const string ToString_PP_HostResolver_Flag(const PP_HostResolver_Flag &v) { + return ToString_PP_HostResolver_Flag(&v); +} +void FromJSON_PP_HostResolver_Flag(JSONIterator& iterator, PP_HostResolver_Flag &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_HostResolver_Flag(v); +} +const string ToString_PP_HostResolver_Hint(const PP_HostResolver_Hint *v) { + if (!v) { + return "null"; + } + return ToString_PP_HostResolver_Hint(*v); +} +const string ToString_PP_HostResolver_Hint(const PP_HostResolver_Hint &v) { + stringstream x; + BeginProps(x); + AddProp(x, "family", ToString_PP_NetAddress_Family(v.family)); + AddProp(x, "flags", ToString_int32_t(v.flags)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_HostResolver_Hint(JSONIterator& iterator, PP_HostResolver_Hint &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_PP_NetAddress_Family(iterator, value.family); + iterator.skip(); + FromJSON_int32_t(iterator, value.flags); +} +namespace ns_PPB_HostResolver_1_0 { +static PP_Resource Create_1_0(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_HostResolver\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_HostResolver_1_0*)RealGetInterface("PPB_HostResolver;1.0"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsHostResolver_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_HostResolver\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsHostResolver\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_HostResolver_1_0*)RealGetInterface("PPB_HostResolver;1.0"))->IsHostResolver(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Resolve_1_0(PP_Resource host_resolver, const char* host, uint16_t port, const struct PP_HostResolver_Hint* hint, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_HostResolver\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Resolve\""); + AddProp(ss, "host_resolver", ToString_PP_Resource(host_resolver)); + AddProp(ss, "host", ToString_str_t(host)); + AddProp(ss, "port", ToString_uint16_t(port)); + AddProp(ss, "hint", ToString_PP_HostResolver_Hint(hint)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_HostResolver_1_0*)RealGetInterface("PPB_HostResolver;1.0"))->Resolve(host_resolver, host, port, hint, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetCanonicalName_1_0(PP_Resource host_resolver) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_HostResolver\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetCanonicalName\""); + AddProp(ss, "host_resolver", ToString_PP_Resource(host_resolver)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_HostResolver_1_0*)RealGetInterface("PPB_HostResolver;1.0"))->GetCanonicalName(host_resolver); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint32_t GetNetAddressCount_1_0(PP_Resource host_resolver) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_HostResolver\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetNetAddressCount\""); + AddProp(ss, "host_resolver", ToString_PP_Resource(host_resolver)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint32_t rval = ((PPB_HostResolver_1_0*)RealGetInterface("PPB_HostResolver;1.0"))->GetNetAddressCount(host_resolver); + printf("RPC response: ["); + printf("%s", ToString_uint32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource GetNetAddress_1_0(PP_Resource host_resolver, uint32_t index) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_HostResolver\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetNetAddress\""); + AddProp(ss, "host_resolver", ToString_PP_Resource(host_resolver)); + AddProp(ss, "index", ToString_uint32_t(index)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_HostResolver_1_0*)RealGetInterface("PPB_HostResolver;1.0"))->GetNetAddress(host_resolver, index); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_HostResolver_1_0 _PPB_HostResolver_1_0 = { + ns_PPB_HostResolver_1_0::Create_1_0, + ns_PPB_HostResolver_1_0::IsHostResolver_1_0, + ns_PPB_HostResolver_1_0::Resolve_1_0, + ns_PPB_HostResolver_1_0::GetCanonicalName_1_0, + ns_PPB_HostResolver_1_0::GetNetAddressCount_1_0, + ns_PPB_HostResolver_1_0::GetNetAddress_1_0, +}; +const string ToString_PPB_HostResolver(const PPB_HostResolver_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_ImageDataFormat(const PP_ImageDataFormat *v) { + switch (*v) { + case 0: + return "\"PP_IMAGEDATAFORMAT_BGRA_PREMUL\""; + case 1: + return "\"PP_IMAGEDATAFORMAT_RGBA_PREMUL\""; + default: + return "\"???\""; + } +} +const string ToString_PP_ImageDataFormat(const PP_ImageDataFormat &v) { + return ToString_PP_ImageDataFormat(&v); +} +void FromJSON_PP_ImageDataFormat(JSONIterator& iterator, PP_ImageDataFormat &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_ImageDataFormat(v); +} +const string ToString_PP_ImageDataDesc(const PP_ImageDataDesc *v) { + if (!v) { + return "null"; + } + return ToString_PP_ImageDataDesc(*v); +} +const string ToString_PP_ImageDataDesc(const PP_ImageDataDesc &v) { + stringstream x; + BeginProps(x); + AddProp(x, "format", ToString_PP_ImageDataFormat(v.format)); + AddProp(x, "size", ToString_PP_Size(v.size)); + AddProp(x, "stride", ToString_int32_t(v.stride)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_ImageDataDesc(JSONIterator& iterator, PP_ImageDataDesc &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_PP_ImageDataFormat(iterator, value.format); + iterator.skip(); + FromJSON_PP_Size(iterator, value.size); + iterator.skip(); + FromJSON_int32_t(iterator, value.stride); +} +namespace ns_PPB_ImageData_1_0 { +static PP_ImageDataFormat GetNativeImageDataFormat_1_0(void) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_ImageData\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetNativeImageDataFormat\""); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_ImageDataFormat rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_ImageDataFormat(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_ImageDataFormat rval = ((PPB_ImageData_1_0*)RealGetInterface("PPB_ImageData;1.0"))->GetNativeImageDataFormat(); + printf("RPC response: ["); + printf("%s", ToString_PP_ImageDataFormat(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsImageDataFormatSupported_1_0(PP_ImageDataFormat format) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_ImageData\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsImageDataFormatSupported\""); + AddProp(ss, "format", ToString_PP_ImageDataFormat(format)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_ImageData_1_0*)RealGetInterface("PPB_ImageData;1.0"))->IsImageDataFormatSupported(format); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource Create_1_0(PP_Instance instance, PP_ImageDataFormat format, const struct PP_Size* size, PP_Bool init_to_zero) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_ImageData\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "format", ToString_PP_ImageDataFormat(format)); + AddProp(ss, "size", ToString_PP_Size(size)); + AddProp(ss, "init_to_zero", ToString_PP_Bool(init_to_zero)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_ImageData_1_0*)RealGetInterface("PPB_ImageData;1.0"))->Create(instance, format, size, init_to_zero); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsImageData_1_0(PP_Resource image_data) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_ImageData\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsImageData\""); + AddProp(ss, "image_data", ToString_PP_Resource(image_data)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_ImageData_1_0*)RealGetInterface("PPB_ImageData;1.0"))->IsImageData(image_data); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool Describe_1_0(PP_Resource image_data, struct PP_ImageDataDesc* desc) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_ImageData\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Describe\""); + AddProp(ss, "image_data", ToString_PP_Resource(image_data)); + AddProp(ss, "desc", PointerToString(desc)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!desc) { + iterator.skip(); + FromJSON_PP_ImageDataDesc(iterator, *desc); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_ImageData_1_0*)RealGetInterface("PPB_ImageData;1.0"))->Describe(image_data, desc); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!desc) { + AddProp(os, "desc", ToString_PP_ImageDataDesc(desc)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void* Map_1_0(PP_Resource image_data) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_ImageData\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Map\""); + AddProp(ss, "image_data", ToString_PP_Resource(image_data)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + void* rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_mem_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + void* rval = ((PPB_ImageData_1_0*)RealGetInterface("PPB_ImageData;1.0"))->Map(image_data); + printf("RPC response: ["); + printf("%s", ToString_mem_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void Unmap_1_0(PP_Resource image_data) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_ImageData\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Unmap\""); + AddProp(ss, "image_data", ToString_PP_Resource(image_data)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_ImageData_1_0*)RealGetInterface("PPB_ImageData;1.0"))->Unmap(image_data); +#endif // !INTERPOSE +} +} +static PPB_ImageData_1_0 _PPB_ImageData_1_0 = { + ns_PPB_ImageData_1_0::GetNativeImageDataFormat_1_0, + ns_PPB_ImageData_1_0::IsImageDataFormatSupported_1_0, + ns_PPB_ImageData_1_0::Create_1_0, + ns_PPB_ImageData_1_0::IsImageData_1_0, + ns_PPB_ImageData_1_0::Describe_1_0, + ns_PPB_ImageData_1_0::Map_1_0, + ns_PPB_ImageData_1_0::Unmap_1_0, +}; +const string ToString_PPB_ImageData(const PPB_ImageData_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_InputEvent_Type(const PP_InputEvent_Type *v) { + switch (*v) { + case -1: + return "\"PP_INPUTEVENT_TYPE_UNDEFINED\""; + case 0: + return "\"PP_INPUTEVENT_TYPE_MOUSEDOWN\""; + case 1: + return "\"PP_INPUTEVENT_TYPE_MOUSEUP\""; + case 2: + return "\"PP_INPUTEVENT_TYPE_MOUSEMOVE\""; + case 3: + return "\"PP_INPUTEVENT_TYPE_MOUSEENTER\""; + case 4: + return "\"PP_INPUTEVENT_TYPE_MOUSELEAVE\""; + case 5: + return "\"PP_INPUTEVENT_TYPE_WHEEL\""; + case 6: + return "\"PP_INPUTEVENT_TYPE_RAWKEYDOWN\""; + case 7: + return "\"PP_INPUTEVENT_TYPE_KEYDOWN\""; + case 8: + return "\"PP_INPUTEVENT_TYPE_KEYUP\""; + case 9: + return "\"PP_INPUTEVENT_TYPE_CHAR\""; + case 10: + return "\"PP_INPUTEVENT_TYPE_CONTEXTMENU\""; + case 11: + return "\"PP_INPUTEVENT_TYPE_IME_COMPOSITION_START\""; + case 12: + return "\"PP_INPUTEVENT_TYPE_IME_COMPOSITION_UPDATE\""; + case 13: + return "\"PP_INPUTEVENT_TYPE_IME_COMPOSITION_END\""; + case 14: + return "\"PP_INPUTEVENT_TYPE_IME_TEXT\""; + case 15: + return "\"PP_INPUTEVENT_TYPE_TOUCHSTART\""; + case 16: + return "\"PP_INPUTEVENT_TYPE_TOUCHMOVE\""; + case 17: + return "\"PP_INPUTEVENT_TYPE_TOUCHEND\""; + case 18: + return "\"PP_INPUTEVENT_TYPE_TOUCHCANCEL\""; + default: + return "\"???\""; + } +} +const string ToString_PP_InputEvent_Type(const PP_InputEvent_Type &v) { + return ToString_PP_InputEvent_Type(&v); +} +void FromJSON_PP_InputEvent_Type(JSONIterator& iterator, PP_InputEvent_Type &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_InputEvent_Type(v); +} +const string ToString_PP_InputEvent_Modifier(const PP_InputEvent_Modifier *v) { + switch (*v) { + case 1 << 0: + return "\"PP_INPUTEVENT_MODIFIER_SHIFTKEY\""; + case 1 << 1: + return "\"PP_INPUTEVENT_MODIFIER_CONTROLKEY\""; + case 1 << 2: + return "\"PP_INPUTEVENT_MODIFIER_ALTKEY\""; + case 1 << 3: + return "\"PP_INPUTEVENT_MODIFIER_METAKEY\""; + case 1 << 4: + return "\"PP_INPUTEVENT_MODIFIER_ISKEYPAD\""; + case 1 << 5: + return "\"PP_INPUTEVENT_MODIFIER_ISAUTOREPEAT\""; + case 1 << 6: + return "\"PP_INPUTEVENT_MODIFIER_LEFTBUTTONDOWN\""; + case 1 << 7: + return "\"PP_INPUTEVENT_MODIFIER_MIDDLEBUTTONDOWN\""; + case 1 << 8: + return "\"PP_INPUTEVENT_MODIFIER_RIGHTBUTTONDOWN\""; + case 1 << 9: + return "\"PP_INPUTEVENT_MODIFIER_CAPSLOCKKEY\""; + case 1 << 10: + return "\"PP_INPUTEVENT_MODIFIER_NUMLOCKKEY\""; + case 1 << 11: + return "\"PP_INPUTEVENT_MODIFIER_ISLEFT\""; + case 1 << 12: + return "\"PP_INPUTEVENT_MODIFIER_ISRIGHT\""; + case 1 << 13: + return "\"PP_INPUTEVENT_MODIFIER_ISPEN\""; + case 1 << 14: + return "\"PP_INPUTEVENT_MODIFIER_ISERASER\""; + default: + return "\"???\""; + } +} +const string ToString_PP_InputEvent_Modifier(const PP_InputEvent_Modifier &v) { + return ToString_PP_InputEvent_Modifier(&v); +} +void FromJSON_PP_InputEvent_Modifier(JSONIterator& iterator, PP_InputEvent_Modifier &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_InputEvent_Modifier(v); +} +const string ToString_PP_InputEvent_MouseButton(const PP_InputEvent_MouseButton *v) { + switch (*v) { + case -1: + return "\"PP_INPUTEVENT_MOUSEBUTTON_NONE\""; + case 0: + return "\"PP_INPUTEVENT_MOUSEBUTTON_LEFT\""; + case 1: + return "\"PP_INPUTEVENT_MOUSEBUTTON_MIDDLE\""; + case 2: + return "\"PP_INPUTEVENT_MOUSEBUTTON_RIGHT\""; + default: + return "\"???\""; + } +} +const string ToString_PP_InputEvent_MouseButton(const PP_InputEvent_MouseButton &v) { + return ToString_PP_InputEvent_MouseButton(&v); +} +void FromJSON_PP_InputEvent_MouseButton(JSONIterator& iterator, PP_InputEvent_MouseButton &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_InputEvent_MouseButton(v); +} +const string ToString_PP_InputEvent_Class(const PP_InputEvent_Class *v) { + switch (*v) { + case 1 << 0: + return "\"PP_INPUTEVENT_CLASS_MOUSE\""; + case 1 << 1: + return "\"PP_INPUTEVENT_CLASS_KEYBOARD\""; + case 1 << 2: + return "\"PP_INPUTEVENT_CLASS_WHEEL\""; + case 1 << 3: + return "\"PP_INPUTEVENT_CLASS_TOUCH\""; + case 1 << 4: + return "\"PP_INPUTEVENT_CLASS_IME\""; + default: + return "\"???\""; + } +} +const string ToString_PP_InputEvent_Class(const PP_InputEvent_Class &v) { + return ToString_PP_InputEvent_Class(&v); +} +void FromJSON_PP_InputEvent_Class(JSONIterator& iterator, PP_InputEvent_Class &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_InputEvent_Class(v); +} +namespace ns_PPB_InputEvent_1_0 { +static int32_t RequestInputEvents_1_0(PP_Instance instance, uint32_t event_classes) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_InputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"RequestInputEvents\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "event_classes", ToString_uint32_t(event_classes)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_InputEvent_1_0*)RealGetInterface("PPB_InputEvent;1.0"))->RequestInputEvents(instance, event_classes); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t RequestFilteringInputEvents_1_0(PP_Instance instance, uint32_t event_classes) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_InputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"RequestFilteringInputEvents\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "event_classes", ToString_uint32_t(event_classes)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_InputEvent_1_0*)RealGetInterface("PPB_InputEvent;1.0"))->RequestFilteringInputEvents(instance, event_classes); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void ClearInputEventRequest_1_0(PP_Instance instance, uint32_t event_classes) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_InputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"ClearInputEventRequest\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "event_classes", ToString_uint32_t(event_classes)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_InputEvent_1_0*)RealGetInterface("PPB_InputEvent;1.0"))->ClearInputEventRequest(instance, event_classes); +#endif // !INTERPOSE +} +static PP_Bool IsInputEvent_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_InputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsInputEvent\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_InputEvent_1_0*)RealGetInterface("PPB_InputEvent;1.0"))->IsInputEvent(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_InputEvent_Type GetType_1_0(PP_Resource event) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_InputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetType\""); + AddProp(ss, "event", ToString_PP_Resource(event)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_InputEvent_Type rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_InputEvent_Type(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_InputEvent_Type rval = ((PPB_InputEvent_1_0*)RealGetInterface("PPB_InputEvent;1.0"))->GetType(event); + printf("RPC response: ["); + printf("%s", ToString_PP_InputEvent_Type(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_TimeTicks GetTimeStamp_1_0(PP_Resource event) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_InputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetTimeStamp\""); + AddProp(ss, "event", ToString_PP_Resource(event)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + double rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_TimeTicks(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + double rval = ((PPB_InputEvent_1_0*)RealGetInterface("PPB_InputEvent;1.0"))->GetTimeStamp(event); + printf("RPC response: ["); + printf("%s", ToString_PP_TimeTicks(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint32_t GetModifiers_1_0(PP_Resource event) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_InputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetModifiers\""); + AddProp(ss, "event", ToString_PP_Resource(event)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint32_t rval = ((PPB_InputEvent_1_0*)RealGetInterface("PPB_InputEvent;1.0"))->GetModifiers(event); + printf("RPC response: ["); + printf("%s", ToString_uint32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_InputEvent_1_0 _PPB_InputEvent_1_0 = { + ns_PPB_InputEvent_1_0::RequestInputEvents_1_0, + ns_PPB_InputEvent_1_0::RequestFilteringInputEvents_1_0, + ns_PPB_InputEvent_1_0::ClearInputEventRequest_1_0, + ns_PPB_InputEvent_1_0::IsInputEvent_1_0, + ns_PPB_InputEvent_1_0::GetType_1_0, + ns_PPB_InputEvent_1_0::GetTimeStamp_1_0, + ns_PPB_InputEvent_1_0::GetModifiers_1_0, +}; +const string ToString_PPB_InputEvent(const PPB_InputEvent_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_MouseInputEvent_1_0 { +static PP_Resource Create_1_0(PP_Instance instance, PP_InputEvent_Type type, PP_TimeTicks time_stamp, uint32_t modifiers, PP_InputEvent_MouseButton mouse_button, const struct PP_Point* mouse_position, int32_t click_count) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MouseInputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "type", ToString_PP_InputEvent_Type(type)); + AddProp(ss, "time_stamp", ToString_PP_TimeTicks(time_stamp)); + AddProp(ss, "modifiers", ToString_uint32_t(modifiers)); + AddProp(ss, "mouse_button", ToString_PP_InputEvent_MouseButton(mouse_button)); + AddProp(ss, "mouse_position", ToString_PP_Point(mouse_position)); + AddProp(ss, "click_count", ToString_int32_t(click_count)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_MouseInputEvent_1_0*)RealGetInterface("PPB_MouseInputEvent;1.0"))->Create(instance, type, time_stamp, modifiers, mouse_button, mouse_position, click_count); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping Create */ +static PP_Bool IsMouseInputEvent_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MouseInputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsMouseInputEvent\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_MouseInputEvent_1_0*)RealGetInterface("PPB_MouseInputEvent;1.0"))->IsMouseInputEvent(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_InputEvent_MouseButton GetButton_1_0(PP_Resource mouse_event) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MouseInputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetButton\""); + AddProp(ss, "mouse_event", ToString_PP_Resource(mouse_event)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_InputEvent_MouseButton rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_InputEvent_MouseButton(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_InputEvent_MouseButton rval = ((PPB_MouseInputEvent_1_0*)RealGetInterface("PPB_MouseInputEvent;1.0"))->GetButton(mouse_event); + printf("RPC response: ["); + printf("%s", ToString_PP_InputEvent_MouseButton(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Point GetPosition_1_0(PP_Resource mouse_event) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MouseInputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetPosition\""); + AddProp(ss, "mouse_event", ToString_PP_Resource(mouse_event)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Point rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Point(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Point rval = ((PPB_MouseInputEvent_1_0*)RealGetInterface("PPB_MouseInputEvent;1.0"))->GetPosition(mouse_event); + printf("RPC response: ["); + printf("%s", ToString_PP_Point(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetClickCount_1_0(PP_Resource mouse_event) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MouseInputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetClickCount\""); + AddProp(ss, "mouse_event", ToString_PP_Resource(mouse_event)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_MouseInputEvent_1_0*)RealGetInterface("PPB_MouseInputEvent;1.0"))->GetClickCount(mouse_event); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping GetMovement */ +} +static PPB_MouseInputEvent_1_0 _PPB_MouseInputEvent_1_0 = { + ns_PPB_MouseInputEvent_1_0::Create_1_0, + ns_PPB_MouseInputEvent_1_0::IsMouseInputEvent_1_0, + ns_PPB_MouseInputEvent_1_0::GetButton_1_0, + ns_PPB_MouseInputEvent_1_0::GetPosition_1_0, + ns_PPB_MouseInputEvent_1_0::GetClickCount_1_0, +}; +const string ToString_PPB_MouseInputEvent(const PPB_MouseInputEvent_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_MouseInputEvent_1_1 { +/* skipping Create */ +static PP_Resource Create_1_1(PP_Instance instance, PP_InputEvent_Type type, PP_TimeTicks time_stamp, uint32_t modifiers, PP_InputEvent_MouseButton mouse_button, const struct PP_Point* mouse_position, int32_t click_count, const struct PP_Point* mouse_movement) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MouseInputEvent\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "type", ToString_PP_InputEvent_Type(type)); + AddProp(ss, "time_stamp", ToString_PP_TimeTicks(time_stamp)); + AddProp(ss, "modifiers", ToString_uint32_t(modifiers)); + AddProp(ss, "mouse_button", ToString_PP_InputEvent_MouseButton(mouse_button)); + AddProp(ss, "mouse_position", ToString_PP_Point(mouse_position)); + AddProp(ss, "click_count", ToString_int32_t(click_count)); + AddProp(ss, "mouse_movement", ToString_PP_Point(mouse_movement)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_MouseInputEvent_1_1*)RealGetInterface("PPB_MouseInputEvent;1.1"))->Create(instance, type, time_stamp, modifiers, mouse_button, mouse_position, click_count, mouse_movement); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsMouseInputEvent_1_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MouseInputEvent\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"IsMouseInputEvent\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_MouseInputEvent_1_1*)RealGetInterface("PPB_MouseInputEvent;1.1"))->IsMouseInputEvent(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_InputEvent_MouseButton GetButton_1_1(PP_Resource mouse_event) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MouseInputEvent\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"GetButton\""); + AddProp(ss, "mouse_event", ToString_PP_Resource(mouse_event)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_InputEvent_MouseButton rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_InputEvent_MouseButton(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_InputEvent_MouseButton rval = ((PPB_MouseInputEvent_1_1*)RealGetInterface("PPB_MouseInputEvent;1.1"))->GetButton(mouse_event); + printf("RPC response: ["); + printf("%s", ToString_PP_InputEvent_MouseButton(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Point GetPosition_1_1(PP_Resource mouse_event) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MouseInputEvent\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"GetPosition\""); + AddProp(ss, "mouse_event", ToString_PP_Resource(mouse_event)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Point rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Point(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Point rval = ((PPB_MouseInputEvent_1_1*)RealGetInterface("PPB_MouseInputEvent;1.1"))->GetPosition(mouse_event); + printf("RPC response: ["); + printf("%s", ToString_PP_Point(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetClickCount_1_1(PP_Resource mouse_event) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MouseInputEvent\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"GetClickCount\""); + AddProp(ss, "mouse_event", ToString_PP_Resource(mouse_event)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_MouseInputEvent_1_1*)RealGetInterface("PPB_MouseInputEvent;1.1"))->GetClickCount(mouse_event); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Point GetMovement_1_1(PP_Resource mouse_event) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MouseInputEvent\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"GetMovement\""); + AddProp(ss, "mouse_event", ToString_PP_Resource(mouse_event)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Point rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Point(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Point rval = ((PPB_MouseInputEvent_1_1*)RealGetInterface("PPB_MouseInputEvent;1.1"))->GetMovement(mouse_event); + printf("RPC response: ["); + printf("%s", ToString_PP_Point(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_MouseInputEvent_1_1 _PPB_MouseInputEvent_1_1 = { + ns_PPB_MouseInputEvent_1_1::Create_1_1, + ns_PPB_MouseInputEvent_1_1::IsMouseInputEvent_1_1, + ns_PPB_MouseInputEvent_1_1::GetButton_1_1, + ns_PPB_MouseInputEvent_1_1::GetPosition_1_1, + ns_PPB_MouseInputEvent_1_1::GetClickCount_1_1, + ns_PPB_MouseInputEvent_1_1::GetMovement_1_1, +}; +const string ToString_PPB_MouseInputEvent(const PPB_MouseInputEvent_1_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_WheelInputEvent_1_0 { +static PP_Resource Create_1_0(PP_Instance instance, PP_TimeTicks time_stamp, uint32_t modifiers, const struct PP_FloatPoint* wheel_delta, const struct PP_FloatPoint* wheel_ticks, PP_Bool scroll_by_page) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_WheelInputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "time_stamp", ToString_PP_TimeTicks(time_stamp)); + AddProp(ss, "modifiers", ToString_uint32_t(modifiers)); + AddProp(ss, "wheel_delta", ToString_PP_FloatPoint(wheel_delta)); + AddProp(ss, "wheel_ticks", ToString_PP_FloatPoint(wheel_ticks)); + AddProp(ss, "scroll_by_page", ToString_PP_Bool(scroll_by_page)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_WheelInputEvent_1_0*)RealGetInterface("PPB_WheelInputEvent;1.0"))->Create(instance, time_stamp, modifiers, wheel_delta, wheel_ticks, scroll_by_page); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsWheelInputEvent_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_WheelInputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsWheelInputEvent\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_WheelInputEvent_1_0*)RealGetInterface("PPB_WheelInputEvent;1.0"))->IsWheelInputEvent(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_FloatPoint GetDelta_1_0(PP_Resource wheel_event) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_WheelInputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetDelta\""); + AddProp(ss, "wheel_event", ToString_PP_Resource(wheel_event)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_FloatPoint rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_FloatPoint(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_FloatPoint rval = ((PPB_WheelInputEvent_1_0*)RealGetInterface("PPB_WheelInputEvent;1.0"))->GetDelta(wheel_event); + printf("RPC response: ["); + printf("%s", ToString_PP_FloatPoint(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_FloatPoint GetTicks_1_0(PP_Resource wheel_event) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_WheelInputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetTicks\""); + AddProp(ss, "wheel_event", ToString_PP_Resource(wheel_event)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_FloatPoint rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_FloatPoint(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_FloatPoint rval = ((PPB_WheelInputEvent_1_0*)RealGetInterface("PPB_WheelInputEvent;1.0"))->GetTicks(wheel_event); + printf("RPC response: ["); + printf("%s", ToString_PP_FloatPoint(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetScrollByPage_1_0(PP_Resource wheel_event) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_WheelInputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetScrollByPage\""); + AddProp(ss, "wheel_event", ToString_PP_Resource(wheel_event)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_WheelInputEvent_1_0*)RealGetInterface("PPB_WheelInputEvent;1.0"))->GetScrollByPage(wheel_event); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_WheelInputEvent_1_0 _PPB_WheelInputEvent_1_0 = { + ns_PPB_WheelInputEvent_1_0::Create_1_0, + ns_PPB_WheelInputEvent_1_0::IsWheelInputEvent_1_0, + ns_PPB_WheelInputEvent_1_0::GetDelta_1_0, + ns_PPB_WheelInputEvent_1_0::GetTicks_1_0, + ns_PPB_WheelInputEvent_1_0::GetScrollByPage_1_0, +}; +const string ToString_PPB_WheelInputEvent(const PPB_WheelInputEvent_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_KeyboardInputEvent_1_0 { +static PP_Resource Create_1_0(PP_Instance instance, PP_InputEvent_Type type, PP_TimeTicks time_stamp, uint32_t modifiers, uint32_t key_code, struct PP_Var character_text) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_KeyboardInputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "type", ToString_PP_InputEvent_Type(type)); + AddProp(ss, "time_stamp", ToString_PP_TimeTicks(time_stamp)); + AddProp(ss, "modifiers", ToString_uint32_t(modifiers)); + AddProp(ss, "key_code", ToString_uint32_t(key_code)); + AddProp(ss, "character_text", ToString_PP_Var(character_text)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_KeyboardInputEvent_1_0*)RealGetInterface("PPB_KeyboardInputEvent;1.0"))->Create(instance, type, time_stamp, modifiers, key_code, character_text); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping Create */ +static PP_Bool IsKeyboardInputEvent_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_KeyboardInputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsKeyboardInputEvent\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_KeyboardInputEvent_1_0*)RealGetInterface("PPB_KeyboardInputEvent;1.0"))->IsKeyboardInputEvent(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint32_t GetKeyCode_1_0(PP_Resource key_event) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_KeyboardInputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetKeyCode\""); + AddProp(ss, "key_event", ToString_PP_Resource(key_event)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint32_t rval = ((PPB_KeyboardInputEvent_1_0*)RealGetInterface("PPB_KeyboardInputEvent;1.0"))->GetKeyCode(key_event); + printf("RPC response: ["); + printf("%s", ToString_uint32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetCharacterText_1_0(PP_Resource character_event) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_KeyboardInputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetCharacterText\""); + AddProp(ss, "character_event", ToString_PP_Resource(character_event)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_KeyboardInputEvent_1_0*)RealGetInterface("PPB_KeyboardInputEvent;1.0"))->GetCharacterText(character_event); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping GetCode */ +} +static PPB_KeyboardInputEvent_1_0 _PPB_KeyboardInputEvent_1_0 = { + ns_PPB_KeyboardInputEvent_1_0::Create_1_0, + ns_PPB_KeyboardInputEvent_1_0::IsKeyboardInputEvent_1_0, + ns_PPB_KeyboardInputEvent_1_0::GetKeyCode_1_0, + ns_PPB_KeyboardInputEvent_1_0::GetCharacterText_1_0, +}; +const string ToString_PPB_KeyboardInputEvent(const PPB_KeyboardInputEvent_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_KeyboardInputEvent_1_2 { +/* skipping Create */ +static PP_Resource Create_1_2(PP_Instance instance, PP_InputEvent_Type type, PP_TimeTicks time_stamp, uint32_t modifiers, uint32_t key_code, struct PP_Var character_text, struct PP_Var code) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_KeyboardInputEvent\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "type", ToString_PP_InputEvent_Type(type)); + AddProp(ss, "time_stamp", ToString_PP_TimeTicks(time_stamp)); + AddProp(ss, "modifiers", ToString_uint32_t(modifiers)); + AddProp(ss, "key_code", ToString_uint32_t(key_code)); + AddProp(ss, "character_text", ToString_PP_Var(character_text)); + AddProp(ss, "code", ToString_PP_Var(code)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_KeyboardInputEvent_1_2*)RealGetInterface("PPB_KeyboardInputEvent;1.2"))->Create(instance, type, time_stamp, modifiers, key_code, character_text, code); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsKeyboardInputEvent_1_2(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_KeyboardInputEvent\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"IsKeyboardInputEvent\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_KeyboardInputEvent_1_2*)RealGetInterface("PPB_KeyboardInputEvent;1.2"))->IsKeyboardInputEvent(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint32_t GetKeyCode_1_2(PP_Resource key_event) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_KeyboardInputEvent\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"GetKeyCode\""); + AddProp(ss, "key_event", ToString_PP_Resource(key_event)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint32_t rval = ((PPB_KeyboardInputEvent_1_2*)RealGetInterface("PPB_KeyboardInputEvent;1.2"))->GetKeyCode(key_event); + printf("RPC response: ["); + printf("%s", ToString_uint32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetCharacterText_1_2(PP_Resource character_event) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_KeyboardInputEvent\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"GetCharacterText\""); + AddProp(ss, "character_event", ToString_PP_Resource(character_event)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_KeyboardInputEvent_1_2*)RealGetInterface("PPB_KeyboardInputEvent;1.2"))->GetCharacterText(character_event); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetCode_1_2(PP_Resource key_event) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_KeyboardInputEvent\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"GetCode\""); + AddProp(ss, "key_event", ToString_PP_Resource(key_event)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_KeyboardInputEvent_1_2*)RealGetInterface("PPB_KeyboardInputEvent;1.2"))->GetCode(key_event); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_KeyboardInputEvent_1_2 _PPB_KeyboardInputEvent_1_2 = { + ns_PPB_KeyboardInputEvent_1_2::Create_1_2, + ns_PPB_KeyboardInputEvent_1_2::IsKeyboardInputEvent_1_2, + ns_PPB_KeyboardInputEvent_1_2::GetKeyCode_1_2, + ns_PPB_KeyboardInputEvent_1_2::GetCharacterText_1_2, + ns_PPB_KeyboardInputEvent_1_2::GetCode_1_2, +}; +const string ToString_PPB_KeyboardInputEvent(const PPB_KeyboardInputEvent_1_2 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_TouchListType(const PP_TouchListType *v) { + switch (*v) { + case 0: + return "\"PP_TOUCHLIST_TYPE_TOUCHES\""; + case 1: + return "\"PP_TOUCHLIST_TYPE_CHANGEDTOUCHES\""; + case 2: + return "\"PP_TOUCHLIST_TYPE_TARGETTOUCHES\""; + default: + return "\"???\""; + } +} +const string ToString_PP_TouchListType(const PP_TouchListType &v) { + return ToString_PP_TouchListType(&v); +} +void FromJSON_PP_TouchListType(JSONIterator& iterator, PP_TouchListType &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_TouchListType(v); +} +namespace ns_PPB_TouchInputEvent_1_0 { +static PP_Resource Create_1_0(PP_Instance instance, PP_InputEvent_Type type, PP_TimeTicks time_stamp, uint32_t modifiers) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TouchInputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "type", ToString_PP_InputEvent_Type(type)); + AddProp(ss, "time_stamp", ToString_PP_TimeTicks(time_stamp)); + AddProp(ss, "modifiers", ToString_uint32_t(modifiers)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_TouchInputEvent_1_0*)RealGetInterface("PPB_TouchInputEvent;1.0"))->Create(instance, type, time_stamp, modifiers); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void AddTouchPoint_1_0(PP_Resource touch_event, PP_TouchListType list, const struct PP_TouchPoint* point) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TouchInputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"AddTouchPoint\""); + AddProp(ss, "touch_event", ToString_PP_Resource(touch_event)); + AddProp(ss, "list", ToString_PP_TouchListType(list)); + AddProp(ss, "point", ToString_PP_TouchPoint(point)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_TouchInputEvent_1_0*)RealGetInterface("PPB_TouchInputEvent;1.0"))->AddTouchPoint(touch_event, list, point); +#endif // !INTERPOSE +} +static PP_Bool IsTouchInputEvent_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TouchInputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsTouchInputEvent\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_TouchInputEvent_1_0*)RealGetInterface("PPB_TouchInputEvent;1.0"))->IsTouchInputEvent(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint32_t GetTouchCount_1_0(PP_Resource resource, PP_TouchListType list) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TouchInputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetTouchCount\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + AddProp(ss, "list", ToString_PP_TouchListType(list)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint32_t rval = ((PPB_TouchInputEvent_1_0*)RealGetInterface("PPB_TouchInputEvent;1.0"))->GetTouchCount(resource, list); + printf("RPC response: ["); + printf("%s", ToString_uint32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_TouchPoint GetTouchByIndex_1_0(PP_Resource resource, PP_TouchListType list, uint32_t index) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TouchInputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetTouchByIndex\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + AddProp(ss, "list", ToString_PP_TouchListType(list)); + AddProp(ss, "index", ToString_uint32_t(index)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_TouchPoint rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_TouchPoint(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_TouchPoint rval = ((PPB_TouchInputEvent_1_0*)RealGetInterface("PPB_TouchInputEvent;1.0"))->GetTouchByIndex(resource, list, index); + printf("RPC response: ["); + printf("%s", ToString_PP_TouchPoint(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_TouchPoint GetTouchById_1_0(PP_Resource resource, PP_TouchListType list, uint32_t touch_id) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TouchInputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetTouchById\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + AddProp(ss, "list", ToString_PP_TouchListType(list)); + AddProp(ss, "touch_id", ToString_uint32_t(touch_id)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_TouchPoint rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_TouchPoint(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_TouchPoint rval = ((PPB_TouchInputEvent_1_0*)RealGetInterface("PPB_TouchInputEvent;1.0"))->GetTouchById(resource, list, touch_id); + printf("RPC response: ["); + printf("%s", ToString_PP_TouchPoint(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_TouchInputEvent_1_0 _PPB_TouchInputEvent_1_0 = { + ns_PPB_TouchInputEvent_1_0::Create_1_0, + ns_PPB_TouchInputEvent_1_0::AddTouchPoint_1_0, + ns_PPB_TouchInputEvent_1_0::IsTouchInputEvent_1_0, + ns_PPB_TouchInputEvent_1_0::GetTouchCount_1_0, + ns_PPB_TouchInputEvent_1_0::GetTouchByIndex_1_0, + ns_PPB_TouchInputEvent_1_0::GetTouchById_1_0, +}; +const string ToString_PPB_TouchInputEvent(const PPB_TouchInputEvent_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_IMEInputEvent_1_0 { +static PP_Resource Create_1_0(PP_Instance instance, PP_InputEvent_Type type, PP_TimeTicks time_stamp, struct PP_Var text, uint32_t segment_number, const uint32_t segment_offsets[], int32_t target_segment, uint32_t selection_start, uint32_t selection_end) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_IMEInputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "type", ToString_PP_InputEvent_Type(type)); + AddProp(ss, "time_stamp", ToString_PP_TimeTicks(time_stamp)); + AddProp(ss, "text", ToString_PP_Var(text)); + AddProp(ss, "segment_number", ToString_uint32_t(segment_number)); + { + BeginProp(ss, "segment_offsets"); + BeginElements(ss); + for (uint32_t _n = 0; segment_offsets[_n] != 0; ++_n) { + AddElement(ss, ToString_uint32_t(segment_offsets[_n])); + } + EndElements(ss); + } + AddProp(ss, "target_segment", ToString_int32_t(target_segment)); + AddProp(ss, "selection_start", ToString_uint32_t(selection_start)); + AddProp(ss, "selection_end", ToString_uint32_t(selection_end)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_IMEInputEvent_1_0*)RealGetInterface("PPB_IMEInputEvent;1.0"))->Create(instance, type, time_stamp, text, segment_number, segment_offsets, target_segment, selection_start, selection_end); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsIMEInputEvent_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_IMEInputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsIMEInputEvent\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_IMEInputEvent_1_0*)RealGetInterface("PPB_IMEInputEvent;1.0"))->IsIMEInputEvent(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetText_1_0(PP_Resource ime_event) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_IMEInputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetText\""); + AddProp(ss, "ime_event", ToString_PP_Resource(ime_event)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_IMEInputEvent_1_0*)RealGetInterface("PPB_IMEInputEvent;1.0"))->GetText(ime_event); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint32_t GetSegmentNumber_1_0(PP_Resource ime_event) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_IMEInputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetSegmentNumber\""); + AddProp(ss, "ime_event", ToString_PP_Resource(ime_event)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint32_t rval = ((PPB_IMEInputEvent_1_0*)RealGetInterface("PPB_IMEInputEvent;1.0"))->GetSegmentNumber(ime_event); + printf("RPC response: ["); + printf("%s", ToString_uint32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint32_t GetSegmentOffset_1_0(PP_Resource ime_event, uint32_t index) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_IMEInputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetSegmentOffset\""); + AddProp(ss, "ime_event", ToString_PP_Resource(ime_event)); + AddProp(ss, "index", ToString_uint32_t(index)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint32_t rval = ((PPB_IMEInputEvent_1_0*)RealGetInterface("PPB_IMEInputEvent;1.0"))->GetSegmentOffset(ime_event, index); + printf("RPC response: ["); + printf("%s", ToString_uint32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetTargetSegment_1_0(PP_Resource ime_event) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_IMEInputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetTargetSegment\""); + AddProp(ss, "ime_event", ToString_PP_Resource(ime_event)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_IMEInputEvent_1_0*)RealGetInterface("PPB_IMEInputEvent;1.0"))->GetTargetSegment(ime_event); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void GetSelection_1_0(PP_Resource ime_event, uint32_t* start, uint32_t* end) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_IMEInputEvent\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetSelection\""); + AddProp(ss, "ime_event", ToString_PP_Resource(ime_event)); + AddProp(ss, "start", PointerToString(start)); + AddProp(ss, "end", PointerToString(end)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_uint32_t(iterator, *start); + iterator.skip(); + FromJSON_uint32_t(iterator, *end); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_IMEInputEvent_1_0*)RealGetInterface("PPB_IMEInputEvent;1.0"))->GetSelection(ime_event, start, end); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + if (!!start) { + AddProp(os, "start", ToString_uint32_t(start)); + } + if (!!end) { + AddProp(os, "end", ToString_uint32_t(end)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +} +static PPB_IMEInputEvent_1_0 _PPB_IMEInputEvent_1_0 = { + ns_PPB_IMEInputEvent_1_0::Create_1_0, + ns_PPB_IMEInputEvent_1_0::IsIMEInputEvent_1_0, + ns_PPB_IMEInputEvent_1_0::GetText_1_0, + ns_PPB_IMEInputEvent_1_0::GetSegmentNumber_1_0, + ns_PPB_IMEInputEvent_1_0::GetSegmentOffset_1_0, + ns_PPB_IMEInputEvent_1_0::GetTargetSegment_1_0, + ns_PPB_IMEInputEvent_1_0::GetSelection_1_0, +}; +const string ToString_PPB_IMEInputEvent(const PPB_IMEInputEvent_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Instance_1_0 { +static PP_Bool BindGraphics_1_0(PP_Instance instance, PP_Resource device) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Instance\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"BindGraphics\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "device", ToString_PP_Resource(device)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Instance_1_0*)RealGetInterface("PPB_Instance;1.0"))->BindGraphics(instance, device); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsFullFrame_1_0(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Instance\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsFullFrame\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Instance_1_0*)RealGetInterface("PPB_Instance;1.0"))->IsFullFrame(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_Instance_1_0 _PPB_Instance_1_0 = { + ns_PPB_Instance_1_0::BindGraphics_1_0, + ns_PPB_Instance_1_0::IsFullFrame_1_0, +}; +const string ToString_PPB_Instance(const PPB_Instance_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_MediaStreamAudioTrack_Attrib(const PP_MediaStreamAudioTrack_Attrib *v) { + switch (*v) { + case 0: + return "\"PP_MEDIASTREAMAUDIOTRACK_ATTRIB_NONE\""; + case 1: + return "\"PP_MEDIASTREAMAUDIOTRACK_ATTRIB_BUFFERS\""; + case 2: + return "\"PP_MEDIASTREAMAUDIOTRACK_ATTRIB_SAMPLE_RATE\""; + case 3: + return "\"PP_MEDIASTREAMAUDIOTRACK_ATTRIB_SAMPLE_SIZE\""; + case 4: + return "\"PP_MEDIASTREAMAUDIOTRACK_ATTRIB_CHANNELS\""; + case 5: + return "\"PP_MEDIASTREAMAUDIOTRACK_ATTRIB_DURATION\""; + default: + return "\"???\""; + } +} +const string ToString_PP_MediaStreamAudioTrack_Attrib(const PP_MediaStreamAudioTrack_Attrib &v) { + return ToString_PP_MediaStreamAudioTrack_Attrib(&v); +} +void FromJSON_PP_MediaStreamAudioTrack_Attrib(JSONIterator& iterator, PP_MediaStreamAudioTrack_Attrib &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_MediaStreamAudioTrack_Attrib(v); +} +namespace ns_PPB_MediaStreamAudioTrack_0_1 { +static PP_Bool IsMediaStreamAudioTrack_0_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MediaStreamAudioTrack\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"IsMediaStreamAudioTrack\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_MediaStreamAudioTrack_0_1*)RealGetInterface("PPB_MediaStreamAudioTrack;0.1"))->IsMediaStreamAudioTrack(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Configure_0_1(PP_Resource audio_track, const int32_t attrib_list[], struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MediaStreamAudioTrack\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Configure\""); + AddProp(ss, "audio_track", ToString_PP_Resource(audio_track)); + { + BeginProp(ss, "attrib_list"); + BeginElements(ss); + for (uint32_t _n = 0; attrib_list[_n] != PP_MEDIASTREAMAUDIOTRACK_ATTRIB_NONE; ++_n) { + AddElement(ss, ToString_int32_t(attrib_list[_n])); + } + EndElements(ss); + } + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_MediaStreamAudioTrack_0_1*)RealGetInterface("PPB_MediaStreamAudioTrack;0.1"))->Configure(audio_track, attrib_list, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetAttrib_0_1(PP_Resource audio_track, PP_MediaStreamAudioTrack_Attrib attrib, int32_t* value) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MediaStreamAudioTrack\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetAttrib\""); + AddProp(ss, "audio_track", ToString_PP_Resource(audio_track)); + AddProp(ss, "attrib", ToString_PP_MediaStreamAudioTrack_Attrib(attrib)); + AddProp(ss, "value", PointerToString(value)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_int32_t(iterator, *value); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_MediaStreamAudioTrack_0_1*)RealGetInterface("PPB_MediaStreamAudioTrack;0.1"))->GetAttrib(audio_track, attrib, value); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!value) { + AddProp(os, "value", ToString_int32_t(value)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetId_0_1(PP_Resource audio_track) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MediaStreamAudioTrack\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetId\""); + AddProp(ss, "audio_track", ToString_PP_Resource(audio_track)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_MediaStreamAudioTrack_0_1*)RealGetInterface("PPB_MediaStreamAudioTrack;0.1"))->GetId(audio_track); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool HasEnded_0_1(PP_Resource audio_track) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MediaStreamAudioTrack\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"HasEnded\""); + AddProp(ss, "audio_track", ToString_PP_Resource(audio_track)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_MediaStreamAudioTrack_0_1*)RealGetInterface("PPB_MediaStreamAudioTrack;0.1"))->HasEnded(audio_track); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetBuffer_0_1(PP_Resource audio_track, PP_Resource* buffer, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MediaStreamAudioTrack\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetBuffer\""); + AddProp(ss, "audio_track", ToString_PP_Resource(audio_track)); + AddProp(ss, "buffer", PointerToString(buffer)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Resource(iterator, *buffer); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_MediaStreamAudioTrack_0_1*)RealGetInterface("PPB_MediaStreamAudioTrack;0.1"))->GetBuffer(audio_track, buffer, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!buffer) { + AddProp(os, "buffer", ToString_PP_Resource(buffer)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t RecycleBuffer_0_1(PP_Resource audio_track, PP_Resource buffer) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MediaStreamAudioTrack\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"RecycleBuffer\""); + AddProp(ss, "audio_track", ToString_PP_Resource(audio_track)); + AddProp(ss, "buffer", ToString_PP_Resource(buffer)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_MediaStreamAudioTrack_0_1*)RealGetInterface("PPB_MediaStreamAudioTrack;0.1"))->RecycleBuffer(audio_track, buffer); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void Close_0_1(PP_Resource audio_track) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MediaStreamAudioTrack\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Close\""); + AddProp(ss, "audio_track", ToString_PP_Resource(audio_track)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_MediaStreamAudioTrack_0_1*)RealGetInterface("PPB_MediaStreamAudioTrack;0.1"))->Close(audio_track); +#endif // !INTERPOSE +} +} +static PPB_MediaStreamAudioTrack_0_1 _PPB_MediaStreamAudioTrack_0_1 = { + ns_PPB_MediaStreamAudioTrack_0_1::IsMediaStreamAudioTrack_0_1, + ns_PPB_MediaStreamAudioTrack_0_1::Configure_0_1, + ns_PPB_MediaStreamAudioTrack_0_1::GetAttrib_0_1, + ns_PPB_MediaStreamAudioTrack_0_1::GetId_0_1, + ns_PPB_MediaStreamAudioTrack_0_1::HasEnded_0_1, + ns_PPB_MediaStreamAudioTrack_0_1::GetBuffer_0_1, + ns_PPB_MediaStreamAudioTrack_0_1::RecycleBuffer_0_1, + ns_PPB_MediaStreamAudioTrack_0_1::Close_0_1, +}; +const string ToString_PPB_MediaStreamAudioTrack(const PPB_MediaStreamAudioTrack_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_MediaStreamVideoTrack_Attrib(const PP_MediaStreamVideoTrack_Attrib *v) { + switch (*v) { + case 0: + return "\"PP_MEDIASTREAMVIDEOTRACK_ATTRIB_NONE\""; + case 1: + return "\"PP_MEDIASTREAMVIDEOTRACK_ATTRIB_BUFFERED_FRAMES\""; + case 2: + return "\"PP_MEDIASTREAMVIDEOTRACK_ATTRIB_WIDTH\""; + case 3: + return "\"PP_MEDIASTREAMVIDEOTRACK_ATTRIB_HEIGHT\""; + case 4: + return "\"PP_MEDIASTREAMVIDEOTRACK_ATTRIB_FORMAT\""; + default: + return "\"???\""; + } +} +const string ToString_PP_MediaStreamVideoTrack_Attrib(const PP_MediaStreamVideoTrack_Attrib &v) { + return ToString_PP_MediaStreamVideoTrack_Attrib(&v); +} +void FromJSON_PP_MediaStreamVideoTrack_Attrib(JSONIterator& iterator, PP_MediaStreamVideoTrack_Attrib &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_MediaStreamVideoTrack_Attrib(v); +} +namespace ns_PPB_MediaStreamVideoTrack_0_1 { +/* skipping Create */ +static PP_Bool IsMediaStreamVideoTrack_0_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MediaStreamVideoTrack\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"IsMediaStreamVideoTrack\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_MediaStreamVideoTrack_0_1*)RealGetInterface("PPB_MediaStreamVideoTrack;0.1"))->IsMediaStreamVideoTrack(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Configure_0_1(PP_Resource video_track, const int32_t attrib_list[], struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MediaStreamVideoTrack\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Configure\""); + AddProp(ss, "video_track", ToString_PP_Resource(video_track)); + { + BeginProp(ss, "attrib_list"); + BeginElements(ss); + for (uint32_t _n = 0; attrib_list[_n] != 0; ++_n) { + AddElement(ss, ToString_int32_t(attrib_list[_n])); + } + EndElements(ss); + } + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_MediaStreamVideoTrack_0_1*)RealGetInterface("PPB_MediaStreamVideoTrack;0.1"))->Configure(video_track, attrib_list, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetAttrib_0_1(PP_Resource video_track, PP_MediaStreamVideoTrack_Attrib attrib, int32_t* value) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MediaStreamVideoTrack\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetAttrib\""); + AddProp(ss, "video_track", ToString_PP_Resource(video_track)); + AddProp(ss, "attrib", ToString_PP_MediaStreamVideoTrack_Attrib(attrib)); + AddProp(ss, "value", PointerToString(value)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_int32_t(iterator, *value); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_MediaStreamVideoTrack_0_1*)RealGetInterface("PPB_MediaStreamVideoTrack;0.1"))->GetAttrib(video_track, attrib, value); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!value) { + AddProp(os, "value", ToString_int32_t(value)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetId_0_1(PP_Resource video_track) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MediaStreamVideoTrack\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetId\""); + AddProp(ss, "video_track", ToString_PP_Resource(video_track)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_MediaStreamVideoTrack_0_1*)RealGetInterface("PPB_MediaStreamVideoTrack;0.1"))->GetId(video_track); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool HasEnded_0_1(PP_Resource video_track) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MediaStreamVideoTrack\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"HasEnded\""); + AddProp(ss, "video_track", ToString_PP_Resource(video_track)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_MediaStreamVideoTrack_0_1*)RealGetInterface("PPB_MediaStreamVideoTrack;0.1"))->HasEnded(video_track); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetFrame_0_1(PP_Resource video_track, PP_Resource* frame, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MediaStreamVideoTrack\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetFrame\""); + AddProp(ss, "video_track", ToString_PP_Resource(video_track)); + AddProp(ss, "frame", PointerToString(frame)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Resource(iterator, *frame); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_MediaStreamVideoTrack_0_1*)RealGetInterface("PPB_MediaStreamVideoTrack;0.1"))->GetFrame(video_track, frame, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!frame) { + AddProp(os, "frame", ToString_PP_Resource(frame)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t RecycleFrame_0_1(PP_Resource video_track, PP_Resource frame) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MediaStreamVideoTrack\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"RecycleFrame\""); + AddProp(ss, "video_track", ToString_PP_Resource(video_track)); + AddProp(ss, "frame", ToString_PP_Resource(frame)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_MediaStreamVideoTrack_0_1*)RealGetInterface("PPB_MediaStreamVideoTrack;0.1"))->RecycleFrame(video_track, frame); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void Close_0_1(PP_Resource video_track) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MediaStreamVideoTrack\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Close\""); + AddProp(ss, "video_track", ToString_PP_Resource(video_track)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_MediaStreamVideoTrack_0_1*)RealGetInterface("PPB_MediaStreamVideoTrack;0.1"))->Close(video_track); +#endif // !INTERPOSE +} +/* skipping GetEmptyFrame */ +/* skipping PutFrame */ +} +static PPB_MediaStreamVideoTrack_0_1 _PPB_MediaStreamVideoTrack_0_1 = { + ns_PPB_MediaStreamVideoTrack_0_1::IsMediaStreamVideoTrack_0_1, + ns_PPB_MediaStreamVideoTrack_0_1::Configure_0_1, + ns_PPB_MediaStreamVideoTrack_0_1::GetAttrib_0_1, + ns_PPB_MediaStreamVideoTrack_0_1::GetId_0_1, + ns_PPB_MediaStreamVideoTrack_0_1::HasEnded_0_1, + ns_PPB_MediaStreamVideoTrack_0_1::GetFrame_0_1, + ns_PPB_MediaStreamVideoTrack_0_1::RecycleFrame_0_1, + ns_PPB_MediaStreamVideoTrack_0_1::Close_0_1, +}; +const string ToString_PPB_MediaStreamVideoTrack(const PPB_MediaStreamVideoTrack_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_MediaStreamVideoTrack_1_0 { +static PP_Resource Create_1_0(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MediaStreamVideoTrack\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_MediaStreamVideoTrack_1_0*)RealGetInterface("PPB_MediaStreamVideoTrack;1.0"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsMediaStreamVideoTrack_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MediaStreamVideoTrack\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsMediaStreamVideoTrack\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_MediaStreamVideoTrack_1_0*)RealGetInterface("PPB_MediaStreamVideoTrack;1.0"))->IsMediaStreamVideoTrack(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Configure_1_0(PP_Resource video_track, const int32_t attrib_list[], struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MediaStreamVideoTrack\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Configure\""); + AddProp(ss, "video_track", ToString_PP_Resource(video_track)); + { + BeginProp(ss, "attrib_list"); + BeginElements(ss); + for (uint32_t _n = 0; attrib_list[_n] != 0; ++_n) { + AddElement(ss, ToString_int32_t(attrib_list[_n])); + } + EndElements(ss); + } + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_MediaStreamVideoTrack_1_0*)RealGetInterface("PPB_MediaStreamVideoTrack;1.0"))->Configure(video_track, attrib_list, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetAttrib_1_0(PP_Resource video_track, PP_MediaStreamVideoTrack_Attrib attrib, int32_t* value) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MediaStreamVideoTrack\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetAttrib\""); + AddProp(ss, "video_track", ToString_PP_Resource(video_track)); + AddProp(ss, "attrib", ToString_PP_MediaStreamVideoTrack_Attrib(attrib)); + AddProp(ss, "value", PointerToString(value)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_int32_t(iterator, *value); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_MediaStreamVideoTrack_1_0*)RealGetInterface("PPB_MediaStreamVideoTrack;1.0"))->GetAttrib(video_track, attrib, value); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!value) { + AddProp(os, "value", ToString_int32_t(value)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetId_1_0(PP_Resource video_track) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MediaStreamVideoTrack\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetId\""); + AddProp(ss, "video_track", ToString_PP_Resource(video_track)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_MediaStreamVideoTrack_1_0*)RealGetInterface("PPB_MediaStreamVideoTrack;1.0"))->GetId(video_track); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool HasEnded_1_0(PP_Resource video_track) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MediaStreamVideoTrack\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"HasEnded\""); + AddProp(ss, "video_track", ToString_PP_Resource(video_track)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_MediaStreamVideoTrack_1_0*)RealGetInterface("PPB_MediaStreamVideoTrack;1.0"))->HasEnded(video_track); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetFrame_1_0(PP_Resource video_track, PP_Resource* frame, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MediaStreamVideoTrack\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetFrame\""); + AddProp(ss, "video_track", ToString_PP_Resource(video_track)); + AddProp(ss, "frame", PointerToString(frame)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Resource(iterator, *frame); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_MediaStreamVideoTrack_1_0*)RealGetInterface("PPB_MediaStreamVideoTrack;1.0"))->GetFrame(video_track, frame, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!frame) { + AddProp(os, "frame", ToString_PP_Resource(frame)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t RecycleFrame_1_0(PP_Resource video_track, PP_Resource frame) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MediaStreamVideoTrack\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"RecycleFrame\""); + AddProp(ss, "video_track", ToString_PP_Resource(video_track)); + AddProp(ss, "frame", ToString_PP_Resource(frame)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_MediaStreamVideoTrack_1_0*)RealGetInterface("PPB_MediaStreamVideoTrack;1.0"))->RecycleFrame(video_track, frame); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void Close_1_0(PP_Resource video_track) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MediaStreamVideoTrack\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Close\""); + AddProp(ss, "video_track", ToString_PP_Resource(video_track)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_MediaStreamVideoTrack_1_0*)RealGetInterface("PPB_MediaStreamVideoTrack;1.0"))->Close(video_track); +#endif // !INTERPOSE +} +static int32_t GetEmptyFrame_1_0(PP_Resource video_track, PP_Resource* frame, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MediaStreamVideoTrack\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetEmptyFrame\""); + AddProp(ss, "video_track", ToString_PP_Resource(video_track)); + AddProp(ss, "frame", PointerToString(frame)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Resource(iterator, *frame); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_MediaStreamVideoTrack_1_0*)RealGetInterface("PPB_MediaStreamVideoTrack;1.0"))->GetEmptyFrame(video_track, frame, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!frame) { + AddProp(os, "frame", ToString_PP_Resource(frame)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t PutFrame_1_0(PP_Resource video_track, PP_Resource frame) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MediaStreamVideoTrack\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"PutFrame\""); + AddProp(ss, "video_track", ToString_PP_Resource(video_track)); + AddProp(ss, "frame", ToString_PP_Resource(frame)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_MediaStreamVideoTrack_1_0*)RealGetInterface("PPB_MediaStreamVideoTrack;1.0"))->PutFrame(video_track, frame); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_MediaStreamVideoTrack_1_0 _PPB_MediaStreamVideoTrack_1_0 = { + ns_PPB_MediaStreamVideoTrack_1_0::Create_1_0, + ns_PPB_MediaStreamVideoTrack_1_0::IsMediaStreamVideoTrack_1_0, + ns_PPB_MediaStreamVideoTrack_1_0::Configure_1_0, + ns_PPB_MediaStreamVideoTrack_1_0::GetAttrib_1_0, + ns_PPB_MediaStreamVideoTrack_1_0::GetId_1_0, + ns_PPB_MediaStreamVideoTrack_1_0::HasEnded_1_0, + ns_PPB_MediaStreamVideoTrack_1_0::GetFrame_1_0, + ns_PPB_MediaStreamVideoTrack_1_0::RecycleFrame_1_0, + ns_PPB_MediaStreamVideoTrack_1_0::Close_1_0, + ns_PPB_MediaStreamVideoTrack_1_0::GetEmptyFrame_1_0, + ns_PPB_MediaStreamVideoTrack_1_0::PutFrame_1_0, +}; +const string ToString_PPB_MediaStreamVideoTrack(const PPB_MediaStreamVideoTrack_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_MessageLoop_1_0 { +static PP_Resource Create_1_0(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MessageLoop\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_MessageLoop_1_0*)RealGetInterface("PPB_MessageLoop;1.0"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource GetForMainThread_1_0(void) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MessageLoop\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetForMainThread\""); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_MessageLoop_1_0*)RealGetInterface("PPB_MessageLoop;1.0"))->GetForMainThread(); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource GetCurrent_1_0(void) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MessageLoop\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetCurrent\""); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_MessageLoop_1_0*)RealGetInterface("PPB_MessageLoop;1.0"))->GetCurrent(); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t AttachToCurrentThread_1_0(PP_Resource message_loop) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MessageLoop\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"AttachToCurrentThread\""); + AddProp(ss, "message_loop", ToString_PP_Resource(message_loop)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_MessageLoop_1_0*)RealGetInterface("PPB_MessageLoop;1.0"))->AttachToCurrentThread(message_loop); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Run_1_0(PP_Resource message_loop) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MessageLoop\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Run\""); + AddProp(ss, "message_loop", ToString_PP_Resource(message_loop)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_MessageLoop_1_0*)RealGetInterface("PPB_MessageLoop;1.0"))->Run(message_loop); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t PostWork_1_0(PP_Resource message_loop, struct PP_CompletionCallback callback, int64_t delay_ms) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MessageLoop\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"PostWork\""); + AddProp(ss, "message_loop", ToString_PP_Resource(message_loop)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + AddProp(ss, "delay_ms", ToString_int64_t(delay_ms)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_MessageLoop_1_0*)RealGetInterface("PPB_MessageLoop;1.0"))->PostWork(message_loop, logging_callback, delay_ms); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t PostQuit_1_0(PP_Resource message_loop, PP_Bool should_destroy) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MessageLoop\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"PostQuit\""); + AddProp(ss, "message_loop", ToString_PP_Resource(message_loop)); + AddProp(ss, "should_destroy", ToString_PP_Bool(should_destroy)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_MessageLoop_1_0*)RealGetInterface("PPB_MessageLoop;1.0"))->PostQuit(message_loop, should_destroy); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_MessageLoop_1_0 _PPB_MessageLoop_1_0 = { + ns_PPB_MessageLoop_1_0::Create_1_0, + ns_PPB_MessageLoop_1_0::GetForMainThread_1_0, + ns_PPB_MessageLoop_1_0::GetCurrent_1_0, + ns_PPB_MessageLoop_1_0::AttachToCurrentThread_1_0, + ns_PPB_MessageLoop_1_0::Run_1_0, + ns_PPB_MessageLoop_1_0::PostWork_1_0, + ns_PPB_MessageLoop_1_0::PostQuit_1_0, +}; +const string ToString_PPB_MessageLoop(const PPB_MessageLoop_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Messaging_1_0 { +static void PostMessage_1_0(PP_Instance instance, struct PP_Var message) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Messaging\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"PostMessage\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "message", ToString_PP_Var(message)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Messaging_1_0*)RealGetInterface("PPB_Messaging;1.0"))->PostMessage(instance, message); +#endif // !INTERPOSE +} +/* skipping RegisterMessageHandler */ +/* skipping UnregisterMessageHandler */ +} +static PPB_Messaging_1_0 _PPB_Messaging_1_0 = { + ns_PPB_Messaging_1_0::PostMessage_1_0, +}; +const string ToString_PPB_Messaging(const PPB_Messaging_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Messaging_1_2 { +static void PostMessage_1_2(PP_Instance instance, struct PP_Var message) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Messaging\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"PostMessage\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "message", ToString_PP_Var(message)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Messaging_1_2*)RealGetInterface("PPB_Messaging;1.2"))->PostMessage(instance, message); +#endif // !INTERPOSE +} +static int32_t RegisterMessageHandler_1_2(PP_Instance instance, void* user_data, const struct PPP_MessageHandler_0_2* handler, PP_Resource message_loop) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Messaging\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"RegisterMessageHandler\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "user_data", ToString_mem_t(user_data)); + AddProp(ss, "handler", ToString_PPP_MessageHandler(handler)); + AddProp(ss, "message_loop", ToString_PP_Resource(message_loop)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Messaging_1_2*)RealGetInterface("PPB_Messaging;1.2"))->RegisterMessageHandler(instance, user_data, handler, message_loop); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void UnregisterMessageHandler_1_2(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Messaging\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"UnregisterMessageHandler\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Messaging_1_2*)RealGetInterface("PPB_Messaging;1.2"))->UnregisterMessageHandler(instance); +#endif // !INTERPOSE +} +} +static PPB_Messaging_1_2 _PPB_Messaging_1_2 = { + ns_PPB_Messaging_1_2::PostMessage_1_2, + ns_PPB_Messaging_1_2::RegisterMessageHandler_1_2, + ns_PPB_Messaging_1_2::UnregisterMessageHandler_1_2, +}; +const string ToString_PPB_Messaging(const PPB_Messaging_1_2 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_MouseCursor_Type(const PP_MouseCursor_Type *v) { + switch (*v) { + case -1: + return "\"PP_MOUSECURSOR_TYPE_CUSTOM\""; + case 0: + return "\"PP_MOUSECURSOR_TYPE_POINTER\""; + case 1: + return "\"PP_MOUSECURSOR_TYPE_CROSS\""; + case 2: + return "\"PP_MOUSECURSOR_TYPE_HAND\""; + case 3: + return "\"PP_MOUSECURSOR_TYPE_IBEAM\""; + case 4: + return "\"PP_MOUSECURSOR_TYPE_WAIT\""; + case 5: + return "\"PP_MOUSECURSOR_TYPE_HELP\""; + case 6: + return "\"PP_MOUSECURSOR_TYPE_EASTRESIZE\""; + case 7: + return "\"PP_MOUSECURSOR_TYPE_NORTHRESIZE\""; + case 8: + return "\"PP_MOUSECURSOR_TYPE_NORTHEASTRESIZE\""; + case 9: + return "\"PP_MOUSECURSOR_TYPE_NORTHWESTRESIZE\""; + case 10: + return "\"PP_MOUSECURSOR_TYPE_SOUTHRESIZE\""; + case 11: + return "\"PP_MOUSECURSOR_TYPE_SOUTHEASTRESIZE\""; + case 12: + return "\"PP_MOUSECURSOR_TYPE_SOUTHWESTRESIZE\""; + case 13: + return "\"PP_MOUSECURSOR_TYPE_WESTRESIZE\""; + case 14: + return "\"PP_MOUSECURSOR_TYPE_NORTHSOUTHRESIZE\""; + case 15: + return "\"PP_MOUSECURSOR_TYPE_EASTWESTRESIZE\""; + case 16: + return "\"PP_MOUSECURSOR_TYPE_NORTHEASTSOUTHWESTRESIZE\""; + case 17: + return "\"PP_MOUSECURSOR_TYPE_NORTHWESTSOUTHEASTRESIZE\""; + case 18: + return "\"PP_MOUSECURSOR_TYPE_COLUMNRESIZE\""; + case 19: + return "\"PP_MOUSECURSOR_TYPE_ROWRESIZE\""; + case 20: + return "\"PP_MOUSECURSOR_TYPE_MIDDLEPANNING\""; + case 21: + return "\"PP_MOUSECURSOR_TYPE_EASTPANNING\""; + case 22: + return "\"PP_MOUSECURSOR_TYPE_NORTHPANNING\""; + case 23: + return "\"PP_MOUSECURSOR_TYPE_NORTHEASTPANNING\""; + case 24: + return "\"PP_MOUSECURSOR_TYPE_NORTHWESTPANNING\""; + case 25: + return "\"PP_MOUSECURSOR_TYPE_SOUTHPANNING\""; + case 26: + return "\"PP_MOUSECURSOR_TYPE_SOUTHEASTPANNING\""; + case 27: + return "\"PP_MOUSECURSOR_TYPE_SOUTHWESTPANNING\""; + case 28: + return "\"PP_MOUSECURSOR_TYPE_WESTPANNING\""; + case 29: + return "\"PP_MOUSECURSOR_TYPE_MOVE\""; + case 30: + return "\"PP_MOUSECURSOR_TYPE_VERTICALTEXT\""; + case 31: + return "\"PP_MOUSECURSOR_TYPE_CELL\""; + case 32: + return "\"PP_MOUSECURSOR_TYPE_CONTEXTMENU\""; + case 33: + return "\"PP_MOUSECURSOR_TYPE_ALIAS\""; + case 34: + return "\"PP_MOUSECURSOR_TYPE_PROGRESS\""; + case 35: + return "\"PP_MOUSECURSOR_TYPE_NODROP\""; + case 36: + return "\"PP_MOUSECURSOR_TYPE_COPY\""; + case 37: + return "\"PP_MOUSECURSOR_TYPE_NONE\""; + case 38: + return "\"PP_MOUSECURSOR_TYPE_NOTALLOWED\""; + case 39: + return "\"PP_MOUSECURSOR_TYPE_ZOOMIN\""; + case 40: + return "\"PP_MOUSECURSOR_TYPE_ZOOMOUT\""; + case 41: + return "\"PP_MOUSECURSOR_TYPE_GRAB\""; + case 42: + return "\"PP_MOUSECURSOR_TYPE_GRABBING\""; + default: + return "\"???\""; + } +} +const string ToString_PP_MouseCursor_Type(const PP_MouseCursor_Type &v) { + return ToString_PP_MouseCursor_Type(&v); +} +void FromJSON_PP_MouseCursor_Type(JSONIterator& iterator, PP_MouseCursor_Type &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_MouseCursor_Type(v); +} +namespace ns_PPB_MouseCursor_1_0 { +static PP_Bool SetCursor_1_0(PP_Instance instance, enum PP_MouseCursor_Type type, PP_Resource image, const struct PP_Point* hot_spot) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MouseCursor\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"SetCursor\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "type", ToString_PP_MouseCursor_Type(type)); + AddProp(ss, "image", ToString_PP_Resource(image)); + AddProp(ss, "hot_spot", ToString_PP_Point(hot_spot)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_MouseCursor_1_0*)RealGetInterface("PPB_MouseCursor;1.0"))->SetCursor(instance, type, image, hot_spot); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_MouseCursor_1_0 _PPB_MouseCursor_1_0 = { + ns_PPB_MouseCursor_1_0::SetCursor_1_0, +}; +const string ToString_PPB_MouseCursor(const PPB_MouseCursor_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_MouseLock_1_0 { +static int32_t LockMouse_1_0(PP_Instance instance, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MouseLock\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"LockMouse\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_MouseLock_1_0*)RealGetInterface("PPB_MouseLock;1.0"))->LockMouse(instance, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void UnlockMouse_1_0(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_MouseLock\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"UnlockMouse\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_MouseLock_1_0*)RealGetInterface("PPB_MouseLock;1.0"))->UnlockMouse(instance); +#endif // !INTERPOSE +} +} +static PPB_MouseLock_1_0 _PPB_MouseLock_1_0 = { + ns_PPB_MouseLock_1_0::LockMouse_1_0, + ns_PPB_MouseLock_1_0::UnlockMouse_1_0, +}; +const string ToString_PPB_MouseLock(const PPB_MouseLock_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_NetAddress_Family(const PP_NetAddress_Family *v) { + switch (*v) { + case 0: + return "\"PP_NETADDRESS_FAMILY_UNSPECIFIED\""; + case 1: + return "\"PP_NETADDRESS_FAMILY_IPV4\""; + case 2: + return "\"PP_NETADDRESS_FAMILY_IPV6\""; + default: + return "\"???\""; + } +} +const string ToString_PP_NetAddress_Family(const PP_NetAddress_Family &v) { + return ToString_PP_NetAddress_Family(&v); +} +void FromJSON_PP_NetAddress_Family(JSONIterator& iterator, PP_NetAddress_Family &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_NetAddress_Family(v); +} +const string ToString_PP_NetAddress_IPv4(const PP_NetAddress_IPv4 *v) { + if (!v) { + return "null"; + } + return ToString_PP_NetAddress_IPv4(*v); +} +const string ToString_PP_NetAddress_IPv4(const PP_NetAddress_IPv4 &v) { + stringstream x; + BeginProps(x); + AddProp(x, "port", ToString_uint16_t(v.port)); + { + BeginProp(x, "addr"); + BeginElements(x); + for (uint32_t _n = 0; _n < 4; ++_n) { + AddElement(x, ToString_uint8_t(v.addr[_n])); + } + EndElements(x); + } + EndProps(x); + return x.str(); +} +void FromJSON_PP_NetAddress_IPv4(JSONIterator& iterator, PP_NetAddress_IPv4 &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_uint16_t(iterator, value.port); + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > 4) { + Fail("Too many items in array\n", ""); + } + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_uint8_t(iterator, (value.addr)[_n]); + } + // FIXME Null out remaining items? + } +} +const string ToString_PP_NetAddress_IPv6(const PP_NetAddress_IPv6 *v) { + if (!v) { + return "null"; + } + return ToString_PP_NetAddress_IPv6(*v); +} +const string ToString_PP_NetAddress_IPv6(const PP_NetAddress_IPv6 &v) { + stringstream x; + BeginProps(x); + AddProp(x, "port", ToString_uint16_t(v.port)); + { + BeginProp(x, "addr"); + BeginElements(x); + for (uint32_t _n = 0; _n < 16; ++_n) { + AddElement(x, ToString_uint8_t(v.addr[_n])); + } + EndElements(x); + } + EndProps(x); + return x.str(); +} +void FromJSON_PP_NetAddress_IPv6(JSONIterator& iterator, PP_NetAddress_IPv6 &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_uint16_t(iterator, value.port); + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > 16) { + Fail("Too many items in array\n", ""); + } + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_uint8_t(iterator, (value.addr)[_n]); + } + // FIXME Null out remaining items? + } +} +namespace ns_PPB_NetAddress_1_0 { +static PP_Resource CreateFromIPv4Address_1_0(PP_Instance instance, const struct PP_NetAddress_IPv4* ipv4_addr) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"CreateFromIPv4Address\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "ipv4_addr", ToString_PP_NetAddress_IPv4(ipv4_addr)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_NetAddress_1_0*)RealGetInterface("PPB_NetAddress;1.0"))->CreateFromIPv4Address(instance, ipv4_addr); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource CreateFromIPv6Address_1_0(PP_Instance instance, const struct PP_NetAddress_IPv6* ipv6_addr) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"CreateFromIPv6Address\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "ipv6_addr", ToString_PP_NetAddress_IPv6(ipv6_addr)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_NetAddress_1_0*)RealGetInterface("PPB_NetAddress;1.0"))->CreateFromIPv6Address(instance, ipv6_addr); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsNetAddress_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsNetAddress\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_NetAddress_1_0*)RealGetInterface("PPB_NetAddress;1.0"))->IsNetAddress(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_NetAddress_Family GetFamily_1_0(PP_Resource addr) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetFamily\""); + AddProp(ss, "addr", ToString_PP_Resource(addr)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_NetAddress_Family rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_NetAddress_Family(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_NetAddress_Family rval = ((PPB_NetAddress_1_0*)RealGetInterface("PPB_NetAddress;1.0"))->GetFamily(addr); + printf("RPC response: ["); + printf("%s", ToString_PP_NetAddress_Family(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var DescribeAsString_1_0(PP_Resource addr, PP_Bool include_port) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"DescribeAsString\""); + AddProp(ss, "addr", ToString_PP_Resource(addr)); + AddProp(ss, "include_port", ToString_PP_Bool(include_port)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_NetAddress_1_0*)RealGetInterface("PPB_NetAddress;1.0"))->DescribeAsString(addr, include_port); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool DescribeAsIPv4Address_1_0(PP_Resource addr, struct PP_NetAddress_IPv4* ipv4_addr) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"DescribeAsIPv4Address\""); + AddProp(ss, "addr", ToString_PP_Resource(addr)); + AddProp(ss, "ipv4_addr", PointerToString(ipv4_addr)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!ipv4_addr) { + iterator.skip(); + FromJSON_PP_NetAddress_IPv4(iterator, *ipv4_addr); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_NetAddress_1_0*)RealGetInterface("PPB_NetAddress;1.0"))->DescribeAsIPv4Address(addr, ipv4_addr); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!ipv4_addr) { + AddProp(os, "ipv4_addr", ToString_PP_NetAddress_IPv4(ipv4_addr)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool DescribeAsIPv6Address_1_0(PP_Resource addr, struct PP_NetAddress_IPv6* ipv6_addr) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"DescribeAsIPv6Address\""); + AddProp(ss, "addr", ToString_PP_Resource(addr)); + AddProp(ss, "ipv6_addr", PointerToString(ipv6_addr)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!ipv6_addr) { + iterator.skip(); + FromJSON_PP_NetAddress_IPv6(iterator, *ipv6_addr); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_NetAddress_1_0*)RealGetInterface("PPB_NetAddress;1.0"))->DescribeAsIPv6Address(addr, ipv6_addr); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!ipv6_addr) { + AddProp(os, "ipv6_addr", ToString_PP_NetAddress_IPv6(ipv6_addr)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_NetAddress_1_0 _PPB_NetAddress_1_0 = { + ns_PPB_NetAddress_1_0::CreateFromIPv4Address_1_0, + ns_PPB_NetAddress_1_0::CreateFromIPv6Address_1_0, + ns_PPB_NetAddress_1_0::IsNetAddress_1_0, + ns_PPB_NetAddress_1_0::GetFamily_1_0, + ns_PPB_NetAddress_1_0::DescribeAsString_1_0, + ns_PPB_NetAddress_1_0::DescribeAsIPv4Address_1_0, + ns_PPB_NetAddress_1_0::DescribeAsIPv6Address_1_0, +}; +const string ToString_PPB_NetAddress(const PPB_NetAddress_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_NetworkList_Type(const PP_NetworkList_Type *v) { + switch (*v) { + case 0: + return "\"PP_NETWORKLIST_TYPE_UNKNOWN\""; + case 1: + return "\"PP_NETWORKLIST_TYPE_ETHERNET\""; + case 2: + return "\"PP_NETWORKLIST_TYPE_WIFI\""; + case 3: + return "\"PP_NETWORKLIST_TYPE_CELLULAR\""; + default: + return "\"???\""; + } +} +const string ToString_PP_NetworkList_Type(const PP_NetworkList_Type &v) { + return ToString_PP_NetworkList_Type(&v); +} +void FromJSON_PP_NetworkList_Type(JSONIterator& iterator, PP_NetworkList_Type &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_NetworkList_Type(v); +} +const string ToString_PP_NetworkList_State(const PP_NetworkList_State *v) { + switch (*v) { + case 0: + return "\"PP_NETWORKLIST_STATE_DOWN\""; + case 1: + return "\"PP_NETWORKLIST_STATE_UP\""; + default: + return "\"???\""; + } +} +const string ToString_PP_NetworkList_State(const PP_NetworkList_State &v) { + return ToString_PP_NetworkList_State(&v); +} +void FromJSON_PP_NetworkList_State(JSONIterator& iterator, PP_NetworkList_State &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_NetworkList_State(v); +} +namespace ns_PPB_NetworkList_1_0 { +static PP_Bool IsNetworkList_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetworkList\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsNetworkList\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_NetworkList_1_0*)RealGetInterface("PPB_NetworkList;1.0"))->IsNetworkList(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint32_t GetCount_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetworkList\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetCount\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint32_t rval = ((PPB_NetworkList_1_0*)RealGetInterface("PPB_NetworkList;1.0"))->GetCount(resource); + printf("RPC response: ["); + printf("%s", ToString_uint32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetName_1_0(PP_Resource resource, uint32_t index) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetworkList\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetName\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + AddProp(ss, "index", ToString_uint32_t(index)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_NetworkList_1_0*)RealGetInterface("PPB_NetworkList;1.0"))->GetName(resource, index); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_NetworkList_Type GetType_1_0(PP_Resource resource, uint32_t index) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetworkList\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetType\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + AddProp(ss, "index", ToString_uint32_t(index)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_NetworkList_Type rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_NetworkList_Type(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_NetworkList_Type rval = ((PPB_NetworkList_1_0*)RealGetInterface("PPB_NetworkList;1.0"))->GetType(resource, index); + printf("RPC response: ["); + printf("%s", ToString_PP_NetworkList_Type(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_NetworkList_State GetState_1_0(PP_Resource resource, uint32_t index) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetworkList\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetState\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + AddProp(ss, "index", ToString_uint32_t(index)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_NetworkList_State rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_NetworkList_State(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_NetworkList_State rval = ((PPB_NetworkList_1_0*)RealGetInterface("PPB_NetworkList;1.0"))->GetState(resource, index); + printf("RPC response: ["); + printf("%s", ToString_PP_NetworkList_State(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetIpAddresses_1_0(PP_Resource resource, uint32_t index, struct PP_ArrayOutput output) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetworkList\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetIpAddresses\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + AddProp(ss, "index", ToString_uint32_t(index)); + AddProp(ss, "output", ToString_PP_ArrayOutput(output)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_NetworkList_1_0*)RealGetInterface("PPB_NetworkList;1.0"))->GetIpAddresses(resource, index, output); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetDisplayName_1_0(PP_Resource resource, uint32_t index) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetworkList\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetDisplayName\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + AddProp(ss, "index", ToString_uint32_t(index)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_NetworkList_1_0*)RealGetInterface("PPB_NetworkList;1.0"))->GetDisplayName(resource, index); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint32_t GetMTU_1_0(PP_Resource resource, uint32_t index) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetworkList\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetMTU\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + AddProp(ss, "index", ToString_uint32_t(index)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint32_t rval = ((PPB_NetworkList_1_0*)RealGetInterface("PPB_NetworkList;1.0"))->GetMTU(resource, index); + printf("RPC response: ["); + printf("%s", ToString_uint32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_NetworkList_1_0 _PPB_NetworkList_1_0 = { + ns_PPB_NetworkList_1_0::IsNetworkList_1_0, + ns_PPB_NetworkList_1_0::GetCount_1_0, + ns_PPB_NetworkList_1_0::GetName_1_0, + ns_PPB_NetworkList_1_0::GetType_1_0, + ns_PPB_NetworkList_1_0::GetState_1_0, + ns_PPB_NetworkList_1_0::GetIpAddresses_1_0, + ns_PPB_NetworkList_1_0::GetDisplayName_1_0, + ns_PPB_NetworkList_1_0::GetMTU_1_0, +}; +const string ToString_PPB_NetworkList(const PPB_NetworkList_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_NetworkMonitor_1_0 { +static PP_Resource Create_1_0(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetworkMonitor\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_NetworkMonitor_1_0*)RealGetInterface("PPB_NetworkMonitor;1.0"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t UpdateNetworkList_1_0(PP_Resource network_monitor, PP_Resource* network_list, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetworkMonitor\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"UpdateNetworkList\""); + AddProp(ss, "network_monitor", ToString_PP_Resource(network_monitor)); + AddProp(ss, "network_list", PointerToString(network_list)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Resource(iterator, *network_list); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_NetworkMonitor_1_0*)RealGetInterface("PPB_NetworkMonitor;1.0"))->UpdateNetworkList(network_monitor, network_list, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!network_list) { + AddProp(os, "network_list", ToString_PP_Resource(network_list)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsNetworkMonitor_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetworkMonitor\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsNetworkMonitor\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_NetworkMonitor_1_0*)RealGetInterface("PPB_NetworkMonitor;1.0"))->IsNetworkMonitor(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_NetworkMonitor_1_0 _PPB_NetworkMonitor_1_0 = { + ns_PPB_NetworkMonitor_1_0::Create_1_0, + ns_PPB_NetworkMonitor_1_0::UpdateNetworkList_1_0, + ns_PPB_NetworkMonitor_1_0::IsNetworkMonitor_1_0, +}; +const string ToString_PPB_NetworkMonitor(const PPB_NetworkMonitor_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_NetworkProxy_1_0 { +static int32_t GetProxyForURL_1_0(PP_Instance instance, struct PP_Var url, struct PP_Var* proxy_string, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetworkProxy\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetProxyForURL\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "url", ToString_PP_Var(url)); + AddProp(ss, "proxy_string", PointerToString(proxy_string)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Var(iterator, *proxy_string); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_NetworkProxy_1_0*)RealGetInterface("PPB_NetworkProxy;1.0"))->GetProxyForURL(instance, url, proxy_string, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!proxy_string) { + AddProp(os, "proxy_string", ToString_PP_Var(proxy_string)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_NetworkProxy_1_0 _PPB_NetworkProxy_1_0 = { + ns_PPB_NetworkProxy_1_0::GetProxyForURL_1_0, +}; +const string ToString_PPB_NetworkProxy(const PPB_NetworkProxy_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_OpenGLES2_1_0 { +static void ActiveTexture_1_0(PP_Resource context, GLenum texture) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"ActiveTexture\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "texture", ToString_GLenum(texture)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->ActiveTexture(context, texture); +#endif // !INTERPOSE +} +static void AttachShader_1_0(PP_Resource context, GLuint program, GLuint shader) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"AttachShader\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "program", ToString_GLuint(program)); + AddProp(ss, "shader", ToString_GLuint(shader)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->AttachShader(context, program, shader); +#endif // !INTERPOSE +} +static void BindAttribLocation_1_0(PP_Resource context, GLuint program, GLuint index, const char* name) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"BindAttribLocation\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "program", ToString_GLuint(program)); + AddProp(ss, "index", ToString_GLuint(index)); + AddProp(ss, "name", ToString_cstr_t(name)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->BindAttribLocation(context, program, index, name); +#endif // !INTERPOSE +} +static void BindBuffer_1_0(PP_Resource context, GLenum target, GLuint buffer) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"BindBuffer\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + AddProp(ss, "buffer", ToString_GLuint(buffer)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->BindBuffer(context, target, buffer); +#endif // !INTERPOSE +} +static void BindFramebuffer_1_0(PP_Resource context, GLenum target, GLuint framebuffer) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"BindFramebuffer\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + AddProp(ss, "framebuffer", ToString_GLuint(framebuffer)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->BindFramebuffer(context, target, framebuffer); +#endif // !INTERPOSE +} +static void BindRenderbuffer_1_0(PP_Resource context, GLenum target, GLuint renderbuffer) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"BindRenderbuffer\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + AddProp(ss, "renderbuffer", ToString_GLuint(renderbuffer)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->BindRenderbuffer(context, target, renderbuffer); +#endif // !INTERPOSE +} +static void BindTexture_1_0(PP_Resource context, GLenum target, GLuint texture) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"BindTexture\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + AddProp(ss, "texture", ToString_GLuint(texture)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->BindTexture(context, target, texture); +#endif // !INTERPOSE +} +static void BlendColor_1_0(PP_Resource context, GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"BlendColor\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "red", ToString_GLclampf(red)); + AddProp(ss, "green", ToString_GLclampf(green)); + AddProp(ss, "blue", ToString_GLclampf(blue)); + AddProp(ss, "alpha", ToString_GLclampf(alpha)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->BlendColor(context, red, green, blue, alpha); +#endif // !INTERPOSE +} +static void BlendEquation_1_0(PP_Resource context, GLenum mode) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"BlendEquation\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "mode", ToString_GLenum(mode)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->BlendEquation(context, mode); +#endif // !INTERPOSE +} +static void BlendEquationSeparate_1_0(PP_Resource context, GLenum modeRGB, GLenum modeAlpha) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"BlendEquationSeparate\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "modeRGB", ToString_GLenum(modeRGB)); + AddProp(ss, "modeAlpha", ToString_GLenum(modeAlpha)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->BlendEquationSeparate(context, modeRGB, modeAlpha); +#endif // !INTERPOSE +} +static void BlendFunc_1_0(PP_Resource context, GLenum sfactor, GLenum dfactor) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"BlendFunc\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "sfactor", ToString_GLenum(sfactor)); + AddProp(ss, "dfactor", ToString_GLenum(dfactor)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->BlendFunc(context, sfactor, dfactor); +#endif // !INTERPOSE +} +static void BlendFuncSeparate_1_0(PP_Resource context, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"BlendFuncSeparate\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "srcRGB", ToString_GLenum(srcRGB)); + AddProp(ss, "dstRGB", ToString_GLenum(dstRGB)); + AddProp(ss, "srcAlpha", ToString_GLenum(srcAlpha)); + AddProp(ss, "dstAlpha", ToString_GLenum(dstAlpha)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->BlendFuncSeparate(context, srcRGB, dstRGB, srcAlpha, dstAlpha); +#endif // !INTERPOSE +} +static void BufferData_1_0(PP_Resource context, GLenum target, GLsizeiptr size, const void* data, GLenum usage) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"BufferData\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + AddProp(ss, "size", ToString_GLsizeiptr(size)); + AddProp(ss, "data", ToString_mem_t(data)); + AddProp(ss, "usage", ToString_GLenum(usage)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->BufferData(context, target, size, data, usage); +#endif // !INTERPOSE +} +static void BufferSubData_1_0(PP_Resource context, GLenum target, GLintptr offset, GLsizeiptr size, const void* data) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"BufferSubData\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + AddProp(ss, "offset", ToString_GLintptr(offset)); + AddProp(ss, "size", ToString_GLsizeiptr(size)); + AddProp(ss, "data", ToString_mem_t(data)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->BufferSubData(context, target, offset, size, data); +#endif // !INTERPOSE +} +static GLenum CheckFramebufferStatus_1_0(PP_Resource context, GLenum target) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"CheckFramebufferStatus\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + GLenum rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_GLenum(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + GLenum rval = ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->CheckFramebufferStatus(context, target); + printf("RPC response: ["); + printf("%s", ToString_GLenum(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void Clear_1_0(PP_Resource context, GLbitfield mask) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Clear\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "mask", ToString_GLbitfield(mask)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->Clear(context, mask); +#endif // !INTERPOSE +} +static void ClearColor_1_0(PP_Resource context, GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"ClearColor\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "red", ToString_GLclampf(red)); + AddProp(ss, "green", ToString_GLclampf(green)); + AddProp(ss, "blue", ToString_GLclampf(blue)); + AddProp(ss, "alpha", ToString_GLclampf(alpha)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->ClearColor(context, red, green, blue, alpha); +#endif // !INTERPOSE +} +static void ClearDepthf_1_0(PP_Resource context, GLclampf depth) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"ClearDepthf\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "depth", ToString_GLclampf(depth)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->ClearDepthf(context, depth); +#endif // !INTERPOSE +} +static void ClearStencil_1_0(PP_Resource context, GLint s) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"ClearStencil\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "s", ToString_GLint(s)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->ClearStencil(context, s); +#endif // !INTERPOSE +} +static void ColorMask_1_0(PP_Resource context, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"ColorMask\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "red", ToString_GLboolean(red)); + AddProp(ss, "green", ToString_GLboolean(green)); + AddProp(ss, "blue", ToString_GLboolean(blue)); + AddProp(ss, "alpha", ToString_GLboolean(alpha)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->ColorMask(context, red, green, blue, alpha); +#endif // !INTERPOSE +} +static void CompileShader_1_0(PP_Resource context, GLuint shader) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"CompileShader\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "shader", ToString_GLuint(shader)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->CompileShader(context, shader); +#endif // !INTERPOSE +} +static void CompressedTexImage2D_1_0(PP_Resource context, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"CompressedTexImage2D\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + AddProp(ss, "level", ToString_GLint(level)); + AddProp(ss, "internalformat", ToString_GLenum(internalformat)); + AddProp(ss, "width", ToString_GLsizei(width)); + AddProp(ss, "height", ToString_GLsizei(height)); + AddProp(ss, "border", ToString_GLint(border)); + AddProp(ss, "imageSize", ToString_GLsizei(imageSize)); + AddProp(ss, "data", ToString_mem_t(data)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->CompressedTexImage2D(context, target, level, internalformat, width, height, border, imageSize, data); +#endif // !INTERPOSE +} +static void CompressedTexSubImage2D_1_0(PP_Resource context, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"CompressedTexSubImage2D\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + AddProp(ss, "level", ToString_GLint(level)); + AddProp(ss, "xoffset", ToString_GLint(xoffset)); + AddProp(ss, "yoffset", ToString_GLint(yoffset)); + AddProp(ss, "width", ToString_GLsizei(width)); + AddProp(ss, "height", ToString_GLsizei(height)); + AddProp(ss, "format", ToString_GLenum(format)); + AddProp(ss, "imageSize", ToString_GLsizei(imageSize)); + AddProp(ss, "data", ToString_mem_t(data)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->CompressedTexSubImage2D(context, target, level, xoffset, yoffset, width, height, format, imageSize, data); +#endif // !INTERPOSE +} +static void CopyTexImage2D_1_0(PP_Resource context, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"CopyTexImage2D\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + AddProp(ss, "level", ToString_GLint(level)); + AddProp(ss, "internalformat", ToString_GLenum(internalformat)); + AddProp(ss, "x", ToString_GLint(x)); + AddProp(ss, "y", ToString_GLint(y)); + AddProp(ss, "width", ToString_GLsizei(width)); + AddProp(ss, "height", ToString_GLsizei(height)); + AddProp(ss, "border", ToString_GLint(border)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->CopyTexImage2D(context, target, level, internalformat, x, y, width, height, border); +#endif // !INTERPOSE +} +static void CopyTexSubImage2D_1_0(PP_Resource context, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"CopyTexSubImage2D\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + AddProp(ss, "level", ToString_GLint(level)); + AddProp(ss, "xoffset", ToString_GLint(xoffset)); + AddProp(ss, "yoffset", ToString_GLint(yoffset)); + AddProp(ss, "x", ToString_GLint(x)); + AddProp(ss, "y", ToString_GLint(y)); + AddProp(ss, "width", ToString_GLsizei(width)); + AddProp(ss, "height", ToString_GLsizei(height)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->CopyTexSubImage2D(context, target, level, xoffset, yoffset, x, y, width, height); +#endif // !INTERPOSE +} +static GLuint CreateProgram_1_0(PP_Resource context) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"CreateProgram\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + GLuint rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_GLuint(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + GLuint rval = ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->CreateProgram(context); + printf("RPC response: ["); + printf("%s", ToString_GLuint(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static GLuint CreateShader_1_0(PP_Resource context, GLenum type) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"CreateShader\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "type", ToString_GLenum(type)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + GLuint rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_GLuint(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + GLuint rval = ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->CreateShader(context, type); + printf("RPC response: ["); + printf("%s", ToString_GLuint(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void CullFace_1_0(PP_Resource context, GLenum mode) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"CullFace\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "mode", ToString_GLenum(mode)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->CullFace(context, mode); +#endif // !INTERPOSE +} +static void DeleteBuffers_1_0(PP_Resource context, GLsizei n, const GLuint* buffers) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"DeleteBuffers\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "n", ToString_GLsizei(n)); + { + BeginProp(ss, "buffers"); + BeginElements(ss); + for (uint32_t _n = 0; _n < n; ++_n) { + AddElement(ss, ToString_GLuint(buffers[_n])); + } + EndElements(ss); + } + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->DeleteBuffers(context, n, buffers); +#endif // !INTERPOSE +} +static void DeleteFramebuffers_1_0(PP_Resource context, GLsizei n, const GLuint* framebuffers) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"DeleteFramebuffers\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "n", ToString_GLsizei(n)); + { + BeginProp(ss, "framebuffers"); + BeginElements(ss); + for (uint32_t _n = 0; _n < n; ++_n) { + AddElement(ss, ToString_GLuint(framebuffers[_n])); + } + EndElements(ss); + } + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->DeleteFramebuffers(context, n, framebuffers); +#endif // !INTERPOSE +} +static void DeleteProgram_1_0(PP_Resource context, GLuint program) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"DeleteProgram\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "program", ToString_GLuint(program)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->DeleteProgram(context, program); +#endif // !INTERPOSE +} +static void DeleteRenderbuffers_1_0(PP_Resource context, GLsizei n, const GLuint* renderbuffers) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"DeleteRenderbuffers\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "n", ToString_GLsizei(n)); + { + BeginProp(ss, "renderbuffers"); + BeginElements(ss); + for (uint32_t _n = 0; _n < n; ++_n) { + AddElement(ss, ToString_GLuint(renderbuffers[_n])); + } + EndElements(ss); + } + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->DeleteRenderbuffers(context, n, renderbuffers); +#endif // !INTERPOSE +} +static void DeleteShader_1_0(PP_Resource context, GLuint shader) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"DeleteShader\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "shader", ToString_GLuint(shader)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->DeleteShader(context, shader); +#endif // !INTERPOSE +} +static void DeleteTextures_1_0(PP_Resource context, GLsizei n, const GLuint* textures) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"DeleteTextures\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "n", ToString_GLsizei(n)); + { + BeginProp(ss, "textures"); + BeginElements(ss); + for (uint32_t _n = 0; _n < n; ++_n) { + AddElement(ss, ToString_GLuint(textures[_n])); + } + EndElements(ss); + } + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->DeleteTextures(context, n, textures); +#endif // !INTERPOSE +} +static void DepthFunc_1_0(PP_Resource context, GLenum func) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"DepthFunc\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "func", ToString_GLenum(func)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->DepthFunc(context, func); +#endif // !INTERPOSE +} +static void DepthMask_1_0(PP_Resource context, GLboolean flag) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"DepthMask\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "flag", ToString_GLboolean(flag)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->DepthMask(context, flag); +#endif // !INTERPOSE +} +static void DepthRangef_1_0(PP_Resource context, GLclampf zNear, GLclampf zFar) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"DepthRangef\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "zNear", ToString_GLclampf(zNear)); + AddProp(ss, "zFar", ToString_GLclampf(zFar)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->DepthRangef(context, zNear, zFar); +#endif // !INTERPOSE +} +static void DetachShader_1_0(PP_Resource context, GLuint program, GLuint shader) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"DetachShader\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "program", ToString_GLuint(program)); + AddProp(ss, "shader", ToString_GLuint(shader)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->DetachShader(context, program, shader); +#endif // !INTERPOSE +} +static void Disable_1_0(PP_Resource context, GLenum cap) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Disable\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "cap", ToString_GLenum(cap)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->Disable(context, cap); +#endif // !INTERPOSE +} +static void DisableVertexAttribArray_1_0(PP_Resource context, GLuint index) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"DisableVertexAttribArray\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "index", ToString_GLuint(index)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->DisableVertexAttribArray(context, index); +#endif // !INTERPOSE +} +static void DrawArrays_1_0(PP_Resource context, GLenum mode, GLint first, GLsizei count) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"DrawArrays\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "mode", ToString_GLenum(mode)); + AddProp(ss, "first", ToString_GLint(first)); + AddProp(ss, "count", ToString_GLsizei(count)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->DrawArrays(context, mode, first, count); +#endif // !INTERPOSE +} +static void DrawElements_1_0(PP_Resource context, GLenum mode, GLsizei count, GLenum type, const void* indices) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"DrawElements\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "mode", ToString_GLenum(mode)); + AddProp(ss, "count", ToString_GLsizei(count)); + AddProp(ss, "type", ToString_GLenum(type)); + AddProp(ss, "indices", ToString_mem_t(indices)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->DrawElements(context, mode, count, type, indices); +#endif // !INTERPOSE +} +static void Enable_1_0(PP_Resource context, GLenum cap) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Enable\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "cap", ToString_GLenum(cap)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->Enable(context, cap); +#endif // !INTERPOSE +} +static void EnableVertexAttribArray_1_0(PP_Resource context, GLuint index) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"EnableVertexAttribArray\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "index", ToString_GLuint(index)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->EnableVertexAttribArray(context, index); +#endif // !INTERPOSE +} +static void Finish_1_0(PP_Resource context) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Finish\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->Finish(context); +#endif // !INTERPOSE +} +static void Flush_1_0(PP_Resource context) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Flush\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->Flush(context); +#endif // !INTERPOSE +} +static void FramebufferRenderbuffer_1_0(PP_Resource context, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"FramebufferRenderbuffer\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + AddProp(ss, "attachment", ToString_GLenum(attachment)); + AddProp(ss, "renderbuffertarget", ToString_GLenum(renderbuffertarget)); + AddProp(ss, "renderbuffer", ToString_GLuint(renderbuffer)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->FramebufferRenderbuffer(context, target, attachment, renderbuffertarget, renderbuffer); +#endif // !INTERPOSE +} +static void FramebufferTexture2D_1_0(PP_Resource context, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"FramebufferTexture2D\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + AddProp(ss, "attachment", ToString_GLenum(attachment)); + AddProp(ss, "textarget", ToString_GLenum(textarget)); + AddProp(ss, "texture", ToString_GLuint(texture)); + AddProp(ss, "level", ToString_GLint(level)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->FramebufferTexture2D(context, target, attachment, textarget, texture, level); +#endif // !INTERPOSE +} +static void FrontFace_1_0(PP_Resource context, GLenum mode) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"FrontFace\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "mode", ToString_GLenum(mode)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->FrontFace(context, mode); +#endif // !INTERPOSE +} +static void GenBuffers_1_0(PP_Resource context, GLsizei n, GLuint* buffers) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GenBuffers\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "n", ToString_GLsizei(n)); + AddProp(ss, "buffers", PointerToString(buffers)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > n) { + Fail("Too many items in array\n", ""); + } + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_GLuint(iterator, (buffers)[_n]); + } + // FIXME Null out remaining items? + } +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GenBuffers(context, n, buffers); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + { + BeginProp(os, "buffers"); + BeginElements(os); + for (uint32_t _n = 0; _n < n; ++_n) { + AddElement(os, ToString_GLuint(buffers[_n])); + } + EndElements(os); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void GenerateMipmap_1_0(PP_Resource context, GLenum target) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GenerateMipmap\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GenerateMipmap(context, target); +#endif // !INTERPOSE +} +static void GenFramebuffers_1_0(PP_Resource context, GLsizei n, GLuint* framebuffers) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GenFramebuffers\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "n", ToString_GLsizei(n)); + AddProp(ss, "framebuffers", PointerToString(framebuffers)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_GLuint_ptr_t(iterator, framebuffers); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GenFramebuffers(context, n, framebuffers); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "framebuffers", ToString_GLuint_ptr_t(framebuffers)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void GenRenderbuffers_1_0(PP_Resource context, GLsizei n, GLuint* renderbuffers) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GenRenderbuffers\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "n", ToString_GLsizei(n)); + AddProp(ss, "renderbuffers", PointerToString(renderbuffers)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_GLuint_ptr_t(iterator, renderbuffers); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GenRenderbuffers(context, n, renderbuffers); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "renderbuffers", ToString_GLuint_ptr_t(renderbuffers)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void GenTextures_1_0(PP_Resource context, GLsizei n, GLuint* textures) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GenTextures\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "n", ToString_GLsizei(n)); + AddProp(ss, "textures", PointerToString(textures)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > n) { + Fail("Too many items in array\n", ""); + } + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_GLuint(iterator, (textures)[_n]); + } + // FIXME Null out remaining items? + } +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GenTextures(context, n, textures); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + { + BeginProp(os, "textures"); + BeginElements(os); + for (uint32_t _n = 0; _n < n; ++_n) { + AddElement(os, ToString_GLuint(textures[_n])); + } + EndElements(os); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void GetActiveAttrib_1_0(PP_Resource context, GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetActiveAttrib\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "program", ToString_GLuint(program)); + AddProp(ss, "index", ToString_GLuint(index)); + AddProp(ss, "bufsize", ToString_GLsizei(bufsize)); + AddProp(ss, "length", PointerToString(length)); + AddProp(ss, "size", PointerToString(size)); + AddProp(ss, "type", PointerToString(type)); + AddProp(ss, "name", PointerToString(name)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_GLsizei_ptr_t(iterator, length); + iterator.skip(); + FromJSON_GLint_ptr_t(iterator, size); + iterator.skip(); + FromJSON_GLenum_ptr_t(iterator, type); + iterator.skip(); + FromJSON_str_t(iterator, name); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GetActiveAttrib(context, program, index, bufsize, length, size, type, name); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "length", ToString_GLsizei_ptr_t(length)); + AddProp(os, "size", ToString_GLint_ptr_t(size)); + AddProp(os, "type", ToString_GLenum_ptr_t(type)); + AddProp(os, "name", ToString_str_t(name)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void GetActiveUniform_1_0(PP_Resource context, GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetActiveUniform\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "program", ToString_GLuint(program)); + AddProp(ss, "index", ToString_GLuint(index)); + AddProp(ss, "bufsize", ToString_GLsizei(bufsize)); + AddProp(ss, "length", PointerToString(length)); + AddProp(ss, "size", PointerToString(size)); + AddProp(ss, "type", PointerToString(type)); + AddProp(ss, "name", PointerToString(name)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_GLsizei_ptr_t(iterator, length); + iterator.skip(); + FromJSON_GLint_ptr_t(iterator, size); + iterator.skip(); + FromJSON_GLenum_ptr_t(iterator, type); + iterator.skip(); + FromJSON_str_t(iterator, name); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GetActiveUniform(context, program, index, bufsize, length, size, type, name); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "length", ToString_GLsizei_ptr_t(length)); + AddProp(os, "size", ToString_GLint_ptr_t(size)); + AddProp(os, "type", ToString_GLenum_ptr_t(type)); + AddProp(os, "name", ToString_str_t(name)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void GetAttachedShaders_1_0(PP_Resource context, GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetAttachedShaders\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "program", ToString_GLuint(program)); + AddProp(ss, "maxcount", ToString_GLsizei(maxcount)); + AddProp(ss, "count", PointerToString(count)); + AddProp(ss, "shaders", PointerToString(shaders)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_GLsizei_ptr_t(iterator, count); + iterator.skip(); + FromJSON_GLuint_ptr_t(iterator, shaders); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GetAttachedShaders(context, program, maxcount, count, shaders); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "count", ToString_GLsizei_ptr_t(count)); + AddProp(os, "shaders", ToString_GLuint_ptr_t(shaders)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static GLint GetAttribLocation_1_0(PP_Resource context, GLuint program, const char* name) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetAttribLocation\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "program", ToString_GLuint(program)); + AddProp(ss, "name", ToString_cstr_t(name)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + GLint rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_GLint(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + GLint rval = ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GetAttribLocation(context, program, name); + printf("RPC response: ["); + printf("%s", ToString_GLint(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void GetBooleanv_1_0(PP_Resource context, GLenum pname, GLboolean* params) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetBooleanv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "pname", ToString_GLenum(pname)); + AddProp(ss, "params", PointerToString(params)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_GLboolean_ptr_t(iterator, params); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GetBooleanv(context, pname, params); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "params", ToString_GLboolean_ptr_t(params)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void GetBufferParameteriv_1_0(PP_Resource context, GLenum target, GLenum pname, GLint* params) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetBufferParameteriv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + AddProp(ss, "pname", ToString_GLenum(pname)); + AddProp(ss, "params", PointerToString(params)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_GLint_ptr_t(iterator, params); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GetBufferParameteriv(context, target, pname, params); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "params", ToString_GLint_ptr_t(params)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static GLenum GetError_1_0(PP_Resource context) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetError\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + GLenum rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_GLenum(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + GLenum rval = ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GetError(context); + printf("RPC response: ["); + printf("%s", ToString_GLenum(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void GetFloatv_1_0(PP_Resource context, GLenum pname, GLfloat* params) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetFloatv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "pname", ToString_GLenum(pname)); + AddProp(ss, "params", PointerToString(params)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_GLfloat_ptr_t(iterator, params); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GetFloatv(context, pname, params); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "params", ToString_GLfloat_ptr_t(params)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void GetFramebufferAttachmentParameteriv_1_0(PP_Resource context, GLenum target, GLenum attachment, GLenum pname, GLint* params) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetFramebufferAttachmentParameteriv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + AddProp(ss, "attachment", ToString_GLenum(attachment)); + AddProp(ss, "pname", ToString_GLenum(pname)); + AddProp(ss, "params", PointerToString(params)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_GLint_ptr_t(iterator, params); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GetFramebufferAttachmentParameteriv(context, target, attachment, pname, params); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "params", ToString_GLint_ptr_t(params)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void GetIntegerv_1_0(PP_Resource context, GLenum pname, GLint* params) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetIntegerv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "pname", ToString_GLenum(pname)); + AddProp(ss, "params", PointerToString(params)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_GLint_ptr_t(iterator, params); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GetIntegerv(context, pname, params); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "params", ToString_GLint_ptr_t(params)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void GetProgramiv_1_0(PP_Resource context, GLuint program, GLenum pname, GLint* params) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetProgramiv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "program", ToString_GLuint(program)); + AddProp(ss, "pname", ToString_GLenum(pname)); + AddProp(ss, "params", PointerToString(params)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_GLint_ptr_t(iterator, params); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GetProgramiv(context, program, pname, params); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "params", ToString_GLint_ptr_t(params)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void GetProgramInfoLog_1_0(PP_Resource context, GLuint program, GLsizei bufsize, GLsizei* length, char* infolog) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetProgramInfoLog\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "program", ToString_GLuint(program)); + AddProp(ss, "bufsize", ToString_GLsizei(bufsize)); + AddProp(ss, "length", PointerToString(length)); + AddProp(ss, "infolog", PointerToString(infolog)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_GLsizei_ptr_t(iterator, length); + iterator.skip(); + FromJSON_str_t(iterator, infolog); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GetProgramInfoLog(context, program, bufsize, length, infolog); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "length", ToString_GLsizei_ptr_t(length)); + AddProp(os, "infolog", ToString_str_t(infolog)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void GetRenderbufferParameteriv_1_0(PP_Resource context, GLenum target, GLenum pname, GLint* params) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetRenderbufferParameteriv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + AddProp(ss, "pname", ToString_GLenum(pname)); + AddProp(ss, "params", PointerToString(params)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_GLint_ptr_t(iterator, params); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GetRenderbufferParameteriv(context, target, pname, params); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "params", ToString_GLint_ptr_t(params)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void GetShaderiv_1_0(PP_Resource context, GLuint shader, GLenum pname, GLint* params) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetShaderiv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "shader", ToString_GLuint(shader)); + AddProp(ss, "pname", ToString_GLenum(pname)); + AddProp(ss, "params", PointerToString(params)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_GLint_ptr_t(iterator, params); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GetShaderiv(context, shader, pname, params); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "params", ToString_GLint_ptr_t(params)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void GetShaderInfoLog_1_0(PP_Resource context, GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetShaderInfoLog\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "shader", ToString_GLuint(shader)); + AddProp(ss, "bufsize", ToString_GLsizei(bufsize)); + AddProp(ss, "length", PointerToString(length)); + AddProp(ss, "infolog", PointerToString(infolog)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_GLsizei_ptr_t(iterator, length); + iterator.skip(); + FromJSON_str_t(iterator, infolog); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GetShaderInfoLog(context, shader, bufsize, length, infolog); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "length", ToString_GLsizei_ptr_t(length)); + AddProp(os, "infolog", ToString_str_t(infolog)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void GetShaderPrecisionFormat_1_0(PP_Resource context, GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetShaderPrecisionFormat\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "shadertype", ToString_GLenum(shadertype)); + AddProp(ss, "precisiontype", ToString_GLenum(precisiontype)); + AddProp(ss, "range", PointerToString(range)); + AddProp(ss, "precision", PointerToString(precision)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_GLint_ptr_t(iterator, range); + iterator.skip(); + FromJSON_GLint_ptr_t(iterator, precision); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GetShaderPrecisionFormat(context, shadertype, precisiontype, range, precision); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "range", ToString_GLint_ptr_t(range)); + AddProp(os, "precision", ToString_GLint_ptr_t(precision)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void GetShaderSource_1_0(PP_Resource context, GLuint shader, GLsizei bufsize, GLsizei* length, char* source) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetShaderSource\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "shader", ToString_GLuint(shader)); + AddProp(ss, "bufsize", ToString_GLsizei(bufsize)); + AddProp(ss, "length", PointerToString(length)); + AddProp(ss, "source", PointerToString(source)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_GLsizei_ptr_t(iterator, length); + iterator.skip(); + FromJSON_str_t(iterator, source); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GetShaderSource(context, shader, bufsize, length, source); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "length", ToString_GLsizei_ptr_t(length)); + AddProp(os, "source", ToString_str_t(source)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static const GLubyte* GetString_1_0(PP_Resource context, GLenum name) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetString\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "name", ToString_GLenum(name)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + GLubyte* rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_GLubyte_ptr_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + const GLubyte* rval = ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GetString(context, name); + printf("RPC response: ["); + printf("%s", ToString_GLubyte_ptr_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void GetTexParameterfv_1_0(PP_Resource context, GLenum target, GLenum pname, GLfloat* params) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetTexParameterfv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + AddProp(ss, "pname", ToString_GLenum(pname)); + AddProp(ss, "params", PointerToString(params)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_GLfloat_ptr_t(iterator, params); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GetTexParameterfv(context, target, pname, params); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "params", ToString_GLfloat_ptr_t(params)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void GetTexParameteriv_1_0(PP_Resource context, GLenum target, GLenum pname, GLint* params) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetTexParameteriv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + AddProp(ss, "pname", ToString_GLenum(pname)); + AddProp(ss, "params", PointerToString(params)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_GLint_ptr_t(iterator, params); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GetTexParameteriv(context, target, pname, params); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "params", ToString_GLint_ptr_t(params)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void GetUniformfv_1_0(PP_Resource context, GLuint program, GLint location, GLfloat* params) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetUniformfv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "program", ToString_GLuint(program)); + AddProp(ss, "location", ToString_GLint(location)); + AddProp(ss, "params", PointerToString(params)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_GLfloat_ptr_t(iterator, params); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GetUniformfv(context, program, location, params); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "params", ToString_GLfloat_ptr_t(params)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void GetUniformiv_1_0(PP_Resource context, GLuint program, GLint location, GLint* params) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetUniformiv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "program", ToString_GLuint(program)); + AddProp(ss, "location", ToString_GLint(location)); + AddProp(ss, "params", PointerToString(params)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_GLint_ptr_t(iterator, params); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GetUniformiv(context, program, location, params); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "params", ToString_GLint_ptr_t(params)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static GLint GetUniformLocation_1_0(PP_Resource context, GLuint program, const char* name) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetUniformLocation\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "program", ToString_GLuint(program)); + AddProp(ss, "name", ToString_cstr_t(name)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + GLint rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_GLint(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + GLint rval = ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GetUniformLocation(context, program, name); + printf("RPC response: ["); + printf("%s", ToString_GLint(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void GetVertexAttribfv_1_0(PP_Resource context, GLuint index, GLenum pname, GLfloat* params) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetVertexAttribfv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "index", ToString_GLuint(index)); + AddProp(ss, "pname", ToString_GLenum(pname)); + AddProp(ss, "params", PointerToString(params)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_GLfloat_ptr_t(iterator, params); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GetVertexAttribfv(context, index, pname, params); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "params", ToString_GLfloat_ptr_t(params)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void GetVertexAttribiv_1_0(PP_Resource context, GLuint index, GLenum pname, GLint* params) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetVertexAttribiv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "index", ToString_GLuint(index)); + AddProp(ss, "pname", ToString_GLenum(pname)); + AddProp(ss, "params", PointerToString(params)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_GLint_ptr_t(iterator, params); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GetVertexAttribiv(context, index, pname, params); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "params", ToString_GLint_ptr_t(params)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void GetVertexAttribPointerv_1_0(PP_Resource context, GLuint index, GLenum pname, void** pointer) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetVertexAttribPointerv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "index", ToString_GLuint(index)); + AddProp(ss, "pname", ToString_GLenum(pname)); + AddProp(ss, "pointer", PointerToString(pointer)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_mem_ptr_t(iterator, pointer); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->GetVertexAttribPointerv(context, index, pname, pointer); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "pointer", ToString_mem_ptr_t(pointer)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void Hint_1_0(PP_Resource context, GLenum target, GLenum mode) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Hint\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + AddProp(ss, "mode", ToString_GLenum(mode)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->Hint(context, target, mode); +#endif // !INTERPOSE +} +static GLboolean IsBuffer_1_0(PP_Resource context, GLuint buffer) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsBuffer\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "buffer", ToString_GLuint(buffer)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + GLboolean rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_GLboolean(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + GLboolean rval = ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->IsBuffer(context, buffer); + printf("RPC response: ["); + printf("%s", ToString_GLboolean(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static GLboolean IsEnabled_1_0(PP_Resource context, GLenum cap) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsEnabled\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "cap", ToString_GLenum(cap)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + GLboolean rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_GLboolean(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + GLboolean rval = ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->IsEnabled(context, cap); + printf("RPC response: ["); + printf("%s", ToString_GLboolean(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static GLboolean IsFramebuffer_1_0(PP_Resource context, GLuint framebuffer) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsFramebuffer\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "framebuffer", ToString_GLuint(framebuffer)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + GLboolean rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_GLboolean(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + GLboolean rval = ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->IsFramebuffer(context, framebuffer); + printf("RPC response: ["); + printf("%s", ToString_GLboolean(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static GLboolean IsProgram_1_0(PP_Resource context, GLuint program) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsProgram\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "program", ToString_GLuint(program)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + GLboolean rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_GLboolean(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + GLboolean rval = ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->IsProgram(context, program); + printf("RPC response: ["); + printf("%s", ToString_GLboolean(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static GLboolean IsRenderbuffer_1_0(PP_Resource context, GLuint renderbuffer) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsRenderbuffer\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "renderbuffer", ToString_GLuint(renderbuffer)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + GLboolean rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_GLboolean(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + GLboolean rval = ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->IsRenderbuffer(context, renderbuffer); + printf("RPC response: ["); + printf("%s", ToString_GLboolean(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static GLboolean IsShader_1_0(PP_Resource context, GLuint shader) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsShader\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "shader", ToString_GLuint(shader)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + GLboolean rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_GLboolean(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + GLboolean rval = ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->IsShader(context, shader); + printf("RPC response: ["); + printf("%s", ToString_GLboolean(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static GLboolean IsTexture_1_0(PP_Resource context, GLuint texture) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsTexture\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "texture", ToString_GLuint(texture)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + GLboolean rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_GLboolean(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + GLboolean rval = ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->IsTexture(context, texture); + printf("RPC response: ["); + printf("%s", ToString_GLboolean(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void LineWidth_1_0(PP_Resource context, GLfloat width) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"LineWidth\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "width", ToString_GLfloat(width)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->LineWidth(context, width); +#endif // !INTERPOSE +} +static void LinkProgram_1_0(PP_Resource context, GLuint program) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"LinkProgram\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "program", ToString_GLuint(program)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->LinkProgram(context, program); +#endif // !INTERPOSE +} +static void PixelStorei_1_0(PP_Resource context, GLenum pname, GLint param) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"PixelStorei\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "pname", ToString_GLenum(pname)); + AddProp(ss, "param", ToString_GLint(param)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->PixelStorei(context, pname, param); +#endif // !INTERPOSE +} +static void PolygonOffset_1_0(PP_Resource context, GLfloat factor, GLfloat units) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"PolygonOffset\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "factor", ToString_GLfloat(factor)); + AddProp(ss, "units", ToString_GLfloat(units)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->PolygonOffset(context, factor, units); +#endif // !INTERPOSE +} +static void ReadPixels_1_0(PP_Resource context, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"ReadPixels\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "x", ToString_GLint(x)); + AddProp(ss, "y", ToString_GLint(y)); + AddProp(ss, "width", ToString_GLsizei(width)); + AddProp(ss, "height", ToString_GLsizei(height)); + AddProp(ss, "format", ToString_GLenum(format)); + AddProp(ss, "type", ToString_GLenum(type)); + AddProp(ss, "pixels", PointerToString(pixels)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_mem_t(iterator, pixels); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->ReadPixels(context, x, y, width, height, format, type, pixels); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "pixels", ToString_mem_t(pixels)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void ReleaseShaderCompiler_1_0(PP_Resource context) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"ReleaseShaderCompiler\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->ReleaseShaderCompiler(context); +#endif // !INTERPOSE +} +static void RenderbufferStorage_1_0(PP_Resource context, GLenum target, GLenum internalformat, GLsizei width, GLsizei height) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"RenderbufferStorage\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + AddProp(ss, "internalformat", ToString_GLenum(internalformat)); + AddProp(ss, "width", ToString_GLsizei(width)); + AddProp(ss, "height", ToString_GLsizei(height)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->RenderbufferStorage(context, target, internalformat, width, height); +#endif // !INTERPOSE +} +static void SampleCoverage_1_0(PP_Resource context, GLclampf value, GLboolean invert) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"SampleCoverage\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "value", ToString_GLclampf(value)); + AddProp(ss, "invert", ToString_GLboolean(invert)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->SampleCoverage(context, value, invert); +#endif // !INTERPOSE +} +static void Scissor_1_0(PP_Resource context, GLint x, GLint y, GLsizei width, GLsizei height) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Scissor\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "x", ToString_GLint(x)); + AddProp(ss, "y", ToString_GLint(y)); + AddProp(ss, "width", ToString_GLsizei(width)); + AddProp(ss, "height", ToString_GLsizei(height)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->Scissor(context, x, y, width, height); +#endif // !INTERPOSE +} +static void ShaderBinary_1_0(PP_Resource context, GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"ShaderBinary\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "n", ToString_GLsizei(n)); + AddProp(ss, "shaders", ToString_GLuint_ptr_t(shaders)); + AddProp(ss, "binaryformat", ToString_GLenum(binaryformat)); + AddProp(ss, "binary", ToString_mem_t(binary)); + AddProp(ss, "length", ToString_GLsizei(length)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->ShaderBinary(context, n, shaders, binaryformat, binary, length); +#endif // !INTERPOSE +} +static void ShaderSource_1_0(PP_Resource context, GLuint shader, GLsizei count, const char** str, const GLint* length) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"ShaderSource\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "shader", ToString_GLuint(shader)); + AddProp(ss, "count", ToString_GLsizei(count)); + { + BeginProp(ss, "str"); + BeginElements(ss); + for (uint32_t _n = 0; _n < count; ++_n) { + AddElement(ss, ToString_str_t(str[_n])); + } + EndElements(ss); + } + AddProp(ss, "length", ToString_GLint_ptr_t(length)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->ShaderSource(context, shader, count, str, length); +#endif // !INTERPOSE +} +static void StencilFunc_1_0(PP_Resource context, GLenum func, GLint ref, GLuint mask) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"StencilFunc\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "func", ToString_GLenum(func)); + AddProp(ss, "ref", ToString_GLint(ref)); + AddProp(ss, "mask", ToString_GLuint(mask)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->StencilFunc(context, func, ref, mask); +#endif // !INTERPOSE +} +static void StencilFuncSeparate_1_0(PP_Resource context, GLenum face, GLenum func, GLint ref, GLuint mask) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"StencilFuncSeparate\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "face", ToString_GLenum(face)); + AddProp(ss, "func", ToString_GLenum(func)); + AddProp(ss, "ref", ToString_GLint(ref)); + AddProp(ss, "mask", ToString_GLuint(mask)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->StencilFuncSeparate(context, face, func, ref, mask); +#endif // !INTERPOSE +} +static void StencilMask_1_0(PP_Resource context, GLuint mask) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"StencilMask\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "mask", ToString_GLuint(mask)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->StencilMask(context, mask); +#endif // !INTERPOSE +} +static void StencilMaskSeparate_1_0(PP_Resource context, GLenum face, GLuint mask) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"StencilMaskSeparate\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "face", ToString_GLenum(face)); + AddProp(ss, "mask", ToString_GLuint(mask)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->StencilMaskSeparate(context, face, mask); +#endif // !INTERPOSE +} +static void StencilOp_1_0(PP_Resource context, GLenum fail, GLenum zfail, GLenum zpass) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"StencilOp\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "fail", ToString_GLenum(fail)); + AddProp(ss, "zfail", ToString_GLenum(zfail)); + AddProp(ss, "zpass", ToString_GLenum(zpass)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->StencilOp(context, fail, zfail, zpass); +#endif // !INTERPOSE +} +static void StencilOpSeparate_1_0(PP_Resource context, GLenum face, GLenum fail, GLenum zfail, GLenum zpass) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"StencilOpSeparate\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "face", ToString_GLenum(face)); + AddProp(ss, "fail", ToString_GLenum(fail)); + AddProp(ss, "zfail", ToString_GLenum(zfail)); + AddProp(ss, "zpass", ToString_GLenum(zpass)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->StencilOpSeparate(context, face, fail, zfail, zpass); +#endif // !INTERPOSE +} +static void TexImage2D_1_0(PP_Resource context, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"TexImage2D\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + AddProp(ss, "level", ToString_GLint(level)); + AddProp(ss, "internalformat", ToString_GLint(internalformat)); + AddProp(ss, "width", ToString_GLsizei(width)); + AddProp(ss, "height", ToString_GLsizei(height)); + AddProp(ss, "border", ToString_GLint(border)); + AddProp(ss, "format", ToString_GLenum(format)); + AddProp(ss, "type", ToString_GLenum(type)); + AddProp(ss, "pixels", ToString_mem_t(pixels)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->TexImage2D(context, target, level, internalformat, width, height, border, format, type, pixels); +#endif // !INTERPOSE +} +static void TexParameterf_1_0(PP_Resource context, GLenum target, GLenum pname, GLfloat param) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"TexParameterf\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + AddProp(ss, "pname", ToString_GLenum(pname)); + AddProp(ss, "param", ToString_GLfloat(param)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->TexParameterf(context, target, pname, param); +#endif // !INTERPOSE +} +static void TexParameterfv_1_0(PP_Resource context, GLenum target, GLenum pname, const GLfloat* params) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"TexParameterfv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + AddProp(ss, "pname", ToString_GLenum(pname)); + AddProp(ss, "params", ToString_GLfloat_ptr_t(params)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->TexParameterfv(context, target, pname, params); +#endif // !INTERPOSE +} +static void TexParameteri_1_0(PP_Resource context, GLenum target, GLenum pname, GLint param) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"TexParameteri\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + AddProp(ss, "pname", ToString_GLenum(pname)); + AddProp(ss, "param", ToString_GLint(param)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->TexParameteri(context, target, pname, param); +#endif // !INTERPOSE +} +static void TexParameteriv_1_0(PP_Resource context, GLenum target, GLenum pname, const GLint* params) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"TexParameteriv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + AddProp(ss, "pname", ToString_GLenum(pname)); + AddProp(ss, "params", ToString_GLint_ptr_t(params)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->TexParameteriv(context, target, pname, params); +#endif // !INTERPOSE +} +static void TexSubImage2D_1_0(PP_Resource context, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"TexSubImage2D\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + AddProp(ss, "level", ToString_GLint(level)); + AddProp(ss, "xoffset", ToString_GLint(xoffset)); + AddProp(ss, "yoffset", ToString_GLint(yoffset)); + AddProp(ss, "width", ToString_GLsizei(width)); + AddProp(ss, "height", ToString_GLsizei(height)); + AddProp(ss, "format", ToString_GLenum(format)); + AddProp(ss, "type", ToString_GLenum(type)); + AddProp(ss, "pixels", ToString_mem_t(pixels)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->TexSubImage2D(context, target, level, xoffset, yoffset, width, height, format, type, pixels); +#endif // !INTERPOSE +} +static void Uniform1f_1_0(PP_Resource context, GLint location, GLfloat x) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Uniform1f\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "location", ToString_GLint(location)); + AddProp(ss, "x", ToString_GLfloat(x)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->Uniform1f(context, location, x); +#endif // !INTERPOSE +} +static void Uniform1fv_1_0(PP_Resource context, GLint location, GLsizei count, const GLfloat* v) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Uniform1fv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "location", ToString_GLint(location)); + AddProp(ss, "count", ToString_GLsizei(count)); + AddProp(ss, "v", ToString_GLfloat_ptr_t(v)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->Uniform1fv(context, location, count, v); +#endif // !INTERPOSE +} +static void Uniform1i_1_0(PP_Resource context, GLint location, GLint x) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Uniform1i\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "location", ToString_GLint(location)); + AddProp(ss, "x", ToString_GLint(x)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->Uniform1i(context, location, x); +#endif // !INTERPOSE +} +static void Uniform1iv_1_0(PP_Resource context, GLint location, GLsizei count, const GLint* v) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Uniform1iv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "location", ToString_GLint(location)); + AddProp(ss, "count", ToString_GLsizei(count)); + AddProp(ss, "v", ToString_GLint_ptr_t(v)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->Uniform1iv(context, location, count, v); +#endif // !INTERPOSE +} +static void Uniform2f_1_0(PP_Resource context, GLint location, GLfloat x, GLfloat y) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Uniform2f\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "location", ToString_GLint(location)); + AddProp(ss, "x", ToString_GLfloat(x)); + AddProp(ss, "y", ToString_GLfloat(y)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->Uniform2f(context, location, x, y); +#endif // !INTERPOSE +} +static void Uniform2fv_1_0(PP_Resource context, GLint location, GLsizei count, const GLfloat* v) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Uniform2fv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "location", ToString_GLint(location)); + AddProp(ss, "count", ToString_GLsizei(count)); + AddProp(ss, "v", ToString_GLfloat_ptr_t(v)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->Uniform2fv(context, location, count, v); +#endif // !INTERPOSE +} +static void Uniform2i_1_0(PP_Resource context, GLint location, GLint x, GLint y) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Uniform2i\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "location", ToString_GLint(location)); + AddProp(ss, "x", ToString_GLint(x)); + AddProp(ss, "y", ToString_GLint(y)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->Uniform2i(context, location, x, y); +#endif // !INTERPOSE +} +static void Uniform2iv_1_0(PP_Resource context, GLint location, GLsizei count, const GLint* v) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Uniform2iv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "location", ToString_GLint(location)); + AddProp(ss, "count", ToString_GLsizei(count)); + AddProp(ss, "v", ToString_GLint_ptr_t(v)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->Uniform2iv(context, location, count, v); +#endif // !INTERPOSE +} +static void Uniform3f_1_0(PP_Resource context, GLint location, GLfloat x, GLfloat y, GLfloat z) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Uniform3f\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "location", ToString_GLint(location)); + AddProp(ss, "x", ToString_GLfloat(x)); + AddProp(ss, "y", ToString_GLfloat(y)); + AddProp(ss, "z", ToString_GLfloat(z)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->Uniform3f(context, location, x, y, z); +#endif // !INTERPOSE +} +static void Uniform3fv_1_0(PP_Resource context, GLint location, GLsizei count, const GLfloat* v) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Uniform3fv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "location", ToString_GLint(location)); + AddProp(ss, "count", ToString_GLsizei(count)); + AddProp(ss, "v", ToString_GLfloat_ptr_t(v)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->Uniform3fv(context, location, count, v); +#endif // !INTERPOSE +} +static void Uniform3i_1_0(PP_Resource context, GLint location, GLint x, GLint y, GLint z) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Uniform3i\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "location", ToString_GLint(location)); + AddProp(ss, "x", ToString_GLint(x)); + AddProp(ss, "y", ToString_GLint(y)); + AddProp(ss, "z", ToString_GLint(z)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->Uniform3i(context, location, x, y, z); +#endif // !INTERPOSE +} +static void Uniform3iv_1_0(PP_Resource context, GLint location, GLsizei count, const GLint* v) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Uniform3iv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "location", ToString_GLint(location)); + AddProp(ss, "count", ToString_GLsizei(count)); + AddProp(ss, "v", ToString_GLint_ptr_t(v)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->Uniform3iv(context, location, count, v); +#endif // !INTERPOSE +} +static void Uniform4f_1_0(PP_Resource context, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Uniform4f\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "location", ToString_GLint(location)); + AddProp(ss, "x", ToString_GLfloat(x)); + AddProp(ss, "y", ToString_GLfloat(y)); + AddProp(ss, "z", ToString_GLfloat(z)); + AddProp(ss, "w", ToString_GLfloat(w)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->Uniform4f(context, location, x, y, z, w); +#endif // !INTERPOSE +} +static void Uniform4fv_1_0(PP_Resource context, GLint location, GLsizei count, const GLfloat* v) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Uniform4fv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "location", ToString_GLint(location)); + AddProp(ss, "count", ToString_GLsizei(count)); + AddProp(ss, "v", ToString_GLfloat_ptr_t(v)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->Uniform4fv(context, location, count, v); +#endif // !INTERPOSE +} +static void Uniform4i_1_0(PP_Resource context, GLint location, GLint x, GLint y, GLint z, GLint w) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Uniform4i\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "location", ToString_GLint(location)); + AddProp(ss, "x", ToString_GLint(x)); + AddProp(ss, "y", ToString_GLint(y)); + AddProp(ss, "z", ToString_GLint(z)); + AddProp(ss, "w", ToString_GLint(w)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->Uniform4i(context, location, x, y, z, w); +#endif // !INTERPOSE +} +static void Uniform4iv_1_0(PP_Resource context, GLint location, GLsizei count, const GLint* v) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Uniform4iv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "location", ToString_GLint(location)); + AddProp(ss, "count", ToString_GLsizei(count)); + AddProp(ss, "v", ToString_GLint_ptr_t(v)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->Uniform4iv(context, location, count, v); +#endif // !INTERPOSE +} +static void UniformMatrix2fv_1_0(PP_Resource context, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"UniformMatrix2fv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "location", ToString_GLint(location)); + AddProp(ss, "count", ToString_GLsizei(count)); + AddProp(ss, "transpose", ToString_GLboolean(transpose)); + AddProp(ss, "value", ToString_GLfloat_ptr_t(value)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->UniformMatrix2fv(context, location, count, transpose, value); +#endif // !INTERPOSE +} +static void UniformMatrix3fv_1_0(PP_Resource context, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"UniformMatrix3fv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "location", ToString_GLint(location)); + AddProp(ss, "count", ToString_GLsizei(count)); + AddProp(ss, "transpose", ToString_GLboolean(transpose)); + { + BeginProp(ss, "value"); + BeginElements(ss); + for (uint32_t _n = 0; _n < count * 9; ++_n) { + AddElement(ss, ToString_GLfloat(value[_n])); + } + EndElements(ss); + } + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->UniformMatrix3fv(context, location, count, transpose, value); +#endif // !INTERPOSE +} +static void UniformMatrix4fv_1_0(PP_Resource context, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"UniformMatrix4fv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "location", ToString_GLint(location)); + AddProp(ss, "count", ToString_GLsizei(count)); + AddProp(ss, "transpose", ToString_GLboolean(transpose)); + AddProp(ss, "value", ToString_GLfloat_ptr_t(value)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->UniformMatrix4fv(context, location, count, transpose, value); +#endif // !INTERPOSE +} +static void UseProgram_1_0(PP_Resource context, GLuint program) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"UseProgram\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "program", ToString_GLuint(program)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->UseProgram(context, program); +#endif // !INTERPOSE +} +static void ValidateProgram_1_0(PP_Resource context, GLuint program) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"ValidateProgram\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "program", ToString_GLuint(program)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->ValidateProgram(context, program); +#endif // !INTERPOSE +} +static void VertexAttrib1f_1_0(PP_Resource context, GLuint indx, GLfloat x) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"VertexAttrib1f\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "indx", ToString_GLuint(indx)); + AddProp(ss, "x", ToString_GLfloat(x)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->VertexAttrib1f(context, indx, x); +#endif // !INTERPOSE +} +static void VertexAttrib1fv_1_0(PP_Resource context, GLuint indx, const GLfloat* values) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"VertexAttrib1fv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "indx", ToString_GLuint(indx)); + AddProp(ss, "values", ToString_GLfloat_ptr_t(values)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->VertexAttrib1fv(context, indx, values); +#endif // !INTERPOSE +} +static void VertexAttrib2f_1_0(PP_Resource context, GLuint indx, GLfloat x, GLfloat y) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"VertexAttrib2f\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "indx", ToString_GLuint(indx)); + AddProp(ss, "x", ToString_GLfloat(x)); + AddProp(ss, "y", ToString_GLfloat(y)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->VertexAttrib2f(context, indx, x, y); +#endif // !INTERPOSE +} +static void VertexAttrib2fv_1_0(PP_Resource context, GLuint indx, const GLfloat* values) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"VertexAttrib2fv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "indx", ToString_GLuint(indx)); + AddProp(ss, "values", ToString_GLfloat_ptr_t(values)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->VertexAttrib2fv(context, indx, values); +#endif // !INTERPOSE +} +static void VertexAttrib3f_1_0(PP_Resource context, GLuint indx, GLfloat x, GLfloat y, GLfloat z) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"VertexAttrib3f\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "indx", ToString_GLuint(indx)); + AddProp(ss, "x", ToString_GLfloat(x)); + AddProp(ss, "y", ToString_GLfloat(y)); + AddProp(ss, "z", ToString_GLfloat(z)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->VertexAttrib3f(context, indx, x, y, z); +#endif // !INTERPOSE +} +static void VertexAttrib3fv_1_0(PP_Resource context, GLuint indx, const GLfloat* values) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"VertexAttrib3fv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "indx", ToString_GLuint(indx)); + AddProp(ss, "values", ToString_GLfloat_ptr_t(values)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->VertexAttrib3fv(context, indx, values); +#endif // !INTERPOSE +} +static void VertexAttrib4f_1_0(PP_Resource context, GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"VertexAttrib4f\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "indx", ToString_GLuint(indx)); + AddProp(ss, "x", ToString_GLfloat(x)); + AddProp(ss, "y", ToString_GLfloat(y)); + AddProp(ss, "z", ToString_GLfloat(z)); + AddProp(ss, "w", ToString_GLfloat(w)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->VertexAttrib4f(context, indx, x, y, z, w); +#endif // !INTERPOSE +} +static void VertexAttrib4fv_1_0(PP_Resource context, GLuint indx, const GLfloat* values) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"VertexAttrib4fv\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "indx", ToString_GLuint(indx)); + AddProp(ss, "values", ToString_GLfloat_ptr_t(values)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->VertexAttrib4fv(context, indx, values); +#endif // !INTERPOSE +} +static void VertexAttribPointer_1_0(PP_Resource context, GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"VertexAttribPointer\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "indx", ToString_GLuint(indx)); + AddProp(ss, "size", ToString_GLint(size)); + AddProp(ss, "type", ToString_GLenum(type)); + AddProp(ss, "normalized", ToString_GLboolean(normalized)); + AddProp(ss, "stride", ToString_GLsizei(stride)); + AddProp(ss, "ptr", ToString_mem_t(ptr)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->VertexAttribPointer(context, indx, size, type, normalized, stride, ptr); +#endif // !INTERPOSE +} +static void Viewport_1_0(PP_Resource context, GLint x, GLint y, GLsizei width, GLsizei height) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Viewport\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "x", ToString_GLint(x)); + AddProp(ss, "y", ToString_GLint(y)); + AddProp(ss, "width", ToString_GLsizei(width)); + AddProp(ss, "height", ToString_GLsizei(height)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2_1_0*)RealGetInterface("PPB_OpenGLES2;1.0"))->Viewport(context, x, y, width, height); +#endif // !INTERPOSE +} +} +static PPB_OpenGLES2_1_0 _PPB_OpenGLES2_1_0 = { + ns_PPB_OpenGLES2_1_0::ActiveTexture_1_0, + ns_PPB_OpenGLES2_1_0::AttachShader_1_0, + ns_PPB_OpenGLES2_1_0::BindAttribLocation_1_0, + ns_PPB_OpenGLES2_1_0::BindBuffer_1_0, + ns_PPB_OpenGLES2_1_0::BindFramebuffer_1_0, + ns_PPB_OpenGLES2_1_0::BindRenderbuffer_1_0, + ns_PPB_OpenGLES2_1_0::BindTexture_1_0, + ns_PPB_OpenGLES2_1_0::BlendColor_1_0, + ns_PPB_OpenGLES2_1_0::BlendEquation_1_0, + ns_PPB_OpenGLES2_1_0::BlendEquationSeparate_1_0, + ns_PPB_OpenGLES2_1_0::BlendFunc_1_0, + ns_PPB_OpenGLES2_1_0::BlendFuncSeparate_1_0, + ns_PPB_OpenGLES2_1_0::BufferData_1_0, + ns_PPB_OpenGLES2_1_0::BufferSubData_1_0, + ns_PPB_OpenGLES2_1_0::CheckFramebufferStatus_1_0, + ns_PPB_OpenGLES2_1_0::Clear_1_0, + ns_PPB_OpenGLES2_1_0::ClearColor_1_0, + ns_PPB_OpenGLES2_1_0::ClearDepthf_1_0, + ns_PPB_OpenGLES2_1_0::ClearStencil_1_0, + ns_PPB_OpenGLES2_1_0::ColorMask_1_0, + ns_PPB_OpenGLES2_1_0::CompileShader_1_0, + ns_PPB_OpenGLES2_1_0::CompressedTexImage2D_1_0, + ns_PPB_OpenGLES2_1_0::CompressedTexSubImage2D_1_0, + ns_PPB_OpenGLES2_1_0::CopyTexImage2D_1_0, + ns_PPB_OpenGLES2_1_0::CopyTexSubImage2D_1_0, + ns_PPB_OpenGLES2_1_0::CreateProgram_1_0, + ns_PPB_OpenGLES2_1_0::CreateShader_1_0, + ns_PPB_OpenGLES2_1_0::CullFace_1_0, + ns_PPB_OpenGLES2_1_0::DeleteBuffers_1_0, + ns_PPB_OpenGLES2_1_0::DeleteFramebuffers_1_0, + ns_PPB_OpenGLES2_1_0::DeleteProgram_1_0, + ns_PPB_OpenGLES2_1_0::DeleteRenderbuffers_1_0, + ns_PPB_OpenGLES2_1_0::DeleteShader_1_0, + ns_PPB_OpenGLES2_1_0::DeleteTextures_1_0, + ns_PPB_OpenGLES2_1_0::DepthFunc_1_0, + ns_PPB_OpenGLES2_1_0::DepthMask_1_0, + ns_PPB_OpenGLES2_1_0::DepthRangef_1_0, + ns_PPB_OpenGLES2_1_0::DetachShader_1_0, + ns_PPB_OpenGLES2_1_0::Disable_1_0, + ns_PPB_OpenGLES2_1_0::DisableVertexAttribArray_1_0, + ns_PPB_OpenGLES2_1_0::DrawArrays_1_0, + ns_PPB_OpenGLES2_1_0::DrawElements_1_0, + ns_PPB_OpenGLES2_1_0::Enable_1_0, + ns_PPB_OpenGLES2_1_0::EnableVertexAttribArray_1_0, + ns_PPB_OpenGLES2_1_0::Finish_1_0, + ns_PPB_OpenGLES2_1_0::Flush_1_0, + ns_PPB_OpenGLES2_1_0::FramebufferRenderbuffer_1_0, + ns_PPB_OpenGLES2_1_0::FramebufferTexture2D_1_0, + ns_PPB_OpenGLES2_1_0::FrontFace_1_0, + ns_PPB_OpenGLES2_1_0::GenBuffers_1_0, + ns_PPB_OpenGLES2_1_0::GenerateMipmap_1_0, + ns_PPB_OpenGLES2_1_0::GenFramebuffers_1_0, + ns_PPB_OpenGLES2_1_0::GenRenderbuffers_1_0, + ns_PPB_OpenGLES2_1_0::GenTextures_1_0, + ns_PPB_OpenGLES2_1_0::GetActiveAttrib_1_0, + ns_PPB_OpenGLES2_1_0::GetActiveUniform_1_0, + ns_PPB_OpenGLES2_1_0::GetAttachedShaders_1_0, + ns_PPB_OpenGLES2_1_0::GetAttribLocation_1_0, + ns_PPB_OpenGLES2_1_0::GetBooleanv_1_0, + ns_PPB_OpenGLES2_1_0::GetBufferParameteriv_1_0, + ns_PPB_OpenGLES2_1_0::GetError_1_0, + ns_PPB_OpenGLES2_1_0::GetFloatv_1_0, + ns_PPB_OpenGLES2_1_0::GetFramebufferAttachmentParameteriv_1_0, + ns_PPB_OpenGLES2_1_0::GetIntegerv_1_0, + ns_PPB_OpenGLES2_1_0::GetProgramiv_1_0, + ns_PPB_OpenGLES2_1_0::GetProgramInfoLog_1_0, + ns_PPB_OpenGLES2_1_0::GetRenderbufferParameteriv_1_0, + ns_PPB_OpenGLES2_1_0::GetShaderiv_1_0, + ns_PPB_OpenGLES2_1_0::GetShaderInfoLog_1_0, + ns_PPB_OpenGLES2_1_0::GetShaderPrecisionFormat_1_0, + ns_PPB_OpenGLES2_1_0::GetShaderSource_1_0, + ns_PPB_OpenGLES2_1_0::GetString_1_0, + ns_PPB_OpenGLES2_1_0::GetTexParameterfv_1_0, + ns_PPB_OpenGLES2_1_0::GetTexParameteriv_1_0, + ns_PPB_OpenGLES2_1_0::GetUniformfv_1_0, + ns_PPB_OpenGLES2_1_0::GetUniformiv_1_0, + ns_PPB_OpenGLES2_1_0::GetUniformLocation_1_0, + ns_PPB_OpenGLES2_1_0::GetVertexAttribfv_1_0, + ns_PPB_OpenGLES2_1_0::GetVertexAttribiv_1_0, + ns_PPB_OpenGLES2_1_0::GetVertexAttribPointerv_1_0, + ns_PPB_OpenGLES2_1_0::Hint_1_0, + ns_PPB_OpenGLES2_1_0::IsBuffer_1_0, + ns_PPB_OpenGLES2_1_0::IsEnabled_1_0, + ns_PPB_OpenGLES2_1_0::IsFramebuffer_1_0, + ns_PPB_OpenGLES2_1_0::IsProgram_1_0, + ns_PPB_OpenGLES2_1_0::IsRenderbuffer_1_0, + ns_PPB_OpenGLES2_1_0::IsShader_1_0, + ns_PPB_OpenGLES2_1_0::IsTexture_1_0, + ns_PPB_OpenGLES2_1_0::LineWidth_1_0, + ns_PPB_OpenGLES2_1_0::LinkProgram_1_0, + ns_PPB_OpenGLES2_1_0::PixelStorei_1_0, + ns_PPB_OpenGLES2_1_0::PolygonOffset_1_0, + ns_PPB_OpenGLES2_1_0::ReadPixels_1_0, + ns_PPB_OpenGLES2_1_0::ReleaseShaderCompiler_1_0, + ns_PPB_OpenGLES2_1_0::RenderbufferStorage_1_0, + ns_PPB_OpenGLES2_1_0::SampleCoverage_1_0, + ns_PPB_OpenGLES2_1_0::Scissor_1_0, + ns_PPB_OpenGLES2_1_0::ShaderBinary_1_0, + ns_PPB_OpenGLES2_1_0::ShaderSource_1_0, + ns_PPB_OpenGLES2_1_0::StencilFunc_1_0, + ns_PPB_OpenGLES2_1_0::StencilFuncSeparate_1_0, + ns_PPB_OpenGLES2_1_0::StencilMask_1_0, + ns_PPB_OpenGLES2_1_0::StencilMaskSeparate_1_0, + ns_PPB_OpenGLES2_1_0::StencilOp_1_0, + ns_PPB_OpenGLES2_1_0::StencilOpSeparate_1_0, + ns_PPB_OpenGLES2_1_0::TexImage2D_1_0, + ns_PPB_OpenGLES2_1_0::TexParameterf_1_0, + ns_PPB_OpenGLES2_1_0::TexParameterfv_1_0, + ns_PPB_OpenGLES2_1_0::TexParameteri_1_0, + ns_PPB_OpenGLES2_1_0::TexParameteriv_1_0, + ns_PPB_OpenGLES2_1_0::TexSubImage2D_1_0, + ns_PPB_OpenGLES2_1_0::Uniform1f_1_0, + ns_PPB_OpenGLES2_1_0::Uniform1fv_1_0, + ns_PPB_OpenGLES2_1_0::Uniform1i_1_0, + ns_PPB_OpenGLES2_1_0::Uniform1iv_1_0, + ns_PPB_OpenGLES2_1_0::Uniform2f_1_0, + ns_PPB_OpenGLES2_1_0::Uniform2fv_1_0, + ns_PPB_OpenGLES2_1_0::Uniform2i_1_0, + ns_PPB_OpenGLES2_1_0::Uniform2iv_1_0, + ns_PPB_OpenGLES2_1_0::Uniform3f_1_0, + ns_PPB_OpenGLES2_1_0::Uniform3fv_1_0, + ns_PPB_OpenGLES2_1_0::Uniform3i_1_0, + ns_PPB_OpenGLES2_1_0::Uniform3iv_1_0, + ns_PPB_OpenGLES2_1_0::Uniform4f_1_0, + ns_PPB_OpenGLES2_1_0::Uniform4fv_1_0, + ns_PPB_OpenGLES2_1_0::Uniform4i_1_0, + ns_PPB_OpenGLES2_1_0::Uniform4iv_1_0, + ns_PPB_OpenGLES2_1_0::UniformMatrix2fv_1_0, + ns_PPB_OpenGLES2_1_0::UniformMatrix3fv_1_0, + ns_PPB_OpenGLES2_1_0::UniformMatrix4fv_1_0, + ns_PPB_OpenGLES2_1_0::UseProgram_1_0, + ns_PPB_OpenGLES2_1_0::ValidateProgram_1_0, + ns_PPB_OpenGLES2_1_0::VertexAttrib1f_1_0, + ns_PPB_OpenGLES2_1_0::VertexAttrib1fv_1_0, + ns_PPB_OpenGLES2_1_0::VertexAttrib2f_1_0, + ns_PPB_OpenGLES2_1_0::VertexAttrib2fv_1_0, + ns_PPB_OpenGLES2_1_0::VertexAttrib3f_1_0, + ns_PPB_OpenGLES2_1_0::VertexAttrib3fv_1_0, + ns_PPB_OpenGLES2_1_0::VertexAttrib4f_1_0, + ns_PPB_OpenGLES2_1_0::VertexAttrib4fv_1_0, + ns_PPB_OpenGLES2_1_0::VertexAttribPointer_1_0, + ns_PPB_OpenGLES2_1_0::Viewport_1_0, +}; +const string ToString_PPB_OpenGLES2(const PPB_OpenGLES2_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_OpenGLES2InstancedArrays_1_0 { +static void DrawArraysInstancedANGLE_1_0(PP_Resource context, GLenum mode, GLint first, GLsizei count, GLsizei primcount) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2InstancedArrays\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"DrawArraysInstancedANGLE\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "mode", ToString_GLenum(mode)); + AddProp(ss, "first", ToString_GLint(first)); + AddProp(ss, "count", ToString_GLsizei(count)); + AddProp(ss, "primcount", ToString_GLsizei(primcount)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2InstancedArrays_1_0*)RealGetInterface("PPB_OpenGLES2InstancedArrays;1.0"))->DrawArraysInstancedANGLE(context, mode, first, count, primcount); +#endif // !INTERPOSE +} +static void DrawElementsInstancedANGLE_1_0(PP_Resource context, GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2InstancedArrays\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"DrawElementsInstancedANGLE\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "mode", ToString_GLenum(mode)); + AddProp(ss, "count", ToString_GLsizei(count)); + AddProp(ss, "type", ToString_GLenum(type)); + AddProp(ss, "indices", ToString_mem_t(indices)); + AddProp(ss, "primcount", ToString_GLsizei(primcount)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2InstancedArrays_1_0*)RealGetInterface("PPB_OpenGLES2InstancedArrays;1.0"))->DrawElementsInstancedANGLE(context, mode, count, type, indices, primcount); +#endif // !INTERPOSE +} +static void VertexAttribDivisorANGLE_1_0(PP_Resource context, GLuint index, GLuint divisor) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2InstancedArrays\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"VertexAttribDivisorANGLE\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "index", ToString_GLuint(index)); + AddProp(ss, "divisor", ToString_GLuint(divisor)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2InstancedArrays_1_0*)RealGetInterface("PPB_OpenGLES2InstancedArrays;1.0"))->VertexAttribDivisorANGLE(context, index, divisor); +#endif // !INTERPOSE +} +} +static PPB_OpenGLES2InstancedArrays_1_0 _PPB_OpenGLES2InstancedArrays_1_0 = { + ns_PPB_OpenGLES2InstancedArrays_1_0::DrawArraysInstancedANGLE_1_0, + ns_PPB_OpenGLES2InstancedArrays_1_0::DrawElementsInstancedANGLE_1_0, + ns_PPB_OpenGLES2InstancedArrays_1_0::VertexAttribDivisorANGLE_1_0, +}; +const string ToString_PPB_OpenGLES2InstancedArrays(const PPB_OpenGLES2InstancedArrays_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_OpenGLES2FramebufferBlit_1_0 { +static void BlitFramebufferEXT_1_0(PP_Resource context, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2FramebufferBlit\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"BlitFramebufferEXT\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "srcX0", ToString_GLint(srcX0)); + AddProp(ss, "srcY0", ToString_GLint(srcY0)); + AddProp(ss, "srcX1", ToString_GLint(srcX1)); + AddProp(ss, "srcY1", ToString_GLint(srcY1)); + AddProp(ss, "dstX0", ToString_GLint(dstX0)); + AddProp(ss, "dstY0", ToString_GLint(dstY0)); + AddProp(ss, "dstX1", ToString_GLint(dstX1)); + AddProp(ss, "dstY1", ToString_GLint(dstY1)); + AddProp(ss, "mask", ToString_GLbitfield(mask)); + AddProp(ss, "filter", ToString_GLenum(filter)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2FramebufferBlit_1_0*)RealGetInterface("PPB_OpenGLES2FramebufferBlit;1.0"))->BlitFramebufferEXT(context, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); +#endif // !INTERPOSE +} +} +static PPB_OpenGLES2FramebufferBlit_1_0 _PPB_OpenGLES2FramebufferBlit_1_0 = { + ns_PPB_OpenGLES2FramebufferBlit_1_0::BlitFramebufferEXT_1_0, +}; +const string ToString_PPB_OpenGLES2FramebufferBlit(const PPB_OpenGLES2FramebufferBlit_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_OpenGLES2FramebufferMultisample_1_0 { +static void RenderbufferStorageMultisampleEXT_1_0(PP_Resource context, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2FramebufferMultisample\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"RenderbufferStorageMultisampleEXT\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + AddProp(ss, "samples", ToString_GLsizei(samples)); + AddProp(ss, "internalformat", ToString_GLenum(internalformat)); + AddProp(ss, "width", ToString_GLsizei(width)); + AddProp(ss, "height", ToString_GLsizei(height)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2FramebufferMultisample_1_0*)RealGetInterface("PPB_OpenGLES2FramebufferMultisample;1.0"))->RenderbufferStorageMultisampleEXT(context, target, samples, internalformat, width, height); +#endif // !INTERPOSE +} +} +static PPB_OpenGLES2FramebufferMultisample_1_0 _PPB_OpenGLES2FramebufferMultisample_1_0 = { + ns_PPB_OpenGLES2FramebufferMultisample_1_0::RenderbufferStorageMultisampleEXT_1_0, +}; +const string ToString_PPB_OpenGLES2FramebufferMultisample(const PPB_OpenGLES2FramebufferMultisample_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_OpenGLES2ChromiumEnableFeature_1_0 { +static GLboolean EnableFeatureCHROMIUM_1_0(PP_Resource context, const char* feature) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2ChromiumEnableFeature\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"EnableFeatureCHROMIUM\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "feature", ToString_cstr_t(feature)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + GLboolean rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_GLboolean(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + GLboolean rval = ((PPB_OpenGLES2ChromiumEnableFeature_1_0*)RealGetInterface("PPB_OpenGLES2ChromiumEnableFeature;1.0"))->EnableFeatureCHROMIUM(context, feature); + printf("RPC response: ["); + printf("%s", ToString_GLboolean(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_OpenGLES2ChromiumEnableFeature_1_0 _PPB_OpenGLES2ChromiumEnableFeature_1_0 = { + ns_PPB_OpenGLES2ChromiumEnableFeature_1_0::EnableFeatureCHROMIUM_1_0, +}; +const string ToString_PPB_OpenGLES2ChromiumEnableFeature(const PPB_OpenGLES2ChromiumEnableFeature_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_OpenGLES2ChromiumMapSub_1_0 { +static void* MapBufferSubDataCHROMIUM_1_0(PP_Resource context, GLuint target, GLintptr offset, GLsizeiptr size, GLenum access) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2ChromiumMapSub\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"MapBufferSubDataCHROMIUM\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLuint(target)); + AddProp(ss, "offset", ToString_GLintptr(offset)); + AddProp(ss, "size", ToString_GLsizeiptr(size)); + AddProp(ss, "access", ToString_GLenum(access)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + void* rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_mem_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + void* rval = ((PPB_OpenGLES2ChromiumMapSub_1_0*)RealGetInterface("PPB_OpenGLES2ChromiumMapSub;1.0"))->MapBufferSubDataCHROMIUM(context, target, offset, size, access); + printf("RPC response: ["); + printf("%s", ToString_mem_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void UnmapBufferSubDataCHROMIUM_1_0(PP_Resource context, const void* mem) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2ChromiumMapSub\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"UnmapBufferSubDataCHROMIUM\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "mem", ToString_mem_t(mem)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2ChromiumMapSub_1_0*)RealGetInterface("PPB_OpenGLES2ChromiumMapSub;1.0"))->UnmapBufferSubDataCHROMIUM(context, mem); +#endif // !INTERPOSE +} +static void* MapTexSubImage2DCHROMIUM_1_0(PP_Resource context, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLenum access) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2ChromiumMapSub\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"MapTexSubImage2DCHROMIUM\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + AddProp(ss, "level", ToString_GLint(level)); + AddProp(ss, "xoffset", ToString_GLint(xoffset)); + AddProp(ss, "yoffset", ToString_GLint(yoffset)); + AddProp(ss, "width", ToString_GLsizei(width)); + AddProp(ss, "height", ToString_GLsizei(height)); + AddProp(ss, "format", ToString_GLenum(format)); + AddProp(ss, "type", ToString_GLenum(type)); + AddProp(ss, "access", ToString_GLenum(access)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + void* rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_mem_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + void* rval = ((PPB_OpenGLES2ChromiumMapSub_1_0*)RealGetInterface("PPB_OpenGLES2ChromiumMapSub;1.0"))->MapTexSubImage2DCHROMIUM(context, target, level, xoffset, yoffset, width, height, format, type, access); + printf("RPC response: ["); + printf("%s", ToString_mem_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void UnmapTexSubImage2DCHROMIUM_1_0(PP_Resource context, const void* mem) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2ChromiumMapSub\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"UnmapTexSubImage2DCHROMIUM\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "mem", ToString_mem_t(mem)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2ChromiumMapSub_1_0*)RealGetInterface("PPB_OpenGLES2ChromiumMapSub;1.0"))->UnmapTexSubImage2DCHROMIUM(context, mem); +#endif // !INTERPOSE +} +} +static PPB_OpenGLES2ChromiumMapSub_1_0 _PPB_OpenGLES2ChromiumMapSub_1_0 = { + ns_PPB_OpenGLES2ChromiumMapSub_1_0::MapBufferSubDataCHROMIUM_1_0, + ns_PPB_OpenGLES2ChromiumMapSub_1_0::UnmapBufferSubDataCHROMIUM_1_0, + ns_PPB_OpenGLES2ChromiumMapSub_1_0::MapTexSubImage2DCHROMIUM_1_0, + ns_PPB_OpenGLES2ChromiumMapSub_1_0::UnmapTexSubImage2DCHROMIUM_1_0, +}; +const string ToString_PPB_OpenGLES2ChromiumMapSub(const PPB_OpenGLES2ChromiumMapSub_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_OpenGLES2Query_1_0 { +static void GenQueriesEXT_1_0(PP_Resource context, GLsizei n, GLuint* queries) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2Query\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GenQueriesEXT\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "n", ToString_GLsizei(n)); + AddProp(ss, "queries", PointerToString(queries)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_GLuint_ptr_t(iterator, queries); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2Query_1_0*)RealGetInterface("PPB_OpenGLES2Query;1.0"))->GenQueriesEXT(context, n, queries); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "queries", ToString_GLuint_ptr_t(queries)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void DeleteQueriesEXT_1_0(PP_Resource context, GLsizei n, const GLuint* queries) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2Query\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"DeleteQueriesEXT\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "n", ToString_GLsizei(n)); + AddProp(ss, "queries", ToString_GLuint_ptr_t(queries)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2Query_1_0*)RealGetInterface("PPB_OpenGLES2Query;1.0"))->DeleteQueriesEXT(context, n, queries); +#endif // !INTERPOSE +} +static GLboolean IsQueryEXT_1_0(PP_Resource context, GLuint id) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2Query\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsQueryEXT\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "id", ToString_GLuint(id)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + GLboolean rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_GLboolean(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + GLboolean rval = ((PPB_OpenGLES2Query_1_0*)RealGetInterface("PPB_OpenGLES2Query;1.0"))->IsQueryEXT(context, id); + printf("RPC response: ["); + printf("%s", ToString_GLboolean(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void BeginQueryEXT_1_0(PP_Resource context, GLenum target, GLuint id) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2Query\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"BeginQueryEXT\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + AddProp(ss, "id", ToString_GLuint(id)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2Query_1_0*)RealGetInterface("PPB_OpenGLES2Query;1.0"))->BeginQueryEXT(context, target, id); +#endif // !INTERPOSE +} +static void EndQueryEXT_1_0(PP_Resource context, GLenum target) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2Query\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"EndQueryEXT\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2Query_1_0*)RealGetInterface("PPB_OpenGLES2Query;1.0"))->EndQueryEXT(context, target); +#endif // !INTERPOSE +} +static void GetQueryivEXT_1_0(PP_Resource context, GLenum target, GLenum pname, GLint* params) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2Query\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetQueryivEXT\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "target", ToString_GLenum(target)); + AddProp(ss, "pname", ToString_GLenum(pname)); + AddProp(ss, "params", PointerToString(params)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_GLint_ptr_t(iterator, params); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2Query_1_0*)RealGetInterface("PPB_OpenGLES2Query;1.0"))->GetQueryivEXT(context, target, pname, params); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "params", ToString_GLint_ptr_t(params)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void GetQueryObjectuivEXT_1_0(PP_Resource context, GLuint id, GLenum pname, GLuint* params) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2Query\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetQueryObjectuivEXT\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "id", ToString_GLuint(id)); + AddProp(ss, "pname", ToString_GLenum(pname)); + AddProp(ss, "params", PointerToString(params)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_GLuint_ptr_t(iterator, params); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2Query_1_0*)RealGetInterface("PPB_OpenGLES2Query;1.0"))->GetQueryObjectuivEXT(context, id, pname, params); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "params", ToString_GLuint_ptr_t(params)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +} +static PPB_OpenGLES2Query_1_0 _PPB_OpenGLES2Query_1_0 = { + ns_PPB_OpenGLES2Query_1_0::GenQueriesEXT_1_0, + ns_PPB_OpenGLES2Query_1_0::DeleteQueriesEXT_1_0, + ns_PPB_OpenGLES2Query_1_0::IsQueryEXT_1_0, + ns_PPB_OpenGLES2Query_1_0::BeginQueryEXT_1_0, + ns_PPB_OpenGLES2Query_1_0::EndQueryEXT_1_0, + ns_PPB_OpenGLES2Query_1_0::GetQueryivEXT_1_0, + ns_PPB_OpenGLES2Query_1_0::GetQueryObjectuivEXT_1_0, +}; +const string ToString_PPB_OpenGLES2Query(const PPB_OpenGLES2Query_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_OpenGLES2VertexArrayObject_1_0 { +static void GenVertexArraysOES_1_0(PP_Resource context, GLsizei n, GLuint* arrays) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2VertexArrayObject\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GenVertexArraysOES\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "n", ToString_GLsizei(n)); + AddProp(ss, "arrays", PointerToString(arrays)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_GLuint_ptr_t(iterator, arrays); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2VertexArrayObject_1_0*)RealGetInterface("PPB_OpenGLES2VertexArrayObject;1.0"))->GenVertexArraysOES(context, n, arrays); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "arrays", ToString_GLuint_ptr_t(arrays)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void DeleteVertexArraysOES_1_0(PP_Resource context, GLsizei n, const GLuint* arrays) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2VertexArrayObject\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"DeleteVertexArraysOES\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "n", ToString_GLsizei(n)); + AddProp(ss, "arrays", ToString_GLuint_ptr_t(arrays)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2VertexArrayObject_1_0*)RealGetInterface("PPB_OpenGLES2VertexArrayObject;1.0"))->DeleteVertexArraysOES(context, n, arrays); +#endif // !INTERPOSE +} +static GLboolean IsVertexArrayOES_1_0(PP_Resource context, GLuint array) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2VertexArrayObject\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsVertexArrayOES\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "array", ToString_GLuint(array)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + GLboolean rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_GLboolean(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + GLboolean rval = ((PPB_OpenGLES2VertexArrayObject_1_0*)RealGetInterface("PPB_OpenGLES2VertexArrayObject;1.0"))->IsVertexArrayOES(context, array); + printf("RPC response: ["); + printf("%s", ToString_GLboolean(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void BindVertexArrayOES_1_0(PP_Resource context, GLuint array) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2VertexArrayObject\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"BindVertexArrayOES\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "array", ToString_GLuint(array)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2VertexArrayObject_1_0*)RealGetInterface("PPB_OpenGLES2VertexArrayObject;1.0"))->BindVertexArrayOES(context, array); +#endif // !INTERPOSE +} +} +static PPB_OpenGLES2VertexArrayObject_1_0 _PPB_OpenGLES2VertexArrayObject_1_0 = { + ns_PPB_OpenGLES2VertexArrayObject_1_0::GenVertexArraysOES_1_0, + ns_PPB_OpenGLES2VertexArrayObject_1_0::DeleteVertexArraysOES_1_0, + ns_PPB_OpenGLES2VertexArrayObject_1_0::IsVertexArrayOES_1_0, + ns_PPB_OpenGLES2VertexArrayObject_1_0::BindVertexArrayOES_1_0, +}; +const string ToString_PPB_OpenGLES2VertexArrayObject(const PPB_OpenGLES2VertexArrayObject_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_TCPSocket_Option(const PP_TCPSocket_Option *v) { + switch (*v) { + case 0: + return "\"PP_TCPSOCKET_OPTION_NO_DELAY\""; + case 1: + return "\"PP_TCPSOCKET_OPTION_SEND_BUFFER_SIZE\""; + case 2: + return "\"PP_TCPSOCKET_OPTION_RECV_BUFFER_SIZE\""; + default: + return "\"???\""; + } +} +const string ToString_PP_TCPSocket_Option(const PP_TCPSocket_Option &v) { + return ToString_PP_TCPSocket_Option(&v); +} +void FromJSON_PP_TCPSocket_Option(JSONIterator& iterator, PP_TCPSocket_Option &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_TCPSocket_Option(v); +} +namespace ns_PPB_TCPSocket_1_0 { +static PP_Resource Create_1_0(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_TCPSocket_1_0*)RealGetInterface("PPB_TCPSocket;1.0"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsTCPSocket_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsTCPSocket\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_TCPSocket_1_0*)RealGetInterface("PPB_TCPSocket;1.0"))->IsTCPSocket(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping Bind */ +static int32_t Connect_1_0(PP_Resource tcp_socket, PP_Resource addr, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Connect\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "addr", ToString_PP_Resource(addr)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_1_0*)RealGetInterface("PPB_TCPSocket;1.0"))->Connect(tcp_socket, addr, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource GetLocalAddress_1_0(PP_Resource tcp_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetLocalAddress\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_TCPSocket_1_0*)RealGetInterface("PPB_TCPSocket;1.0"))->GetLocalAddress(tcp_socket); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource GetRemoteAddress_1_0(PP_Resource tcp_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetRemoteAddress\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_TCPSocket_1_0*)RealGetInterface("PPB_TCPSocket;1.0"))->GetRemoteAddress(tcp_socket); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Read_1_0(PP_Resource tcp_socket, char* buffer, int32_t bytes_to_read, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Read\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "buffer", PointerToString(buffer)); + AddProp(ss, "bytes_to_read", ToString_int32_t(bytes_to_read)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_str_t(iterator, buffer); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_1_0*)RealGetInterface("PPB_TCPSocket;1.0"))->Read(tcp_socket, buffer, bytes_to_read, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + AddProp(os, "buffer", ToString_str_t(buffer)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Write_1_0(PP_Resource tcp_socket, const char* buffer, int32_t bytes_to_write, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Write\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "buffer", ToString_str_t(buffer)); + AddProp(ss, "bytes_to_write", ToString_int32_t(bytes_to_write)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_1_0*)RealGetInterface("PPB_TCPSocket;1.0"))->Write(tcp_socket, buffer, bytes_to_write, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping Listen */ +/* skipping Accept */ +static void Close_1_0(PP_Resource tcp_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Close\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_TCPSocket_1_0*)RealGetInterface("PPB_TCPSocket;1.0"))->Close(tcp_socket); +#endif // !INTERPOSE +} +static int32_t SetOption_1_0(PP_Resource tcp_socket, PP_TCPSocket_Option name, struct PP_Var value, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"SetOption\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "name", ToString_PP_TCPSocket_Option(name)); + AddProp(ss, "value", ToString_PP_Var(value)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_1_0*)RealGetInterface("PPB_TCPSocket;1.0"))->SetOption(tcp_socket, name, value, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping SetOption */ +} +static PPB_TCPSocket_1_0 _PPB_TCPSocket_1_0 = { + ns_PPB_TCPSocket_1_0::Create_1_0, + ns_PPB_TCPSocket_1_0::IsTCPSocket_1_0, + ns_PPB_TCPSocket_1_0::Connect_1_0, + ns_PPB_TCPSocket_1_0::GetLocalAddress_1_0, + ns_PPB_TCPSocket_1_0::GetRemoteAddress_1_0, + ns_PPB_TCPSocket_1_0::Read_1_0, + ns_PPB_TCPSocket_1_0::Write_1_0, + ns_PPB_TCPSocket_1_0::Close_1_0, + ns_PPB_TCPSocket_1_0::SetOption_1_0, +}; +const string ToString_PPB_TCPSocket(const PPB_TCPSocket_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_TCPSocket_1_1 { +static PP_Resource Create_1_1(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_TCPSocket_1_1*)RealGetInterface("PPB_TCPSocket;1.1"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsTCPSocket_1_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"IsTCPSocket\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_TCPSocket_1_1*)RealGetInterface("PPB_TCPSocket;1.1"))->IsTCPSocket(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Bind_1_1(PP_Resource tcp_socket, PP_Resource addr, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Bind\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "addr", ToString_PP_Resource(addr)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_1_1*)RealGetInterface("PPB_TCPSocket;1.1"))->Bind(tcp_socket, addr, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Connect_1_1(PP_Resource tcp_socket, PP_Resource addr, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Connect\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "addr", ToString_PP_Resource(addr)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_1_1*)RealGetInterface("PPB_TCPSocket;1.1"))->Connect(tcp_socket, addr, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource GetLocalAddress_1_1(PP_Resource tcp_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"GetLocalAddress\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_TCPSocket_1_1*)RealGetInterface("PPB_TCPSocket;1.1"))->GetLocalAddress(tcp_socket); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource GetRemoteAddress_1_1(PP_Resource tcp_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"GetRemoteAddress\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_TCPSocket_1_1*)RealGetInterface("PPB_TCPSocket;1.1"))->GetRemoteAddress(tcp_socket); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Read_1_1(PP_Resource tcp_socket, char* buffer, int32_t bytes_to_read, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Read\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "buffer", PointerToString(buffer)); + AddProp(ss, "bytes_to_read", ToString_int32_t(bytes_to_read)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_str_t(iterator, buffer); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_1_1*)RealGetInterface("PPB_TCPSocket;1.1"))->Read(tcp_socket, buffer, bytes_to_read, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + AddProp(os, "buffer", ToString_str_t(buffer)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Write_1_1(PP_Resource tcp_socket, const char* buffer, int32_t bytes_to_write, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Write\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "buffer", ToString_str_t(buffer)); + AddProp(ss, "bytes_to_write", ToString_int32_t(bytes_to_write)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_1_1*)RealGetInterface("PPB_TCPSocket;1.1"))->Write(tcp_socket, buffer, bytes_to_write, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Listen_1_1(PP_Resource tcp_socket, int32_t backlog, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Listen\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "backlog", ToString_int32_t(backlog)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_1_1*)RealGetInterface("PPB_TCPSocket;1.1"))->Listen(tcp_socket, backlog, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Accept_1_1(PP_Resource tcp_socket, PP_Resource* accepted_tcp_socket, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Accept\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "accepted_tcp_socket", PointerToString(accepted_tcp_socket)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Resource(iterator, *accepted_tcp_socket); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_1_1*)RealGetInterface("PPB_TCPSocket;1.1"))->Accept(tcp_socket, accepted_tcp_socket, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!accepted_tcp_socket) { + AddProp(os, "accepted_tcp_socket", ToString_PP_Resource(accepted_tcp_socket)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void Close_1_1(PP_Resource tcp_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Close\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_TCPSocket_1_1*)RealGetInterface("PPB_TCPSocket;1.1"))->Close(tcp_socket); +#endif // !INTERPOSE +} +static int32_t SetOption_1_1(PP_Resource tcp_socket, PP_TCPSocket_Option name, struct PP_Var value, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"SetOption\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "name", ToString_PP_TCPSocket_Option(name)); + AddProp(ss, "value", ToString_PP_Var(value)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_1_1*)RealGetInterface("PPB_TCPSocket;1.1"))->SetOption(tcp_socket, name, value, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping SetOption */ +} +static PPB_TCPSocket_1_1 _PPB_TCPSocket_1_1 = { + ns_PPB_TCPSocket_1_1::Create_1_1, + ns_PPB_TCPSocket_1_1::IsTCPSocket_1_1, + ns_PPB_TCPSocket_1_1::Bind_1_1, + ns_PPB_TCPSocket_1_1::Connect_1_1, + ns_PPB_TCPSocket_1_1::GetLocalAddress_1_1, + ns_PPB_TCPSocket_1_1::GetRemoteAddress_1_1, + ns_PPB_TCPSocket_1_1::Read_1_1, + ns_PPB_TCPSocket_1_1::Write_1_1, + ns_PPB_TCPSocket_1_1::Listen_1_1, + ns_PPB_TCPSocket_1_1::Accept_1_1, + ns_PPB_TCPSocket_1_1::Close_1_1, + ns_PPB_TCPSocket_1_1::SetOption_1_1, +}; +const string ToString_PPB_TCPSocket(const PPB_TCPSocket_1_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_TCPSocket_1_2 { +static PP_Resource Create_1_2(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_TCPSocket_1_2*)RealGetInterface("PPB_TCPSocket;1.2"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsTCPSocket_1_2(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"IsTCPSocket\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_TCPSocket_1_2*)RealGetInterface("PPB_TCPSocket;1.2"))->IsTCPSocket(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Bind_1_2(PP_Resource tcp_socket, PP_Resource addr, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"Bind\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "addr", ToString_PP_Resource(addr)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_1_2*)RealGetInterface("PPB_TCPSocket;1.2"))->Bind(tcp_socket, addr, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Connect_1_2(PP_Resource tcp_socket, PP_Resource addr, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"Connect\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "addr", ToString_PP_Resource(addr)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_1_2*)RealGetInterface("PPB_TCPSocket;1.2"))->Connect(tcp_socket, addr, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource GetLocalAddress_1_2(PP_Resource tcp_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"GetLocalAddress\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_TCPSocket_1_2*)RealGetInterface("PPB_TCPSocket;1.2"))->GetLocalAddress(tcp_socket); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource GetRemoteAddress_1_2(PP_Resource tcp_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"GetRemoteAddress\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_TCPSocket_1_2*)RealGetInterface("PPB_TCPSocket;1.2"))->GetRemoteAddress(tcp_socket); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Read_1_2(PP_Resource tcp_socket, char* buffer, int32_t bytes_to_read, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"Read\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "buffer", PointerToString(buffer)); + AddProp(ss, "bytes_to_read", ToString_int32_t(bytes_to_read)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_str_t(iterator, buffer); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_1_2*)RealGetInterface("PPB_TCPSocket;1.2"))->Read(tcp_socket, buffer, bytes_to_read, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + AddProp(os, "buffer", ToString_str_t(buffer)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Write_1_2(PP_Resource tcp_socket, const char* buffer, int32_t bytes_to_write, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"Write\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "buffer", ToString_str_t(buffer)); + AddProp(ss, "bytes_to_write", ToString_int32_t(bytes_to_write)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_1_2*)RealGetInterface("PPB_TCPSocket;1.2"))->Write(tcp_socket, buffer, bytes_to_write, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Listen_1_2(PP_Resource tcp_socket, int32_t backlog, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"Listen\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "backlog", ToString_int32_t(backlog)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_1_2*)RealGetInterface("PPB_TCPSocket;1.2"))->Listen(tcp_socket, backlog, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Accept_1_2(PP_Resource tcp_socket, PP_Resource* accepted_tcp_socket, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"Accept\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "accepted_tcp_socket", PointerToString(accepted_tcp_socket)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Resource(iterator, *accepted_tcp_socket); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_1_2*)RealGetInterface("PPB_TCPSocket;1.2"))->Accept(tcp_socket, accepted_tcp_socket, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!accepted_tcp_socket) { + AddProp(os, "accepted_tcp_socket", ToString_PP_Resource(accepted_tcp_socket)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void Close_1_2(PP_Resource tcp_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"Close\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_TCPSocket_1_2*)RealGetInterface("PPB_TCPSocket;1.2"))->Close(tcp_socket); +#endif // !INTERPOSE +} +/* skipping SetOption */ +static int32_t SetOption_1_2(PP_Resource tcp_socket, PP_TCPSocket_Option name, struct PP_Var value, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"SetOption\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "name", ToString_PP_TCPSocket_Option(name)); + AddProp(ss, "value", ToString_PP_Var(value)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_1_2*)RealGetInterface("PPB_TCPSocket;1.2"))->SetOption(tcp_socket, name, value, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_TCPSocket_1_2 _PPB_TCPSocket_1_2 = { + ns_PPB_TCPSocket_1_2::Create_1_2, + ns_PPB_TCPSocket_1_2::IsTCPSocket_1_2, + ns_PPB_TCPSocket_1_2::Bind_1_2, + ns_PPB_TCPSocket_1_2::Connect_1_2, + ns_PPB_TCPSocket_1_2::GetLocalAddress_1_2, + ns_PPB_TCPSocket_1_2::GetRemoteAddress_1_2, + ns_PPB_TCPSocket_1_2::Read_1_2, + ns_PPB_TCPSocket_1_2::Write_1_2, + ns_PPB_TCPSocket_1_2::Listen_1_2, + ns_PPB_TCPSocket_1_2::Accept_1_2, + ns_PPB_TCPSocket_1_2::Close_1_2, + ns_PPB_TCPSocket_1_2::SetOption_1_2, +}; +const string ToString_PPB_TCPSocket(const PPB_TCPSocket_1_2 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_TextInput_Type(const PP_TextInput_Type *v) { + switch (*v) { + case 0: + return "\"PP_TEXTINPUT_TYPE_NONE\""; + case 1: + return "\"PP_TEXTINPUT_TYPE_TEXT\""; + case 2: + return "\"PP_TEXTINPUT_TYPE_PASSWORD\""; + case 3: + return "\"PP_TEXTINPUT_TYPE_SEARCH\""; + case 4: + return "\"PP_TEXTINPUT_TYPE_EMAIL\""; + case 5: + return "\"PP_TEXTINPUT_TYPE_NUMBER\""; + case 6: + return "\"PP_TEXTINPUT_TYPE_TELEPHONE\""; + case 7: + return "\"PP_TEXTINPUT_TYPE_URL\""; + default: + return "\"???\""; + } +} +const string ToString_PP_TextInput_Type(const PP_TextInput_Type &v) { + return ToString_PP_TextInput_Type(&v); +} +void FromJSON_PP_TextInput_Type(JSONIterator& iterator, PP_TextInput_Type &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_TextInput_Type(v); +} +namespace ns_PPB_TextInputController_1_0 { +static void SetTextInputType_1_0(PP_Instance instance, PP_TextInput_Type type) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TextInputController\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"SetTextInputType\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "type", ToString_PP_TextInput_Type(type)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_TextInputController_1_0*)RealGetInterface("PPB_TextInputController;1.0"))->SetTextInputType(instance, type); +#endif // !INTERPOSE +} +static void UpdateCaretPosition_1_0(PP_Instance instance, const struct PP_Rect* caret) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TextInputController\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"UpdateCaretPosition\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "caret", ToString_PP_Rect(caret)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_TextInputController_1_0*)RealGetInterface("PPB_TextInputController;1.0"))->UpdateCaretPosition(instance, caret); +#endif // !INTERPOSE +} +static void CancelCompositionText_1_0(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TextInputController\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"CancelCompositionText\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_TextInputController_1_0*)RealGetInterface("PPB_TextInputController;1.0"))->CancelCompositionText(instance); +#endif // !INTERPOSE +} +static void UpdateSurroundingText_1_0(PP_Instance instance, struct PP_Var text, uint32_t caret, uint32_t anchor) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TextInputController\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"UpdateSurroundingText\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "text", ToString_PP_Var(text)); + AddProp(ss, "caret", ToString_uint32_t(caret)); + AddProp(ss, "anchor", ToString_uint32_t(anchor)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_TextInputController_1_0*)RealGetInterface("PPB_TextInputController;1.0"))->UpdateSurroundingText(instance, text, caret, anchor); +#endif // !INTERPOSE +} +} +static PPB_TextInputController_1_0 _PPB_TextInputController_1_0 = { + ns_PPB_TextInputController_1_0::SetTextInputType_1_0, + ns_PPB_TextInputController_1_0::UpdateCaretPosition_1_0, + ns_PPB_TextInputController_1_0::CancelCompositionText_1_0, + ns_PPB_TextInputController_1_0::UpdateSurroundingText_1_0, +}; +const string ToString_PPB_TextInputController(const PPB_TextInputController_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_UDPSocket_Option(const PP_UDPSocket_Option *v) { + switch (*v) { + case 0: + return "\"PP_UDPSOCKET_OPTION_ADDRESS_REUSE\""; + case 1: + return "\"PP_UDPSOCKET_OPTION_BROADCAST\""; + case 2: + return "\"PP_UDPSOCKET_OPTION_SEND_BUFFER_SIZE\""; + case 3: + return "\"PP_UDPSOCKET_OPTION_RECV_BUFFER_SIZE\""; + case 4: + return "\"PP_UDPSOCKET_OPTION_MULTICAST_LOOP\""; + case 5: + return "\"PP_UDPSOCKET_OPTION_MULTICAST_TTL\""; + default: + return "\"???\""; + } +} +const string ToString_PP_UDPSocket_Option(const PP_UDPSocket_Option &v) { + return ToString_PP_UDPSocket_Option(&v); +} +void FromJSON_PP_UDPSocket_Option(JSONIterator& iterator, PP_UDPSocket_Option &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_UDPSocket_Option(v); +} +namespace ns_PPB_UDPSocket_1_0 { +static PP_Resource Create_1_0(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_UDPSocket_1_0*)RealGetInterface("PPB_UDPSocket;1.0"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsUDPSocket_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsUDPSocket\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_UDPSocket_1_0*)RealGetInterface("PPB_UDPSocket;1.0"))->IsUDPSocket(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Bind_1_0(PP_Resource udp_socket, PP_Resource addr, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Bind\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + AddProp(ss, "addr", ToString_PP_Resource(addr)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_UDPSocket_1_0*)RealGetInterface("PPB_UDPSocket;1.0"))->Bind(udp_socket, addr, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource GetBoundAddress_1_0(PP_Resource udp_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetBoundAddress\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_UDPSocket_1_0*)RealGetInterface("PPB_UDPSocket;1.0"))->GetBoundAddress(udp_socket); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t RecvFrom_1_0(PP_Resource udp_socket, char* buffer, int32_t num_bytes, PP_Resource* addr, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"RecvFrom\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + AddProp(ss, "buffer", PointerToString(buffer)); + AddProp(ss, "num_bytes", ToString_int32_t(num_bytes)); + AddProp(ss, "addr", PointerToString(addr)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_str_t(iterator, buffer); + iterator.skip(); + FromJSON_PP_Resource(iterator, *addr); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_UDPSocket_1_0*)RealGetInterface("PPB_UDPSocket;1.0"))->RecvFrom(udp_socket, buffer, num_bytes, addr, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + AddProp(os, "buffer", ToString_str_t(buffer)); + if (!!addr) { + AddProp(os, "addr", ToString_PP_Resource(addr)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SendTo_1_0(PP_Resource udp_socket, const char* buffer, int32_t num_bytes, PP_Resource addr, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"SendTo\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + AddProp(ss, "buffer", ToString_str_t(buffer)); + AddProp(ss, "num_bytes", ToString_int32_t(num_bytes)); + AddProp(ss, "addr", ToString_PP_Resource(addr)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_UDPSocket_1_0*)RealGetInterface("PPB_UDPSocket;1.0"))->SendTo(udp_socket, buffer, num_bytes, addr, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void Close_1_0(PP_Resource udp_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Close\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_UDPSocket_1_0*)RealGetInterface("PPB_UDPSocket;1.0"))->Close(udp_socket); +#endif // !INTERPOSE +} +static int32_t SetOption_1_0(PP_Resource udp_socket, PP_UDPSocket_Option name, struct PP_Var value, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"SetOption\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + AddProp(ss, "name", ToString_PP_UDPSocket_Option(name)); + AddProp(ss, "value", ToString_PP_Var(value)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_UDPSocket_1_0*)RealGetInterface("PPB_UDPSocket;1.0"))->SetOption(udp_socket, name, value, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping SetOption */ +/* skipping SetOption */ +/* skipping JoinGroup */ +/* skipping LeaveGroup */ +} +static PPB_UDPSocket_1_0 _PPB_UDPSocket_1_0 = { + ns_PPB_UDPSocket_1_0::Create_1_0, + ns_PPB_UDPSocket_1_0::IsUDPSocket_1_0, + ns_PPB_UDPSocket_1_0::Bind_1_0, + ns_PPB_UDPSocket_1_0::GetBoundAddress_1_0, + ns_PPB_UDPSocket_1_0::RecvFrom_1_0, + ns_PPB_UDPSocket_1_0::SendTo_1_0, + ns_PPB_UDPSocket_1_0::Close_1_0, + ns_PPB_UDPSocket_1_0::SetOption_1_0, +}; +const string ToString_PPB_UDPSocket(const PPB_UDPSocket_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_UDPSocket_1_1 { +static PP_Resource Create_1_1(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_UDPSocket_1_1*)RealGetInterface("PPB_UDPSocket;1.1"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsUDPSocket_1_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"IsUDPSocket\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_UDPSocket_1_1*)RealGetInterface("PPB_UDPSocket;1.1"))->IsUDPSocket(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Bind_1_1(PP_Resource udp_socket, PP_Resource addr, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Bind\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + AddProp(ss, "addr", ToString_PP_Resource(addr)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_UDPSocket_1_1*)RealGetInterface("PPB_UDPSocket;1.1"))->Bind(udp_socket, addr, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource GetBoundAddress_1_1(PP_Resource udp_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"GetBoundAddress\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_UDPSocket_1_1*)RealGetInterface("PPB_UDPSocket;1.1"))->GetBoundAddress(udp_socket); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t RecvFrom_1_1(PP_Resource udp_socket, char* buffer, int32_t num_bytes, PP_Resource* addr, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"RecvFrom\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + AddProp(ss, "buffer", PointerToString(buffer)); + AddProp(ss, "num_bytes", ToString_int32_t(num_bytes)); + AddProp(ss, "addr", PointerToString(addr)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_str_t(iterator, buffer); + iterator.skip(); + FromJSON_PP_Resource(iterator, *addr); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_UDPSocket_1_1*)RealGetInterface("PPB_UDPSocket;1.1"))->RecvFrom(udp_socket, buffer, num_bytes, addr, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + AddProp(os, "buffer", ToString_str_t(buffer)); + if (!!addr) { + AddProp(os, "addr", ToString_PP_Resource(addr)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SendTo_1_1(PP_Resource udp_socket, const char* buffer, int32_t num_bytes, PP_Resource addr, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"SendTo\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + AddProp(ss, "buffer", ToString_str_t(buffer)); + AddProp(ss, "num_bytes", ToString_int32_t(num_bytes)); + AddProp(ss, "addr", ToString_PP_Resource(addr)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_UDPSocket_1_1*)RealGetInterface("PPB_UDPSocket;1.1"))->SendTo(udp_socket, buffer, num_bytes, addr, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void Close_1_1(PP_Resource udp_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Close\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_UDPSocket_1_1*)RealGetInterface("PPB_UDPSocket;1.1"))->Close(udp_socket); +#endif // !INTERPOSE +} +/* skipping SetOption */ +static int32_t SetOption_1_1(PP_Resource udp_socket, PP_UDPSocket_Option name, struct PP_Var value, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"SetOption\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + AddProp(ss, "name", ToString_PP_UDPSocket_Option(name)); + AddProp(ss, "value", ToString_PP_Var(value)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_UDPSocket_1_1*)RealGetInterface("PPB_UDPSocket;1.1"))->SetOption(udp_socket, name, value, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping SetOption */ +/* skipping JoinGroup */ +/* skipping LeaveGroup */ +} +static PPB_UDPSocket_1_1 _PPB_UDPSocket_1_1 = { + ns_PPB_UDPSocket_1_1::Create_1_1, + ns_PPB_UDPSocket_1_1::IsUDPSocket_1_1, + ns_PPB_UDPSocket_1_1::Bind_1_1, + ns_PPB_UDPSocket_1_1::GetBoundAddress_1_1, + ns_PPB_UDPSocket_1_1::RecvFrom_1_1, + ns_PPB_UDPSocket_1_1::SendTo_1_1, + ns_PPB_UDPSocket_1_1::Close_1_1, + ns_PPB_UDPSocket_1_1::SetOption_1_1, +}; +const string ToString_PPB_UDPSocket(const PPB_UDPSocket_1_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_UDPSocket_1_2 { +static PP_Resource Create_1_2(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_UDPSocket_1_2*)RealGetInterface("PPB_UDPSocket;1.2"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsUDPSocket_1_2(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"IsUDPSocket\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_UDPSocket_1_2*)RealGetInterface("PPB_UDPSocket;1.2"))->IsUDPSocket(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Bind_1_2(PP_Resource udp_socket, PP_Resource addr, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"Bind\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + AddProp(ss, "addr", ToString_PP_Resource(addr)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_UDPSocket_1_2*)RealGetInterface("PPB_UDPSocket;1.2"))->Bind(udp_socket, addr, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource GetBoundAddress_1_2(PP_Resource udp_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"GetBoundAddress\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_UDPSocket_1_2*)RealGetInterface("PPB_UDPSocket;1.2"))->GetBoundAddress(udp_socket); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t RecvFrom_1_2(PP_Resource udp_socket, char* buffer, int32_t num_bytes, PP_Resource* addr, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"RecvFrom\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + AddProp(ss, "buffer", PointerToString(buffer)); + AddProp(ss, "num_bytes", ToString_int32_t(num_bytes)); + AddProp(ss, "addr", PointerToString(addr)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_str_t(iterator, buffer); + iterator.skip(); + FromJSON_PP_Resource(iterator, *addr); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_UDPSocket_1_2*)RealGetInterface("PPB_UDPSocket;1.2"))->RecvFrom(udp_socket, buffer, num_bytes, addr, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + AddProp(os, "buffer", ToString_str_t(buffer)); + if (!!addr) { + AddProp(os, "addr", ToString_PP_Resource(addr)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SendTo_1_2(PP_Resource udp_socket, const char* buffer, int32_t num_bytes, PP_Resource addr, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"SendTo\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + AddProp(ss, "buffer", ToString_str_t(buffer)); + AddProp(ss, "num_bytes", ToString_int32_t(num_bytes)); + AddProp(ss, "addr", ToString_PP_Resource(addr)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_UDPSocket_1_2*)RealGetInterface("PPB_UDPSocket;1.2"))->SendTo(udp_socket, buffer, num_bytes, addr, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void Close_1_2(PP_Resource udp_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"Close\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_UDPSocket_1_2*)RealGetInterface("PPB_UDPSocket;1.2"))->Close(udp_socket); +#endif // !INTERPOSE +} +/* skipping SetOption */ +/* skipping SetOption */ +static int32_t SetOption_1_2(PP_Resource udp_socket, PP_UDPSocket_Option name, struct PP_Var value, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"SetOption\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + AddProp(ss, "name", ToString_PP_UDPSocket_Option(name)); + AddProp(ss, "value", ToString_PP_Var(value)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_UDPSocket_1_2*)RealGetInterface("PPB_UDPSocket;1.2"))->SetOption(udp_socket, name, value, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t JoinGroup_1_2(PP_Resource udp_socket, PP_Resource group, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"JoinGroup\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + AddProp(ss, "group", ToString_PP_Resource(group)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_UDPSocket_1_2*)RealGetInterface("PPB_UDPSocket;1.2"))->JoinGroup(udp_socket, group, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t LeaveGroup_1_2(PP_Resource udp_socket, PP_Resource group, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"LeaveGroup\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + AddProp(ss, "group", ToString_PP_Resource(group)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_UDPSocket_1_2*)RealGetInterface("PPB_UDPSocket;1.2"))->LeaveGroup(udp_socket, group, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_UDPSocket_1_2 _PPB_UDPSocket_1_2 = { + ns_PPB_UDPSocket_1_2::Create_1_2, + ns_PPB_UDPSocket_1_2::IsUDPSocket_1_2, + ns_PPB_UDPSocket_1_2::Bind_1_2, + ns_PPB_UDPSocket_1_2::GetBoundAddress_1_2, + ns_PPB_UDPSocket_1_2::RecvFrom_1_2, + ns_PPB_UDPSocket_1_2::SendTo_1_2, + ns_PPB_UDPSocket_1_2::Close_1_2, + ns_PPB_UDPSocket_1_2::SetOption_1_2, + ns_PPB_UDPSocket_1_2::JoinGroup_1_2, + ns_PPB_UDPSocket_1_2::LeaveGroup_1_2, +}; +const string ToString_PPB_UDPSocket(const PPB_UDPSocket_1_2 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_URLLoader_1_0 { +static PP_Resource Create_1_0(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLLoader\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_URLLoader_1_0*)RealGetInterface("PPB_URLLoader;1.0"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsURLLoader_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLLoader\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsURLLoader\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_URLLoader_1_0*)RealGetInterface("PPB_URLLoader;1.0"))->IsURLLoader(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Open_1_0(PP_Resource loader, PP_Resource request_info, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLLoader\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Open\""); + AddProp(ss, "loader", ToString_PP_Resource(loader)); + AddProp(ss, "request_info", ToString_PP_Resource(request_info)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_URLLoader_1_0*)RealGetInterface("PPB_URLLoader;1.0"))->Open(loader, request_info, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t FollowRedirect_1_0(PP_Resource loader, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLLoader\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"FollowRedirect\""); + AddProp(ss, "loader", ToString_PP_Resource(loader)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_URLLoader_1_0*)RealGetInterface("PPB_URLLoader;1.0"))->FollowRedirect(loader, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetUploadProgress_1_0(PP_Resource loader, int64_t* bytes_sent, int64_t* total_bytes_to_be_sent) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLLoader\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetUploadProgress\""); + AddProp(ss, "loader", ToString_PP_Resource(loader)); + AddProp(ss, "bytes_sent", PointerToString(bytes_sent)); + AddProp(ss, "total_bytes_to_be_sent", PointerToString(total_bytes_to_be_sent)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_int64_t(iterator, *bytes_sent); + iterator.skip(); + FromJSON_int64_t(iterator, *total_bytes_to_be_sent); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_URLLoader_1_0*)RealGetInterface("PPB_URLLoader;1.0"))->GetUploadProgress(loader, bytes_sent, total_bytes_to_be_sent); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!bytes_sent) { + AddProp(os, "bytes_sent", ToString_int64_t(bytes_sent)); + } + if (!!total_bytes_to_be_sent) { + AddProp(os, "total_bytes_to_be_sent", ToString_int64_t(total_bytes_to_be_sent)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetDownloadProgress_1_0(PP_Resource loader, int64_t* bytes_received, int64_t* total_bytes_to_be_received) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLLoader\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetDownloadProgress\""); + AddProp(ss, "loader", ToString_PP_Resource(loader)); + AddProp(ss, "bytes_received", PointerToString(bytes_received)); + AddProp(ss, "total_bytes_to_be_received", PointerToString(total_bytes_to_be_received)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_int64_t(iterator, *bytes_received); + iterator.skip(); + FromJSON_int64_t(iterator, *total_bytes_to_be_received); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_URLLoader_1_0*)RealGetInterface("PPB_URLLoader;1.0"))->GetDownloadProgress(loader, bytes_received, total_bytes_to_be_received); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!bytes_received) { + AddProp(os, "bytes_received", ToString_int64_t(bytes_received)); + } + if (!!total_bytes_to_be_received) { + AddProp(os, "total_bytes_to_be_received", ToString_int64_t(total_bytes_to_be_received)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource GetResponseInfo_1_0(PP_Resource loader) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLLoader\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetResponseInfo\""); + AddProp(ss, "loader", ToString_PP_Resource(loader)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_URLLoader_1_0*)RealGetInterface("PPB_URLLoader;1.0"))->GetResponseInfo(loader); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t ReadResponseBody_1_0(PP_Resource loader, void* buffer, int32_t bytes_to_read, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLLoader\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"ReadResponseBody\""); + AddProp(ss, "loader", ToString_PP_Resource(loader)); + AddProp(ss, "buffer", PointerToString(buffer)); + AddProp(ss, "bytes_to_read", ToString_int32_t(bytes_to_read)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_mem_t(iterator, buffer); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_URLLoader_1_0*)RealGetInterface("PPB_URLLoader;1.0"))->ReadResponseBody(loader, buffer, bytes_to_read, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + AddProp(os, "buffer", ToString_mem_t(buffer)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t FinishStreamingToFile_1_0(PP_Resource loader, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLLoader\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"FinishStreamingToFile\""); + AddProp(ss, "loader", ToString_PP_Resource(loader)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_URLLoader_1_0*)RealGetInterface("PPB_URLLoader;1.0"))->FinishStreamingToFile(loader, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void Close_1_0(PP_Resource loader) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLLoader\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Close\""); + AddProp(ss, "loader", ToString_PP_Resource(loader)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_URLLoader_1_0*)RealGetInterface("PPB_URLLoader;1.0"))->Close(loader); +#endif // !INTERPOSE +} +} +static PPB_URLLoader_1_0 _PPB_URLLoader_1_0 = { + ns_PPB_URLLoader_1_0::Create_1_0, + ns_PPB_URLLoader_1_0::IsURLLoader_1_0, + ns_PPB_URLLoader_1_0::Open_1_0, + ns_PPB_URLLoader_1_0::FollowRedirect_1_0, + ns_PPB_URLLoader_1_0::GetUploadProgress_1_0, + ns_PPB_URLLoader_1_0::GetDownloadProgress_1_0, + ns_PPB_URLLoader_1_0::GetResponseInfo_1_0, + ns_PPB_URLLoader_1_0::ReadResponseBody_1_0, + ns_PPB_URLLoader_1_0::FinishStreamingToFile_1_0, + ns_PPB_URLLoader_1_0::Close_1_0, +}; +const string ToString_PPB_URLLoader(const PPB_URLLoader_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_URLRequestProperty(const PP_URLRequestProperty *v) { + switch (*v) { + case 0: + return "\"PP_URLREQUESTPROPERTY_URL\""; + case 1: + return "\"PP_URLREQUESTPROPERTY_METHOD\""; + case 2: + return "\"PP_URLREQUESTPROPERTY_HEADERS\""; + case 3: + return "\"PP_URLREQUESTPROPERTY_STREAMTOFILE\""; + case 4: + return "\"PP_URLREQUESTPROPERTY_FOLLOWREDIRECTS\""; + case 5: + return "\"PP_URLREQUESTPROPERTY_RECORDDOWNLOADPROGRESS\""; + case 6: + return "\"PP_URLREQUESTPROPERTY_RECORDUPLOADPROGRESS\""; + case 7: + return "\"PP_URLREQUESTPROPERTY_CUSTOMREFERRERURL\""; + case 8: + return "\"PP_URLREQUESTPROPERTY_ALLOWCROSSORIGINREQUESTS\""; + case 9: + return "\"PP_URLREQUESTPROPERTY_ALLOWCREDENTIALS\""; + case 10: + return "\"PP_URLREQUESTPROPERTY_CUSTOMCONTENTTRANSFERENCODING\""; + case 11: + return "\"PP_URLREQUESTPROPERTY_PREFETCHBUFFERUPPERTHRESHOLD\""; + case 12: + return "\"PP_URLREQUESTPROPERTY_PREFETCHBUFFERLOWERTHRESHOLD\""; + case 13: + return "\"PP_URLREQUESTPROPERTY_CUSTOMUSERAGENT\""; + default: + return "\"???\""; + } +} +const string ToString_PP_URLRequestProperty(const PP_URLRequestProperty &v) { + return ToString_PP_URLRequestProperty(&v); +} +void FromJSON_PP_URLRequestProperty(JSONIterator& iterator, PP_URLRequestProperty &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_URLRequestProperty(v); +} +namespace ns_PPB_URLRequestInfo_1_0 { +static PP_Resource Create_1_0(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLRequestInfo\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_URLRequestInfo_1_0*)RealGetInterface("PPB_URLRequestInfo;1.0"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsURLRequestInfo_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLRequestInfo\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsURLRequestInfo\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_URLRequestInfo_1_0*)RealGetInterface("PPB_URLRequestInfo;1.0"))->IsURLRequestInfo(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool SetProperty_1_0(PP_Resource request, PP_URLRequestProperty property, struct PP_Var value) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLRequestInfo\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"SetProperty\""); + AddProp(ss, "request", ToString_PP_Resource(request)); + AddProp(ss, "property", ToString_PP_URLRequestProperty(property)); + AddProp(ss, "value", ToString_PP_Var(value)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_URLRequestInfo_1_0*)RealGetInterface("PPB_URLRequestInfo;1.0"))->SetProperty(request, property, value); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool AppendDataToBody_1_0(PP_Resource request, const void* data, uint32_t len) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLRequestInfo\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"AppendDataToBody\""); + AddProp(ss, "request", ToString_PP_Resource(request)); + AddProp(ss, "data", ToString_mem_t(data)); + AddProp(ss, "len", ToString_uint32_t(len)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_URLRequestInfo_1_0*)RealGetInterface("PPB_URLRequestInfo;1.0"))->AppendDataToBody(request, data, len); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool AppendFileToBody_1_0(PP_Resource request, PP_Resource file_ref, int64_t start_offset, int64_t number_of_bytes, PP_Time expected_last_modified_time) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLRequestInfo\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"AppendFileToBody\""); + AddProp(ss, "request", ToString_PP_Resource(request)); + AddProp(ss, "file_ref", ToString_PP_Resource(file_ref)); + AddProp(ss, "start_offset", ToString_int64_t(start_offset)); + AddProp(ss, "number_of_bytes", ToString_int64_t(number_of_bytes)); + AddProp(ss, "expected_last_modified_time", ToString_PP_Time(expected_last_modified_time)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_URLRequestInfo_1_0*)RealGetInterface("PPB_URLRequestInfo;1.0"))->AppendFileToBody(request, file_ref, start_offset, number_of_bytes, expected_last_modified_time); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_URLRequestInfo_1_0 _PPB_URLRequestInfo_1_0 = { + ns_PPB_URLRequestInfo_1_0::Create_1_0, + ns_PPB_URLRequestInfo_1_0::IsURLRequestInfo_1_0, + ns_PPB_URLRequestInfo_1_0::SetProperty_1_0, + ns_PPB_URLRequestInfo_1_0::AppendDataToBody_1_0, + ns_PPB_URLRequestInfo_1_0::AppendFileToBody_1_0, +}; +const string ToString_PPB_URLRequestInfo(const PPB_URLRequestInfo_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_URLResponseProperty(const PP_URLResponseProperty *v) { + switch (*v) { + case 0: + return "\"PP_URLRESPONSEPROPERTY_URL\""; + case 1: + return "\"PP_URLRESPONSEPROPERTY_REDIRECTURL\""; + case 2: + return "\"PP_URLRESPONSEPROPERTY_REDIRECTMETHOD\""; + case 3: + return "\"PP_URLRESPONSEPROPERTY_STATUSCODE\""; + case 4: + return "\"PP_URLRESPONSEPROPERTY_STATUSLINE\""; + case 5: + return "\"PP_URLRESPONSEPROPERTY_HEADERS\""; + default: + return "\"???\""; + } +} +const string ToString_PP_URLResponseProperty(const PP_URLResponseProperty &v) { + return ToString_PP_URLResponseProperty(&v); +} +void FromJSON_PP_URLResponseProperty(JSONIterator& iterator, PP_URLResponseProperty &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_URLResponseProperty(v); +} +namespace ns_PPB_URLResponseInfo_1_0 { +static PP_Bool IsURLResponseInfo_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLResponseInfo\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsURLResponseInfo\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_URLResponseInfo_1_0*)RealGetInterface("PPB_URLResponseInfo;1.0"))->IsURLResponseInfo(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetProperty_1_0(PP_Resource response, PP_URLResponseProperty property) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLResponseInfo\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetProperty\""); + AddProp(ss, "response", ToString_PP_Resource(response)); + AddProp(ss, "property", ToString_PP_URLResponseProperty(property)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_URLResponseInfo_1_0*)RealGetInterface("PPB_URLResponseInfo;1.0"))->GetProperty(response, property); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource GetBodyAsFileRef_1_0(PP_Resource response) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLResponseInfo\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetBodyAsFileRef\""); + AddProp(ss, "response", ToString_PP_Resource(response)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_URLResponseInfo_1_0*)RealGetInterface("PPB_URLResponseInfo;1.0"))->GetBodyAsFileRef(response); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_URLResponseInfo_1_0 _PPB_URLResponseInfo_1_0 = { + ns_PPB_URLResponseInfo_1_0::IsURLResponseInfo_1_0, + ns_PPB_URLResponseInfo_1_0::GetProperty_1_0, + ns_PPB_URLResponseInfo_1_0::GetBodyAsFileRef_1_0, +}; +const string ToString_PPB_URLResponseInfo(const PPB_URLResponseInfo_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Var_1_0 { +static void AddRef_1_0(struct PP_Var var) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Var\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"AddRef\""); + AddProp(ss, "var", ToString_PP_Var(var)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Var_1_0*)RealGetInterface("PPB_Var;1.0"))->AddRef(var); +#endif // !INTERPOSE +} +static void Release_1_0(struct PP_Var var) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Var\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Release\""); + AddProp(ss, "var", ToString_PP_Var(var)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Var_1_0*)RealGetInterface("PPB_Var;1.0"))->Release(var); +#endif // !INTERPOSE +} +static struct PP_Var VarFromUtf8_1_0(PP_Module module, const char* data, uint32_t len) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Var\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"VarFromUtf8\""); + AddProp(ss, "module", ToString_PP_Module(module)); + AddProp(ss, "data", ToString_str_t(data)); + AddProp(ss, "len", ToString_uint32_t(len)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Var_1_0*)RealGetInterface("PPB_Var;1.0"))->VarFromUtf8(module, data, len); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping VarFromUtf8 */ +static const char* VarToUtf8_1_0(struct PP_Var var, uint32_t* len) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Var\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"VarToUtf8\""); + AddProp(ss, "var", ToString_PP_Var(var)); + AddProp(ss, "len", PointerToString(len)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + char* rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_str_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_uint32_t(iterator, *len); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + const char* rval = ((PPB_Var_1_0*)RealGetInterface("PPB_Var;1.0"))->VarToUtf8(var, len); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_str_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!len) { + AddProp(os, "len", ToString_uint32_t(len)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping VarToResource */ +/* skipping VarFromResource */ +} +static PPB_Var_1_0 _PPB_Var_1_0 = { + ns_PPB_Var_1_0::AddRef_1_0, + ns_PPB_Var_1_0::Release_1_0, + ns_PPB_Var_1_0::VarFromUtf8_1_0, + ns_PPB_Var_1_0::VarToUtf8_1_0, +}; +const string ToString_PPB_Var(const PPB_Var_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Var_1_1 { +static void AddRef_1_1(struct PP_Var var) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Var\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"AddRef\""); + AddProp(ss, "var", ToString_PP_Var(var)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Var_1_1*)RealGetInterface("PPB_Var;1.1"))->AddRef(var); +#endif // !INTERPOSE +} +static void Release_1_1(struct PP_Var var) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Var\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Release\""); + AddProp(ss, "var", ToString_PP_Var(var)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Var_1_1*)RealGetInterface("PPB_Var;1.1"))->Release(var); +#endif // !INTERPOSE +} +/* skipping VarFromUtf8 */ +static struct PP_Var VarFromUtf8_1_1(const char* data, uint32_t len) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Var\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"VarFromUtf8\""); + AddProp(ss, "data", ToString_str_t(data)); + AddProp(ss, "len", ToString_uint32_t(len)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Var_1_1*)RealGetInterface("PPB_Var;1.1"))->VarFromUtf8(data, len); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static const char* VarToUtf8_1_1(struct PP_Var var, uint32_t* len) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Var\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"VarToUtf8\""); + AddProp(ss, "var", ToString_PP_Var(var)); + AddProp(ss, "len", PointerToString(len)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + char* rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_str_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_uint32_t(iterator, *len); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + const char* rval = ((PPB_Var_1_1*)RealGetInterface("PPB_Var;1.1"))->VarToUtf8(var, len); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_str_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!len) { + AddProp(os, "len", ToString_uint32_t(len)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping VarToResource */ +/* skipping VarFromResource */ +} +static PPB_Var_1_1 _PPB_Var_1_1 = { + ns_PPB_Var_1_1::AddRef_1_1, + ns_PPB_Var_1_1::Release_1_1, + ns_PPB_Var_1_1::VarFromUtf8_1_1, + ns_PPB_Var_1_1::VarToUtf8_1_1, +}; +const string ToString_PPB_Var(const PPB_Var_1_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Var_1_2 { +static void AddRef_1_2(struct PP_Var var) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Var\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"AddRef\""); + AddProp(ss, "var", ToString_PP_Var(var)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Var_1_2*)RealGetInterface("PPB_Var;1.2"))->AddRef(var); +#endif // !INTERPOSE +} +static void Release_1_2(struct PP_Var var) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Var\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"Release\""); + AddProp(ss, "var", ToString_PP_Var(var)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Var_1_2*)RealGetInterface("PPB_Var;1.2"))->Release(var); +#endif // !INTERPOSE +} +/* skipping VarFromUtf8 */ +static struct PP_Var VarFromUtf8_1_2(const char* data, uint32_t len) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Var\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"VarFromUtf8\""); + AddProp(ss, "data", ToString_str_t(data)); + AddProp(ss, "len", ToString_uint32_t(len)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Var_1_2*)RealGetInterface("PPB_Var;1.2"))->VarFromUtf8(data, len); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static const char* VarToUtf8_1_2(struct PP_Var var, uint32_t* len) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Var\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"VarToUtf8\""); + AddProp(ss, "var", ToString_PP_Var(var)); + AddProp(ss, "len", PointerToString(len)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + char* rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_str_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_uint32_t(iterator, *len); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + const char* rval = ((PPB_Var_1_2*)RealGetInterface("PPB_Var;1.2"))->VarToUtf8(var, len); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_str_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!len) { + AddProp(os, "len", ToString_uint32_t(len)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource VarToResource_1_2(struct PP_Var var) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Var\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"VarToResource\""); + AddProp(ss, "var", ToString_PP_Var(var)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Var_1_2*)RealGetInterface("PPB_Var;1.2"))->VarToResource(var); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var VarFromResource_1_2(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Var\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"VarFromResource\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Var_1_2*)RealGetInterface("PPB_Var;1.2"))->VarFromResource(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_Var_1_2 _PPB_Var_1_2 = { + ns_PPB_Var_1_2::AddRef_1_2, + ns_PPB_Var_1_2::Release_1_2, + ns_PPB_Var_1_2::VarFromUtf8_1_2, + ns_PPB_Var_1_2::VarToUtf8_1_2, + ns_PPB_Var_1_2::VarToResource_1_2, + ns_PPB_Var_1_2::VarFromResource_1_2, +}; +const string ToString_PPB_Var(const PPB_Var_1_2 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_VarArray_1_0 { +static struct PP_Var Create_1_0(void) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VarArray\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Create\""); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_VarArray_1_0*)RealGetInterface("PPB_VarArray;1.0"))->Create(); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var Get_1_0(struct PP_Var array, uint32_t index) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VarArray\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Get\""); + AddProp(ss, "array", ToString_PP_Var(array)); + AddProp(ss, "index", ToString_uint32_t(index)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_VarArray_1_0*)RealGetInterface("PPB_VarArray;1.0"))->Get(array, index); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool Set_1_0(struct PP_Var array, uint32_t index, struct PP_Var value) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VarArray\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Set\""); + AddProp(ss, "array", ToString_PP_Var(array)); + AddProp(ss, "index", ToString_uint32_t(index)); + AddProp(ss, "value", ToString_PP_Var(value)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_VarArray_1_0*)RealGetInterface("PPB_VarArray;1.0"))->Set(array, index, value); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint32_t GetLength_1_0(struct PP_Var array) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VarArray\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetLength\""); + AddProp(ss, "array", ToString_PP_Var(array)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint32_t rval = ((PPB_VarArray_1_0*)RealGetInterface("PPB_VarArray;1.0"))->GetLength(array); + printf("RPC response: ["); + printf("%s", ToString_uint32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool SetLength_1_0(struct PP_Var array, uint32_t length) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VarArray\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"SetLength\""); + AddProp(ss, "array", ToString_PP_Var(array)); + AddProp(ss, "length", ToString_uint32_t(length)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_VarArray_1_0*)RealGetInterface("PPB_VarArray;1.0"))->SetLength(array, length); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_VarArray_1_0 _PPB_VarArray_1_0 = { + ns_PPB_VarArray_1_0::Create_1_0, + ns_PPB_VarArray_1_0::Get_1_0, + ns_PPB_VarArray_1_0::Set_1_0, + ns_PPB_VarArray_1_0::GetLength_1_0, + ns_PPB_VarArray_1_0::SetLength_1_0, +}; +const string ToString_PPB_VarArray(const PPB_VarArray_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_VarArrayBuffer_1_0 { +static struct PP_Var Create_1_0(uint32_t size_in_bytes) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VarArrayBuffer\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "size_in_bytes", ToString_uint32_t(size_in_bytes)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_VarArrayBuffer_1_0*)RealGetInterface("PPB_VarArrayBuffer;1.0"))->Create(size_in_bytes); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool ByteLength_1_0(struct PP_Var array, uint32_t* byte_length) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VarArrayBuffer\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"ByteLength\""); + AddProp(ss, "array", ToString_PP_Var(array)); + AddProp(ss, "byte_length", PointerToString(byte_length)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_uint32_t(iterator, *byte_length); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_VarArrayBuffer_1_0*)RealGetInterface("PPB_VarArrayBuffer;1.0"))->ByteLength(array, byte_length); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!byte_length) { + AddProp(os, "byte_length", ToString_uint32_t(byte_length)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void* Map_1_0(struct PP_Var array) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VarArrayBuffer\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Map\""); + AddProp(ss, "array", ToString_PP_Var(array)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + void* rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_mem_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + void* rval = ((PPB_VarArrayBuffer_1_0*)RealGetInterface("PPB_VarArrayBuffer;1.0"))->Map(array); + printf("RPC response: ["); + printf("%s", ToString_mem_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void Unmap_1_0(struct PP_Var array) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VarArrayBuffer\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Unmap\""); + AddProp(ss, "array", ToString_PP_Var(array)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_VarArrayBuffer_1_0*)RealGetInterface("PPB_VarArrayBuffer;1.0"))->Unmap(array); +#endif // !INTERPOSE +} +} +static PPB_VarArrayBuffer_1_0 _PPB_VarArrayBuffer_1_0 = { + ns_PPB_VarArrayBuffer_1_0::Create_1_0, + ns_PPB_VarArrayBuffer_1_0::ByteLength_1_0, + ns_PPB_VarArrayBuffer_1_0::Map_1_0, + ns_PPB_VarArrayBuffer_1_0::Unmap_1_0, +}; +const string ToString_PPB_VarArrayBuffer(const PPB_VarArrayBuffer_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_VarDictionary_1_0 { +static struct PP_Var Create_1_0(void) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VarDictionary\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Create\""); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_VarDictionary_1_0*)RealGetInterface("PPB_VarDictionary;1.0"))->Create(); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var Get_1_0(struct PP_Var dict, struct PP_Var key) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VarDictionary\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Get\""); + AddProp(ss, "dict", ToString_PP_Var(dict)); + AddProp(ss, "key", ToString_PP_Var(key)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_VarDictionary_1_0*)RealGetInterface("PPB_VarDictionary;1.0"))->Get(dict, key); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool Set_1_0(struct PP_Var dict, struct PP_Var key, struct PP_Var value) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VarDictionary\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Set\""); + AddProp(ss, "dict", ToString_PP_Var(dict)); + AddProp(ss, "key", ToString_PP_Var(key)); + AddProp(ss, "value", ToString_PP_Var(value)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_VarDictionary_1_0*)RealGetInterface("PPB_VarDictionary;1.0"))->Set(dict, key, value); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void Delete_1_0(struct PP_Var dict, struct PP_Var key) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VarDictionary\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Delete\""); + AddProp(ss, "dict", ToString_PP_Var(dict)); + AddProp(ss, "key", ToString_PP_Var(key)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_VarDictionary_1_0*)RealGetInterface("PPB_VarDictionary;1.0"))->Delete(dict, key); +#endif // !INTERPOSE +} +static PP_Bool HasKey_1_0(struct PP_Var dict, struct PP_Var key) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VarDictionary\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"HasKey\""); + AddProp(ss, "dict", ToString_PP_Var(dict)); + AddProp(ss, "key", ToString_PP_Var(key)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_VarDictionary_1_0*)RealGetInterface("PPB_VarDictionary;1.0"))->HasKey(dict, key); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetKeys_1_0(struct PP_Var dict) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VarDictionary\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetKeys\""); + AddProp(ss, "dict", ToString_PP_Var(dict)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_VarDictionary_1_0*)RealGetInterface("PPB_VarDictionary;1.0"))->GetKeys(dict); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_VarDictionary_1_0 _PPB_VarDictionary_1_0 = { + ns_PPB_VarDictionary_1_0::Create_1_0, + ns_PPB_VarDictionary_1_0::Get_1_0, + ns_PPB_VarDictionary_1_0::Set_1_0, + ns_PPB_VarDictionary_1_0::Delete_1_0, + ns_PPB_VarDictionary_1_0::HasKey_1_0, + ns_PPB_VarDictionary_1_0::GetKeys_1_0, +}; +const string ToString_PPB_VarDictionary(const PPB_VarDictionary_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_VideoDecoder_0_1 { +static PP_Resource Create_0_1(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_VideoDecoder_0_1*)RealGetInterface("PPB_VideoDecoder;0.1"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsVideoDecoder_0_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"IsVideoDecoder\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_VideoDecoder_0_1*)RealGetInterface("PPB_VideoDecoder;0.1"))->IsVideoDecoder(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Initialize_0_1(PP_Resource video_decoder, PP_Resource graphics3d_context, PP_VideoProfile profile, PP_Bool allow_software_fallback, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Initialize\""); + AddProp(ss, "video_decoder", ToString_PP_Resource(video_decoder)); + AddProp(ss, "graphics3d_context", ToString_PP_Resource(graphics3d_context)); + AddProp(ss, "profile", ToString_PP_VideoProfile(profile)); + AddProp(ss, "allow_software_fallback", ToString_PP_Bool(allow_software_fallback)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoDecoder_0_1*)RealGetInterface("PPB_VideoDecoder;0.1"))->Initialize(video_decoder, graphics3d_context, profile, allow_software_fallback, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping Initialize */ +/* skipping Initialize */ +static int32_t Decode_0_1(PP_Resource video_decoder, uint32_t decode_id, uint32_t size, const void* buffer, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Decode\""); + AddProp(ss, "video_decoder", ToString_PP_Resource(video_decoder)); + AddProp(ss, "decode_id", ToString_uint32_t(decode_id)); + AddProp(ss, "size", ToString_uint32_t(size)); + AddProp(ss, "buffer", ToString_mem_t(buffer)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoDecoder_0_1*)RealGetInterface("PPB_VideoDecoder;0.1"))->Decode(video_decoder, decode_id, size, buffer, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetPicture_0_1(PP_Resource video_decoder, struct PP_VideoPicture_0_1* picture, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetPicture\""); + AddProp(ss, "video_decoder", ToString_PP_Resource(video_decoder)); + AddProp(ss, "picture", PointerToString(picture)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!picture) { + iterator.skip(); + FromJSON_PP_VideoPicture_0_1(iterator, *picture); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoDecoder_0_1*)RealGetInterface("PPB_VideoDecoder;0.1"))->GetPicture(video_decoder, picture, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!picture) { + AddProp(os, "picture", ToString_PP_VideoPicture_0_1(picture)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping GetPicture */ +static void RecyclePicture_0_1(PP_Resource video_decoder, const struct PP_VideoPicture* picture) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"RecyclePicture\""); + AddProp(ss, "video_decoder", ToString_PP_Resource(video_decoder)); + AddProp(ss, "picture", ToString_PP_VideoPicture(picture)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_VideoDecoder_0_1*)RealGetInterface("PPB_VideoDecoder;0.1"))->RecyclePicture(video_decoder, picture); +#endif // !INTERPOSE +} +static int32_t Flush_0_1(PP_Resource video_decoder, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Flush\""); + AddProp(ss, "video_decoder", ToString_PP_Resource(video_decoder)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoDecoder_0_1*)RealGetInterface("PPB_VideoDecoder;0.1"))->Flush(video_decoder, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Reset_0_1(PP_Resource video_decoder, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Reset\""); + AddProp(ss, "video_decoder", ToString_PP_Resource(video_decoder)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoDecoder_0_1*)RealGetInterface("PPB_VideoDecoder;0.1"))->Reset(video_decoder, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_VideoDecoder_0_1 _PPB_VideoDecoder_0_1 = { + ns_PPB_VideoDecoder_0_1::Create_0_1, + ns_PPB_VideoDecoder_0_1::IsVideoDecoder_0_1, + ns_PPB_VideoDecoder_0_1::Initialize_0_1, + ns_PPB_VideoDecoder_0_1::Decode_0_1, + ns_PPB_VideoDecoder_0_1::GetPicture_0_1, + ns_PPB_VideoDecoder_0_1::RecyclePicture_0_1, + ns_PPB_VideoDecoder_0_1::Flush_0_1, + ns_PPB_VideoDecoder_0_1::Reset_0_1, +}; +const string ToString_PPB_VideoDecoder(const PPB_VideoDecoder_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_VideoDecoder_0_2 { +static PP_Resource Create_0_2(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_VideoDecoder_0_2*)RealGetInterface("PPB_VideoDecoder;0.2"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsVideoDecoder_0_2(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"IsVideoDecoder\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_VideoDecoder_0_2*)RealGetInterface("PPB_VideoDecoder;0.2"))->IsVideoDecoder(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping Initialize */ +static int32_t Initialize_0_2(PP_Resource video_decoder, PP_Resource graphics3d_context, PP_VideoProfile profile, PP_HardwareAcceleration acceleration, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"Initialize\""); + AddProp(ss, "video_decoder", ToString_PP_Resource(video_decoder)); + AddProp(ss, "graphics3d_context", ToString_PP_Resource(graphics3d_context)); + AddProp(ss, "profile", ToString_PP_VideoProfile(profile)); + AddProp(ss, "acceleration", ToString_PP_HardwareAcceleration(acceleration)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoDecoder_0_2*)RealGetInterface("PPB_VideoDecoder;0.2"))->Initialize(video_decoder, graphics3d_context, profile, acceleration, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping Initialize */ +static int32_t Decode_0_2(PP_Resource video_decoder, uint32_t decode_id, uint32_t size, const void* buffer, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"Decode\""); + AddProp(ss, "video_decoder", ToString_PP_Resource(video_decoder)); + AddProp(ss, "decode_id", ToString_uint32_t(decode_id)); + AddProp(ss, "size", ToString_uint32_t(size)); + AddProp(ss, "buffer", ToString_mem_t(buffer)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoDecoder_0_2*)RealGetInterface("PPB_VideoDecoder;0.2"))->Decode(video_decoder, decode_id, size, buffer, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetPicture_0_2(PP_Resource video_decoder, struct PP_VideoPicture_0_1* picture, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"GetPicture\""); + AddProp(ss, "video_decoder", ToString_PP_Resource(video_decoder)); + AddProp(ss, "picture", PointerToString(picture)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!picture) { + iterator.skip(); + FromJSON_PP_VideoPicture_0_1(iterator, *picture); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoDecoder_0_2*)RealGetInterface("PPB_VideoDecoder;0.2"))->GetPicture(video_decoder, picture, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!picture) { + AddProp(os, "picture", ToString_PP_VideoPicture_0_1(picture)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping GetPicture */ +static void RecyclePicture_0_2(PP_Resource video_decoder, const struct PP_VideoPicture* picture) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"RecyclePicture\""); + AddProp(ss, "video_decoder", ToString_PP_Resource(video_decoder)); + AddProp(ss, "picture", ToString_PP_VideoPicture(picture)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_VideoDecoder_0_2*)RealGetInterface("PPB_VideoDecoder;0.2"))->RecyclePicture(video_decoder, picture); +#endif // !INTERPOSE +} +static int32_t Flush_0_2(PP_Resource video_decoder, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"Flush\""); + AddProp(ss, "video_decoder", ToString_PP_Resource(video_decoder)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoDecoder_0_2*)RealGetInterface("PPB_VideoDecoder;0.2"))->Flush(video_decoder, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Reset_0_2(PP_Resource video_decoder, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"Reset\""); + AddProp(ss, "video_decoder", ToString_PP_Resource(video_decoder)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoDecoder_0_2*)RealGetInterface("PPB_VideoDecoder;0.2"))->Reset(video_decoder, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_VideoDecoder_0_2 _PPB_VideoDecoder_0_2 = { + ns_PPB_VideoDecoder_0_2::Create_0_2, + ns_PPB_VideoDecoder_0_2::IsVideoDecoder_0_2, + ns_PPB_VideoDecoder_0_2::Initialize_0_2, + ns_PPB_VideoDecoder_0_2::Decode_0_2, + ns_PPB_VideoDecoder_0_2::GetPicture_0_2, + ns_PPB_VideoDecoder_0_2::RecyclePicture_0_2, + ns_PPB_VideoDecoder_0_2::Flush_0_2, + ns_PPB_VideoDecoder_0_2::Reset_0_2, +}; +const string ToString_PPB_VideoDecoder(const PPB_VideoDecoder_0_2 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_VideoDecoder_1_0 { +static PP_Resource Create_1_0(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_VideoDecoder_1_0*)RealGetInterface("PPB_VideoDecoder;1.0"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsVideoDecoder_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsVideoDecoder\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_VideoDecoder_1_0*)RealGetInterface("PPB_VideoDecoder;1.0"))->IsVideoDecoder(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping Initialize */ +static int32_t Initialize_1_0(PP_Resource video_decoder, PP_Resource graphics3d_context, PP_VideoProfile profile, PP_HardwareAcceleration acceleration, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Initialize\""); + AddProp(ss, "video_decoder", ToString_PP_Resource(video_decoder)); + AddProp(ss, "graphics3d_context", ToString_PP_Resource(graphics3d_context)); + AddProp(ss, "profile", ToString_PP_VideoProfile(profile)); + AddProp(ss, "acceleration", ToString_PP_HardwareAcceleration(acceleration)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoDecoder_1_0*)RealGetInterface("PPB_VideoDecoder;1.0"))->Initialize(video_decoder, graphics3d_context, profile, acceleration, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping Initialize */ +static int32_t Decode_1_0(PP_Resource video_decoder, uint32_t decode_id, uint32_t size, const void* buffer, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Decode\""); + AddProp(ss, "video_decoder", ToString_PP_Resource(video_decoder)); + AddProp(ss, "decode_id", ToString_uint32_t(decode_id)); + AddProp(ss, "size", ToString_uint32_t(size)); + AddProp(ss, "buffer", ToString_mem_t(buffer)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoDecoder_1_0*)RealGetInterface("PPB_VideoDecoder;1.0"))->Decode(video_decoder, decode_id, size, buffer, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping GetPicture */ +static int32_t GetPicture_1_0(PP_Resource video_decoder, struct PP_VideoPicture* picture, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetPicture\""); + AddProp(ss, "video_decoder", ToString_PP_Resource(video_decoder)); + AddProp(ss, "picture", PointerToString(picture)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!picture) { + iterator.skip(); + FromJSON_PP_VideoPicture(iterator, *picture); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoDecoder_1_0*)RealGetInterface("PPB_VideoDecoder;1.0"))->GetPicture(video_decoder, picture, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!picture) { + AddProp(os, "picture", ToString_PP_VideoPicture(picture)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void RecyclePicture_1_0(PP_Resource video_decoder, const struct PP_VideoPicture* picture) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"RecyclePicture\""); + AddProp(ss, "video_decoder", ToString_PP_Resource(video_decoder)); + AddProp(ss, "picture", ToString_PP_VideoPicture(picture)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_VideoDecoder_1_0*)RealGetInterface("PPB_VideoDecoder;1.0"))->RecyclePicture(video_decoder, picture); +#endif // !INTERPOSE +} +static int32_t Flush_1_0(PP_Resource video_decoder, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Flush\""); + AddProp(ss, "video_decoder", ToString_PP_Resource(video_decoder)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoDecoder_1_0*)RealGetInterface("PPB_VideoDecoder;1.0"))->Flush(video_decoder, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Reset_1_0(PP_Resource video_decoder, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Reset\""); + AddProp(ss, "video_decoder", ToString_PP_Resource(video_decoder)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoDecoder_1_0*)RealGetInterface("PPB_VideoDecoder;1.0"))->Reset(video_decoder, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_VideoDecoder_1_0 _PPB_VideoDecoder_1_0 = { + ns_PPB_VideoDecoder_1_0::Create_1_0, + ns_PPB_VideoDecoder_1_0::IsVideoDecoder_1_0, + ns_PPB_VideoDecoder_1_0::Initialize_1_0, + ns_PPB_VideoDecoder_1_0::Decode_1_0, + ns_PPB_VideoDecoder_1_0::GetPicture_1_0, + ns_PPB_VideoDecoder_1_0::RecyclePicture_1_0, + ns_PPB_VideoDecoder_1_0::Flush_1_0, + ns_PPB_VideoDecoder_1_0::Reset_1_0, +}; +const string ToString_PPB_VideoDecoder(const PPB_VideoDecoder_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_VideoDecoder_1_1 { +static PP_Resource Create_1_1(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_VideoDecoder_1_1*)RealGetInterface("PPB_VideoDecoder;1.1"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsVideoDecoder_1_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"IsVideoDecoder\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_VideoDecoder_1_1*)RealGetInterface("PPB_VideoDecoder;1.1"))->IsVideoDecoder(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping Initialize */ +/* skipping Initialize */ +static int32_t Initialize_1_1(PP_Resource video_decoder, PP_Resource graphics3d_context, PP_VideoProfile profile, PP_HardwareAcceleration acceleration, uint32_t min_picture_count, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Initialize\""); + AddProp(ss, "video_decoder", ToString_PP_Resource(video_decoder)); + AddProp(ss, "graphics3d_context", ToString_PP_Resource(graphics3d_context)); + AddProp(ss, "profile", ToString_PP_VideoProfile(profile)); + AddProp(ss, "acceleration", ToString_PP_HardwareAcceleration(acceleration)); + AddProp(ss, "min_picture_count", ToString_uint32_t(min_picture_count)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoDecoder_1_1*)RealGetInterface("PPB_VideoDecoder;1.1"))->Initialize(video_decoder, graphics3d_context, profile, acceleration, min_picture_count, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Decode_1_1(PP_Resource video_decoder, uint32_t decode_id, uint32_t size, const void* buffer, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Decode\""); + AddProp(ss, "video_decoder", ToString_PP_Resource(video_decoder)); + AddProp(ss, "decode_id", ToString_uint32_t(decode_id)); + AddProp(ss, "size", ToString_uint32_t(size)); + AddProp(ss, "buffer", ToString_mem_t(buffer)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoDecoder_1_1*)RealGetInterface("PPB_VideoDecoder;1.1"))->Decode(video_decoder, decode_id, size, buffer, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping GetPicture */ +static int32_t GetPicture_1_1(PP_Resource video_decoder, struct PP_VideoPicture* picture, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"GetPicture\""); + AddProp(ss, "video_decoder", ToString_PP_Resource(video_decoder)); + AddProp(ss, "picture", PointerToString(picture)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!picture) { + iterator.skip(); + FromJSON_PP_VideoPicture(iterator, *picture); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoDecoder_1_1*)RealGetInterface("PPB_VideoDecoder;1.1"))->GetPicture(video_decoder, picture, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!picture) { + AddProp(os, "picture", ToString_PP_VideoPicture(picture)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void RecyclePicture_1_1(PP_Resource video_decoder, const struct PP_VideoPicture* picture) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"RecyclePicture\""); + AddProp(ss, "video_decoder", ToString_PP_Resource(video_decoder)); + AddProp(ss, "picture", ToString_PP_VideoPicture(picture)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_VideoDecoder_1_1*)RealGetInterface("PPB_VideoDecoder;1.1"))->RecyclePicture(video_decoder, picture); +#endif // !INTERPOSE +} +static int32_t Flush_1_1(PP_Resource video_decoder, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Flush\""); + AddProp(ss, "video_decoder", ToString_PP_Resource(video_decoder)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoDecoder_1_1*)RealGetInterface("PPB_VideoDecoder;1.1"))->Flush(video_decoder, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Reset_1_1(PP_Resource video_decoder, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Reset\""); + AddProp(ss, "video_decoder", ToString_PP_Resource(video_decoder)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoDecoder_1_1*)RealGetInterface("PPB_VideoDecoder;1.1"))->Reset(video_decoder, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_VideoDecoder_1_1 _PPB_VideoDecoder_1_1 = { + ns_PPB_VideoDecoder_1_1::Create_1_1, + ns_PPB_VideoDecoder_1_1::IsVideoDecoder_1_1, + ns_PPB_VideoDecoder_1_1::Initialize_1_1, + ns_PPB_VideoDecoder_1_1::Decode_1_1, + ns_PPB_VideoDecoder_1_1::GetPicture_1_1, + ns_PPB_VideoDecoder_1_1::RecyclePicture_1_1, + ns_PPB_VideoDecoder_1_1::Flush_1_1, + ns_PPB_VideoDecoder_1_1::Reset_1_1, +}; +const string ToString_PPB_VideoDecoder(const PPB_VideoDecoder_1_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_VideoEncoder_0_1 { +static PP_Resource Create_0_1(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoEncoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_VideoEncoder_0_1*)RealGetInterface("PPB_VideoEncoder;0.1"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsVideoEncoder_0_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoEncoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"IsVideoEncoder\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_VideoEncoder_0_1*)RealGetInterface("PPB_VideoEncoder;0.1"))->IsVideoEncoder(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetSupportedProfiles_0_1(PP_Resource video_encoder, struct PP_ArrayOutput output, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoEncoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetSupportedProfiles\""); + AddProp(ss, "video_encoder", ToString_PP_Resource(video_encoder)); + AddProp(ss, "output", ToString_PP_ArrayOutput(output)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoEncoder_0_1*)RealGetInterface("PPB_VideoEncoder;0.1"))->GetSupportedProfiles(video_encoder, output, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping GetSupportedProfiles */ +static int32_t Initialize_0_1(PP_Resource video_encoder, PP_VideoFrame_Format input_format, const struct PP_Size* input_visible_size, PP_VideoProfile output_profile, uint32_t initial_bitrate, PP_HardwareAcceleration acceleration, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoEncoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Initialize\""); + AddProp(ss, "video_encoder", ToString_PP_Resource(video_encoder)); + AddProp(ss, "input_format", ToString_PP_VideoFrame_Format(input_format)); + AddProp(ss, "input_visible_size", ToString_PP_Size(input_visible_size)); + AddProp(ss, "output_profile", ToString_PP_VideoProfile(output_profile)); + AddProp(ss, "initial_bitrate", ToString_uint32_t(initial_bitrate)); + AddProp(ss, "acceleration", ToString_PP_HardwareAcceleration(acceleration)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoEncoder_0_1*)RealGetInterface("PPB_VideoEncoder;0.1"))->Initialize(video_encoder, input_format, input_visible_size, output_profile, initial_bitrate, acceleration, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetFramesRequired_0_1(PP_Resource video_encoder) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoEncoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetFramesRequired\""); + AddProp(ss, "video_encoder", ToString_PP_Resource(video_encoder)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_VideoEncoder_0_1*)RealGetInterface("PPB_VideoEncoder;0.1"))->GetFramesRequired(video_encoder); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetFrameCodedSize_0_1(PP_Resource video_encoder, struct PP_Size* coded_size) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoEncoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetFrameCodedSize\""); + AddProp(ss, "video_encoder", ToString_PP_Resource(video_encoder)); + AddProp(ss, "coded_size", PointerToString(coded_size)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!coded_size) { + iterator.skip(); + FromJSON_PP_Size(iterator, *coded_size); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_VideoEncoder_0_1*)RealGetInterface("PPB_VideoEncoder;0.1"))->GetFrameCodedSize(video_encoder, coded_size); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!coded_size) { + AddProp(os, "coded_size", ToString_PP_Size(coded_size)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetVideoFrame_0_1(PP_Resource video_encoder, PP_Resource* video_frame, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoEncoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetVideoFrame\""); + AddProp(ss, "video_encoder", ToString_PP_Resource(video_encoder)); + AddProp(ss, "video_frame", PointerToString(video_frame)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Resource(iterator, *video_frame); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoEncoder_0_1*)RealGetInterface("PPB_VideoEncoder;0.1"))->GetVideoFrame(video_encoder, video_frame, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!video_frame) { + AddProp(os, "video_frame", ToString_PP_Resource(video_frame)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Encode_0_1(PP_Resource video_encoder, PP_Resource video_frame, PP_Bool force_keyframe, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoEncoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Encode\""); + AddProp(ss, "video_encoder", ToString_PP_Resource(video_encoder)); + AddProp(ss, "video_frame", ToString_PP_Resource(video_frame)); + AddProp(ss, "force_keyframe", ToString_PP_Bool(force_keyframe)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoEncoder_0_1*)RealGetInterface("PPB_VideoEncoder;0.1"))->Encode(video_encoder, video_frame, force_keyframe, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetBitstreamBuffer_0_1(PP_Resource video_encoder, struct PP_BitstreamBuffer* bitstream_buffer, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoEncoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetBitstreamBuffer\""); + AddProp(ss, "video_encoder", ToString_PP_Resource(video_encoder)); + AddProp(ss, "bitstream_buffer", PointerToString(bitstream_buffer)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!bitstream_buffer) { + iterator.skip(); + FromJSON_PP_BitstreamBuffer(iterator, *bitstream_buffer); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoEncoder_0_1*)RealGetInterface("PPB_VideoEncoder;0.1"))->GetBitstreamBuffer(video_encoder, bitstream_buffer, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!bitstream_buffer) { + AddProp(os, "bitstream_buffer", ToString_PP_BitstreamBuffer(bitstream_buffer)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void RecycleBitstreamBuffer_0_1(PP_Resource video_encoder, const struct PP_BitstreamBuffer* bitstream_buffer) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoEncoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"RecycleBitstreamBuffer\""); + AddProp(ss, "video_encoder", ToString_PP_Resource(video_encoder)); + AddProp(ss, "bitstream_buffer", ToString_PP_BitstreamBuffer(bitstream_buffer)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_VideoEncoder_0_1*)RealGetInterface("PPB_VideoEncoder;0.1"))->RecycleBitstreamBuffer(video_encoder, bitstream_buffer); +#endif // !INTERPOSE +} +static void RequestEncodingParametersChange_0_1(PP_Resource video_encoder, uint32_t bitrate, uint32_t framerate) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoEncoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"RequestEncodingParametersChange\""); + AddProp(ss, "video_encoder", ToString_PP_Resource(video_encoder)); + AddProp(ss, "bitrate", ToString_uint32_t(bitrate)); + AddProp(ss, "framerate", ToString_uint32_t(framerate)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_VideoEncoder_0_1*)RealGetInterface("PPB_VideoEncoder;0.1"))->RequestEncodingParametersChange(video_encoder, bitrate, framerate); +#endif // !INTERPOSE +} +static void Close_0_1(PP_Resource video_encoder) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoEncoder\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Close\""); + AddProp(ss, "video_encoder", ToString_PP_Resource(video_encoder)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_VideoEncoder_0_1*)RealGetInterface("PPB_VideoEncoder;0.1"))->Close(video_encoder); +#endif // !INTERPOSE +} +} +static PPB_VideoEncoder_0_1 _PPB_VideoEncoder_0_1 = { + ns_PPB_VideoEncoder_0_1::Create_0_1, + ns_PPB_VideoEncoder_0_1::IsVideoEncoder_0_1, + ns_PPB_VideoEncoder_0_1::GetSupportedProfiles_0_1, + ns_PPB_VideoEncoder_0_1::Initialize_0_1, + ns_PPB_VideoEncoder_0_1::GetFramesRequired_0_1, + ns_PPB_VideoEncoder_0_1::GetFrameCodedSize_0_1, + ns_PPB_VideoEncoder_0_1::GetVideoFrame_0_1, + ns_PPB_VideoEncoder_0_1::Encode_0_1, + ns_PPB_VideoEncoder_0_1::GetBitstreamBuffer_0_1, + ns_PPB_VideoEncoder_0_1::RecycleBitstreamBuffer_0_1, + ns_PPB_VideoEncoder_0_1::RequestEncodingParametersChange_0_1, + ns_PPB_VideoEncoder_0_1::Close_0_1, +}; +const string ToString_PPB_VideoEncoder(const PPB_VideoEncoder_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_VideoEncoder_0_2 { +static PP_Resource Create_0_2(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoEncoder\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_VideoEncoder_0_2*)RealGetInterface("PPB_VideoEncoder;0.2"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsVideoEncoder_0_2(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoEncoder\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"IsVideoEncoder\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_VideoEncoder_0_2*)RealGetInterface("PPB_VideoEncoder;0.2"))->IsVideoEncoder(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping GetSupportedProfiles */ +static int32_t GetSupportedProfiles_0_2(PP_Resource video_encoder, struct PP_ArrayOutput output, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoEncoder\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"GetSupportedProfiles\""); + AddProp(ss, "video_encoder", ToString_PP_Resource(video_encoder)); + AddProp(ss, "output", ToString_PP_ArrayOutput(output)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoEncoder_0_2*)RealGetInterface("PPB_VideoEncoder;0.2"))->GetSupportedProfiles(video_encoder, output, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Initialize_0_2(PP_Resource video_encoder, PP_VideoFrame_Format input_format, const struct PP_Size* input_visible_size, PP_VideoProfile output_profile, uint32_t initial_bitrate, PP_HardwareAcceleration acceleration, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoEncoder\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"Initialize\""); + AddProp(ss, "video_encoder", ToString_PP_Resource(video_encoder)); + AddProp(ss, "input_format", ToString_PP_VideoFrame_Format(input_format)); + AddProp(ss, "input_visible_size", ToString_PP_Size(input_visible_size)); + AddProp(ss, "output_profile", ToString_PP_VideoProfile(output_profile)); + AddProp(ss, "initial_bitrate", ToString_uint32_t(initial_bitrate)); + AddProp(ss, "acceleration", ToString_PP_HardwareAcceleration(acceleration)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoEncoder_0_2*)RealGetInterface("PPB_VideoEncoder;0.2"))->Initialize(video_encoder, input_format, input_visible_size, output_profile, initial_bitrate, acceleration, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetFramesRequired_0_2(PP_Resource video_encoder) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoEncoder\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"GetFramesRequired\""); + AddProp(ss, "video_encoder", ToString_PP_Resource(video_encoder)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_VideoEncoder_0_2*)RealGetInterface("PPB_VideoEncoder;0.2"))->GetFramesRequired(video_encoder); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetFrameCodedSize_0_2(PP_Resource video_encoder, struct PP_Size* coded_size) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoEncoder\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"GetFrameCodedSize\""); + AddProp(ss, "video_encoder", ToString_PP_Resource(video_encoder)); + AddProp(ss, "coded_size", PointerToString(coded_size)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!coded_size) { + iterator.skip(); + FromJSON_PP_Size(iterator, *coded_size); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_VideoEncoder_0_2*)RealGetInterface("PPB_VideoEncoder;0.2"))->GetFrameCodedSize(video_encoder, coded_size); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!coded_size) { + AddProp(os, "coded_size", ToString_PP_Size(coded_size)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetVideoFrame_0_2(PP_Resource video_encoder, PP_Resource* video_frame, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoEncoder\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"GetVideoFrame\""); + AddProp(ss, "video_encoder", ToString_PP_Resource(video_encoder)); + AddProp(ss, "video_frame", PointerToString(video_frame)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Resource(iterator, *video_frame); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoEncoder_0_2*)RealGetInterface("PPB_VideoEncoder;0.2"))->GetVideoFrame(video_encoder, video_frame, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!video_frame) { + AddProp(os, "video_frame", ToString_PP_Resource(video_frame)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Encode_0_2(PP_Resource video_encoder, PP_Resource video_frame, PP_Bool force_keyframe, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoEncoder\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"Encode\""); + AddProp(ss, "video_encoder", ToString_PP_Resource(video_encoder)); + AddProp(ss, "video_frame", ToString_PP_Resource(video_frame)); + AddProp(ss, "force_keyframe", ToString_PP_Bool(force_keyframe)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoEncoder_0_2*)RealGetInterface("PPB_VideoEncoder;0.2"))->Encode(video_encoder, video_frame, force_keyframe, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetBitstreamBuffer_0_2(PP_Resource video_encoder, struct PP_BitstreamBuffer* bitstream_buffer, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoEncoder\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"GetBitstreamBuffer\""); + AddProp(ss, "video_encoder", ToString_PP_Resource(video_encoder)); + AddProp(ss, "bitstream_buffer", PointerToString(bitstream_buffer)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!bitstream_buffer) { + iterator.skip(); + FromJSON_PP_BitstreamBuffer(iterator, *bitstream_buffer); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoEncoder_0_2*)RealGetInterface("PPB_VideoEncoder;0.2"))->GetBitstreamBuffer(video_encoder, bitstream_buffer, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!bitstream_buffer) { + AddProp(os, "bitstream_buffer", ToString_PP_BitstreamBuffer(bitstream_buffer)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void RecycleBitstreamBuffer_0_2(PP_Resource video_encoder, const struct PP_BitstreamBuffer* bitstream_buffer) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoEncoder\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"RecycleBitstreamBuffer\""); + AddProp(ss, "video_encoder", ToString_PP_Resource(video_encoder)); + AddProp(ss, "bitstream_buffer", ToString_PP_BitstreamBuffer(bitstream_buffer)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_VideoEncoder_0_2*)RealGetInterface("PPB_VideoEncoder;0.2"))->RecycleBitstreamBuffer(video_encoder, bitstream_buffer); +#endif // !INTERPOSE +} +static void RequestEncodingParametersChange_0_2(PP_Resource video_encoder, uint32_t bitrate, uint32_t framerate) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoEncoder\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"RequestEncodingParametersChange\""); + AddProp(ss, "video_encoder", ToString_PP_Resource(video_encoder)); + AddProp(ss, "bitrate", ToString_uint32_t(bitrate)); + AddProp(ss, "framerate", ToString_uint32_t(framerate)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_VideoEncoder_0_2*)RealGetInterface("PPB_VideoEncoder;0.2"))->RequestEncodingParametersChange(video_encoder, bitrate, framerate); +#endif // !INTERPOSE +} +static void Close_0_2(PP_Resource video_encoder) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoEncoder\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"Close\""); + AddProp(ss, "video_encoder", ToString_PP_Resource(video_encoder)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_VideoEncoder_0_2*)RealGetInterface("PPB_VideoEncoder;0.2"))->Close(video_encoder); +#endif // !INTERPOSE +} +} +static PPB_VideoEncoder_0_2 _PPB_VideoEncoder_0_2 = { + ns_PPB_VideoEncoder_0_2::Create_0_2, + ns_PPB_VideoEncoder_0_2::IsVideoEncoder_0_2, + ns_PPB_VideoEncoder_0_2::GetSupportedProfiles_0_2, + ns_PPB_VideoEncoder_0_2::Initialize_0_2, + ns_PPB_VideoEncoder_0_2::GetFramesRequired_0_2, + ns_PPB_VideoEncoder_0_2::GetFrameCodedSize_0_2, + ns_PPB_VideoEncoder_0_2::GetVideoFrame_0_2, + ns_PPB_VideoEncoder_0_2::Encode_0_2, + ns_PPB_VideoEncoder_0_2::GetBitstreamBuffer_0_2, + ns_PPB_VideoEncoder_0_2::RecycleBitstreamBuffer_0_2, + ns_PPB_VideoEncoder_0_2::RequestEncodingParametersChange_0_2, + ns_PPB_VideoEncoder_0_2::Close_0_2, +}; +const string ToString_PPB_VideoEncoder(const PPB_VideoEncoder_0_2 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_VideoFrame_Format(const PP_VideoFrame_Format *v) { + switch (*v) { + case 0: + return "\"PP_VIDEOFRAME_FORMAT_UNKNOWN\""; + case 1: + return "\"PP_VIDEOFRAME_FORMAT_YV12\""; + case 2: + return "\"PP_VIDEOFRAME_FORMAT_I420\""; + case 3: + return "\"PP_VIDEOFRAME_FORMAT_BGRA\""; + default: + return "\"???\""; + } +} +const string ToString_PP_VideoFrame_Format(const PP_VideoFrame_Format &v) { + return ToString_PP_VideoFrame_Format(&v); +} +void FromJSON_PP_VideoFrame_Format(JSONIterator& iterator, PP_VideoFrame_Format &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_VideoFrame_Format(v); +} +namespace ns_PPB_VideoFrame_0_1 { +static PP_Bool IsVideoFrame_0_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoFrame\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"IsVideoFrame\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_VideoFrame_0_1*)RealGetInterface("PPB_VideoFrame;0.1"))->IsVideoFrame(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_TimeDelta GetTimestamp_0_1(PP_Resource frame) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoFrame\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetTimestamp\""); + AddProp(ss, "frame", ToString_PP_Resource(frame)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + double rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_TimeDelta(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + double rval = ((PPB_VideoFrame_0_1*)RealGetInterface("PPB_VideoFrame;0.1"))->GetTimestamp(frame); + printf("RPC response: ["); + printf("%s", ToString_PP_TimeDelta(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void SetTimestamp_0_1(PP_Resource frame, PP_TimeDelta timestamp) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoFrame\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"SetTimestamp\""); + AddProp(ss, "frame", ToString_PP_Resource(frame)); + AddProp(ss, "timestamp", ToString_PP_TimeDelta(timestamp)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_VideoFrame_0_1*)RealGetInterface("PPB_VideoFrame;0.1"))->SetTimestamp(frame, timestamp); +#endif // !INTERPOSE +} +static PP_VideoFrame_Format GetFormat_0_1(PP_Resource frame) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoFrame\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetFormat\""); + AddProp(ss, "frame", ToString_PP_Resource(frame)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_VideoFrame_Format rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_VideoFrame_Format(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_VideoFrame_Format rval = ((PPB_VideoFrame_0_1*)RealGetInterface("PPB_VideoFrame;0.1"))->GetFormat(frame); + printf("RPC response: ["); + printf("%s", ToString_PP_VideoFrame_Format(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetSize_0_1(PP_Resource frame, struct PP_Size* size) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoFrame\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetSize\""); + AddProp(ss, "frame", ToString_PP_Resource(frame)); + AddProp(ss, "size", PointerToString(size)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!size) { + iterator.skip(); + FromJSON_PP_Size(iterator, *size); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_VideoFrame_0_1*)RealGetInterface("PPB_VideoFrame;0.1"))->GetSize(frame, size); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!size) { + AddProp(os, "size", ToString_PP_Size(size)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void* GetDataBuffer_0_1(PP_Resource frame) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoFrame\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetDataBuffer\""); + AddProp(ss, "frame", ToString_PP_Resource(frame)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + void* rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_mem_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + void* rval = ((PPB_VideoFrame_0_1*)RealGetInterface("PPB_VideoFrame;0.1"))->GetDataBuffer(frame); + printf("RPC response: ["); + printf("%s", ToString_mem_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint32_t GetDataBufferSize_0_1(PP_Resource frame) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoFrame\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetDataBufferSize\""); + AddProp(ss, "frame", ToString_PP_Resource(frame)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint32_t rval = ((PPB_VideoFrame_0_1*)RealGetInterface("PPB_VideoFrame;0.1"))->GetDataBufferSize(frame); + printf("RPC response: ["); + printf("%s", ToString_uint32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_VideoFrame_0_1 _PPB_VideoFrame_0_1 = { + ns_PPB_VideoFrame_0_1::IsVideoFrame_0_1, + ns_PPB_VideoFrame_0_1::GetTimestamp_0_1, + ns_PPB_VideoFrame_0_1::SetTimestamp_0_1, + ns_PPB_VideoFrame_0_1::GetFormat_0_1, + ns_PPB_VideoFrame_0_1::GetSize_0_1, + ns_PPB_VideoFrame_0_1::GetDataBuffer_0_1, + ns_PPB_VideoFrame_0_1::GetDataBufferSize_0_1, +}; +const string ToString_PPB_VideoFrame(const PPB_VideoFrame_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_View_1_0 { +static PP_Bool IsView_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_View\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsView\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_View_1_0*)RealGetInterface("PPB_View;1.0"))->IsView(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetRect_1_0(PP_Resource resource, struct PP_Rect* rect) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_View\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetRect\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + AddProp(ss, "rect", PointerToString(rect)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!rect) { + iterator.skip(); + FromJSON_PP_Rect(iterator, *rect); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_View_1_0*)RealGetInterface("PPB_View;1.0"))->GetRect(resource, rect); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!rect) { + AddProp(os, "rect", ToString_PP_Rect(rect)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsFullscreen_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_View\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsFullscreen\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_View_1_0*)RealGetInterface("PPB_View;1.0"))->IsFullscreen(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsVisible_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_View\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsVisible\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_View_1_0*)RealGetInterface("PPB_View;1.0"))->IsVisible(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsPageVisible_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_View\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsPageVisible\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_View_1_0*)RealGetInterface("PPB_View;1.0"))->IsPageVisible(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetClipRect_1_0(PP_Resource resource, struct PP_Rect* clip) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_View\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetClipRect\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + AddProp(ss, "clip", PointerToString(clip)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!clip) { + iterator.skip(); + FromJSON_PP_Rect(iterator, *clip); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_View_1_0*)RealGetInterface("PPB_View;1.0"))->GetClipRect(resource, clip); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!clip) { + AddProp(os, "clip", ToString_PP_Rect(clip)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping GetDeviceScale */ +/* skipping GetCSSScale */ +/* skipping GetScrollOffset */ +} +static PPB_View_1_0 _PPB_View_1_0 = { + ns_PPB_View_1_0::IsView_1_0, + ns_PPB_View_1_0::GetRect_1_0, + ns_PPB_View_1_0::IsFullscreen_1_0, + ns_PPB_View_1_0::IsVisible_1_0, + ns_PPB_View_1_0::IsPageVisible_1_0, + ns_PPB_View_1_0::GetClipRect_1_0, +}; +const string ToString_PPB_View(const PPB_View_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_View_1_1 { +static PP_Bool IsView_1_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_View\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"IsView\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_View_1_1*)RealGetInterface("PPB_View;1.1"))->IsView(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetRect_1_1(PP_Resource resource, struct PP_Rect* rect) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_View\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"GetRect\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + AddProp(ss, "rect", PointerToString(rect)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!rect) { + iterator.skip(); + FromJSON_PP_Rect(iterator, *rect); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_View_1_1*)RealGetInterface("PPB_View;1.1"))->GetRect(resource, rect); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!rect) { + AddProp(os, "rect", ToString_PP_Rect(rect)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsFullscreen_1_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_View\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"IsFullscreen\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_View_1_1*)RealGetInterface("PPB_View;1.1"))->IsFullscreen(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsVisible_1_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_View\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"IsVisible\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_View_1_1*)RealGetInterface("PPB_View;1.1"))->IsVisible(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsPageVisible_1_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_View\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"IsPageVisible\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_View_1_1*)RealGetInterface("PPB_View;1.1"))->IsPageVisible(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetClipRect_1_1(PP_Resource resource, struct PP_Rect* clip) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_View\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"GetClipRect\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + AddProp(ss, "clip", PointerToString(clip)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!clip) { + iterator.skip(); + FromJSON_PP_Rect(iterator, *clip); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_View_1_1*)RealGetInterface("PPB_View;1.1"))->GetClipRect(resource, clip); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!clip) { + AddProp(os, "clip", ToString_PP_Rect(clip)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static float GetDeviceScale_1_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_View\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"GetDeviceScale\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + float rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_float_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + float rval = ((PPB_View_1_1*)RealGetInterface("PPB_View;1.1"))->GetDeviceScale(resource); + printf("RPC response: ["); + printf("%s", ToString_float_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static float GetCSSScale_1_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_View\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"GetCSSScale\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + float rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_float_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + float rval = ((PPB_View_1_1*)RealGetInterface("PPB_View;1.1"))->GetCSSScale(resource); + printf("RPC response: ["); + printf("%s", ToString_float_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping GetScrollOffset */ +} +static PPB_View_1_1 _PPB_View_1_1 = { + ns_PPB_View_1_1::IsView_1_1, + ns_PPB_View_1_1::GetRect_1_1, + ns_PPB_View_1_1::IsFullscreen_1_1, + ns_PPB_View_1_1::IsVisible_1_1, + ns_PPB_View_1_1::IsPageVisible_1_1, + ns_PPB_View_1_1::GetClipRect_1_1, + ns_PPB_View_1_1::GetDeviceScale_1_1, + ns_PPB_View_1_1::GetCSSScale_1_1, +}; +const string ToString_PPB_View(const PPB_View_1_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_View_1_2 { +static PP_Bool IsView_1_2(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_View\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"IsView\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_View_1_2*)RealGetInterface("PPB_View;1.2"))->IsView(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetRect_1_2(PP_Resource resource, struct PP_Rect* rect) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_View\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"GetRect\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + AddProp(ss, "rect", PointerToString(rect)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!rect) { + iterator.skip(); + FromJSON_PP_Rect(iterator, *rect); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_View_1_2*)RealGetInterface("PPB_View;1.2"))->GetRect(resource, rect); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!rect) { + AddProp(os, "rect", ToString_PP_Rect(rect)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsFullscreen_1_2(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_View\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"IsFullscreen\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_View_1_2*)RealGetInterface("PPB_View;1.2"))->IsFullscreen(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsVisible_1_2(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_View\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"IsVisible\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_View_1_2*)RealGetInterface("PPB_View;1.2"))->IsVisible(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsPageVisible_1_2(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_View\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"IsPageVisible\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_View_1_2*)RealGetInterface("PPB_View;1.2"))->IsPageVisible(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetClipRect_1_2(PP_Resource resource, struct PP_Rect* clip) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_View\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"GetClipRect\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + AddProp(ss, "clip", PointerToString(clip)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!clip) { + iterator.skip(); + FromJSON_PP_Rect(iterator, *clip); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_View_1_2*)RealGetInterface("PPB_View;1.2"))->GetClipRect(resource, clip); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!clip) { + AddProp(os, "clip", ToString_PP_Rect(clip)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static float GetDeviceScale_1_2(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_View\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"GetDeviceScale\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + float rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_float_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + float rval = ((PPB_View_1_2*)RealGetInterface("PPB_View;1.2"))->GetDeviceScale(resource); + printf("RPC response: ["); + printf("%s", ToString_float_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static float GetCSSScale_1_2(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_View\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"GetCSSScale\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + float rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_float_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + float rval = ((PPB_View_1_2*)RealGetInterface("PPB_View;1.2"))->GetCSSScale(resource); + printf("RPC response: ["); + printf("%s", ToString_float_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetScrollOffset_1_2(PP_Resource resource, struct PP_Point* offset) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_View\""); + AddProp(ss, "__version", "\"1.2\""); + AddProp(ss, "__method", "\"GetScrollOffset\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + AddProp(ss, "offset", PointerToString(offset)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!offset) { + iterator.skip(); + FromJSON_PP_Point(iterator, *offset); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_View_1_2*)RealGetInterface("PPB_View;1.2"))->GetScrollOffset(resource, offset); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!offset) { + AddProp(os, "offset", ToString_PP_Point(offset)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_View_1_2 _PPB_View_1_2 = { + ns_PPB_View_1_2::IsView_1_2, + ns_PPB_View_1_2::GetRect_1_2, + ns_PPB_View_1_2::IsFullscreen_1_2, + ns_PPB_View_1_2::IsVisible_1_2, + ns_PPB_View_1_2::IsPageVisible_1_2, + ns_PPB_View_1_2::GetClipRect_1_2, + ns_PPB_View_1_2::GetDeviceScale_1_2, + ns_PPB_View_1_2::GetCSSScale_1_2, + ns_PPB_View_1_2::GetScrollOffset_1_2, +}; +const string ToString_PPB_View(const PPB_View_1_2 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_VpnProvider_0_1 { +static PP_Resource Create_0_1(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VpnProvider\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_VpnProvider_0_1*)RealGetInterface("PPB_VpnProvider;0.1"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsVpnProvider_0_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VpnProvider\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"IsVpnProvider\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_VpnProvider_0_1*)RealGetInterface("PPB_VpnProvider;0.1"))->IsVpnProvider(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Bind_0_1(PP_Resource vpn_provider, struct PP_Var configuration_id, struct PP_Var configuration_name, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VpnProvider\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Bind\""); + AddProp(ss, "vpn_provider", ToString_PP_Resource(vpn_provider)); + AddProp(ss, "configuration_id", ToString_PP_Var(configuration_id)); + AddProp(ss, "configuration_name", ToString_PP_Var(configuration_name)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VpnProvider_0_1*)RealGetInterface("PPB_VpnProvider;0.1"))->Bind(vpn_provider, configuration_id, configuration_name, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SendPacket_0_1(PP_Resource vpn_provider, struct PP_Var packet, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VpnProvider\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"SendPacket\""); + AddProp(ss, "vpn_provider", ToString_PP_Resource(vpn_provider)); + AddProp(ss, "packet", ToString_PP_Var(packet)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VpnProvider_0_1*)RealGetInterface("PPB_VpnProvider;0.1"))->SendPacket(vpn_provider, packet, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t ReceivePacket_0_1(PP_Resource vpn_provider, struct PP_Var* packet, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VpnProvider\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"ReceivePacket\""); + AddProp(ss, "vpn_provider", ToString_PP_Resource(vpn_provider)); + AddProp(ss, "packet", PointerToString(packet)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Var(iterator, *packet); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VpnProvider_0_1*)RealGetInterface("PPB_VpnProvider;0.1"))->ReceivePacket(vpn_provider, packet, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!packet) { + AddProp(os, "packet", ToString_PP_Var(packet)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_VpnProvider_0_1 _PPB_VpnProvider_0_1 = { + ns_PPB_VpnProvider_0_1::Create_0_1, + ns_PPB_VpnProvider_0_1::IsVpnProvider_0_1, + ns_PPB_VpnProvider_0_1::Bind_0_1, + ns_PPB_VpnProvider_0_1::SendPacket_0_1, + ns_PPB_VpnProvider_0_1::ReceivePacket_0_1, +}; +const string ToString_PPB_VpnProvider(const PPB_VpnProvider_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_WebSocketReadyState(const PP_WebSocketReadyState *v) { + switch (*v) { + case -1: + return "\"PP_WEBSOCKETREADYSTATE_INVALID\""; + case 0: + return "\"PP_WEBSOCKETREADYSTATE_CONNECTING\""; + case 1: + return "\"PP_WEBSOCKETREADYSTATE_OPEN\""; + case 2: + return "\"PP_WEBSOCKETREADYSTATE_CLOSING\""; + case 3: + return "\"PP_WEBSOCKETREADYSTATE_CLOSED\""; + default: + return "\"???\""; + } +} +const string ToString_PP_WebSocketReadyState(const PP_WebSocketReadyState &v) { + return ToString_PP_WebSocketReadyState(&v); +} +void FromJSON_PP_WebSocketReadyState(JSONIterator& iterator, PP_WebSocketReadyState &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_WebSocketReadyState(v); +} +const string ToString_PP_WebSocketCloseCode(const PP_WebSocketCloseCode *v) { + switch (*v) { + case 1005: + return "\"PP_WEBSOCKETSTATUSCODE_NOT_SPECIFIED\""; + case 1000: + return "\"PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE\""; + case 1001: + return "\"PP_WEBSOCKETSTATUSCODE_GOING_AWAY\""; + case 1002: + return "\"PP_WEBSOCKETSTATUSCODE_PROTOCOL_ERROR\""; + case 1003: + return "\"PP_WEBSOCKETSTATUSCODE_UNSUPPORTED_DATA\""; + case 1006: + return "\"PP_WEBSOCKETSTATUSCODE_ABNORMAL_CLOSURE\""; + case 1007: + return "\"PP_WEBSOCKETSTATUSCODE_INVALID_FRAME_PAYLOAD_DATA\""; + case 1008: + return "\"PP_WEBSOCKETSTATUSCODE_POLICY_VIOLATION\""; + case 1009: + return "\"PP_WEBSOCKETSTATUSCODE_MESSAGE_TOO_BIG\""; + case 1010: + return "\"PP_WEBSOCKETSTATUSCODE_MANDATORY_EXTENSION\""; + case 1011: + return "\"PP_WEBSOCKETSTATUSCODE_INTERNAL_SERVER_ERROR\""; + case 1015: + return "\"PP_WEBSOCKETSTATUSCODE_TLS_HANDSHAKE\""; + case 3000: + return "\"PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MIN\""; + case 3999: + return "\"PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MAX\""; + case 4000: + return "\"PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MIN\""; + case 4999: + return "\"PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MAX\""; + default: + return "\"???\""; + } +} +const string ToString_PP_WebSocketCloseCode(const PP_WebSocketCloseCode &v) { + return ToString_PP_WebSocketCloseCode(&v); +} +void FromJSON_PP_WebSocketCloseCode(JSONIterator& iterator, PP_WebSocketCloseCode &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_WebSocketCloseCode(v); +} +namespace ns_PPB_WebSocket_1_0 { +static PP_Resource Create_1_0(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_WebSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_WebSocket_1_0*)RealGetInterface("PPB_WebSocket;1.0"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsWebSocket_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_WebSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsWebSocket\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_WebSocket_1_0*)RealGetInterface("PPB_WebSocket;1.0"))->IsWebSocket(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Connect_1_0(PP_Resource web_socket, struct PP_Var url, const struct PP_Var protocols[], uint32_t protocol_count, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_WebSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Connect\""); + AddProp(ss, "web_socket", ToString_PP_Resource(web_socket)); + AddProp(ss, "url", ToString_PP_Var(url)); + { + BeginProp(ss, "protocols"); + BeginElements(ss); + for (uint32_t _n = 0; _n < protocol_count; ++_n) { + AddElement(ss, ToString_PP_Var(protocols[_n])); + } + EndElements(ss); + } + AddProp(ss, "protocol_count", ToString_uint32_t(protocol_count)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_WebSocket_1_0*)RealGetInterface("PPB_WebSocket;1.0"))->Connect(web_socket, url, protocols, protocol_count, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Close_1_0(PP_Resource web_socket, uint16_t code, struct PP_Var reason, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_WebSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Close\""); + AddProp(ss, "web_socket", ToString_PP_Resource(web_socket)); + AddProp(ss, "code", ToString_uint16_t(code)); + AddProp(ss, "reason", ToString_PP_Var(reason)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_WebSocket_1_0*)RealGetInterface("PPB_WebSocket;1.0"))->Close(web_socket, code, reason, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t ReceiveMessage_1_0(PP_Resource web_socket, struct PP_Var* message, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_WebSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"ReceiveMessage\""); + AddProp(ss, "web_socket", ToString_PP_Resource(web_socket)); + AddProp(ss, "message", PointerToString(message)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Var(iterator, *message); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_WebSocket_1_0*)RealGetInterface("PPB_WebSocket;1.0"))->ReceiveMessage(web_socket, message, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!message) { + AddProp(os, "message", ToString_PP_Var(message)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SendMessage_1_0(PP_Resource web_socket, struct PP_Var message) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_WebSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"SendMessage\""); + AddProp(ss, "web_socket", ToString_PP_Resource(web_socket)); + AddProp(ss, "message", ToString_PP_Var(message)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_WebSocket_1_0*)RealGetInterface("PPB_WebSocket;1.0"))->SendMessage(web_socket, message); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint64_t GetBufferedAmount_1_0(PP_Resource web_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_WebSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetBufferedAmount\""); + AddProp(ss, "web_socket", ToString_PP_Resource(web_socket)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint64_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint64_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint64_t rval = ((PPB_WebSocket_1_0*)RealGetInterface("PPB_WebSocket;1.0"))->GetBufferedAmount(web_socket); + printf("RPC response: ["); + printf("%s", ToString_uint64_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint16_t GetCloseCode_1_0(PP_Resource web_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_WebSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetCloseCode\""); + AddProp(ss, "web_socket", ToString_PP_Resource(web_socket)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint16_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint16_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint16_t rval = ((PPB_WebSocket_1_0*)RealGetInterface("PPB_WebSocket;1.0"))->GetCloseCode(web_socket); + printf("RPC response: ["); + printf("%s", ToString_uint16_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetCloseReason_1_0(PP_Resource web_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_WebSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetCloseReason\""); + AddProp(ss, "web_socket", ToString_PP_Resource(web_socket)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_WebSocket_1_0*)RealGetInterface("PPB_WebSocket;1.0"))->GetCloseReason(web_socket); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetCloseWasClean_1_0(PP_Resource web_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_WebSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetCloseWasClean\""); + AddProp(ss, "web_socket", ToString_PP_Resource(web_socket)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_WebSocket_1_0*)RealGetInterface("PPB_WebSocket;1.0"))->GetCloseWasClean(web_socket); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetExtensions_1_0(PP_Resource web_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_WebSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetExtensions\""); + AddProp(ss, "web_socket", ToString_PP_Resource(web_socket)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_WebSocket_1_0*)RealGetInterface("PPB_WebSocket;1.0"))->GetExtensions(web_socket); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetProtocol_1_0(PP_Resource web_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_WebSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetProtocol\""); + AddProp(ss, "web_socket", ToString_PP_Resource(web_socket)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_WebSocket_1_0*)RealGetInterface("PPB_WebSocket;1.0"))->GetProtocol(web_socket); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_WebSocketReadyState GetReadyState_1_0(PP_Resource web_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_WebSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetReadyState\""); + AddProp(ss, "web_socket", ToString_PP_Resource(web_socket)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_WebSocketReadyState rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_WebSocketReadyState(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_WebSocketReadyState rval = ((PPB_WebSocket_1_0*)RealGetInterface("PPB_WebSocket;1.0"))->GetReadyState(web_socket); + printf("RPC response: ["); + printf("%s", ToString_PP_WebSocketReadyState(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetURL_1_0(PP_Resource web_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_WebSocket\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetURL\""); + AddProp(ss, "web_socket", ToString_PP_Resource(web_socket)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_WebSocket_1_0*)RealGetInterface("PPB_WebSocket;1.0"))->GetURL(web_socket); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_WebSocket_1_0 _PPB_WebSocket_1_0 = { + ns_PPB_WebSocket_1_0::Create_1_0, + ns_PPB_WebSocket_1_0::IsWebSocket_1_0, + ns_PPB_WebSocket_1_0::Connect_1_0, + ns_PPB_WebSocket_1_0::Close_1_0, + ns_PPB_WebSocket_1_0::ReceiveMessage_1_0, + ns_PPB_WebSocket_1_0::SendMessage_1_0, + ns_PPB_WebSocket_1_0::GetBufferedAmount_1_0, + ns_PPB_WebSocket_1_0::GetCloseCode_1_0, + ns_PPB_WebSocket_1_0::GetCloseReason_1_0, + ns_PPB_WebSocket_1_0::GetCloseWasClean_1_0, + ns_PPB_WebSocket_1_0::GetExtensions_1_0, + ns_PPB_WebSocket_1_0::GetProtocol_1_0, + ns_PPB_WebSocket_1_0::GetReadyState_1_0, + ns_PPB_WebSocket_1_0::GetURL_1_0, +}; +const string ToString_PPB_WebSocket(const PPB_WebSocket_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_InitializeModule_Func(const PP_InitializeModule_Func &v) { + return PointerToString(v); +} +void FromJSON_PP_InitializeModule_Func(JSONIterator& iterator, PP_InitializeModule_Func &value) { + PointerValueFromJSON(iterator, value); +} +const string ToString_PP_ShutdownModule_Func(const PP_ShutdownModule_Func &v) { + return PointerToString(v); +} +void FromJSON_PP_ShutdownModule_Func(JSONIterator& iterator, PP_ShutdownModule_Func &value) { + PointerValueFromJSON(iterator, value); +} +const string ToString_PP_GetInterface_Func(const PP_GetInterface_Func &v) { + return PointerToString(v); +} +void FromJSON_PP_GetInterface_Func(JSONIterator& iterator, PP_GetInterface_Func &value) { + PointerValueFromJSON(iterator, value); +} +char* Call_PPP_Graphics3D_Graphics3DContextLost(const PPP_Graphics3D* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + _interface->Graphics3DContextLost((PP_Instance )instance); + return nullptr; +} +char* Call_PPP_Graphics3D(const void* _interface, JSONIterator& iterator) { + iterator.skip(); + const Token& member = iterator.getCurrentStringAndGotoNext(); + string memberName = member.value(); + if (!memberName.compare("Graphics3DContextLost")) { + return Call_PPP_Graphics3D_Graphics3DContextLost((const PPP_Graphics3D*)_interface, iterator); + } + return nullptr; +} +char* Call_PPP_InputEvent_HandleInputEvent(const PPP_InputEvent* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + PP_Resource input_event; + iterator.skip(); + FromJSON_PP_Resource(iterator, input_event); + PP_Bool rval; + rval = _interface->HandleInputEvent((PP_Instance )instance, (PP_Resource )input_event); + return strdup(ToString_PP_Bool(rval).c_str()); +} +char* Call_PPP_InputEvent(const void* _interface, JSONIterator& iterator) { + iterator.skip(); + const Token& member = iterator.getCurrentStringAndGotoNext(); + string memberName = member.value(); + if (!memberName.compare("HandleInputEvent")) { + return Call_PPP_InputEvent_HandleInputEvent((const PPP_InputEvent*)_interface, iterator); + } + return nullptr; +} +char* Call_PPP_Instance_DidCreate(const PPP_Instance_1_0* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + uint32_t argc; + iterator.skip(); + FromJSON_uint32_t(iterator, argc); + char* *argn; + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > argc) { + Fail("Too many items in array\n", ""); + } + argn = new char*[argc]; + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_str_t(iterator, (argn)[_n]); + } + // FIXME Null out remaining items? + } + char* *argv; + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > argc) { + Fail("Too many items in array\n", ""); + } + argv = new char*[argc]; + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_str_t(iterator, (argv)[_n]); + } + // FIXME Null out remaining items? + } + PP_Bool rval; + rval = _interface->DidCreate((PP_Instance )instance, (uint32_t )argc, (const char* *)argn, (const char* *)argv); + return strdup(ToString_PP_Bool(rval).c_str()); +} +char* Call_PPP_Instance_DidDestroy(const PPP_Instance_1_0* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + _interface->DidDestroy((PP_Instance )instance); + return nullptr; +} +char* Call_PPP_Instance_DidChangeView(const PPP_Instance_1_0* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + struct PP_Rect position; + iterator.skip(); + FromJSON_PP_Rect(iterator, position); + struct PP_Rect clip; + iterator.skip(); + FromJSON_PP_Rect(iterator, clip); + _interface->DidChangeView((PP_Instance )instance, (const struct PP_Rect* )&position, (const struct PP_Rect* )&clip); + return nullptr; +} +/* skipping DidChangeView */ +char* Call_PPP_Instance_DidChangeFocus(const PPP_Instance_1_0* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + PP_Bool has_focus; + iterator.skip(); + FromJSON_PP_Bool(iterator, has_focus); + _interface->DidChangeFocus((PP_Instance )instance, (PP_Bool )has_focus); + return nullptr; +} +char* Call_PPP_Instance_HandleDocumentLoad(const PPP_Instance_1_0* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + PP_Resource url_loader; + iterator.skip(); + FromJSON_PP_Resource(iterator, url_loader); + PP_Bool rval; + rval = _interface->HandleDocumentLoad((PP_Instance )instance, (PP_Resource )url_loader); + return strdup(ToString_PP_Bool(rval).c_str()); +} +char* Call_PPP_Instance_1_0(const void* _interface, JSONIterator& iterator) { + iterator.skip(); + const Token& member = iterator.getCurrentStringAndGotoNext(); + string memberName = member.value(); + if (!memberName.compare("DidCreate")) { + return Call_PPP_Instance_DidCreate((const PPP_Instance_1_0*)_interface, iterator); + } + if (!memberName.compare("DidDestroy")) { + return Call_PPP_Instance_DidDestroy((const PPP_Instance_1_0*)_interface, iterator); + } + if (!memberName.compare("DidChangeView")) { + return Call_PPP_Instance_DidChangeView((const PPP_Instance_1_0*)_interface, iterator); + } +/* skipping DidChangeView */ + if (!memberName.compare("DidChangeFocus")) { + return Call_PPP_Instance_DidChangeFocus((const PPP_Instance_1_0*)_interface, iterator); + } + if (!memberName.compare("HandleDocumentLoad")) { + return Call_PPP_Instance_HandleDocumentLoad((const PPP_Instance_1_0*)_interface, iterator); + } + return nullptr; +} +char* Call_PPP_Instance_DidCreate(const PPP_Instance* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + uint32_t argc; + iterator.skip(); + FromJSON_uint32_t(iterator, argc); + char* *argn; + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > argc) { + Fail("Too many items in array\n", ""); + } + argn = new char*[argc]; + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_str_t(iterator, (argn)[_n]); + } + // FIXME Null out remaining items? + } + char* *argv; + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > argc) { + Fail("Too many items in array\n", ""); + } + argv = new char*[argc]; + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_str_t(iterator, (argv)[_n]); + } + // FIXME Null out remaining items? + } + PP_Bool rval; + rval = _interface->DidCreate((PP_Instance )instance, (uint32_t )argc, (const char* *)argn, (const char* *)argv); + return strdup(ToString_PP_Bool(rval).c_str()); +} +char* Call_PPP_Instance_DidDestroy(const PPP_Instance* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + _interface->DidDestroy((PP_Instance )instance); + return nullptr; +} +/* skipping DidChangeView */ +char* Call_PPP_Instance_DidChangeView(const PPP_Instance* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + PP_Resource view; + iterator.skip(); + FromJSON_PP_Resource(iterator, view); + _interface->DidChangeView((PP_Instance )instance, (PP_Resource )view); + return nullptr; +} +char* Call_PPP_Instance_DidChangeFocus(const PPP_Instance* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + PP_Bool has_focus; + iterator.skip(); + FromJSON_PP_Bool(iterator, has_focus); + _interface->DidChangeFocus((PP_Instance )instance, (PP_Bool )has_focus); + return nullptr; +} +char* Call_PPP_Instance_HandleDocumentLoad(const PPP_Instance* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + PP_Resource url_loader; + iterator.skip(); + FromJSON_PP_Resource(iterator, url_loader); + PP_Bool rval; + rval = _interface->HandleDocumentLoad((PP_Instance )instance, (PP_Resource )url_loader); + return strdup(ToString_PP_Bool(rval).c_str()); +} +char* Call_PPP_Instance(const void* _interface, JSONIterator& iterator) { + iterator.skip(); + const Token& member = iterator.getCurrentStringAndGotoNext(); + string memberName = member.value(); + if (!memberName.compare("DidCreate")) { + return Call_PPP_Instance_DidCreate((const PPP_Instance*)_interface, iterator); + } + if (!memberName.compare("DidDestroy")) { + return Call_PPP_Instance_DidDestroy((const PPP_Instance*)_interface, iterator); + } +/* skipping DidChangeView */ + if (!memberName.compare("DidChangeView")) { + return Call_PPP_Instance_DidChangeView((const PPP_Instance*)_interface, iterator); + } + if (!memberName.compare("DidChangeFocus")) { + return Call_PPP_Instance_DidChangeFocus((const PPP_Instance*)_interface, iterator); + } + if (!memberName.compare("HandleDocumentLoad")) { + return Call_PPP_Instance_HandleDocumentLoad((const PPP_Instance*)_interface, iterator); + } + return nullptr; +} +char* Call_PPP_MessageHandler_HandleMessage(const PPP_MessageHandler* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + void* user_data; + iterator.skip(); + FromJSON_mem_t(iterator, user_data); + struct PP_Var message; + iterator.skip(); + FromJSON_PP_Var(iterator, message); + _interface->HandleMessage((PP_Instance )instance, (void* )user_data, (const struct PP_Var* )&message); + stringstream os; + BeginElements(os); + BeginProps(os); + AddProp(os, "user_data", ToString_mem_t(user_data)); + EndProps(os); + EndElements(os); + return strdup(os.str().c_str()); +} +char* Call_PPP_MessageHandler_HandleBlockingMessage(const PPP_MessageHandler* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + void* user_data; + iterator.skip(); + FromJSON_mem_t(iterator, user_data); + struct PP_Var message; + iterator.skip(); + FromJSON_PP_Var(iterator, message); + struct PP_Var response; + _interface->HandleBlockingMessage((PP_Instance )instance, (void* )user_data, (const struct PP_Var* )&message, (struct PP_Var* )&response); + stringstream os; + BeginElements(os); + BeginProps(os); + AddProp(os, "user_data", ToString_mem_t(user_data)); + AddProp(os, "response", ToString_PP_Var(response)); + EndProps(os); + EndElements(os); + return strdup(os.str().c_str()); +} +char* Call_PPP_MessageHandler_Destroy(const PPP_MessageHandler* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + void* user_data; + iterator.skip(); + FromJSON_mem_t(iterator, user_data); + _interface->Destroy((PP_Instance )instance, (void* )user_data); + stringstream os; + BeginElements(os); + BeginProps(os); + AddProp(os, "user_data", ToString_mem_t(user_data)); + EndProps(os); + EndElements(os); + return strdup(os.str().c_str()); +} +char* Call_PPP_MessageHandler(const void* _interface, JSONIterator& iterator) { + iterator.skip(); + const Token& member = iterator.getCurrentStringAndGotoNext(); + string memberName = member.value(); + if (!memberName.compare("HandleMessage")) { + return Call_PPP_MessageHandler_HandleMessage((const PPP_MessageHandler*)_interface, iterator); + } + if (!memberName.compare("HandleBlockingMessage")) { + return Call_PPP_MessageHandler_HandleBlockingMessage((const PPP_MessageHandler*)_interface, iterator); + } + if (!memberName.compare("Destroy")) { + return Call_PPP_MessageHandler_Destroy((const PPP_MessageHandler*)_interface, iterator); + } + return nullptr; +} +char* Call_PPP_Messaging_HandleMessage(const PPP_Messaging* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + struct PP_Var message; + iterator.skip(); + FromJSON_PP_Var(iterator, message); + _interface->HandleMessage((PP_Instance )instance, (struct PP_Var )message); + return nullptr; +} +char* Call_PPP_Messaging(const void* _interface, JSONIterator& iterator) { + iterator.skip(); + const Token& member = iterator.getCurrentStringAndGotoNext(); + string memberName = member.value(); + if (!memberName.compare("HandleMessage")) { + return Call_PPP_Messaging_HandleMessage((const PPP_Messaging*)_interface, iterator); + } + return nullptr; +} +char* Call_PPP_MouseLock_MouseLockLost(const PPP_MouseLock* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + _interface->MouseLockLost((PP_Instance )instance); + return nullptr; +} +char* Call_PPP_MouseLock(const void* _interface, JSONIterator& iterator) { + iterator.skip(); + const Token& member = iterator.getCurrentStringAndGotoNext(); + string memberName = member.value(); + if (!memberName.compare("MouseLockLost")) { + return Call_PPP_MouseLock_MouseLockLost((const PPP_MouseLock*)_interface, iterator); + } + return nullptr; +} +namespace ns_PPB_BrokerTrusted_0_2 { +static PP_Resource CreateTrusted_0_2(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_BrokerTrusted\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"CreateTrusted\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_BrokerTrusted_0_2*)RealGetInterface("PPB_BrokerTrusted;0.2"))->CreateTrusted(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsBrokerTrusted_0_2(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_BrokerTrusted\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"IsBrokerTrusted\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_BrokerTrusted_0_2*)RealGetInterface("PPB_BrokerTrusted;0.2"))->IsBrokerTrusted(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Connect_0_2(PP_Resource broker, struct PP_CompletionCallback connect_callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_BrokerTrusted\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"Connect\""); + AddProp(ss, "broker", ToString_PP_Resource(broker)); + AddProp(ss, "connect_callback", ToString_PP_CompletionCallback(connect_callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_connect_callback; + logging_connect_callback.func = &Logging_PP_CompletionCallback; + logging_connect_callback.user_data = new PP_CompletionCallback(connect_callback); + logging_connect_callback.flags = connect_callback.flags; + int32_t rval = ((PPB_BrokerTrusted_0_2*)RealGetInterface("PPB_BrokerTrusted;0.2"))->Connect(broker, logging_connect_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetHandle_0_2(PP_Resource broker, int32_t* handle) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_BrokerTrusted\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"GetHandle\""); + AddProp(ss, "broker", ToString_PP_Resource(broker)); + AddProp(ss, "handle", PointerToString(handle)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_int32_t(iterator, *handle); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_BrokerTrusted_0_2*)RealGetInterface("PPB_BrokerTrusted;0.2"))->GetHandle(broker, handle); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!handle) { + AddProp(os, "handle", ToString_int32_t(handle)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping IsAllowed */ +} +static PPB_BrokerTrusted_0_2 _PPB_BrokerTrusted_0_2 = { + ns_PPB_BrokerTrusted_0_2::CreateTrusted_0_2, + ns_PPB_BrokerTrusted_0_2::IsBrokerTrusted_0_2, + ns_PPB_BrokerTrusted_0_2::Connect_0_2, + ns_PPB_BrokerTrusted_0_2::GetHandle_0_2, +}; +const string ToString_PPB_BrokerTrusted(const PPB_BrokerTrusted_0_2 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_BrokerTrusted_0_3 { +static PP_Resource CreateTrusted_0_3(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_BrokerTrusted\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"CreateTrusted\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_BrokerTrusted_0_3*)RealGetInterface("PPB_BrokerTrusted;0.3"))->CreateTrusted(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsBrokerTrusted_0_3(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_BrokerTrusted\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"IsBrokerTrusted\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_BrokerTrusted_0_3*)RealGetInterface("PPB_BrokerTrusted;0.3"))->IsBrokerTrusted(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Connect_0_3(PP_Resource broker, struct PP_CompletionCallback connect_callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_BrokerTrusted\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"Connect\""); + AddProp(ss, "broker", ToString_PP_Resource(broker)); + AddProp(ss, "connect_callback", ToString_PP_CompletionCallback(connect_callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_connect_callback; + logging_connect_callback.func = &Logging_PP_CompletionCallback; + logging_connect_callback.user_data = new PP_CompletionCallback(connect_callback); + logging_connect_callback.flags = connect_callback.flags; + int32_t rval = ((PPB_BrokerTrusted_0_3*)RealGetInterface("PPB_BrokerTrusted;0.3"))->Connect(broker, logging_connect_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetHandle_0_3(PP_Resource broker, int32_t* handle) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_BrokerTrusted\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"GetHandle\""); + AddProp(ss, "broker", ToString_PP_Resource(broker)); + AddProp(ss, "handle", PointerToString(handle)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_int32_t(iterator, *handle); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_BrokerTrusted_0_3*)RealGetInterface("PPB_BrokerTrusted;0.3"))->GetHandle(broker, handle); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!handle) { + AddProp(os, "handle", ToString_int32_t(handle)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsAllowed_0_3(PP_Resource broker) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_BrokerTrusted\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"IsAllowed\""); + AddProp(ss, "broker", ToString_PP_Resource(broker)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_BrokerTrusted_0_3*)RealGetInterface("PPB_BrokerTrusted;0.3"))->IsAllowed(broker); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_BrokerTrusted_0_3 _PPB_BrokerTrusted_0_3 = { + ns_PPB_BrokerTrusted_0_3::CreateTrusted_0_3, + ns_PPB_BrokerTrusted_0_3::IsBrokerTrusted_0_3, + ns_PPB_BrokerTrusted_0_3::Connect_0_3, + ns_PPB_BrokerTrusted_0_3::GetHandle_0_3, + ns_PPB_BrokerTrusted_0_3::IsAllowed_0_3, +}; +const string ToString_PPB_BrokerTrusted(const PPB_BrokerTrusted_0_3 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_BrowserFont_Trusted_Family(const PP_BrowserFont_Trusted_Family *v) { + switch (*v) { + case 0: + return "\"PP_BROWSERFONT_TRUSTED_FAMILY_DEFAULT\""; + case 1: + return "\"PP_BROWSERFONT_TRUSTED_FAMILY_SERIF\""; + case 2: + return "\"PP_BROWSERFONT_TRUSTED_FAMILY_SANSSERIF\""; + case 3: + return "\"PP_BROWSERFONT_TRUSTED_FAMILY_MONOSPACE\""; + default: + return "\"???\""; + } +} +const string ToString_PP_BrowserFont_Trusted_Family(const PP_BrowserFont_Trusted_Family &v) { + return ToString_PP_BrowserFont_Trusted_Family(&v); +} +void FromJSON_PP_BrowserFont_Trusted_Family(JSONIterator& iterator, PP_BrowserFont_Trusted_Family &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_BrowserFont_Trusted_Family(v); +} +const string ToString_PP_BrowserFont_Trusted_Weight(const PP_BrowserFont_Trusted_Weight *v) { + switch (*v) { + case 0: + return "\"PP_BROWSERFONT_TRUSTED_WEIGHT_100\""; + case 1: + return "\"PP_BROWSERFONT_TRUSTED_WEIGHT_200\""; + case 2: + return "\"PP_BROWSERFONT_TRUSTED_WEIGHT_300\""; + case 3: + return "\"PP_BROWSERFONT_TRUSTED_WEIGHT_400\""; + case 4: + return "\"PP_BROWSERFONT_TRUSTED_WEIGHT_500\""; + case 5: + return "\"PP_BROWSERFONT_TRUSTED_WEIGHT_600\""; + case 6: + return "\"PP_BROWSERFONT_TRUSTED_WEIGHT_700\""; + case 7: + return "\"PP_BROWSERFONT_TRUSTED_WEIGHT_800\""; + case 8: + return "\"PP_BROWSERFONT_TRUSTED_WEIGHT_900\""; + default: + return "\"???\""; + } +} +const string ToString_PP_BrowserFont_Trusted_Weight(const PP_BrowserFont_Trusted_Weight &v) { + return ToString_PP_BrowserFont_Trusted_Weight(&v); +} +void FromJSON_PP_BrowserFont_Trusted_Weight(JSONIterator& iterator, PP_BrowserFont_Trusted_Weight &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_BrowserFont_Trusted_Weight(v); +} +const string ToString_PP_BrowserFont_Trusted_Description(const PP_BrowserFont_Trusted_Description *v) { + if (!v) { + return "null"; + } + return ToString_PP_BrowserFont_Trusted_Description(*v); +} +const string ToString_PP_BrowserFont_Trusted_Description(const PP_BrowserFont_Trusted_Description &v) { + stringstream x; + BeginProps(x); + AddProp(x, "face", ToString_PP_Var(v.face)); + AddProp(x, "family", ToString_PP_BrowserFont_Trusted_Family(v.family)); + AddProp(x, "size", ToString_uint32_t(v.size)); + AddProp(x, "weight", ToString_PP_BrowserFont_Trusted_Weight(v.weight)); + AddProp(x, "italic", ToString_PP_Bool(v.italic)); + AddProp(x, "small_caps", ToString_PP_Bool(v.small_caps)); + AddProp(x, "letter_spacing", ToString_int32_t(v.letter_spacing)); + AddProp(x, "word_spacing", ToString_int32_t(v.word_spacing)); + AddProp(x, "padding", ToString_int32_t(v.padding)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_BrowserFont_Trusted_Description(JSONIterator& iterator, PP_BrowserFont_Trusted_Description &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_PP_Var(iterator, value.face); + iterator.skip(); + FromJSON_PP_BrowserFont_Trusted_Family(iterator, value.family); + iterator.skip(); + FromJSON_uint32_t(iterator, value.size); + iterator.skip(); + FromJSON_PP_BrowserFont_Trusted_Weight(iterator, value.weight); + iterator.skip(); + FromJSON_PP_Bool(iterator, value.italic); + iterator.skip(); + FromJSON_PP_Bool(iterator, value.small_caps); + iterator.skip(); + FromJSON_int32_t(iterator, value.letter_spacing); + iterator.skip(); + FromJSON_int32_t(iterator, value.word_spacing); + iterator.skip(); + FromJSON_int32_t(iterator, value.padding); +} +const string ToString_PP_BrowserFont_Trusted_Metrics(const PP_BrowserFont_Trusted_Metrics *v) { + if (!v) { + return "null"; + } + return ToString_PP_BrowserFont_Trusted_Metrics(*v); +} +const string ToString_PP_BrowserFont_Trusted_Metrics(const PP_BrowserFont_Trusted_Metrics &v) { + stringstream x; + BeginProps(x); + AddProp(x, "height", ToString_int32_t(v.height)); + AddProp(x, "ascent", ToString_int32_t(v.ascent)); + AddProp(x, "descent", ToString_int32_t(v.descent)); + AddProp(x, "line_spacing", ToString_int32_t(v.line_spacing)); + AddProp(x, "x_height", ToString_int32_t(v.x_height)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_BrowserFont_Trusted_Metrics(JSONIterator& iterator, PP_BrowserFont_Trusted_Metrics &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_int32_t(iterator, value.height); + iterator.skip(); + FromJSON_int32_t(iterator, value.ascent); + iterator.skip(); + FromJSON_int32_t(iterator, value.descent); + iterator.skip(); + FromJSON_int32_t(iterator, value.line_spacing); + iterator.skip(); + FromJSON_int32_t(iterator, value.x_height); +} +const string ToString_PP_BrowserFont_Trusted_TextRun(const PP_BrowserFont_Trusted_TextRun *v) { + if (!v) { + return "null"; + } + return ToString_PP_BrowserFont_Trusted_TextRun(*v); +} +const string ToString_PP_BrowserFont_Trusted_TextRun(const PP_BrowserFont_Trusted_TextRun &v) { + stringstream x; + BeginProps(x); + AddProp(x, "text", ToString_PP_Var(v.text)); + AddProp(x, "rtl", ToString_PP_Bool(v.rtl)); + AddProp(x, "override_direction", ToString_PP_Bool(v.override_direction)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_BrowserFont_Trusted_TextRun(JSONIterator& iterator, PP_BrowserFont_Trusted_TextRun &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_PP_Var(iterator, value.text); + iterator.skip(); + FromJSON_PP_Bool(iterator, value.rtl); + iterator.skip(); + FromJSON_PP_Bool(iterator, value.override_direction); +} +namespace ns_PPB_BrowserFont_Trusted_1_0 { +static struct PP_Var GetFontFamilies_1_0(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_BrowserFont_Trusted\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetFontFamilies\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_BrowserFont_Trusted_1_0*)RealGetInterface("PPB_BrowserFont_Trusted;1.0"))->GetFontFamilies(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource Create_1_0(PP_Instance instance, const struct PP_BrowserFont_Trusted_Description* description) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_BrowserFont_Trusted\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "description", ToString_PP_BrowserFont_Trusted_Description(description)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_BrowserFont_Trusted_1_0*)RealGetInterface("PPB_BrowserFont_Trusted;1.0"))->Create(instance, description); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsFont_1_0(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_BrowserFont_Trusted\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsFont\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_BrowserFont_Trusted_1_0*)RealGetInterface("PPB_BrowserFont_Trusted;1.0"))->IsFont(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool Describe_1_0(PP_Resource font, struct PP_BrowserFont_Trusted_Description* description, struct PP_BrowserFont_Trusted_Metrics* metrics) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_BrowserFont_Trusted\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Describe\""); + AddProp(ss, "font", ToString_PP_Resource(font)); + AddProp(ss, "description", PointerToString(description)); + AddProp(ss, "metrics", PointerToString(metrics)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!description) { + iterator.skip(); + FromJSON_PP_BrowserFont_Trusted_Description(iterator, *description); + } + if (!!metrics) { + iterator.skip(); + FromJSON_PP_BrowserFont_Trusted_Metrics(iterator, *metrics); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_BrowserFont_Trusted_1_0*)RealGetInterface("PPB_BrowserFont_Trusted;1.0"))->Describe(font, description, metrics); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!description) { + AddProp(os, "description", ToString_PP_BrowserFont_Trusted_Description(description)); + } + if (!!metrics) { + AddProp(os, "metrics", ToString_PP_BrowserFont_Trusted_Metrics(metrics)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool DrawTextAt_1_0(PP_Resource font, PP_Resource image_data, const struct PP_BrowserFont_Trusted_TextRun* text, const struct PP_Point* position, uint32_t color, const struct PP_Rect* clip, PP_Bool image_data_is_opaque) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_BrowserFont_Trusted\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"DrawTextAt\""); + AddProp(ss, "font", ToString_PP_Resource(font)); + AddProp(ss, "image_data", ToString_PP_Resource(image_data)); + AddProp(ss, "text", ToString_PP_BrowserFont_Trusted_TextRun(text)); + AddProp(ss, "position", ToString_PP_Point(position)); + AddProp(ss, "color", ToString_uint32_t(color)); + AddProp(ss, "clip", ToString_PP_Rect(clip)); + AddProp(ss, "image_data_is_opaque", ToString_PP_Bool(image_data_is_opaque)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_BrowserFont_Trusted_1_0*)RealGetInterface("PPB_BrowserFont_Trusted;1.0"))->DrawTextAt(font, image_data, text, position, color, clip, image_data_is_opaque); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t MeasureText_1_0(PP_Resource font, const struct PP_BrowserFont_Trusted_TextRun* text) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_BrowserFont_Trusted\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"MeasureText\""); + AddProp(ss, "font", ToString_PP_Resource(font)); + AddProp(ss, "text", ToString_PP_BrowserFont_Trusted_TextRun(text)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_BrowserFont_Trusted_1_0*)RealGetInterface("PPB_BrowserFont_Trusted;1.0"))->MeasureText(font, text); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint32_t CharacterOffsetForPixel_1_0(PP_Resource font, const struct PP_BrowserFont_Trusted_TextRun* text, int32_t pixel_position) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_BrowserFont_Trusted\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"CharacterOffsetForPixel\""); + AddProp(ss, "font", ToString_PP_Resource(font)); + AddProp(ss, "text", ToString_PP_BrowserFont_Trusted_TextRun(text)); + AddProp(ss, "pixel_position", ToString_int32_t(pixel_position)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint32_t rval = ((PPB_BrowserFont_Trusted_1_0*)RealGetInterface("PPB_BrowserFont_Trusted;1.0"))->CharacterOffsetForPixel(font, text, pixel_position); + printf("RPC response: ["); + printf("%s", ToString_uint32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t PixelOffsetForCharacter_1_0(PP_Resource font, const struct PP_BrowserFont_Trusted_TextRun* text, uint32_t char_offset) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_BrowserFont_Trusted\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"PixelOffsetForCharacter\""); + AddProp(ss, "font", ToString_PP_Resource(font)); + AddProp(ss, "text", ToString_PP_BrowserFont_Trusted_TextRun(text)); + AddProp(ss, "char_offset", ToString_uint32_t(char_offset)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_BrowserFont_Trusted_1_0*)RealGetInterface("PPB_BrowserFont_Trusted;1.0"))->PixelOffsetForCharacter(font, text, char_offset); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_BrowserFont_Trusted_1_0 _PPB_BrowserFont_Trusted_1_0 = { + ns_PPB_BrowserFont_Trusted_1_0::GetFontFamilies_1_0, + ns_PPB_BrowserFont_Trusted_1_0::Create_1_0, + ns_PPB_BrowserFont_Trusted_1_0::IsFont_1_0, + ns_PPB_BrowserFont_Trusted_1_0::Describe_1_0, + ns_PPB_BrowserFont_Trusted_1_0::DrawTextAt_1_0, + ns_PPB_BrowserFont_Trusted_1_0::MeasureText_1_0, + ns_PPB_BrowserFont_Trusted_1_0::CharacterOffsetForPixel_1_0, + ns_PPB_BrowserFont_Trusted_1_0::PixelOffsetForCharacter_1_0, +}; +const string ToString_PPB_BrowserFont_Trusted(const PPB_BrowserFont_Trusted_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_CharSet_Trusted_ConversionError(const PP_CharSet_Trusted_ConversionError *v) { + switch (*v) { + case 0: + return "\"PP_CHARSET_TRUSTED_CONVERSIONERROR_FAIL\""; + case 1: + return "\"PP_CHARSET_TRUSTED_CONVERSIONERROR_SKIP\""; + case 2: + return "\"PP_CHARSET_TRUSTED_CONVERSIONERROR_SUBSTITUTE\""; + default: + return "\"???\""; + } +} +const string ToString_PP_CharSet_Trusted_ConversionError(const PP_CharSet_Trusted_ConversionError &v) { + return ToString_PP_CharSet_Trusted_ConversionError(&v); +} +void FromJSON_PP_CharSet_Trusted_ConversionError(JSONIterator& iterator, PP_CharSet_Trusted_ConversionError &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_CharSet_Trusted_ConversionError(v); +} +namespace ns_PPB_CharSet_Trusted_1_0 { +static PP_Bool UTF16ToCharSet_1_0(const uint16_t utf16[], uint32_t utf16_len, const char* output_char_set, PP_CharSet_Trusted_ConversionError on_error, char* output_buffer, uint32_t* output_length) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CharSet_Trusted\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"UTF16ToCharSet\""); + { + BeginProp(ss, "utf16"); + BeginElements(ss); + for (uint32_t _n = 0; _n < utf16_len; ++_n) { + AddElement(ss, ToString_uint16_t(utf16[_n])); + } + EndElements(ss); + } + AddProp(ss, "utf16_len", ToString_uint32_t(utf16_len)); + AddProp(ss, "output_char_set", ToString_str_t(output_char_set)); + AddProp(ss, "on_error", ToString_PP_CharSet_Trusted_ConversionError(on_error)); + AddProp(ss, "output_buffer", PointerToString(output_buffer)); + AddProp(ss, "output_length", ToString_uint32_t(output_length)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_str_t(iterator, output_buffer); + iterator.skip(); + FromJSON_uint32_t(iterator, *output_length); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_CharSet_Trusted_1_0*)RealGetInterface("PPB_CharSet_Trusted;1.0"))->UTF16ToCharSet(utf16, utf16_len, output_char_set, on_error, output_buffer, output_length); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + AddProp(os, "output_buffer", ToString_str_t(output_buffer)); + AddProp(os, "output_length", ToString_uint32_t(output_length)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool CharSetToUTF16_1_0(const char* input, uint32_t input_len, const char* input_char_set, PP_CharSet_Trusted_ConversionError on_error, uint16_t* output_buffer, uint32_t* output_utf16_length) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CharSet_Trusted\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"CharSetToUTF16\""); + AddProp(ss, "input", ToString_str_t(input)); + AddProp(ss, "input_len", ToString_uint32_t(input_len)); + AddProp(ss, "input_char_set", ToString_str_t(input_char_set)); + AddProp(ss, "on_error", ToString_PP_CharSet_Trusted_ConversionError(on_error)); + AddProp(ss, "output_buffer", PointerToString(output_buffer)); + AddProp(ss, "output_utf16_length", ToString_uint32_t(output_utf16_length)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_uint16_t(iterator, *output_buffer); + iterator.skip(); + FromJSON_uint32_t(iterator, *output_utf16_length); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_CharSet_Trusted_1_0*)RealGetInterface("PPB_CharSet_Trusted;1.0"))->CharSetToUTF16(input, input_len, input_char_set, on_error, output_buffer, output_utf16_length); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!output_buffer) { + AddProp(os, "output_buffer", ToString_uint16_t(output_buffer)); + } + AddProp(os, "output_utf16_length", ToString_uint32_t(output_utf16_length)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetDefaultCharSet_1_0(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CharSet_Trusted\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetDefaultCharSet\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_CharSet_Trusted_1_0*)RealGetInterface("PPB_CharSet_Trusted;1.0"))->GetDefaultCharSet(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_CharSet_Trusted_1_0 _PPB_CharSet_Trusted_1_0 = { + ns_PPB_CharSet_Trusted_1_0::UTF16ToCharSet_1_0, + ns_PPB_CharSet_Trusted_1_0::CharSetToUTF16_1_0, + ns_PPB_CharSet_Trusted_1_0::GetDefaultCharSet_1_0, +}; +const string ToString_PPB_CharSet_Trusted(const PPB_CharSet_Trusted_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_FileChooserTrusted_0_5 { +static int32_t ShowWithoutUserGesture_0_5(PP_Resource chooser, PP_Bool save_as, struct PP_Var suggested_file_name, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileChooserTrusted\""); + AddProp(ss, "__version", "\"0.5\""); + AddProp(ss, "__method", "\"ShowWithoutUserGesture\""); + AddProp(ss, "chooser", ToString_PP_Resource(chooser)); + AddProp(ss, "save_as", ToString_PP_Bool(save_as)); + AddProp(ss, "suggested_file_name", ToString_PP_Var(suggested_file_name)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileChooserTrusted_0_5*)RealGetInterface("PPB_FileChooserTrusted;0.5"))->ShowWithoutUserGesture(chooser, save_as, suggested_file_name, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping ShowWithoutUserGesture */ +} +static PPB_FileChooserTrusted_0_5 _PPB_FileChooserTrusted_0_5 = { + ns_PPB_FileChooserTrusted_0_5::ShowWithoutUserGesture_0_5, +}; +const string ToString_PPB_FileChooserTrusted(const PPB_FileChooserTrusted_0_5 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_FileChooserTrusted_0_6 { +/* skipping ShowWithoutUserGesture */ +static int32_t ShowWithoutUserGesture_0_6(PP_Resource chooser, PP_Bool save_as, struct PP_Var suggested_file_name, struct PP_ArrayOutput output, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileChooserTrusted\""); + AddProp(ss, "__version", "\"0.6\""); + AddProp(ss, "__method", "\"ShowWithoutUserGesture\""); + AddProp(ss, "chooser", ToString_PP_Resource(chooser)); + AddProp(ss, "save_as", ToString_PP_Bool(save_as)); + AddProp(ss, "suggested_file_name", ToString_PP_Var(suggested_file_name)); + AddProp(ss, "output", ToString_PP_ArrayOutput(output)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileChooserTrusted_0_6*)RealGetInterface("PPB_FileChooserTrusted;0.6"))->ShowWithoutUserGesture(chooser, save_as, suggested_file_name, output, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_FileChooserTrusted_0_6 _PPB_FileChooserTrusted_0_6 = { + ns_PPB_FileChooserTrusted_0_6::ShowWithoutUserGesture_0_6, +}; +const string ToString_PPB_FileChooserTrusted(const PPB_FileChooserTrusted_0_6 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_URLLoaderTrusted_StatusCallback(const PP_URLLoaderTrusted_StatusCallback &v) { + return PointerToString(v); +} +void FromJSON_PP_URLLoaderTrusted_StatusCallback(JSONIterator& iterator, PP_URLLoaderTrusted_StatusCallback &value) { + PointerValueFromJSON(iterator, value); +} +namespace ns_PPB_URLLoaderTrusted_0_3 { +static void GrantUniversalAccess_0_3(PP_Resource loader) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLLoaderTrusted\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"GrantUniversalAccess\""); + AddProp(ss, "loader", ToString_PP_Resource(loader)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_URLLoaderTrusted_0_3*)RealGetInterface("PPB_URLLoaderTrusted;0.3"))->GrantUniversalAccess(loader); +#endif // !INTERPOSE +} +static void RegisterStatusCallback_0_3(PP_Resource loader, PP_URLLoaderTrusted_StatusCallback cb) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLLoaderTrusted\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"RegisterStatusCallback\""); + AddProp(ss, "loader", ToString_PP_Resource(loader)); + AddProp(ss, "cb", ToString_PP_URLLoaderTrusted_StatusCallback(cb)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_URLLoaderTrusted_0_3*)RealGetInterface("PPB_URLLoaderTrusted;0.3"))->RegisterStatusCallback(loader, cb); +#endif // !INTERPOSE +} +} +static PPB_URLLoaderTrusted_0_3 _PPB_URLLoaderTrusted_0_3 = { + ns_PPB_URLLoaderTrusted_0_3::GrantUniversalAccess_0_3, + ns_PPB_URLLoaderTrusted_0_3::RegisterStatusCallback_0_3, +}; +const string ToString_PPB_URLLoaderTrusted(const PPB_URLLoaderTrusted_0_3 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_CursorType_Dev(const PP_CursorType_Dev *v) { + switch (*v) { + case -1: + return "\"PP_CURSORTYPE_CUSTOM\""; + case 0: + return "\"PP_CURSORTYPE_POINTER\""; + case 1: + return "\"PP_CURSORTYPE_CROSS\""; + case 2: + return "\"PP_CURSORTYPE_HAND\""; + case 3: + return "\"PP_CURSORTYPE_IBEAM\""; + case 4: + return "\"PP_CURSORTYPE_WAIT\""; + case 5: + return "\"PP_CURSORTYPE_HELP\""; + case 6: + return "\"PP_CURSORTYPE_EASTRESIZE\""; + case 7: + return "\"PP_CURSORTYPE_NORTHRESIZE\""; + case 8: + return "\"PP_CURSORTYPE_NORTHEASTRESIZE\""; + case 9: + return "\"PP_CURSORTYPE_NORTHWESTRESIZE\""; + case 10: + return "\"PP_CURSORTYPE_SOUTHRESIZE\""; + case 11: + return "\"PP_CURSORTYPE_SOUTHEASTRESIZE\""; + case 12: + return "\"PP_CURSORTYPE_SOUTHWESTRESIZE\""; + case 13: + return "\"PP_CURSORTYPE_WESTRESIZE\""; + case 14: + return "\"PP_CURSORTYPE_NORTHSOUTHRESIZE\""; + case 15: + return "\"PP_CURSORTYPE_EASTWESTRESIZE\""; + case 16: + return "\"PP_CURSORTYPE_NORTHEASTSOUTHWESTRESIZE\""; + case 17: + return "\"PP_CURSORTYPE_NORTHWESTSOUTHEASTRESIZE\""; + case 18: + return "\"PP_CURSORTYPE_COLUMNRESIZE\""; + case 19: + return "\"PP_CURSORTYPE_ROWRESIZE\""; + case 20: + return "\"PP_CURSORTYPE_MIDDLEPANNING\""; + case 21: + return "\"PP_CURSORTYPE_EASTPANNING\""; + case 22: + return "\"PP_CURSORTYPE_NORTHPANNING\""; + case 23: + return "\"PP_CURSORTYPE_NORTHEASTPANNING\""; + case 24: + return "\"PP_CURSORTYPE_NORTHWESTPANNING\""; + case 25: + return "\"PP_CURSORTYPE_SOUTHPANNING\""; + case 26: + return "\"PP_CURSORTYPE_SOUTHEASTPANNING\""; + case 27: + return "\"PP_CURSORTYPE_SOUTHWESTPANNING\""; + case 28: + return "\"PP_CURSORTYPE_WESTPANNING\""; + case 29: + return "\"PP_CURSORTYPE_MOVE\""; + case 30: + return "\"PP_CURSORTYPE_VERTICALTEXT\""; + case 31: + return "\"PP_CURSORTYPE_CELL\""; + case 32: + return "\"PP_CURSORTYPE_CONTEXTMENU\""; + case 33: + return "\"PP_CURSORTYPE_ALIAS\""; + case 34: + return "\"PP_CURSORTYPE_PROGRESS\""; + case 35: + return "\"PP_CURSORTYPE_NODROP\""; + case 36: + return "\"PP_CURSORTYPE_COPY\""; + case 37: + return "\"PP_CURSORTYPE_NONE\""; + case 38: + return "\"PP_CURSORTYPE_NOTALLOWED\""; + case 39: + return "\"PP_CURSORTYPE_ZOOMIN\""; + case 40: + return "\"PP_CURSORTYPE_ZOOMOUT\""; + case 41: + return "\"PP_CURSORTYPE_GRAB\""; + case 42: + return "\"PP_CURSORTYPE_GRABBING\""; + default: + return "\"???\""; + } +} +const string ToString_PP_CursorType_Dev(const PP_CursorType_Dev &v) { + return ToString_PP_CursorType_Dev(&v); +} +void FromJSON_PP_CursorType_Dev(JSONIterator& iterator, PP_CursorType_Dev &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_CursorType_Dev(v); +} +const string ToString_PP_PrintOrientation_Dev(const PP_PrintOrientation_Dev *v) { + switch (*v) { + case 0: + return "\"PP_PRINTORIENTATION_NORMAL\""; + case 1: + return "\"PP_PRINTORIENTATION_ROTATED_90_CW\""; + case 2: + return "\"PP_PRINTORIENTATION_ROTATED_180\""; + case 3: + return "\"PP_PRINTORIENTATION_ROTATED_90_CCW\""; + default: + return "\"???\""; + } +} +const string ToString_PP_PrintOrientation_Dev(const PP_PrintOrientation_Dev &v) { + return ToString_PP_PrintOrientation_Dev(&v); +} +void FromJSON_PP_PrintOrientation_Dev(JSONIterator& iterator, PP_PrintOrientation_Dev &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_PrintOrientation_Dev(v); +} +const string ToString_PP_PrintOutputFormat_Dev(const PP_PrintOutputFormat_Dev *v) { + switch (*v) { + case 1u << 0: + return "\"PP_PRINTOUTPUTFORMAT_RASTER\""; + case 1u << 1: + return "\"PP_PRINTOUTPUTFORMAT_PDF\""; + case 1u << 2: + return "\"PP_PRINTOUTPUTFORMAT_POSTSCRIPT\""; + case 1u << 3: + return "\"PP_PRINTOUTPUTFORMAT_EMF\""; + default: + return "\"???\""; + } +} +const string ToString_PP_PrintOutputFormat_Dev(const PP_PrintOutputFormat_Dev &v) { + return ToString_PP_PrintOutputFormat_Dev(&v); +} +void FromJSON_PP_PrintOutputFormat_Dev(JSONIterator& iterator, PP_PrintOutputFormat_Dev &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_PrintOutputFormat_Dev(v); +} +const string ToString_PP_PrintScalingOption_Dev(const PP_PrintScalingOption_Dev *v) { + switch (*v) { + case 0: + return "\"PP_PRINTSCALINGOPTION_NONE\""; + case 1: + return "\"PP_PRINTSCALINGOPTION_FIT_TO_PRINTABLE_AREA\""; + case 2: + return "\"PP_PRINTSCALINGOPTION_SOURCE_SIZE\""; + default: + return "\"???\""; + } +} +const string ToString_PP_PrintScalingOption_Dev(const PP_PrintScalingOption_Dev &v) { + return ToString_PP_PrintScalingOption_Dev(&v); +} +void FromJSON_PP_PrintScalingOption_Dev(JSONIterator& iterator, PP_PrintScalingOption_Dev &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_PrintScalingOption_Dev(v); +} +const string ToString_PP_PrintSettings_Dev(const PP_PrintSettings_Dev *v) { + if (!v) { + return "null"; + } + return ToString_PP_PrintSettings_Dev(*v); +} +const string ToString_PP_PrintSettings_Dev(const PP_PrintSettings_Dev &v) { + stringstream x; + BeginProps(x); + AddProp(x, "printable_area", ToString_PP_Rect(v.printable_area)); + AddProp(x, "content_area", ToString_PP_Rect(v.content_area)); + AddProp(x, "paper_size", ToString_PP_Size(v.paper_size)); + AddProp(x, "dpi", ToString_int32_t(v.dpi)); + AddProp(x, "orientation", ToString_PP_PrintOrientation_Dev(v.orientation)); + AddProp(x, "print_scaling_option", ToString_PP_PrintScalingOption_Dev(v.print_scaling_option)); + AddProp(x, "grayscale", ToString_PP_Bool(v.grayscale)); + AddProp(x, "format", ToString_PP_PrintOutputFormat_Dev(v.format)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_PrintSettings_Dev(JSONIterator& iterator, PP_PrintSettings_Dev &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_PP_Rect(iterator, value.printable_area); + iterator.skip(); + FromJSON_PP_Rect(iterator, value.content_area); + iterator.skip(); + FromJSON_PP_Size(iterator, value.paper_size); + iterator.skip(); + FromJSON_int32_t(iterator, value.dpi); + iterator.skip(); + FromJSON_PP_PrintOrientation_Dev(iterator, value.orientation); + iterator.skip(); + FromJSON_PP_PrintScalingOption_Dev(iterator, value.print_scaling_option); + iterator.skip(); + FromJSON_PP_Bool(iterator, value.grayscale); + iterator.skip(); + FromJSON_PP_PrintOutputFormat_Dev(iterator, value.format); +} +const string ToString_PP_VideoCaptureDeviceInfo_Dev(const PP_VideoCaptureDeviceInfo_Dev *v) { + if (!v) { + return "null"; + } + return ToString_PP_VideoCaptureDeviceInfo_Dev(*v); +} +const string ToString_PP_VideoCaptureDeviceInfo_Dev(const PP_VideoCaptureDeviceInfo_Dev &v) { + stringstream x; + BeginProps(x); + AddProp(x, "width", ToString_uint32_t(v.width)); + AddProp(x, "height", ToString_uint32_t(v.height)); + AddProp(x, "frames_per_second", ToString_uint32_t(v.frames_per_second)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_VideoCaptureDeviceInfo_Dev(JSONIterator& iterator, PP_VideoCaptureDeviceInfo_Dev &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_uint32_t(iterator, value.width); + iterator.skip(); + FromJSON_uint32_t(iterator, value.height); + iterator.skip(); + FromJSON_uint32_t(iterator, value.frames_per_second); +} +const string ToString_PP_VideoCaptureStatus_Dev(const PP_VideoCaptureStatus_Dev *v) { + switch (*v) { + case 0: + return "\"PP_VIDEO_CAPTURE_STATUS_STOPPED\""; + case 1: + return "\"PP_VIDEO_CAPTURE_STATUS_STARTING\""; + case 2: + return "\"PP_VIDEO_CAPTURE_STATUS_STARTED\""; + case 3: + return "\"PP_VIDEO_CAPTURE_STATUS_PAUSED\""; + case 4: + return "\"PP_VIDEO_CAPTURE_STATUS_STOPPING\""; + default: + return "\"???\""; + } +} +const string ToString_PP_VideoCaptureStatus_Dev(const PP_VideoCaptureStatus_Dev &v) { + return ToString_PP_VideoCaptureStatus_Dev(&v); +} +void FromJSON_PP_VideoCaptureStatus_Dev(JSONIterator& iterator, PP_VideoCaptureStatus_Dev &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_VideoCaptureStatus_Dev(v); +} +const string ToString_PP_VideoDecoder_Profile(const PP_VideoDecoder_Profile *v) { + switch (*v) { + case -1: + return "\"PP_VIDEODECODER_PROFILE_UNKNOWN\""; + case 0: + return "\"PP_VIDEODECODER_H264PROFILE_NONE\""; + case 1: + return "\"PP_VIDEODECODER_H264PROFILE_BASELINE\""; + case 2: + return "\"PP_VIDEODECODER_H264PROFILE_MAIN\""; + case 3: + return "\"PP_VIDEODECODER_H264PROFILE_EXTENDED\""; + case 4: + return "\"PP_VIDEODECODER_H264PROFILE_HIGH\""; + case 5: + return "\"PP_VIDEODECODER_H264PROFILE_HIGH10PROFILE\""; + case 6: + return "\"PP_VIDEODECODER_H264PROFILE_HIGH422PROFILE\""; + case 7: + return "\"PP_VIDEODECODER_H264PROFILE_HIGH444PREDICTIVEPROFILE\""; + case 8: + return "\"PP_VIDEODECODER_H264PROFILE_SCALABLEBASELINE\""; + case 9: + return "\"PP_VIDEODECODER_H264PROFILE_SCALABLEHIGH\""; + case 10: + return "\"PP_VIDEODECODER_H264PROFILE_STEREOHIGH\""; + case 11: + return "\"PP_VIDEODECODER_H264PROFILE_MULTIVIEWHIGH\""; + case 12: + return "\"PP_VIDEODECODER_VP8PROFILE_ANY\""; + default: + return "\"???\""; + } +} +const string ToString_PP_VideoDecoder_Profile(const PP_VideoDecoder_Profile &v) { + return ToString_PP_VideoDecoder_Profile(&v); +} +void FromJSON_PP_VideoDecoder_Profile(JSONIterator& iterator, PP_VideoDecoder_Profile &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_VideoDecoder_Profile(v); +} +const string ToString_PP_VideoBitstreamBuffer_Dev(const PP_VideoBitstreamBuffer_Dev *v) { + if (!v) { + return "null"; + } + return ToString_PP_VideoBitstreamBuffer_Dev(*v); +} +const string ToString_PP_VideoBitstreamBuffer_Dev(const PP_VideoBitstreamBuffer_Dev &v) { + stringstream x; + BeginProps(x); + AddProp(x, "id", ToString_int32_t(v.id)); + AddProp(x, "data", ToString_PP_Resource(v.data)); + AddProp(x, "size", ToString_uint32_t(v.size)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_VideoBitstreamBuffer_Dev(JSONIterator& iterator, PP_VideoBitstreamBuffer_Dev &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_int32_t(iterator, value.id); + iterator.skip(); + FromJSON_PP_Resource(iterator, value.data); + iterator.skip(); + FromJSON_uint32_t(iterator, value.size); +} +const string ToString_PP_PictureBuffer_Dev(const PP_PictureBuffer_Dev *v) { + if (!v) { + return "null"; + } + return ToString_PP_PictureBuffer_Dev(*v); +} +const string ToString_PP_PictureBuffer_Dev(const PP_PictureBuffer_Dev &v) { + stringstream x; + BeginProps(x); + AddProp(x, "id", ToString_int32_t(v.id)); + AddProp(x, "size", ToString_PP_Size(v.size)); + AddProp(x, "texture_id", ToString_uint32_t(v.texture_id)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_PictureBuffer_Dev(JSONIterator& iterator, PP_PictureBuffer_Dev &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_int32_t(iterator, value.id); + iterator.skip(); + FromJSON_PP_Size(iterator, value.size); + iterator.skip(); + FromJSON_uint32_t(iterator, value.texture_id); +} +const string ToString_PP_Picture_Dev(const PP_Picture_Dev *v) { + if (!v) { + return "null"; + } + return ToString_PP_Picture_Dev(*v); +} +const string ToString_PP_Picture_Dev(const PP_Picture_Dev &v) { + stringstream x; + BeginProps(x); + AddProp(x, "picture_buffer_id", ToString_int32_t(v.picture_buffer_id)); + AddProp(x, "bitstream_buffer_id", ToString_int32_t(v.bitstream_buffer_id)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_Picture_Dev(JSONIterator& iterator, PP_Picture_Dev &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_int32_t(iterator, value.picture_buffer_id); + iterator.skip(); + FromJSON_int32_t(iterator, value.bitstream_buffer_id); +} +const string ToString_PP_VideoDecodeError_Dev(const PP_VideoDecodeError_Dev *v) { + switch (*v) { + case 1: + return "\"PP_VIDEODECODERERROR_ILLEGAL_STATE\""; + case 2: + return "\"PP_VIDEODECODERERROR_INVALID_ARGUMENT\""; + case 3: + return "\"PP_VIDEODECODERERROR_UNREADABLE_INPUT\""; + case 4: + return "\"PP_VIDEODECODERERROR_PLATFORM_FAILURE\""; + default: + return "\"???\""; + } +} +const string ToString_PP_VideoDecodeError_Dev(const PP_VideoDecodeError_Dev &v) { + return ToString_PP_VideoDecodeError_Dev(&v); +} +void FromJSON_PP_VideoDecodeError_Dev(JSONIterator& iterator, PP_VideoDecodeError_Dev &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_VideoDecodeError_Dev(v); +} +const string ToString_PPB_AudioInput_Callback(const PPB_AudioInput_Callback_0_3 &v) { + return PointerToString(v); +} +void FromJSON_PPB_AudioInput_Callback(JSONIterator& iterator, PPB_AudioInput_Callback_0_3 &value) { + PointerValueFromJSON(iterator, value); +} +const string ToString_PPB_AudioInput_Callback(const PPB_AudioInput_Callback &v) { + return PointerToString(v); +} +void FromJSON_PPB_AudioInput_Callback(JSONIterator& iterator, PPB_AudioInput_Callback &value) { + PointerValueFromJSON(iterator, value); +} +namespace ns_PPB_AudioInput_Dev_0_3 { +static PP_Resource Create_0_3(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioInput_Dev\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_AudioInput_Dev_0_3*)RealGetInterface("PPB_AudioInput(Dev);0.3"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsAudioInput_0_3(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioInput_Dev\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"IsAudioInput\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_AudioInput_Dev_0_3*)RealGetInterface("PPB_AudioInput(Dev);0.3"))->IsAudioInput(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t EnumerateDevices_0_3(PP_Resource audio_input, struct PP_ArrayOutput output, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioInput_Dev\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"EnumerateDevices\""); + AddProp(ss, "audio_input", ToString_PP_Resource(audio_input)); + AddProp(ss, "output", ToString_PP_ArrayOutput(output)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_AudioInput_Dev_0_3*)RealGetInterface("PPB_AudioInput(Dev);0.3"))->EnumerateDevices(audio_input, output, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t MonitorDeviceChange_0_3(PP_Resource audio_input, PP_MonitorDeviceChangeCallback callback, void* user_data) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioInput_Dev\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"MonitorDeviceChange\""); + AddProp(ss, "audio_input", ToString_PP_Resource(audio_input)); + AddProp(ss, "callback", ToString_PP_MonitorDeviceChangeCallback(callback)); + AddProp(ss, "user_data", ToString_mem_t(user_data)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_AudioInput_Dev_0_3*)RealGetInterface("PPB_AudioInput(Dev);0.3"))->MonitorDeviceChange(audio_input, callback, user_data); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Open_0_3(PP_Resource audio_input, PP_Resource device_ref, PP_Resource config, PPB_AudioInput_Callback_0_3 audio_input_callback, void* user_data, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioInput_Dev\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"Open\""); + AddProp(ss, "audio_input", ToString_PP_Resource(audio_input)); + AddProp(ss, "device_ref", ToString_PP_Resource(device_ref)); + AddProp(ss, "config", ToString_PP_Resource(config)); + AddProp(ss, "audio_input_callback", ToString_PPB_AudioInput_Callback(audio_input_callback)); + AddProp(ss, "user_data", ToString_mem_t(user_data)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_AudioInput_Dev_0_3*)RealGetInterface("PPB_AudioInput(Dev);0.3"))->Open(audio_input, device_ref, config, audio_input_callback, user_data, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource GetCurrentConfig_0_3(PP_Resource audio_input) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioInput_Dev\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"GetCurrentConfig\""); + AddProp(ss, "audio_input", ToString_PP_Resource(audio_input)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_AudioInput_Dev_0_3*)RealGetInterface("PPB_AudioInput(Dev);0.3"))->GetCurrentConfig(audio_input); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool StartCapture_0_3(PP_Resource audio_input) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioInput_Dev\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"StartCapture\""); + AddProp(ss, "audio_input", ToString_PP_Resource(audio_input)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_AudioInput_Dev_0_3*)RealGetInterface("PPB_AudioInput(Dev);0.3"))->StartCapture(audio_input); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool StopCapture_0_3(PP_Resource audio_input) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioInput_Dev\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"StopCapture\""); + AddProp(ss, "audio_input", ToString_PP_Resource(audio_input)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_AudioInput_Dev_0_3*)RealGetInterface("PPB_AudioInput(Dev);0.3"))->StopCapture(audio_input); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void Close_0_3(PP_Resource audio_input) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioInput_Dev\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"Close\""); + AddProp(ss, "audio_input", ToString_PP_Resource(audio_input)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_AudioInput_Dev_0_3*)RealGetInterface("PPB_AudioInput(Dev);0.3"))->Close(audio_input); +#endif // !INTERPOSE +} +} +static PPB_AudioInput_Dev_0_3 _PPB_AudioInput_Dev_0_3 = { + ns_PPB_AudioInput_Dev_0_3::Create_0_3, + ns_PPB_AudioInput_Dev_0_3::IsAudioInput_0_3, + ns_PPB_AudioInput_Dev_0_3::EnumerateDevices_0_3, + ns_PPB_AudioInput_Dev_0_3::MonitorDeviceChange_0_3, + ns_PPB_AudioInput_Dev_0_3::Open_0_3, + ns_PPB_AudioInput_Dev_0_3::GetCurrentConfig_0_3, + ns_PPB_AudioInput_Dev_0_3::StartCapture_0_3, + ns_PPB_AudioInput_Dev_0_3::StopCapture_0_3, + ns_PPB_AudioInput_Dev_0_3::Close_0_3, +}; +const string ToString_PPB_AudioInput_Dev(const PPB_AudioInput_Dev_0_3 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_AudioInput_Dev_0_4 { +static PP_Resource Create_0_4(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioInput_Dev\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_AudioInput_Dev_0_4*)RealGetInterface("PPB_AudioInput(Dev);0.4"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsAudioInput_0_4(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioInput_Dev\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"IsAudioInput\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_AudioInput_Dev_0_4*)RealGetInterface("PPB_AudioInput(Dev);0.4"))->IsAudioInput(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t EnumerateDevices_0_4(PP_Resource audio_input, struct PP_ArrayOutput output, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioInput_Dev\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"EnumerateDevices\""); + AddProp(ss, "audio_input", ToString_PP_Resource(audio_input)); + AddProp(ss, "output", ToString_PP_ArrayOutput(output)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_AudioInput_Dev_0_4*)RealGetInterface("PPB_AudioInput(Dev);0.4"))->EnumerateDevices(audio_input, output, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t MonitorDeviceChange_0_4(PP_Resource audio_input, PP_MonitorDeviceChangeCallback callback, void* user_data) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioInput_Dev\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"MonitorDeviceChange\""); + AddProp(ss, "audio_input", ToString_PP_Resource(audio_input)); + AddProp(ss, "callback", ToString_PP_MonitorDeviceChangeCallback(callback)); + AddProp(ss, "user_data", ToString_mem_t(user_data)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_AudioInput_Dev_0_4*)RealGetInterface("PPB_AudioInput(Dev);0.4"))->MonitorDeviceChange(audio_input, callback, user_data); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Open_0_4(PP_Resource audio_input, PP_Resource device_ref, PP_Resource config, PPB_AudioInput_Callback audio_input_callback, void* user_data, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioInput_Dev\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"Open\""); + AddProp(ss, "audio_input", ToString_PP_Resource(audio_input)); + AddProp(ss, "device_ref", ToString_PP_Resource(device_ref)); + AddProp(ss, "config", ToString_PP_Resource(config)); + AddProp(ss, "audio_input_callback", ToString_PPB_AudioInput_Callback(audio_input_callback)); + AddProp(ss, "user_data", ToString_mem_t(user_data)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_AudioInput_Dev_0_4*)RealGetInterface("PPB_AudioInput(Dev);0.4"))->Open(audio_input, device_ref, config, audio_input_callback, user_data, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource GetCurrentConfig_0_4(PP_Resource audio_input) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioInput_Dev\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"GetCurrentConfig\""); + AddProp(ss, "audio_input", ToString_PP_Resource(audio_input)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_AudioInput_Dev_0_4*)RealGetInterface("PPB_AudioInput(Dev);0.4"))->GetCurrentConfig(audio_input); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool StartCapture_0_4(PP_Resource audio_input) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioInput_Dev\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"StartCapture\""); + AddProp(ss, "audio_input", ToString_PP_Resource(audio_input)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_AudioInput_Dev_0_4*)RealGetInterface("PPB_AudioInput(Dev);0.4"))->StartCapture(audio_input); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool StopCapture_0_4(PP_Resource audio_input) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioInput_Dev\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"StopCapture\""); + AddProp(ss, "audio_input", ToString_PP_Resource(audio_input)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_AudioInput_Dev_0_4*)RealGetInterface("PPB_AudioInput(Dev);0.4"))->StopCapture(audio_input); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void Close_0_4(PP_Resource audio_input) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_AudioInput_Dev\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"Close\""); + AddProp(ss, "audio_input", ToString_PP_Resource(audio_input)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_AudioInput_Dev_0_4*)RealGetInterface("PPB_AudioInput(Dev);0.4"))->Close(audio_input); +#endif // !INTERPOSE +} +} +static PPB_AudioInput_Dev_0_4 _PPB_AudioInput_Dev_0_4 = { + ns_PPB_AudioInput_Dev_0_4::Create_0_4, + ns_PPB_AudioInput_Dev_0_4::IsAudioInput_0_4, + ns_PPB_AudioInput_Dev_0_4::EnumerateDevices_0_4, + ns_PPB_AudioInput_Dev_0_4::MonitorDeviceChange_0_4, + ns_PPB_AudioInput_Dev_0_4::Open_0_4, + ns_PPB_AudioInput_Dev_0_4::GetCurrentConfig_0_4, + ns_PPB_AudioInput_Dev_0_4::StartCapture_0_4, + ns_PPB_AudioInput_Dev_0_4::StopCapture_0_4, + ns_PPB_AudioInput_Dev_0_4::Close_0_4, +}; +const string ToString_PPB_AudioInput_Dev(const PPB_AudioInput_Dev_0_4 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Buffer_Dev_0_4 { +static PP_Resource Create_0_4(PP_Instance instance, uint32_t size_in_bytes) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Buffer_Dev\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "size_in_bytes", ToString_uint32_t(size_in_bytes)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Buffer_Dev_0_4*)RealGetInterface("PPB_Buffer(Dev);0.4"))->Create(instance, size_in_bytes); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsBuffer_0_4(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Buffer_Dev\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"IsBuffer\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Buffer_Dev_0_4*)RealGetInterface("PPB_Buffer(Dev);0.4"))->IsBuffer(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool Describe_0_4(PP_Resource resource, uint32_t* size_in_bytes) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Buffer_Dev\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"Describe\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + AddProp(ss, "size_in_bytes", PointerToString(size_in_bytes)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_uint32_t(iterator, *size_in_bytes); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Buffer_Dev_0_4*)RealGetInterface("PPB_Buffer(Dev);0.4"))->Describe(resource, size_in_bytes); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!size_in_bytes) { + AddProp(os, "size_in_bytes", ToString_uint32_t(size_in_bytes)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void* Map_0_4(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Buffer_Dev\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"Map\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + void* rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_mem_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + void* rval = ((PPB_Buffer_Dev_0_4*)RealGetInterface("PPB_Buffer(Dev);0.4"))->Map(resource); + printf("RPC response: ["); + printf("%s", ToString_mem_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void Unmap_0_4(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Buffer_Dev\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"Unmap\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Buffer_Dev_0_4*)RealGetInterface("PPB_Buffer(Dev);0.4"))->Unmap(resource); +#endif // !INTERPOSE +} +} +static PPB_Buffer_Dev_0_4 _PPB_Buffer_Dev_0_4 = { + ns_PPB_Buffer_Dev_0_4::Create_0_4, + ns_PPB_Buffer_Dev_0_4::IsBuffer_0_4, + ns_PPB_Buffer_Dev_0_4::Describe_0_4, + ns_PPB_Buffer_Dev_0_4::Map_0_4, + ns_PPB_Buffer_Dev_0_4::Unmap_0_4, +}; +const string ToString_PPB_Buffer_Dev(const PPB_Buffer_Dev_0_4 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_CharSet_ConversionError(const PP_CharSet_ConversionError *v) { + switch (*v) { + case 0: + return "\"PP_CHARSET_CONVERSIONERROR_FAIL\""; + case 1: + return "\"PP_CHARSET_CONVERSIONERROR_SKIP\""; + case 2: + return "\"PP_CHARSET_CONVERSIONERROR_SUBSTITUTE\""; + default: + return "\"???\""; + } +} +const string ToString_PP_CharSet_ConversionError(const PP_CharSet_ConversionError &v) { + return ToString_PP_CharSet_ConversionError(&v); +} +void FromJSON_PP_CharSet_ConversionError(JSONIterator& iterator, PP_CharSet_ConversionError &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_CharSet_ConversionError(v); +} +namespace ns_PPB_CharSet_Dev_0_4 { +static const char* UTF16ToCharSet_0_4(PP_Instance instance, const uint16_t utf16[], uint32_t utf16_len, const char* output_char_set, PP_CharSet_ConversionError on_error, uint32_t* output_length) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CharSet_Dev\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"UTF16ToCharSet\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + { + BeginProp(ss, "utf16"); + BeginElements(ss); + for (uint32_t _n = 0; _n < utf16_len; ++_n) { + AddElement(ss, ToString_uint16_t(utf16[_n])); + } + EndElements(ss); + } + AddProp(ss, "utf16_len", ToString_uint32_t(utf16_len)); + AddProp(ss, "output_char_set", ToString_str_t(output_char_set)); + AddProp(ss, "on_error", ToString_PP_CharSet_ConversionError(on_error)); + AddProp(ss, "output_length", PointerToString(output_length)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + char* rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_str_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_uint32_t(iterator, *output_length); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + const char* rval = ((PPB_CharSet_Dev_0_4*)RealGetInterface("PPB_CharSet(Dev);0.4"))->UTF16ToCharSet(instance, utf16, utf16_len, output_char_set, on_error, output_length); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_str_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!output_length) { + AddProp(os, "output_length", ToString_uint32_t(output_length)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint16_ptr_t CharSetToUTF16_0_4(PP_Instance instance, const char* input, uint32_t input_len, const char* input_char_set, PP_CharSet_ConversionError on_error, uint32_t* output_utf16_length) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CharSet_Dev\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"CharSetToUTF16\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + { + BeginProp(ss, "input"); + BeginElements(ss); + for (uint32_t _n = 0; _n < input_len; ++_n) { + AddElement(ss, ToString_uint8_t(input[_n])); + } + EndElements(ss); + } + AddProp(ss, "input_len", ToString_uint32_t(input_len)); + AddProp(ss, "input_char_set", ToString_str_t(input_char_set)); + AddProp(ss, "on_error", ToString_PP_CharSet_ConversionError(on_error)); + AddProp(ss, "output_utf16_length", PointerToString(output_utf16_length)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint16_ptr_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + size_t length = iterator.expectArrayAndGotoFirstItem(); + rval = new uint16_t[length]; + for (size_t i = 0; i < length; ++i) { + FromJSON_uint16_t(iterator, rval[i]); + } + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_uint32_t(iterator, *output_utf16_length); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint16_ptr_t rval = ((PPB_CharSet_Dev_0_4*)RealGetInterface("PPB_CharSet(Dev);0.4"))->CharSetToUTF16(instance, input, input_len, input_char_set, on_error, output_utf16_length); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_uint16_ptr_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!output_utf16_length) { + AddProp(os, "output_utf16_length", ToString_uint32_t(output_utf16_length)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetDefaultCharSet_0_4(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CharSet_Dev\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"GetDefaultCharSet\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_CharSet_Dev_0_4*)RealGetInterface("PPB_CharSet(Dev);0.4"))->GetDefaultCharSet(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_CharSet_Dev_0_4 _PPB_CharSet_Dev_0_4 = { + ns_PPB_CharSet_Dev_0_4::UTF16ToCharSet_0_4, + ns_PPB_CharSet_Dev_0_4::CharSetToUTF16_0_4, + ns_PPB_CharSet_Dev_0_4::GetDefaultCharSet_0_4, +}; +const string ToString_PPB_CharSet_Dev(const PPB_CharSet_Dev_0_4 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Crypto_Dev_0_1 { +static void GetRandomBytes_0_1(char* buffer, uint32_t num_bytes) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Crypto_Dev\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetRandomBytes\""); + AddProp(ss, "buffer", PointerToString(buffer)); + AddProp(ss, "num_bytes", ToString_uint32_t(num_bytes)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_str_t(iterator, buffer); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Crypto_Dev_0_1*)RealGetInterface("PPB_Crypto(Dev);0.1"))->GetRandomBytes(buffer, num_bytes); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "buffer", ToString_str_t(buffer)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +} +static PPB_Crypto_Dev_0_1 _PPB_Crypto_Dev_0_1 = { + ns_PPB_Crypto_Dev_0_1::GetRandomBytes_0_1, +}; +const string ToString_PPB_Crypto_Dev(const PPB_Crypto_Dev_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_CursorControl_Dev_0_4 { +static PP_Bool SetCursor_0_4(PP_Instance instance, enum PP_CursorType_Dev type, PP_Resource custom_image, const struct PP_Point* hot_spot) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CursorControl_Dev\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"SetCursor\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "type", ToString_PP_CursorType_Dev(type)); + AddProp(ss, "custom_image", ToString_PP_Resource(custom_image)); + AddProp(ss, "hot_spot", ToString_PP_Point(hot_spot)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_CursorControl_Dev_0_4*)RealGetInterface("PPB_CursorControl(Dev);0.4"))->SetCursor(instance, type, custom_image, hot_spot); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool LockCursor_0_4(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CursorControl_Dev\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"LockCursor\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_CursorControl_Dev_0_4*)RealGetInterface("PPB_CursorControl(Dev);0.4"))->LockCursor(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool UnlockCursor_0_4(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CursorControl_Dev\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"UnlockCursor\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_CursorControl_Dev_0_4*)RealGetInterface("PPB_CursorControl(Dev);0.4"))->UnlockCursor(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool HasCursorLock_0_4(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CursorControl_Dev\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"HasCursorLock\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_CursorControl_Dev_0_4*)RealGetInterface("PPB_CursorControl(Dev);0.4"))->HasCursorLock(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool CanLockCursor_0_4(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CursorControl_Dev\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"CanLockCursor\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_CursorControl_Dev_0_4*)RealGetInterface("PPB_CursorControl(Dev);0.4"))->CanLockCursor(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_CursorControl_Dev_0_4 _PPB_CursorControl_Dev_0_4 = { + ns_PPB_CursorControl_Dev_0_4::SetCursor_0_4, + ns_PPB_CursorControl_Dev_0_4::LockCursor_0_4, + ns_PPB_CursorControl_Dev_0_4::UnlockCursor_0_4, + ns_PPB_CursorControl_Dev_0_4::HasCursorLock_0_4, + ns_PPB_CursorControl_Dev_0_4::CanLockCursor_0_4, +}; +const string ToString_PPB_CursorControl_Dev(const PPB_CursorControl_Dev_0_4 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_MonitorDeviceChangeCallback(const PP_MonitorDeviceChangeCallback &v) { + return PointerToString(v); +} +void FromJSON_PP_MonitorDeviceChangeCallback(JSONIterator& iterator, PP_MonitorDeviceChangeCallback &value) { + PointerValueFromJSON(iterator, value); +} +const string ToString_PP_DeviceType_Dev(const PP_DeviceType_Dev *v) { + switch (*v) { + case 0: + return "\"PP_DEVICETYPE_DEV_INVALID\""; + case 1: + return "\"PP_DEVICETYPE_DEV_AUDIOCAPTURE\""; + case 2: + return "\"PP_DEVICETYPE_DEV_VIDEOCAPTURE\""; + default: + return "\"???\""; + } +} +const string ToString_PP_DeviceType_Dev(const PP_DeviceType_Dev &v) { + return ToString_PP_DeviceType_Dev(&v); +} +void FromJSON_PP_DeviceType_Dev(JSONIterator& iterator, PP_DeviceType_Dev &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_DeviceType_Dev(v); +} +namespace ns_PPB_DeviceRef_Dev_0_1 { +static PP_Bool IsDeviceRef_0_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_DeviceRef_Dev\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"IsDeviceRef\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_DeviceRef_Dev_0_1*)RealGetInterface("PPB_DeviceRef(Dev);0.1"))->IsDeviceRef(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_DeviceType_Dev GetType_0_1(PP_Resource device_ref) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_DeviceRef_Dev\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetType\""); + AddProp(ss, "device_ref", ToString_PP_Resource(device_ref)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_DeviceType_Dev rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_DeviceType_Dev(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_DeviceType_Dev rval = ((PPB_DeviceRef_Dev_0_1*)RealGetInterface("PPB_DeviceRef(Dev);0.1"))->GetType(device_ref); + printf("RPC response: ["); + printf("%s", ToString_PP_DeviceType_Dev(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetName_0_1(PP_Resource device_ref) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_DeviceRef_Dev\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetName\""); + AddProp(ss, "device_ref", ToString_PP_Resource(device_ref)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_DeviceRef_Dev_0_1*)RealGetInterface("PPB_DeviceRef(Dev);0.1"))->GetName(device_ref); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_DeviceRef_Dev_0_1 _PPB_DeviceRef_Dev_0_1 = { + ns_PPB_DeviceRef_Dev_0_1::IsDeviceRef_0_1, + ns_PPB_DeviceRef_Dev_0_1::GetType_0_1, + ns_PPB_DeviceRef_Dev_0_1::GetName_0_1, +}; +const string ToString_PPB_DeviceRef_Dev(const PPB_DeviceRef_Dev_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_FileChooserMode_Dev(const PP_FileChooserMode_Dev *v) { + switch (*v) { + case 0: + return "\"PP_FILECHOOSERMODE_OPEN\""; + case 1: + return "\"PP_FILECHOOSERMODE_OPENMULTIPLE\""; + default: + return "\"???\""; + } +} +const string ToString_PP_FileChooserMode_Dev(const PP_FileChooserMode_Dev &v) { + return ToString_PP_FileChooserMode_Dev(&v); +} +void FromJSON_PP_FileChooserMode_Dev(JSONIterator& iterator, PP_FileChooserMode_Dev &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_FileChooserMode_Dev(v); +} +namespace ns_PPB_FileChooser_Dev_0_5 { +static PP_Resource Create_0_5(PP_Instance instance, PP_FileChooserMode_Dev mode, struct PP_Var accept_types) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileChooser_Dev\""); + AddProp(ss, "__version", "\"0.5\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "mode", ToString_PP_FileChooserMode_Dev(mode)); + AddProp(ss, "accept_types", ToString_PP_Var(accept_types)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_FileChooser_Dev_0_5*)RealGetInterface("PPB_FileChooser(Dev);0.5"))->Create(instance, mode, accept_types); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsFileChooser_0_5(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileChooser_Dev\""); + AddProp(ss, "__version", "\"0.5\""); + AddProp(ss, "__method", "\"IsFileChooser\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_FileChooser_Dev_0_5*)RealGetInterface("PPB_FileChooser(Dev);0.5"))->IsFileChooser(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Show_0_5(PP_Resource chooser, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileChooser_Dev\""); + AddProp(ss, "__version", "\"0.5\""); + AddProp(ss, "__method", "\"Show\""); + AddProp(ss, "chooser", ToString_PP_Resource(chooser)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileChooser_Dev_0_5*)RealGetInterface("PPB_FileChooser(Dev);0.5"))->Show(chooser, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource GetNextChosenFile_0_5(PP_Resource chooser) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileChooser_Dev\""); + AddProp(ss, "__version", "\"0.5\""); + AddProp(ss, "__method", "\"GetNextChosenFile\""); + AddProp(ss, "chooser", ToString_PP_Resource(chooser)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_FileChooser_Dev_0_5*)RealGetInterface("PPB_FileChooser(Dev);0.5"))->GetNextChosenFile(chooser); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping Show */ +} +static PPB_FileChooser_Dev_0_5 _PPB_FileChooser_Dev_0_5 = { + ns_PPB_FileChooser_Dev_0_5::Create_0_5, + ns_PPB_FileChooser_Dev_0_5::IsFileChooser_0_5, + ns_PPB_FileChooser_Dev_0_5::Show_0_5, + ns_PPB_FileChooser_Dev_0_5::GetNextChosenFile_0_5, +}; +const string ToString_PPB_FileChooser_Dev(const PPB_FileChooser_Dev_0_5 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_FileChooser_Dev_0_6 { +static PP_Resource Create_0_6(PP_Instance instance, PP_FileChooserMode_Dev mode, struct PP_Var accept_types) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileChooser_Dev\""); + AddProp(ss, "__version", "\"0.6\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "mode", ToString_PP_FileChooserMode_Dev(mode)); + AddProp(ss, "accept_types", ToString_PP_Var(accept_types)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_FileChooser_Dev_0_6*)RealGetInterface("PPB_FileChooser(Dev);0.6"))->Create(instance, mode, accept_types); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsFileChooser_0_6(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileChooser_Dev\""); + AddProp(ss, "__version", "\"0.6\""); + AddProp(ss, "__method", "\"IsFileChooser\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_FileChooser_Dev_0_6*)RealGetInterface("PPB_FileChooser(Dev);0.6"))->IsFileChooser(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping Show */ +/* skipping GetNextChosenFile */ +static int32_t Show_0_6(PP_Resource chooser, struct PP_ArrayOutput output, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileChooser_Dev\""); + AddProp(ss, "__version", "\"0.6\""); + AddProp(ss, "__method", "\"Show\""); + AddProp(ss, "chooser", ToString_PP_Resource(chooser)); + AddProp(ss, "output", ToString_PP_ArrayOutput(output)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileChooser_Dev_0_6*)RealGetInterface("PPB_FileChooser(Dev);0.6"))->Show(chooser, output, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_FileChooser_Dev_0_6 _PPB_FileChooser_Dev_0_6 = { + ns_PPB_FileChooser_Dev_0_6::Create_0_6, + ns_PPB_FileChooser_Dev_0_6::IsFileChooser_0_6, + ns_PPB_FileChooser_Dev_0_6::Show_0_6, +}; +const string ToString_PPB_FileChooser_Dev(const PPB_FileChooser_Dev_0_6 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_FontFamily_Dev(const PP_FontFamily_Dev *v) { + switch (*v) { + case 0: + return "\"PP_FONTFAMILY_DEFAULT\""; + case 1: + return "\"PP_FONTFAMILY_SERIF\""; + case 2: + return "\"PP_FONTFAMILY_SANSSERIF\""; + case 3: + return "\"PP_FONTFAMILY_MONOSPACE\""; + default: + return "\"???\""; + } +} +const string ToString_PP_FontFamily_Dev(const PP_FontFamily_Dev &v) { + return ToString_PP_FontFamily_Dev(&v); +} +void FromJSON_PP_FontFamily_Dev(JSONIterator& iterator, PP_FontFamily_Dev &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_FontFamily_Dev(v); +} +const string ToString_PP_FontWeight_Dev(const PP_FontWeight_Dev *v) { + switch (*v) { + case 0: + return "\"PP_FONTWEIGHT_100\""; + case 1: + return "\"PP_FONTWEIGHT_200\""; + case 2: + return "\"PP_FONTWEIGHT_300\""; + case 3: + return "\"PP_FONTWEIGHT_400\""; + case 4: + return "\"PP_FONTWEIGHT_500\""; + case 5: + return "\"PP_FONTWEIGHT_600\""; + case 6: + return "\"PP_FONTWEIGHT_700\""; + case 7: + return "\"PP_FONTWEIGHT_800\""; + case 8: + return "\"PP_FONTWEIGHT_900\""; + default: + return "\"???\""; + } +} +const string ToString_PP_FontWeight_Dev(const PP_FontWeight_Dev &v) { + return ToString_PP_FontWeight_Dev(&v); +} +void FromJSON_PP_FontWeight_Dev(JSONIterator& iterator, PP_FontWeight_Dev &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_FontWeight_Dev(v); +} +const string ToString_PP_FontDescription_Dev(const PP_FontDescription_Dev *v) { + if (!v) { + return "null"; + } + return ToString_PP_FontDescription_Dev(*v); +} +const string ToString_PP_FontDescription_Dev(const PP_FontDescription_Dev &v) { + stringstream x; + BeginProps(x); + AddProp(x, "face", ToString_PP_Var(v.face)); + AddProp(x, "family", ToString_PP_FontFamily_Dev(v.family)); + AddProp(x, "size", ToString_uint32_t(v.size)); + AddProp(x, "weight", ToString_PP_FontWeight_Dev(v.weight)); + AddProp(x, "italic", ToString_PP_Bool(v.italic)); + AddProp(x, "small_caps", ToString_PP_Bool(v.small_caps)); + AddProp(x, "letter_spacing", ToString_int32_t(v.letter_spacing)); + AddProp(x, "word_spacing", ToString_int32_t(v.word_spacing)); + AddProp(x, "padding", ToString_int32_t(v.padding)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_FontDescription_Dev(JSONIterator& iterator, PP_FontDescription_Dev &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_PP_Var(iterator, value.face); + iterator.skip(); + FromJSON_PP_FontFamily_Dev(iterator, value.family); + iterator.skip(); + FromJSON_uint32_t(iterator, value.size); + iterator.skip(); + FromJSON_PP_FontWeight_Dev(iterator, value.weight); + iterator.skip(); + FromJSON_PP_Bool(iterator, value.italic); + iterator.skip(); + FromJSON_PP_Bool(iterator, value.small_caps); + iterator.skip(); + FromJSON_int32_t(iterator, value.letter_spacing); + iterator.skip(); + FromJSON_int32_t(iterator, value.word_spacing); + iterator.skip(); + FromJSON_int32_t(iterator, value.padding); +} +const string ToString_PP_FontMetrics_Dev(const PP_FontMetrics_Dev *v) { + if (!v) { + return "null"; + } + return ToString_PP_FontMetrics_Dev(*v); +} +const string ToString_PP_FontMetrics_Dev(const PP_FontMetrics_Dev &v) { + stringstream x; + BeginProps(x); + AddProp(x, "height", ToString_int32_t(v.height)); + AddProp(x, "ascent", ToString_int32_t(v.ascent)); + AddProp(x, "descent", ToString_int32_t(v.descent)); + AddProp(x, "line_spacing", ToString_int32_t(v.line_spacing)); + AddProp(x, "x_height", ToString_int32_t(v.x_height)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_FontMetrics_Dev(JSONIterator& iterator, PP_FontMetrics_Dev &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_int32_t(iterator, value.height); + iterator.skip(); + FromJSON_int32_t(iterator, value.ascent); + iterator.skip(); + FromJSON_int32_t(iterator, value.descent); + iterator.skip(); + FromJSON_int32_t(iterator, value.line_spacing); + iterator.skip(); + FromJSON_int32_t(iterator, value.x_height); +} +const string ToString_PP_TextRun_Dev(const PP_TextRun_Dev *v) { + if (!v) { + return "null"; + } + return ToString_PP_TextRun_Dev(*v); +} +const string ToString_PP_TextRun_Dev(const PP_TextRun_Dev &v) { + stringstream x; + BeginProps(x); + AddProp(x, "text", ToString_PP_Var(v.text)); + AddProp(x, "rtl", ToString_PP_Bool(v.rtl)); + AddProp(x, "override_direction", ToString_PP_Bool(v.override_direction)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_TextRun_Dev(JSONIterator& iterator, PP_TextRun_Dev &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_PP_Var(iterator, value.text); + iterator.skip(); + FromJSON_PP_Bool(iterator, value.rtl); + iterator.skip(); + FromJSON_PP_Bool(iterator, value.override_direction); +} +namespace ns_PPB_Font_Dev_0_6 { +static struct PP_Var GetFontFamilies_0_6(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Font_Dev\""); + AddProp(ss, "__version", "\"0.6\""); + AddProp(ss, "__method", "\"GetFontFamilies\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Font_Dev_0_6*)RealGetInterface("PPB_Font(Dev);0.6"))->GetFontFamilies(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource Create_0_6(PP_Instance instance, const struct PP_FontDescription_Dev* description) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Font_Dev\""); + AddProp(ss, "__version", "\"0.6\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "description", ToString_PP_FontDescription_Dev(description)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Font_Dev_0_6*)RealGetInterface("PPB_Font(Dev);0.6"))->Create(instance, description); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsFont_0_6(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Font_Dev\""); + AddProp(ss, "__version", "\"0.6\""); + AddProp(ss, "__method", "\"IsFont\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Font_Dev_0_6*)RealGetInterface("PPB_Font(Dev);0.6"))->IsFont(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool Describe_0_6(PP_Resource font, struct PP_FontDescription_Dev* description, struct PP_FontMetrics_Dev* metrics) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Font_Dev\""); + AddProp(ss, "__version", "\"0.6\""); + AddProp(ss, "__method", "\"Describe\""); + AddProp(ss, "font", ToString_PP_Resource(font)); + AddProp(ss, "description", PointerToString(description)); + AddProp(ss, "metrics", PointerToString(metrics)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!description) { + iterator.skip(); + FromJSON_PP_FontDescription_Dev(iterator, *description); + } + if (!!metrics) { + iterator.skip(); + FromJSON_PP_FontMetrics_Dev(iterator, *metrics); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Font_Dev_0_6*)RealGetInterface("PPB_Font(Dev);0.6"))->Describe(font, description, metrics); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!description) { + AddProp(os, "description", ToString_PP_FontDescription_Dev(description)); + } + if (!!metrics) { + AddProp(os, "metrics", ToString_PP_FontMetrics_Dev(metrics)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool DrawTextAt_0_6(PP_Resource font, PP_Resource image_data, const struct PP_TextRun_Dev* text, const struct PP_Point* position, uint32_t color, const struct PP_Rect* clip, PP_Bool image_data_is_opaque) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Font_Dev\""); + AddProp(ss, "__version", "\"0.6\""); + AddProp(ss, "__method", "\"DrawTextAt\""); + AddProp(ss, "font", ToString_PP_Resource(font)); + AddProp(ss, "image_data", ToString_PP_Resource(image_data)); + AddProp(ss, "text", ToString_PP_TextRun_Dev(text)); + AddProp(ss, "position", ToString_PP_Point(position)); + AddProp(ss, "color", ToString_uint32_t(color)); + AddProp(ss, "clip", ToString_PP_Rect(clip)); + AddProp(ss, "image_data_is_opaque", ToString_PP_Bool(image_data_is_opaque)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Font_Dev_0_6*)RealGetInterface("PPB_Font(Dev);0.6"))->DrawTextAt(font, image_data, text, position, color, clip, image_data_is_opaque); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t MeasureText_0_6(PP_Resource font, const struct PP_TextRun_Dev* text) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Font_Dev\""); + AddProp(ss, "__version", "\"0.6\""); + AddProp(ss, "__method", "\"MeasureText\""); + AddProp(ss, "font", ToString_PP_Resource(font)); + AddProp(ss, "text", ToString_PP_TextRun_Dev(text)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Font_Dev_0_6*)RealGetInterface("PPB_Font(Dev);0.6"))->MeasureText(font, text); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint32_t CharacterOffsetForPixel_0_6(PP_Resource font, const struct PP_TextRun_Dev* text, int32_t pixel_position) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Font_Dev\""); + AddProp(ss, "__version", "\"0.6\""); + AddProp(ss, "__method", "\"CharacterOffsetForPixel\""); + AddProp(ss, "font", ToString_PP_Resource(font)); + AddProp(ss, "text", ToString_PP_TextRun_Dev(text)); + AddProp(ss, "pixel_position", ToString_int32_t(pixel_position)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint32_t rval = ((PPB_Font_Dev_0_6*)RealGetInterface("PPB_Font(Dev);0.6"))->CharacterOffsetForPixel(font, text, pixel_position); + printf("RPC response: ["); + printf("%s", ToString_uint32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t PixelOffsetForCharacter_0_6(PP_Resource font, const struct PP_TextRun_Dev* text, uint32_t char_offset) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Font_Dev\""); + AddProp(ss, "__version", "\"0.6\""); + AddProp(ss, "__method", "\"PixelOffsetForCharacter\""); + AddProp(ss, "font", ToString_PP_Resource(font)); + AddProp(ss, "text", ToString_PP_TextRun_Dev(text)); + AddProp(ss, "char_offset", ToString_uint32_t(char_offset)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Font_Dev_0_6*)RealGetInterface("PPB_Font(Dev);0.6"))->PixelOffsetForCharacter(font, text, char_offset); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_Font_Dev_0_6 _PPB_Font_Dev_0_6 = { + ns_PPB_Font_Dev_0_6::GetFontFamilies_0_6, + ns_PPB_Font_Dev_0_6::Create_0_6, + ns_PPB_Font_Dev_0_6::IsFont_0_6, + ns_PPB_Font_Dev_0_6::Describe_0_6, + ns_PPB_Font_Dev_0_6::DrawTextAt_0_6, + ns_PPB_Font_Dev_0_6::MeasureText_0_6, + ns_PPB_Font_Dev_0_6::CharacterOffsetForPixel_0_6, + ns_PPB_Font_Dev_0_6::PixelOffsetForCharacter_0_6, +}; +const string ToString_PPB_Font_Dev(const PPB_Font_Dev_0_6 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_IMEInputEvent_Dev_0_1 { +/* skipping Create */ +static PP_Bool IsIMEInputEvent_0_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_IMEInputEvent_Dev\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"IsIMEInputEvent\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_IMEInputEvent_Dev_0_1*)RealGetInterface("PPB_IMEInputEvent(Dev);0.1"))->IsIMEInputEvent(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetText_0_1(PP_Resource ime_event) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_IMEInputEvent_Dev\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetText\""); + AddProp(ss, "ime_event", ToString_PP_Resource(ime_event)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_IMEInputEvent_Dev_0_1*)RealGetInterface("PPB_IMEInputEvent(Dev);0.1"))->GetText(ime_event); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint32_t GetSegmentNumber_0_1(PP_Resource ime_event) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_IMEInputEvent_Dev\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetSegmentNumber\""); + AddProp(ss, "ime_event", ToString_PP_Resource(ime_event)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint32_t rval = ((PPB_IMEInputEvent_Dev_0_1*)RealGetInterface("PPB_IMEInputEvent(Dev);0.1"))->GetSegmentNumber(ime_event); + printf("RPC response: ["); + printf("%s", ToString_uint32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint32_t GetSegmentOffset_0_1(PP_Resource ime_event, uint32_t index) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_IMEInputEvent_Dev\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetSegmentOffset\""); + AddProp(ss, "ime_event", ToString_PP_Resource(ime_event)); + AddProp(ss, "index", ToString_uint32_t(index)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint32_t rval = ((PPB_IMEInputEvent_Dev_0_1*)RealGetInterface("PPB_IMEInputEvent(Dev);0.1"))->GetSegmentOffset(ime_event, index); + printf("RPC response: ["); + printf("%s", ToString_uint32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetTargetSegment_0_1(PP_Resource ime_event) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_IMEInputEvent_Dev\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetTargetSegment\""); + AddProp(ss, "ime_event", ToString_PP_Resource(ime_event)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_IMEInputEvent_Dev_0_1*)RealGetInterface("PPB_IMEInputEvent(Dev);0.1"))->GetTargetSegment(ime_event); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void GetSelection_0_1(PP_Resource ime_event, uint32_t* start, uint32_t* end) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_IMEInputEvent_Dev\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetSelection\""); + AddProp(ss, "ime_event", ToString_PP_Resource(ime_event)); + AddProp(ss, "start", PointerToString(start)); + AddProp(ss, "end", PointerToString(end)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_uint32_t(iterator, *start); + iterator.skip(); + FromJSON_uint32_t(iterator, *end); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_IMEInputEvent_Dev_0_1*)RealGetInterface("PPB_IMEInputEvent(Dev);0.1"))->GetSelection(ime_event, start, end); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + if (!!start) { + AddProp(os, "start", ToString_uint32_t(start)); + } + if (!!end) { + AddProp(os, "end", ToString_uint32_t(end)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +} +static PPB_IMEInputEvent_Dev_0_1 _PPB_IMEInputEvent_Dev_0_1 = { + ns_PPB_IMEInputEvent_Dev_0_1::IsIMEInputEvent_0_1, + ns_PPB_IMEInputEvent_Dev_0_1::GetText_0_1, + ns_PPB_IMEInputEvent_Dev_0_1::GetSegmentNumber_0_1, + ns_PPB_IMEInputEvent_Dev_0_1::GetSegmentOffset_0_1, + ns_PPB_IMEInputEvent_Dev_0_1::GetTargetSegment_0_1, + ns_PPB_IMEInputEvent_Dev_0_1::GetSelection_0_1, +}; +const string ToString_PPB_IMEInputEvent_Dev(const PPB_IMEInputEvent_Dev_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_IMEInputEvent_Dev_0_2 { +static PP_Resource Create_0_2(PP_Instance instance, PP_InputEvent_Type type, PP_TimeTicks time_stamp, struct PP_Var text, uint32_t segment_number, const uint32_t segment_offsets[], int32_t target_segment, uint32_t selection_start, uint32_t selection_end) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_IMEInputEvent_Dev\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "type", ToString_PP_InputEvent_Type(type)); + AddProp(ss, "time_stamp", ToString_PP_TimeTicks(time_stamp)); + AddProp(ss, "text", ToString_PP_Var(text)); + AddProp(ss, "segment_number", ToString_uint32_t(segment_number)); + { + BeginProp(ss, "segment_offsets"); + BeginElements(ss); + for (uint32_t _n = 0; segment_offsets[_n] != 0; ++_n) { + AddElement(ss, ToString_uint32_t(segment_offsets[_n])); + } + EndElements(ss); + } + AddProp(ss, "target_segment", ToString_int32_t(target_segment)); + AddProp(ss, "selection_start", ToString_uint32_t(selection_start)); + AddProp(ss, "selection_end", ToString_uint32_t(selection_end)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_IMEInputEvent_Dev_0_2*)RealGetInterface("PPB_IMEInputEvent(Dev);0.2"))->Create(instance, type, time_stamp, text, segment_number, segment_offsets, target_segment, selection_start, selection_end); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsIMEInputEvent_0_2(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_IMEInputEvent_Dev\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"IsIMEInputEvent\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_IMEInputEvent_Dev_0_2*)RealGetInterface("PPB_IMEInputEvent(Dev);0.2"))->IsIMEInputEvent(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetText_0_2(PP_Resource ime_event) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_IMEInputEvent_Dev\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"GetText\""); + AddProp(ss, "ime_event", ToString_PP_Resource(ime_event)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_IMEInputEvent_Dev_0_2*)RealGetInterface("PPB_IMEInputEvent(Dev);0.2"))->GetText(ime_event); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint32_t GetSegmentNumber_0_2(PP_Resource ime_event) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_IMEInputEvent_Dev\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"GetSegmentNumber\""); + AddProp(ss, "ime_event", ToString_PP_Resource(ime_event)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint32_t rval = ((PPB_IMEInputEvent_Dev_0_2*)RealGetInterface("PPB_IMEInputEvent(Dev);0.2"))->GetSegmentNumber(ime_event); + printf("RPC response: ["); + printf("%s", ToString_uint32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint32_t GetSegmentOffset_0_2(PP_Resource ime_event, uint32_t index) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_IMEInputEvent_Dev\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"GetSegmentOffset\""); + AddProp(ss, "ime_event", ToString_PP_Resource(ime_event)); + AddProp(ss, "index", ToString_uint32_t(index)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint32_t rval = ((PPB_IMEInputEvent_Dev_0_2*)RealGetInterface("PPB_IMEInputEvent(Dev);0.2"))->GetSegmentOffset(ime_event, index); + printf("RPC response: ["); + printf("%s", ToString_uint32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetTargetSegment_0_2(PP_Resource ime_event) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_IMEInputEvent_Dev\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"GetTargetSegment\""); + AddProp(ss, "ime_event", ToString_PP_Resource(ime_event)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_IMEInputEvent_Dev_0_2*)RealGetInterface("PPB_IMEInputEvent(Dev);0.2"))->GetTargetSegment(ime_event); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void GetSelection_0_2(PP_Resource ime_event, uint32_t* start, uint32_t* end) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_IMEInputEvent_Dev\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"GetSelection\""); + AddProp(ss, "ime_event", ToString_PP_Resource(ime_event)); + AddProp(ss, "start", PointerToString(start)); + AddProp(ss, "end", PointerToString(end)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_uint32_t(iterator, *start); + iterator.skip(); + FromJSON_uint32_t(iterator, *end); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_IMEInputEvent_Dev_0_2*)RealGetInterface("PPB_IMEInputEvent(Dev);0.2"))->GetSelection(ime_event, start, end); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + if (!!start) { + AddProp(os, "start", ToString_uint32_t(start)); + } + if (!!end) { + AddProp(os, "end", ToString_uint32_t(end)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +} +static PPB_IMEInputEvent_Dev_0_2 _PPB_IMEInputEvent_Dev_0_2 = { + ns_PPB_IMEInputEvent_Dev_0_2::Create_0_2, + ns_PPB_IMEInputEvent_Dev_0_2::IsIMEInputEvent_0_2, + ns_PPB_IMEInputEvent_Dev_0_2::GetText_0_2, + ns_PPB_IMEInputEvent_Dev_0_2::GetSegmentNumber_0_2, + ns_PPB_IMEInputEvent_Dev_0_2::GetSegmentOffset_0_2, + ns_PPB_IMEInputEvent_Dev_0_2::GetTargetSegment_0_2, + ns_PPB_IMEInputEvent_Dev_0_2::GetSelection_0_2, +}; +const string ToString_PPB_IMEInputEvent_Dev(const PPB_IMEInputEvent_Dev_0_2 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Memory_Dev_0_1 { +static void* MemAlloc_0_1(uint32_t num_bytes) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Memory_Dev\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"MemAlloc\""); + AddProp(ss, "num_bytes", ToString_uint32_t(num_bytes)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + void* rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_mem_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + void* rval = ((PPB_Memory_Dev_0_1*)RealGetInterface("PPB_Memory(Dev);0.1"))->MemAlloc(num_bytes); + printf("RPC response: ["); + printf("%s", ToString_mem_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void MemFree_0_1(void* ptr) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Memory_Dev\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"MemFree\""); + AddProp(ss, "ptr", ToString_mem_t(ptr)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Memory_Dev_0_1*)RealGetInterface("PPB_Memory(Dev);0.1"))->MemFree(ptr); +#endif // !INTERPOSE +} +} +static PPB_Memory_Dev_0_1 _PPB_Memory_Dev_0_1 = { + ns_PPB_Memory_Dev_0_1::MemAlloc_0_1, + ns_PPB_Memory_Dev_0_1::MemFree_0_1, +}; +const string ToString_PPB_Memory_Dev(const PPB_Memory_Dev_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_OpenGLES2DrawBuffers_Dev_1_0 { +static void DrawBuffersEXT_1_0(PP_Resource context, GLsizei count, const GLenum* bufs) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OpenGLES2DrawBuffers_Dev\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"DrawBuffersEXT\""); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "count", ToString_GLsizei(count)); + AddProp(ss, "bufs", ToString_GLenum_ptr_t(bufs)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_OpenGLES2DrawBuffers_Dev_1_0*)RealGetInterface("PPB_OpenGLES2DrawBuffers(Dev);1.0"))->DrawBuffersEXT(context, count, bufs); +#endif // !INTERPOSE +} +} +static PPB_OpenGLES2DrawBuffers_Dev_1_0 _PPB_OpenGLES2DrawBuffers_Dev_1_0 = { + ns_PPB_OpenGLES2DrawBuffers_Dev_1_0::DrawBuffersEXT_1_0, +}; +const string ToString_PPB_OpenGLES2DrawBuffers_Dev(const PPB_OpenGLES2DrawBuffers_Dev_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Printing_Dev_0_7 { +static PP_Resource Create_0_7(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Printing_Dev\""); + AddProp(ss, "__version", "\"0.7\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Printing_Dev_0_7*)RealGetInterface("PPB_Printing(Dev);0.7"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetDefaultPrintSettings_0_7(PP_Resource resource, struct PP_PrintSettings_Dev* print_settings, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Printing_Dev\""); + AddProp(ss, "__version", "\"0.7\""); + AddProp(ss, "__method", "\"GetDefaultPrintSettings\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + AddProp(ss, "print_settings", PointerToString(print_settings)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!print_settings) { + iterator.skip(); + FromJSON_PP_PrintSettings_Dev(iterator, *print_settings); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_Printing_Dev_0_7*)RealGetInterface("PPB_Printing(Dev);0.7"))->GetDefaultPrintSettings(resource, print_settings, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!print_settings) { + AddProp(os, "print_settings", ToString_PP_PrintSettings_Dev(print_settings)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_Printing_Dev_0_7 _PPB_Printing_Dev_0_7 = { + ns_PPB_Printing_Dev_0_7::Create_0_7, + ns_PPB_Printing_Dev_0_7::GetDefaultPrintSettings_0_7, +}; +const string ToString_PPB_Printing_Dev(const PPB_Printing_Dev_0_7 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_TextInput_Type_Dev(const PP_TextInput_Type_Dev *v) { + switch (*v) { + case 0: + return "\"PP_TEXTINPUT_TYPE_DEV_NONE\""; + case 1: + return "\"PP_TEXTINPUT_TYPE_DEV_TEXT\""; + case 2: + return "\"PP_TEXTINPUT_TYPE_DEV_PASSWORD\""; + case 3: + return "\"PP_TEXTINPUT_TYPE_DEV_SEARCH\""; + case 4: + return "\"PP_TEXTINPUT_TYPE_DEV_EMAIL\""; + case 5: + return "\"PP_TEXTINPUT_TYPE_DEV_NUMBER\""; + case 6: + return "\"PP_TEXTINPUT_TYPE_DEV_TELEPHONE\""; + case 7: + return "\"PP_TEXTINPUT_TYPE_DEV_URL\""; + default: + return "\"???\""; + } +} +const string ToString_PP_TextInput_Type_Dev(const PP_TextInput_Type_Dev &v) { + return ToString_PP_TextInput_Type_Dev(&v); +} +void FromJSON_PP_TextInput_Type_Dev(JSONIterator& iterator, PP_TextInput_Type_Dev &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_TextInput_Type_Dev(v); +} +namespace ns_PPB_TextInput_Dev_0_1 { +static void SetTextInputType_0_1(PP_Instance instance, PP_TextInput_Type_Dev type) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TextInput_Dev\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"SetTextInputType\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "type", ToString_PP_TextInput_Type_Dev(type)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_TextInput_Dev_0_1*)RealGetInterface("PPB_TextInput(Dev);0.1"))->SetTextInputType(instance, type); +#endif // !INTERPOSE +} +static void UpdateCaretPosition_0_1(PP_Instance instance, const struct PP_Rect* caret, const struct PP_Rect* bounding_box) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TextInput_Dev\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"UpdateCaretPosition\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "caret", ToString_PP_Rect(caret)); + AddProp(ss, "bounding_box", ToString_PP_Rect(bounding_box)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_TextInput_Dev_0_1*)RealGetInterface("PPB_TextInput(Dev);0.1"))->UpdateCaretPosition(instance, caret, bounding_box); +#endif // !INTERPOSE +} +static void CancelCompositionText_0_1(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TextInput_Dev\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"CancelCompositionText\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_TextInput_Dev_0_1*)RealGetInterface("PPB_TextInput(Dev);0.1"))->CancelCompositionText(instance); +#endif // !INTERPOSE +} +/* skipping UpdateSurroundingText */ +/* skipping SelectionChanged */ +} +static PPB_TextInput_Dev_0_1 _PPB_TextInput_Dev_0_1 = { + ns_PPB_TextInput_Dev_0_1::SetTextInputType_0_1, + ns_PPB_TextInput_Dev_0_1::UpdateCaretPosition_0_1, + ns_PPB_TextInput_Dev_0_1::CancelCompositionText_0_1, +}; +const string ToString_PPB_TextInput_Dev(const PPB_TextInput_Dev_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_TextInput_Dev_0_2 { +static void SetTextInputType_0_2(PP_Instance instance, PP_TextInput_Type_Dev type) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TextInput_Dev\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"SetTextInputType\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "type", ToString_PP_TextInput_Type_Dev(type)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_TextInput_Dev_0_2*)RealGetInterface("PPB_TextInput(Dev);0.2"))->SetTextInputType(instance, type); +#endif // !INTERPOSE +} +static void UpdateCaretPosition_0_2(PP_Instance instance, const struct PP_Rect* caret, const struct PP_Rect* bounding_box) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TextInput_Dev\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"UpdateCaretPosition\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "caret", ToString_PP_Rect(caret)); + AddProp(ss, "bounding_box", ToString_PP_Rect(bounding_box)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_TextInput_Dev_0_2*)RealGetInterface("PPB_TextInput(Dev);0.2"))->UpdateCaretPosition(instance, caret, bounding_box); +#endif // !INTERPOSE +} +static void CancelCompositionText_0_2(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TextInput_Dev\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"CancelCompositionText\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_TextInput_Dev_0_2*)RealGetInterface("PPB_TextInput(Dev);0.2"))->CancelCompositionText(instance); +#endif // !INTERPOSE +} +static void UpdateSurroundingText_0_2(PP_Instance instance, const char* text, uint32_t caret, uint32_t anchor) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TextInput_Dev\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"UpdateSurroundingText\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "text", ToString_str_t(text)); + AddProp(ss, "caret", ToString_uint32_t(caret)); + AddProp(ss, "anchor", ToString_uint32_t(anchor)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_TextInput_Dev_0_2*)RealGetInterface("PPB_TextInput(Dev);0.2"))->UpdateSurroundingText(instance, text, caret, anchor); +#endif // !INTERPOSE +} +static void SelectionChanged_0_2(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TextInput_Dev\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"SelectionChanged\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_TextInput_Dev_0_2*)RealGetInterface("PPB_TextInput(Dev);0.2"))->SelectionChanged(instance); +#endif // !INTERPOSE +} +} +static PPB_TextInput_Dev_0_2 _PPB_TextInput_Dev_0_2 = { + ns_PPB_TextInput_Dev_0_2::SetTextInputType_0_2, + ns_PPB_TextInput_Dev_0_2::UpdateCaretPosition_0_2, + ns_PPB_TextInput_Dev_0_2::CancelCompositionText_0_2, + ns_PPB_TextInput_Dev_0_2::UpdateSurroundingText_0_2, + ns_PPB_TextInput_Dev_0_2::SelectionChanged_0_2, +}; +const string ToString_PPB_TextInput_Dev(const PPB_TextInput_Dev_0_2 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_TraceEventTime(const PP_TraceEventTime *v) { + return ToString_int64_t(v); +} +const string ToString_PP_TraceEventTime(const PP_TraceEventTime &v) { + return ToString_PP_TraceEventTime(&v); +} +void FromJSON_PP_TraceEventTime(JSONIterator& iterator, PP_TraceEventTime &value) { + FromJSON_int64_t(iterator, value); +} +namespace ns_PPB_Trace_Event_Dev_0_1 { +static void* GetCategoryEnabled_0_1(const char* category_name) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Trace_Event_Dev\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetCategoryEnabled\""); + AddProp(ss, "category_name", ToString_cstr_t(category_name)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + void* rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_mem_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + void* rval = ((PPB_Trace_Event_Dev_0_1*)RealGetInterface("PPB_Trace_Event(Dev);0.1"))->GetCategoryEnabled(category_name); + printf("RPC response: ["); + printf("%s", ToString_mem_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void AddTraceEvent_0_1(int8_t phase, const void* category_enabled, const char* name, uint64_t id, uint32_t num_args, const char* arg_names[], const uint8_t arg_types[], const uint64_t arg_values[], uint8_t flags) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Trace_Event_Dev\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"AddTraceEvent\""); + AddProp(ss, "phase", ToString_int8_t(phase)); + AddProp(ss, "category_enabled", ToString_mem_t(category_enabled)); + AddProp(ss, "name", ToString_cstr_t(name)); + AddProp(ss, "id", ToString_uint64_t(id)); + AddProp(ss, "num_args", ToString_uint32_t(num_args)); + { + BeginProp(ss, "arg_names"); + BeginElements(ss); + for (uint32_t _n = 0; _n < num_args; ++_n) { + AddElement(ss, ToString_str_t(arg_names[_n])); + } + EndElements(ss); + } + { + BeginProp(ss, "arg_types"); + BeginElements(ss); + for (uint32_t _n = 0; _n < num_args; ++_n) { + AddElement(ss, ToString_uint8_t(arg_types[_n])); + } + EndElements(ss); + } + { + BeginProp(ss, "arg_values"); + BeginElements(ss); + for (uint32_t _n = 0; _n < num_args; ++_n) { + AddElement(ss, ToString_uint64_t(arg_values[_n])); + } + EndElements(ss); + } + AddProp(ss, "flags", ToString_uint8_t(flags)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Trace_Event_Dev_0_1*)RealGetInterface("PPB_Trace_Event(Dev);0.1"))->AddTraceEvent(phase, category_enabled, name, id, num_args, arg_names, arg_types, arg_values, flags); +#endif // !INTERPOSE +} +/* skipping AddTraceEventWithThreadIdAndTimestamp */ +/* skipping Now */ +static void SetThreadName_0_1(const char* thread_name) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Trace_Event_Dev\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"SetThreadName\""); + AddProp(ss, "thread_name", ToString_cstr_t(thread_name)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Trace_Event_Dev_0_1*)RealGetInterface("PPB_Trace_Event(Dev);0.1"))->SetThreadName(thread_name); +#endif // !INTERPOSE +} +} +static PPB_Trace_Event_Dev_0_1 _PPB_Trace_Event_Dev_0_1 = { + ns_PPB_Trace_Event_Dev_0_1::GetCategoryEnabled_0_1, + ns_PPB_Trace_Event_Dev_0_1::AddTraceEvent_0_1, + ns_PPB_Trace_Event_Dev_0_1::SetThreadName_0_1, +}; +const string ToString_PPB_Trace_Event_Dev(const PPB_Trace_Event_Dev_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Trace_Event_Dev_0_2 { +static void* GetCategoryEnabled_0_2(const char* category_name) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Trace_Event_Dev\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"GetCategoryEnabled\""); + AddProp(ss, "category_name", ToString_cstr_t(category_name)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + void* rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_mem_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + void* rval = ((PPB_Trace_Event_Dev_0_2*)RealGetInterface("PPB_Trace_Event(Dev);0.2"))->GetCategoryEnabled(category_name); + printf("RPC response: ["); + printf("%s", ToString_mem_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void AddTraceEvent_0_2(int8_t phase, const void* category_enabled, const char* name, uint64_t id, uint32_t num_args, const char* arg_names[], const uint8_t arg_types[], const uint64_t arg_values[], uint8_t flags) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Trace_Event_Dev\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"AddTraceEvent\""); + AddProp(ss, "phase", ToString_int8_t(phase)); + AddProp(ss, "category_enabled", ToString_mem_t(category_enabled)); + AddProp(ss, "name", ToString_cstr_t(name)); + AddProp(ss, "id", ToString_uint64_t(id)); + AddProp(ss, "num_args", ToString_uint32_t(num_args)); + { + BeginProp(ss, "arg_names"); + BeginElements(ss); + for (uint32_t _n = 0; _n < num_args; ++_n) { + AddElement(ss, ToString_str_t(arg_names[_n])); + } + EndElements(ss); + } + { + BeginProp(ss, "arg_types"); + BeginElements(ss); + for (uint32_t _n = 0; _n < num_args; ++_n) { + AddElement(ss, ToString_uint8_t(arg_types[_n])); + } + EndElements(ss); + } + { + BeginProp(ss, "arg_values"); + BeginElements(ss); + for (uint32_t _n = 0; _n < num_args; ++_n) { + AddElement(ss, ToString_uint64_t(arg_values[_n])); + } + EndElements(ss); + } + AddProp(ss, "flags", ToString_uint8_t(flags)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Trace_Event_Dev_0_2*)RealGetInterface("PPB_Trace_Event(Dev);0.2"))->AddTraceEvent(phase, category_enabled, name, id, num_args, arg_names, arg_types, arg_values, flags); +#endif // !INTERPOSE +} +static void AddTraceEventWithThreadIdAndTimestamp_0_2(int8_t phase, const void* category_enabled, const char* name, uint64_t id, int32_t thread_id, PP_TraceEventTime timestamp, uint32_t num_args, const char* arg_names[], const uint8_t arg_types[], const uint64_t arg_values[], uint8_t flags) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Trace_Event_Dev\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"AddTraceEventWithThreadIdAndTimestamp\""); + AddProp(ss, "phase", ToString_int8_t(phase)); + AddProp(ss, "category_enabled", ToString_mem_t(category_enabled)); + AddProp(ss, "name", ToString_cstr_t(name)); + AddProp(ss, "id", ToString_uint64_t(id)); + AddProp(ss, "thread_id", ToString_int32_t(thread_id)); + AddProp(ss, "timestamp", ToString_PP_TraceEventTime(timestamp)); + AddProp(ss, "num_args", ToString_uint32_t(num_args)); + { + BeginProp(ss, "arg_names"); + BeginElements(ss); + for (uint32_t _n = 0; _n < num_args; ++_n) { + AddElement(ss, ToString_str_t(arg_names[_n])); + } + EndElements(ss); + } + { + BeginProp(ss, "arg_types"); + BeginElements(ss); + for (uint32_t _n = 0; _n < num_args; ++_n) { + AddElement(ss, ToString_uint8_t(arg_types[_n])); + } + EndElements(ss); + } + { + BeginProp(ss, "arg_values"); + BeginElements(ss); + for (uint32_t _n = 0; _n < num_args; ++_n) { + AddElement(ss, ToString_uint64_t(arg_values[_n])); + } + EndElements(ss); + } + AddProp(ss, "flags", ToString_uint8_t(flags)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Trace_Event_Dev_0_2*)RealGetInterface("PPB_Trace_Event(Dev);0.2"))->AddTraceEventWithThreadIdAndTimestamp(phase, category_enabled, name, id, thread_id, timestamp, num_args, arg_names, arg_types, arg_values, flags); +#endif // !INTERPOSE +} +static PP_TraceEventTime Now_0_2(void) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Trace_Event_Dev\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"Now\""); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int64_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_TraceEventTime(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int64_t rval = ((PPB_Trace_Event_Dev_0_2*)RealGetInterface("PPB_Trace_Event(Dev);0.2"))->Now(); + printf("RPC response: ["); + printf("%s", ToString_PP_TraceEventTime(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void SetThreadName_0_2(const char* thread_name) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Trace_Event_Dev\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"SetThreadName\""); + AddProp(ss, "thread_name", ToString_cstr_t(thread_name)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Trace_Event_Dev_0_2*)RealGetInterface("PPB_Trace_Event(Dev);0.2"))->SetThreadName(thread_name); +#endif // !INTERPOSE +} +} +static PPB_Trace_Event_Dev_0_2 _PPB_Trace_Event_Dev_0_2 = { + ns_PPB_Trace_Event_Dev_0_2::GetCategoryEnabled_0_2, + ns_PPB_Trace_Event_Dev_0_2::AddTraceEvent_0_2, + ns_PPB_Trace_Event_Dev_0_2::AddTraceEventWithThreadIdAndTimestamp_0_2, + ns_PPB_Trace_Event_Dev_0_2::Now_0_2, + ns_PPB_Trace_Event_Dev_0_2::SetThreadName_0_2, +}; +const string ToString_PPB_Trace_Event_Dev(const PPB_Trace_Event_Dev_0_2 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_TrueTypeFontFamily_Dev(const PP_TrueTypeFontFamily_Dev *v) { + switch (*v) { + case 0: + return "\"PP_TRUETYPEFONTFAMILY_SERIF\""; + case 1: + return "\"PP_TRUETYPEFONTFAMILY_SANSSERIF\""; + case 2: + return "\"PP_TRUETYPEFONTFAMILY_CURSIVE\""; + case 3: + return "\"PP_TRUETYPEFONTFAMILY_FANTASY\""; + case 4: + return "\"PP_TRUETYPEFONTFAMILY_MONOSPACE\""; + default: + return "\"???\""; + } +} +const string ToString_PP_TrueTypeFontFamily_Dev(const PP_TrueTypeFontFamily_Dev &v) { + return ToString_PP_TrueTypeFontFamily_Dev(&v); +} +void FromJSON_PP_TrueTypeFontFamily_Dev(JSONIterator& iterator, PP_TrueTypeFontFamily_Dev &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_TrueTypeFontFamily_Dev(v); +} +const string ToString_PP_TrueTypeFontStyle_Dev(const PP_TrueTypeFontStyle_Dev *v) { + switch (*v) { + case 0: + return "\"PP_TRUETYPEFONTSTYLE_NORMAL\""; + case 1: + return "\"PP_TRUETYPEFONTSTYLE_ITALIC\""; + default: + return "\"???\""; + } +} +const string ToString_PP_TrueTypeFontStyle_Dev(const PP_TrueTypeFontStyle_Dev &v) { + return ToString_PP_TrueTypeFontStyle_Dev(&v); +} +void FromJSON_PP_TrueTypeFontStyle_Dev(JSONIterator& iterator, PP_TrueTypeFontStyle_Dev &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_TrueTypeFontStyle_Dev(v); +} +const string ToString_PP_TrueTypeFontWeight_Dev(const PP_TrueTypeFontWeight_Dev *v) { + switch (*v) { + case 100: + return "\"PP_TRUETYPEFONTWEIGHT_THIN\""; + case 200: + return "\"PP_TRUETYPEFONTWEIGHT_ULTRALIGHT\""; + case 300: + return "\"PP_TRUETYPEFONTWEIGHT_LIGHT\""; + case 400: + return "\"PP_TRUETYPEFONTWEIGHT_NORMAL\""; + case 500: + return "\"PP_TRUETYPEFONTWEIGHT_MEDIUM\""; + case 600: + return "\"PP_TRUETYPEFONTWEIGHT_SEMIBOLD\""; + case 700: + return "\"PP_TRUETYPEFONTWEIGHT_BOLD\""; + case 800: + return "\"PP_TRUETYPEFONTWEIGHT_ULTRABOLD\""; + case 900: + return "\"PP_TRUETYPEFONTWEIGHT_HEAVY\""; + default: + return "\"???\""; + } +} +const string ToString_PP_TrueTypeFontWeight_Dev(const PP_TrueTypeFontWeight_Dev &v) { + return ToString_PP_TrueTypeFontWeight_Dev(&v); +} +void FromJSON_PP_TrueTypeFontWeight_Dev(JSONIterator& iterator, PP_TrueTypeFontWeight_Dev &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_TrueTypeFontWeight_Dev(v); +} +const string ToString_PP_TrueTypeFontWidth_Dev(const PP_TrueTypeFontWidth_Dev *v) { + switch (*v) { + case 0: + return "\"PP_TRUETYPEFONTWIDTH_ULTRACONDENSED\""; + case 1: + return "\"PP_TRUETYPEFONTWIDTH_EXTRACONDENSED\""; + case 2: + return "\"PP_TRUETYPEFONTWIDTH_CONDENSED\""; + case 3: + return "\"PP_TRUETYPEFONTWIDTH_SEMICONDENSED\""; + case 4: + return "\"PP_TRUETYPEFONTWIDTH_NORMAL\""; + case 5: + return "\"PP_TRUETYPEFONTWIDTH_SEMIEXPANDED\""; + case 6: + return "\"PP_TRUETYPEFONTWIDTH_EXPANDED\""; + case 7: + return "\"PP_TRUETYPEFONTWIDTH_EXTRAEXPANDED\""; + case 8: + return "\"PP_TRUETYPEFONTWIDTH_ULTRAEXPANDED\""; + default: + return "\"???\""; + } +} +const string ToString_PP_TrueTypeFontWidth_Dev(const PP_TrueTypeFontWidth_Dev &v) { + return ToString_PP_TrueTypeFontWidth_Dev(&v); +} +void FromJSON_PP_TrueTypeFontWidth_Dev(JSONIterator& iterator, PP_TrueTypeFontWidth_Dev &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_TrueTypeFontWidth_Dev(v); +} +const string ToString_PP_TrueTypeFontCharset_Dev(const PP_TrueTypeFontCharset_Dev *v) { + switch (*v) { + case 0: + return "\"PP_TRUETYPEFONTCHARSET_ANSI\""; + case 1: + return "\"PP_TRUETYPEFONTCHARSET_DEFAULT\""; + case 2: + return "\"PP_TRUETYPEFONTCHARSET_SYMBOL\""; + case 77: + return "\"PP_TRUETYPEFONTCHARSET_MAC\""; + case 128: + return "\"PP_TRUETYPEFONTCHARSET_SHIFTJIS\""; + case 129: + return "\"PP_TRUETYPEFONTCHARSET_HANGUL\""; + case 130: + return "\"PP_TRUETYPEFONTCHARSET_JOHAB\""; + case 134: + return "\"PP_TRUETYPEFONTCHARSET_GB2312\""; + case 136: + return "\"PP_TRUETYPEFONTCHARSET_CHINESEBIG5\""; + case 161: + return "\"PP_TRUETYPEFONTCHARSET_GREEK\""; + case 162: + return "\"PP_TRUETYPEFONTCHARSET_TURKISH\""; + case 163: + return "\"PP_TRUETYPEFONTCHARSET_VIETNAMESE\""; + case 177: + return "\"PP_TRUETYPEFONTCHARSET_HEBREW\""; + case 178: + return "\"PP_TRUETYPEFONTCHARSET_ARABIC\""; + case 186: + return "\"PP_TRUETYPEFONTCHARSET_BALTIC\""; + case 204: + return "\"PP_TRUETYPEFONTCHARSET_RUSSIAN\""; + case 222: + return "\"PP_TRUETYPEFONTCHARSET_THAI\""; + case 238: + return "\"PP_TRUETYPEFONTCHARSET_EASTEUROPE\""; + case 255: + return "\"PP_TRUETYPEFONTCHARSET_OEM\""; + default: + return "\"???\""; + } +} +const string ToString_PP_TrueTypeFontCharset_Dev(const PP_TrueTypeFontCharset_Dev &v) { + return ToString_PP_TrueTypeFontCharset_Dev(&v); +} +void FromJSON_PP_TrueTypeFontCharset_Dev(JSONIterator& iterator, PP_TrueTypeFontCharset_Dev &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_TrueTypeFontCharset_Dev(v); +} +const string ToString_PP_TrueTypeFontDesc_Dev(const PP_TrueTypeFontDesc_Dev *v) { + if (!v) { + return "null"; + } + return ToString_PP_TrueTypeFontDesc_Dev(*v); +} +const string ToString_PP_TrueTypeFontDesc_Dev(const PP_TrueTypeFontDesc_Dev &v) { + stringstream x; + BeginProps(x); + AddProp(x, "family", ToString_PP_Var(v.family)); + AddProp(x, "generic_family", ToString_PP_TrueTypeFontFamily_Dev(v.generic_family)); + AddProp(x, "style", ToString_PP_TrueTypeFontStyle_Dev(v.style)); + AddProp(x, "weight", ToString_PP_TrueTypeFontWeight_Dev(v.weight)); + AddProp(x, "width", ToString_PP_TrueTypeFontWidth_Dev(v.width)); + AddProp(x, "charset", ToString_PP_TrueTypeFontCharset_Dev(v.charset)); + AddProp(x, "padding", ToString_int32_t(v.padding)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_TrueTypeFontDesc_Dev(JSONIterator& iterator, PP_TrueTypeFontDesc_Dev &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_PP_Var(iterator, value.family); + iterator.skip(); + FromJSON_PP_TrueTypeFontFamily_Dev(iterator, value.generic_family); + iterator.skip(); + FromJSON_PP_TrueTypeFontStyle_Dev(iterator, value.style); + iterator.skip(); + FromJSON_PP_TrueTypeFontWeight_Dev(iterator, value.weight); + iterator.skip(); + FromJSON_PP_TrueTypeFontWidth_Dev(iterator, value.width); + iterator.skip(); + FromJSON_PP_TrueTypeFontCharset_Dev(iterator, value.charset); + iterator.skip(); + FromJSON_int32_t(iterator, value.padding); +} +namespace ns_PPB_TrueTypeFont_Dev_0_1 { +static int32_t GetFontFamilies_0_1(PP_Instance instance, struct PP_ArrayOutput output, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TrueTypeFont_Dev\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetFontFamilies\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "output", ToString_PP_ArrayOutput(output)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TrueTypeFont_Dev_0_1*)RealGetInterface("PPB_TrueTypeFont(Dev);0.1"))->GetFontFamilies(instance, output, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetFontsInFamily_0_1(PP_Instance instance, struct PP_Var family, struct PP_ArrayOutput output, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TrueTypeFont_Dev\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetFontsInFamily\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "family", ToString_PP_Var(family)); + AddProp(ss, "output", ToString_PP_ArrayOutput(output)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TrueTypeFont_Dev_0_1*)RealGetInterface("PPB_TrueTypeFont(Dev);0.1"))->GetFontsInFamily(instance, family, output, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource Create_0_1(PP_Instance instance, const struct PP_TrueTypeFontDesc_Dev* desc) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TrueTypeFont_Dev\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "desc", ToString_PP_TrueTypeFontDesc_Dev(desc)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_TrueTypeFont_Dev_0_1*)RealGetInterface("PPB_TrueTypeFont(Dev);0.1"))->Create(instance, desc); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsTrueTypeFont_0_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TrueTypeFont_Dev\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"IsTrueTypeFont\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_TrueTypeFont_Dev_0_1*)RealGetInterface("PPB_TrueTypeFont(Dev);0.1"))->IsTrueTypeFont(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Describe_0_1(PP_Resource font, struct PP_TrueTypeFontDesc_Dev* desc, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TrueTypeFont_Dev\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Describe\""); + AddProp(ss, "font", ToString_PP_Resource(font)); + AddProp(ss, "desc", PointerToString(desc)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!desc) { + iterator.skip(); + FromJSON_PP_TrueTypeFontDesc_Dev(iterator, *desc); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TrueTypeFont_Dev_0_1*)RealGetInterface("PPB_TrueTypeFont(Dev);0.1"))->Describe(font, desc, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!desc) { + AddProp(os, "desc", ToString_PP_TrueTypeFontDesc_Dev(desc)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetTableTags_0_1(PP_Resource font, struct PP_ArrayOutput output, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TrueTypeFont_Dev\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetTableTags\""); + AddProp(ss, "font", ToString_PP_Resource(font)); + AddProp(ss, "output", ToString_PP_ArrayOutput(output)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TrueTypeFont_Dev_0_1*)RealGetInterface("PPB_TrueTypeFont(Dev);0.1"))->GetTableTags(font, output, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetTable_0_1(PP_Resource font, uint32_t table, int32_t offset, int32_t max_data_length, struct PP_ArrayOutput output, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TrueTypeFont_Dev\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetTable\""); + AddProp(ss, "font", ToString_PP_Resource(font)); + AddProp(ss, "table", ToString_uint32_t(table)); + AddProp(ss, "offset", ToString_int32_t(offset)); + AddProp(ss, "max_data_length", ToString_int32_t(max_data_length)); + AddProp(ss, "output", ToString_PP_ArrayOutput(output)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TrueTypeFont_Dev_0_1*)RealGetInterface("PPB_TrueTypeFont(Dev);0.1"))->GetTable(font, table, offset, max_data_length, output, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_TrueTypeFont_Dev_0_1 _PPB_TrueTypeFont_Dev_0_1 = { + ns_PPB_TrueTypeFont_Dev_0_1::GetFontFamilies_0_1, + ns_PPB_TrueTypeFont_Dev_0_1::GetFontsInFamily_0_1, + ns_PPB_TrueTypeFont_Dev_0_1::Create_0_1, + ns_PPB_TrueTypeFont_Dev_0_1::IsTrueTypeFont_0_1, + ns_PPB_TrueTypeFont_Dev_0_1::Describe_0_1, + ns_PPB_TrueTypeFont_Dev_0_1::GetTableTags_0_1, + ns_PPB_TrueTypeFont_Dev_0_1::GetTable_0_1, +}; +const string ToString_PPB_TrueTypeFont_Dev(const PPB_TrueTypeFont_Dev_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_URLComponent_Dev(const PP_URLComponent_Dev *v) { + if (!v) { + return "null"; + } + return ToString_PP_URLComponent_Dev(*v); +} +const string ToString_PP_URLComponent_Dev(const PP_URLComponent_Dev &v) { + stringstream x; + BeginProps(x); + AddProp(x, "begin", ToString_int32_t(v.begin)); + AddProp(x, "len", ToString_int32_t(v.len)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_URLComponent_Dev(JSONIterator& iterator, PP_URLComponent_Dev &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_int32_t(iterator, value.begin); + iterator.skip(); + FromJSON_int32_t(iterator, value.len); +} +const string ToString_PP_URLComponents_Dev(const PP_URLComponents_Dev *v) { + if (!v) { + return "null"; + } + return ToString_PP_URLComponents_Dev(*v); +} +const string ToString_PP_URLComponents_Dev(const PP_URLComponents_Dev &v) { + stringstream x; + BeginProps(x); + AddProp(x, "scheme", ToString_PP_URLComponent_Dev(v.scheme)); + AddProp(x, "username", ToString_PP_URLComponent_Dev(v.username)); + AddProp(x, "password", ToString_PP_URLComponent_Dev(v.password)); + AddProp(x, "host", ToString_PP_URLComponent_Dev(v.host)); + AddProp(x, "port", ToString_PP_URLComponent_Dev(v.port)); + AddProp(x, "path", ToString_PP_URLComponent_Dev(v.path)); + AddProp(x, "query", ToString_PP_URLComponent_Dev(v.query)); + AddProp(x, "ref", ToString_PP_URLComponent_Dev(v.ref)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_URLComponents_Dev(JSONIterator& iterator, PP_URLComponents_Dev &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_PP_URLComponent_Dev(iterator, value.scheme); + iterator.skip(); + FromJSON_PP_URLComponent_Dev(iterator, value.username); + iterator.skip(); + FromJSON_PP_URLComponent_Dev(iterator, value.password); + iterator.skip(); + FromJSON_PP_URLComponent_Dev(iterator, value.host); + iterator.skip(); + FromJSON_PP_URLComponent_Dev(iterator, value.port); + iterator.skip(); + FromJSON_PP_URLComponent_Dev(iterator, value.path); + iterator.skip(); + FromJSON_PP_URLComponent_Dev(iterator, value.query); + iterator.skip(); + FromJSON_PP_URLComponent_Dev(iterator, value.ref); +} +namespace ns_PPB_URLUtil_Dev_0_6 { +static struct PP_Var Canonicalize_0_6(struct PP_Var url, struct PP_URLComponents_Dev* components) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLUtil_Dev\""); + AddProp(ss, "__version", "\"0.6\""); + AddProp(ss, "__method", "\"Canonicalize\""); + AddProp(ss, "url", ToString_PP_Var(url)); + AddProp(ss, "components", PointerToString(components)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!components) { + iterator.skip(); + FromJSON_PP_URLComponents_Dev(iterator, *components); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_URLUtil_Dev_0_6*)RealGetInterface("PPB_URLUtil(Dev);0.6"))->Canonicalize(url, components); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!components) { + AddProp(os, "components", ToString_PP_URLComponents_Dev(components)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var ResolveRelativeToURL_0_6(struct PP_Var base_url, struct PP_Var relative_string, struct PP_URLComponents_Dev* components) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLUtil_Dev\""); + AddProp(ss, "__version", "\"0.6\""); + AddProp(ss, "__method", "\"ResolveRelativeToURL\""); + AddProp(ss, "base_url", ToString_PP_Var(base_url)); + AddProp(ss, "relative_string", ToString_PP_Var(relative_string)); + AddProp(ss, "components", PointerToString(components)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!components) { + iterator.skip(); + FromJSON_PP_URLComponents_Dev(iterator, *components); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_URLUtil_Dev_0_6*)RealGetInterface("PPB_URLUtil(Dev);0.6"))->ResolveRelativeToURL(base_url, relative_string, components); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!components) { + AddProp(os, "components", ToString_PP_URLComponents_Dev(components)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var ResolveRelativeToDocument_0_6(PP_Instance instance, struct PP_Var relative_string, struct PP_URLComponents_Dev* components) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLUtil_Dev\""); + AddProp(ss, "__version", "\"0.6\""); + AddProp(ss, "__method", "\"ResolveRelativeToDocument\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "relative_string", ToString_PP_Var(relative_string)); + AddProp(ss, "components", PointerToString(components)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!components) { + iterator.skip(); + FromJSON_PP_URLComponents_Dev(iterator, *components); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_URLUtil_Dev_0_6*)RealGetInterface("PPB_URLUtil(Dev);0.6"))->ResolveRelativeToDocument(instance, relative_string, components); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!components) { + AddProp(os, "components", ToString_PP_URLComponents_Dev(components)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsSameSecurityOrigin_0_6(struct PP_Var url_a, struct PP_Var url_b) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLUtil_Dev\""); + AddProp(ss, "__version", "\"0.6\""); + AddProp(ss, "__method", "\"IsSameSecurityOrigin\""); + AddProp(ss, "url_a", ToString_PP_Var(url_a)); + AddProp(ss, "url_b", ToString_PP_Var(url_b)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_URLUtil_Dev_0_6*)RealGetInterface("PPB_URLUtil(Dev);0.6"))->IsSameSecurityOrigin(url_a, url_b); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool DocumentCanRequest_0_6(PP_Instance instance, struct PP_Var url) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLUtil_Dev\""); + AddProp(ss, "__version", "\"0.6\""); + AddProp(ss, "__method", "\"DocumentCanRequest\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "url", ToString_PP_Var(url)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_URLUtil_Dev_0_6*)RealGetInterface("PPB_URLUtil(Dev);0.6"))->DocumentCanRequest(instance, url); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool DocumentCanAccessDocument_0_6(PP_Instance active, PP_Instance target) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLUtil_Dev\""); + AddProp(ss, "__version", "\"0.6\""); + AddProp(ss, "__method", "\"DocumentCanAccessDocument\""); + AddProp(ss, "active", ToString_PP_Instance(active)); + AddProp(ss, "target", ToString_PP_Instance(target)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_URLUtil_Dev_0_6*)RealGetInterface("PPB_URLUtil(Dev);0.6"))->DocumentCanAccessDocument(active, target); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetDocumentURL_0_6(PP_Instance instance, struct PP_URLComponents_Dev* components) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLUtil_Dev\""); + AddProp(ss, "__version", "\"0.6\""); + AddProp(ss, "__method", "\"GetDocumentURL\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "components", PointerToString(components)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!components) { + iterator.skip(); + FromJSON_PP_URLComponents_Dev(iterator, *components); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_URLUtil_Dev_0_6*)RealGetInterface("PPB_URLUtil(Dev);0.6"))->GetDocumentURL(instance, components); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!components) { + AddProp(os, "components", ToString_PP_URLComponents_Dev(components)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetPluginInstanceURL_0_6(PP_Instance instance, struct PP_URLComponents_Dev* components) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLUtil_Dev\""); + AddProp(ss, "__version", "\"0.6\""); + AddProp(ss, "__method", "\"GetPluginInstanceURL\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "components", PointerToString(components)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!components) { + iterator.skip(); + FromJSON_PP_URLComponents_Dev(iterator, *components); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_URLUtil_Dev_0_6*)RealGetInterface("PPB_URLUtil(Dev);0.6"))->GetPluginInstanceURL(instance, components); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!components) { + AddProp(os, "components", ToString_PP_URLComponents_Dev(components)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping GetPluginReferrerURL */ +} +static PPB_URLUtil_Dev_0_6 _PPB_URLUtil_Dev_0_6 = { + ns_PPB_URLUtil_Dev_0_6::Canonicalize_0_6, + ns_PPB_URLUtil_Dev_0_6::ResolveRelativeToURL_0_6, + ns_PPB_URLUtil_Dev_0_6::ResolveRelativeToDocument_0_6, + ns_PPB_URLUtil_Dev_0_6::IsSameSecurityOrigin_0_6, + ns_PPB_URLUtil_Dev_0_6::DocumentCanRequest_0_6, + ns_PPB_URLUtil_Dev_0_6::DocumentCanAccessDocument_0_6, + ns_PPB_URLUtil_Dev_0_6::GetDocumentURL_0_6, + ns_PPB_URLUtil_Dev_0_6::GetPluginInstanceURL_0_6, +}; +const string ToString_PPB_URLUtil_Dev(const PPB_URLUtil_Dev_0_6 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_URLUtil_Dev_0_7 { +static struct PP_Var Canonicalize_0_7(struct PP_Var url, struct PP_URLComponents_Dev* components) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLUtil_Dev\""); + AddProp(ss, "__version", "\"0.7\""); + AddProp(ss, "__method", "\"Canonicalize\""); + AddProp(ss, "url", ToString_PP_Var(url)); + AddProp(ss, "components", PointerToString(components)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!components) { + iterator.skip(); + FromJSON_PP_URLComponents_Dev(iterator, *components); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_URLUtil_Dev_0_7*)RealGetInterface("PPB_URLUtil(Dev);0.7"))->Canonicalize(url, components); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!components) { + AddProp(os, "components", ToString_PP_URLComponents_Dev(components)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var ResolveRelativeToURL_0_7(struct PP_Var base_url, struct PP_Var relative_string, struct PP_URLComponents_Dev* components) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLUtil_Dev\""); + AddProp(ss, "__version", "\"0.7\""); + AddProp(ss, "__method", "\"ResolveRelativeToURL\""); + AddProp(ss, "base_url", ToString_PP_Var(base_url)); + AddProp(ss, "relative_string", ToString_PP_Var(relative_string)); + AddProp(ss, "components", PointerToString(components)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!components) { + iterator.skip(); + FromJSON_PP_URLComponents_Dev(iterator, *components); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_URLUtil_Dev_0_7*)RealGetInterface("PPB_URLUtil(Dev);0.7"))->ResolveRelativeToURL(base_url, relative_string, components); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!components) { + AddProp(os, "components", ToString_PP_URLComponents_Dev(components)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var ResolveRelativeToDocument_0_7(PP_Instance instance, struct PP_Var relative_string, struct PP_URLComponents_Dev* components) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLUtil_Dev\""); + AddProp(ss, "__version", "\"0.7\""); + AddProp(ss, "__method", "\"ResolveRelativeToDocument\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "relative_string", ToString_PP_Var(relative_string)); + AddProp(ss, "components", PointerToString(components)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!components) { + iterator.skip(); + FromJSON_PP_URLComponents_Dev(iterator, *components); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_URLUtil_Dev_0_7*)RealGetInterface("PPB_URLUtil(Dev);0.7"))->ResolveRelativeToDocument(instance, relative_string, components); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!components) { + AddProp(os, "components", ToString_PP_URLComponents_Dev(components)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsSameSecurityOrigin_0_7(struct PP_Var url_a, struct PP_Var url_b) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLUtil_Dev\""); + AddProp(ss, "__version", "\"0.7\""); + AddProp(ss, "__method", "\"IsSameSecurityOrigin\""); + AddProp(ss, "url_a", ToString_PP_Var(url_a)); + AddProp(ss, "url_b", ToString_PP_Var(url_b)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_URLUtil_Dev_0_7*)RealGetInterface("PPB_URLUtil(Dev);0.7"))->IsSameSecurityOrigin(url_a, url_b); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool DocumentCanRequest_0_7(PP_Instance instance, struct PP_Var url) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLUtil_Dev\""); + AddProp(ss, "__version", "\"0.7\""); + AddProp(ss, "__method", "\"DocumentCanRequest\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "url", ToString_PP_Var(url)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_URLUtil_Dev_0_7*)RealGetInterface("PPB_URLUtil(Dev);0.7"))->DocumentCanRequest(instance, url); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool DocumentCanAccessDocument_0_7(PP_Instance active, PP_Instance target) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLUtil_Dev\""); + AddProp(ss, "__version", "\"0.7\""); + AddProp(ss, "__method", "\"DocumentCanAccessDocument\""); + AddProp(ss, "active", ToString_PP_Instance(active)); + AddProp(ss, "target", ToString_PP_Instance(target)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_URLUtil_Dev_0_7*)RealGetInterface("PPB_URLUtil(Dev);0.7"))->DocumentCanAccessDocument(active, target); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetDocumentURL_0_7(PP_Instance instance, struct PP_URLComponents_Dev* components) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLUtil_Dev\""); + AddProp(ss, "__version", "\"0.7\""); + AddProp(ss, "__method", "\"GetDocumentURL\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "components", PointerToString(components)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!components) { + iterator.skip(); + FromJSON_PP_URLComponents_Dev(iterator, *components); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_URLUtil_Dev_0_7*)RealGetInterface("PPB_URLUtil(Dev);0.7"))->GetDocumentURL(instance, components); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!components) { + AddProp(os, "components", ToString_PP_URLComponents_Dev(components)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetPluginInstanceURL_0_7(PP_Instance instance, struct PP_URLComponents_Dev* components) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLUtil_Dev\""); + AddProp(ss, "__version", "\"0.7\""); + AddProp(ss, "__method", "\"GetPluginInstanceURL\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "components", PointerToString(components)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!components) { + iterator.skip(); + FromJSON_PP_URLComponents_Dev(iterator, *components); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_URLUtil_Dev_0_7*)RealGetInterface("PPB_URLUtil(Dev);0.7"))->GetPluginInstanceURL(instance, components); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!components) { + AddProp(os, "components", ToString_PP_URLComponents_Dev(components)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetPluginReferrerURL_0_7(PP_Instance instance, struct PP_URLComponents_Dev* components) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_URLUtil_Dev\""); + AddProp(ss, "__version", "\"0.7\""); + AddProp(ss, "__method", "\"GetPluginReferrerURL\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "components", PointerToString(components)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!components) { + iterator.skip(); + FromJSON_PP_URLComponents_Dev(iterator, *components); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_URLUtil_Dev_0_7*)RealGetInterface("PPB_URLUtil(Dev);0.7"))->GetPluginReferrerURL(instance, components); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!components) { + AddProp(os, "components", ToString_PP_URLComponents_Dev(components)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_URLUtil_Dev_0_7 _PPB_URLUtil_Dev_0_7 = { + ns_PPB_URLUtil_Dev_0_7::Canonicalize_0_7, + ns_PPB_URLUtil_Dev_0_7::ResolveRelativeToURL_0_7, + ns_PPB_URLUtil_Dev_0_7::ResolveRelativeToDocument_0_7, + ns_PPB_URLUtil_Dev_0_7::IsSameSecurityOrigin_0_7, + ns_PPB_URLUtil_Dev_0_7::DocumentCanRequest_0_7, + ns_PPB_URLUtil_Dev_0_7::DocumentCanAccessDocument_0_7, + ns_PPB_URLUtil_Dev_0_7::GetDocumentURL_0_7, + ns_PPB_URLUtil_Dev_0_7::GetPluginInstanceURL_0_7, + ns_PPB_URLUtil_Dev_0_7::GetPluginReferrerURL_0_7, +}; +const string ToString_PPB_URLUtil_Dev(const PPB_URLUtil_Dev_0_7 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Var_Deprecated_0_3 { +static void AddRef_0_3(struct PP_Var var) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Var_Deprecated\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"AddRef\""); + AddProp(ss, "var", ToString_PP_Var(var)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Var_Deprecated_0_3*)RealGetInterface("PPB_Var(Deprecated);0.3"))->AddRef(var); +#endif // !INTERPOSE +} +static void Release_0_3(struct PP_Var var) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Var_Deprecated\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"Release\""); + AddProp(ss, "var", ToString_PP_Var(var)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Var_Deprecated_0_3*)RealGetInterface("PPB_Var(Deprecated);0.3"))->Release(var); +#endif // !INTERPOSE +} +static struct PP_Var VarFromUtf8_0_3(PP_Module module, const char* data, uint32_t len) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Var_Deprecated\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"VarFromUtf8\""); + AddProp(ss, "module", ToString_PP_Module(module)); + AddProp(ss, "data", ToString_str_t(data)); + AddProp(ss, "len", ToString_uint32_t(len)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Var_Deprecated_0_3*)RealGetInterface("PPB_Var(Deprecated);0.3"))->VarFromUtf8(module, data, len); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static const char* VarToUtf8_0_3(struct PP_Var var, uint32_t* len) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Var_Deprecated\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"VarToUtf8\""); + AddProp(ss, "var", ToString_PP_Var(var)); + AddProp(ss, "len", PointerToString(len)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + char* rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_str_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_uint32_t(iterator, *len); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + const char* rval = ((PPB_Var_Deprecated_0_3*)RealGetInterface("PPB_Var(Deprecated);0.3"))->VarToUtf8(var, len); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_str_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!len) { + AddProp(os, "len", ToString_uint32_t(len)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool HasProperty_0_3(struct PP_Var object, struct PP_Var name, struct PP_Var* exception) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Var_Deprecated\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"HasProperty\""); + AddProp(ss, "object", ToString_PP_Var(object)); + AddProp(ss, "name", ToString_PP_Var(name)); + AddProp(ss, "exception", PointerToString(exception)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Var(iterator, *exception); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Var_Deprecated_0_3*)RealGetInterface("PPB_Var(Deprecated);0.3"))->HasProperty(object, name, exception); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!exception) { + AddProp(os, "exception", ToString_PP_Var(exception)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool HasMethod_0_3(struct PP_Var object, struct PP_Var name, struct PP_Var* exception) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Var_Deprecated\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"HasMethod\""); + AddProp(ss, "object", ToString_PP_Var(object)); + AddProp(ss, "name", ToString_PP_Var(name)); + AddProp(ss, "exception", PointerToString(exception)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Var(iterator, *exception); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Var_Deprecated_0_3*)RealGetInterface("PPB_Var(Deprecated);0.3"))->HasMethod(object, name, exception); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!exception) { + AddProp(os, "exception", ToString_PP_Var(exception)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetProperty_0_3(struct PP_Var object, struct PP_Var name, struct PP_Var* exception) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Var_Deprecated\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"GetProperty\""); + AddProp(ss, "object", ToString_PP_Var(object)); + AddProp(ss, "name", ToString_PP_Var(name)); + AddProp(ss, "exception", PointerToString(exception)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Var(iterator, *exception); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Var_Deprecated_0_3*)RealGetInterface("PPB_Var(Deprecated);0.3"))->GetProperty(object, name, exception); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!exception) { + AddProp(os, "exception", ToString_PP_Var(exception)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void GetAllPropertyNames_0_3(struct PP_Var object, uint32_t* property_count, struct PP_Var** properties, struct PP_Var* exception) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Var_Deprecated\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"GetAllPropertyNames\""); + AddProp(ss, "object", ToString_PP_Var(object)); + AddProp(ss, "property_count", PointerToString(property_count)); + AddProp(ss, "properties", PointerToString(properties)); + AddProp(ss, "exception", PointerToString(exception)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_uint32_t(iterator, *property_count); + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > *property_count) { + Fail("Too many items in array\n", ""); + } + *properties = new struct PP_Var[*property_count]; + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_PP_Var(iterator, (*properties)[_n]); + } + // FIXME Null out remaining items? + } + iterator.skip(); + FromJSON_PP_Var(iterator, *exception); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Var_Deprecated_0_3*)RealGetInterface("PPB_Var(Deprecated);0.3"))->GetAllPropertyNames(object, property_count, properties, exception); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + if (!!property_count) { + AddProp(os, "property_count", ToString_uint32_t(property_count)); + } + { + BeginProp(os, "properties"); + BeginElements(os); + for (uint32_t _n = 0; _n < *property_count; ++_n) { + AddElement(os, ToString_PP_Var(properties[_n])); + } + EndElements(os); + } + if (!!exception) { + AddProp(os, "exception", ToString_PP_Var(exception)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void SetProperty_0_3(struct PP_Var object, struct PP_Var name, struct PP_Var value, struct PP_Var* exception) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Var_Deprecated\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"SetProperty\""); + AddProp(ss, "object", ToString_PP_Var(object)); + AddProp(ss, "name", ToString_PP_Var(name)); + AddProp(ss, "value", ToString_PP_Var(value)); + AddProp(ss, "exception", PointerToString(exception)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Var(iterator, *exception); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Var_Deprecated_0_3*)RealGetInterface("PPB_Var(Deprecated);0.3"))->SetProperty(object, name, value, exception); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + if (!!exception) { + AddProp(os, "exception", ToString_PP_Var(exception)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void RemoveProperty_0_3(struct PP_Var object, struct PP_Var name, struct PP_Var* exception) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Var_Deprecated\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"RemoveProperty\""); + AddProp(ss, "object", ToString_PP_Var(object)); + AddProp(ss, "name", ToString_PP_Var(name)); + AddProp(ss, "exception", PointerToString(exception)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Var(iterator, *exception); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Var_Deprecated_0_3*)RealGetInterface("PPB_Var(Deprecated);0.3"))->RemoveProperty(object, name, exception); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + if (!!exception) { + AddProp(os, "exception", ToString_PP_Var(exception)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static struct PP_Var Call_0_3(struct PP_Var object, struct PP_Var method_name, uint32_t argc, const struct PP_Var argv[], struct PP_Var* exception) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Var_Deprecated\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"Call\""); + AddProp(ss, "object", ToString_PP_Var(object)); + AddProp(ss, "method_name", ToString_PP_Var(method_name)); + AddProp(ss, "argc", ToString_uint32_t(argc)); + { + BeginProp(ss, "argv"); + BeginElements(ss); + for (uint32_t _n = 0; _n < argc; ++_n) { + AddElement(ss, ToString_PP_Var(argv[_n])); + } + EndElements(ss); + } + AddProp(ss, "exception", PointerToString(exception)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Var(iterator, *exception); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Var_Deprecated_0_3*)RealGetInterface("PPB_Var(Deprecated);0.3"))->Call(object, method_name, argc, argv, exception); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!exception) { + AddProp(os, "exception", ToString_PP_Var(exception)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var Construct_0_3(struct PP_Var object, uint32_t argc, const struct PP_Var argv[], struct PP_Var* exception) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Var_Deprecated\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"Construct\""); + AddProp(ss, "object", ToString_PP_Var(object)); + AddProp(ss, "argc", ToString_uint32_t(argc)); + { + BeginProp(ss, "argv"); + BeginElements(ss); + for (uint32_t _n = 0; _n < argc; ++_n) { + AddElement(ss, ToString_PP_Var(argv[_n])); + } + EndElements(ss); + } + AddProp(ss, "exception", PointerToString(exception)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Var(iterator, *exception); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Var_Deprecated_0_3*)RealGetInterface("PPB_Var(Deprecated);0.3"))->Construct(object, argc, argv, exception); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!exception) { + AddProp(os, "exception", ToString_PP_Var(exception)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsInstanceOf_0_3(struct PP_Var var, const struct PPP_Class_Deprecated_1_0* object_class, void* object_data) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Var_Deprecated\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"IsInstanceOf\""); + AddProp(ss, "var", ToString_PP_Var(var)); + AddProp(ss, "object_class", ToString_PPP_Class_Deprecated(object_class)); + AddProp(ss, "object_data", PointerToString(object_data)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_mem_t(iterator, object_data); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + Logging_PPP_Class_Deprecated_holder* logging_object_class = new Logging_PPP_Class_Deprecated_holder(); + logging_object_class->_real_PPP_Class_Deprecated = object_class; + logging_object_class->object = object_data; + object_data = logging_object_class; + PP_Bool rval = ((PPB_Var_Deprecated_0_3*)RealGetInterface("PPB_Var(Deprecated);0.3"))->IsInstanceOf(var, &_interpose_PPP_Class_Deprecated_1_0, object_data); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + AddProp(os, "object_data", ToString_mem_t(object_data)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var CreateObject_0_3(PP_Instance instance, const struct PPP_Class_Deprecated_1_0* object_class, void* object_data) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Var_Deprecated\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"CreateObject\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "object_class", ToString_PPP_Class_Deprecated(object_class)); + AddProp(ss, "object_data", ToString_mem_t(object_data)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + Logging_PPP_Class_Deprecated_holder* logging_object_class = new Logging_PPP_Class_Deprecated_holder(); + logging_object_class->_real_PPP_Class_Deprecated = object_class; + logging_object_class->object = object_data; + object_data = logging_object_class; + struct PP_Var rval = ((PPB_Var_Deprecated_0_3*)RealGetInterface("PPB_Var(Deprecated);0.3"))->CreateObject(instance, &_interpose_PPP_Class_Deprecated_1_0, object_data); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var CreateObjectWithModuleDeprecated_0_3(PP_Module module, const struct PPP_Class_Deprecated_1_0* object_class, void* object_data) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Var_Deprecated\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"CreateObjectWithModuleDeprecated\""); + AddProp(ss, "module", ToString_PP_Module(module)); + AddProp(ss, "object_class", ToString_PPP_Class_Deprecated(object_class)); + AddProp(ss, "object_data", ToString_mem_t(object_data)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + Logging_PPP_Class_Deprecated_holder* logging_object_class = new Logging_PPP_Class_Deprecated_holder(); + logging_object_class->_real_PPP_Class_Deprecated = object_class; + logging_object_class->object = object_data; + object_data = logging_object_class; + struct PP_Var rval = ((PPB_Var_Deprecated_0_3*)RealGetInterface("PPB_Var(Deprecated);0.3"))->CreateObjectWithModuleDeprecated(module, &_interpose_PPP_Class_Deprecated_1_0, object_data); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_Var_Deprecated_0_3 _PPB_Var_Deprecated_0_3 = { + ns_PPB_Var_Deprecated_0_3::AddRef_0_3, + ns_PPB_Var_Deprecated_0_3::Release_0_3, + ns_PPB_Var_Deprecated_0_3::VarFromUtf8_0_3, + ns_PPB_Var_Deprecated_0_3::VarToUtf8_0_3, + ns_PPB_Var_Deprecated_0_3::HasProperty_0_3, + ns_PPB_Var_Deprecated_0_3::HasMethod_0_3, + ns_PPB_Var_Deprecated_0_3::GetProperty_0_3, + ns_PPB_Var_Deprecated_0_3::GetAllPropertyNames_0_3, + ns_PPB_Var_Deprecated_0_3::SetProperty_0_3, + ns_PPB_Var_Deprecated_0_3::RemoveProperty_0_3, + ns_PPB_Var_Deprecated_0_3::Call_0_3, + ns_PPB_Var_Deprecated_0_3::Construct_0_3, + ns_PPB_Var_Deprecated_0_3::IsInstanceOf_0_3, + ns_PPB_Var_Deprecated_0_3::CreateObject_0_3, + ns_PPB_Var_Deprecated_0_3::CreateObjectWithModuleDeprecated_0_3, +}; +const string ToString_PPB_Var_Deprecated(const PPB_Var_Deprecated_0_3 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_VideoCapture_Dev_0_3 { +static PP_Resource Create_0_3(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoCapture_Dev\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_VideoCapture_Dev_0_3*)RealGetInterface("PPB_VideoCapture(Dev);0.3"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsVideoCapture_0_3(PP_Resource video_capture) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoCapture_Dev\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"IsVideoCapture\""); + AddProp(ss, "video_capture", ToString_PP_Resource(video_capture)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_VideoCapture_Dev_0_3*)RealGetInterface("PPB_VideoCapture(Dev);0.3"))->IsVideoCapture(video_capture); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t EnumerateDevices_0_3(PP_Resource video_capture, struct PP_ArrayOutput output, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoCapture_Dev\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"EnumerateDevices\""); + AddProp(ss, "video_capture", ToString_PP_Resource(video_capture)); + AddProp(ss, "output", ToString_PP_ArrayOutput(output)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoCapture_Dev_0_3*)RealGetInterface("PPB_VideoCapture(Dev);0.3"))->EnumerateDevices(video_capture, output, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t MonitorDeviceChange_0_3(PP_Resource video_capture, PP_MonitorDeviceChangeCallback callback, void* user_data) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoCapture_Dev\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"MonitorDeviceChange\""); + AddProp(ss, "video_capture", ToString_PP_Resource(video_capture)); + AddProp(ss, "callback", ToString_PP_MonitorDeviceChangeCallback(callback)); + AddProp(ss, "user_data", ToString_mem_t(user_data)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_VideoCapture_Dev_0_3*)RealGetInterface("PPB_VideoCapture(Dev);0.3"))->MonitorDeviceChange(video_capture, callback, user_data); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Open_0_3(PP_Resource video_capture, PP_Resource device_ref, const struct PP_VideoCaptureDeviceInfo_Dev* requested_info, uint32_t buffer_count, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoCapture_Dev\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"Open\""); + AddProp(ss, "video_capture", ToString_PP_Resource(video_capture)); + AddProp(ss, "device_ref", ToString_PP_Resource(device_ref)); + AddProp(ss, "requested_info", ToString_PP_VideoCaptureDeviceInfo_Dev(requested_info)); + AddProp(ss, "buffer_count", ToString_uint32_t(buffer_count)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoCapture_Dev_0_3*)RealGetInterface("PPB_VideoCapture(Dev);0.3"))->Open(video_capture, device_ref, requested_info, buffer_count, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t StartCapture_0_3(PP_Resource video_capture) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoCapture_Dev\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"StartCapture\""); + AddProp(ss, "video_capture", ToString_PP_Resource(video_capture)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_VideoCapture_Dev_0_3*)RealGetInterface("PPB_VideoCapture(Dev);0.3"))->StartCapture(video_capture); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t ReuseBuffer_0_3(PP_Resource video_capture, uint32_t buffer) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoCapture_Dev\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"ReuseBuffer\""); + AddProp(ss, "video_capture", ToString_PP_Resource(video_capture)); + AddProp(ss, "buffer", ToString_uint32_t(buffer)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_VideoCapture_Dev_0_3*)RealGetInterface("PPB_VideoCapture(Dev);0.3"))->ReuseBuffer(video_capture, buffer); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t StopCapture_0_3(PP_Resource video_capture) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoCapture_Dev\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"StopCapture\""); + AddProp(ss, "video_capture", ToString_PP_Resource(video_capture)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_VideoCapture_Dev_0_3*)RealGetInterface("PPB_VideoCapture(Dev);0.3"))->StopCapture(video_capture); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void Close_0_3(PP_Resource video_capture) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoCapture_Dev\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"Close\""); + AddProp(ss, "video_capture", ToString_PP_Resource(video_capture)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_VideoCapture_Dev_0_3*)RealGetInterface("PPB_VideoCapture(Dev);0.3"))->Close(video_capture); +#endif // !INTERPOSE +} +} +static PPB_VideoCapture_Dev_0_3 _PPB_VideoCapture_Dev_0_3 = { + ns_PPB_VideoCapture_Dev_0_3::Create_0_3, + ns_PPB_VideoCapture_Dev_0_3::IsVideoCapture_0_3, + ns_PPB_VideoCapture_Dev_0_3::EnumerateDevices_0_3, + ns_PPB_VideoCapture_Dev_0_3::MonitorDeviceChange_0_3, + ns_PPB_VideoCapture_Dev_0_3::Open_0_3, + ns_PPB_VideoCapture_Dev_0_3::StartCapture_0_3, + ns_PPB_VideoCapture_Dev_0_3::ReuseBuffer_0_3, + ns_PPB_VideoCapture_Dev_0_3::StopCapture_0_3, + ns_PPB_VideoCapture_Dev_0_3::Close_0_3, +}; +const string ToString_PPB_VideoCapture_Dev(const PPB_VideoCapture_Dev_0_3 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_VideoDecoder_Dev_0_16 { +static PP_Resource Create_0_16(PP_Instance instance, PP_Resource context, PP_VideoDecoder_Profile profile) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder_Dev\""); + AddProp(ss, "__version", "\"0.16\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "context", ToString_PP_Resource(context)); + AddProp(ss, "profile", ToString_PP_VideoDecoder_Profile(profile)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_VideoDecoder_Dev_0_16*)RealGetInterface("PPB_VideoDecoder(Dev);0.16"))->Create(instance, context, profile); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsVideoDecoder_0_16(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder_Dev\""); + AddProp(ss, "__version", "\"0.16\""); + AddProp(ss, "__method", "\"IsVideoDecoder\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_VideoDecoder_Dev_0_16*)RealGetInterface("PPB_VideoDecoder(Dev);0.16"))->IsVideoDecoder(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Decode_0_16(PP_Resource video_decoder, const struct PP_VideoBitstreamBuffer_Dev* bitstream_buffer, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder_Dev\""); + AddProp(ss, "__version", "\"0.16\""); + AddProp(ss, "__method", "\"Decode\""); + AddProp(ss, "video_decoder", ToString_PP_Resource(video_decoder)); + AddProp(ss, "bitstream_buffer", ToString_PP_VideoBitstreamBuffer_Dev(bitstream_buffer)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoDecoder_Dev_0_16*)RealGetInterface("PPB_VideoDecoder(Dev);0.16"))->Decode(video_decoder, bitstream_buffer, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void AssignPictureBuffers_0_16(PP_Resource video_decoder, uint32_t no_of_buffers, const struct PP_PictureBuffer_Dev buffers[]) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder_Dev\""); + AddProp(ss, "__version", "\"0.16\""); + AddProp(ss, "__method", "\"AssignPictureBuffers\""); + AddProp(ss, "video_decoder", ToString_PP_Resource(video_decoder)); + AddProp(ss, "no_of_buffers", ToString_uint32_t(no_of_buffers)); + { + BeginProp(ss, "buffers"); + BeginElements(ss); + for (uint32_t _n = 0; _n < no_of_buffers; ++_n) { + AddElement(ss, ToString_PP_PictureBuffer_Dev(buffers[_n])); + } + EndElements(ss); + } + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_VideoDecoder_Dev_0_16*)RealGetInterface("PPB_VideoDecoder(Dev);0.16"))->AssignPictureBuffers(video_decoder, no_of_buffers, buffers); +#endif // !INTERPOSE +} +static void ReusePictureBuffer_0_16(PP_Resource video_decoder, int32_t picture_buffer_id) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder_Dev\""); + AddProp(ss, "__version", "\"0.16\""); + AddProp(ss, "__method", "\"ReusePictureBuffer\""); + AddProp(ss, "video_decoder", ToString_PP_Resource(video_decoder)); + AddProp(ss, "picture_buffer_id", ToString_int32_t(picture_buffer_id)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_VideoDecoder_Dev_0_16*)RealGetInterface("PPB_VideoDecoder(Dev);0.16"))->ReusePictureBuffer(video_decoder, picture_buffer_id); +#endif // !INTERPOSE +} +static int32_t Flush_0_16(PP_Resource video_decoder, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder_Dev\""); + AddProp(ss, "__version", "\"0.16\""); + AddProp(ss, "__method", "\"Flush\""); + AddProp(ss, "video_decoder", ToString_PP_Resource(video_decoder)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoDecoder_Dev_0_16*)RealGetInterface("PPB_VideoDecoder(Dev);0.16"))->Flush(video_decoder, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Reset_0_16(PP_Resource video_decoder, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder_Dev\""); + AddProp(ss, "__version", "\"0.16\""); + AddProp(ss, "__method", "\"Reset\""); + AddProp(ss, "video_decoder", ToString_PP_Resource(video_decoder)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoDecoder_Dev_0_16*)RealGetInterface("PPB_VideoDecoder(Dev);0.16"))->Reset(video_decoder, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void Destroy_0_16(PP_Resource video_decoder) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDecoder_Dev\""); + AddProp(ss, "__version", "\"0.16\""); + AddProp(ss, "__method", "\"Destroy\""); + AddProp(ss, "video_decoder", ToString_PP_Resource(video_decoder)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_VideoDecoder_Dev_0_16*)RealGetInterface("PPB_VideoDecoder(Dev);0.16"))->Destroy(video_decoder); +#endif // !INTERPOSE +} +} +static PPB_VideoDecoder_Dev_0_16 _PPB_VideoDecoder_Dev_0_16 = { + ns_PPB_VideoDecoder_Dev_0_16::Create_0_16, + ns_PPB_VideoDecoder_Dev_0_16::IsVideoDecoder_0_16, + ns_PPB_VideoDecoder_Dev_0_16::Decode_0_16, + ns_PPB_VideoDecoder_Dev_0_16::AssignPictureBuffers_0_16, + ns_PPB_VideoDecoder_Dev_0_16::ReusePictureBuffer_0_16, + ns_PPB_VideoDecoder_Dev_0_16::Flush_0_16, + ns_PPB_VideoDecoder_Dev_0_16::Reset_0_16, + ns_PPB_VideoDecoder_Dev_0_16::Destroy_0_16, +}; +const string ToString_PPB_VideoDecoder_Dev(const PPB_VideoDecoder_Dev_0_16 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_View_Dev_0_1 { +static float GetDeviceScale_0_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_View_Dev\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetDeviceScale\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + float rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_float_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + float rval = ((PPB_View_Dev_0_1*)RealGetInterface("PPB_View(Dev);0.1"))->GetDeviceScale(resource); + printf("RPC response: ["); + printf("%s", ToString_float_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static float GetCSSScale_0_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_View_Dev\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetCSSScale\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + float rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_float_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + float rval = ((PPB_View_Dev_0_1*)RealGetInterface("PPB_View(Dev);0.1"))->GetCSSScale(resource); + printf("RPC response: ["); + printf("%s", ToString_float_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_View_Dev_0_1 _PPB_View_Dev_0_1 = { + ns_PPB_View_Dev_0_1::GetDeviceScale_0_1, + ns_PPB_View_Dev_0_1::GetCSSScale_0_1, +}; +const string ToString_PPB_View_Dev(const PPB_View_Dev_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +char* Call_PPP_Class_Deprecated_HasProperty(const PPP_Class_Deprecated* _interface, JSONIterator& iterator) { + void* object; + iterator.skip(); + FromJSON_mem_t(iterator, object); + struct PP_Var name; + iterator.skip(); + FromJSON_PP_Var(iterator, name); + struct PP_Var exception; + PP_Bool rval; + rval = _interface->HasProperty((const void* )object, (struct PP_Var )name, (struct PP_Var* )&exception); + stringstream os; + BeginElements(os); + AddElement(os, ToString_PP_Bool(rval).c_str()); + BeginElement(os); + BeginProps(os); + AddProp(os, "exception", ToString_PP_Var(exception)); + EndProps(os); + EndElements(os); + return strdup(os.str().c_str()); +} +char* Call_PPP_Class_Deprecated_HasMethod(const PPP_Class_Deprecated* _interface, JSONIterator& iterator) { + void* object; + iterator.skip(); + FromJSON_mem_t(iterator, object); + struct PP_Var name; + iterator.skip(); + FromJSON_PP_Var(iterator, name); + struct PP_Var exception; + PP_Bool rval; + rval = _interface->HasMethod((const void* )object, (struct PP_Var )name, (struct PP_Var* )&exception); + stringstream os; + BeginElements(os); + AddElement(os, ToString_PP_Bool(rval).c_str()); + BeginElement(os); + BeginProps(os); + AddProp(os, "exception", ToString_PP_Var(exception)); + EndProps(os); + EndElements(os); + return strdup(os.str().c_str()); +} +char* Call_PPP_Class_Deprecated_GetProperty(const PPP_Class_Deprecated* _interface, JSONIterator& iterator) { + void* object; + iterator.skip(); + FromJSON_mem_t(iterator, object); + struct PP_Var name; + iterator.skip(); + FromJSON_PP_Var(iterator, name); + struct PP_Var exception; + struct PP_Var rval; + rval = _interface->GetProperty((const void* )object, (struct PP_Var )name, (struct PP_Var* )&exception); + stringstream os; + BeginElements(os); + AddElement(os, ToString_PP_Var(rval).c_str()); + BeginElement(os); + BeginProps(os); + AddProp(os, "exception", ToString_PP_Var(exception)); + EndProps(os); + EndElements(os); + return strdup(os.str().c_str()); +} +char* Call_PPP_Class_Deprecated_GetAllPropertyNames(const PPP_Class_Deprecated* _interface, JSONIterator& iterator) { + void* object; + iterator.skip(); + FromJSON_mem_t(iterator, object); + uint32_t property_count; + struct PP_Var *properties; + iterator.skip(); + PointerValueFromJSON(iterator, properties); + struct PP_Var exception; + _interface->GetAllPropertyNames((const void* )object, (uint32_t* )&property_count, (struct PP_Var** )&properties, (struct PP_Var* )&exception); + stringstream os; + BeginElements(os); + BeginProps(os); + AddProp(os, "property_count", ToString_uint32_t(property_count)); + { + BeginProp(os, "properties"); + BeginElements(os); + for (uint32_t _n = 0; _n < property_count; ++_n) { + AddElement(os, ToString_PP_Var(properties[_n])); + } + EndElements(os); + } + AddProp(os, "exception", ToString_PP_Var(exception)); + EndProps(os); + EndElements(os); + return strdup(os.str().c_str()); +} +char* Call_PPP_Class_Deprecated_SetProperty(const PPP_Class_Deprecated* _interface, JSONIterator& iterator) { + void* object; + iterator.skip(); + FromJSON_mem_t(iterator, object); + struct PP_Var name; + iterator.skip(); + FromJSON_PP_Var(iterator, name); + struct PP_Var value; + iterator.skip(); + FromJSON_PP_Var(iterator, value); + struct PP_Var exception; + _interface->SetProperty((const void* )object, (struct PP_Var )name, (struct PP_Var )value, (struct PP_Var* )&exception); + stringstream os; + BeginElements(os); + BeginProps(os); + AddProp(os, "exception", ToString_PP_Var(exception)); + EndProps(os); + EndElements(os); + return strdup(os.str().c_str()); +} +char* Call_PPP_Class_Deprecated_RemoveProperty(const PPP_Class_Deprecated* _interface, JSONIterator& iterator) { + void* object; + iterator.skip(); + FromJSON_mem_t(iterator, object); + struct PP_Var name; + iterator.skip(); + FromJSON_PP_Var(iterator, name); + struct PP_Var exception; + _interface->RemoveProperty((const void* )object, (struct PP_Var )name, (struct PP_Var* )&exception); + stringstream os; + BeginElements(os); + BeginProps(os); + AddProp(os, "exception", ToString_PP_Var(exception)); + EndProps(os); + EndElements(os); + return strdup(os.str().c_str()); +} +char* Call_PPP_Class_Deprecated_Call(const PPP_Class_Deprecated* _interface, JSONIterator& iterator) { + void* object; + iterator.skip(); + FromJSON_mem_t(iterator, object); + struct PP_Var method_name; + iterator.skip(); + FromJSON_PP_Var(iterator, method_name); + uint32_t argc; + iterator.skip(); + FromJSON_uint32_t(iterator, argc); + struct PP_Var *argv; + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > argc) { + Fail("Too many items in array\n", ""); + } + argv = new struct PP_Var[argc]; + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_PP_Var(iterator, (argv)[_n]); + } + // FIXME Null out remaining items? + } + struct PP_Var exception; + struct PP_Var rval; + rval = _interface->Call((const void* )object, (struct PP_Var )method_name, (uint32_t )argc, (const struct PP_Var *)argv, (struct PP_Var* )&exception); + stringstream os; + BeginElements(os); + AddElement(os, ToString_PP_Var(rval).c_str()); + BeginElement(os); + BeginProps(os); + AddProp(os, "exception", ToString_PP_Var(exception)); + EndProps(os); + EndElements(os); + return strdup(os.str().c_str()); +} +char* Call_PPP_Class_Deprecated_Construct(const PPP_Class_Deprecated* _interface, JSONIterator& iterator) { + void* object; + iterator.skip(); + FromJSON_mem_t(iterator, object); + uint32_t argc; + iterator.skip(); + FromJSON_uint32_t(iterator, argc); + struct PP_Var *argv; + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > argc) { + Fail("Too many items in array\n", ""); + } + argv = new struct PP_Var[argc]; + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_PP_Var(iterator, (argv)[_n]); + } + // FIXME Null out remaining items? + } + struct PP_Var exception; + struct PP_Var rval; + rval = _interface->Construct((const void* )object, (uint32_t )argc, (const struct PP_Var *)argv, (struct PP_Var* )&exception); + stringstream os; + BeginElements(os); + AddElement(os, ToString_PP_Var(rval).c_str()); + BeginElement(os); + BeginProps(os); + AddProp(os, "exception", ToString_PP_Var(exception)); + EndProps(os); + EndElements(os); + return strdup(os.str().c_str()); +} +char* Call_PPP_Class_Deprecated_Deallocate(const PPP_Class_Deprecated* _interface, JSONIterator& iterator) { + void* object; + iterator.skip(); + FromJSON_mem_t(iterator, object); + _interface->Deallocate((const void* )object); + return nullptr; +} +char* Call_PPP_Class_Deprecated(const void* _interface, JSONIterator& iterator) { + iterator.skip(); + const Token& member = iterator.getCurrentStringAndGotoNext(); + string memberName = member.value(); + if (!memberName.compare("HasProperty")) { + return Call_PPP_Class_Deprecated_HasProperty((const PPP_Class_Deprecated*)_interface, iterator); + } + if (!memberName.compare("HasMethod")) { + return Call_PPP_Class_Deprecated_HasMethod((const PPP_Class_Deprecated*)_interface, iterator); + } + if (!memberName.compare("GetProperty")) { + return Call_PPP_Class_Deprecated_GetProperty((const PPP_Class_Deprecated*)_interface, iterator); + } + if (!memberName.compare("GetAllPropertyNames")) { + return Call_PPP_Class_Deprecated_GetAllPropertyNames((const PPP_Class_Deprecated*)_interface, iterator); + } + if (!memberName.compare("SetProperty")) { + return Call_PPP_Class_Deprecated_SetProperty((const PPP_Class_Deprecated*)_interface, iterator); + } + if (!memberName.compare("RemoveProperty")) { + return Call_PPP_Class_Deprecated_RemoveProperty((const PPP_Class_Deprecated*)_interface, iterator); + } + if (!memberName.compare("Call")) { + return Call_PPP_Class_Deprecated_Call((const PPP_Class_Deprecated*)_interface, iterator); + } + if (!memberName.compare("Construct")) { + return Call_PPP_Class_Deprecated_Construct((const PPP_Class_Deprecated*)_interface, iterator); + } + if (!memberName.compare("Deallocate")) { + return Call_PPP_Class_Deprecated_Deallocate((const PPP_Class_Deprecated*)_interface, iterator); + } + return nullptr; +} +char* Call_PPP_NetworkState_Dev_SetOnLine(const PPP_NetworkState_Dev* _interface, JSONIterator& iterator) { + PP_Bool is_online; + iterator.skip(); + FromJSON_PP_Bool(iterator, is_online); + _interface->SetOnLine((PP_Bool )is_online); + return nullptr; +} +char* Call_PPP_NetworkState_Dev(const void* _interface, JSONIterator& iterator) { + iterator.skip(); + const Token& member = iterator.getCurrentStringAndGotoNext(); + string memberName = member.value(); + if (!memberName.compare("SetOnLine")) { + return Call_PPP_NetworkState_Dev_SetOnLine((const PPP_NetworkState_Dev*)_interface, iterator); + } + return nullptr; +} +const string ToString_PP_PrintPageNumberRange_Dev(const PP_PrintPageNumberRange_Dev *v) { + if (!v) { + return "null"; + } + return ToString_PP_PrintPageNumberRange_Dev(*v); +} +const string ToString_PP_PrintPageNumberRange_Dev(const PP_PrintPageNumberRange_Dev &v) { + stringstream x; + BeginProps(x); + AddProp(x, "first_page_number", ToString_uint32_t(v.first_page_number)); + AddProp(x, "last_page_number", ToString_uint32_t(v.last_page_number)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_PrintPageNumberRange_Dev(JSONIterator& iterator, PP_PrintPageNumberRange_Dev &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_uint32_t(iterator, value.first_page_number); + iterator.skip(); + FromJSON_uint32_t(iterator, value.last_page_number); +} +char* Call_PPP_Printing_Dev_QuerySupportedFormats(const PPP_Printing_Dev* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + uint32_t rval; + rval = _interface->QuerySupportedFormats((PP_Instance )instance); + return strdup(ToString_uint32_t(rval).c_str()); +} +char* Call_PPP_Printing_Dev_Begin(const PPP_Printing_Dev* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + struct PP_PrintSettings_Dev print_settings; + iterator.skip(); + FromJSON_PP_PrintSettings_Dev(iterator, print_settings); + int32_t rval; + rval = _interface->Begin((PP_Instance )instance, (const struct PP_PrintSettings_Dev* )&print_settings); + return strdup(ToString_int32_t(rval).c_str()); +} +char* Call_PPP_Printing_Dev_PrintPages(const PPP_Printing_Dev* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + struct PP_PrintPageNumberRange_Dev page_ranges; + iterator.skip(); + FromJSON_PP_PrintPageNumberRange_Dev(iterator, page_ranges); + uint32_t page_range_count; + iterator.skip(); + FromJSON_uint32_t(iterator, page_range_count); + int32_t rval; + rval = _interface->PrintPages((PP_Instance )instance, (const struct PP_PrintPageNumberRange_Dev* )&page_ranges, (uint32_t )page_range_count); + return strdup(ToString_PP_Resource(rval).c_str()); +} +char* Call_PPP_Printing_Dev_End(const PPP_Printing_Dev* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + _interface->End((PP_Instance )instance); + return nullptr; +} +char* Call_PPP_Printing_Dev_IsScalingDisabled(const PPP_Printing_Dev* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + PP_Bool rval; + rval = _interface->IsScalingDisabled((PP_Instance )instance); + return strdup(ToString_PP_Bool(rval).c_str()); +} +char* Call_PPP_Printing_Dev(const void* _interface, JSONIterator& iterator) { + iterator.skip(); + const Token& member = iterator.getCurrentStringAndGotoNext(); + string memberName = member.value(); + if (!memberName.compare("QuerySupportedFormats")) { + return Call_PPP_Printing_Dev_QuerySupportedFormats((const PPP_Printing_Dev*)_interface, iterator); + } + if (!memberName.compare("Begin")) { + return Call_PPP_Printing_Dev_Begin((const PPP_Printing_Dev*)_interface, iterator); + } + if (!memberName.compare("PrintPages")) { + return Call_PPP_Printing_Dev_PrintPages((const PPP_Printing_Dev*)_interface, iterator); + } + if (!memberName.compare("End")) { + return Call_PPP_Printing_Dev_End((const PPP_Printing_Dev*)_interface, iterator); + } + if (!memberName.compare("IsScalingDisabled")) { + return Call_PPP_Printing_Dev_IsScalingDisabled((const PPP_Printing_Dev*)_interface, iterator); + } + return nullptr; +} +char* Call_PPP_TextInput_Dev_RequestSurroundingText(const PPP_TextInput_Dev* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + uint32_t desired_number_of_characters; + iterator.skip(); + FromJSON_uint32_t(iterator, desired_number_of_characters); + _interface->RequestSurroundingText((PP_Instance )instance, (uint32_t )desired_number_of_characters); + return nullptr; +} +char* Call_PPP_TextInput_Dev(const void* _interface, JSONIterator& iterator) { + iterator.skip(); + const Token& member = iterator.getCurrentStringAndGotoNext(); + string memberName = member.value(); + if (!memberName.compare("RequestSurroundingText")) { + return Call_PPP_TextInput_Dev_RequestSurroundingText((const PPP_TextInput_Dev*)_interface, iterator); + } + return nullptr; +} +char* Call_PPP_VideoCapture_Dev_OnDeviceInfo(const PPP_VideoCapture_Dev* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + PP_Resource video_capture; + iterator.skip(); + FromJSON_PP_Resource(iterator, video_capture); + struct PP_VideoCaptureDeviceInfo_Dev info; + iterator.skip(); + FromJSON_PP_VideoCaptureDeviceInfo_Dev(iterator, info); + uint32_t buffer_count; + iterator.skip(); + FromJSON_uint32_t(iterator, buffer_count); + PP_Resource *buffers; + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > buffer_count) { + Fail("Too many items in array\n", ""); + } + buffers = new PP_Resource[buffer_count]; + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_PP_Resource(iterator, (buffers)[_n]); + } + // FIXME Null out remaining items? + } + _interface->OnDeviceInfo((PP_Instance )instance, (PP_Resource )video_capture, (const struct PP_VideoCaptureDeviceInfo_Dev* )&info, (uint32_t )buffer_count, (const PP_Resource *)buffers); + return nullptr; +} +char* Call_PPP_VideoCapture_Dev_OnStatus(const PPP_VideoCapture_Dev* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + PP_Resource video_capture; + iterator.skip(); + FromJSON_PP_Resource(iterator, video_capture); + uint32_t status; + iterator.skip(); + FromJSON_uint32_t(iterator, status); + _interface->OnStatus((PP_Instance )instance, (PP_Resource )video_capture, (uint32_t )status); + return nullptr; +} +char* Call_PPP_VideoCapture_Dev_OnError(const PPP_VideoCapture_Dev* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + PP_Resource video_capture; + iterator.skip(); + FromJSON_PP_Resource(iterator, video_capture); + uint32_t error_code; + iterator.skip(); + FromJSON_uint32_t(iterator, error_code); + _interface->OnError((PP_Instance )instance, (PP_Resource )video_capture, (uint32_t )error_code); + return nullptr; +} +char* Call_PPP_VideoCapture_Dev_OnBufferReady(const PPP_VideoCapture_Dev* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + PP_Resource video_capture; + iterator.skip(); + FromJSON_PP_Resource(iterator, video_capture); + uint32_t buffer; + iterator.skip(); + FromJSON_uint32_t(iterator, buffer); + _interface->OnBufferReady((PP_Instance )instance, (PP_Resource )video_capture, (uint32_t )buffer); + return nullptr; +} +char* Call_PPP_VideoCapture_Dev(const void* _interface, JSONIterator& iterator) { + iterator.skip(); + const Token& member = iterator.getCurrentStringAndGotoNext(); + string memberName = member.value(); + if (!memberName.compare("OnDeviceInfo")) { + return Call_PPP_VideoCapture_Dev_OnDeviceInfo((const PPP_VideoCapture_Dev*)_interface, iterator); + } + if (!memberName.compare("OnStatus")) { + return Call_PPP_VideoCapture_Dev_OnStatus((const PPP_VideoCapture_Dev*)_interface, iterator); + } + if (!memberName.compare("OnError")) { + return Call_PPP_VideoCapture_Dev_OnError((const PPP_VideoCapture_Dev*)_interface, iterator); + } + if (!memberName.compare("OnBufferReady")) { + return Call_PPP_VideoCapture_Dev_OnBufferReady((const PPP_VideoCapture_Dev*)_interface, iterator); + } + return nullptr; +} +char* Call_PPP_VideoDecoder_Dev_ProvidePictureBuffers(const PPP_VideoDecoder_Dev* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + PP_Resource decoder; + iterator.skip(); + FromJSON_PP_Resource(iterator, decoder); + uint32_t req_num_of_bufs; + iterator.skip(); + FromJSON_uint32_t(iterator, req_num_of_bufs); + struct PP_Size dimensions; + iterator.skip(); + FromJSON_PP_Size(iterator, dimensions); + uint32_t texture_target; + iterator.skip(); + FromJSON_uint32_t(iterator, texture_target); + _interface->ProvidePictureBuffers((PP_Instance )instance, (PP_Resource )decoder, (uint32_t )req_num_of_bufs, (const struct PP_Size* )&dimensions, (uint32_t )texture_target); + return nullptr; +} +char* Call_PPP_VideoDecoder_Dev_DismissPictureBuffer(const PPP_VideoDecoder_Dev* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + PP_Resource decoder; + iterator.skip(); + FromJSON_PP_Resource(iterator, decoder); + int32_t picture_buffer_id; + iterator.skip(); + FromJSON_int32_t(iterator, picture_buffer_id); + _interface->DismissPictureBuffer((PP_Instance )instance, (PP_Resource )decoder, (int32_t )picture_buffer_id); + return nullptr; +} +char* Call_PPP_VideoDecoder_Dev_PictureReady(const PPP_VideoDecoder_Dev* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + PP_Resource decoder; + iterator.skip(); + FromJSON_PP_Resource(iterator, decoder); + struct PP_Picture_Dev picture; + iterator.skip(); + FromJSON_PP_Picture_Dev(iterator, picture); + _interface->PictureReady((PP_Instance )instance, (PP_Resource )decoder, (const struct PP_Picture_Dev* )&picture); + return nullptr; +} +char* Call_PPP_VideoDecoder_Dev_NotifyError(const PPP_VideoDecoder_Dev* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + PP_Resource decoder; + iterator.skip(); + FromJSON_PP_Resource(iterator, decoder); + PP_VideoDecodeError_Dev error; + iterator.skip(); + FromJSON_PP_VideoDecodeError_Dev(iterator, error); + _interface->NotifyError((PP_Instance )instance, (PP_Resource )decoder, (PP_VideoDecodeError_Dev )error); + return nullptr; +} +char* Call_PPP_VideoDecoder_Dev(const void* _interface, JSONIterator& iterator) { + iterator.skip(); + const Token& member = iterator.getCurrentStringAndGotoNext(); + string memberName = member.value(); + if (!memberName.compare("ProvidePictureBuffers")) { + return Call_PPP_VideoDecoder_Dev_ProvidePictureBuffers((const PPP_VideoDecoder_Dev*)_interface, iterator); + } + if (!memberName.compare("DismissPictureBuffer")) { + return Call_PPP_VideoDecoder_Dev_DismissPictureBuffer((const PPP_VideoDecoder_Dev*)_interface, iterator); + } + if (!memberName.compare("PictureReady")) { + return Call_PPP_VideoDecoder_Dev_PictureReady((const PPP_VideoDecoder_Dev*)_interface, iterator); + } + if (!memberName.compare("NotifyError")) { + return Call_PPP_VideoDecoder_Dev_NotifyError((const PPP_VideoDecoder_Dev*)_interface, iterator); + } + return nullptr; +} +const string ToString_PP_DecryptTrackingInfo(const PP_DecryptTrackingInfo *v) { + if (!v) { + return "null"; + } + return ToString_PP_DecryptTrackingInfo(*v); +} +const string ToString_PP_DecryptTrackingInfo(const PP_DecryptTrackingInfo &v) { + stringstream x; + BeginProps(x); + AddProp(x, "request_id", ToString_uint32_t(v.request_id)); + AddProp(x, "buffer_id", ToString_uint32_t(v.buffer_id)); + AddProp(x, "timestamp", ToString_int64_t(v.timestamp)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_DecryptTrackingInfo(JSONIterator& iterator, PP_DecryptTrackingInfo &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_uint32_t(iterator, value.request_id); + iterator.skip(); + FromJSON_uint32_t(iterator, value.buffer_id); + iterator.skip(); + FromJSON_int64_t(iterator, value.timestamp); +} +const string ToString_PP_DecryptSubsampleDescription(const PP_DecryptSubsampleDescription *v) { + if (!v) { + return "null"; + } + return ToString_PP_DecryptSubsampleDescription(*v); +} +const string ToString_PP_DecryptSubsampleDescription(const PP_DecryptSubsampleDescription &v) { + stringstream x; + BeginProps(x); + AddProp(x, "clear_bytes", ToString_uint32_t(v.clear_bytes)); + AddProp(x, "cipher_bytes", ToString_uint32_t(v.cipher_bytes)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_DecryptSubsampleDescription(JSONIterator& iterator, PP_DecryptSubsampleDescription &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_uint32_t(iterator, value.clear_bytes); + iterator.skip(); + FromJSON_uint32_t(iterator, value.cipher_bytes); +} +const string ToString_PP_EncryptedBlockInfo(const PP_EncryptedBlockInfo *v) { + if (!v) { + return "null"; + } + return ToString_PP_EncryptedBlockInfo(*v); +} +const string ToString_PP_EncryptedBlockInfo(const PP_EncryptedBlockInfo &v) { + stringstream x; + BeginProps(x); + AddProp(x, "tracking_info", ToString_PP_DecryptTrackingInfo(v.tracking_info)); + AddProp(x, "data_size", ToString_uint32_t(v.data_size)); + { + BeginProp(x, "key_id"); + BeginElements(x); + for (uint32_t _n = 0; _n < 64; ++_n) { + AddElement(x, ToString_uint8_t(v.key_id[_n])); + } + EndElements(x); + } + AddProp(x, "key_id_size", ToString_uint32_t(v.key_id_size)); + { + BeginProp(x, "iv"); + BeginElements(x); + for (uint32_t _n = 0; _n < 16; ++_n) { + AddElement(x, ToString_uint8_t(v.iv[_n])); + } + EndElements(x); + } + AddProp(x, "iv_size", ToString_uint32_t(v.iv_size)); + { + BeginProp(x, "subsamples"); + BeginElements(x); + for (uint32_t _n = 0; _n < 32; ++_n) { + AddElement(x, ToString_PP_DecryptSubsampleDescription(v.subsamples[_n])); + } + EndElements(x); + } + AddProp(x, "num_subsamples", ToString_uint32_t(v.num_subsamples)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_EncryptedBlockInfo(JSONIterator& iterator, PP_EncryptedBlockInfo &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_PP_DecryptTrackingInfo(iterator, value.tracking_info); + iterator.skip(); + FromJSON_uint32_t(iterator, value.data_size); + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > 64) { + Fail("Too many items in array\n", ""); + } + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_uint8_t(iterator, (value.key_id)[_n]); + } + // FIXME Null out remaining items? + } + iterator.skip(); + FromJSON_uint32_t(iterator, value.key_id_size); + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > 16) { + Fail("Too many items in array\n", ""); + } + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_uint8_t(iterator, (value.iv)[_n]); + } + // FIXME Null out remaining items? + } + iterator.skip(); + FromJSON_uint32_t(iterator, value.iv_size); + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > 32) { + Fail("Too many items in array\n", ""); + } + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_PP_DecryptSubsampleDescription(iterator, (value.subsamples)[_n]); + } + // FIXME Null out remaining items? + } + iterator.skip(); + FromJSON_uint32_t(iterator, value.num_subsamples); +} +const string ToString_PP_DecryptedFrameFormat(const PP_DecryptedFrameFormat *v) { + switch (*v) { + case 0: + return "\"PP_DECRYPTEDFRAMEFORMAT_UNKNOWN\""; + case 1: + return "\"PP_DECRYPTEDFRAMEFORMAT_YV12\""; + case 2: + return "\"PP_DECRYPTEDFRAMEFORMAT_I420\""; + default: + return "\"???\""; + } +} +const string ToString_PP_DecryptedFrameFormat(const PP_DecryptedFrameFormat &v) { + return ToString_PP_DecryptedFrameFormat(&v); +} +void FromJSON_PP_DecryptedFrameFormat(JSONIterator& iterator, PP_DecryptedFrameFormat &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_DecryptedFrameFormat(v); +} +const string ToString_PP_DecryptedSampleFormat(const PP_DecryptedSampleFormat *v) { + switch (*v) { + case 0: + return "\"PP_DECRYPTEDSAMPLEFORMAT_UNKNOWN\""; + case 1: + return "\"PP_DECRYPTEDSAMPLEFORMAT_U8\""; + case 2: + return "\"PP_DECRYPTEDSAMPLEFORMAT_S16\""; + case 3: + return "\"PP_DECRYPTEDSAMPLEFORMAT_S32\""; + case 4: + return "\"PP_DECRYPTEDSAMPLEFORMAT_F32\""; + case 5: + return "\"PP_DECRYPTEDSAMPLEFORMAT_PLANAR_S16\""; + case 6: + return "\"PP_DECRYPTEDSAMPLEFORMAT_PLANAR_F32\""; + default: + return "\"???\""; + } +} +const string ToString_PP_DecryptedSampleFormat(const PP_DecryptedSampleFormat &v) { + return ToString_PP_DecryptedSampleFormat(&v); +} +void FromJSON_PP_DecryptedSampleFormat(JSONIterator& iterator, PP_DecryptedSampleFormat &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_DecryptedSampleFormat(v); +} +const string ToString_PP_DecryptResult(const PP_DecryptResult *v) { + switch (*v) { + case 0: + return "\"PP_DECRYPTRESULT_SUCCESS\""; + case 1: + return "\"PP_DECRYPTRESULT_DECRYPT_NOKEY\""; + case 2: + return "\"PP_DECRYPTRESULT_NEEDMOREDATA\""; + case 3: + return "\"PP_DECRYPTRESULT_DECRYPT_ERROR\""; + case 4: + return "\"PP_DECRYPTRESULT_DECODE_ERROR\""; + default: + return "\"???\""; + } +} +const string ToString_PP_DecryptResult(const PP_DecryptResult &v) { + return ToString_PP_DecryptResult(&v); +} +void FromJSON_PP_DecryptResult(JSONIterator& iterator, PP_DecryptResult &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_DecryptResult(v); +} +const string ToString_PP_DecryptedBlockInfo(const PP_DecryptedBlockInfo *v) { + if (!v) { + return "null"; + } + return ToString_PP_DecryptedBlockInfo(*v); +} +const string ToString_PP_DecryptedBlockInfo(const PP_DecryptedBlockInfo &v) { + stringstream x; + BeginProps(x); + AddProp(x, "result", ToString_PP_DecryptResult(v.result)); + AddProp(x, "data_size", ToString_uint32_t(v.data_size)); + AddProp(x, "tracking_info", ToString_PP_DecryptTrackingInfo(v.tracking_info)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_DecryptedBlockInfo(JSONIterator& iterator, PP_DecryptedBlockInfo &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_PP_DecryptResult(iterator, value.result); + iterator.skip(); + FromJSON_uint32_t(iterator, value.data_size); + iterator.skip(); + FromJSON_PP_DecryptTrackingInfo(iterator, value.tracking_info); +} +const string ToString_PP_DecryptedFramePlanes(const PP_DecryptedFramePlanes *v) { + switch (*v) { + case 0: + return "\"PP_DECRYPTEDFRAMEPLANES_Y\""; + case 1: + return "\"PP_DECRYPTEDFRAMEPLANES_U\""; + case 2: + return "\"PP_DECRYPTEDFRAMEPLANES_V\""; + default: + return "\"???\""; + } +} +const string ToString_PP_DecryptedFramePlanes(const PP_DecryptedFramePlanes &v) { + return ToString_PP_DecryptedFramePlanes(&v); +} +void FromJSON_PP_DecryptedFramePlanes(JSONIterator& iterator, PP_DecryptedFramePlanes &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_DecryptedFramePlanes(v); +} +const string ToString_PP_DecryptedFrameInfo(const PP_DecryptedFrameInfo *v) { + if (!v) { + return "null"; + } + return ToString_PP_DecryptedFrameInfo(*v); +} +const string ToString_PP_DecryptedFrameInfo(const PP_DecryptedFrameInfo &v) { + stringstream x; + BeginProps(x); + AddProp(x, "result", ToString_PP_DecryptResult(v.result)); + AddProp(x, "format", ToString_PP_DecryptedFrameFormat(v.format)); + { + BeginProp(x, "plane_offsets"); + BeginElements(x); + for (uint32_t _n = 0; _n < 3; ++_n) { + AddElement(x, ToString_int32_t(v.plane_offsets[_n])); + } + EndElements(x); + } + { + BeginProp(x, "strides"); + BeginElements(x); + for (uint32_t _n = 0; _n < 3; ++_n) { + AddElement(x, ToString_int32_t(v.strides[_n])); + } + EndElements(x); + } + AddProp(x, "width", ToString_int32_t(v.width)); + AddProp(x, "height", ToString_int32_t(v.height)); + AddProp(x, "tracking_info", ToString_PP_DecryptTrackingInfo(v.tracking_info)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_DecryptedFrameInfo(JSONIterator& iterator, PP_DecryptedFrameInfo &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_PP_DecryptResult(iterator, value.result); + iterator.skip(); + FromJSON_PP_DecryptedFrameFormat(iterator, value.format); + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > 3) { + Fail("Too many items in array\n", ""); + } + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_int32_t(iterator, (value.plane_offsets)[_n]); + } + // FIXME Null out remaining items? + } + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > 3) { + Fail("Too many items in array\n", ""); + } + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_int32_t(iterator, (value.strides)[_n]); + } + // FIXME Null out remaining items? + } + iterator.skip(); + FromJSON_int32_t(iterator, value.width); + iterator.skip(); + FromJSON_int32_t(iterator, value.height); + iterator.skip(); + FromJSON_PP_DecryptTrackingInfo(iterator, value.tracking_info); +} +const string ToString_PP_DecryptedSampleInfo(const PP_DecryptedSampleInfo *v) { + if (!v) { + return "null"; + } + return ToString_PP_DecryptedSampleInfo(*v); +} +const string ToString_PP_DecryptedSampleInfo(const PP_DecryptedSampleInfo &v) { + stringstream x; + BeginProps(x); + AddProp(x, "result", ToString_PP_DecryptResult(v.result)); + AddProp(x, "format", ToString_PP_DecryptedSampleFormat(v.format)); + AddProp(x, "data_size", ToString_uint32_t(v.data_size)); + AddProp(x, "padding", ToString_uint32_t(v.padding)); + AddProp(x, "tracking_info", ToString_PP_DecryptTrackingInfo(v.tracking_info)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_DecryptedSampleInfo(JSONIterator& iterator, PP_DecryptedSampleInfo &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_PP_DecryptResult(iterator, value.result); + iterator.skip(); + FromJSON_PP_DecryptedSampleFormat(iterator, value.format); + iterator.skip(); + FromJSON_uint32_t(iterator, value.data_size); + iterator.skip(); + FromJSON_uint32_t(iterator, value.padding); + iterator.skip(); + FromJSON_PP_DecryptTrackingInfo(iterator, value.tracking_info); +} +const string ToString_PP_AudioCodec(const PP_AudioCodec *v) { + switch (*v) { + case 0: + return "\"PP_AUDIOCODEC_UNKNOWN\""; + case 1: + return "\"PP_AUDIOCODEC_VORBIS\""; + case 2: + return "\"PP_AUDIOCODEC_AAC\""; + default: + return "\"???\""; + } +} +const string ToString_PP_AudioCodec(const PP_AudioCodec &v) { + return ToString_PP_AudioCodec(&v); +} +void FromJSON_PP_AudioCodec(JSONIterator& iterator, PP_AudioCodec &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_AudioCodec(v); +} +const string ToString_PP_AudioDecoderConfig(const PP_AudioDecoderConfig *v) { + if (!v) { + return "null"; + } + return ToString_PP_AudioDecoderConfig(*v); +} +const string ToString_PP_AudioDecoderConfig(const PP_AudioDecoderConfig &v) { + stringstream x; + BeginProps(x); + AddProp(x, "codec", ToString_PP_AudioCodec(v.codec)); + AddProp(x, "channel_count", ToString_int32_t(v.channel_count)); + AddProp(x, "bits_per_channel", ToString_int32_t(v.bits_per_channel)); + AddProp(x, "samples_per_second", ToString_int32_t(v.samples_per_second)); + AddProp(x, "request_id", ToString_uint32_t(v.request_id)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_AudioDecoderConfig(JSONIterator& iterator, PP_AudioDecoderConfig &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_PP_AudioCodec(iterator, value.codec); + iterator.skip(); + FromJSON_int32_t(iterator, value.channel_count); + iterator.skip(); + FromJSON_int32_t(iterator, value.bits_per_channel); + iterator.skip(); + FromJSON_int32_t(iterator, value.samples_per_second); + iterator.skip(); + FromJSON_uint32_t(iterator, value.request_id); +} +const string ToString_PP_VideoCodec(const PP_VideoCodec *v) { + switch (*v) { + case 0: + return "\"PP_VIDEOCODEC_UNKNOWN\""; + case 1: + return "\"PP_VIDEOCODEC_VP8\""; + case 2: + return "\"PP_VIDEOCODEC_H264\""; + case 3: + return "\"PP_VIDEOCODEC_VP9\""; + default: + return "\"???\""; + } +} +const string ToString_PP_VideoCodec(const PP_VideoCodec &v) { + return ToString_PP_VideoCodec(&v); +} +void FromJSON_PP_VideoCodec(JSONIterator& iterator, PP_VideoCodec &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_VideoCodec(v); +} +const string ToString_PP_VideoCodecProfile(const PP_VideoCodecProfile *v) { + switch (*v) { + case 0: + return "\"PP_VIDEOCODECPROFILE_UNKNOWN\""; + case 1: + return "\"PP_VIDEOCODECPROFILE_NOT_NEEDED\""; + case 2: + return "\"PP_VIDEOCODECPROFILE_H264_BASELINE\""; + case 3: + return "\"PP_VIDEOCODECPROFILE_H264_MAIN\""; + case 4: + return "\"PP_VIDEOCODECPROFILE_H264_EXTENDED\""; + case 5: + return "\"PP_VIDEOCODECPROFILE_H264_HIGH\""; + case 6: + return "\"PP_VIDEOCODECPROFILE_H264_HIGH_10\""; + case 7: + return "\"PP_VIDEOCODECPROFILE_H264_HIGH_422\""; + case 8: + return "\"PP_VIDEOCODECPROFILE_H264_HIGH_444_PREDICTIVE\""; + default: + return "\"???\""; + } +} +const string ToString_PP_VideoCodecProfile(const PP_VideoCodecProfile &v) { + return ToString_PP_VideoCodecProfile(&v); +} +void FromJSON_PP_VideoCodecProfile(JSONIterator& iterator, PP_VideoCodecProfile &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_VideoCodecProfile(v); +} +const string ToString_PP_VideoDecoderConfig(const PP_VideoDecoderConfig *v) { + if (!v) { + return "null"; + } + return ToString_PP_VideoDecoderConfig(*v); +} +const string ToString_PP_VideoDecoderConfig(const PP_VideoDecoderConfig &v) { + stringstream x; + BeginProps(x); + AddProp(x, "codec", ToString_PP_VideoCodec(v.codec)); + AddProp(x, "profile", ToString_PP_VideoCodecProfile(v.profile)); + AddProp(x, "format", ToString_PP_DecryptedFrameFormat(v.format)); + AddProp(x, "width", ToString_int32_t(v.width)); + AddProp(x, "height", ToString_int32_t(v.height)); + AddProp(x, "request_id", ToString_uint32_t(v.request_id)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_VideoDecoderConfig(JSONIterator& iterator, PP_VideoDecoderConfig &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_PP_VideoCodec(iterator, value.codec); + iterator.skip(); + FromJSON_PP_VideoCodecProfile(iterator, value.profile); + iterator.skip(); + FromJSON_PP_DecryptedFrameFormat(iterator, value.format); + iterator.skip(); + FromJSON_int32_t(iterator, value.width); + iterator.skip(); + FromJSON_int32_t(iterator, value.height); + iterator.skip(); + FromJSON_uint32_t(iterator, value.request_id); +} +const string ToString_PP_DecryptorStreamType(const PP_DecryptorStreamType *v) { + switch (*v) { + case 0: + return "\"PP_DECRYPTORSTREAMTYPE_AUDIO\""; + case 1: + return "\"PP_DECRYPTORSTREAMTYPE_VIDEO\""; + default: + return "\"???\""; + } +} +const string ToString_PP_DecryptorStreamType(const PP_DecryptorStreamType &v) { + return ToString_PP_DecryptorStreamType(&v); +} +void FromJSON_PP_DecryptorStreamType(JSONIterator& iterator, PP_DecryptorStreamType &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_DecryptorStreamType(v); +} +const string ToString_PP_SessionType(const PP_SessionType *v) { + switch (*v) { + case 0: + return "\"PP_SESSIONTYPE_TEMPORARY\""; + case 1: + return "\"PP_SESSIONTYPE_PERSISTENT_LICENSE\""; + case 2: + return "\"PP_SESSIONTYPE_PERSISTENT_RELEASE\""; + default: + return "\"???\""; + } +} +const string ToString_PP_SessionType(const PP_SessionType &v) { + return ToString_PP_SessionType(&v); +} +void FromJSON_PP_SessionType(JSONIterator& iterator, PP_SessionType &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_SessionType(v); +} +const string ToString_PP_InitDataType(const PP_InitDataType *v) { + switch (*v) { + case 0: + return "\"PP_INITDATATYPE_CENC\""; + case 1: + return "\"PP_INITDATATYPE_KEYIDS\""; + case 2: + return "\"PP_INITDATATYPE_WEBM\""; + default: + return "\"???\""; + } +} +const string ToString_PP_InitDataType(const PP_InitDataType &v) { + return ToString_PP_InitDataType(&v); +} +void FromJSON_PP_InitDataType(JSONIterator& iterator, PP_InitDataType &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_InitDataType(v); +} +const string ToString_PP_CdmExceptionCode(const PP_CdmExceptionCode *v) { + switch (*v) { + case 1: + return "\"PP_CDMEXCEPTIONCODE_NOTSUPPORTEDERROR\""; + case 2: + return "\"PP_CDMEXCEPTIONCODE_INVALIDSTATEERROR\""; + case 3: + return "\"PP_CDMEXCEPTIONCODE_INVALIDACCESSERROR\""; + case 4: + return "\"PP_CDMEXCEPTIONCODE_QUOTAEXCEEDEDERROR\""; + case 5: + return "\"PP_CDMEXCEPTIONCODE_UNKNOWNERROR\""; + case 6: + return "\"PP_CDMEXCEPTIONCODE_CLIENTERROR\""; + case 7: + return "\"PP_CDMEXCEPTIONCODE_OUTPUTERROR\""; + default: + return "\"???\""; + } +} +const string ToString_PP_CdmExceptionCode(const PP_CdmExceptionCode &v) { + return ToString_PP_CdmExceptionCode(&v); +} +void FromJSON_PP_CdmExceptionCode(JSONIterator& iterator, PP_CdmExceptionCode &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_CdmExceptionCode(v); +} +const string ToString_PP_CdmMessageType(const PP_CdmMessageType *v) { + switch (*v) { + case 0: + return "\"PP_CDMMESSAGETYPE_LICENSE_REQUEST\""; + case 1: + return "\"PP_CDMMESSAGETYPE_LICENSE_RENEWAL\""; + case 2: + return "\"PP_CDMMESSAGETYPE_LICENSE_RELEASE\""; + default: + return "\"???\""; + } +} +const string ToString_PP_CdmMessageType(const PP_CdmMessageType &v) { + return ToString_PP_CdmMessageType(&v); +} +void FromJSON_PP_CdmMessageType(JSONIterator& iterator, PP_CdmMessageType &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_CdmMessageType(v); +} +const string ToString_PP_CdmKeyStatus(const PP_CdmKeyStatus *v) { + switch (*v) { + case 0: + return "\"PP_CDMKEYSTATUS_USABLE\""; + case 1: + return "\"PP_CDMKEYSTATUS_INVALID\""; + case 2: + return "\"PP_CDMKEYSTATUS_EXPIRED\""; + case 3: + return "\"PP_CDMKEYSTATUS_OUTPUTRESTRICTED\""; + case 4: + return "\"PP_CDMKEYSTATUS_OUTPUTDOWNSCALED\""; + case 5: + return "\"PP_CDMKEYSTATUS_STATUSPENDING\""; + case 6: + return "\"PP_CDMKEYSTATUS_RELEASED\""; + default: + return "\"???\""; + } +} +const string ToString_PP_CdmKeyStatus(const PP_CdmKeyStatus &v) { + return ToString_PP_CdmKeyStatus(&v); +} +void FromJSON_PP_CdmKeyStatus(JSONIterator& iterator, PP_CdmKeyStatus &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_CdmKeyStatus(v); +} +const string ToString_PP_KeyInformation(const PP_KeyInformation *v) { + if (!v) { + return "null"; + } + return ToString_PP_KeyInformation(*v); +} +const string ToString_PP_KeyInformation(const PP_KeyInformation &v) { + stringstream x; + BeginProps(x); + { + BeginProp(x, "key_id"); + BeginElements(x); + for (uint32_t _n = 0; _n < 512; ++_n) { + AddElement(x, ToString_uint8_t(v.key_id[_n])); + } + EndElements(x); + } + AddProp(x, "key_id_size", ToString_uint32_t(v.key_id_size)); + AddProp(x, "key_status", ToString_PP_CdmKeyStatus(v.key_status)); + AddProp(x, "system_code", ToString_uint32_t(v.system_code)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_KeyInformation(JSONIterator& iterator, PP_KeyInformation &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > 512) { + Fail("Too many items in array\n", ""); + } + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_uint8_t(iterator, (value.key_id)[_n]); + } + // FIXME Null out remaining items? + } + iterator.skip(); + FromJSON_uint32_t(iterator, value.key_id_size); + iterator.skip(); + FromJSON_PP_CdmKeyStatus(iterator, value.key_status); + iterator.skip(); + FromJSON_uint32_t(iterator, value.system_code); +} +const string ToString_PP_PrivateFontCharset(const PP_PrivateFontCharset *v) { + switch (*v) { + case 0: + return "\"PP_PRIVATEFONTCHARSET_ANSI\""; + case 1: + return "\"PP_PRIVATEFONTCHARSET_DEFAULT\""; + case 2: + return "\"PP_PRIVATEFONTCHARSET_SYMBOL\""; + case 77: + return "\"PP_PRIVATEFONTCHARSET_MAC\""; + case 128: + return "\"PP_PRIVATEFONTCHARSET_SHIFTJIS\""; + case 129: + return "\"PP_PRIVATEFONTCHARSET_HANGUL\""; + case 130: + return "\"PP_PRIVATEFONTCHARSET_JOHAB\""; + case 134: + return "\"PP_PRIVATEFONTCHARSET_GB2312\""; + case 136: + return "\"PP_PRIVATEFONTCHARSET_CHINESEBIG5\""; + case 161: + return "\"PP_PRIVATEFONTCHARSET_GREEK\""; + case 162: + return "\"PP_PRIVATEFONTCHARSET_TURKISH\""; + case 163: + return "\"PP_PRIVATEFONTCHARSET_VIETNAMESE\""; + case 177: + return "\"PP_PRIVATEFONTCHARSET_HEBREW\""; + case 178: + return "\"PP_PRIVATEFONTCHARSET_ARABIC\""; + case 186: + return "\"PP_PRIVATEFONTCHARSET_BALTIC\""; + case 204: + return "\"PP_PRIVATEFONTCHARSET_RUSSIAN\""; + case 222: + return "\"PP_PRIVATEFONTCHARSET_THAI\""; + case 238: + return "\"PP_PRIVATEFONTCHARSET_EASTEUROPE\""; + case 255: + return "\"PP_PRIVATEFONTCHARSET_OEM\""; + default: + return "\"???\""; + } +} +const string ToString_PP_PrivateFontCharset(const PP_PrivateFontCharset &v) { + return ToString_PP_PrivateFontCharset(&v); +} +void FromJSON_PP_PrivateFontCharset(JSONIterator& iterator, PP_PrivateFontCharset &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_PrivateFontCharset(v); +} +const string ToString_PP_VideoCaptureFormat(const PP_VideoCaptureFormat *v) { + if (!v) { + return "null"; + } + return ToString_PP_VideoCaptureFormat(*v); +} +const string ToString_PP_VideoCaptureFormat(const PP_VideoCaptureFormat &v) { + stringstream x; + BeginProps(x); + AddProp(x, "frame_size", ToString_PP_Size(v.frame_size)); + AddProp(x, "frame_rate", ToString_float_t(v.frame_rate)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_VideoCaptureFormat(JSONIterator& iterator, PP_VideoCaptureFormat &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_PP_Size(iterator, value.frame_size); + iterator.skip(); + FromJSON_float_t(iterator, value.frame_rate); +} +const string ToString_PP_VideoFrame_Private(const PP_VideoFrame_Private *v) { + if (!v) { + return "null"; + } + return ToString_PP_VideoFrame_Private(*v); +} +const string ToString_PP_VideoFrame_Private(const PP_VideoFrame_Private &v) { + stringstream x; + BeginProps(x); + AddProp(x, "timestamp", ToString_PP_TimeTicks(v.timestamp)); + AddProp(x, "image_data", ToString_PP_Resource(v.image_data)); + AddProp(x, "padding", ToString_int32_t(v.padding)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_VideoFrame_Private(JSONIterator& iterator, PP_VideoFrame_Private &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_PP_TimeTicks(iterator, value.timestamp); + iterator.skip(); + FromJSON_PP_Resource(iterator, value.image_data); + iterator.skip(); + FromJSON_int32_t(iterator, value.padding); +} +namespace ns_PPB_CameraCapabilities_Private_0_1 { +static PP_Bool IsCameraCapabilities_0_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CameraCapabilities_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"IsCameraCapabilities\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_CameraCapabilities_Private_0_1*)RealGetInterface("PPB_CameraCapabilities_Private;0.1"))->IsCameraCapabilities(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void GetSupportedVideoCaptureFormats_0_1(PP_Resource capabilities, uint32_t* array_size, struct PP_VideoCaptureFormat** formats) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CameraCapabilities_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetSupportedVideoCaptureFormats\""); + AddProp(ss, "capabilities", ToString_PP_Resource(capabilities)); + AddProp(ss, "array_size", PointerToString(array_size)); + AddProp(ss, "formats", PointerToString(formats)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_uint32_t(iterator, *array_size); + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > *array_size) { + Fail("Too many items in array\n", ""); + } + *formats = new struct PP_VideoCaptureFormat[*array_size]; + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_PP_VideoCaptureFormat(iterator, (*formats)[_n]); + } + // FIXME Null out remaining items? + } +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_CameraCapabilities_Private_0_1*)RealGetInterface("PPB_CameraCapabilities_Private;0.1"))->GetSupportedVideoCaptureFormats(capabilities, array_size, formats); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + if (!!array_size) { + AddProp(os, "array_size", ToString_uint32_t(array_size)); + } + { + BeginProp(os, "formats"); + BeginElements(os); + for (uint32_t _n = 0; _n < *array_size; ++_n) { + AddElement(os, ToString_PP_VideoCaptureFormat(formats[_n])); + } + EndElements(os); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +} +static PPB_CameraCapabilities_Private_0_1 _PPB_CameraCapabilities_Private_0_1 = { + ns_PPB_CameraCapabilities_Private_0_1::IsCameraCapabilities_0_1, + ns_PPB_CameraCapabilities_Private_0_1::GetSupportedVideoCaptureFormats_0_1, +}; +const string ToString_PPB_CameraCapabilities_Private(const PPB_CameraCapabilities_Private_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_CameraDevice_Private_0_1 { +static PP_Resource Create_0_1(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CameraDevice_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_CameraDevice_Private_0_1*)RealGetInterface("PPB_CameraDevice_Private;0.1"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsCameraDevice_0_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CameraDevice_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"IsCameraDevice\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_CameraDevice_Private_0_1*)RealGetInterface("PPB_CameraDevice_Private;0.1"))->IsCameraDevice(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Open_0_1(PP_Resource camera_device, struct PP_Var device_id, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CameraDevice_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Open\""); + AddProp(ss, "camera_device", ToString_PP_Resource(camera_device)); + AddProp(ss, "device_id", ToString_PP_Var(device_id)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_CameraDevice_Private_0_1*)RealGetInterface("PPB_CameraDevice_Private;0.1"))->Open(camera_device, device_id, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void Close_0_1(PP_Resource camera_device) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CameraDevice_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Close\""); + AddProp(ss, "camera_device", ToString_PP_Resource(camera_device)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_CameraDevice_Private_0_1*)RealGetInterface("PPB_CameraDevice_Private;0.1"))->Close(camera_device); +#endif // !INTERPOSE +} +static int32_t GetCameraCapabilities_0_1(PP_Resource camera_device, PP_Resource* capabilities, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_CameraDevice_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetCameraCapabilities\""); + AddProp(ss, "camera_device", ToString_PP_Resource(camera_device)); + AddProp(ss, "capabilities", PointerToString(capabilities)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Resource(iterator, *capabilities); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_CameraDevice_Private_0_1*)RealGetInterface("PPB_CameraDevice_Private;0.1"))->GetCameraCapabilities(camera_device, capabilities, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!capabilities) { + AddProp(os, "capabilities", ToString_PP_Resource(capabilities)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_CameraDevice_Private_0_1 _PPB_CameraDevice_Private_0_1 = { + ns_PPB_CameraDevice_Private_0_1::Create_0_1, + ns_PPB_CameraDevice_Private_0_1::IsCameraDevice_0_1, + ns_PPB_CameraDevice_Private_0_1::Open_0_1, + ns_PPB_CameraDevice_Private_0_1::Close_0_1, + ns_PPB_CameraDevice_Private_0_1::GetCameraCapabilities_0_1, +}; +const string ToString_PPB_CameraDevice_Private(const PPB_CameraDevice_Private_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_ContentDecryptor_Private_0_14 { +static void PromiseResolved_0_14(PP_Instance instance, uint32_t promise_id) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_ContentDecryptor_Private\""); + AddProp(ss, "__version", "\"0.14\""); + AddProp(ss, "__method", "\"PromiseResolved\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "promise_id", ToString_uint32_t(promise_id)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_ContentDecryptor_Private_0_14*)RealGetInterface("PPB_ContentDecryptor_Private;0.14"))->PromiseResolved(instance, promise_id); +#endif // !INTERPOSE +} +static void PromiseResolvedWithSession_0_14(PP_Instance instance, uint32_t promise_id, struct PP_Var session_id) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_ContentDecryptor_Private\""); + AddProp(ss, "__version", "\"0.14\""); + AddProp(ss, "__method", "\"PromiseResolvedWithSession\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "promise_id", ToString_uint32_t(promise_id)); + AddProp(ss, "session_id", ToString_PP_Var(session_id)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_ContentDecryptor_Private_0_14*)RealGetInterface("PPB_ContentDecryptor_Private;0.14"))->PromiseResolvedWithSession(instance, promise_id, session_id); +#endif // !INTERPOSE +} +static void PromiseRejected_0_14(PP_Instance instance, uint32_t promise_id, PP_CdmExceptionCode exception_code, uint32_t system_code, struct PP_Var error_description) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_ContentDecryptor_Private\""); + AddProp(ss, "__version", "\"0.14\""); + AddProp(ss, "__method", "\"PromiseRejected\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "promise_id", ToString_uint32_t(promise_id)); + AddProp(ss, "exception_code", ToString_PP_CdmExceptionCode(exception_code)); + AddProp(ss, "system_code", ToString_uint32_t(system_code)); + AddProp(ss, "error_description", ToString_PP_Var(error_description)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_ContentDecryptor_Private_0_14*)RealGetInterface("PPB_ContentDecryptor_Private;0.14"))->PromiseRejected(instance, promise_id, exception_code, system_code, error_description); +#endif // !INTERPOSE +} +static void SessionMessage_0_14(PP_Instance instance, struct PP_Var session_id, PP_CdmMessageType message_type, struct PP_Var message, struct PP_Var legacy_destination_url) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_ContentDecryptor_Private\""); + AddProp(ss, "__version", "\"0.14\""); + AddProp(ss, "__method", "\"SessionMessage\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "session_id", ToString_PP_Var(session_id)); + AddProp(ss, "message_type", ToString_PP_CdmMessageType(message_type)); + AddProp(ss, "message", ToString_PP_Var(message)); + AddProp(ss, "legacy_destination_url", ToString_PP_Var(legacy_destination_url)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_ContentDecryptor_Private_0_14*)RealGetInterface("PPB_ContentDecryptor_Private;0.14"))->SessionMessage(instance, session_id, message_type, message, legacy_destination_url); +#endif // !INTERPOSE +} +static void SessionKeysChange_0_14(PP_Instance instance, struct PP_Var session_id, PP_Bool has_additional_usable_key, uint32_t key_count, const struct PP_KeyInformation key_information[]) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_ContentDecryptor_Private\""); + AddProp(ss, "__version", "\"0.14\""); + AddProp(ss, "__method", "\"SessionKeysChange\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "session_id", ToString_PP_Var(session_id)); + AddProp(ss, "has_additional_usable_key", ToString_PP_Bool(has_additional_usable_key)); + AddProp(ss, "key_count", ToString_uint32_t(key_count)); + { + BeginProp(ss, "key_information"); + BeginElements(ss); + for (uint32_t _n = 0; _n < key_count; ++_n) { + AddElement(ss, ToString_PP_KeyInformation(key_information[_n])); + } + EndElements(ss); + } + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_ContentDecryptor_Private_0_14*)RealGetInterface("PPB_ContentDecryptor_Private;0.14"))->SessionKeysChange(instance, session_id, has_additional_usable_key, key_count, key_information); +#endif // !INTERPOSE +} +static void SessionExpirationChange_0_14(PP_Instance instance, struct PP_Var session_id, PP_Time new_expiry_time) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_ContentDecryptor_Private\""); + AddProp(ss, "__version", "\"0.14\""); + AddProp(ss, "__method", "\"SessionExpirationChange\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "session_id", ToString_PP_Var(session_id)); + AddProp(ss, "new_expiry_time", ToString_PP_Time(new_expiry_time)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_ContentDecryptor_Private_0_14*)RealGetInterface("PPB_ContentDecryptor_Private;0.14"))->SessionExpirationChange(instance, session_id, new_expiry_time); +#endif // !INTERPOSE +} +static void SessionClosed_0_14(PP_Instance instance, struct PP_Var session_id) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_ContentDecryptor_Private\""); + AddProp(ss, "__version", "\"0.14\""); + AddProp(ss, "__method", "\"SessionClosed\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "session_id", ToString_PP_Var(session_id)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_ContentDecryptor_Private_0_14*)RealGetInterface("PPB_ContentDecryptor_Private;0.14"))->SessionClosed(instance, session_id); +#endif // !INTERPOSE +} +static void LegacySessionError_0_14(PP_Instance instance, struct PP_Var session_id, PP_CdmExceptionCode exception_code, uint32_t system_code, struct PP_Var error_description) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_ContentDecryptor_Private\""); + AddProp(ss, "__version", "\"0.14\""); + AddProp(ss, "__method", "\"LegacySessionError\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "session_id", ToString_PP_Var(session_id)); + AddProp(ss, "exception_code", ToString_PP_CdmExceptionCode(exception_code)); + AddProp(ss, "system_code", ToString_uint32_t(system_code)); + AddProp(ss, "error_description", ToString_PP_Var(error_description)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_ContentDecryptor_Private_0_14*)RealGetInterface("PPB_ContentDecryptor_Private;0.14"))->LegacySessionError(instance, session_id, exception_code, system_code, error_description); +#endif // !INTERPOSE +} +static void DeliverBlock_0_14(PP_Instance instance, PP_Resource decrypted_block, const struct PP_DecryptedBlockInfo* decrypted_block_info) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_ContentDecryptor_Private\""); + AddProp(ss, "__version", "\"0.14\""); + AddProp(ss, "__method", "\"DeliverBlock\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "decrypted_block", ToString_PP_Resource(decrypted_block)); + AddProp(ss, "decrypted_block_info", ToString_PP_DecryptedBlockInfo(decrypted_block_info)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_ContentDecryptor_Private_0_14*)RealGetInterface("PPB_ContentDecryptor_Private;0.14"))->DeliverBlock(instance, decrypted_block, decrypted_block_info); +#endif // !INTERPOSE +} +static void DecoderInitializeDone_0_14(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id, PP_Bool success) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_ContentDecryptor_Private\""); + AddProp(ss, "__version", "\"0.14\""); + AddProp(ss, "__method", "\"DecoderInitializeDone\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "decoder_type", ToString_PP_DecryptorStreamType(decoder_type)); + AddProp(ss, "request_id", ToString_uint32_t(request_id)); + AddProp(ss, "success", ToString_PP_Bool(success)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_ContentDecryptor_Private_0_14*)RealGetInterface("PPB_ContentDecryptor_Private;0.14"))->DecoderInitializeDone(instance, decoder_type, request_id, success); +#endif // !INTERPOSE +} +static void DecoderDeinitializeDone_0_14(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_ContentDecryptor_Private\""); + AddProp(ss, "__version", "\"0.14\""); + AddProp(ss, "__method", "\"DecoderDeinitializeDone\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "decoder_type", ToString_PP_DecryptorStreamType(decoder_type)); + AddProp(ss, "request_id", ToString_uint32_t(request_id)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_ContentDecryptor_Private_0_14*)RealGetInterface("PPB_ContentDecryptor_Private;0.14"))->DecoderDeinitializeDone(instance, decoder_type, request_id); +#endif // !INTERPOSE +} +static void DecoderResetDone_0_14(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_ContentDecryptor_Private\""); + AddProp(ss, "__version", "\"0.14\""); + AddProp(ss, "__method", "\"DecoderResetDone\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "decoder_type", ToString_PP_DecryptorStreamType(decoder_type)); + AddProp(ss, "request_id", ToString_uint32_t(request_id)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_ContentDecryptor_Private_0_14*)RealGetInterface("PPB_ContentDecryptor_Private;0.14"))->DecoderResetDone(instance, decoder_type, request_id); +#endif // !INTERPOSE +} +static void DeliverFrame_0_14(PP_Instance instance, PP_Resource decrypted_frame, const struct PP_DecryptedFrameInfo* decrypted_frame_info) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_ContentDecryptor_Private\""); + AddProp(ss, "__version", "\"0.14\""); + AddProp(ss, "__method", "\"DeliverFrame\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "decrypted_frame", ToString_PP_Resource(decrypted_frame)); + AddProp(ss, "decrypted_frame_info", ToString_PP_DecryptedFrameInfo(decrypted_frame_info)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_ContentDecryptor_Private_0_14*)RealGetInterface("PPB_ContentDecryptor_Private;0.14"))->DeliverFrame(instance, decrypted_frame, decrypted_frame_info); +#endif // !INTERPOSE +} +static void DeliverSamples_0_14(PP_Instance instance, PP_Resource audio_frames, const struct PP_DecryptedSampleInfo* decrypted_sample_info) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_ContentDecryptor_Private\""); + AddProp(ss, "__version", "\"0.14\""); + AddProp(ss, "__method", "\"DeliverSamples\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "audio_frames", ToString_PP_Resource(audio_frames)); + AddProp(ss, "decrypted_sample_info", ToString_PP_DecryptedSampleInfo(decrypted_sample_info)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_ContentDecryptor_Private_0_14*)RealGetInterface("PPB_ContentDecryptor_Private;0.14"))->DeliverSamples(instance, audio_frames, decrypted_sample_info); +#endif // !INTERPOSE +} +} +static PPB_ContentDecryptor_Private_0_14 _PPB_ContentDecryptor_Private_0_14 = { + ns_PPB_ContentDecryptor_Private_0_14::PromiseResolved_0_14, + ns_PPB_ContentDecryptor_Private_0_14::PromiseResolvedWithSession_0_14, + ns_PPB_ContentDecryptor_Private_0_14::PromiseRejected_0_14, + ns_PPB_ContentDecryptor_Private_0_14::SessionMessage_0_14, + ns_PPB_ContentDecryptor_Private_0_14::SessionKeysChange_0_14, + ns_PPB_ContentDecryptor_Private_0_14::SessionExpirationChange_0_14, + ns_PPB_ContentDecryptor_Private_0_14::SessionClosed_0_14, + ns_PPB_ContentDecryptor_Private_0_14::LegacySessionError_0_14, + ns_PPB_ContentDecryptor_Private_0_14::DeliverBlock_0_14, + ns_PPB_ContentDecryptor_Private_0_14::DecoderInitializeDone_0_14, + ns_PPB_ContentDecryptor_Private_0_14::DecoderDeinitializeDone_0_14, + ns_PPB_ContentDecryptor_Private_0_14::DecoderResetDone_0_14, + ns_PPB_ContentDecryptor_Private_0_14::DeliverFrame_0_14, + ns_PPB_ContentDecryptor_Private_0_14::DeliverSamples_0_14, +}; +const string ToString_PPB_ContentDecryptor_Private(const PPB_ContentDecryptor_Private_0_14 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_DisplayColorProfile_Private_0_1 { +static PP_Resource Create_0_1(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_DisplayColorProfile_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_DisplayColorProfile_Private_0_1*)RealGetInterface("PPB_DisplayColorProfile_Private;0.1"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsDisplayColorProfile_0_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_DisplayColorProfile_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"IsDisplayColorProfile\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_DisplayColorProfile_Private_0_1*)RealGetInterface("PPB_DisplayColorProfile_Private;0.1"))->IsDisplayColorProfile(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetColorProfile_0_1(PP_Resource display_color_profile_res, struct PP_ArrayOutput color_profile, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_DisplayColorProfile_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetColorProfile\""); + AddProp(ss, "display_color_profile_res", ToString_PP_Resource(display_color_profile_res)); + AddProp(ss, "color_profile", ToString_PP_ArrayOutput(color_profile)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_DisplayColorProfile_Private_0_1*)RealGetInterface("PPB_DisplayColorProfile_Private;0.1"))->GetColorProfile(display_color_profile_res, color_profile, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t RegisterColorProfileChangeCallback_0_1(PP_Resource display_color_profile_res, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_DisplayColorProfile_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"RegisterColorProfileChangeCallback\""); + AddProp(ss, "display_color_profile_res", ToString_PP_Resource(display_color_profile_res)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_DisplayColorProfile_Private_0_1*)RealGetInterface("PPB_DisplayColorProfile_Private;0.1"))->RegisterColorProfileChangeCallback(display_color_profile_res, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_DisplayColorProfile_Private_0_1 _PPB_DisplayColorProfile_Private_0_1 = { + ns_PPB_DisplayColorProfile_Private_0_1::Create_0_1, + ns_PPB_DisplayColorProfile_Private_0_1::IsDisplayColorProfile_0_1, + ns_PPB_DisplayColorProfile_Private_0_1::GetColorProfile_0_1, + ns_PPB_DisplayColorProfile_Private_0_1::RegisterColorProfileChangeCallback_0_1, +}; +const string ToString_PPB_DisplayColorProfile_Private(const PPB_DisplayColorProfile_Private_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Ext_CrxFileSystem_Private_0_1 { +static int32_t Open_0_1(PP_Instance instance, PP_Resource* file_system, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Ext_CrxFileSystem_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Open\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "file_system", PointerToString(file_system)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Resource(iterator, *file_system); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_Ext_CrxFileSystem_Private_0_1*)RealGetInterface("PPB_Ext_CrxFileSystem_Private;0.1"))->Open(instance, file_system, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!file_system) { + AddProp(os, "file_system", ToString_PP_Resource(file_system)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_Ext_CrxFileSystem_Private_0_1 _PPB_Ext_CrxFileSystem_Private_0_1 = { + ns_PPB_Ext_CrxFileSystem_Private_0_1::Open_0_1, +}; +const string ToString_PPB_Ext_CrxFileSystem_Private(const PPB_Ext_CrxFileSystem_Private_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_FileIO_Private_0_1 { +static int32_t RequestOSFileHandle_0_1(PP_Resource file_io, PP_FileHandle* handle, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileIO_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"RequestOSFileHandle\""); + AddProp(ss, "file_io", ToString_PP_Resource(file_io)); + AddProp(ss, "handle", PointerToString(handle)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_FileHandle(iterator, *handle); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_FileIO_Private_0_1*)RealGetInterface("PPB_FileIO_Private;0.1"))->RequestOSFileHandle(file_io, handle, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!handle) { + AddProp(os, "handle", ToString_PP_FileHandle(handle)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_FileIO_Private_0_1 _PPB_FileIO_Private_0_1 = { + ns_PPB_FileIO_Private_0_1::RequestOSFileHandle_0_1, +}; +const string ToString_PPB_FileIO_Private(const PPB_FileIO_Private_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_FileRefPrivate_0_1 { +static struct PP_Var GetAbsolutePath_0_1(PP_Resource file_ref) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FileRefPrivate\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetAbsolutePath\""); + AddProp(ss, "file_ref", ToString_PP_Resource(file_ref)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_FileRefPrivate_0_1*)RealGetInterface("PPB_FileRefPrivate;0.1"))->GetAbsolutePath(file_ref); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_FileRefPrivate_0_1 _PPB_FileRefPrivate_0_1 = { + ns_PPB_FileRefPrivate_0_1::GetAbsolutePath_0_1, +}; +const string ToString_PPB_FileRefPrivate(const PPB_FileRefPrivate_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Find_Private_0_3 { +static void SetPluginToHandleFindRequests_0_3(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Find_Private\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"SetPluginToHandleFindRequests\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Find_Private_0_3*)RealGetInterface("PPB_Find_Private;0.3"))->SetPluginToHandleFindRequests(instance); +#endif // !INTERPOSE +} +static void NumberOfFindResultsChanged_0_3(PP_Instance instance, int32_t total, PP_Bool final_result) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Find_Private\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"NumberOfFindResultsChanged\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "total", ToString_int32_t(total)); + AddProp(ss, "final_result", ToString_PP_Bool(final_result)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Find_Private_0_3*)RealGetInterface("PPB_Find_Private;0.3"))->NumberOfFindResultsChanged(instance, total, final_result); +#endif // !INTERPOSE +} +static void SelectedFindResultChanged_0_3(PP_Instance instance, int32_t index) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Find_Private\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"SelectedFindResultChanged\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "index", ToString_int32_t(index)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Find_Private_0_3*)RealGetInterface("PPB_Find_Private;0.3"))->SelectedFindResultChanged(instance, index); +#endif // !INTERPOSE +} +static void SetTickmarks_0_3(PP_Instance instance, const struct PP_Rect tickmarks[], uint32_t count) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Find_Private\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"SetTickmarks\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + { + BeginProp(ss, "tickmarks"); + BeginElements(ss); + for (uint32_t _n = 0; _n < count; ++_n) { + AddElement(ss, ToString_PP_Rect(tickmarks[_n])); + } + EndElements(ss); + } + AddProp(ss, "count", ToString_uint32_t(count)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Find_Private_0_3*)RealGetInterface("PPB_Find_Private;0.3"))->SetTickmarks(instance, tickmarks, count); +#endif // !INTERPOSE +} +} +static PPB_Find_Private_0_3 _PPB_Find_Private_0_3 = { + ns_PPB_Find_Private_0_3::SetPluginToHandleFindRequests_0_3, + ns_PPB_Find_Private_0_3::NumberOfFindResultsChanged_0_3, + ns_PPB_Find_Private_0_3::SelectedFindResultChanged_0_3, + ns_PPB_Find_Private_0_3::SetTickmarks_0_3, +}; +const string ToString_PPB_Find_Private(const PPB_Find_Private_0_3 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_FlashLSORestrictions(const PP_FlashLSORestrictions *v) { + switch (*v) { + case 1: + return "\"PP_FLASHLSORESTRICTIONS_NONE\""; + case 2: + return "\"PP_FLASHLSORESTRICTIONS_BLOCK\""; + case 3: + return "\"PP_FLASHLSORESTRICTIONS_IN_MEMORY\""; + default: + return "\"???\""; + } +} +const string ToString_PP_FlashLSORestrictions(const PP_FlashLSORestrictions &v) { + return ToString_PP_FlashLSORestrictions(&v); +} +void FromJSON_PP_FlashLSORestrictions(JSONIterator& iterator, PP_FlashLSORestrictions &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_FlashLSORestrictions(v); +} +const string ToString_PP_FlashSetting(const PP_FlashSetting *v) { + switch (*v) { + case 1: + return "\"PP_FLASHSETTING_3DENABLED\""; + case 2: + return "\"PP_FLASHSETTING_INCOGNITO\""; + case 3: + return "\"PP_FLASHSETTING_STAGE3DENABLED\""; + case 4: + return "\"PP_FLASHSETTING_LANGUAGE\""; + case 5: + return "\"PP_FLASHSETTING_NUMCORES\""; + case 6: + return "\"PP_FLASHSETTING_LSORESTRICTIONS\""; + case 7: + return "\"PP_FLASHSETTING_STAGE3DBASELINEENABLED\""; + default: + return "\"???\""; + } +} +const string ToString_PP_FlashSetting(const PP_FlashSetting &v) { + return ToString_PP_FlashSetting(&v); +} +void FromJSON_PP_FlashSetting(JSONIterator& iterator, PP_FlashSetting &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_FlashSetting(v); +} +const string ToString_PP_FlashCrashKey(const PP_FlashCrashKey *v) { + switch (*v) { + case 1: + return "\"PP_FLASHCRASHKEY_URL\""; + case 2: + return "\"PP_FLASHCRASHKEY_RESOURCE_URL\""; + default: + return "\"???\""; + } +} +const string ToString_PP_FlashCrashKey(const PP_FlashCrashKey &v) { + return ToString_PP_FlashCrashKey(&v); +} +void FromJSON_PP_FlashCrashKey(JSONIterator& iterator, PP_FlashCrashKey &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_FlashCrashKey(v); +} +namespace ns_PPB_Flash_12_4 { +static void SetInstanceAlwaysOnTop_12_4(PP_Instance instance, PP_Bool on_top) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.4\""); + AddProp(ss, "__method", "\"SetInstanceAlwaysOnTop\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "on_top", ToString_PP_Bool(on_top)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Flash_12_4*)RealGetInterface("PPB_Flash;12.4"))->SetInstanceAlwaysOnTop(instance, on_top); +#endif // !INTERPOSE +} +static PP_Bool DrawGlyphs_12_4(PP_Instance instance, PP_Resource pp_image_data, const struct PP_BrowserFont_Trusted_Description* font_desc, uint32_t color, const struct PP_Point* position, const struct PP_Rect* clip, const float transformation[3][3], PP_Bool allow_subpixel_aa, uint32_t glyph_count, const uint16_t glyph_indices[], const struct PP_Point glyph_advances[]) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.4\""); + AddProp(ss, "__method", "\"DrawGlyphs\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "pp_image_data", ToString_PP_Resource(pp_image_data)); + AddProp(ss, "font_desc", ToString_PP_BrowserFont_Trusted_Description(font_desc)); + AddProp(ss, "color", ToString_uint32_t(color)); + AddProp(ss, "position", ToString_PP_Point(position)); + AddProp(ss, "clip", ToString_PP_Rect(clip)); + { + BeginProp(ss, "transformation"); + BeginElements(ss); + for (uint32_t _n = 0; _n < 3; ++_n) { + AddElement(ss, ToString_float_t(transformation[_n])); + } + EndElements(ss); + } + AddProp(ss, "allow_subpixel_aa", ToString_PP_Bool(allow_subpixel_aa)); + AddProp(ss, "glyph_count", ToString_uint32_t(glyph_count)); + { + BeginProp(ss, "glyph_indices"); + BeginElements(ss); + for (uint32_t _n = 0; _n < glyph_count; ++_n) { + AddElement(ss, ToString_uint16_t(glyph_indices[_n])); + } + EndElements(ss); + } + { + BeginProp(ss, "glyph_advances"); + BeginElements(ss); + for (uint32_t _n = 0; _n < glyph_count; ++_n) { + AddElement(ss, ToString_PP_Point(glyph_advances[_n])); + } + EndElements(ss); + } + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Flash_12_4*)RealGetInterface("PPB_Flash;12.4"))->DrawGlyphs(instance, pp_image_data, font_desc, color, position, clip, transformation, allow_subpixel_aa, glyph_count, glyph_indices, glyph_advances); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetProxyForURL_12_4(PP_Instance instance, const char* url) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.4\""); + AddProp(ss, "__method", "\"GetProxyForURL\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "url", ToString_str_t(url)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Flash_12_4*)RealGetInterface("PPB_Flash;12.4"))->GetProxyForURL(instance, url); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Navigate_12_4(PP_Resource request_info, const char* target, PP_Bool from_user_action) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.4\""); + AddProp(ss, "__method", "\"Navigate\""); + AddProp(ss, "request_info", ToString_PP_Resource(request_info)); + AddProp(ss, "target", ToString_str_t(target)); + AddProp(ss, "from_user_action", ToString_PP_Bool(from_user_action)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_12_4*)RealGetInterface("PPB_Flash;12.4"))->Navigate(request_info, target, from_user_action); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void RunMessageLoop_12_4(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.4\""); + AddProp(ss, "__method", "\"RunMessageLoop\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Flash_12_4*)RealGetInterface("PPB_Flash;12.4"))->RunMessageLoop(instance); +#endif // !INTERPOSE +} +static void QuitMessageLoop_12_4(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.4\""); + AddProp(ss, "__method", "\"QuitMessageLoop\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Flash_12_4*)RealGetInterface("PPB_Flash;12.4"))->QuitMessageLoop(instance); +#endif // !INTERPOSE +} +static double GetLocalTimeZoneOffset_12_4(PP_Instance instance, PP_Time t) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.4\""); + AddProp(ss, "__method", "\"GetLocalTimeZoneOffset\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "t", ToString_PP_Time(t)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + double rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_double_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + double rval = ((PPB_Flash_12_4*)RealGetInterface("PPB_Flash;12.4"))->GetLocalTimeZoneOffset(instance, t); + printf("RPC response: ["); + printf("%s", ToString_double_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetCommandLineArgs_12_4(PP_Module module) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.4\""); + AddProp(ss, "__method", "\"GetCommandLineArgs\""); + AddProp(ss, "module", ToString_PP_Module(module)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Flash_12_4*)RealGetInterface("PPB_Flash;12.4"))->GetCommandLineArgs(module); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void PreloadFontWin_12_4(const void* logfontw) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.4\""); + AddProp(ss, "__method", "\"PreloadFontWin\""); + AddProp(ss, "logfontw", ToString_mem_t(logfontw)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Flash_12_4*)RealGetInterface("PPB_Flash;12.4"))->PreloadFontWin(logfontw); +#endif // !INTERPOSE +} +static PP_Bool IsRectTopmost_12_4(PP_Instance instance, const struct PP_Rect* rect) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.4\""); + AddProp(ss, "__method", "\"IsRectTopmost\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "rect", ToString_PP_Rect(rect)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Flash_12_4*)RealGetInterface("PPB_Flash;12.4"))->IsRectTopmost(instance, rect); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t InvokePrinting_12_4(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.4\""); + AddProp(ss, "__method", "\"InvokePrinting\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_12_4*)RealGetInterface("PPB_Flash;12.4"))->InvokePrinting(instance); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void UpdateActivity_12_4(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.4\""); + AddProp(ss, "__method", "\"UpdateActivity\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Flash_12_4*)RealGetInterface("PPB_Flash;12.4"))->UpdateActivity(instance); +#endif // !INTERPOSE +} +static struct PP_Var GetDeviceID_12_4(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.4\""); + AddProp(ss, "__method", "\"GetDeviceID\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Flash_12_4*)RealGetInterface("PPB_Flash;12.4"))->GetDeviceID(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetSettingInt_12_4(PP_Instance instance, PP_FlashSetting setting) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.4\""); + AddProp(ss, "__method", "\"GetSettingInt\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "setting", ToString_PP_FlashSetting(setting)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_12_4*)RealGetInterface("PPB_Flash;12.4"))->GetSettingInt(instance, setting); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetSetting_12_4(PP_Instance instance, PP_FlashSetting setting) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.4\""); + AddProp(ss, "__method", "\"GetSetting\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "setting", ToString_PP_FlashSetting(setting)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Flash_12_4*)RealGetInterface("PPB_Flash;12.4"))->GetSetting(instance, setting); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping SetCrashData */ +/* skipping EnumerateVideoCaptureDevices */ +} +static PPB_Flash_12_4 _PPB_Flash_12_4 = { + ns_PPB_Flash_12_4::SetInstanceAlwaysOnTop_12_4, + ns_PPB_Flash_12_4::DrawGlyphs_12_4, + ns_PPB_Flash_12_4::GetProxyForURL_12_4, + ns_PPB_Flash_12_4::Navigate_12_4, + ns_PPB_Flash_12_4::RunMessageLoop_12_4, + ns_PPB_Flash_12_4::QuitMessageLoop_12_4, + ns_PPB_Flash_12_4::GetLocalTimeZoneOffset_12_4, + ns_PPB_Flash_12_4::GetCommandLineArgs_12_4, + ns_PPB_Flash_12_4::PreloadFontWin_12_4, + ns_PPB_Flash_12_4::IsRectTopmost_12_4, + ns_PPB_Flash_12_4::InvokePrinting_12_4, + ns_PPB_Flash_12_4::UpdateActivity_12_4, + ns_PPB_Flash_12_4::GetDeviceID_12_4, + ns_PPB_Flash_12_4::GetSettingInt_12_4, + ns_PPB_Flash_12_4::GetSetting_12_4, +}; +const string ToString_PPB_Flash(const PPB_Flash_12_4 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Flash_12_5 { +static void SetInstanceAlwaysOnTop_12_5(PP_Instance instance, PP_Bool on_top) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.5\""); + AddProp(ss, "__method", "\"SetInstanceAlwaysOnTop\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "on_top", ToString_PP_Bool(on_top)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Flash_12_5*)RealGetInterface("PPB_Flash;12.5"))->SetInstanceAlwaysOnTop(instance, on_top); +#endif // !INTERPOSE +} +static PP_Bool DrawGlyphs_12_5(PP_Instance instance, PP_Resource pp_image_data, const struct PP_BrowserFont_Trusted_Description* font_desc, uint32_t color, const struct PP_Point* position, const struct PP_Rect* clip, const float transformation[3][3], PP_Bool allow_subpixel_aa, uint32_t glyph_count, const uint16_t glyph_indices[], const struct PP_Point glyph_advances[]) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.5\""); + AddProp(ss, "__method", "\"DrawGlyphs\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "pp_image_data", ToString_PP_Resource(pp_image_data)); + AddProp(ss, "font_desc", ToString_PP_BrowserFont_Trusted_Description(font_desc)); + AddProp(ss, "color", ToString_uint32_t(color)); + AddProp(ss, "position", ToString_PP_Point(position)); + AddProp(ss, "clip", ToString_PP_Rect(clip)); + { + BeginProp(ss, "transformation"); + BeginElements(ss); + for (uint32_t _n = 0; _n < 3; ++_n) { + AddElement(ss, ToString_float_t(transformation[_n])); + } + EndElements(ss); + } + AddProp(ss, "allow_subpixel_aa", ToString_PP_Bool(allow_subpixel_aa)); + AddProp(ss, "glyph_count", ToString_uint32_t(glyph_count)); + { + BeginProp(ss, "glyph_indices"); + BeginElements(ss); + for (uint32_t _n = 0; _n < glyph_count; ++_n) { + AddElement(ss, ToString_uint16_t(glyph_indices[_n])); + } + EndElements(ss); + } + { + BeginProp(ss, "glyph_advances"); + BeginElements(ss); + for (uint32_t _n = 0; _n < glyph_count; ++_n) { + AddElement(ss, ToString_PP_Point(glyph_advances[_n])); + } + EndElements(ss); + } + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Flash_12_5*)RealGetInterface("PPB_Flash;12.5"))->DrawGlyphs(instance, pp_image_data, font_desc, color, position, clip, transformation, allow_subpixel_aa, glyph_count, glyph_indices, glyph_advances); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetProxyForURL_12_5(PP_Instance instance, const char* url) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.5\""); + AddProp(ss, "__method", "\"GetProxyForURL\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "url", ToString_str_t(url)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Flash_12_5*)RealGetInterface("PPB_Flash;12.5"))->GetProxyForURL(instance, url); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Navigate_12_5(PP_Resource request_info, const char* target, PP_Bool from_user_action) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.5\""); + AddProp(ss, "__method", "\"Navigate\""); + AddProp(ss, "request_info", ToString_PP_Resource(request_info)); + AddProp(ss, "target", ToString_str_t(target)); + AddProp(ss, "from_user_action", ToString_PP_Bool(from_user_action)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_12_5*)RealGetInterface("PPB_Flash;12.5"))->Navigate(request_info, target, from_user_action); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void RunMessageLoop_12_5(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.5\""); + AddProp(ss, "__method", "\"RunMessageLoop\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Flash_12_5*)RealGetInterface("PPB_Flash;12.5"))->RunMessageLoop(instance); +#endif // !INTERPOSE +} +static void QuitMessageLoop_12_5(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.5\""); + AddProp(ss, "__method", "\"QuitMessageLoop\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Flash_12_5*)RealGetInterface("PPB_Flash;12.5"))->QuitMessageLoop(instance); +#endif // !INTERPOSE +} +static double GetLocalTimeZoneOffset_12_5(PP_Instance instance, PP_Time t) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.5\""); + AddProp(ss, "__method", "\"GetLocalTimeZoneOffset\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "t", ToString_PP_Time(t)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + double rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_double_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + double rval = ((PPB_Flash_12_5*)RealGetInterface("PPB_Flash;12.5"))->GetLocalTimeZoneOffset(instance, t); + printf("RPC response: ["); + printf("%s", ToString_double_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetCommandLineArgs_12_5(PP_Module module) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.5\""); + AddProp(ss, "__method", "\"GetCommandLineArgs\""); + AddProp(ss, "module", ToString_PP_Module(module)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Flash_12_5*)RealGetInterface("PPB_Flash;12.5"))->GetCommandLineArgs(module); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void PreloadFontWin_12_5(const void* logfontw) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.5\""); + AddProp(ss, "__method", "\"PreloadFontWin\""); + AddProp(ss, "logfontw", ToString_mem_t(logfontw)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Flash_12_5*)RealGetInterface("PPB_Flash;12.5"))->PreloadFontWin(logfontw); +#endif // !INTERPOSE +} +static PP_Bool IsRectTopmost_12_5(PP_Instance instance, const struct PP_Rect* rect) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.5\""); + AddProp(ss, "__method", "\"IsRectTopmost\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "rect", ToString_PP_Rect(rect)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Flash_12_5*)RealGetInterface("PPB_Flash;12.5"))->IsRectTopmost(instance, rect); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t InvokePrinting_12_5(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.5\""); + AddProp(ss, "__method", "\"InvokePrinting\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_12_5*)RealGetInterface("PPB_Flash;12.5"))->InvokePrinting(instance); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void UpdateActivity_12_5(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.5\""); + AddProp(ss, "__method", "\"UpdateActivity\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Flash_12_5*)RealGetInterface("PPB_Flash;12.5"))->UpdateActivity(instance); +#endif // !INTERPOSE +} +static struct PP_Var GetDeviceID_12_5(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.5\""); + AddProp(ss, "__method", "\"GetDeviceID\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Flash_12_5*)RealGetInterface("PPB_Flash;12.5"))->GetDeviceID(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetSettingInt_12_5(PP_Instance instance, PP_FlashSetting setting) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.5\""); + AddProp(ss, "__method", "\"GetSettingInt\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "setting", ToString_PP_FlashSetting(setting)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_12_5*)RealGetInterface("PPB_Flash;12.5"))->GetSettingInt(instance, setting); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetSetting_12_5(PP_Instance instance, PP_FlashSetting setting) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.5\""); + AddProp(ss, "__method", "\"GetSetting\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "setting", ToString_PP_FlashSetting(setting)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Flash_12_5*)RealGetInterface("PPB_Flash;12.5"))->GetSetting(instance, setting); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool SetCrashData_12_5(PP_Instance instance, PP_FlashCrashKey key, struct PP_Var value) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.5\""); + AddProp(ss, "__method", "\"SetCrashData\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "key", ToString_PP_FlashCrashKey(key)); + AddProp(ss, "value", ToString_PP_Var(value)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Flash_12_5*)RealGetInterface("PPB_Flash;12.5"))->SetCrashData(instance, key, value); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping EnumerateVideoCaptureDevices */ +} +static PPB_Flash_12_5 _PPB_Flash_12_5 = { + ns_PPB_Flash_12_5::SetInstanceAlwaysOnTop_12_5, + ns_PPB_Flash_12_5::DrawGlyphs_12_5, + ns_PPB_Flash_12_5::GetProxyForURL_12_5, + ns_PPB_Flash_12_5::Navigate_12_5, + ns_PPB_Flash_12_5::RunMessageLoop_12_5, + ns_PPB_Flash_12_5::QuitMessageLoop_12_5, + ns_PPB_Flash_12_5::GetLocalTimeZoneOffset_12_5, + ns_PPB_Flash_12_5::GetCommandLineArgs_12_5, + ns_PPB_Flash_12_5::PreloadFontWin_12_5, + ns_PPB_Flash_12_5::IsRectTopmost_12_5, + ns_PPB_Flash_12_5::InvokePrinting_12_5, + ns_PPB_Flash_12_5::UpdateActivity_12_5, + ns_PPB_Flash_12_5::GetDeviceID_12_5, + ns_PPB_Flash_12_5::GetSettingInt_12_5, + ns_PPB_Flash_12_5::GetSetting_12_5, + ns_PPB_Flash_12_5::SetCrashData_12_5, +}; +const string ToString_PPB_Flash(const PPB_Flash_12_5 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Flash_12_6 { +static void SetInstanceAlwaysOnTop_12_6(PP_Instance instance, PP_Bool on_top) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.6\""); + AddProp(ss, "__method", "\"SetInstanceAlwaysOnTop\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "on_top", ToString_PP_Bool(on_top)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Flash_12_6*)RealGetInterface("PPB_Flash;12.6"))->SetInstanceAlwaysOnTop(instance, on_top); +#endif // !INTERPOSE +} +static PP_Bool DrawGlyphs_12_6(PP_Instance instance, PP_Resource pp_image_data, const struct PP_BrowserFont_Trusted_Description* font_desc, uint32_t color, const struct PP_Point* position, const struct PP_Rect* clip, const float transformation[3][3], PP_Bool allow_subpixel_aa, uint32_t glyph_count, const uint16_t glyph_indices[], const struct PP_Point glyph_advances[]) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.6\""); + AddProp(ss, "__method", "\"DrawGlyphs\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "pp_image_data", ToString_PP_Resource(pp_image_data)); + AddProp(ss, "font_desc", ToString_PP_BrowserFont_Trusted_Description(font_desc)); + AddProp(ss, "color", ToString_uint32_t(color)); + AddProp(ss, "position", ToString_PP_Point(position)); + AddProp(ss, "clip", ToString_PP_Rect(clip)); + { + BeginProp(ss, "transformation"); + BeginElements(ss); + for (uint32_t _n = 0; _n < 3; ++_n) { + AddElement(ss, ToString_float_t(transformation[_n])); + } + EndElements(ss); + } + AddProp(ss, "allow_subpixel_aa", ToString_PP_Bool(allow_subpixel_aa)); + AddProp(ss, "glyph_count", ToString_uint32_t(glyph_count)); + { + BeginProp(ss, "glyph_indices"); + BeginElements(ss); + for (uint32_t _n = 0; _n < glyph_count; ++_n) { + AddElement(ss, ToString_uint16_t(glyph_indices[_n])); + } + EndElements(ss); + } + { + BeginProp(ss, "glyph_advances"); + BeginElements(ss); + for (uint32_t _n = 0; _n < glyph_count; ++_n) { + AddElement(ss, ToString_PP_Point(glyph_advances[_n])); + } + EndElements(ss); + } + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Flash_12_6*)RealGetInterface("PPB_Flash;12.6"))->DrawGlyphs(instance, pp_image_data, font_desc, color, position, clip, transformation, allow_subpixel_aa, glyph_count, glyph_indices, glyph_advances); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetProxyForURL_12_6(PP_Instance instance, const char* url) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.6\""); + AddProp(ss, "__method", "\"GetProxyForURL\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "url", ToString_str_t(url)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Flash_12_6*)RealGetInterface("PPB_Flash;12.6"))->GetProxyForURL(instance, url); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Navigate_12_6(PP_Resource request_info, const char* target, PP_Bool from_user_action) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.6\""); + AddProp(ss, "__method", "\"Navigate\""); + AddProp(ss, "request_info", ToString_PP_Resource(request_info)); + AddProp(ss, "target", ToString_str_t(target)); + AddProp(ss, "from_user_action", ToString_PP_Bool(from_user_action)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_12_6*)RealGetInterface("PPB_Flash;12.6"))->Navigate(request_info, target, from_user_action); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void RunMessageLoop_12_6(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.6\""); + AddProp(ss, "__method", "\"RunMessageLoop\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Flash_12_6*)RealGetInterface("PPB_Flash;12.6"))->RunMessageLoop(instance); +#endif // !INTERPOSE +} +static void QuitMessageLoop_12_6(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.6\""); + AddProp(ss, "__method", "\"QuitMessageLoop\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Flash_12_6*)RealGetInterface("PPB_Flash;12.6"))->QuitMessageLoop(instance); +#endif // !INTERPOSE +} +static double GetLocalTimeZoneOffset_12_6(PP_Instance instance, PP_Time t) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.6\""); + AddProp(ss, "__method", "\"GetLocalTimeZoneOffset\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "t", ToString_PP_Time(t)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + double rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_double_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + double rval = ((PPB_Flash_12_6*)RealGetInterface("PPB_Flash;12.6"))->GetLocalTimeZoneOffset(instance, t); + printf("RPC response: ["); + printf("%s", ToString_double_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetCommandLineArgs_12_6(PP_Module module) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.6\""); + AddProp(ss, "__method", "\"GetCommandLineArgs\""); + AddProp(ss, "module", ToString_PP_Module(module)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Flash_12_6*)RealGetInterface("PPB_Flash;12.6"))->GetCommandLineArgs(module); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void PreloadFontWin_12_6(const void* logfontw) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.6\""); + AddProp(ss, "__method", "\"PreloadFontWin\""); + AddProp(ss, "logfontw", ToString_mem_t(logfontw)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Flash_12_6*)RealGetInterface("PPB_Flash;12.6"))->PreloadFontWin(logfontw); +#endif // !INTERPOSE +} +static PP_Bool IsRectTopmost_12_6(PP_Instance instance, const struct PP_Rect* rect) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.6\""); + AddProp(ss, "__method", "\"IsRectTopmost\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "rect", ToString_PP_Rect(rect)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Flash_12_6*)RealGetInterface("PPB_Flash;12.6"))->IsRectTopmost(instance, rect); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t InvokePrinting_12_6(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.6\""); + AddProp(ss, "__method", "\"InvokePrinting\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_12_6*)RealGetInterface("PPB_Flash;12.6"))->InvokePrinting(instance); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void UpdateActivity_12_6(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.6\""); + AddProp(ss, "__method", "\"UpdateActivity\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Flash_12_6*)RealGetInterface("PPB_Flash;12.6"))->UpdateActivity(instance); +#endif // !INTERPOSE +} +static struct PP_Var GetDeviceID_12_6(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.6\""); + AddProp(ss, "__method", "\"GetDeviceID\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Flash_12_6*)RealGetInterface("PPB_Flash;12.6"))->GetDeviceID(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetSettingInt_12_6(PP_Instance instance, PP_FlashSetting setting) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.6\""); + AddProp(ss, "__method", "\"GetSettingInt\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "setting", ToString_PP_FlashSetting(setting)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_12_6*)RealGetInterface("PPB_Flash;12.6"))->GetSettingInt(instance, setting); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetSetting_12_6(PP_Instance instance, PP_FlashSetting setting) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.6\""); + AddProp(ss, "__method", "\"GetSetting\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "setting", ToString_PP_FlashSetting(setting)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Flash_12_6*)RealGetInterface("PPB_Flash;12.6"))->GetSetting(instance, setting); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool SetCrashData_12_6(PP_Instance instance, PP_FlashCrashKey key, struct PP_Var value) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.6\""); + AddProp(ss, "__method", "\"SetCrashData\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "key", ToString_PP_FlashCrashKey(key)); + AddProp(ss, "value", ToString_PP_Var(value)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Flash_12_6*)RealGetInterface("PPB_Flash;12.6"))->SetCrashData(instance, key, value); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t EnumerateVideoCaptureDevices_12_6(PP_Instance instance, PP_Resource video_capture, struct PP_ArrayOutput devices) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"12.6\""); + AddProp(ss, "__method", "\"EnumerateVideoCaptureDevices\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "video_capture", ToString_PP_Resource(video_capture)); + AddProp(ss, "devices", ToString_PP_ArrayOutput(devices)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_12_6*)RealGetInterface("PPB_Flash;12.6"))->EnumerateVideoCaptureDevices(instance, video_capture, devices); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_Flash_12_6 _PPB_Flash_12_6 = { + ns_PPB_Flash_12_6::SetInstanceAlwaysOnTop_12_6, + ns_PPB_Flash_12_6::DrawGlyphs_12_6, + ns_PPB_Flash_12_6::GetProxyForURL_12_6, + ns_PPB_Flash_12_6::Navigate_12_6, + ns_PPB_Flash_12_6::RunMessageLoop_12_6, + ns_PPB_Flash_12_6::QuitMessageLoop_12_6, + ns_PPB_Flash_12_6::GetLocalTimeZoneOffset_12_6, + ns_PPB_Flash_12_6::GetCommandLineArgs_12_6, + ns_PPB_Flash_12_6::PreloadFontWin_12_6, + ns_PPB_Flash_12_6::IsRectTopmost_12_6, + ns_PPB_Flash_12_6::InvokePrinting_12_6, + ns_PPB_Flash_12_6::UpdateActivity_12_6, + ns_PPB_Flash_12_6::GetDeviceID_12_6, + ns_PPB_Flash_12_6::GetSettingInt_12_6, + ns_PPB_Flash_12_6::GetSetting_12_6, + ns_PPB_Flash_12_6::SetCrashData_12_6, + ns_PPB_Flash_12_6::EnumerateVideoCaptureDevices_12_6, +}; +const string ToString_PPB_Flash(const PPB_Flash_12_6 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Flash_13_0 { +static void SetInstanceAlwaysOnTop_13_0(PP_Instance instance, PP_Bool on_top) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"13.0\""); + AddProp(ss, "__method", "\"SetInstanceAlwaysOnTop\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "on_top", ToString_PP_Bool(on_top)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Flash_13_0*)RealGetInterface("PPB_Flash;13.0"))->SetInstanceAlwaysOnTop(instance, on_top); +#endif // !INTERPOSE +} +static PP_Bool DrawGlyphs_13_0(PP_Instance instance, PP_Resource pp_image_data, const struct PP_BrowserFont_Trusted_Description* font_desc, uint32_t color, const struct PP_Point* position, const struct PP_Rect* clip, const float transformation[3][3], PP_Bool allow_subpixel_aa, uint32_t glyph_count, const uint16_t glyph_indices[], const struct PP_Point glyph_advances[]) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"13.0\""); + AddProp(ss, "__method", "\"DrawGlyphs\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "pp_image_data", ToString_PP_Resource(pp_image_data)); + AddProp(ss, "font_desc", ToString_PP_BrowserFont_Trusted_Description(font_desc)); + AddProp(ss, "color", ToString_uint32_t(color)); + AddProp(ss, "position", ToString_PP_Point(position)); + AddProp(ss, "clip", ToString_PP_Rect(clip)); + { + BeginProp(ss, "transformation"); + BeginElements(ss); + for (uint32_t _n = 0; _n < 3; ++_n) { + AddElement(ss, ToString_float_t(transformation[_n])); + } + EndElements(ss); + } + AddProp(ss, "allow_subpixel_aa", ToString_PP_Bool(allow_subpixel_aa)); + AddProp(ss, "glyph_count", ToString_uint32_t(glyph_count)); + { + BeginProp(ss, "glyph_indices"); + BeginElements(ss); + for (uint32_t _n = 0; _n < glyph_count; ++_n) { + AddElement(ss, ToString_uint16_t(glyph_indices[_n])); + } + EndElements(ss); + } + { + BeginProp(ss, "glyph_advances"); + BeginElements(ss); + for (uint32_t _n = 0; _n < glyph_count; ++_n) { + AddElement(ss, ToString_PP_Point(glyph_advances[_n])); + } + EndElements(ss); + } + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Flash_13_0*)RealGetInterface("PPB_Flash;13.0"))->DrawGlyphs(instance, pp_image_data, font_desc, color, position, clip, transformation, allow_subpixel_aa, glyph_count, glyph_indices, glyph_advances); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetProxyForURL_13_0(PP_Instance instance, const char* url) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"13.0\""); + AddProp(ss, "__method", "\"GetProxyForURL\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "url", ToString_str_t(url)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Flash_13_0*)RealGetInterface("PPB_Flash;13.0"))->GetProxyForURL(instance, url); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Navigate_13_0(PP_Resource request_info, const char* target, PP_Bool from_user_action) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"13.0\""); + AddProp(ss, "__method", "\"Navigate\""); + AddProp(ss, "request_info", ToString_PP_Resource(request_info)); + AddProp(ss, "target", ToString_str_t(target)); + AddProp(ss, "from_user_action", ToString_PP_Bool(from_user_action)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_13_0*)RealGetInterface("PPB_Flash;13.0"))->Navigate(request_info, target, from_user_action); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping RunMessageLoop */ +/* skipping QuitMessageLoop */ +static double GetLocalTimeZoneOffset_13_0(PP_Instance instance, PP_Time t) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"13.0\""); + AddProp(ss, "__method", "\"GetLocalTimeZoneOffset\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "t", ToString_PP_Time(t)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + double rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_double_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + double rval = ((PPB_Flash_13_0*)RealGetInterface("PPB_Flash;13.0"))->GetLocalTimeZoneOffset(instance, t); + printf("RPC response: ["); + printf("%s", ToString_double_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetCommandLineArgs_13_0(PP_Module module) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"13.0\""); + AddProp(ss, "__method", "\"GetCommandLineArgs\""); + AddProp(ss, "module", ToString_PP_Module(module)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Flash_13_0*)RealGetInterface("PPB_Flash;13.0"))->GetCommandLineArgs(module); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void PreloadFontWin_13_0(const void* logfontw) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"13.0\""); + AddProp(ss, "__method", "\"PreloadFontWin\""); + AddProp(ss, "logfontw", ToString_mem_t(logfontw)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Flash_13_0*)RealGetInterface("PPB_Flash;13.0"))->PreloadFontWin(logfontw); +#endif // !INTERPOSE +} +static PP_Bool IsRectTopmost_13_0(PP_Instance instance, const struct PP_Rect* rect) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"13.0\""); + AddProp(ss, "__method", "\"IsRectTopmost\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "rect", ToString_PP_Rect(rect)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Flash_13_0*)RealGetInterface("PPB_Flash;13.0"))->IsRectTopmost(instance, rect); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping InvokePrinting */ +static void UpdateActivity_13_0(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"13.0\""); + AddProp(ss, "__method", "\"UpdateActivity\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Flash_13_0*)RealGetInterface("PPB_Flash;13.0"))->UpdateActivity(instance); +#endif // !INTERPOSE +} +/* skipping GetDeviceID */ +/* skipping GetSettingInt */ +static struct PP_Var GetSetting_13_0(PP_Instance instance, PP_FlashSetting setting) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"13.0\""); + AddProp(ss, "__method", "\"GetSetting\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "setting", ToString_PP_FlashSetting(setting)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Flash_13_0*)RealGetInterface("PPB_Flash;13.0"))->GetSetting(instance, setting); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool SetCrashData_13_0(PP_Instance instance, PP_FlashCrashKey key, struct PP_Var value) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"13.0\""); + AddProp(ss, "__method", "\"SetCrashData\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "key", ToString_PP_FlashCrashKey(key)); + AddProp(ss, "value", ToString_PP_Var(value)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Flash_13_0*)RealGetInterface("PPB_Flash;13.0"))->SetCrashData(instance, key, value); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t EnumerateVideoCaptureDevices_13_0(PP_Instance instance, PP_Resource video_capture, struct PP_ArrayOutput devices) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash\""); + AddProp(ss, "__version", "\"13.0\""); + AddProp(ss, "__method", "\"EnumerateVideoCaptureDevices\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "video_capture", ToString_PP_Resource(video_capture)); + AddProp(ss, "devices", ToString_PP_ArrayOutput(devices)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_13_0*)RealGetInterface("PPB_Flash;13.0"))->EnumerateVideoCaptureDevices(instance, video_capture, devices); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_Flash_13_0 _PPB_Flash_13_0 = { + ns_PPB_Flash_13_0::SetInstanceAlwaysOnTop_13_0, + ns_PPB_Flash_13_0::DrawGlyphs_13_0, + ns_PPB_Flash_13_0::GetProxyForURL_13_0, + ns_PPB_Flash_13_0::Navigate_13_0, + ns_PPB_Flash_13_0::GetLocalTimeZoneOffset_13_0, + ns_PPB_Flash_13_0::GetCommandLineArgs_13_0, + ns_PPB_Flash_13_0::PreloadFontWin_13_0, + ns_PPB_Flash_13_0::IsRectTopmost_13_0, + ns_PPB_Flash_13_0::UpdateActivity_13_0, + ns_PPB_Flash_13_0::GetSetting_13_0, + ns_PPB_Flash_13_0::SetCrashData_13_0, + ns_PPB_Flash_13_0::EnumerateVideoCaptureDevices_13_0, +}; +const string ToString_PPB_Flash(const PPB_Flash_13_0 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_Flash_Clipboard_Type(const PP_Flash_Clipboard_Type *v) { + switch (*v) { + case 0: + return "\"PP_FLASH_CLIPBOARD_TYPE_STANDARD\""; + case 1: + return "\"PP_FLASH_CLIPBOARD_TYPE_SELECTION\""; + default: + return "\"???\""; + } +} +const string ToString_PP_Flash_Clipboard_Type(const PP_Flash_Clipboard_Type &v) { + return ToString_PP_Flash_Clipboard_Type(&v); +} +void FromJSON_PP_Flash_Clipboard_Type(JSONIterator& iterator, PP_Flash_Clipboard_Type &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_Flash_Clipboard_Type(v); +} +const string ToString_PP_Flash_Clipboard_Format(const PP_Flash_Clipboard_Format *v) { + switch (*v) { + case 0: + return "\"PP_FLASH_CLIPBOARD_FORMAT_INVALID\""; + case 1: + return "\"PP_FLASH_CLIPBOARD_FORMAT_PLAINTEXT\""; + case 2: + return "\"PP_FLASH_CLIPBOARD_FORMAT_HTML\""; + case 3: + return "\"PP_FLASH_CLIPBOARD_FORMAT_RTF\""; + default: + return "\"???\""; + } +} +const string ToString_PP_Flash_Clipboard_Format(const PP_Flash_Clipboard_Format &v) { + return ToString_PP_Flash_Clipboard_Format(&v); +} +void FromJSON_PP_Flash_Clipboard_Format(JSONIterator& iterator, PP_Flash_Clipboard_Format &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_Flash_Clipboard_Format(v); +} +namespace ns_PPB_Flash_Clipboard_4_0 { +static PP_Bool IsFormatAvailable_4_0(PP_Instance instance_id, PP_Flash_Clipboard_Type clipboard_type, PP_Flash_Clipboard_Format format) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_Clipboard\""); + AddProp(ss, "__version", "\"4.0\""); + AddProp(ss, "__method", "\"IsFormatAvailable\""); + AddProp(ss, "instance_id", ToString_PP_Instance(instance_id)); + AddProp(ss, "clipboard_type", ToString_PP_Flash_Clipboard_Type(clipboard_type)); + AddProp(ss, "format", ToString_PP_Flash_Clipboard_Format(format)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Flash_Clipboard_4_0*)RealGetInterface("PPB_Flash_Clipboard;4.0"))->IsFormatAvailable(instance_id, clipboard_type, format); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var ReadData_4_0(PP_Instance instance_id, PP_Flash_Clipboard_Type clipboard_type, PP_Flash_Clipboard_Format format) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_Clipboard\""); + AddProp(ss, "__version", "\"4.0\""); + AddProp(ss, "__method", "\"ReadData\""); + AddProp(ss, "instance_id", ToString_PP_Instance(instance_id)); + AddProp(ss, "clipboard_type", ToString_PP_Flash_Clipboard_Type(clipboard_type)); + AddProp(ss, "format", ToString_PP_Flash_Clipboard_Format(format)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Flash_Clipboard_4_0*)RealGetInterface("PPB_Flash_Clipboard;4.0"))->ReadData(instance_id, clipboard_type, format); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t WriteData_4_0(PP_Instance instance_id, PP_Flash_Clipboard_Type clipboard_type, uint32_t data_item_count, const PP_Flash_Clipboard_Format formats[], const struct PP_Var data_items[]) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_Clipboard\""); + AddProp(ss, "__version", "\"4.0\""); + AddProp(ss, "__method", "\"WriteData\""); + AddProp(ss, "instance_id", ToString_PP_Instance(instance_id)); + AddProp(ss, "clipboard_type", ToString_PP_Flash_Clipboard_Type(clipboard_type)); + AddProp(ss, "data_item_count", ToString_uint32_t(data_item_count)); + { + BeginProp(ss, "formats"); + BeginElements(ss); + for (uint32_t _n = 0; _n < data_item_count; ++_n) { + AddElement(ss, ToString_PP_Flash_Clipboard_Format(formats[_n])); + } + EndElements(ss); + } + { + BeginProp(ss, "data_items"); + BeginElements(ss); + for (uint32_t _n = 0; _n < data_item_count; ++_n) { + AddElement(ss, ToString_PP_Var(data_items[_n])); + } + EndElements(ss); + } + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_Clipboard_4_0*)RealGetInterface("PPB_Flash_Clipboard;4.0"))->WriteData(instance_id, clipboard_type, data_item_count, formats, data_items); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping RegisterCustomFormat */ +/* skipping IsFormatAvailable */ +/* skipping ReadData */ +/* skipping WriteData */ +/* skipping GetSequenceNumber */ +} +static PPB_Flash_Clipboard_4_0 _PPB_Flash_Clipboard_4_0 = { + ns_PPB_Flash_Clipboard_4_0::IsFormatAvailable_4_0, + ns_PPB_Flash_Clipboard_4_0::ReadData_4_0, + ns_PPB_Flash_Clipboard_4_0::WriteData_4_0, +}; +const string ToString_PPB_Flash_Clipboard(const PPB_Flash_Clipboard_4_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Flash_Clipboard_5_0 { +/* skipping IsFormatAvailable */ +/* skipping ReadData */ +/* skipping WriteData */ +static uint32_t RegisterCustomFormat_5_0(PP_Instance instance_id, const char* format_name) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_Clipboard\""); + AddProp(ss, "__version", "\"5.0\""); + AddProp(ss, "__method", "\"RegisterCustomFormat\""); + AddProp(ss, "instance_id", ToString_PP_Instance(instance_id)); + AddProp(ss, "format_name", ToString_str_t(format_name)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint32_t rval = ((PPB_Flash_Clipboard_5_0*)RealGetInterface("PPB_Flash_Clipboard;5.0"))->RegisterCustomFormat(instance_id, format_name); + printf("RPC response: ["); + printf("%s", ToString_uint32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsFormatAvailable_5_0(PP_Instance instance_id, PP_Flash_Clipboard_Type clipboard_type, uint32_t format) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_Clipboard\""); + AddProp(ss, "__version", "\"5.0\""); + AddProp(ss, "__method", "\"IsFormatAvailable\""); + AddProp(ss, "instance_id", ToString_PP_Instance(instance_id)); + AddProp(ss, "clipboard_type", ToString_PP_Flash_Clipboard_Type(clipboard_type)); + AddProp(ss, "format", ToString_uint32_t(format)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Flash_Clipboard_5_0*)RealGetInterface("PPB_Flash_Clipboard;5.0"))->IsFormatAvailable(instance_id, clipboard_type, format); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var ReadData_5_0(PP_Instance instance_id, PP_Flash_Clipboard_Type clipboard_type, uint32_t format) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_Clipboard\""); + AddProp(ss, "__version", "\"5.0\""); + AddProp(ss, "__method", "\"ReadData\""); + AddProp(ss, "instance_id", ToString_PP_Instance(instance_id)); + AddProp(ss, "clipboard_type", ToString_PP_Flash_Clipboard_Type(clipboard_type)); + AddProp(ss, "format", ToString_uint32_t(format)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Flash_Clipboard_5_0*)RealGetInterface("PPB_Flash_Clipboard;5.0"))->ReadData(instance_id, clipboard_type, format); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t WriteData_5_0(PP_Instance instance_id, PP_Flash_Clipboard_Type clipboard_type, uint32_t data_item_count, const uint32_t formats[], const struct PP_Var data_items[]) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_Clipboard\""); + AddProp(ss, "__version", "\"5.0\""); + AddProp(ss, "__method", "\"WriteData\""); + AddProp(ss, "instance_id", ToString_PP_Instance(instance_id)); + AddProp(ss, "clipboard_type", ToString_PP_Flash_Clipboard_Type(clipboard_type)); + AddProp(ss, "data_item_count", ToString_uint32_t(data_item_count)); + { + BeginProp(ss, "formats"); + BeginElements(ss); + for (uint32_t _n = 0; _n < data_item_count; ++_n) { + AddElement(ss, ToString_uint32_t(formats[_n])); + } + EndElements(ss); + } + { + BeginProp(ss, "data_items"); + BeginElements(ss); + for (uint32_t _n = 0; _n < data_item_count; ++_n) { + AddElement(ss, ToString_PP_Var(data_items[_n])); + } + EndElements(ss); + } + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_Clipboard_5_0*)RealGetInterface("PPB_Flash_Clipboard;5.0"))->WriteData(instance_id, clipboard_type, data_item_count, formats, data_items); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping GetSequenceNumber */ +} +static PPB_Flash_Clipboard_5_0 _PPB_Flash_Clipboard_5_0 = { + ns_PPB_Flash_Clipboard_5_0::RegisterCustomFormat_5_0, + ns_PPB_Flash_Clipboard_5_0::IsFormatAvailable_5_0, + ns_PPB_Flash_Clipboard_5_0::ReadData_5_0, + ns_PPB_Flash_Clipboard_5_0::WriteData_5_0, +}; +const string ToString_PPB_Flash_Clipboard(const PPB_Flash_Clipboard_5_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Flash_Clipboard_5_1 { +/* skipping IsFormatAvailable */ +/* skipping ReadData */ +/* skipping WriteData */ +static uint32_t RegisterCustomFormat_5_1(PP_Instance instance_id, const char* format_name) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_Clipboard\""); + AddProp(ss, "__version", "\"5.1\""); + AddProp(ss, "__method", "\"RegisterCustomFormat\""); + AddProp(ss, "instance_id", ToString_PP_Instance(instance_id)); + AddProp(ss, "format_name", ToString_str_t(format_name)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint32_t rval = ((PPB_Flash_Clipboard_5_1*)RealGetInterface("PPB_Flash_Clipboard;5.1"))->RegisterCustomFormat(instance_id, format_name); + printf("RPC response: ["); + printf("%s", ToString_uint32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsFormatAvailable_5_1(PP_Instance instance_id, PP_Flash_Clipboard_Type clipboard_type, uint32_t format) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_Clipboard\""); + AddProp(ss, "__version", "\"5.1\""); + AddProp(ss, "__method", "\"IsFormatAvailable\""); + AddProp(ss, "instance_id", ToString_PP_Instance(instance_id)); + AddProp(ss, "clipboard_type", ToString_PP_Flash_Clipboard_Type(clipboard_type)); + AddProp(ss, "format", ToString_uint32_t(format)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Flash_Clipboard_5_1*)RealGetInterface("PPB_Flash_Clipboard;5.1"))->IsFormatAvailable(instance_id, clipboard_type, format); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var ReadData_5_1(PP_Instance instance_id, PP_Flash_Clipboard_Type clipboard_type, uint32_t format) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_Clipboard\""); + AddProp(ss, "__version", "\"5.1\""); + AddProp(ss, "__method", "\"ReadData\""); + AddProp(ss, "instance_id", ToString_PP_Instance(instance_id)); + AddProp(ss, "clipboard_type", ToString_PP_Flash_Clipboard_Type(clipboard_type)); + AddProp(ss, "format", ToString_uint32_t(format)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Flash_Clipboard_5_1*)RealGetInterface("PPB_Flash_Clipboard;5.1"))->ReadData(instance_id, clipboard_type, format); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t WriteData_5_1(PP_Instance instance_id, PP_Flash_Clipboard_Type clipboard_type, uint32_t data_item_count, const uint32_t formats[], const struct PP_Var data_items[]) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_Clipboard\""); + AddProp(ss, "__version", "\"5.1\""); + AddProp(ss, "__method", "\"WriteData\""); + AddProp(ss, "instance_id", ToString_PP_Instance(instance_id)); + AddProp(ss, "clipboard_type", ToString_PP_Flash_Clipboard_Type(clipboard_type)); + AddProp(ss, "data_item_count", ToString_uint32_t(data_item_count)); + { + BeginProp(ss, "formats"); + BeginElements(ss); + for (uint32_t _n = 0; _n < data_item_count; ++_n) { + AddElement(ss, ToString_uint32_t(formats[_n])); + } + EndElements(ss); + } + { + BeginProp(ss, "data_items"); + BeginElements(ss); + for (uint32_t _n = 0; _n < data_item_count; ++_n) { + AddElement(ss, ToString_PP_Var(data_items[_n])); + } + EndElements(ss); + } + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_Clipboard_5_1*)RealGetInterface("PPB_Flash_Clipboard;5.1"))->WriteData(instance_id, clipboard_type, data_item_count, formats, data_items); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetSequenceNumber_5_1(PP_Instance instance_id, PP_Flash_Clipboard_Type clipboard_type, uint64_t* sequence_number) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_Clipboard\""); + AddProp(ss, "__version", "\"5.1\""); + AddProp(ss, "__method", "\"GetSequenceNumber\""); + AddProp(ss, "instance_id", ToString_PP_Instance(instance_id)); + AddProp(ss, "clipboard_type", ToString_PP_Flash_Clipboard_Type(clipboard_type)); + AddProp(ss, "sequence_number", PointerToString(sequence_number)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_uint64_t(iterator, *sequence_number); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Flash_Clipboard_5_1*)RealGetInterface("PPB_Flash_Clipboard;5.1"))->GetSequenceNumber(instance_id, clipboard_type, sequence_number); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!sequence_number) { + AddProp(os, "sequence_number", ToString_uint64_t(sequence_number)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_Flash_Clipboard_5_1 _PPB_Flash_Clipboard_5_1 = { + ns_PPB_Flash_Clipboard_5_1::RegisterCustomFormat_5_1, + ns_PPB_Flash_Clipboard_5_1::IsFormatAvailable_5_1, + ns_PPB_Flash_Clipboard_5_1::ReadData_5_1, + ns_PPB_Flash_Clipboard_5_1::WriteData_5_1, + ns_PPB_Flash_Clipboard_5_1::GetSequenceNumber_5_1, +}; +const string ToString_PPB_Flash_Clipboard(const PPB_Flash_Clipboard_5_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Flash_DeviceID_1_0 { +static PP_Resource Create_1_0(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_DeviceID\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_DeviceID_1_0*)RealGetInterface("PPB_Flash_DeviceID;1.0"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetDeviceID_1_0(PP_Resource device_id, struct PP_Var* id, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_DeviceID\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetDeviceID\""); + AddProp(ss, "device_id", ToString_PP_Resource(device_id)); + AddProp(ss, "id", PointerToString(id)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Var(iterator, *id); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_Flash_DeviceID_1_0*)RealGetInterface("PPB_Flash_DeviceID;1.0"))->GetDeviceID(device_id, id, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!id) { + AddProp(os, "id", ToString_PP_Var(id)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_Flash_DeviceID_1_0 _PPB_Flash_DeviceID_1_0 = { + ns_PPB_Flash_DeviceID_1_0::Create_1_0, + ns_PPB_Flash_DeviceID_1_0::GetDeviceID_1_0, +}; +const string ToString_PPB_Flash_DeviceID(const PPB_Flash_DeviceID_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Flash_DRM_1_0 { +static PP_Resource Create_1_0(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_DRM\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_DRM_1_0*)RealGetInterface("PPB_Flash_DRM;1.0"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetDeviceID_1_0(PP_Resource drm, struct PP_Var* id, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_DRM\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetDeviceID\""); + AddProp(ss, "drm", ToString_PP_Resource(drm)); + AddProp(ss, "id", PointerToString(id)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Var(iterator, *id); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_Flash_DRM_1_0*)RealGetInterface("PPB_Flash_DRM;1.0"))->GetDeviceID(drm, id, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!id) { + AddProp(os, "id", ToString_PP_Var(id)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetHmonitor_1_0(PP_Resource drm, int64_t* hmonitor) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_DRM\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetHmonitor\""); + AddProp(ss, "drm", ToString_PP_Resource(drm)); + AddProp(ss, "hmonitor", PointerToString(hmonitor)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_int64_t(iterator, *hmonitor); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Flash_DRM_1_0*)RealGetInterface("PPB_Flash_DRM;1.0"))->GetHmonitor(drm, hmonitor); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!hmonitor) { + AddProp(os, "hmonitor", ToString_int64_t(hmonitor)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetVoucherFile_1_0(PP_Resource drm, PP_Resource* file_ref, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_DRM\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetVoucherFile\""); + AddProp(ss, "drm", ToString_PP_Resource(drm)); + AddProp(ss, "file_ref", PointerToString(file_ref)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Resource(iterator, *file_ref); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_Flash_DRM_1_0*)RealGetInterface("PPB_Flash_DRM;1.0"))->GetVoucherFile(drm, file_ref, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!file_ref) { + AddProp(os, "file_ref", ToString_PP_Resource(file_ref)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping MonitorIsExternal */ +} +static PPB_Flash_DRM_1_0 _PPB_Flash_DRM_1_0 = { + ns_PPB_Flash_DRM_1_0::Create_1_0, + ns_PPB_Flash_DRM_1_0::GetDeviceID_1_0, + ns_PPB_Flash_DRM_1_0::GetHmonitor_1_0, + ns_PPB_Flash_DRM_1_0::GetVoucherFile_1_0, +}; +const string ToString_PPB_Flash_DRM(const PPB_Flash_DRM_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Flash_DRM_1_1 { +static PP_Resource Create_1_1(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_DRM\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_DRM_1_1*)RealGetInterface("PPB_Flash_DRM;1.1"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetDeviceID_1_1(PP_Resource drm, struct PP_Var* id, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_DRM\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"GetDeviceID\""); + AddProp(ss, "drm", ToString_PP_Resource(drm)); + AddProp(ss, "id", PointerToString(id)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Var(iterator, *id); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_Flash_DRM_1_1*)RealGetInterface("PPB_Flash_DRM;1.1"))->GetDeviceID(drm, id, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!id) { + AddProp(os, "id", ToString_PP_Var(id)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetHmonitor_1_1(PP_Resource drm, int64_t* hmonitor) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_DRM\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"GetHmonitor\""); + AddProp(ss, "drm", ToString_PP_Resource(drm)); + AddProp(ss, "hmonitor", PointerToString(hmonitor)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_int64_t(iterator, *hmonitor); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Flash_DRM_1_1*)RealGetInterface("PPB_Flash_DRM;1.1"))->GetHmonitor(drm, hmonitor); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!hmonitor) { + AddProp(os, "hmonitor", ToString_int64_t(hmonitor)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetVoucherFile_1_1(PP_Resource drm, PP_Resource* file_ref, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_DRM\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"GetVoucherFile\""); + AddProp(ss, "drm", ToString_PP_Resource(drm)); + AddProp(ss, "file_ref", PointerToString(file_ref)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Resource(iterator, *file_ref); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_Flash_DRM_1_1*)RealGetInterface("PPB_Flash_DRM;1.1"))->GetVoucherFile(drm, file_ref, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!file_ref) { + AddProp(os, "file_ref", ToString_PP_Resource(file_ref)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t MonitorIsExternal_1_1(PP_Resource drm, PP_Bool* is_external, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_DRM\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"MonitorIsExternal\""); + AddProp(ss, "drm", ToString_PP_Resource(drm)); + AddProp(ss, "is_external", PointerToString(is_external)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Bool(iterator, *is_external); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_Flash_DRM_1_1*)RealGetInterface("PPB_Flash_DRM;1.1"))->MonitorIsExternal(drm, is_external, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + AddProp(os, "is_external", ToString_PP_Bool(is_external)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_Flash_DRM_1_1 _PPB_Flash_DRM_1_1 = { + ns_PPB_Flash_DRM_1_1::Create_1_1, + ns_PPB_Flash_DRM_1_1::GetDeviceID_1_1, + ns_PPB_Flash_DRM_1_1::GetHmonitor_1_1, + ns_PPB_Flash_DRM_1_1::GetVoucherFile_1_1, + ns_PPB_Flash_DRM_1_1::MonitorIsExternal_1_1, +}; +const string ToString_PPB_Flash_DRM(const PPB_Flash_DRM_1_1 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_DirEntry_Dev(const PP_DirEntry_Dev *v) { + if (!v) { + return "null"; + } + return ToString_PP_DirEntry_Dev(*v); +} +const string ToString_PP_DirEntry_Dev(const PP_DirEntry_Dev &v) { + stringstream x; + BeginProps(x); + AddProp(x, "name", ToString_str_t(v.name)); + AddProp(x, "is_dir", ToString_PP_Bool(v.is_dir)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_DirEntry_Dev(JSONIterator& iterator, PP_DirEntry_Dev &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_str_t(iterator, value.name); + iterator.skip(); + FromJSON_PP_Bool(iterator, value.is_dir); +} +const string ToString_PP_DirContents_Dev(const PP_DirContents_Dev *v) { + if (!v) { + return "null"; + } + return ToString_PP_DirContents_Dev(*v); +} +const string ToString_PP_DirContents_Dev(const PP_DirContents_Dev &v) { + stringstream x; + BeginProps(x); + AddProp(x, "count", ToString_int32_t(v.count)); + { + BeginProp(x, "entries"); + BeginElements(x); + for (uint32_t _n = 0; _n < v.count; ++_n) { + AddElement(x, ToString_PP_DirEntry_Dev(v.entries[_n])); + } + EndElements(x); + } + EndProps(x); + return x.str(); +} +void FromJSON_PP_DirContents_Dev(JSONIterator& iterator, PP_DirContents_Dev &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_int32_t(iterator, value.count); + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > value.count) { + Fail("Too many items in array\n", ""); + } + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_PP_DirEntry_Dev(iterator, (value.entries)[_n]); + } + // FIXME Null out remaining items? + } +} +namespace ns_PPB_Flash_File_ModuleLocal_3_0 { +static PP_Bool CreateThreadAdapterForInstance_3_0(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_File_ModuleLocal\""); + AddProp(ss, "__version", "\"3.0\""); + AddProp(ss, "__method", "\"CreateThreadAdapterForInstance\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Flash_File_ModuleLocal_3_0*)RealGetInterface("PPB_Flash_File_ModuleLocal;3.0"))->CreateThreadAdapterForInstance(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void ClearThreadAdapterForInstance_3_0(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_File_ModuleLocal\""); + AddProp(ss, "__version", "\"3.0\""); + AddProp(ss, "__method", "\"ClearThreadAdapterForInstance\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Flash_File_ModuleLocal_3_0*)RealGetInterface("PPB_Flash_File_ModuleLocal;3.0"))->ClearThreadAdapterForInstance(instance); +#endif // !INTERPOSE +} +static int32_t OpenFile_3_0(PP_Instance instance, const char* path, int32_t mode, PP_FileHandle* file) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_File_ModuleLocal\""); + AddProp(ss, "__version", "\"3.0\""); + AddProp(ss, "__method", "\"OpenFile\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "path", ToString_str_t(path)); + AddProp(ss, "mode", ToString_int32_t(mode)); + AddProp(ss, "file", PointerToString(file)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_FileHandle(iterator, *file); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_File_ModuleLocal_3_0*)RealGetInterface("PPB_Flash_File_ModuleLocal;3.0"))->OpenFile(instance, path, mode, file); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!file) { + AddProp(os, "file", ToString_PP_FileHandle(file)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t RenameFile_3_0(PP_Instance instance, const char* path_from, const char* path_to) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_File_ModuleLocal\""); + AddProp(ss, "__version", "\"3.0\""); + AddProp(ss, "__method", "\"RenameFile\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "path_from", ToString_str_t(path_from)); + AddProp(ss, "path_to", ToString_str_t(path_to)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_File_ModuleLocal_3_0*)RealGetInterface("PPB_Flash_File_ModuleLocal;3.0"))->RenameFile(instance, path_from, path_to); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t DeleteFileOrDir_3_0(PP_Instance instance, const char* path, PP_Bool recursive) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_File_ModuleLocal\""); + AddProp(ss, "__version", "\"3.0\""); + AddProp(ss, "__method", "\"DeleteFileOrDir\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "path", ToString_str_t(path)); + AddProp(ss, "recursive", ToString_PP_Bool(recursive)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_File_ModuleLocal_3_0*)RealGetInterface("PPB_Flash_File_ModuleLocal;3.0"))->DeleteFileOrDir(instance, path, recursive); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t CreateDir_3_0(PP_Instance instance, const char* path) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_File_ModuleLocal\""); + AddProp(ss, "__version", "\"3.0\""); + AddProp(ss, "__method", "\"CreateDir\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "path", ToString_str_t(path)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_File_ModuleLocal_3_0*)RealGetInterface("PPB_Flash_File_ModuleLocal;3.0"))->CreateDir(instance, path); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t QueryFile_3_0(PP_Instance instance, const char* path, struct PP_FileInfo* info) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_File_ModuleLocal\""); + AddProp(ss, "__version", "\"3.0\""); + AddProp(ss, "__method", "\"QueryFile\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "path", ToString_str_t(path)); + AddProp(ss, "info", PointerToString(info)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!info) { + iterator.skip(); + FromJSON_PP_FileInfo(iterator, *info); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_File_ModuleLocal_3_0*)RealGetInterface("PPB_Flash_File_ModuleLocal;3.0"))->QueryFile(instance, path, info); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!info) { + AddProp(os, "info", ToString_PP_FileInfo(info)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetDirContents_3_0(PP_Instance instance, const char* path, struct PP_DirContents_Dev** contents) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_File_ModuleLocal\""); + AddProp(ss, "__version", "\"3.0\""); + AddProp(ss, "__method", "\"GetDirContents\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "path", ToString_str_t(path)); + AddProp(ss, "contents", PointerToString(contents)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!contents) { + iterator.skip(); + FromJSON_PP_DirContents_Dev(iterator, *contents); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_File_ModuleLocal_3_0*)RealGetInterface("PPB_Flash_File_ModuleLocal;3.0"))->GetDirContents(instance, path, contents); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!contents) { + AddProp(os, "contents", ToString_PP_DirContents_Dev(contents)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void FreeDirContents_3_0(PP_Instance instance, const struct PP_DirContents_Dev* contents) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_File_ModuleLocal\""); + AddProp(ss, "__version", "\"3.0\""); + AddProp(ss, "__method", "\"FreeDirContents\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "contents", ToString_PP_DirContents_Dev(contents)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Flash_File_ModuleLocal_3_0*)RealGetInterface("PPB_Flash_File_ModuleLocal;3.0"))->FreeDirContents(instance, contents); +#endif // !INTERPOSE +} +static int32_t CreateTemporaryFile_3_0(PP_Instance instance, PP_FileHandle* file) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_File_ModuleLocal\""); + AddProp(ss, "__version", "\"3.0\""); + AddProp(ss, "__method", "\"CreateTemporaryFile\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "file", PointerToString(file)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_FileHandle(iterator, *file); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_File_ModuleLocal_3_0*)RealGetInterface("PPB_Flash_File_ModuleLocal;3.0"))->CreateTemporaryFile(instance, file); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!file) { + AddProp(os, "file", ToString_PP_FileHandle(file)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_Flash_File_ModuleLocal_3_0 _PPB_Flash_File_ModuleLocal_3_0 = { + ns_PPB_Flash_File_ModuleLocal_3_0::CreateThreadAdapterForInstance_3_0, + ns_PPB_Flash_File_ModuleLocal_3_0::ClearThreadAdapterForInstance_3_0, + ns_PPB_Flash_File_ModuleLocal_3_0::OpenFile_3_0, + ns_PPB_Flash_File_ModuleLocal_3_0::RenameFile_3_0, + ns_PPB_Flash_File_ModuleLocal_3_0::DeleteFileOrDir_3_0, + ns_PPB_Flash_File_ModuleLocal_3_0::CreateDir_3_0, + ns_PPB_Flash_File_ModuleLocal_3_0::QueryFile_3_0, + ns_PPB_Flash_File_ModuleLocal_3_0::GetDirContents_3_0, + ns_PPB_Flash_File_ModuleLocal_3_0::FreeDirContents_3_0, + ns_PPB_Flash_File_ModuleLocal_3_0::CreateTemporaryFile_3_0, +}; +const string ToString_PPB_Flash_File_ModuleLocal(const PPB_Flash_File_ModuleLocal_3_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Flash_File_FileRef_2_0 { +static int32_t OpenFile_2_0(PP_Resource file_ref_id, int32_t mode, PP_FileHandle* file) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_File_FileRef\""); + AddProp(ss, "__version", "\"2.0\""); + AddProp(ss, "__method", "\"OpenFile\""); + AddProp(ss, "file_ref_id", ToString_PP_Resource(file_ref_id)); + AddProp(ss, "mode", ToString_int32_t(mode)); + AddProp(ss, "file", PointerToString(file)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_FileHandle(iterator, *file); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_File_FileRef_2_0*)RealGetInterface("PPB_Flash_File_FileRef;2.0"))->OpenFile(file_ref_id, mode, file); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!file) { + AddProp(os, "file", ToString_PP_FileHandle(file)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t QueryFile_2_0(PP_Resource file_ref_id, struct PP_FileInfo* info) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_File_FileRef\""); + AddProp(ss, "__version", "\"2.0\""); + AddProp(ss, "__method", "\"QueryFile\""); + AddProp(ss, "file_ref_id", ToString_PP_Resource(file_ref_id)); + AddProp(ss, "info", PointerToString(info)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!info) { + iterator.skip(); + FromJSON_PP_FileInfo(iterator, *info); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_File_FileRef_2_0*)RealGetInterface("PPB_Flash_File_FileRef;2.0"))->QueryFile(file_ref_id, info); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!info) { + AddProp(os, "info", ToString_PP_FileInfo(info)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_Flash_File_FileRef_2_0 _PPB_Flash_File_FileRef_2_0 = { + ns_PPB_Flash_File_FileRef_2_0::OpenFile_2_0, + ns_PPB_Flash_File_FileRef_2_0::QueryFile_2_0, +}; +const string ToString_PPB_Flash_File_FileRef(const PPB_Flash_File_FileRef_2_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Flash_FontFile_0_1 { +static PP_Resource Create_0_1(PP_Instance instance, const struct PP_BrowserFont_Trusted_Description* description, PP_PrivateFontCharset charset) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_FontFile\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "description", ToString_PP_BrowserFont_Trusted_Description(description)); + AddProp(ss, "charset", ToString_PP_PrivateFontCharset(charset)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_FontFile_0_1*)RealGetInterface("PPB_Flash_FontFile;0.1"))->Create(instance, description, charset); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsFlashFontFile_0_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_FontFile\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"IsFlashFontFile\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Flash_FontFile_0_1*)RealGetInterface("PPB_Flash_FontFile;0.1"))->IsFlashFontFile(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetFontTable_0_1(PP_Resource font_file, uint32_t table, void* output, uint32_t* output_length) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_FontFile\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetFontTable\""); + AddProp(ss, "font_file", ToString_PP_Resource(font_file)); + AddProp(ss, "table", ToString_uint32_t(table)); + AddProp(ss, "output", PointerToString(output)); + AddProp(ss, "output_length", PointerToString(output_length)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_mem_t(iterator, output); + iterator.skip(); + FromJSON_uint32_t(iterator, *output_length); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Flash_FontFile_0_1*)RealGetInterface("PPB_Flash_FontFile;0.1"))->GetFontTable(font_file, table, output, output_length); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + AddProp(os, "output", ToString_mem_t(output)); + if (!!output_length) { + AddProp(os, "output_length", ToString_uint32_t(output_length)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping IsSupportedForWindows */ +} +static PPB_Flash_FontFile_0_1 _PPB_Flash_FontFile_0_1 = { + ns_PPB_Flash_FontFile_0_1::Create_0_1, + ns_PPB_Flash_FontFile_0_1::IsFlashFontFile_0_1, + ns_PPB_Flash_FontFile_0_1::GetFontTable_0_1, +}; +const string ToString_PPB_Flash_FontFile(const PPB_Flash_FontFile_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Flash_FontFile_0_2 { +static PP_Resource Create_0_2(PP_Instance instance, const struct PP_BrowserFont_Trusted_Description* description, PP_PrivateFontCharset charset) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_FontFile\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "description", ToString_PP_BrowserFont_Trusted_Description(description)); + AddProp(ss, "charset", ToString_PP_PrivateFontCharset(charset)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_FontFile_0_2*)RealGetInterface("PPB_Flash_FontFile;0.2"))->Create(instance, description, charset); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsFlashFontFile_0_2(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_FontFile\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"IsFlashFontFile\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Flash_FontFile_0_2*)RealGetInterface("PPB_Flash_FontFile;0.2"))->IsFlashFontFile(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetFontTable_0_2(PP_Resource font_file, uint32_t table, void* output, uint32_t* output_length) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_FontFile\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"GetFontTable\""); + AddProp(ss, "font_file", ToString_PP_Resource(font_file)); + AddProp(ss, "table", ToString_uint32_t(table)); + AddProp(ss, "output", PointerToString(output)); + AddProp(ss, "output_length", PointerToString(output_length)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_mem_t(iterator, output); + iterator.skip(); + FromJSON_uint32_t(iterator, *output_length); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Flash_FontFile_0_2*)RealGetInterface("PPB_Flash_FontFile;0.2"))->GetFontTable(font_file, table, output, output_length); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + AddProp(os, "output", ToString_mem_t(output)); + if (!!output_length) { + AddProp(os, "output_length", ToString_uint32_t(output_length)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsSupportedForWindows_0_2(void) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_FontFile\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"IsSupportedForWindows\""); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Flash_FontFile_0_2*)RealGetInterface("PPB_Flash_FontFile;0.2"))->IsSupportedForWindows(); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_Flash_FontFile_0_2 _PPB_Flash_FontFile_0_2 = { + ns_PPB_Flash_FontFile_0_2::Create_0_2, + ns_PPB_Flash_FontFile_0_2::IsFlashFontFile_0_2, + ns_PPB_Flash_FontFile_0_2::GetFontTable_0_2, + ns_PPB_Flash_FontFile_0_2::IsSupportedForWindows_0_2, +}; +const string ToString_PPB_Flash_FontFile(const PPB_Flash_FontFile_0_2 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_FlashFullscreen_0_1 { +static PP_Bool IsFullscreen_0_1(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FlashFullscreen\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"IsFullscreen\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_FlashFullscreen_0_1*)RealGetInterface("PPB_FlashFullscreen;0.1"))->IsFullscreen(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool SetFullscreen_0_1(PP_Instance instance, PP_Bool fullscreen) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FlashFullscreen\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"SetFullscreen\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "fullscreen", ToString_PP_Bool(fullscreen)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_FlashFullscreen_0_1*)RealGetInterface("PPB_FlashFullscreen;0.1"))->SetFullscreen(instance, fullscreen); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping SetFullscreen */ +static PP_Bool GetScreenSize_0_1(PP_Instance instance, struct PP_Size* size) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FlashFullscreen\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetScreenSize\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "size", PointerToString(size)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!size) { + iterator.skip(); + FromJSON_PP_Size(iterator, *size); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_FlashFullscreen_0_1*)RealGetInterface("PPB_FlashFullscreen;0.1"))->GetScreenSize(instance, size); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!size) { + AddProp(os, "size", ToString_PP_Size(size)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_FlashFullscreen_0_1 _PPB_FlashFullscreen_0_1 = { + ns_PPB_FlashFullscreen_0_1::IsFullscreen_0_1, + ns_PPB_FlashFullscreen_0_1::SetFullscreen_0_1, + ns_PPB_FlashFullscreen_0_1::GetScreenSize_0_1, +}; +const string ToString_PPB_FlashFullscreen(const PPB_FlashFullscreen_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_FlashFullscreen_1_0 { +static PP_Bool IsFullscreen_1_0(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FlashFullscreen\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsFullscreen\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_FlashFullscreen_1_0*)RealGetInterface("PPB_FlashFullscreen;1.0"))->IsFullscreen(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping SetFullscreen */ +static PP_Bool SetFullscreen_1_0(PP_Instance instance, PP_Bool fullscreen) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FlashFullscreen\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"SetFullscreen\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "fullscreen", ToString_PP_Bool(fullscreen)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_FlashFullscreen_1_0*)RealGetInterface("PPB_FlashFullscreen;1.0"))->SetFullscreen(instance, fullscreen); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetScreenSize_1_0(PP_Instance instance, struct PP_Size* size) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_FlashFullscreen\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetScreenSize\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "size", PointerToString(size)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!size) { + iterator.skip(); + FromJSON_PP_Size(iterator, *size); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_FlashFullscreen_1_0*)RealGetInterface("PPB_FlashFullscreen;1.0"))->GetScreenSize(instance, size); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!size) { + AddProp(os, "size", ToString_PP_Size(size)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_FlashFullscreen_1_0 _PPB_FlashFullscreen_1_0 = { + ns_PPB_FlashFullscreen_1_0::IsFullscreen_1_0, + ns_PPB_FlashFullscreen_1_0::SetFullscreen_1_0, + ns_PPB_FlashFullscreen_1_0::GetScreenSize_1_0, +}; +const string ToString_PPB_FlashFullscreen(const PPB_FlashFullscreen_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_Flash_MenuItem_Type(const PP_Flash_MenuItem_Type *v) { + switch (*v) { + case 0: + return "\"PP_FLASH_MENUITEM_TYPE_NORMAL\""; + case 1: + return "\"PP_FLASH_MENUITEM_TYPE_CHECKBOX\""; + case 2: + return "\"PP_FLASH_MENUITEM_TYPE_SEPARATOR\""; + case 3: + return "\"PP_FLASH_MENUITEM_TYPE_SUBMENU\""; + default: + return "\"???\""; + } +} +const string ToString_PP_Flash_MenuItem_Type(const PP_Flash_MenuItem_Type &v) { + return ToString_PP_Flash_MenuItem_Type(&v); +} +void FromJSON_PP_Flash_MenuItem_Type(JSONIterator& iterator, PP_Flash_MenuItem_Type &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_Flash_MenuItem_Type(v); +} +const string ToString_PP_Flash_MenuItem(const PP_Flash_MenuItem *v) { + if (!v) { + return "null"; + } + return ToString_PP_Flash_MenuItem(*v); +} +const string ToString_PP_Flash_MenuItem(const PP_Flash_MenuItem &v) { + stringstream x; + BeginProps(x); + AddProp(x, "type", ToString_PP_Flash_MenuItem_Type(v.type)); + AddProp(x, "name", ToString_str_t(v.name)); + AddProp(x, "id", ToString_int32_t(v.id)); + AddProp(x, "enabled", ToString_PP_Bool(v.enabled)); + AddProp(x, "checked", ToString_PP_Bool(v.checked)); + AddProp(x, "submenu", ToString_PP_Flash_Menu(v.submenu)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_Flash_MenuItem(JSONIterator& iterator, PP_Flash_MenuItem &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_PP_Flash_MenuItem_Type(iterator, value.type); + iterator.skip(); + FromJSON_str_t(iterator, value.name); + iterator.skip(); + FromJSON_int32_t(iterator, value.id); + iterator.skip(); + FromJSON_PP_Bool(iterator, value.enabled); + iterator.skip(); + FromJSON_PP_Bool(iterator, value.checked); + iterator.skip(); + FromJSON_PP_Flash_Menu(iterator, value.submenu); +} +const string ToString_PP_Flash_Menu(const PP_Flash_Menu *v) { + if (!v) { + return "null"; + } + return ToString_PP_Flash_Menu(*v); +} +const string ToString_PP_Flash_Menu(const PP_Flash_Menu &v) { + stringstream x; + BeginProps(x); + AddProp(x, "count", ToString_uint32_t(v.count)); + { + BeginProp(x, "items"); + BeginElements(x); + for (uint32_t _n = 0; _n < v.count; ++_n) { + AddElement(x, ToString_PP_Flash_MenuItem(v.items[_n])); + } + EndElements(x); + } + EndProps(x); + return x.str(); +} +void FromJSON_PP_Flash_Menu(JSONIterator& iterator, PP_Flash_Menu &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_uint32_t(iterator, value.count); + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > value.count) { + Fail("Too many items in array\n", ""); + } + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_PP_Flash_MenuItem(iterator, (value.items)[_n]); + } + // FIXME Null out remaining items? + } +} +namespace ns_PPB_Flash_Menu_0_2 { +static PP_Resource Create_0_2(PP_Instance instance_id, const struct PP_Flash_Menu* menu_data) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_Menu\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance_id", ToString_PP_Instance(instance_id)); + AddProp(ss, "menu_data", ToString_PP_Flash_Menu(menu_data)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_Menu_0_2*)RealGetInterface("PPB_Flash_Menu;0.2"))->Create(instance_id, menu_data); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsFlashMenu_0_2(PP_Resource resource_id) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_Menu\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"IsFlashMenu\""); + AddProp(ss, "resource_id", ToString_PP_Resource(resource_id)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Flash_Menu_0_2*)RealGetInterface("PPB_Flash_Menu;0.2"))->IsFlashMenu(resource_id); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Show_0_2(PP_Resource menu_id, const struct PP_Point* location, int32_t* selected_id, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_Menu\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"Show\""); + AddProp(ss, "menu_id", ToString_PP_Resource(menu_id)); + AddProp(ss, "location", ToString_PP_Point(location)); + AddProp(ss, "selected_id", PointerToString(selected_id)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_int32_t(iterator, *selected_id); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_Flash_Menu_0_2*)RealGetInterface("PPB_Flash_Menu;0.2"))->Show(menu_id, location, selected_id, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!selected_id) { + AddProp(os, "selected_id", ToString_int32_t(selected_id)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_Flash_Menu_0_2 _PPB_Flash_Menu_0_2 = { + ns_PPB_Flash_Menu_0_2::Create_0_2, + ns_PPB_Flash_Menu_0_2::IsFlashMenu_0_2, + ns_PPB_Flash_Menu_0_2::Show_0_2, +}; +const string ToString_PPB_Flash_Menu(const PPB_Flash_Menu_0_2 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Flash_MessageLoop_0_1 { +static PP_Resource Create_0_1(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_MessageLoop\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_MessageLoop_0_1*)RealGetInterface("PPB_Flash_MessageLoop;0.1"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsFlashMessageLoop_0_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_MessageLoop\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"IsFlashMessageLoop\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Flash_MessageLoop_0_1*)RealGetInterface("PPB_Flash_MessageLoop;0.1"))->IsFlashMessageLoop(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Run_0_1(PP_Resource flash_message_loop) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_MessageLoop\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Run\""); + AddProp(ss, "flash_message_loop", ToString_PP_Resource(flash_message_loop)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_Flash_MessageLoop_0_1*)RealGetInterface("PPB_Flash_MessageLoop;0.1"))->Run(flash_message_loop); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void Quit_0_1(PP_Resource flash_message_loop) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_MessageLoop\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Quit\""); + AddProp(ss, "flash_message_loop", ToString_PP_Resource(flash_message_loop)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Flash_MessageLoop_0_1*)RealGetInterface("PPB_Flash_MessageLoop;0.1"))->Quit(flash_message_loop); +#endif // !INTERPOSE +} +} +static PPB_Flash_MessageLoop_0_1 _PPB_Flash_MessageLoop_0_1 = { + ns_PPB_Flash_MessageLoop_0_1::Create_0_1, + ns_PPB_Flash_MessageLoop_0_1::IsFlashMessageLoop_0_1, + ns_PPB_Flash_MessageLoop_0_1::Run_0_1, + ns_PPB_Flash_MessageLoop_0_1::Quit_0_1, +}; +const string ToString_PPB_Flash_MessageLoop(const PPB_Flash_MessageLoop_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Flash_Print_1_0 { +static void InvokePrinting_1_0(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Flash_Print\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"InvokePrinting\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Flash_Print_1_0*)RealGetInterface("PPB_Flash_Print;1.0"))->InvokePrinting(instance); +#endif // !INTERPOSE +} +} +static PPB_Flash_Print_1_0 _PPB_Flash_Print_1_0 = { + ns_PPB_Flash_Print_1_0::InvokePrinting_1_0, +}; +const string ToString_PPB_Flash_Print(const PPB_Flash_Print_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_HostResolver_Private_Flags(const PP_HostResolver_Private_Flags *v) { + switch (*v) { + case 1 << 0: + return "\"PP_HOST_RESOLVER_PRIVATE_FLAGS_CANONNAME\""; + case 1 << 1: + return "\"PP_HOST_RESOLVER_PRIVATE_FLAGS_LOOPBACK_ONLY\""; + default: + return "\"???\""; + } +} +const string ToString_PP_HostResolver_Private_Flags(const PP_HostResolver_Private_Flags &v) { + return ToString_PP_HostResolver_Private_Flags(&v); +} +void FromJSON_PP_HostResolver_Private_Flags(JSONIterator& iterator, PP_HostResolver_Private_Flags &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_HostResolver_Private_Flags(v); +} +const string ToString_PP_HostResolver_Private_Hint(const PP_HostResolver_Private_Hint *v) { + if (!v) { + return "null"; + } + return ToString_PP_HostResolver_Private_Hint(*v); +} +const string ToString_PP_HostResolver_Private_Hint(const PP_HostResolver_Private_Hint &v) { + stringstream x; + BeginProps(x); + AddProp(x, "family", ToString_PP_NetAddressFamily_Private(v.family)); + AddProp(x, "flags", ToString_int32_t(v.flags)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_HostResolver_Private_Hint(JSONIterator& iterator, PP_HostResolver_Private_Hint &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_PP_NetAddressFamily_Private(iterator, value.family); + iterator.skip(); + FromJSON_int32_t(iterator, value.flags); +} +namespace ns_PPB_HostResolver_Private_0_1 { +static PP_Resource Create_0_1(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_HostResolver_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_HostResolver_Private_0_1*)RealGetInterface("PPB_HostResolver_Private;0.1"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsHostResolver_0_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_HostResolver_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"IsHostResolver\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_HostResolver_Private_0_1*)RealGetInterface("PPB_HostResolver_Private;0.1"))->IsHostResolver(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Resolve_0_1(PP_Resource host_resolver, const char* host, uint16_t port, const struct PP_HostResolver_Private_Hint* hint, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_HostResolver_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Resolve\""); + AddProp(ss, "host_resolver", ToString_PP_Resource(host_resolver)); + AddProp(ss, "host", ToString_str_t(host)); + AddProp(ss, "port", ToString_uint16_t(port)); + AddProp(ss, "hint", ToString_PP_HostResolver_Private_Hint(hint)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_HostResolver_Private_0_1*)RealGetInterface("PPB_HostResolver_Private;0.1"))->Resolve(host_resolver, host, port, hint, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetCanonicalName_0_1(PP_Resource host_resolver) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_HostResolver_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetCanonicalName\""); + AddProp(ss, "host_resolver", ToString_PP_Resource(host_resolver)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_HostResolver_Private_0_1*)RealGetInterface("PPB_HostResolver_Private;0.1"))->GetCanonicalName(host_resolver); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint32_t GetSize_0_1(PP_Resource host_resolver) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_HostResolver_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetSize\""); + AddProp(ss, "host_resolver", ToString_PP_Resource(host_resolver)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint32_t rval = ((PPB_HostResolver_Private_0_1*)RealGetInterface("PPB_HostResolver_Private;0.1"))->GetSize(host_resolver); + printf("RPC response: ["); + printf("%s", ToString_uint32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetNetAddress_0_1(PP_Resource host_resolver, uint32_t index, struct PP_NetAddress_Private* addr) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_HostResolver_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetNetAddress\""); + AddProp(ss, "host_resolver", ToString_PP_Resource(host_resolver)); + AddProp(ss, "index", ToString_uint32_t(index)); + AddProp(ss, "addr", PointerToString(addr)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!addr) { + iterator.skip(); + FromJSON_PP_NetAddress_Private(iterator, *addr); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_HostResolver_Private_0_1*)RealGetInterface("PPB_HostResolver_Private;0.1"))->GetNetAddress(host_resolver, index, addr); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!addr) { + AddProp(os, "addr", ToString_PP_NetAddress_Private(addr)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_HostResolver_Private_0_1 _PPB_HostResolver_Private_0_1 = { + ns_PPB_HostResolver_Private_0_1::Create_0_1, + ns_PPB_HostResolver_Private_0_1::IsHostResolver_0_1, + ns_PPB_HostResolver_Private_0_1::Resolve_0_1, + ns_PPB_HostResolver_Private_0_1::GetCanonicalName_0_1, + ns_PPB_HostResolver_Private_0_1::GetSize_0_1, + ns_PPB_HostResolver_Private_0_1::GetNetAddress_0_1, +}; +const string ToString_PPB_HostResolver_Private(const PPB_HostResolver_Private_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_ExternalPluginResult(const PP_ExternalPluginResult *v) { + switch (*v) { + case 0: + return "\"PP_EXTERNAL_PLUGIN_OK\""; + case 1: + return "\"PP_EXTERNAL_PLUGIN_FAILED\""; + case 2: + return "\"PP_EXTERNAL_PLUGIN_ERROR_MODULE\""; + case 3: + return "\"PP_EXTERNAL_PLUGIN_ERROR_INSTANCE\""; + default: + return "\"???\""; + } +} +const string ToString_PP_ExternalPluginResult(const PP_ExternalPluginResult &v) { + return ToString_PP_ExternalPluginResult(&v); +} +void FromJSON_PP_ExternalPluginResult(JSONIterator& iterator, PP_ExternalPluginResult &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_ExternalPluginResult(v); +} +namespace ns_PPB_Instance_Private_0_1 { +static struct PP_Var GetWindowObject_0_1(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Instance_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetWindowObject\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Instance_Private_0_1*)RealGetInterface("PPB_Instance_Private;0.1"))->GetWindowObject(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetOwnerElementObject_0_1(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Instance_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetOwnerElementObject\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Instance_Private_0_1*)RealGetInterface("PPB_Instance_Private;0.1"))->GetOwnerElementObject(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var ExecuteScript_0_1(PP_Instance instance, struct PP_Var script, struct PP_Var* exception) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Instance_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"ExecuteScript\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "script", ToString_PP_Var(script)); + AddProp(ss, "exception", PointerToString(exception)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Var(iterator, *exception); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Instance_Private_0_1*)RealGetInterface("PPB_Instance_Private;0.1"))->ExecuteScript(instance, script, exception); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!exception) { + AddProp(os, "exception", ToString_PP_Var(exception)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_Instance_Private_0_1 _PPB_Instance_Private_0_1 = { + ns_PPB_Instance_Private_0_1::GetWindowObject_0_1, + ns_PPB_Instance_Private_0_1::GetOwnerElementObject_0_1, + ns_PPB_Instance_Private_0_1::ExecuteScript_0_1, +}; +const string ToString_PPB_Instance_Private(const PPB_Instance_Private_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_IsolatedFileSystemType_Private(const PP_IsolatedFileSystemType_Private *v) { + switch (*v) { + case 0: + return "\"PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_INVALID\""; + case 1: + return "\"PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_CRX\""; + case 2: + return "\"PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_PLUGINPRIVATE\""; + default: + return "\"???\""; + } +} +const string ToString_PP_IsolatedFileSystemType_Private(const PP_IsolatedFileSystemType_Private &v) { + return ToString_PP_IsolatedFileSystemType_Private(&v); +} +void FromJSON_PP_IsolatedFileSystemType_Private(JSONIterator& iterator, PP_IsolatedFileSystemType_Private &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_IsolatedFileSystemType_Private(v); +} +namespace ns_PPB_IsolatedFileSystem_Private_0_2 { +static int32_t Open_0_2(PP_Instance instance, PP_IsolatedFileSystemType_Private type, PP_Resource* file_system, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_IsolatedFileSystem_Private\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"Open\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "type", ToString_PP_IsolatedFileSystemType_Private(type)); + AddProp(ss, "file_system", PointerToString(file_system)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Resource(iterator, *file_system); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_IsolatedFileSystem_Private_0_2*)RealGetInterface("PPB_IsolatedFileSystem_Private;0.2"))->Open(instance, type, file_system, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!file_system) { + AddProp(os, "file_system", ToString_PP_Resource(file_system)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_IsolatedFileSystem_Private_0_2 _PPB_IsolatedFileSystem_Private_0_2 = { + ns_PPB_IsolatedFileSystem_Private_0_2::Open_0_2, +}; +const string ToString_PPB_IsolatedFileSystem_Private(const PPB_IsolatedFileSystem_Private_0_2 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_NetAddressFamily_Private(const PP_NetAddressFamily_Private *v) { + switch (*v) { + case 0: + return "\"PP_NETADDRESSFAMILY_PRIVATE_UNSPECIFIED\""; + case 1: + return "\"PP_NETADDRESSFAMILY_PRIVATE_IPV4\""; + case 2: + return "\"PP_NETADDRESSFAMILY_PRIVATE_IPV6\""; + default: + return "\"???\""; + } +} +const string ToString_PP_NetAddressFamily_Private(const PP_NetAddressFamily_Private &v) { + return ToString_PP_NetAddressFamily_Private(&v); +} +void FromJSON_PP_NetAddressFamily_Private(JSONIterator& iterator, PP_NetAddressFamily_Private &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_NetAddressFamily_Private(v); +} +const string ToString_PP_NetAddress_Private(const PP_NetAddress_Private *v) { + if (!v) { + return "null"; + } + return ToString_PP_NetAddress_Private(*v); +} +const string ToString_PP_NetAddress_Private(const PP_NetAddress_Private &v) { + stringstream x; + BeginProps(x); + AddProp(x, "size", ToString_uint32_t(v.size)); + { + BeginProp(x, "data"); + BeginElements(x); + for (uint32_t _n = 0; _n < 128; ++_n) { + AddElement(x, ToString_int8_t(v.data[_n])); + } + EndElements(x); + } + EndProps(x); + return x.str(); +} +void FromJSON_PP_NetAddress_Private(JSONIterator& iterator, PP_NetAddress_Private &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_uint32_t(iterator, value.size); + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > 128) { + Fail("Too many items in array\n", ""); + } + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_int8_t(iterator, (value.data)[_n]); + } + // FIXME Null out remaining items? + } +} +namespace ns_PPB_NetAddress_Private_0_1 { +static PP_Bool AreEqual_0_1(const struct PP_NetAddress_Private* addr1, const struct PP_NetAddress_Private* addr2) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"AreEqual\""); + AddProp(ss, "addr1", ToString_PP_NetAddress_Private(addr1)); + AddProp(ss, "addr2", ToString_PP_NetAddress_Private(addr2)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_NetAddress_Private_0_1*)RealGetInterface("PPB_NetAddress_Private;0.1"))->AreEqual(addr1, addr2); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool AreHostsEqual_0_1(const struct PP_NetAddress_Private* addr1, const struct PP_NetAddress_Private* addr2) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"AreHostsEqual\""); + AddProp(ss, "addr1", ToString_PP_NetAddress_Private(addr1)); + AddProp(ss, "addr2", ToString_PP_NetAddress_Private(addr2)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_NetAddress_Private_0_1*)RealGetInterface("PPB_NetAddress_Private;0.1"))->AreHostsEqual(addr1, addr2); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var Describe_0_1(PP_Module module, const struct PP_NetAddress_Private* addr, PP_Bool include_port) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Describe\""); + AddProp(ss, "module", ToString_PP_Module(module)); + AddProp(ss, "addr", ToString_PP_NetAddress_Private(addr)); + AddProp(ss, "include_port", ToString_PP_Bool(include_port)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_NetAddress_Private_0_1*)RealGetInterface("PPB_NetAddress_Private;0.1"))->Describe(module, addr, include_port); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool ReplacePort_0_1(const struct PP_NetAddress_Private* src_addr, uint16_t port, struct PP_NetAddress_Private* addr_out) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"ReplacePort\""); + AddProp(ss, "src_addr", ToString_PP_NetAddress_Private(src_addr)); + AddProp(ss, "port", ToString_uint16_t(port)); + AddProp(ss, "addr_out", PointerToString(addr_out)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!addr_out) { + iterator.skip(); + FromJSON_PP_NetAddress_Private(iterator, *addr_out); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_NetAddress_Private_0_1*)RealGetInterface("PPB_NetAddress_Private;0.1"))->ReplacePort(src_addr, port, addr_out); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!addr_out) { + AddProp(os, "addr_out", ToString_PP_NetAddress_Private(addr_out)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void GetAnyAddress_0_1(PP_Bool is_ipv6, struct PP_NetAddress_Private* addr) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetAnyAddress\""); + AddProp(ss, "is_ipv6", ToString_PP_Bool(is_ipv6)); + AddProp(ss, "addr", PointerToString(addr)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + if (!!addr) { + iterator.skip(); + FromJSON_PP_NetAddress_Private(iterator, *addr); + } +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_NetAddress_Private_0_1*)RealGetInterface("PPB_NetAddress_Private;0.1"))->GetAnyAddress(is_ipv6, addr); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + if (!!addr) { + AddProp(os, "addr", ToString_PP_NetAddress_Private(addr)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +/* skipping GetFamily */ +/* skipping GetPort */ +/* skipping GetAddress */ +/* skipping GetScopeID */ +/* skipping CreateFromIPv4Address */ +/* skipping CreateFromIPv6Address */ +} +static PPB_NetAddress_Private_0_1 _PPB_NetAddress_Private_0_1 = { + ns_PPB_NetAddress_Private_0_1::AreEqual_0_1, + ns_PPB_NetAddress_Private_0_1::AreHostsEqual_0_1, + ns_PPB_NetAddress_Private_0_1::Describe_0_1, + ns_PPB_NetAddress_Private_0_1::ReplacePort_0_1, + ns_PPB_NetAddress_Private_0_1::GetAnyAddress_0_1, +}; +const string ToString_PPB_NetAddress_Private(const PPB_NetAddress_Private_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_NetAddress_Private_1_0 { +static PP_Bool AreEqual_1_0(const struct PP_NetAddress_Private* addr1, const struct PP_NetAddress_Private* addr2) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress_Private\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"AreEqual\""); + AddProp(ss, "addr1", ToString_PP_NetAddress_Private(addr1)); + AddProp(ss, "addr2", ToString_PP_NetAddress_Private(addr2)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_NetAddress_Private_1_0*)RealGetInterface("PPB_NetAddress_Private;1.0"))->AreEqual(addr1, addr2); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool AreHostsEqual_1_0(const struct PP_NetAddress_Private* addr1, const struct PP_NetAddress_Private* addr2) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress_Private\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"AreHostsEqual\""); + AddProp(ss, "addr1", ToString_PP_NetAddress_Private(addr1)); + AddProp(ss, "addr2", ToString_PP_NetAddress_Private(addr2)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_NetAddress_Private_1_0*)RealGetInterface("PPB_NetAddress_Private;1.0"))->AreHostsEqual(addr1, addr2); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var Describe_1_0(PP_Module module, const struct PP_NetAddress_Private* addr, PP_Bool include_port) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress_Private\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"Describe\""); + AddProp(ss, "module", ToString_PP_Module(module)); + AddProp(ss, "addr", ToString_PP_NetAddress_Private(addr)); + AddProp(ss, "include_port", ToString_PP_Bool(include_port)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_NetAddress_Private_1_0*)RealGetInterface("PPB_NetAddress_Private;1.0"))->Describe(module, addr, include_port); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool ReplacePort_1_0(const struct PP_NetAddress_Private* src_addr, uint16_t port, struct PP_NetAddress_Private* addr_out) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress_Private\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"ReplacePort\""); + AddProp(ss, "src_addr", ToString_PP_NetAddress_Private(src_addr)); + AddProp(ss, "port", ToString_uint16_t(port)); + AddProp(ss, "addr_out", PointerToString(addr_out)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!addr_out) { + iterator.skip(); + FromJSON_PP_NetAddress_Private(iterator, *addr_out); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_NetAddress_Private_1_0*)RealGetInterface("PPB_NetAddress_Private;1.0"))->ReplacePort(src_addr, port, addr_out); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!addr_out) { + AddProp(os, "addr_out", ToString_PP_NetAddress_Private(addr_out)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void GetAnyAddress_1_0(PP_Bool is_ipv6, struct PP_NetAddress_Private* addr) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress_Private\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetAnyAddress\""); + AddProp(ss, "is_ipv6", ToString_PP_Bool(is_ipv6)); + AddProp(ss, "addr", PointerToString(addr)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + if (!!addr) { + iterator.skip(); + FromJSON_PP_NetAddress_Private(iterator, *addr); + } +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_NetAddress_Private_1_0*)RealGetInterface("PPB_NetAddress_Private;1.0"))->GetAnyAddress(is_ipv6, addr); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + if (!!addr) { + AddProp(os, "addr", ToString_PP_NetAddress_Private(addr)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static PP_NetAddressFamily_Private GetFamily_1_0(const struct PP_NetAddress_Private* addr) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress_Private\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetFamily\""); + AddProp(ss, "addr", ToString_PP_NetAddress_Private(addr)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_NetAddressFamily_Private rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_NetAddressFamily_Private(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_NetAddressFamily_Private rval = ((PPB_NetAddress_Private_1_0*)RealGetInterface("PPB_NetAddress_Private;1.0"))->GetFamily(addr); + printf("RPC response: ["); + printf("%s", ToString_PP_NetAddressFamily_Private(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint16_t GetPort_1_0(const struct PP_NetAddress_Private* addr) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress_Private\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetPort\""); + AddProp(ss, "addr", ToString_PP_NetAddress_Private(addr)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint16_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint16_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint16_t rval = ((PPB_NetAddress_Private_1_0*)RealGetInterface("PPB_NetAddress_Private;1.0"))->GetPort(addr); + printf("RPC response: ["); + printf("%s", ToString_uint16_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetAddress_1_0(const struct PP_NetAddress_Private* addr, void* address, uint16_t address_size) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress_Private\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetAddress\""); + AddProp(ss, "addr", ToString_PP_NetAddress_Private(addr)); + AddProp(ss, "address", PointerToString(address)); + AddProp(ss, "address_size", ToString_uint16_t(address_size)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_mem_t(iterator, address); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_NetAddress_Private_1_0*)RealGetInterface("PPB_NetAddress_Private;1.0"))->GetAddress(addr, address, address_size); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + AddProp(os, "address", ToString_mem_t(address)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping GetScopeID */ +/* skipping CreateFromIPv4Address */ +/* skipping CreateFromIPv6Address */ +} +static PPB_NetAddress_Private_1_0 _PPB_NetAddress_Private_1_0 = { + ns_PPB_NetAddress_Private_1_0::AreEqual_1_0, + ns_PPB_NetAddress_Private_1_0::AreHostsEqual_1_0, + ns_PPB_NetAddress_Private_1_0::Describe_1_0, + ns_PPB_NetAddress_Private_1_0::ReplacePort_1_0, + ns_PPB_NetAddress_Private_1_0::GetAnyAddress_1_0, + ns_PPB_NetAddress_Private_1_0::GetFamily_1_0, + ns_PPB_NetAddress_Private_1_0::GetPort_1_0, + ns_PPB_NetAddress_Private_1_0::GetAddress_1_0, +}; +const string ToString_PPB_NetAddress_Private(const PPB_NetAddress_Private_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_NetAddress_Private_1_1 { +static PP_Bool AreEqual_1_1(const struct PP_NetAddress_Private* addr1, const struct PP_NetAddress_Private* addr2) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress_Private\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"AreEqual\""); + AddProp(ss, "addr1", ToString_PP_NetAddress_Private(addr1)); + AddProp(ss, "addr2", ToString_PP_NetAddress_Private(addr2)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_NetAddress_Private_1_1*)RealGetInterface("PPB_NetAddress_Private;1.1"))->AreEqual(addr1, addr2); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool AreHostsEqual_1_1(const struct PP_NetAddress_Private* addr1, const struct PP_NetAddress_Private* addr2) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress_Private\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"AreHostsEqual\""); + AddProp(ss, "addr1", ToString_PP_NetAddress_Private(addr1)); + AddProp(ss, "addr2", ToString_PP_NetAddress_Private(addr2)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_NetAddress_Private_1_1*)RealGetInterface("PPB_NetAddress_Private;1.1"))->AreHostsEqual(addr1, addr2); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var Describe_1_1(PP_Module module, const struct PP_NetAddress_Private* addr, PP_Bool include_port) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress_Private\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"Describe\""); + AddProp(ss, "module", ToString_PP_Module(module)); + AddProp(ss, "addr", ToString_PP_NetAddress_Private(addr)); + AddProp(ss, "include_port", ToString_PP_Bool(include_port)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_NetAddress_Private_1_1*)RealGetInterface("PPB_NetAddress_Private;1.1"))->Describe(module, addr, include_port); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool ReplacePort_1_1(const struct PP_NetAddress_Private* src_addr, uint16_t port, struct PP_NetAddress_Private* addr_out) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress_Private\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"ReplacePort\""); + AddProp(ss, "src_addr", ToString_PP_NetAddress_Private(src_addr)); + AddProp(ss, "port", ToString_uint16_t(port)); + AddProp(ss, "addr_out", PointerToString(addr_out)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!addr_out) { + iterator.skip(); + FromJSON_PP_NetAddress_Private(iterator, *addr_out); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_NetAddress_Private_1_1*)RealGetInterface("PPB_NetAddress_Private;1.1"))->ReplacePort(src_addr, port, addr_out); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!addr_out) { + AddProp(os, "addr_out", ToString_PP_NetAddress_Private(addr_out)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void GetAnyAddress_1_1(PP_Bool is_ipv6, struct PP_NetAddress_Private* addr) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress_Private\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"GetAnyAddress\""); + AddProp(ss, "is_ipv6", ToString_PP_Bool(is_ipv6)); + AddProp(ss, "addr", PointerToString(addr)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + if (!!addr) { + iterator.skip(); + FromJSON_PP_NetAddress_Private(iterator, *addr); + } +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_NetAddress_Private_1_1*)RealGetInterface("PPB_NetAddress_Private;1.1"))->GetAnyAddress(is_ipv6, addr); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + if (!!addr) { + AddProp(os, "addr", ToString_PP_NetAddress_Private(addr)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static PP_NetAddressFamily_Private GetFamily_1_1(const struct PP_NetAddress_Private* addr) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress_Private\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"GetFamily\""); + AddProp(ss, "addr", ToString_PP_NetAddress_Private(addr)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_NetAddressFamily_Private rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_NetAddressFamily_Private(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_NetAddressFamily_Private rval = ((PPB_NetAddress_Private_1_1*)RealGetInterface("PPB_NetAddress_Private;1.1"))->GetFamily(addr); + printf("RPC response: ["); + printf("%s", ToString_PP_NetAddressFamily_Private(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint16_t GetPort_1_1(const struct PP_NetAddress_Private* addr) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress_Private\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"GetPort\""); + AddProp(ss, "addr", ToString_PP_NetAddress_Private(addr)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint16_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint16_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint16_t rval = ((PPB_NetAddress_Private_1_1*)RealGetInterface("PPB_NetAddress_Private;1.1"))->GetPort(addr); + printf("RPC response: ["); + printf("%s", ToString_uint16_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetAddress_1_1(const struct PP_NetAddress_Private* addr, void* address, uint16_t address_size) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress_Private\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"GetAddress\""); + AddProp(ss, "addr", ToString_PP_NetAddress_Private(addr)); + AddProp(ss, "address", PointerToString(address)); + AddProp(ss, "address_size", ToString_uint16_t(address_size)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_mem_t(iterator, address); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_NetAddress_Private_1_1*)RealGetInterface("PPB_NetAddress_Private;1.1"))->GetAddress(addr, address, address_size); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + AddProp(os, "address", ToString_mem_t(address)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint32_t GetScopeID_1_1(const struct PP_NetAddress_Private* addr) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress_Private\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"GetScopeID\""); + AddProp(ss, "addr", ToString_PP_NetAddress_Private(addr)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint32_t rval = ((PPB_NetAddress_Private_1_1*)RealGetInterface("PPB_NetAddress_Private;1.1"))->GetScopeID(addr); + printf("RPC response: ["); + printf("%s", ToString_uint32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void CreateFromIPv4Address_1_1(const uint8_t ip[4], uint16_t port, struct PP_NetAddress_Private* addr_out) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress_Private\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"CreateFromIPv4Address\""); + { + BeginProp(ss, "ip"); + BeginElements(ss); + for (uint32_t _n = 0; _n < 4; ++_n) { + AddElement(ss, ToString_uint8_t(ip[_n])); + } + EndElements(ss); + } + AddProp(ss, "port", ToString_uint16_t(port)); + AddProp(ss, "addr_out", PointerToString(addr_out)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + if (!!addr_out) { + iterator.skip(); + FromJSON_PP_NetAddress_Private(iterator, *addr_out); + } +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_NetAddress_Private_1_1*)RealGetInterface("PPB_NetAddress_Private;1.1"))->CreateFromIPv4Address(ip, port, addr_out); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + if (!!addr_out) { + AddProp(os, "addr_out", ToString_PP_NetAddress_Private(addr_out)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void CreateFromIPv6Address_1_1(const uint8_t ip[16], uint32_t scope_id, uint16_t port, struct PP_NetAddress_Private* addr_out) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_NetAddress_Private\""); + AddProp(ss, "__version", "\"1.1\""); + AddProp(ss, "__method", "\"CreateFromIPv6Address\""); + { + BeginProp(ss, "ip"); + BeginElements(ss); + for (uint32_t _n = 0; _n < 16; ++_n) { + AddElement(ss, ToString_uint8_t(ip[_n])); + } + EndElements(ss); + } + AddProp(ss, "scope_id", ToString_uint32_t(scope_id)); + AddProp(ss, "port", ToString_uint16_t(port)); + AddProp(ss, "addr_out", PointerToString(addr_out)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + if (!!addr_out) { + iterator.skip(); + FromJSON_PP_NetAddress_Private(iterator, *addr_out); + } +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_NetAddress_Private_1_1*)RealGetInterface("PPB_NetAddress_Private;1.1"))->CreateFromIPv6Address(ip, scope_id, port, addr_out); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + if (!!addr_out) { + AddProp(os, "addr_out", ToString_PP_NetAddress_Private(addr_out)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +} +static PPB_NetAddress_Private_1_1 _PPB_NetAddress_Private_1_1 = { + ns_PPB_NetAddress_Private_1_1::AreEqual_1_1, + ns_PPB_NetAddress_Private_1_1::AreHostsEqual_1_1, + ns_PPB_NetAddress_Private_1_1::Describe_1_1, + ns_PPB_NetAddress_Private_1_1::ReplacePort_1_1, + ns_PPB_NetAddress_Private_1_1::GetAnyAddress_1_1, + ns_PPB_NetAddress_Private_1_1::GetFamily_1_1, + ns_PPB_NetAddress_Private_1_1::GetPort_1_1, + ns_PPB_NetAddress_Private_1_1::GetAddress_1_1, + ns_PPB_NetAddress_Private_1_1::GetScopeID_1_1, + ns_PPB_NetAddress_Private_1_1::CreateFromIPv4Address_1_1, + ns_PPB_NetAddress_Private_1_1::CreateFromIPv6Address_1_1, +}; +const string ToString_PPB_NetAddress_Private(const PPB_NetAddress_Private_1_1 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_OutputProtectionMethod_Private(const PP_OutputProtectionMethod_Private *v) { + switch (*v) { + case 0: + return "\"PP_OUTPUT_PROTECTION_METHOD_PRIVATE_NONE\""; + case 1 << 0: + return "\"PP_OUTPUT_PROTECTION_METHOD_PRIVATE_HDCP\""; + default: + return "\"???\""; + } +} +const string ToString_PP_OutputProtectionMethod_Private(const PP_OutputProtectionMethod_Private &v) { + return ToString_PP_OutputProtectionMethod_Private(&v); +} +void FromJSON_PP_OutputProtectionMethod_Private(JSONIterator& iterator, PP_OutputProtectionMethod_Private &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_OutputProtectionMethod_Private(v); +} +const string ToString_PP_OutputProtectionLinkType_Private(const PP_OutputProtectionLinkType_Private *v) { + switch (*v) { + case 0: + return "\"PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_NONE\""; + case 1 << 0: + return "\"PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_UNKNOWN\""; + case 1 << 1: + return "\"PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_INTERNAL\""; + case 1 << 2: + return "\"PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_VGA\""; + case 1 << 3: + return "\"PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_HDMI\""; + case 1 << 4: + return "\"PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_DVI\""; + case 1 << 5: + return "\"PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_DISPLAYPORT\""; + case 1 << 6: + return "\"PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_NETWORK\""; + default: + return "\"???\""; + } +} +const string ToString_PP_OutputProtectionLinkType_Private(const PP_OutputProtectionLinkType_Private &v) { + return ToString_PP_OutputProtectionLinkType_Private(&v); +} +void FromJSON_PP_OutputProtectionLinkType_Private(JSONIterator& iterator, PP_OutputProtectionLinkType_Private &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_OutputProtectionLinkType_Private(v); +} +namespace ns_PPB_OutputProtection_Private_0_1 { +static PP_Resource Create_0_1(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OutputProtection_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_OutputProtection_Private_0_1*)RealGetInterface("PPB_OutputProtection_Private;0.1"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsOutputProtection_0_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OutputProtection_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"IsOutputProtection\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_OutputProtection_Private_0_1*)RealGetInterface("PPB_OutputProtection_Private;0.1"))->IsOutputProtection(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t QueryStatus_0_1(PP_Resource resource, uint32_t* link_mask, uint32_t* protection_mask, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OutputProtection_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"QueryStatus\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + AddProp(ss, "link_mask", PointerToString(link_mask)); + AddProp(ss, "protection_mask", PointerToString(protection_mask)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_uint32_t(iterator, *link_mask); + iterator.skip(); + FromJSON_uint32_t(iterator, *protection_mask); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_OutputProtection_Private_0_1*)RealGetInterface("PPB_OutputProtection_Private;0.1"))->QueryStatus(resource, link_mask, protection_mask, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!link_mask) { + AddProp(os, "link_mask", ToString_uint32_t(link_mask)); + } + if (!!protection_mask) { + AddProp(os, "protection_mask", ToString_uint32_t(protection_mask)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t EnableProtection_0_1(PP_Resource resource, uint32_t desired_protection_mask, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_OutputProtection_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"EnableProtection\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + AddProp(ss, "desired_protection_mask", ToString_uint32_t(desired_protection_mask)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_OutputProtection_Private_0_1*)RealGetInterface("PPB_OutputProtection_Private;0.1"))->EnableProtection(resource, desired_protection_mask, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_OutputProtection_Private_0_1 _PPB_OutputProtection_Private_0_1 = { + ns_PPB_OutputProtection_Private_0_1::Create_0_1, + ns_PPB_OutputProtection_Private_0_1::IsOutputProtection_0_1, + ns_PPB_OutputProtection_Private_0_1::QueryStatus_0_1, + ns_PPB_OutputProtection_Private_0_1::EnableProtection_0_1, +}; +const string ToString_PPB_OutputProtection_Private(const PPB_OutputProtection_Private_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_PDFFeature(const PP_PDFFeature *v) { + switch (*v) { + case 0: + return "\"PP_PDFFEATURE_HIDPI\""; + case 1: + return "\"PP_PDFFEATURE_PRINTING\""; + default: + return "\"???\""; + } +} +const string ToString_PP_PDFFeature(const PP_PDFFeature &v) { + return ToString_PP_PDFFeature(&v); +} +void FromJSON_PP_PDFFeature(JSONIterator& iterator, PP_PDFFeature &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_PDFFeature(v); +} +const string ToString_PP_PrivateFontFileDescription(const PP_PrivateFontFileDescription *v) { + if (!v) { + return "null"; + } + return ToString_PP_PrivateFontFileDescription(*v); +} +const string ToString_PP_PrivateFontFileDescription(const PP_PrivateFontFileDescription &v) { + stringstream x; + BeginProps(x); + AddProp(x, "face", ToString_str_t(v.face)); + AddProp(x, "weight", ToString_uint32_t(v.weight)); + AddProp(x, "italic", ToString_PP_Bool(v.italic)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_PrivateFontFileDescription(JSONIterator& iterator, PP_PrivateFontFileDescription &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_str_t(iterator, value.face); + iterator.skip(); + FromJSON_uint32_t(iterator, value.weight); + iterator.skip(); + FromJSON_PP_Bool(iterator, value.italic); +} +const string ToString_PP_PrivateFindResult(const PP_PrivateFindResult *v) { + if (!v) { + return "null"; + } + return ToString_PP_PrivateFindResult(*v); +} +const string ToString_PP_PrivateFindResult(const PP_PrivateFindResult &v) { + stringstream x; + BeginProps(x); + AddProp(x, "start_index", ToString_int32_t(v.start_index)); + AddProp(x, "length", ToString_int32_t(v.length)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_PrivateFindResult(JSONIterator& iterator, PP_PrivateFindResult &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_int32_t(iterator, value.start_index); + iterator.skip(); + FromJSON_int32_t(iterator, value.length); +} +const string ToString_PP_PrivateAccessibilityViewportInfo(const PP_PrivateAccessibilityViewportInfo *v) { + if (!v) { + return "null"; + } + return ToString_PP_PrivateAccessibilityViewportInfo(*v); +} +const string ToString_PP_PrivateAccessibilityViewportInfo(const PP_PrivateAccessibilityViewportInfo &v) { + stringstream x; + BeginProps(x); + AddProp(x, "zoom", ToString_double_t(v.zoom)); + AddProp(x, "scroll", ToString_PP_Point(v.scroll)); + AddProp(x, "offset", ToString_PP_Point(v.offset)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_PrivateAccessibilityViewportInfo(JSONIterator& iterator, PP_PrivateAccessibilityViewportInfo &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_double_t(iterator, value.zoom); + iterator.skip(); + FromJSON_PP_Point(iterator, value.scroll); + iterator.skip(); + FromJSON_PP_Point(iterator, value.offset); +} +const string ToString_PP_PrivateAccessibilityDocInfo(const PP_PrivateAccessibilityDocInfo *v) { + if (!v) { + return "null"; + } + return ToString_PP_PrivateAccessibilityDocInfo(*v); +} +const string ToString_PP_PrivateAccessibilityDocInfo(const PP_PrivateAccessibilityDocInfo &v) { + stringstream x; + BeginProps(x); + AddProp(x, "page_count", ToString_uint32_t(v.page_count)); + AddProp(x, "text_accessible", ToString_PP_Bool(v.text_accessible)); + AddProp(x, "text_copyable", ToString_PP_Bool(v.text_copyable)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_PrivateAccessibilityDocInfo(JSONIterator& iterator, PP_PrivateAccessibilityDocInfo &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_uint32_t(iterator, value.page_count); + iterator.skip(); + FromJSON_PP_Bool(iterator, value.text_accessible); + iterator.skip(); + FromJSON_PP_Bool(iterator, value.text_copyable); +} +const string ToString_PP_PrivateDirection(const PP_PrivateDirection *v) { + switch (*v) { + case 0: + return "\"PP_PRIVATEDIRECTION_NONE\""; + case 1: + return "\"PP_PRIVATEDIRECTION_LTR\""; + case 2: + return "\"PP_PRIVATEDIRECTION_RTL\""; + case 3: + return "\"PP_PRIVATEDIRECTION_TTB\""; + case 4: + return "\"PP_PRIVATEDIRECTION_BTT\""; + default: + return "\"???\""; + } +} +const string ToString_PP_PrivateDirection(const PP_PrivateDirection &v) { + return ToString_PP_PrivateDirection(&v); +} +void FromJSON_PP_PrivateDirection(JSONIterator& iterator, PP_PrivateDirection &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_PrivateDirection(v); +} +const string ToString_PP_PrivateAccessibilityPageInfo(const PP_PrivateAccessibilityPageInfo *v) { + if (!v) { + return "null"; + } + return ToString_PP_PrivateAccessibilityPageInfo(*v); +} +const string ToString_PP_PrivateAccessibilityPageInfo(const PP_PrivateAccessibilityPageInfo &v) { + stringstream x; + BeginProps(x); + AddProp(x, "page_index", ToString_uint32_t(v.page_index)); + AddProp(x, "bounds", ToString_PP_Rect(v.bounds)); + AddProp(x, "text_run_count", ToString_uint32_t(v.text_run_count)); + AddProp(x, "char_count", ToString_uint32_t(v.char_count)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_PrivateAccessibilityPageInfo(JSONIterator& iterator, PP_PrivateAccessibilityPageInfo &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_uint32_t(iterator, value.page_index); + iterator.skip(); + FromJSON_PP_Rect(iterator, value.bounds); + iterator.skip(); + FromJSON_uint32_t(iterator, value.text_run_count); + iterator.skip(); + FromJSON_uint32_t(iterator, value.char_count); +} +const string ToString_PP_PrivateAccessibilityTextRunInfo(const PP_PrivateAccessibilityTextRunInfo *v) { + if (!v) { + return "null"; + } + return ToString_PP_PrivateAccessibilityTextRunInfo(*v); +} +const string ToString_PP_PrivateAccessibilityTextRunInfo(const PP_PrivateAccessibilityTextRunInfo &v) { + stringstream x; + BeginProps(x); + AddProp(x, "len", ToString_uint32_t(v.len)); + AddProp(x, "font_size", ToString_double_t(v.font_size)); + AddProp(x, "bounds", ToString_PP_FloatRect(v.bounds)); + AddProp(x, "direction", ToString_PP_PrivateDirection(v.direction)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_PrivateAccessibilityTextRunInfo(JSONIterator& iterator, PP_PrivateAccessibilityTextRunInfo &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_uint32_t(iterator, value.len); + iterator.skip(); + FromJSON_double_t(iterator, value.font_size); + iterator.skip(); + FromJSON_PP_FloatRect(iterator, value.bounds); + iterator.skip(); + FromJSON_PP_PrivateDirection(iterator, value.direction); +} +const string ToString_PP_PrivateAccessibilityCharInfo(const PP_PrivateAccessibilityCharInfo *v) { + if (!v) { + return "null"; + } + return ToString_PP_PrivateAccessibilityCharInfo(*v); +} +const string ToString_PP_PrivateAccessibilityCharInfo(const PP_PrivateAccessibilityCharInfo &v) { + stringstream x; + BeginProps(x); + AddProp(x, "unicode_character", ToString_uint32_t(v.unicode_character)); + AddProp(x, "char_width", ToString_double_t(v.char_width)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_PrivateAccessibilityCharInfo(JSONIterator& iterator, PP_PrivateAccessibilityCharInfo &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_uint32_t(iterator, value.unicode_character); + iterator.skip(); + FromJSON_double_t(iterator, value.char_width); +} +namespace ns_PPB_PDF_0_1 { +static PP_Resource GetFontFileWithFallback_0_1(PP_Instance instance, const struct PP_BrowserFont_Trusted_Description* description, PP_PrivateFontCharset charset) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_PDF\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetFontFileWithFallback\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "description", ToString_PP_BrowserFont_Trusted_Description(description)); + AddProp(ss, "charset", ToString_PP_PrivateFontCharset(charset)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_PDF_0_1*)RealGetInterface("PPB_PDF;0.1"))->GetFontFileWithFallback(instance, description, charset); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetFontTableForPrivateFontFile_0_1(PP_Resource font_file, uint32_t table, void* output, uint32_t* output_length) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_PDF\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetFontTableForPrivateFontFile\""); + AddProp(ss, "font_file", ToString_PP_Resource(font_file)); + AddProp(ss, "table", ToString_uint32_t(table)); + AddProp(ss, "output", PointerToString(output)); + AddProp(ss, "output_length", PointerToString(output_length)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_mem_t(iterator, output); + iterator.skip(); + FromJSON_uint32_t(iterator, *output_length); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_PDF_0_1*)RealGetInterface("PPB_PDF;0.1"))->GetFontTableForPrivateFontFile(font_file, table, output, output_length); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + AddProp(os, "output", ToString_mem_t(output)); + if (!!output_length) { + AddProp(os, "output_length", ToString_uint32_t(output_length)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void SearchString_0_1(PP_Instance instance, const void* str, const void* term, PP_Bool case_sensitive, struct PP_PrivateFindResult** results, int32_t* count) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_PDF\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"SearchString\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "str", ToString_mem_t(str)); + AddProp(ss, "term", ToString_mem_t(term)); + AddProp(ss, "case_sensitive", ToString_PP_Bool(case_sensitive)); + AddProp(ss, "results", PointerToString(results)); + AddProp(ss, "count", PointerToString(count)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + *results = new struct PP_PrivateFindResult[children]; + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_PP_PrivateFindResult(iterator, (*results)[_n]); + } + // FIXME Null out remaining items? + } + iterator.skip(); + FromJSON_int32_t(iterator, *count); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_PDF_0_1*)RealGetInterface("PPB_PDF;0.1"))->SearchString(instance, str, term, case_sensitive, results, count); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + { + BeginProp(os, "results"); + BeginElements(os); + for (uint32_t _n = 0; results[_n] != 0; ++_n) { + AddElement(os, ToString_PP_PrivateFindResult(results[_n])); + } + EndElements(os); + } + if (!!count) { + AddProp(os, "count", ToString_int32_t(count)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void DidStartLoading_0_1(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_PDF\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"DidStartLoading\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_PDF_0_1*)RealGetInterface("PPB_PDF;0.1"))->DidStartLoading(instance); +#endif // !INTERPOSE +} +static void DidStopLoading_0_1(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_PDF\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"DidStopLoading\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_PDF_0_1*)RealGetInterface("PPB_PDF;0.1"))->DidStopLoading(instance); +#endif // !INTERPOSE +} +static void SetContentRestriction_0_1(PP_Instance instance, int32_t restrictions) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_PDF\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"SetContentRestriction\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "restrictions", ToString_int32_t(restrictions)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_PDF_0_1*)RealGetInterface("PPB_PDF;0.1"))->SetContentRestriction(instance, restrictions); +#endif // !INTERPOSE +} +static void UserMetricsRecordAction_0_1(PP_Instance instance, struct PP_Var action) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_PDF\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"UserMetricsRecordAction\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "action", ToString_PP_Var(action)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_PDF_0_1*)RealGetInterface("PPB_PDF;0.1"))->UserMetricsRecordAction(instance, action); +#endif // !INTERPOSE +} +static void HasUnsupportedFeature_0_1(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_PDF\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"HasUnsupportedFeature\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_PDF_0_1*)RealGetInterface("PPB_PDF;0.1"))->HasUnsupportedFeature(instance); +#endif // !INTERPOSE +} +static void SaveAs_0_1(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_PDF\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"SaveAs\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_PDF_0_1*)RealGetInterface("PPB_PDF;0.1"))->SaveAs(instance); +#endif // !INTERPOSE +} +static void Print_0_1(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_PDF\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Print\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_PDF_0_1*)RealGetInterface("PPB_PDF;0.1"))->Print(instance); +#endif // !INTERPOSE +} +static PP_Bool IsFeatureEnabled_0_1(PP_Instance instance, PP_PDFFeature feature) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_PDF\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"IsFeatureEnabled\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "feature", ToString_PP_PDFFeature(feature)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_PDF_0_1*)RealGetInterface("PPB_PDF;0.1"))->IsFeatureEnabled(instance, feature); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void SetSelectedText_0_1(PP_Instance instance, const char* selected_text) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_PDF\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"SetSelectedText\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "selected_text", ToString_str_t(selected_text)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_PDF_0_1*)RealGetInterface("PPB_PDF;0.1"))->SetSelectedText(instance, selected_text); +#endif // !INTERPOSE +} +static void SetLinkUnderCursor_0_1(PP_Instance instance, const char* url) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_PDF\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"SetLinkUnderCursor\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "url", ToString_str_t(url)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_PDF_0_1*)RealGetInterface("PPB_PDF;0.1"))->SetLinkUnderCursor(instance, url); +#endif // !INTERPOSE +} +static void GetV8ExternalSnapshotData_0_1(PP_Instance instance, void** natives_data_out, int32_t* natives_size_out, void** snapshot_data_out, int32_t* snapshot_size_out) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_PDF\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetV8ExternalSnapshotData\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "natives_data_out", PointerToString(natives_data_out)); + AddProp(ss, "natives_size_out", PointerToString(natives_size_out)); + AddProp(ss, "snapshot_data_out", PointerToString(snapshot_data_out)); + AddProp(ss, "snapshot_size_out", PointerToString(snapshot_size_out)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_mem_ptr_t(iterator, natives_data_out); + iterator.skip(); + FromJSON_int32_t(iterator, *natives_size_out); + iterator.skip(); + FromJSON_mem_ptr_t(iterator, snapshot_data_out); + iterator.skip(); + FromJSON_int32_t(iterator, *snapshot_size_out); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_PDF_0_1*)RealGetInterface("PPB_PDF;0.1"))->GetV8ExternalSnapshotData(instance, natives_data_out, natives_size_out, snapshot_data_out, snapshot_size_out); + printf("RPC response: ["); + printf("["); + std::stringstream os; + BeginProps(os); + AddProp(os, "natives_data_out", ToString_mem_ptr_t(natives_data_out)); + if (!!natives_size_out) { + AddProp(os, "natives_size_out", ToString_int32_t(natives_size_out)); + } + AddProp(os, "snapshot_data_out", ToString_mem_ptr_t(snapshot_data_out)); + if (!!snapshot_size_out) { + AddProp(os, "snapshot_size_out", ToString_int32_t(snapshot_size_out)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); +#endif // !INTERPOSE +} +static void SetAccessibilityViewportInfo_0_1(PP_Instance instance, const struct PP_PrivateAccessibilityViewportInfo* viewport_info) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_PDF\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"SetAccessibilityViewportInfo\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "viewport_info", ToString_PP_PrivateAccessibilityViewportInfo(viewport_info)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_PDF_0_1*)RealGetInterface("PPB_PDF;0.1"))->SetAccessibilityViewportInfo(instance, viewport_info); +#endif // !INTERPOSE +} +static void SetAccessibilityDocInfo_0_1(PP_Instance instance, const struct PP_PrivateAccessibilityDocInfo* doc_info) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_PDF\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"SetAccessibilityDocInfo\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "doc_info", ToString_PP_PrivateAccessibilityDocInfo(doc_info)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_PDF_0_1*)RealGetInterface("PPB_PDF;0.1"))->SetAccessibilityDocInfo(instance, doc_info); +#endif // !INTERPOSE +} +static void SetAccessibilityPageInfo_0_1(PP_Instance instance, const struct PP_PrivateAccessibilityPageInfo* page_info, const struct PP_PrivateAccessibilityTextRunInfo text_runs[], const struct PP_PrivateAccessibilityCharInfo chars[]) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_PDF\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"SetAccessibilityPageInfo\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "page_info", ToString_PP_PrivateAccessibilityPageInfo(page_info)); + { + BeginProp(ss, "text_runs"); + BeginElements(ss); + for (uint32_t _n = 0; _n < page_info->text_run_count; ++_n) { + AddElement(ss, ToString_PP_PrivateAccessibilityTextRunInfo(text_runs[_n])); + } + EndElements(ss); + } + { + BeginProp(ss, "chars"); + BeginElements(ss); + for (uint32_t _n = 0; _n < page_info->char_count; ++_n) { + AddElement(ss, ToString_PP_PrivateAccessibilityCharInfo(chars[_n])); + } + EndElements(ss); + } + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_PDF_0_1*)RealGetInterface("PPB_PDF;0.1"))->SetAccessibilityPageInfo(instance, page_info, text_runs, chars); +#endif // !INTERPOSE +} +static void SetCrashData_0_1(PP_Instance instance, const char* pdf_url, const char* top_level_url) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_PDF\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"SetCrashData\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "pdf_url", ToString_str_t(pdf_url)); + AddProp(ss, "top_level_url", ToString_str_t(top_level_url)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_PDF_0_1*)RealGetInterface("PPB_PDF;0.1"))->SetCrashData(instance, pdf_url, top_level_url); +#endif // !INTERPOSE +} +} +static PPB_PDF_0_1 _PPB_PDF_0_1 = { + ns_PPB_PDF_0_1::GetFontFileWithFallback_0_1, + ns_PPB_PDF_0_1::GetFontTableForPrivateFontFile_0_1, + ns_PPB_PDF_0_1::SearchString_0_1, + ns_PPB_PDF_0_1::DidStartLoading_0_1, + ns_PPB_PDF_0_1::DidStopLoading_0_1, + ns_PPB_PDF_0_1::SetContentRestriction_0_1, + ns_PPB_PDF_0_1::UserMetricsRecordAction_0_1, + ns_PPB_PDF_0_1::HasUnsupportedFeature_0_1, + ns_PPB_PDF_0_1::SaveAs_0_1, + ns_PPB_PDF_0_1::Print_0_1, + ns_PPB_PDF_0_1::IsFeatureEnabled_0_1, + ns_PPB_PDF_0_1::SetSelectedText_0_1, + ns_PPB_PDF_0_1::SetLinkUnderCursor_0_1, + ns_PPB_PDF_0_1::GetV8ExternalSnapshotData_0_1, + ns_PPB_PDF_0_1::SetAccessibilityViewportInfo_0_1, + ns_PPB_PDF_0_1::SetAccessibilityDocInfo_0_1, + ns_PPB_PDF_0_1::SetAccessibilityPageInfo_0_1, + ns_PPB_PDF_0_1::SetCrashData_0_1, +}; +const string ToString_PPB_PDF(const PPB_PDF_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_PlatformVerification_Private_0_2 { +static PP_Resource Create_0_2(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_PlatformVerification_Private\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_PlatformVerification_Private_0_2*)RealGetInterface("PPB_PlatformVerification_Private;0.2"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsPlatformVerification_0_2(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_PlatformVerification_Private\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"IsPlatformVerification\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_PlatformVerification_Private_0_2*)RealGetInterface("PPB_PlatformVerification_Private;0.2"))->IsPlatformVerification(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t ChallengePlatform_0_2(PP_Resource instance, struct PP_Var service_id, struct PP_Var challenge, struct PP_Var* signed_data, struct PP_Var* signed_data_signature, struct PP_Var* platform_key_certificate, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_PlatformVerification_Private\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"ChallengePlatform\""); + AddProp(ss, "instance", ToString_PP_Resource(instance)); + AddProp(ss, "service_id", ToString_PP_Var(service_id)); + AddProp(ss, "challenge", ToString_PP_Var(challenge)); + AddProp(ss, "signed_data", PointerToString(signed_data)); + AddProp(ss, "signed_data_signature", PointerToString(signed_data_signature)); + AddProp(ss, "platform_key_certificate", PointerToString(platform_key_certificate)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Var(iterator, *signed_data); + iterator.skip(); + FromJSON_PP_Var(iterator, *signed_data_signature); + iterator.skip(); + FromJSON_PP_Var(iterator, *platform_key_certificate); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_PlatformVerification_Private_0_2*)RealGetInterface("PPB_PlatformVerification_Private;0.2"))->ChallengePlatform(instance, service_id, challenge, signed_data, signed_data_signature, platform_key_certificate, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!signed_data) { + AddProp(os, "signed_data", ToString_PP_Var(signed_data)); + } + if (!!signed_data_signature) { + AddProp(os, "signed_data_signature", ToString_PP_Var(signed_data_signature)); + } + if (!!platform_key_certificate) { + AddProp(os, "platform_key_certificate", ToString_PP_Var(platform_key_certificate)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_PlatformVerification_Private_0_2 _PPB_PlatformVerification_Private_0_2 = { + ns_PPB_PlatformVerification_Private_0_2::Create_0_2, + ns_PPB_PlatformVerification_Private_0_2::IsPlatformVerification_0_2, + ns_PPB_PlatformVerification_Private_0_2::ChallengePlatform_0_2, +}; +const string ToString_PPB_PlatformVerification_Private(const PPB_PlatformVerification_Private_0_2 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_TCPServerSocket_Private_0_1 { +static PP_Resource Create_0_1(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPServerSocket_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_TCPServerSocket_Private_0_1*)RealGetInterface("PPB_TCPServerSocket_Private;0.1"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsTCPServerSocket_0_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPServerSocket_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"IsTCPServerSocket\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_TCPServerSocket_Private_0_1*)RealGetInterface("PPB_TCPServerSocket_Private;0.1"))->IsTCPServerSocket(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Listen_0_1(PP_Resource tcp_server_socket, const struct PP_NetAddress_Private* addr, int32_t backlog, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPServerSocket_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Listen\""); + AddProp(ss, "tcp_server_socket", ToString_PP_Resource(tcp_server_socket)); + AddProp(ss, "addr", ToString_PP_NetAddress_Private(addr)); + AddProp(ss, "backlog", ToString_int32_t(backlog)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPServerSocket_Private_0_1*)RealGetInterface("PPB_TCPServerSocket_Private;0.1"))->Listen(tcp_server_socket, addr, backlog, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Accept_0_1(PP_Resource tcp_server_socket, PP_Resource* tcp_socket, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPServerSocket_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Accept\""); + AddProp(ss, "tcp_server_socket", ToString_PP_Resource(tcp_server_socket)); + AddProp(ss, "tcp_socket", PointerToString(tcp_socket)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Resource(iterator, *tcp_socket); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPServerSocket_Private_0_1*)RealGetInterface("PPB_TCPServerSocket_Private;0.1"))->Accept(tcp_server_socket, tcp_socket, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!tcp_socket) { + AddProp(os, "tcp_socket", ToString_PP_Resource(tcp_socket)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping GetLocalAddress */ +static void StopListening_0_1(PP_Resource tcp_server_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPServerSocket_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"StopListening\""); + AddProp(ss, "tcp_server_socket", ToString_PP_Resource(tcp_server_socket)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_TCPServerSocket_Private_0_1*)RealGetInterface("PPB_TCPServerSocket_Private;0.1"))->StopListening(tcp_server_socket); +#endif // !INTERPOSE +} +} +static PPB_TCPServerSocket_Private_0_1 _PPB_TCPServerSocket_Private_0_1 = { + ns_PPB_TCPServerSocket_Private_0_1::Create_0_1, + ns_PPB_TCPServerSocket_Private_0_1::IsTCPServerSocket_0_1, + ns_PPB_TCPServerSocket_Private_0_1::Listen_0_1, + ns_PPB_TCPServerSocket_Private_0_1::Accept_0_1, + ns_PPB_TCPServerSocket_Private_0_1::StopListening_0_1, +}; +const string ToString_PPB_TCPServerSocket_Private(const PPB_TCPServerSocket_Private_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_TCPServerSocket_Private_0_2 { +static PP_Resource Create_0_2(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPServerSocket_Private\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_TCPServerSocket_Private_0_2*)RealGetInterface("PPB_TCPServerSocket_Private;0.2"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsTCPServerSocket_0_2(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPServerSocket_Private\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"IsTCPServerSocket\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_TCPServerSocket_Private_0_2*)RealGetInterface("PPB_TCPServerSocket_Private;0.2"))->IsTCPServerSocket(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Listen_0_2(PP_Resource tcp_server_socket, const struct PP_NetAddress_Private* addr, int32_t backlog, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPServerSocket_Private\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"Listen\""); + AddProp(ss, "tcp_server_socket", ToString_PP_Resource(tcp_server_socket)); + AddProp(ss, "addr", ToString_PP_NetAddress_Private(addr)); + AddProp(ss, "backlog", ToString_int32_t(backlog)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPServerSocket_Private_0_2*)RealGetInterface("PPB_TCPServerSocket_Private;0.2"))->Listen(tcp_server_socket, addr, backlog, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Accept_0_2(PP_Resource tcp_server_socket, PP_Resource* tcp_socket, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPServerSocket_Private\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"Accept\""); + AddProp(ss, "tcp_server_socket", ToString_PP_Resource(tcp_server_socket)); + AddProp(ss, "tcp_socket", PointerToString(tcp_socket)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_PP_Resource(iterator, *tcp_socket); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPServerSocket_Private_0_2*)RealGetInterface("PPB_TCPServerSocket_Private;0.2"))->Accept(tcp_server_socket, tcp_socket, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!tcp_socket) { + AddProp(os, "tcp_socket", ToString_PP_Resource(tcp_socket)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetLocalAddress_0_2(PP_Resource tcp_server_socket, struct PP_NetAddress_Private* addr) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPServerSocket_Private\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"GetLocalAddress\""); + AddProp(ss, "tcp_server_socket", ToString_PP_Resource(tcp_server_socket)); + AddProp(ss, "addr", PointerToString(addr)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!addr) { + iterator.skip(); + FromJSON_PP_NetAddress_Private(iterator, *addr); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_TCPServerSocket_Private_0_2*)RealGetInterface("PPB_TCPServerSocket_Private;0.2"))->GetLocalAddress(tcp_server_socket, addr); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!addr) { + AddProp(os, "addr", ToString_PP_NetAddress_Private(addr)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void StopListening_0_2(PP_Resource tcp_server_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPServerSocket_Private\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"StopListening\""); + AddProp(ss, "tcp_server_socket", ToString_PP_Resource(tcp_server_socket)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_TCPServerSocket_Private_0_2*)RealGetInterface("PPB_TCPServerSocket_Private;0.2"))->StopListening(tcp_server_socket); +#endif // !INTERPOSE +} +} +static PPB_TCPServerSocket_Private_0_2 _PPB_TCPServerSocket_Private_0_2 = { + ns_PPB_TCPServerSocket_Private_0_2::Create_0_2, + ns_PPB_TCPServerSocket_Private_0_2::IsTCPServerSocket_0_2, + ns_PPB_TCPServerSocket_Private_0_2::Listen_0_2, + ns_PPB_TCPServerSocket_Private_0_2::Accept_0_2, + ns_PPB_TCPServerSocket_Private_0_2::GetLocalAddress_0_2, + ns_PPB_TCPServerSocket_Private_0_2::StopListening_0_2, +}; +const string ToString_PPB_TCPServerSocket_Private(const PPB_TCPServerSocket_Private_0_2 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_TCPSocketOption_Private(const PP_TCPSocketOption_Private *v) { + switch (*v) { + case 0: + return "\"PP_TCPSOCKETOPTION_PRIVATE_INVALID\""; + case 1: + return "\"PP_TCPSOCKETOPTION_PRIVATE_NO_DELAY\""; + default: + return "\"???\""; + } +} +const string ToString_PP_TCPSocketOption_Private(const PP_TCPSocketOption_Private &v) { + return ToString_PP_TCPSocketOption_Private(&v); +} +void FromJSON_PP_TCPSocketOption_Private(JSONIterator& iterator, PP_TCPSocketOption_Private &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_TCPSocketOption_Private(v); +} +namespace ns_PPB_TCPSocket_Private_0_3 { +static PP_Resource Create_0_3(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_TCPSocket_Private_0_3*)RealGetInterface("PPB_TCPSocket_Private;0.3"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsTCPSocket_0_3(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"IsTCPSocket\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_TCPSocket_Private_0_3*)RealGetInterface("PPB_TCPSocket_Private;0.3"))->IsTCPSocket(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Connect_0_3(PP_Resource tcp_socket, const char* host, uint16_t port, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"Connect\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "host", ToString_str_t(host)); + AddProp(ss, "port", ToString_uint16_t(port)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_Private_0_3*)RealGetInterface("PPB_TCPSocket_Private;0.3"))->Connect(tcp_socket, host, port, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t ConnectWithNetAddress_0_3(PP_Resource tcp_socket, const struct PP_NetAddress_Private* addr, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"ConnectWithNetAddress\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "addr", ToString_PP_NetAddress_Private(addr)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_Private_0_3*)RealGetInterface("PPB_TCPSocket_Private;0.3"))->ConnectWithNetAddress(tcp_socket, addr, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetLocalAddress_0_3(PP_Resource tcp_socket, struct PP_NetAddress_Private* local_addr) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"GetLocalAddress\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "local_addr", PointerToString(local_addr)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!local_addr) { + iterator.skip(); + FromJSON_PP_NetAddress_Private(iterator, *local_addr); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_TCPSocket_Private_0_3*)RealGetInterface("PPB_TCPSocket_Private;0.3"))->GetLocalAddress(tcp_socket, local_addr); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!local_addr) { + AddProp(os, "local_addr", ToString_PP_NetAddress_Private(local_addr)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetRemoteAddress_0_3(PP_Resource tcp_socket, struct PP_NetAddress_Private* remote_addr) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"GetRemoteAddress\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "remote_addr", PointerToString(remote_addr)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!remote_addr) { + iterator.skip(); + FromJSON_PP_NetAddress_Private(iterator, *remote_addr); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_TCPSocket_Private_0_3*)RealGetInterface("PPB_TCPSocket_Private;0.3"))->GetRemoteAddress(tcp_socket, remote_addr); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!remote_addr) { + AddProp(os, "remote_addr", ToString_PP_NetAddress_Private(remote_addr)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SSLHandshake_0_3(PP_Resource tcp_socket, const char* server_name, uint16_t server_port, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"SSLHandshake\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "server_name", ToString_str_t(server_name)); + AddProp(ss, "server_port", ToString_uint16_t(server_port)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_Private_0_3*)RealGetInterface("PPB_TCPSocket_Private;0.3"))->SSLHandshake(tcp_socket, server_name, server_port, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping GetServerCertificate */ +/* skipping AddChainBuildingCertificate */ +static int32_t Read_0_3(PP_Resource tcp_socket, char* buffer, int32_t bytes_to_read, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"Read\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "buffer", PointerToString(buffer)); + AddProp(ss, "bytes_to_read", ToString_int32_t(bytes_to_read)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_str_t(iterator, buffer); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_Private_0_3*)RealGetInterface("PPB_TCPSocket_Private;0.3"))->Read(tcp_socket, buffer, bytes_to_read, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + AddProp(os, "buffer", ToString_str_t(buffer)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Write_0_3(PP_Resource tcp_socket, const char* buffer, int32_t bytes_to_write, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"Write\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + { + BeginProp(ss, "buffer"); + BeginElements(ss); + for (uint32_t _n = 0; _n < bytes_to_write; ++_n) { + AddElement(ss, ToString_uint8_t(buffer[_n])); + } + EndElements(ss); + } + AddProp(ss, "bytes_to_write", ToString_int32_t(bytes_to_write)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_Private_0_3*)RealGetInterface("PPB_TCPSocket_Private;0.3"))->Write(tcp_socket, buffer, bytes_to_write, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void Disconnect_0_3(PP_Resource tcp_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"Disconnect\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_TCPSocket_Private_0_3*)RealGetInterface("PPB_TCPSocket_Private;0.3"))->Disconnect(tcp_socket); +#endif // !INTERPOSE +} +/* skipping SetOption */ +} +static PPB_TCPSocket_Private_0_3 _PPB_TCPSocket_Private_0_3 = { + ns_PPB_TCPSocket_Private_0_3::Create_0_3, + ns_PPB_TCPSocket_Private_0_3::IsTCPSocket_0_3, + ns_PPB_TCPSocket_Private_0_3::Connect_0_3, + ns_PPB_TCPSocket_Private_0_3::ConnectWithNetAddress_0_3, + ns_PPB_TCPSocket_Private_0_3::GetLocalAddress_0_3, + ns_PPB_TCPSocket_Private_0_3::GetRemoteAddress_0_3, + ns_PPB_TCPSocket_Private_0_3::SSLHandshake_0_3, + ns_PPB_TCPSocket_Private_0_3::Read_0_3, + ns_PPB_TCPSocket_Private_0_3::Write_0_3, + ns_PPB_TCPSocket_Private_0_3::Disconnect_0_3, +}; +const string ToString_PPB_TCPSocket_Private(const PPB_TCPSocket_Private_0_3 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_TCPSocket_Private_0_4 { +static PP_Resource Create_0_4(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_TCPSocket_Private_0_4*)RealGetInterface("PPB_TCPSocket_Private;0.4"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsTCPSocket_0_4(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"IsTCPSocket\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_TCPSocket_Private_0_4*)RealGetInterface("PPB_TCPSocket_Private;0.4"))->IsTCPSocket(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Connect_0_4(PP_Resource tcp_socket, const char* host, uint16_t port, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"Connect\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "host", ToString_str_t(host)); + AddProp(ss, "port", ToString_uint16_t(port)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_Private_0_4*)RealGetInterface("PPB_TCPSocket_Private;0.4"))->Connect(tcp_socket, host, port, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t ConnectWithNetAddress_0_4(PP_Resource tcp_socket, const struct PP_NetAddress_Private* addr, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"ConnectWithNetAddress\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "addr", ToString_PP_NetAddress_Private(addr)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_Private_0_4*)RealGetInterface("PPB_TCPSocket_Private;0.4"))->ConnectWithNetAddress(tcp_socket, addr, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetLocalAddress_0_4(PP_Resource tcp_socket, struct PP_NetAddress_Private* local_addr) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"GetLocalAddress\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "local_addr", PointerToString(local_addr)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!local_addr) { + iterator.skip(); + FromJSON_PP_NetAddress_Private(iterator, *local_addr); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_TCPSocket_Private_0_4*)RealGetInterface("PPB_TCPSocket_Private;0.4"))->GetLocalAddress(tcp_socket, local_addr); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!local_addr) { + AddProp(os, "local_addr", ToString_PP_NetAddress_Private(local_addr)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetRemoteAddress_0_4(PP_Resource tcp_socket, struct PP_NetAddress_Private* remote_addr) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"GetRemoteAddress\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "remote_addr", PointerToString(remote_addr)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!remote_addr) { + iterator.skip(); + FromJSON_PP_NetAddress_Private(iterator, *remote_addr); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_TCPSocket_Private_0_4*)RealGetInterface("PPB_TCPSocket_Private;0.4"))->GetRemoteAddress(tcp_socket, remote_addr); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!remote_addr) { + AddProp(os, "remote_addr", ToString_PP_NetAddress_Private(remote_addr)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SSLHandshake_0_4(PP_Resource tcp_socket, const char* server_name, uint16_t server_port, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"SSLHandshake\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "server_name", ToString_str_t(server_name)); + AddProp(ss, "server_port", ToString_uint16_t(server_port)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_Private_0_4*)RealGetInterface("PPB_TCPSocket_Private;0.4"))->SSLHandshake(tcp_socket, server_name, server_port, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource GetServerCertificate_0_4(PP_Resource tcp_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"GetServerCertificate\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_TCPSocket_Private_0_4*)RealGetInterface("PPB_TCPSocket_Private;0.4"))->GetServerCertificate(tcp_socket); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool AddChainBuildingCertificate_0_4(PP_Resource tcp_socket, PP_Resource certificate, PP_Bool is_trusted) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"AddChainBuildingCertificate\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "certificate", ToString_PP_Resource(certificate)); + AddProp(ss, "is_trusted", ToString_PP_Bool(is_trusted)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_TCPSocket_Private_0_4*)RealGetInterface("PPB_TCPSocket_Private;0.4"))->AddChainBuildingCertificate(tcp_socket, certificate, is_trusted); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Read_0_4(PP_Resource tcp_socket, char* buffer, int32_t bytes_to_read, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"Read\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "buffer", PointerToString(buffer)); + AddProp(ss, "bytes_to_read", ToString_int32_t(bytes_to_read)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_str_t(iterator, buffer); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_Private_0_4*)RealGetInterface("PPB_TCPSocket_Private;0.4"))->Read(tcp_socket, buffer, bytes_to_read, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + AddProp(os, "buffer", ToString_str_t(buffer)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Write_0_4(PP_Resource tcp_socket, const char* buffer, int32_t bytes_to_write, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"Write\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + { + BeginProp(ss, "buffer"); + BeginElements(ss); + for (uint32_t _n = 0; _n < bytes_to_write; ++_n) { + AddElement(ss, ToString_uint8_t(buffer[_n])); + } + EndElements(ss); + } + AddProp(ss, "bytes_to_write", ToString_int32_t(bytes_to_write)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_Private_0_4*)RealGetInterface("PPB_TCPSocket_Private;0.4"))->Write(tcp_socket, buffer, bytes_to_write, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void Disconnect_0_4(PP_Resource tcp_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"Disconnect\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_TCPSocket_Private_0_4*)RealGetInterface("PPB_TCPSocket_Private;0.4"))->Disconnect(tcp_socket); +#endif // !INTERPOSE +} +/* skipping SetOption */ +} +static PPB_TCPSocket_Private_0_4 _PPB_TCPSocket_Private_0_4 = { + ns_PPB_TCPSocket_Private_0_4::Create_0_4, + ns_PPB_TCPSocket_Private_0_4::IsTCPSocket_0_4, + ns_PPB_TCPSocket_Private_0_4::Connect_0_4, + ns_PPB_TCPSocket_Private_0_4::ConnectWithNetAddress_0_4, + ns_PPB_TCPSocket_Private_0_4::GetLocalAddress_0_4, + ns_PPB_TCPSocket_Private_0_4::GetRemoteAddress_0_4, + ns_PPB_TCPSocket_Private_0_4::SSLHandshake_0_4, + ns_PPB_TCPSocket_Private_0_4::GetServerCertificate_0_4, + ns_PPB_TCPSocket_Private_0_4::AddChainBuildingCertificate_0_4, + ns_PPB_TCPSocket_Private_0_4::Read_0_4, + ns_PPB_TCPSocket_Private_0_4::Write_0_4, + ns_PPB_TCPSocket_Private_0_4::Disconnect_0_4, +}; +const string ToString_PPB_TCPSocket_Private(const PPB_TCPSocket_Private_0_4 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_TCPSocket_Private_0_5 { +static PP_Resource Create_0_5(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.5\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_TCPSocket_Private_0_5*)RealGetInterface("PPB_TCPSocket_Private;0.5"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsTCPSocket_0_5(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.5\""); + AddProp(ss, "__method", "\"IsTCPSocket\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_TCPSocket_Private_0_5*)RealGetInterface("PPB_TCPSocket_Private;0.5"))->IsTCPSocket(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Connect_0_5(PP_Resource tcp_socket, const char* host, uint16_t port, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.5\""); + AddProp(ss, "__method", "\"Connect\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "host", ToString_str_t(host)); + AddProp(ss, "port", ToString_uint16_t(port)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_Private_0_5*)RealGetInterface("PPB_TCPSocket_Private;0.5"))->Connect(tcp_socket, host, port, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t ConnectWithNetAddress_0_5(PP_Resource tcp_socket, const struct PP_NetAddress_Private* addr, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.5\""); + AddProp(ss, "__method", "\"ConnectWithNetAddress\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "addr", ToString_PP_NetAddress_Private(addr)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_Private_0_5*)RealGetInterface("PPB_TCPSocket_Private;0.5"))->ConnectWithNetAddress(tcp_socket, addr, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetLocalAddress_0_5(PP_Resource tcp_socket, struct PP_NetAddress_Private* local_addr) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.5\""); + AddProp(ss, "__method", "\"GetLocalAddress\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "local_addr", PointerToString(local_addr)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!local_addr) { + iterator.skip(); + FromJSON_PP_NetAddress_Private(iterator, *local_addr); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_TCPSocket_Private_0_5*)RealGetInterface("PPB_TCPSocket_Private;0.5"))->GetLocalAddress(tcp_socket, local_addr); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!local_addr) { + AddProp(os, "local_addr", ToString_PP_NetAddress_Private(local_addr)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetRemoteAddress_0_5(PP_Resource tcp_socket, struct PP_NetAddress_Private* remote_addr) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.5\""); + AddProp(ss, "__method", "\"GetRemoteAddress\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "remote_addr", PointerToString(remote_addr)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!remote_addr) { + iterator.skip(); + FromJSON_PP_NetAddress_Private(iterator, *remote_addr); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_TCPSocket_Private_0_5*)RealGetInterface("PPB_TCPSocket_Private;0.5"))->GetRemoteAddress(tcp_socket, remote_addr); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!remote_addr) { + AddProp(os, "remote_addr", ToString_PP_NetAddress_Private(remote_addr)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SSLHandshake_0_5(PP_Resource tcp_socket, const char* server_name, uint16_t server_port, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.5\""); + AddProp(ss, "__method", "\"SSLHandshake\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "server_name", ToString_str_t(server_name)); + AddProp(ss, "server_port", ToString_uint16_t(server_port)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_Private_0_5*)RealGetInterface("PPB_TCPSocket_Private;0.5"))->SSLHandshake(tcp_socket, server_name, server_port, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Resource GetServerCertificate_0_5(PP_Resource tcp_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.5\""); + AddProp(ss, "__method", "\"GetServerCertificate\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_TCPSocket_Private_0_5*)RealGetInterface("PPB_TCPSocket_Private;0.5"))->GetServerCertificate(tcp_socket); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool AddChainBuildingCertificate_0_5(PP_Resource tcp_socket, PP_Resource certificate, PP_Bool is_trusted) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.5\""); + AddProp(ss, "__method", "\"AddChainBuildingCertificate\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "certificate", ToString_PP_Resource(certificate)); + AddProp(ss, "is_trusted", ToString_PP_Bool(is_trusted)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_TCPSocket_Private_0_5*)RealGetInterface("PPB_TCPSocket_Private;0.5"))->AddChainBuildingCertificate(tcp_socket, certificate, is_trusted); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Read_0_5(PP_Resource tcp_socket, char* buffer, int32_t bytes_to_read, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.5\""); + AddProp(ss, "__method", "\"Read\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "buffer", PointerToString(buffer)); + AddProp(ss, "bytes_to_read", ToString_int32_t(bytes_to_read)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_str_t(iterator, buffer); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_Private_0_5*)RealGetInterface("PPB_TCPSocket_Private;0.5"))->Read(tcp_socket, buffer, bytes_to_read, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + AddProp(os, "buffer", ToString_str_t(buffer)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Write_0_5(PP_Resource tcp_socket, const char* buffer, int32_t bytes_to_write, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.5\""); + AddProp(ss, "__method", "\"Write\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + { + BeginProp(ss, "buffer"); + BeginElements(ss); + for (uint32_t _n = 0; _n < bytes_to_write; ++_n) { + AddElement(ss, ToString_uint8_t(buffer[_n])); + } + EndElements(ss); + } + AddProp(ss, "bytes_to_write", ToString_int32_t(bytes_to_write)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_Private_0_5*)RealGetInterface("PPB_TCPSocket_Private;0.5"))->Write(tcp_socket, buffer, bytes_to_write, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void Disconnect_0_5(PP_Resource tcp_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.5\""); + AddProp(ss, "__method", "\"Disconnect\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_TCPSocket_Private_0_5*)RealGetInterface("PPB_TCPSocket_Private;0.5"))->Disconnect(tcp_socket); +#endif // !INTERPOSE +} +static int32_t SetOption_0_5(PP_Resource tcp_socket, PP_TCPSocketOption_Private name, struct PP_Var value, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_TCPSocket_Private\""); + AddProp(ss, "__version", "\"0.5\""); + AddProp(ss, "__method", "\"SetOption\""); + AddProp(ss, "tcp_socket", ToString_PP_Resource(tcp_socket)); + AddProp(ss, "name", ToString_PP_TCPSocketOption_Private(name)); + AddProp(ss, "value", ToString_PP_Var(value)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_TCPSocket_Private_0_5*)RealGetInterface("PPB_TCPSocket_Private;0.5"))->SetOption(tcp_socket, name, value, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_TCPSocket_Private_0_5 _PPB_TCPSocket_Private_0_5 = { + ns_PPB_TCPSocket_Private_0_5::Create_0_5, + ns_PPB_TCPSocket_Private_0_5::IsTCPSocket_0_5, + ns_PPB_TCPSocket_Private_0_5::Connect_0_5, + ns_PPB_TCPSocket_Private_0_5::ConnectWithNetAddress_0_5, + ns_PPB_TCPSocket_Private_0_5::GetLocalAddress_0_5, + ns_PPB_TCPSocket_Private_0_5::GetRemoteAddress_0_5, + ns_PPB_TCPSocket_Private_0_5::SSLHandshake_0_5, + ns_PPB_TCPSocket_Private_0_5::GetServerCertificate_0_5, + ns_PPB_TCPSocket_Private_0_5::AddChainBuildingCertificate_0_5, + ns_PPB_TCPSocket_Private_0_5::Read_0_5, + ns_PPB_TCPSocket_Private_0_5::Write_0_5, + ns_PPB_TCPSocket_Private_0_5::Disconnect_0_5, + ns_PPB_TCPSocket_Private_0_5::SetOption_0_5, +}; +const string ToString_PPB_TCPSocket_Private(const PPB_TCPSocket_Private_0_5 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_Testing_Private_1_0 { +static PP_Bool ReadImageData_1_0(PP_Resource device_context_2d, PP_Resource image, const struct PP_Point* top_left) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Testing_Private\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"ReadImageData\""); + AddProp(ss, "device_context_2d", ToString_PP_Resource(device_context_2d)); + AddProp(ss, "image", ToString_PP_Resource(image)); + AddProp(ss, "top_left", ToString_PP_Point(top_left)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Testing_Private_1_0*)RealGetInterface("PPB_Testing_Private;1.0"))->ReadImageData(device_context_2d, image, top_left); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void RunMessageLoop_1_0(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Testing_Private\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"RunMessageLoop\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Testing_Private_1_0*)RealGetInterface("PPB_Testing_Private;1.0"))->RunMessageLoop(instance); +#endif // !INTERPOSE +} +static void QuitMessageLoop_1_0(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Testing_Private\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"QuitMessageLoop\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Testing_Private_1_0*)RealGetInterface("PPB_Testing_Private;1.0"))->QuitMessageLoop(instance); +#endif // !INTERPOSE +} +static uint32_t GetLiveObjectsForInstance_1_0(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Testing_Private\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetLiveObjectsForInstance\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint32_t rval = ((PPB_Testing_Private_1_0*)RealGetInterface("PPB_Testing_Private;1.0"))->GetLiveObjectsForInstance(instance); + printf("RPC response: ["); + printf("%s", ToString_uint32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsOutOfProcess_1_0(void) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Testing_Private\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"IsOutOfProcess\""); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_Testing_Private_1_0*)RealGetInterface("PPB_Testing_Private;1.0"))->IsOutOfProcess(); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void PostPowerSaverStatus_1_0(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Testing_Private\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"PostPowerSaverStatus\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Testing_Private_1_0*)RealGetInterface("PPB_Testing_Private;1.0"))->PostPowerSaverStatus(instance); +#endif // !INTERPOSE +} +static void SubscribeToPowerSaverNotifications_1_0(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Testing_Private\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"SubscribeToPowerSaverNotifications\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Testing_Private_1_0*)RealGetInterface("PPB_Testing_Private;1.0"))->SubscribeToPowerSaverNotifications(instance); +#endif // !INTERPOSE +} +static void SimulateInputEvent_1_0(PP_Instance instance, PP_Resource input_event) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Testing_Private\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"SimulateInputEvent\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "input_event", ToString_PP_Resource(input_event)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Testing_Private_1_0*)RealGetInterface("PPB_Testing_Private;1.0"))->SimulateInputEvent(instance, input_event); +#endif // !INTERPOSE +} +static struct PP_Var GetDocumentURL_1_0(PP_Instance instance, struct PP_URLComponents_Dev* components) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Testing_Private\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetDocumentURL\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "components", PointerToString(components)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!components) { + iterator.skip(); + FromJSON_PP_URLComponents_Dev(iterator, *components); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_Testing_Private_1_0*)RealGetInterface("PPB_Testing_Private;1.0"))->GetDocumentURL(instance, components); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!components) { + AddProp(os, "components", ToString_PP_URLComponents_Dev(components)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static uint32_t GetLiveVars_1_0(struct PP_Var live_vars[], uint32_t array_size) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Testing_Private\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"GetLiveVars\""); + { + BeginProp(ss, "live_vars"); + BeginElements(ss); + for (uint32_t _n = 0; _n < array_size; ++_n) { + AddElement(ss, ToString_PP_Var(live_vars[_n])); + } + EndElements(ss); + } + AddProp(ss, "array_size", ToString_uint32_t(array_size)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + uint32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_uint32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + uint32_t rval = ((PPB_Testing_Private_1_0*)RealGetInterface("PPB_Testing_Private;1.0"))->GetLiveVars(live_vars, array_size); + printf("RPC response: ["); + printf("%s", ToString_uint32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void SetMinimumArrayBufferSizeForShmem_1_0(PP_Instance instance, uint32_t threshold) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Testing_Private\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"SetMinimumArrayBufferSizeForShmem\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "threshold", ToString_uint32_t(threshold)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Testing_Private_1_0*)RealGetInterface("PPB_Testing_Private;1.0"))->SetMinimumArrayBufferSizeForShmem(instance, threshold); +#endif // !INTERPOSE +} +static void RunV8GC_1_0(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_Testing_Private\""); + AddProp(ss, "__version", "\"1.0\""); + AddProp(ss, "__method", "\"RunV8GC\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_Testing_Private_1_0*)RealGetInterface("PPB_Testing_Private;1.0"))->RunV8GC(instance); +#endif // !INTERPOSE +} +} +static PPB_Testing_Private_1_0 _PPB_Testing_Private_1_0 = { + ns_PPB_Testing_Private_1_0::ReadImageData_1_0, + ns_PPB_Testing_Private_1_0::RunMessageLoop_1_0, + ns_PPB_Testing_Private_1_0::QuitMessageLoop_1_0, + ns_PPB_Testing_Private_1_0::GetLiveObjectsForInstance_1_0, + ns_PPB_Testing_Private_1_0::IsOutOfProcess_1_0, + ns_PPB_Testing_Private_1_0::PostPowerSaverStatus_1_0, + ns_PPB_Testing_Private_1_0::SubscribeToPowerSaverNotifications_1_0, + ns_PPB_Testing_Private_1_0::SimulateInputEvent_1_0, + ns_PPB_Testing_Private_1_0::GetDocumentURL_1_0, + ns_PPB_Testing_Private_1_0::GetLiveVars_1_0, + ns_PPB_Testing_Private_1_0::SetMinimumArrayBufferSizeForShmem_1_0, + ns_PPB_Testing_Private_1_0::RunV8GC_1_0, +}; +const string ToString_PPB_Testing_Private(const PPB_Testing_Private_1_0 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_UDPSocketFeature_Private(const PP_UDPSocketFeature_Private *v) { + switch (*v) { + case 0: + return "\"PP_UDPSOCKETFEATURE_PRIVATE_ADDRESS_REUSE\""; + case 1: + return "\"PP_UDPSOCKETFEATURE_PRIVATE_BROADCAST\""; + case 2: + return "\"PP_UDPSOCKETFEATURE_PRIVATE_COUNT\""; + default: + return "\"???\""; + } +} +const string ToString_PP_UDPSocketFeature_Private(const PP_UDPSocketFeature_Private &v) { + return ToString_PP_UDPSocketFeature_Private(&v); +} +void FromJSON_PP_UDPSocketFeature_Private(JSONIterator& iterator, PP_UDPSocketFeature_Private &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_UDPSocketFeature_Private(v); +} +namespace ns_PPB_UDPSocket_Private_0_2 { +static PP_Resource Create_0_2(PP_Instance instance_id) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket_Private\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance_id", ToString_PP_Instance(instance_id)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_UDPSocket_Private_0_2*)RealGetInterface("PPB_UDPSocket_Private;0.2"))->Create(instance_id); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsUDPSocket_0_2(PP_Resource resource_id) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket_Private\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"IsUDPSocket\""); + AddProp(ss, "resource_id", ToString_PP_Resource(resource_id)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_UDPSocket_Private_0_2*)RealGetInterface("PPB_UDPSocket_Private;0.2"))->IsUDPSocket(resource_id); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping SetSocketFeature */ +static int32_t Bind_0_2(PP_Resource udp_socket, const struct PP_NetAddress_Private* addr, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket_Private\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"Bind\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + AddProp(ss, "addr", ToString_PP_NetAddress_Private(addr)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_UDPSocket_Private_0_2*)RealGetInterface("PPB_UDPSocket_Private;0.2"))->Bind(udp_socket, addr, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping GetBoundAddress */ +static int32_t RecvFrom_0_2(PP_Resource udp_socket, char* buffer, int32_t num_bytes, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket_Private\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"RecvFrom\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + AddProp(ss, "buffer", PointerToString(buffer)); + AddProp(ss, "num_bytes", ToString_int32_t(num_bytes)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_str_t(iterator, buffer); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_UDPSocket_Private_0_2*)RealGetInterface("PPB_UDPSocket_Private;0.2"))->RecvFrom(udp_socket, buffer, num_bytes, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + AddProp(os, "buffer", ToString_str_t(buffer)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetRecvFromAddress_0_2(PP_Resource udp_socket, struct PP_NetAddress_Private* addr) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket_Private\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"GetRecvFromAddress\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + AddProp(ss, "addr", PointerToString(addr)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!addr) { + iterator.skip(); + FromJSON_PP_NetAddress_Private(iterator, *addr); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_UDPSocket_Private_0_2*)RealGetInterface("PPB_UDPSocket_Private;0.2"))->GetRecvFromAddress(udp_socket, addr); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!addr) { + AddProp(os, "addr", ToString_PP_NetAddress_Private(addr)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SendTo_0_2(PP_Resource udp_socket, const char* buffer, int32_t num_bytes, const struct PP_NetAddress_Private* addr, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket_Private\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"SendTo\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + AddProp(ss, "buffer", ToString_str_t(buffer)); + AddProp(ss, "num_bytes", ToString_int32_t(num_bytes)); + AddProp(ss, "addr", ToString_PP_NetAddress_Private(addr)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_UDPSocket_Private_0_2*)RealGetInterface("PPB_UDPSocket_Private;0.2"))->SendTo(udp_socket, buffer, num_bytes, addr, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void Close_0_2(PP_Resource udp_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket_Private\""); + AddProp(ss, "__version", "\"0.2\""); + AddProp(ss, "__method", "\"Close\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_UDPSocket_Private_0_2*)RealGetInterface("PPB_UDPSocket_Private;0.2"))->Close(udp_socket); +#endif // !INTERPOSE +} +} +static PPB_UDPSocket_Private_0_2 _PPB_UDPSocket_Private_0_2 = { + ns_PPB_UDPSocket_Private_0_2::Create_0_2, + ns_PPB_UDPSocket_Private_0_2::IsUDPSocket_0_2, + ns_PPB_UDPSocket_Private_0_2::Bind_0_2, + ns_PPB_UDPSocket_Private_0_2::RecvFrom_0_2, + ns_PPB_UDPSocket_Private_0_2::GetRecvFromAddress_0_2, + ns_PPB_UDPSocket_Private_0_2::SendTo_0_2, + ns_PPB_UDPSocket_Private_0_2::Close_0_2, +}; +const string ToString_PPB_UDPSocket_Private(const PPB_UDPSocket_Private_0_2 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_UDPSocket_Private_0_3 { +static PP_Resource Create_0_3(PP_Instance instance_id) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket_Private\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance_id", ToString_PP_Instance(instance_id)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_UDPSocket_Private_0_3*)RealGetInterface("PPB_UDPSocket_Private;0.3"))->Create(instance_id); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsUDPSocket_0_3(PP_Resource resource_id) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket_Private\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"IsUDPSocket\""); + AddProp(ss, "resource_id", ToString_PP_Resource(resource_id)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_UDPSocket_Private_0_3*)RealGetInterface("PPB_UDPSocket_Private;0.3"))->IsUDPSocket(resource_id); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +/* skipping SetSocketFeature */ +static int32_t Bind_0_3(PP_Resource udp_socket, const struct PP_NetAddress_Private* addr, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket_Private\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"Bind\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + AddProp(ss, "addr", ToString_PP_NetAddress_Private(addr)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_UDPSocket_Private_0_3*)RealGetInterface("PPB_UDPSocket_Private;0.3"))->Bind(udp_socket, addr, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetBoundAddress_0_3(PP_Resource udp_socket, struct PP_NetAddress_Private* addr) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket_Private\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"GetBoundAddress\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + AddProp(ss, "addr", PointerToString(addr)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!addr) { + iterator.skip(); + FromJSON_PP_NetAddress_Private(iterator, *addr); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_UDPSocket_Private_0_3*)RealGetInterface("PPB_UDPSocket_Private;0.3"))->GetBoundAddress(udp_socket, addr); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!addr) { + AddProp(os, "addr", ToString_PP_NetAddress_Private(addr)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t RecvFrom_0_3(PP_Resource udp_socket, char* buffer, int32_t num_bytes, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket_Private\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"RecvFrom\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + AddProp(ss, "buffer", PointerToString(buffer)); + AddProp(ss, "num_bytes", ToString_int32_t(num_bytes)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_str_t(iterator, buffer); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_UDPSocket_Private_0_3*)RealGetInterface("PPB_UDPSocket_Private;0.3"))->RecvFrom(udp_socket, buffer, num_bytes, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + AddProp(os, "buffer", ToString_str_t(buffer)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetRecvFromAddress_0_3(PP_Resource udp_socket, struct PP_NetAddress_Private* addr) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket_Private\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"GetRecvFromAddress\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + AddProp(ss, "addr", PointerToString(addr)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!addr) { + iterator.skip(); + FromJSON_PP_NetAddress_Private(iterator, *addr); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_UDPSocket_Private_0_3*)RealGetInterface("PPB_UDPSocket_Private;0.3"))->GetRecvFromAddress(udp_socket, addr); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!addr) { + AddProp(os, "addr", ToString_PP_NetAddress_Private(addr)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SendTo_0_3(PP_Resource udp_socket, const char* buffer, int32_t num_bytes, const struct PP_NetAddress_Private* addr, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket_Private\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"SendTo\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + AddProp(ss, "buffer", ToString_str_t(buffer)); + AddProp(ss, "num_bytes", ToString_int32_t(num_bytes)); + AddProp(ss, "addr", ToString_PP_NetAddress_Private(addr)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_UDPSocket_Private_0_3*)RealGetInterface("PPB_UDPSocket_Private;0.3"))->SendTo(udp_socket, buffer, num_bytes, addr, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void Close_0_3(PP_Resource udp_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket_Private\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"Close\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_UDPSocket_Private_0_3*)RealGetInterface("PPB_UDPSocket_Private;0.3"))->Close(udp_socket); +#endif // !INTERPOSE +} +} +static PPB_UDPSocket_Private_0_3 _PPB_UDPSocket_Private_0_3 = { + ns_PPB_UDPSocket_Private_0_3::Create_0_3, + ns_PPB_UDPSocket_Private_0_3::IsUDPSocket_0_3, + ns_PPB_UDPSocket_Private_0_3::Bind_0_3, + ns_PPB_UDPSocket_Private_0_3::GetBoundAddress_0_3, + ns_PPB_UDPSocket_Private_0_3::RecvFrom_0_3, + ns_PPB_UDPSocket_Private_0_3::GetRecvFromAddress_0_3, + ns_PPB_UDPSocket_Private_0_3::SendTo_0_3, + ns_PPB_UDPSocket_Private_0_3::Close_0_3, +}; +const string ToString_PPB_UDPSocket_Private(const PPB_UDPSocket_Private_0_3 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_UDPSocket_Private_0_4 { +static PP_Resource Create_0_4(PP_Instance instance_id) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket_Private\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance_id", ToString_PP_Instance(instance_id)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_UDPSocket_Private_0_4*)RealGetInterface("PPB_UDPSocket_Private;0.4"))->Create(instance_id); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsUDPSocket_0_4(PP_Resource resource_id) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket_Private\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"IsUDPSocket\""); + AddProp(ss, "resource_id", ToString_PP_Resource(resource_id)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_UDPSocket_Private_0_4*)RealGetInterface("PPB_UDPSocket_Private;0.4"))->IsUDPSocket(resource_id); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SetSocketFeature_0_4(PP_Resource udp_socket, PP_UDPSocketFeature_Private name, struct PP_Var value) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket_Private\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"SetSocketFeature\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + AddProp(ss, "name", ToString_PP_UDPSocketFeature_Private(name)); + AddProp(ss, "value", ToString_PP_Var(value)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_UDPSocket_Private_0_4*)RealGetInterface("PPB_UDPSocket_Private;0.4"))->SetSocketFeature(udp_socket, name, value); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Bind_0_4(PP_Resource udp_socket, const struct PP_NetAddress_Private* addr, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket_Private\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"Bind\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + AddProp(ss, "addr", ToString_PP_NetAddress_Private(addr)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_UDPSocket_Private_0_4*)RealGetInterface("PPB_UDPSocket_Private;0.4"))->Bind(udp_socket, addr, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetBoundAddress_0_4(PP_Resource udp_socket, struct PP_NetAddress_Private* addr) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket_Private\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"GetBoundAddress\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + AddProp(ss, "addr", PointerToString(addr)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!addr) { + iterator.skip(); + FromJSON_PP_NetAddress_Private(iterator, *addr); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_UDPSocket_Private_0_4*)RealGetInterface("PPB_UDPSocket_Private;0.4"))->GetBoundAddress(udp_socket, addr); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!addr) { + AddProp(os, "addr", ToString_PP_NetAddress_Private(addr)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t RecvFrom_0_4(PP_Resource udp_socket, char* buffer, int32_t num_bytes, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket_Private\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"RecvFrom\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + AddProp(ss, "buffer", PointerToString(buffer)); + AddProp(ss, "num_bytes", ToString_int32_t(num_bytes)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + iterator.skip(); + FromJSON_str_t(iterator, buffer); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_UDPSocket_Private_0_4*)RealGetInterface("PPB_UDPSocket_Private;0.4"))->RecvFrom(udp_socket, buffer, num_bytes, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + AddProp(os, "buffer", ToString_str_t(buffer)); + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool GetRecvFromAddress_0_4(PP_Resource udp_socket, struct PP_NetAddress_Private* addr) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket_Private\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"GetRecvFromAddress\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + AddProp(ss, "addr", PointerToString(addr)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!addr) { + iterator.skip(); + FromJSON_PP_NetAddress_Private(iterator, *addr); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_UDPSocket_Private_0_4*)RealGetInterface("PPB_UDPSocket_Private;0.4"))->GetRecvFromAddress(udp_socket, addr); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!addr) { + AddProp(os, "addr", ToString_PP_NetAddress_Private(addr)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t SendTo_0_4(PP_Resource udp_socket, const char* buffer, int32_t num_bytes, const struct PP_NetAddress_Private* addr, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket_Private\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"SendTo\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + AddProp(ss, "buffer", ToString_str_t(buffer)); + AddProp(ss, "num_bytes", ToString_int32_t(num_bytes)); + AddProp(ss, "addr", ToString_PP_NetAddress_Private(addr)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_UDPSocket_Private_0_4*)RealGetInterface("PPB_UDPSocket_Private;0.4"))->SendTo(udp_socket, buffer, num_bytes, addr, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void Close_0_4(PP_Resource udp_socket) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UDPSocket_Private\""); + AddProp(ss, "__version", "\"0.4\""); + AddProp(ss, "__method", "\"Close\""); + AddProp(ss, "udp_socket", ToString_PP_Resource(udp_socket)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_UDPSocket_Private_0_4*)RealGetInterface("PPB_UDPSocket_Private;0.4"))->Close(udp_socket); +#endif // !INTERPOSE +} +} +static PPB_UDPSocket_Private_0_4 _PPB_UDPSocket_Private_0_4 = { + ns_PPB_UDPSocket_Private_0_4::Create_0_4, + ns_PPB_UDPSocket_Private_0_4::IsUDPSocket_0_4, + ns_PPB_UDPSocket_Private_0_4::SetSocketFeature_0_4, + ns_PPB_UDPSocket_Private_0_4::Bind_0_4, + ns_PPB_UDPSocket_Private_0_4::GetBoundAddress_0_4, + ns_PPB_UDPSocket_Private_0_4::RecvFrom_0_4, + ns_PPB_UDPSocket_Private_0_4::GetRecvFromAddress_0_4, + ns_PPB_UDPSocket_Private_0_4::SendTo_0_4, + ns_PPB_UDPSocket_Private_0_4::Close_0_4, +}; +const string ToString_PPB_UDPSocket_Private(const PPB_UDPSocket_Private_0_4 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_UMA_Private_0_3 { +static void HistogramCustomTimes_0_3(PP_Instance instance, struct PP_Var name, int64_t sample, int64_t min, int64_t max, uint32_t bucket_count) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UMA_Private\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"HistogramCustomTimes\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "name", ToString_PP_Var(name)); + AddProp(ss, "sample", ToString_int64_t(sample)); + AddProp(ss, "min", ToString_int64_t(min)); + AddProp(ss, "max", ToString_int64_t(max)); + AddProp(ss, "bucket_count", ToString_uint32_t(bucket_count)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_UMA_Private_0_3*)RealGetInterface("PPB_UMA_Private;0.3"))->HistogramCustomTimes(instance, name, sample, min, max, bucket_count); +#endif // !INTERPOSE +} +static void HistogramCustomCounts_0_3(PP_Instance instance, struct PP_Var name, int32_t sample, int32_t min, int32_t max, uint32_t bucket_count) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UMA_Private\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"HistogramCustomCounts\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "name", ToString_PP_Var(name)); + AddProp(ss, "sample", ToString_int32_t(sample)); + AddProp(ss, "min", ToString_int32_t(min)); + AddProp(ss, "max", ToString_int32_t(max)); + AddProp(ss, "bucket_count", ToString_uint32_t(bucket_count)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_UMA_Private_0_3*)RealGetInterface("PPB_UMA_Private;0.3"))->HistogramCustomCounts(instance, name, sample, min, max, bucket_count); +#endif // !INTERPOSE +} +static void HistogramEnumeration_0_3(PP_Instance instance, struct PP_Var name, int32_t sample, int32_t boundary_value) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UMA_Private\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"HistogramEnumeration\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "name", ToString_PP_Var(name)); + AddProp(ss, "sample", ToString_int32_t(sample)); + AddProp(ss, "boundary_value", ToString_int32_t(boundary_value)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_UMA_Private_0_3*)RealGetInterface("PPB_UMA_Private;0.3"))->HistogramEnumeration(instance, name, sample, boundary_value); +#endif // !INTERPOSE +} +static int32_t IsCrashReportingEnabled_0_3(PP_Instance instance, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_UMA_Private\""); + AddProp(ss, "__version", "\"0.3\""); + AddProp(ss, "__method", "\"IsCrashReportingEnabled\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_UMA_Private_0_3*)RealGetInterface("PPB_UMA_Private;0.3"))->IsCrashReportingEnabled(instance, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_UMA_Private_0_3 _PPB_UMA_Private_0_3 = { + ns_PPB_UMA_Private_0_3::HistogramCustomTimes_0_3, + ns_PPB_UMA_Private_0_3::HistogramCustomCounts_0_3, + ns_PPB_UMA_Private_0_3::HistogramEnumeration_0_3, + ns_PPB_UMA_Private_0_3::IsCrashReportingEnabled_0_3, +}; +const string ToString_PPB_UMA_Private(const PPB_UMA_Private_0_3 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_VideoDestination_Private_0_1 { +static PP_Resource Create_0_1(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDestination_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_VideoDestination_Private_0_1*)RealGetInterface("PPB_VideoDestination_Private;0.1"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsVideoDestination_0_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDestination_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"IsVideoDestination\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_VideoDestination_Private_0_1*)RealGetInterface("PPB_VideoDestination_Private;0.1"))->IsVideoDestination(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Open_0_1(PP_Resource destination, struct PP_Var stream_url, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDestination_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Open\""); + AddProp(ss, "destination", ToString_PP_Resource(destination)); + AddProp(ss, "stream_url", ToString_PP_Var(stream_url)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoDestination_Private_0_1*)RealGetInterface("PPB_VideoDestination_Private;0.1"))->Open(destination, stream_url, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t PutFrame_0_1(PP_Resource destination, const struct PP_VideoFrame_Private* frame) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDestination_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"PutFrame\""); + AddProp(ss, "destination", ToString_PP_Resource(destination)); + AddProp(ss, "frame", ToString_PP_VideoFrame_Private(frame)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_VideoDestination_Private_0_1*)RealGetInterface("PPB_VideoDestination_Private;0.1"))->PutFrame(destination, frame); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void Close_0_1(PP_Resource destination) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoDestination_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Close\""); + AddProp(ss, "destination", ToString_PP_Resource(destination)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_VideoDestination_Private_0_1*)RealGetInterface("PPB_VideoDestination_Private;0.1"))->Close(destination); +#endif // !INTERPOSE +} +} +static PPB_VideoDestination_Private_0_1 _PPB_VideoDestination_Private_0_1 = { + ns_PPB_VideoDestination_Private_0_1::Create_0_1, + ns_PPB_VideoDestination_Private_0_1::IsVideoDestination_0_1, + ns_PPB_VideoDestination_Private_0_1::Open_0_1, + ns_PPB_VideoDestination_Private_0_1::PutFrame_0_1, + ns_PPB_VideoDestination_Private_0_1::Close_0_1, +}; +const string ToString_PPB_VideoDestination_Private(const PPB_VideoDestination_Private_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +namespace ns_PPB_VideoSource_Private_0_1 { +static PP_Resource Create_0_1(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoSource_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_VideoSource_Private_0_1*)RealGetInterface("PPB_VideoSource_Private;0.1"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsVideoSource_0_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoSource_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"IsVideoSource\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_VideoSource_Private_0_1*)RealGetInterface("PPB_VideoSource_Private;0.1"))->IsVideoSource(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t Open_0_1(PP_Resource source, struct PP_Var stream_url, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoSource_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Open\""); + AddProp(ss, "source", ToString_PP_Resource(source)); + AddProp(ss, "stream_url", ToString_PP_Var(stream_url)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoSource_Private_0_1*)RealGetInterface("PPB_VideoSource_Private;0.1"))->Open(source, stream_url, logging_callback); + printf("RPC response: ["); + printf("%s", ToString_int32_t(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static int32_t GetFrame_0_1(PP_Resource source, struct PP_VideoFrame_Private* frame, struct PP_CompletionCallback callback) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoSource_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetFrame\""); + AddProp(ss, "source", ToString_PP_Resource(source)); + AddProp(ss, "frame", PointerToString(frame)); + AddProp(ss, "callback", ToString_PP_CompletionCallback(callback)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_int32_t(iterator, rval); + iterator.expectObjectAndGotoFirstProperty(); + if (!!frame) { + iterator.skip(); + FromJSON_PP_VideoFrame_Private(iterator, *frame); + } + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_CompletionCallback logging_callback; + logging_callback.func = &Logging_PP_CompletionCallback; + logging_callback.user_data = new PP_CompletionCallback(callback); + logging_callback.flags = callback.flags; + int32_t rval = ((PPB_VideoSource_Private_0_1*)RealGetInterface("PPB_VideoSource_Private;0.1"))->GetFrame(source, frame, logging_callback); + printf("RPC response: ["); + printf("["); + printf("%s", ToString_int32_t(rval).c_str()); + printf(","); + std::stringstream os; + BeginProps(os); + if (!!frame) { + AddProp(os, "frame", ToString_PP_VideoFrame_Private(frame)); + } + EndProps(os); + printf("%s]", os.str().c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static void Close_0_1(PP_Resource source) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_VideoSource_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Close\""); + AddProp(ss, "source", ToString_PP_Resource(source)); + EndProps(ss); +#ifndef INTERPOSE + RPC(ss); +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + ((PPB_VideoSource_Private_0_1*)RealGetInterface("PPB_VideoSource_Private;0.1"))->Close(source); +#endif // !INTERPOSE +} +} +static PPB_VideoSource_Private_0_1 _PPB_VideoSource_Private_0_1 = { + ns_PPB_VideoSource_Private_0_1::Create_0_1, + ns_PPB_VideoSource_Private_0_1::IsVideoSource_0_1, + ns_PPB_VideoSource_Private_0_1::Open_0_1, + ns_PPB_VideoSource_Private_0_1::GetFrame_0_1, + ns_PPB_VideoSource_Private_0_1::Close_0_1, +}; +const string ToString_PPB_VideoSource_Private(const PPB_VideoSource_Private_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +const string ToString_PP_X509Certificate_Private_Field(const PP_X509Certificate_Private_Field *v) { + switch (*v) { + case 0: + return "\"PP_X509CERTIFICATE_PRIVATE_ISSUER_COMMON_NAME\""; + case 1: + return "\"PP_X509CERTIFICATE_PRIVATE_ISSUER_LOCALITY_NAME\""; + case 2: + return "\"PP_X509CERTIFICATE_PRIVATE_ISSUER_STATE_OR_PROVINCE_NAME\""; + case 3: + return "\"PP_X509CERTIFICATE_PRIVATE_ISSUER_COUNTRY_NAME\""; + case 4: + return "\"PP_X509CERTIFICATE_PRIVATE_ISSUER_ORGANIZATION_NAME\""; + case 5: + return "\"PP_X509CERTIFICATE_PRIVATE_ISSUER_ORGANIZATION_UNIT_NAME\""; + case 6: + return "\"PP_X509CERTIFICATE_PRIVATE_ISSUER_UNIQUE_ID\""; + case 7: + return "\"PP_X509CERTIFICATE_PRIVATE_SUBJECT_COMMON_NAME\""; + case 8: + return "\"PP_X509CERTIFICATE_PRIVATE_SUBJECT_LOCALITY_NAME\""; + case 9: + return "\"PP_X509CERTIFICATE_PRIVATE_SUBJECT_STATE_OR_PROVINCE_NAME\""; + case 10: + return "\"PP_X509CERTIFICATE_PRIVATE_SUBJECT_COUNTRY_NAME\""; + case 11: + return "\"PP_X509CERTIFICATE_PRIVATE_SUBJECT_ORGANIZATION_NAME\""; + case 12: + return "\"PP_X509CERTIFICATE_PRIVATE_SUBJECT_ORGANIZATION_UNIT_NAME\""; + case 13: + return "\"PP_X509CERTIFICATE_PRIVATE_SUBJECT_UNIQUE_ID\""; + case 14: + return "\"PP_X509CERTIFICATE_PRIVATE_VERSION\""; + case 15: + return "\"PP_X509CERTIFICATE_PRIVATE_SERIAL_NUMBER\""; + case 16: + return "\"PP_X509CERTIFICATE_PRIVATE_SIGNATURE_ALGORITHM_OID\""; + case 17: + return "\"PP_X509CERTIFICATE_PRIVATE_SIGNATURE_ALGORITHM_PARAMATERS_RAW\""; + case 18: + return "\"PP_X509CERTIFICATE_PRIVATE_VALIDITY_NOT_BEFORE\""; + case 19: + return "\"PP_X509CERTIFICATE_PRIVATE_VALIDITY_NOT_AFTER\""; + case 20: + return "\"PP_X509CERTIFICATE_PRIVATE_SUBJECT_PUBLIC_KEY_ALGORITHM_OID\""; + case 21: + return "\"PP_X509CERTIFICATE_PRIVATE_SUBJECT_PUBLIC_KEY\""; + case 22: + return "\"PP_X509CERTIFICATE_PRIVATE_RAW\""; + case 23: + return "\"PP_X509CERTIFICATE_PRIVATE_ISSUER_DISTINGUISHED_NAME\""; + case 24: + return "\"PP_X509CERTIFICATE_PRIVATE_SUBJECT_DISTINGUISHED_NAME\""; + default: + return "\"???\""; + } +} +const string ToString_PP_X509Certificate_Private_Field(const PP_X509Certificate_Private_Field &v) { + return ToString_PP_X509Certificate_Private_Field(&v); +} +void FromJSON_PP_X509Certificate_Private_Field(JSONIterator& iterator, PP_X509Certificate_Private_Field &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_X509Certificate_Private_Field(v); +} +const string ToString_PPB_X509Certificate_Private_Version(const PPB_X509Certificate_Private_Version *v) { + switch (*v) { + case 0: + return "\"PP_X509CERTIFICATE_PRIVATE_V1\""; + case 1: + return "\"PP_X509CERTIFICATE_PRIVATE_V2\""; + case 2: + return "\"PP_X509CERTIFICATE_PRIVATE_V3\""; + default: + return "\"???\""; + } +} +const string ToString_PPB_X509Certificate_Private_Version(const PPB_X509Certificate_Private_Version &v) { + return ToString_PPB_X509Certificate_Private_Version(&v); +} +void FromJSON_PPB_X509Certificate_Private_Version(JSONIterator& iterator, PPB_X509Certificate_Private_Version &value) { + long int v; + FromJSON_int(iterator, v); + value = PPB_X509Certificate_Private_Version(v); +} +namespace ns_PPB_X509Certificate_Private_0_1 { +static PP_Resource Create_0_1(PP_Instance instance) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_X509Certificate_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Create\""); + AddProp(ss, "instance", ToString_PP_Instance(instance)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + int32_t rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Resource(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + int32_t rval = ((PPB_X509Certificate_Private_0_1*)RealGetInterface("PPB_X509Certificate_Private;0.1"))->Create(instance); + printf("RPC response: ["); + printf("%s", ToString_PP_Resource(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool IsX509CertificatePrivate_0_1(PP_Resource resource) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_X509Certificate_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"IsX509CertificatePrivate\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_X509Certificate_Private_0_1*)RealGetInterface("PPB_X509Certificate_Private;0.1"))->IsX509CertificatePrivate(resource); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static PP_Bool Initialize_0_1(PP_Resource resource, const char* bytes, uint32_t length) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_X509Certificate_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"Initialize\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + AddProp(ss, "bytes", ToString_str_t(bytes)); + AddProp(ss, "length", ToString_uint32_t(length)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + PP_Bool rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Bool(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + PP_Bool rval = ((PPB_X509Certificate_Private_0_1*)RealGetInterface("PPB_X509Certificate_Private;0.1"))->Initialize(resource, bytes, length); + printf("RPC response: ["); + printf("%s", ToString_PP_Bool(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +static struct PP_Var GetField_0_1(PP_Resource resource, PP_X509Certificate_Private_Field field) { + stringstream ss; + BeginProps(ss); + AddProp(ss, "__interface", "\"PPB_X509Certificate_Private\""); + AddProp(ss, "__version", "\"0.1\""); + AddProp(ss, "__method", "\"GetField\""); + AddProp(ss, "resource", ToString_PP_Resource(resource)); + AddProp(ss, "field", ToString_PP_X509Certificate_Private_Field(field)); + EndProps(ss); +#ifndef INTERPOSE + string json = RPCWithResult(ss); + struct PP_Var rval; + JSONIterator iterator(json); + iterator.expectArrayAndGotoFirstItem(); + FromJSON_PP_Var(iterator, rval); + return rval; +#else // !INTERPOSE + printf("%s\n", ss.str().c_str()); + struct PP_Var rval = ((PPB_X509Certificate_Private_0_1*)RealGetInterface("PPB_X509Certificate_Private;0.1"))->GetField(resource, field); + printf("RPC response: ["); + printf("%s", ToString_PP_Var(rval).c_str()); + printf("]\n"); + return rval; +#endif // !INTERPOSE +} +} +static PPB_X509Certificate_Private_0_1 _PPB_X509Certificate_Private_0_1 = { + ns_PPB_X509Certificate_Private_0_1::Create_0_1, + ns_PPB_X509Certificate_Private_0_1::IsX509CertificatePrivate_0_1, + ns_PPB_X509Certificate_Private_0_1::Initialize_0_1, + ns_PPB_X509Certificate_Private_0_1::GetField_0_1, +}; +const string ToString_PPB_X509Certificate_Private(const PPB_X509Certificate_Private_0_1 *v) { + stringstream s; + s << v; + return s.str(); +} +char* Call_PPP_ContentDecryptor_Private_Initialize(const PPP_ContentDecryptor_Private* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + uint32_t promise_id; + iterator.skip(); + FromJSON_uint32_t(iterator, promise_id); + struct PP_Var key_system; + iterator.skip(); + FromJSON_PP_Var(iterator, key_system); + PP_Bool allow_distinctive_identifier; + iterator.skip(); + FromJSON_PP_Bool(iterator, allow_distinctive_identifier); + PP_Bool allow_persistent_state; + iterator.skip(); + FromJSON_PP_Bool(iterator, allow_persistent_state); + _interface->Initialize((PP_Instance )instance, (uint32_t )promise_id, (struct PP_Var )key_system, (PP_Bool )allow_distinctive_identifier, (PP_Bool )allow_persistent_state); + return nullptr; +} +char* Call_PPP_ContentDecryptor_Private_SetServerCertificate(const PPP_ContentDecryptor_Private* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + uint32_t promise_id; + iterator.skip(); + FromJSON_uint32_t(iterator, promise_id); + struct PP_Var server_certificate; + iterator.skip(); + FromJSON_PP_Var(iterator, server_certificate); + _interface->SetServerCertificate((PP_Instance )instance, (uint32_t )promise_id, (struct PP_Var )server_certificate); + return nullptr; +} +char* Call_PPP_ContentDecryptor_Private_CreateSessionAndGenerateRequest(const PPP_ContentDecryptor_Private* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + uint32_t promise_id; + iterator.skip(); + FromJSON_uint32_t(iterator, promise_id); + PP_SessionType session_type; + iterator.skip(); + FromJSON_PP_SessionType(iterator, session_type); + PP_InitDataType init_data_type; + iterator.skip(); + FromJSON_PP_InitDataType(iterator, init_data_type); + struct PP_Var init_data; + iterator.skip(); + FromJSON_PP_Var(iterator, init_data); + _interface->CreateSessionAndGenerateRequest((PP_Instance )instance, (uint32_t )promise_id, (PP_SessionType )session_type, (PP_InitDataType )init_data_type, (struct PP_Var )init_data); + return nullptr; +} +char* Call_PPP_ContentDecryptor_Private_LoadSession(const PPP_ContentDecryptor_Private* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + uint32_t promise_id; + iterator.skip(); + FromJSON_uint32_t(iterator, promise_id); + PP_SessionType session_type; + iterator.skip(); + FromJSON_PP_SessionType(iterator, session_type); + struct PP_Var session_id; + iterator.skip(); + FromJSON_PP_Var(iterator, session_id); + _interface->LoadSession((PP_Instance )instance, (uint32_t )promise_id, (PP_SessionType )session_type, (struct PP_Var )session_id); + return nullptr; +} +char* Call_PPP_ContentDecryptor_Private_UpdateSession(const PPP_ContentDecryptor_Private* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + uint32_t promise_id; + iterator.skip(); + FromJSON_uint32_t(iterator, promise_id); + struct PP_Var session_id; + iterator.skip(); + FromJSON_PP_Var(iterator, session_id); + struct PP_Var response; + iterator.skip(); + FromJSON_PP_Var(iterator, response); + _interface->UpdateSession((PP_Instance )instance, (uint32_t )promise_id, (struct PP_Var )session_id, (struct PP_Var )response); + return nullptr; +} +char* Call_PPP_ContentDecryptor_Private_CloseSession(const PPP_ContentDecryptor_Private* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + uint32_t promise_id; + iterator.skip(); + FromJSON_uint32_t(iterator, promise_id); + struct PP_Var session_id; + iterator.skip(); + FromJSON_PP_Var(iterator, session_id); + _interface->CloseSession((PP_Instance )instance, (uint32_t )promise_id, (struct PP_Var )session_id); + return nullptr; +} +char* Call_PPP_ContentDecryptor_Private_RemoveSession(const PPP_ContentDecryptor_Private* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + uint32_t promise_id; + iterator.skip(); + FromJSON_uint32_t(iterator, promise_id); + struct PP_Var session_id; + iterator.skip(); + FromJSON_PP_Var(iterator, session_id); + _interface->RemoveSession((PP_Instance )instance, (uint32_t )promise_id, (struct PP_Var )session_id); + return nullptr; +} +char* Call_PPP_ContentDecryptor_Private_Decrypt(const PPP_ContentDecryptor_Private* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + PP_Resource encrypted_block; + iterator.skip(); + FromJSON_PP_Resource(iterator, encrypted_block); + struct PP_EncryptedBlockInfo encrypted_block_info; + iterator.skip(); + FromJSON_PP_EncryptedBlockInfo(iterator, encrypted_block_info); + _interface->Decrypt((PP_Instance )instance, (PP_Resource )encrypted_block, (const struct PP_EncryptedBlockInfo* )&encrypted_block_info); + return nullptr; +} +char* Call_PPP_ContentDecryptor_Private_InitializeAudioDecoder(const PPP_ContentDecryptor_Private* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + struct PP_AudioDecoderConfig decoder_config; + iterator.skip(); + FromJSON_PP_AudioDecoderConfig(iterator, decoder_config); + PP_Resource codec_extra_data; + iterator.skip(); + FromJSON_PP_Resource(iterator, codec_extra_data); + _interface->InitializeAudioDecoder((PP_Instance )instance, (const struct PP_AudioDecoderConfig* )&decoder_config, (PP_Resource )codec_extra_data); + return nullptr; +} +char* Call_PPP_ContentDecryptor_Private_InitializeVideoDecoder(const PPP_ContentDecryptor_Private* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + struct PP_VideoDecoderConfig decoder_config; + iterator.skip(); + FromJSON_PP_VideoDecoderConfig(iterator, decoder_config); + PP_Resource codec_extra_data; + iterator.skip(); + FromJSON_PP_Resource(iterator, codec_extra_data); + _interface->InitializeVideoDecoder((PP_Instance )instance, (const struct PP_VideoDecoderConfig* )&decoder_config, (PP_Resource )codec_extra_data); + return nullptr; +} +char* Call_PPP_ContentDecryptor_Private_DeinitializeDecoder(const PPP_ContentDecryptor_Private* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + PP_DecryptorStreamType decoder_type; + iterator.skip(); + FromJSON_PP_DecryptorStreamType(iterator, decoder_type); + uint32_t request_id; + iterator.skip(); + FromJSON_uint32_t(iterator, request_id); + _interface->DeinitializeDecoder((PP_Instance )instance, (PP_DecryptorStreamType )decoder_type, (uint32_t )request_id); + return nullptr; +} +char* Call_PPP_ContentDecryptor_Private_ResetDecoder(const PPP_ContentDecryptor_Private* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + PP_DecryptorStreamType decoder_type; + iterator.skip(); + FromJSON_PP_DecryptorStreamType(iterator, decoder_type); + uint32_t request_id; + iterator.skip(); + FromJSON_uint32_t(iterator, request_id); + _interface->ResetDecoder((PP_Instance )instance, (PP_DecryptorStreamType )decoder_type, (uint32_t )request_id); + return nullptr; +} +char* Call_PPP_ContentDecryptor_Private_DecryptAndDecode(const PPP_ContentDecryptor_Private* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + PP_DecryptorStreamType decoder_type; + iterator.skip(); + FromJSON_PP_DecryptorStreamType(iterator, decoder_type); + PP_Resource encrypted_buffer; + iterator.skip(); + FromJSON_PP_Resource(iterator, encrypted_buffer); + struct PP_EncryptedBlockInfo encrypted_block_info; + iterator.skip(); + FromJSON_PP_EncryptedBlockInfo(iterator, encrypted_block_info); + _interface->DecryptAndDecode((PP_Instance )instance, (PP_DecryptorStreamType )decoder_type, (PP_Resource )encrypted_buffer, (const struct PP_EncryptedBlockInfo* )&encrypted_block_info); + return nullptr; +} +char* Call_PPP_ContentDecryptor_Private(const void* _interface, JSONIterator& iterator) { + iterator.skip(); + const Token& member = iterator.getCurrentStringAndGotoNext(); + string memberName = member.value(); + if (!memberName.compare("Initialize")) { + return Call_PPP_ContentDecryptor_Private_Initialize((const PPP_ContentDecryptor_Private*)_interface, iterator); + } + if (!memberName.compare("SetServerCertificate")) { + return Call_PPP_ContentDecryptor_Private_SetServerCertificate((const PPP_ContentDecryptor_Private*)_interface, iterator); + } + if (!memberName.compare("CreateSessionAndGenerateRequest")) { + return Call_PPP_ContentDecryptor_Private_CreateSessionAndGenerateRequest((const PPP_ContentDecryptor_Private*)_interface, iterator); + } + if (!memberName.compare("LoadSession")) { + return Call_PPP_ContentDecryptor_Private_LoadSession((const PPP_ContentDecryptor_Private*)_interface, iterator); + } + if (!memberName.compare("UpdateSession")) { + return Call_PPP_ContentDecryptor_Private_UpdateSession((const PPP_ContentDecryptor_Private*)_interface, iterator); + } + if (!memberName.compare("CloseSession")) { + return Call_PPP_ContentDecryptor_Private_CloseSession((const PPP_ContentDecryptor_Private*)_interface, iterator); + } + if (!memberName.compare("RemoveSession")) { + return Call_PPP_ContentDecryptor_Private_RemoveSession((const PPP_ContentDecryptor_Private*)_interface, iterator); + } + if (!memberName.compare("Decrypt")) { + return Call_PPP_ContentDecryptor_Private_Decrypt((const PPP_ContentDecryptor_Private*)_interface, iterator); + } + if (!memberName.compare("InitializeAudioDecoder")) { + return Call_PPP_ContentDecryptor_Private_InitializeAudioDecoder((const PPP_ContentDecryptor_Private*)_interface, iterator); + } + if (!memberName.compare("InitializeVideoDecoder")) { + return Call_PPP_ContentDecryptor_Private_InitializeVideoDecoder((const PPP_ContentDecryptor_Private*)_interface, iterator); + } + if (!memberName.compare("DeinitializeDecoder")) { + return Call_PPP_ContentDecryptor_Private_DeinitializeDecoder((const PPP_ContentDecryptor_Private*)_interface, iterator); + } + if (!memberName.compare("ResetDecoder")) { + return Call_PPP_ContentDecryptor_Private_ResetDecoder((const PPP_ContentDecryptor_Private*)_interface, iterator); + } + if (!memberName.compare("DecryptAndDecode")) { + return Call_PPP_ContentDecryptor_Private_DecryptAndDecode((const PPP_ContentDecryptor_Private*)_interface, iterator); + } + return nullptr; +} +char* Call_PPP_Find_Private_StartFind(const PPP_Find_Private* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + char* text; + iterator.skip(); + FromJSON_str_t(iterator, text); + PP_Bool case_sensitive; + iterator.skip(); + FromJSON_PP_Bool(iterator, case_sensitive); + PP_Bool rval; + rval = _interface->StartFind((PP_Instance )instance, (const char* )text, (PP_Bool )case_sensitive); + return strdup(ToString_PP_Bool(rval).c_str()); +} +char* Call_PPP_Find_Private_SelectFindResult(const PPP_Find_Private* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + PP_Bool forward; + iterator.skip(); + FromJSON_PP_Bool(iterator, forward); + _interface->SelectFindResult((PP_Instance )instance, (PP_Bool )forward); + return nullptr; +} +char* Call_PPP_Find_Private_StopFind(const PPP_Find_Private* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + _interface->StopFind((PP_Instance )instance); + return nullptr; +} +char* Call_PPP_Find_Private(const void* _interface, JSONIterator& iterator) { + iterator.skip(); + const Token& member = iterator.getCurrentStringAndGotoNext(); + string memberName = member.value(); + if (!memberName.compare("StartFind")) { + return Call_PPP_Find_Private_StartFind((const PPP_Find_Private*)_interface, iterator); + } + if (!memberName.compare("SelectFindResult")) { + return Call_PPP_Find_Private_SelectFindResult((const PPP_Find_Private*)_interface, iterator); + } + if (!memberName.compare("StopFind")) { + return Call_PPP_Find_Private_StopFind((const PPP_Find_Private*)_interface, iterator); + } + return nullptr; +} +const string ToString_PP_Flash_BrowserOperations_SettingType(const PP_Flash_BrowserOperations_SettingType *v) { + switch (*v) { + case 0: + return "\"PP_FLASH_BROWSEROPERATIONS_SETTINGTYPE_CAMERAMIC\""; + case 1: + return "\"PP_FLASH_BROWSEROPERATIONS_SETTINGTYPE_PEERNETWORKING\""; + default: + return "\"???\""; + } +} +const string ToString_PP_Flash_BrowserOperations_SettingType(const PP_Flash_BrowserOperations_SettingType &v) { + return ToString_PP_Flash_BrowserOperations_SettingType(&v); +} +void FromJSON_PP_Flash_BrowserOperations_SettingType(JSONIterator& iterator, PP_Flash_BrowserOperations_SettingType &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_Flash_BrowserOperations_SettingType(v); +} +const string ToString_PP_Flash_BrowserOperations_Permission(const PP_Flash_BrowserOperations_Permission *v) { + switch (*v) { + case 0: + return "\"PP_FLASH_BROWSEROPERATIONS_PERMISSION_DEFAULT\""; + case 1: + return "\"PP_FLASH_BROWSEROPERATIONS_PERMISSION_ALLOW\""; + case 2: + return "\"PP_FLASH_BROWSEROPERATIONS_PERMISSION_BLOCK\""; + case 3: + return "\"PP_FLASH_BROWSEROPERATIONS_PERMISSION_ASK\""; + default: + return "\"???\""; + } +} +const string ToString_PP_Flash_BrowserOperations_Permission(const PP_Flash_BrowserOperations_Permission &v) { + return ToString_PP_Flash_BrowserOperations_Permission(&v); +} +void FromJSON_PP_Flash_BrowserOperations_Permission(JSONIterator& iterator, PP_Flash_BrowserOperations_Permission &value) { + long int v; + FromJSON_int(iterator, v); + value = PP_Flash_BrowserOperations_Permission(v); +} +const string ToString_PP_Flash_BrowserOperations_SiteSetting(const PP_Flash_BrowserOperations_SiteSetting *v) { + if (!v) { + return "null"; + } + return ToString_PP_Flash_BrowserOperations_SiteSetting(*v); +} +const string ToString_PP_Flash_BrowserOperations_SiteSetting(const PP_Flash_BrowserOperations_SiteSetting &v) { + stringstream x; + BeginProps(x); + AddProp(x, "site", ToString_cstr_t(v.site)); + AddProp(x, "permission", ToString_PP_Flash_BrowserOperations_Permission(v.permission)); + EndProps(x); + return x.str(); +} +void FromJSON_PP_Flash_BrowserOperations_SiteSetting(JSONIterator& iterator, PP_Flash_BrowserOperations_SiteSetting &value) { + const JSON::Token& current = iterator.getCurrentAndGotoNext(); + if (current.isPrimitive() && !current.value().compare("null")) { + return; + } + if (!current.isObject()) { + Fail("Expected object!", ""); + } + iterator.skip(); + FromJSON_cstr_t(iterator, value.site); + iterator.skip(); + FromJSON_PP_Flash_BrowserOperations_Permission(iterator, value.permission); +} +const string ToString_PPB_Flash_BrowserOperations_GetSettingsCallback(const PPB_Flash_BrowserOperations_GetSettingsCallback &v) { + return PointerToString(v); +} +void FromJSON_PPB_Flash_BrowserOperations_GetSettingsCallback(JSONIterator& iterator, PPB_Flash_BrowserOperations_GetSettingsCallback &value) { + PointerValueFromJSON(iterator, value); +} +char* Call_PPP_Flash_BrowserOperations_ClearSiteData(const PPP_Flash_BrowserOperations_1_0* _interface, JSONIterator& iterator) { + char* plugin_data_path; + iterator.skip(); + FromJSON_str_t(iterator, plugin_data_path); + char* site; + iterator.skip(); + FromJSON_str_t(iterator, site); + uint64_t flags; + iterator.skip(); + FromJSON_uint64_t(iterator, flags); + uint64_t max_age; + iterator.skip(); + FromJSON_uint64_t(iterator, max_age); + PP_Bool rval; + rval = _interface->ClearSiteData((const char* )plugin_data_path, (const char* )site, (uint64_t )flags, (uint64_t )max_age); + return strdup(ToString_PP_Bool(rval).c_str()); +} +/* skipping DeauthorizeContentLicenses */ +/* skipping GetPermissionSettings */ +/* skipping SetDefaultPermission */ +/* skipping SetSitePermission */ +/* skipping GetSitesWithData */ +/* skipping FreeSiteList */ +char* Call_PPP_Flash_BrowserOperations_1_0(const void* _interface, JSONIterator& iterator) { + iterator.skip(); + const Token& member = iterator.getCurrentStringAndGotoNext(); + string memberName = member.value(); + if (!memberName.compare("ClearSiteData")) { + return Call_PPP_Flash_BrowserOperations_ClearSiteData((const PPP_Flash_BrowserOperations_1_0*)_interface, iterator); + } +/* skipping DeauthorizeContentLicenses */ +/* skipping GetPermissionSettings */ +/* skipping SetDefaultPermission */ +/* skipping SetSitePermission */ +/* skipping GetSitesWithData */ +/* skipping FreeSiteList */ + return nullptr; +} +char* Call_PPP_Flash_BrowserOperations_ClearSiteData(const PPP_Flash_BrowserOperations_1_2* _interface, JSONIterator& iterator) { + char* plugin_data_path; + iterator.skip(); + FromJSON_str_t(iterator, plugin_data_path); + char* site; + iterator.skip(); + FromJSON_str_t(iterator, site); + uint64_t flags; + iterator.skip(); + FromJSON_uint64_t(iterator, flags); + uint64_t max_age; + iterator.skip(); + FromJSON_uint64_t(iterator, max_age); + PP_Bool rval; + rval = _interface->ClearSiteData((const char* )plugin_data_path, (const char* )site, (uint64_t )flags, (uint64_t )max_age); + return strdup(ToString_PP_Bool(rval).c_str()); +} +char* Call_PPP_Flash_BrowserOperations_DeauthorizeContentLicenses(const PPP_Flash_BrowserOperations_1_2* _interface, JSONIterator& iterator) { + char* plugin_data_path; + iterator.skip(); + FromJSON_str_t(iterator, plugin_data_path); + PP_Bool rval; + rval = _interface->DeauthorizeContentLicenses((const char* )plugin_data_path); + return strdup(ToString_PP_Bool(rval).c_str()); +} +char* Call_PPP_Flash_BrowserOperations_GetPermissionSettings(const PPP_Flash_BrowserOperations_1_2* _interface, JSONIterator& iterator) { + char* plugin_data_path; + iterator.skip(); + FromJSON_str_t(iterator, plugin_data_path); + PP_Flash_BrowserOperations_SettingType setting_type; + iterator.skip(); + FromJSON_PP_Flash_BrowserOperations_SettingType(iterator, setting_type); + PPB_Flash_BrowserOperations_GetSettingsCallback callback; + iterator.skip(); + FromJSON_PPB_Flash_BrowserOperations_GetSettingsCallback(iterator, callback); + void* user_data; + iterator.skip(); + FromJSON_mem_t(iterator, user_data); + _interface->GetPermissionSettings((const char* )plugin_data_path, (PP_Flash_BrowserOperations_SettingType )setting_type, (PPB_Flash_BrowserOperations_GetSettingsCallback )callback, (void* )user_data); + stringstream os; + BeginElements(os); + BeginProps(os); + AddProp(os, "user_data", ToString_mem_t(user_data)); + EndProps(os); + EndElements(os); + return strdup(os.str().c_str()); +} +char* Call_PPP_Flash_BrowserOperations_SetDefaultPermission(const PPP_Flash_BrowserOperations_1_2* _interface, JSONIterator& iterator) { + char* plugin_data_path; + iterator.skip(); + FromJSON_str_t(iterator, plugin_data_path); + PP_Flash_BrowserOperations_SettingType setting_type; + iterator.skip(); + FromJSON_PP_Flash_BrowserOperations_SettingType(iterator, setting_type); + PP_Flash_BrowserOperations_Permission permission; + iterator.skip(); + FromJSON_PP_Flash_BrowserOperations_Permission(iterator, permission); + PP_Bool clear_site_specific; + iterator.skip(); + FromJSON_PP_Bool(iterator, clear_site_specific); + PP_Bool rval; + rval = _interface->SetDefaultPermission((const char* )plugin_data_path, (PP_Flash_BrowserOperations_SettingType )setting_type, (PP_Flash_BrowserOperations_Permission )permission, (PP_Bool )clear_site_specific); + return strdup(ToString_PP_Bool(rval).c_str()); +} +char* Call_PPP_Flash_BrowserOperations_SetSitePermission(const PPP_Flash_BrowserOperations_1_2* _interface, JSONIterator& iterator) { + char* plugin_data_path; + iterator.skip(); + FromJSON_str_t(iterator, plugin_data_path); + PP_Flash_BrowserOperations_SettingType setting_type; + iterator.skip(); + FromJSON_PP_Flash_BrowserOperations_SettingType(iterator, setting_type); + uint32_t site_count; + iterator.skip(); + FromJSON_uint32_t(iterator, site_count); + struct PP_Flash_BrowserOperations_SiteSetting *sites; + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > site_count) { + Fail("Too many items in array\n", ""); + } + sites = new struct PP_Flash_BrowserOperations_SiteSetting[site_count]; + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_PP_Flash_BrowserOperations_SiteSetting(iterator, (sites)[_n]); + } + // FIXME Null out remaining items? + } + PP_Bool rval; + rval = _interface->SetSitePermission((const char* )plugin_data_path, (PP_Flash_BrowserOperations_SettingType )setting_type, (uint32_t )site_count, (const struct PP_Flash_BrowserOperations_SiteSetting *)sites); + return strdup(ToString_PP_Bool(rval).c_str()); +} +/* skipping GetSitesWithData */ +/* skipping FreeSiteList */ +char* Call_PPP_Flash_BrowserOperations_1_2(const void* _interface, JSONIterator& iterator) { + iterator.skip(); + const Token& member = iterator.getCurrentStringAndGotoNext(); + string memberName = member.value(); + if (!memberName.compare("ClearSiteData")) { + return Call_PPP_Flash_BrowserOperations_ClearSiteData((const PPP_Flash_BrowserOperations_1_2*)_interface, iterator); + } + if (!memberName.compare("DeauthorizeContentLicenses")) { + return Call_PPP_Flash_BrowserOperations_DeauthorizeContentLicenses((const PPP_Flash_BrowserOperations_1_2*)_interface, iterator); + } + if (!memberName.compare("GetPermissionSettings")) { + return Call_PPP_Flash_BrowserOperations_GetPermissionSettings((const PPP_Flash_BrowserOperations_1_2*)_interface, iterator); + } + if (!memberName.compare("SetDefaultPermission")) { + return Call_PPP_Flash_BrowserOperations_SetDefaultPermission((const PPP_Flash_BrowserOperations_1_2*)_interface, iterator); + } + if (!memberName.compare("SetSitePermission")) { + return Call_PPP_Flash_BrowserOperations_SetSitePermission((const PPP_Flash_BrowserOperations_1_2*)_interface, iterator); + } +/* skipping GetSitesWithData */ +/* skipping FreeSiteList */ + return nullptr; +} +char* Call_PPP_Flash_BrowserOperations_ClearSiteData(const PPP_Flash_BrowserOperations* _interface, JSONIterator& iterator) { + char* plugin_data_path; + iterator.skip(); + FromJSON_str_t(iterator, plugin_data_path); + char* site; + iterator.skip(); + FromJSON_str_t(iterator, site); + uint64_t flags; + iterator.skip(); + FromJSON_uint64_t(iterator, flags); + uint64_t max_age; + iterator.skip(); + FromJSON_uint64_t(iterator, max_age); + PP_Bool rval; + rval = _interface->ClearSiteData((const char* )plugin_data_path, (const char* )site, (uint64_t )flags, (uint64_t )max_age); + return strdup(ToString_PP_Bool(rval).c_str()); +} +char* Call_PPP_Flash_BrowserOperations_DeauthorizeContentLicenses(const PPP_Flash_BrowserOperations* _interface, JSONIterator& iterator) { + char* plugin_data_path; + iterator.skip(); + FromJSON_str_t(iterator, plugin_data_path); + PP_Bool rval; + rval = _interface->DeauthorizeContentLicenses((const char* )plugin_data_path); + return strdup(ToString_PP_Bool(rval).c_str()); +} +char* Call_PPP_Flash_BrowserOperations_GetPermissionSettings(const PPP_Flash_BrowserOperations* _interface, JSONIterator& iterator) { + char* plugin_data_path; + iterator.skip(); + FromJSON_str_t(iterator, plugin_data_path); + PP_Flash_BrowserOperations_SettingType setting_type; + iterator.skip(); + FromJSON_PP_Flash_BrowserOperations_SettingType(iterator, setting_type); + PPB_Flash_BrowserOperations_GetSettingsCallback callback; + iterator.skip(); + FromJSON_PPB_Flash_BrowserOperations_GetSettingsCallback(iterator, callback); + void* user_data; + iterator.skip(); + FromJSON_mem_t(iterator, user_data); + _interface->GetPermissionSettings((const char* )plugin_data_path, (PP_Flash_BrowserOperations_SettingType )setting_type, (PPB_Flash_BrowserOperations_GetSettingsCallback )callback, (void* )user_data); + stringstream os; + BeginElements(os); + BeginProps(os); + AddProp(os, "user_data", ToString_mem_t(user_data)); + EndProps(os); + EndElements(os); + return strdup(os.str().c_str()); +} +char* Call_PPP_Flash_BrowserOperations_SetDefaultPermission(const PPP_Flash_BrowserOperations* _interface, JSONIterator& iterator) { + char* plugin_data_path; + iterator.skip(); + FromJSON_str_t(iterator, plugin_data_path); + PP_Flash_BrowserOperations_SettingType setting_type; + iterator.skip(); + FromJSON_PP_Flash_BrowserOperations_SettingType(iterator, setting_type); + PP_Flash_BrowserOperations_Permission permission; + iterator.skip(); + FromJSON_PP_Flash_BrowserOperations_Permission(iterator, permission); + PP_Bool clear_site_specific; + iterator.skip(); + FromJSON_PP_Bool(iterator, clear_site_specific); + PP_Bool rval; + rval = _interface->SetDefaultPermission((const char* )plugin_data_path, (PP_Flash_BrowserOperations_SettingType )setting_type, (PP_Flash_BrowserOperations_Permission )permission, (PP_Bool )clear_site_specific); + return strdup(ToString_PP_Bool(rval).c_str()); +} +char* Call_PPP_Flash_BrowserOperations_SetSitePermission(const PPP_Flash_BrowserOperations* _interface, JSONIterator& iterator) { + char* plugin_data_path; + iterator.skip(); + FromJSON_str_t(iterator, plugin_data_path); + PP_Flash_BrowserOperations_SettingType setting_type; + iterator.skip(); + FromJSON_PP_Flash_BrowserOperations_SettingType(iterator, setting_type); + uint32_t site_count; + iterator.skip(); + FromJSON_uint32_t(iterator, site_count); + struct PP_Flash_BrowserOperations_SiteSetting *sites; + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + if (children > site_count) { + Fail("Too many items in array\n", ""); + } + sites = new struct PP_Flash_BrowserOperations_SiteSetting[site_count]; + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_PP_Flash_BrowserOperations_SiteSetting(iterator, (sites)[_n]); + } + // FIXME Null out remaining items? + } + PP_Bool rval; + rval = _interface->SetSitePermission((const char* )plugin_data_path, (PP_Flash_BrowserOperations_SettingType )setting_type, (uint32_t )site_count, (const struct PP_Flash_BrowserOperations_SiteSetting *)sites); + return strdup(ToString_PP_Bool(rval).c_str()); +} +char* Call_PPP_Flash_BrowserOperations_GetSitesWithData(const PPP_Flash_BrowserOperations* _interface, JSONIterator& iterator) { + char* plugin_data_path; + iterator.skip(); + FromJSON_str_t(iterator, plugin_data_path); + char* *sites; + iterator.skip(); + PointerValueFromJSON(iterator, sites); + _interface->GetSitesWithData((const char* )plugin_data_path, (char*** )&sites); + stringstream os; + BeginElements(os); + BeginProps(os); + { + BeginProp(os, "sites"); + BeginElements(os); + for (uint32_t _n = 0; sites[_n] != 0; ++_n) { + AddElement(os, ToString_str_t(sites[_n])); + } + EndElements(os); + } + EndProps(os); + EndElements(os); + return strdup(os.str().c_str()); +} +char* Call_PPP_Flash_BrowserOperations_FreeSiteList(const PPP_Flash_BrowserOperations* _interface, JSONIterator& iterator) { + char* *sites; + iterator.skip(); + + { + size_t children = iterator.expectArrayAndGotoFirstItem(); + sites = new char*[children]; + for (uint32_t _n = 0; _n < children; ++_n) { + FromJSON_str_t(iterator, (sites)[_n]); + } + // FIXME Null out remaining items? + } + _interface->FreeSiteList((char* *)sites); + stringstream os; + BeginElements(os); + BeginProps(os); + { + BeginProp(os, "sites"); + BeginElements(os); + for (uint32_t _n = 0; sites[_n] != 0; ++_n) { + AddElement(os, ToString_str_t(sites[_n])); + } + EndElements(os); + } + EndProps(os); + EndElements(os); + return strdup(os.str().c_str()); +} +char* Call_PPP_Flash_BrowserOperations(const void* _interface, JSONIterator& iterator) { + iterator.skip(); + const Token& member = iterator.getCurrentStringAndGotoNext(); + string memberName = member.value(); + if (!memberName.compare("ClearSiteData")) { + return Call_PPP_Flash_BrowserOperations_ClearSiteData((const PPP_Flash_BrowserOperations*)_interface, iterator); + } + if (!memberName.compare("DeauthorizeContentLicenses")) { + return Call_PPP_Flash_BrowserOperations_DeauthorizeContentLicenses((const PPP_Flash_BrowserOperations*)_interface, iterator); + } + if (!memberName.compare("GetPermissionSettings")) { + return Call_PPP_Flash_BrowserOperations_GetPermissionSettings((const PPP_Flash_BrowserOperations*)_interface, iterator); + } + if (!memberName.compare("SetDefaultPermission")) { + return Call_PPP_Flash_BrowserOperations_SetDefaultPermission((const PPP_Flash_BrowserOperations*)_interface, iterator); + } + if (!memberName.compare("SetSitePermission")) { + return Call_PPP_Flash_BrowserOperations_SetSitePermission((const PPP_Flash_BrowserOperations*)_interface, iterator); + } + if (!memberName.compare("GetSitesWithData")) { + return Call_PPP_Flash_BrowserOperations_GetSitesWithData((const PPP_Flash_BrowserOperations*)_interface, iterator); + } + if (!memberName.compare("FreeSiteList")) { + return Call_PPP_Flash_BrowserOperations_FreeSiteList((const PPP_Flash_BrowserOperations*)_interface, iterator); + } + return nullptr; +} +char* Call_PPP_Instance_Private_GetInstanceObject(const PPP_Instance_Private* _interface, JSONIterator& iterator) { + PP_Instance instance; + iterator.skip(); + FromJSON_PP_Instance(iterator, instance); + struct PP_Var rval; + rval = _interface->GetInstanceObject((PP_Instance )instance); + return strdup(ToString_PP_Var(rval).c_str()); +} +char* Call_PPP_Instance_Private(const void* _interface, JSONIterator& iterator) { + iterator.skip(); + const Token& member = iterator.getCurrentStringAndGotoNext(); + string memberName = member.value(); + if (!memberName.compare("GetInstanceObject")) { + return Call_PPP_Instance_Private_GetInstanceObject((const PPP_Instance_Private*)_interface, iterator); + } + return nullptr; +} +char* Call_PPP_PexeStreamHandler_DidCacheHit(const PPP_PexeStreamHandler* _interface, JSONIterator& iterator) { + void* user_data; + iterator.skip(); + FromJSON_mem_t(iterator, user_data); + PP_FileHandle nexe_file_handle; + iterator.skip(); + FromJSON_PP_FileHandle(iterator, nexe_file_handle); + _interface->DidCacheHit((void* )user_data, (PP_FileHandle )nexe_file_handle); + stringstream os; + BeginElements(os); + BeginProps(os); + AddProp(os, "user_data", ToString_mem_t(user_data)); + EndProps(os); + EndElements(os); + return strdup(os.str().c_str()); +} +char* Call_PPP_PexeStreamHandler_DidCacheMiss(const PPP_PexeStreamHandler* _interface, JSONIterator& iterator) { + void* user_data; + iterator.skip(); + FromJSON_mem_t(iterator, user_data); + int64_t expected_total_length; + iterator.skip(); + FromJSON_int64_t(iterator, expected_total_length); + PP_FileHandle temp_nexe_file; + iterator.skip(); + FromJSON_PP_FileHandle(iterator, temp_nexe_file); + _interface->DidCacheMiss((void* )user_data, (int64_t )expected_total_length, (PP_FileHandle )temp_nexe_file); + stringstream os; + BeginElements(os); + BeginProps(os); + AddProp(os, "user_data", ToString_mem_t(user_data)); + EndProps(os); + EndElements(os); + return strdup(os.str().c_str()); +} +char* Call_PPP_PexeStreamHandler_DidStreamData(const PPP_PexeStreamHandler* _interface, JSONIterator& iterator) { + void* user_data; + iterator.skip(); + FromJSON_mem_t(iterator, user_data); + void* data; + iterator.skip(); + FromJSON_mem_t(iterator, data); + int32_t length; + iterator.skip(); + FromJSON_int32_t(iterator, length); + _interface->DidStreamData((void* )user_data, (const void* )data, (int32_t )length); + stringstream os; + BeginElements(os); + BeginProps(os); + AddProp(os, "user_data", ToString_mem_t(user_data)); + EndProps(os); + EndElements(os); + return strdup(os.str().c_str()); +} +char* Call_PPP_PexeStreamHandler_DidFinishStream(const PPP_PexeStreamHandler* _interface, JSONIterator& iterator) { + void* user_data; + iterator.skip(); + FromJSON_mem_t(iterator, user_data); + int32_t pp_error; + iterator.skip(); + FromJSON_int32_t(iterator, pp_error); + _interface->DidFinishStream((void* )user_data, (int32_t )pp_error); + stringstream os; + BeginElements(os); + BeginProps(os); + AddProp(os, "user_data", ToString_mem_t(user_data)); + EndProps(os); + EndElements(os); + return strdup(os.str().c_str()); +} +char* Call_PPP_PexeStreamHandler(const void* _interface, JSONIterator& iterator) { + iterator.skip(); + const Token& member = iterator.getCurrentStringAndGotoNext(); + string memberName = member.value(); + if (!memberName.compare("DidCacheHit")) { + return Call_PPP_PexeStreamHandler_DidCacheHit((const PPP_PexeStreamHandler*)_interface, iterator); + } + if (!memberName.compare("DidCacheMiss")) { + return Call_PPP_PexeStreamHandler_DidCacheMiss((const PPP_PexeStreamHandler*)_interface, iterator); + } + if (!memberName.compare("DidStreamData")) { + return Call_PPP_PexeStreamHandler_DidStreamData((const PPP_PexeStreamHandler*)_interface, iterator); + } + if (!memberName.compare("DidFinishStream")) { + return Call_PPP_PexeStreamHandler_DidFinishStream((const PPP_PexeStreamHandler*)_interface, iterator); + } + return nullptr; +} +static map gInterfaces; + +typedef char* (*InterfaceMemberCallFunc)(const void*, JSONIterator&); +static map gInterfaceMemberCallers; + +void InitializeInterfaceList() { + gInterfaces.insert(pair("PPB_Audio;1.0", &_PPB_Audio_1_0)); + gInterfaces.insert(pair("PPB_Audio;1.1", &_PPB_Audio_1_1)); + gInterfaces.insert(pair("PPB_AudioBuffer;0.1", &_PPB_AudioBuffer_0_1)); + gInterfaces.insert(pair("PPB_AudioConfig;1.0", &_PPB_AudioConfig_1_0)); + gInterfaces.insert(pair("PPB_AudioConfig;1.1", &_PPB_AudioConfig_1_1)); + gInterfaces.insert(pair("PPB_AudioEncoder;0.1", &_PPB_AudioEncoder_0_1)); + gInterfaces.insert(pair("PPB_Compositor;0.1", &_PPB_Compositor_0_1)); + gInterfaces.insert(pair("PPB_CompositorLayer;0.1", &_PPB_CompositorLayer_0_1)); + gInterfaces.insert(pair("PPB_CompositorLayer;0.2", &_PPB_CompositorLayer_0_2)); + gInterfaces.insert(pair("PPB_Console;1.0", &_PPB_Console_1_0)); + gInterfaces.insert(pair("PPB_Core;1.0", &_PPB_Core_1_0)); + gInterfaces.insert(pair("PPB_FileIO;1.0", &_PPB_FileIO_1_0)); + gInterfaces.insert(pair("PPB_FileIO;1.1", &_PPB_FileIO_1_1)); + gInterfaces.insert(pair("PPB_FileRef;1.0", &_PPB_FileRef_1_0)); + gInterfaces.insert(pair("PPB_FileRef;1.1", &_PPB_FileRef_1_1)); + gInterfaces.insert(pair("PPB_FileRef;1.2", &_PPB_FileRef_1_2)); + gInterfaces.insert(pair("PPB_FileSystem;1.0", &_PPB_FileSystem_1_0)); + gInterfaces.insert(pair("PPB_Fullscreen;1.0", &_PPB_Fullscreen_1_0)); + gInterfaces.insert(pair("PPB_Gamepad;1.0", &_PPB_Gamepad_1_0)); + gInterfaces.insert(pair("PPB_Graphics2D;1.0", &_PPB_Graphics2D_1_0)); + gInterfaces.insert(pair("PPB_Graphics2D;1.1", &_PPB_Graphics2D_1_1)); + gInterfaces.insert(pair("PPB_Graphics2D;1.2", &_PPB_Graphics2D_1_2)); + gInterfaces.insert(pair("PPB_Graphics3D;1.0", &_PPB_Graphics3D_1_0)); + gInterfaces.insert(pair("PPB_HostResolver;1.0", &_PPB_HostResolver_1_0)); + gInterfaces.insert(pair("PPB_ImageData;1.0", &_PPB_ImageData_1_0)); + gInterfaces.insert(pair("PPB_InputEvent;1.0", &_PPB_InputEvent_1_0)); + gInterfaces.insert(pair("PPB_MouseInputEvent;1.0", &_PPB_MouseInputEvent_1_0)); + gInterfaces.insert(pair("PPB_MouseInputEvent;1.1", &_PPB_MouseInputEvent_1_1)); + gInterfaces.insert(pair("PPB_WheelInputEvent;1.0", &_PPB_WheelInputEvent_1_0)); + gInterfaces.insert(pair("PPB_KeyboardInputEvent;1.0", &_PPB_KeyboardInputEvent_1_0)); + gInterfaces.insert(pair("PPB_KeyboardInputEvent;1.2", &_PPB_KeyboardInputEvent_1_2)); + gInterfaces.insert(pair("PPB_TouchInputEvent;1.0", &_PPB_TouchInputEvent_1_0)); + gInterfaces.insert(pair("PPB_IMEInputEvent;1.0", &_PPB_IMEInputEvent_1_0)); + gInterfaces.insert(pair("PPB_Instance;1.0", &_PPB_Instance_1_0)); + gInterfaces.insert(pair("PPB_MediaStreamAudioTrack;0.1", &_PPB_MediaStreamAudioTrack_0_1)); + gInterfaces.insert(pair("PPB_MediaStreamVideoTrack;0.1", &_PPB_MediaStreamVideoTrack_0_1)); + gInterfaces.insert(pair("PPB_MediaStreamVideoTrack;1.0", &_PPB_MediaStreamVideoTrack_1_0)); + gInterfaces.insert(pair("PPB_MessageLoop;1.0", &_PPB_MessageLoop_1_0)); + gInterfaces.insert(pair("PPB_Messaging;1.0", &_PPB_Messaging_1_0)); + gInterfaces.insert(pair("PPB_Messaging;1.2", &_PPB_Messaging_1_2)); + gInterfaces.insert(pair("PPB_MouseCursor;1.0", &_PPB_MouseCursor_1_0)); + gInterfaces.insert(pair("PPB_MouseLock;1.0", &_PPB_MouseLock_1_0)); + gInterfaces.insert(pair("PPB_NetAddress;1.0", &_PPB_NetAddress_1_0)); + gInterfaces.insert(pair("PPB_NetworkList;1.0", &_PPB_NetworkList_1_0)); + gInterfaces.insert(pair("PPB_NetworkMonitor;1.0", &_PPB_NetworkMonitor_1_0)); + gInterfaces.insert(pair("PPB_NetworkProxy;1.0", &_PPB_NetworkProxy_1_0)); + gInterfaces.insert(pair("PPB_OpenGLES2;1.0", &_PPB_OpenGLES2_1_0)); + gInterfaces.insert(pair("PPB_OpenGLES2InstancedArrays;1.0", &_PPB_OpenGLES2InstancedArrays_1_0)); + gInterfaces.insert(pair("PPB_OpenGLES2FramebufferBlit;1.0", &_PPB_OpenGLES2FramebufferBlit_1_0)); + gInterfaces.insert(pair("PPB_OpenGLES2FramebufferMultisample;1.0", &_PPB_OpenGLES2FramebufferMultisample_1_0)); + gInterfaces.insert(pair("PPB_OpenGLES2ChromiumEnableFeature;1.0", &_PPB_OpenGLES2ChromiumEnableFeature_1_0)); + gInterfaces.insert(pair("PPB_OpenGLES2ChromiumMapSub;1.0", &_PPB_OpenGLES2ChromiumMapSub_1_0)); + gInterfaces.insert(pair("PPB_OpenGLES2Query;1.0", &_PPB_OpenGLES2Query_1_0)); + gInterfaces.insert(pair("PPB_OpenGLES2VertexArrayObject;1.0", &_PPB_OpenGLES2VertexArrayObject_1_0)); + gInterfaces.insert(pair("PPB_TCPSocket;1.0", &_PPB_TCPSocket_1_0)); + gInterfaces.insert(pair("PPB_TCPSocket;1.1", &_PPB_TCPSocket_1_1)); + gInterfaces.insert(pair("PPB_TCPSocket;1.2", &_PPB_TCPSocket_1_2)); + gInterfaces.insert(pair("PPB_TextInputController;1.0", &_PPB_TextInputController_1_0)); + gInterfaces.insert(pair("PPB_UDPSocket;1.0", &_PPB_UDPSocket_1_0)); + gInterfaces.insert(pair("PPB_UDPSocket;1.1", &_PPB_UDPSocket_1_1)); + gInterfaces.insert(pair("PPB_UDPSocket;1.2", &_PPB_UDPSocket_1_2)); + gInterfaces.insert(pair("PPB_URLLoader;1.0", &_PPB_URLLoader_1_0)); + gInterfaces.insert(pair("PPB_URLRequestInfo;1.0", &_PPB_URLRequestInfo_1_0)); + gInterfaces.insert(pair("PPB_URLResponseInfo;1.0", &_PPB_URLResponseInfo_1_0)); + gInterfaces.insert(pair("PPB_Var;1.0", &_PPB_Var_1_0)); + gInterfaces.insert(pair("PPB_Var;1.1", &_PPB_Var_1_1)); + gInterfaces.insert(pair("PPB_Var;1.2", &_PPB_Var_1_2)); + gInterfaces.insert(pair("PPB_VarArray;1.0", &_PPB_VarArray_1_0)); + gInterfaces.insert(pair("PPB_VarArrayBuffer;1.0", &_PPB_VarArrayBuffer_1_0)); + gInterfaces.insert(pair("PPB_VarDictionary;1.0", &_PPB_VarDictionary_1_0)); + gInterfaces.insert(pair("PPB_VideoDecoder;0.1", &_PPB_VideoDecoder_0_1)); + gInterfaces.insert(pair("PPB_VideoDecoder;0.2", &_PPB_VideoDecoder_0_2)); + gInterfaces.insert(pair("PPB_VideoDecoder;1.0", &_PPB_VideoDecoder_1_0)); + gInterfaces.insert(pair("PPB_VideoDecoder;1.1", &_PPB_VideoDecoder_1_1)); + gInterfaces.insert(pair("PPB_VideoEncoder;0.1", &_PPB_VideoEncoder_0_1)); + gInterfaces.insert(pair("PPB_VideoEncoder;0.2", &_PPB_VideoEncoder_0_2)); + gInterfaces.insert(pair("PPB_VideoFrame;0.1", &_PPB_VideoFrame_0_1)); + gInterfaces.insert(pair("PPB_View;1.0", &_PPB_View_1_0)); + gInterfaces.insert(pair("PPB_View;1.1", &_PPB_View_1_1)); + gInterfaces.insert(pair("PPB_View;1.2", &_PPB_View_1_2)); + gInterfaces.insert(pair("PPB_VpnProvider;0.1", &_PPB_VpnProvider_0_1)); + gInterfaces.insert(pair("PPB_WebSocket;1.0", &_PPB_WebSocket_1_0)); + gInterfaces.insert(pair("PPB_BrokerTrusted;0.2", &_PPB_BrokerTrusted_0_2)); + gInterfaces.insert(pair("PPB_BrokerTrusted;0.3", &_PPB_BrokerTrusted_0_3)); + gInterfaces.insert(pair("PPB_BrowserFont_Trusted;1.0", &_PPB_BrowserFont_Trusted_1_0)); + gInterfaces.insert(pair("PPB_CharSet_Trusted;1.0", &_PPB_CharSet_Trusted_1_0)); + gInterfaces.insert(pair("PPB_FileChooserTrusted;0.5", &_PPB_FileChooserTrusted_0_5)); + gInterfaces.insert(pair("PPB_FileChooserTrusted;0.6", &_PPB_FileChooserTrusted_0_6)); + gInterfaces.insert(pair("PPB_URLLoaderTrusted;0.3", &_PPB_URLLoaderTrusted_0_3)); + gInterfaces.insert(pair("PPB_AudioInput(Dev);0.3", &_PPB_AudioInput_Dev_0_3)); + gInterfaces.insert(pair("PPB_AudioInput(Dev);0.4", &_PPB_AudioInput_Dev_0_4)); + gInterfaces.insert(pair("PPB_Buffer(Dev);0.4", &_PPB_Buffer_Dev_0_4)); + gInterfaces.insert(pair("PPB_CharSet(Dev);0.4", &_PPB_CharSet_Dev_0_4)); + gInterfaces.insert(pair("PPB_Crypto(Dev);0.1", &_PPB_Crypto_Dev_0_1)); + gInterfaces.insert(pair("PPB_CursorControl(Dev);0.4", &_PPB_CursorControl_Dev_0_4)); + gInterfaces.insert(pair("PPB_DeviceRef(Dev);0.1", &_PPB_DeviceRef_Dev_0_1)); + gInterfaces.insert(pair("PPB_FileChooser(Dev);0.5", &_PPB_FileChooser_Dev_0_5)); + gInterfaces.insert(pair("PPB_FileChooser(Dev);0.6", &_PPB_FileChooser_Dev_0_6)); + gInterfaces.insert(pair("PPB_Font(Dev);0.6", &_PPB_Font_Dev_0_6)); + gInterfaces.insert(pair("PPB_IMEInputEvent(Dev);0.1", &_PPB_IMEInputEvent_Dev_0_1)); + gInterfaces.insert(pair("PPB_IMEInputEvent(Dev);0.2", &_PPB_IMEInputEvent_Dev_0_2)); + gInterfaces.insert(pair("PPB_Memory(Dev);0.1", &_PPB_Memory_Dev_0_1)); + gInterfaces.insert(pair("PPB_OpenGLES2DrawBuffers(Dev);1.0", &_PPB_OpenGLES2DrawBuffers_Dev_1_0)); + gInterfaces.insert(pair("PPB_Printing(Dev);0.7", &_PPB_Printing_Dev_0_7)); + gInterfaces.insert(pair("PPB_TextInput(Dev);0.1", &_PPB_TextInput_Dev_0_1)); + gInterfaces.insert(pair("PPB_TextInput(Dev);0.2", &_PPB_TextInput_Dev_0_2)); + gInterfaces.insert(pair("PPB_Trace_Event(Dev);0.1", &_PPB_Trace_Event_Dev_0_1)); + gInterfaces.insert(pair("PPB_Trace_Event(Dev);0.2", &_PPB_Trace_Event_Dev_0_2)); + gInterfaces.insert(pair("PPB_TrueTypeFont(Dev);0.1", &_PPB_TrueTypeFont_Dev_0_1)); + gInterfaces.insert(pair("PPB_URLUtil(Dev);0.6", &_PPB_URLUtil_Dev_0_6)); + gInterfaces.insert(pair("PPB_URLUtil(Dev);0.7", &_PPB_URLUtil_Dev_0_7)); + gInterfaces.insert(pair("PPB_Var(Deprecated);0.3", &_PPB_Var_Deprecated_0_3)); + gInterfaces.insert(pair("PPB_VideoCapture(Dev);0.3", &_PPB_VideoCapture_Dev_0_3)); + gInterfaces.insert(pair("PPB_VideoDecoder(Dev);0.16", &_PPB_VideoDecoder_Dev_0_16)); + gInterfaces.insert(pair("PPB_View(Dev);0.1", &_PPB_View_Dev_0_1)); + gInterfaces.insert(pair("PPB_CameraCapabilities_Private;0.1", &_PPB_CameraCapabilities_Private_0_1)); + gInterfaces.insert(pair("PPB_CameraDevice_Private;0.1", &_PPB_CameraDevice_Private_0_1)); + gInterfaces.insert(pair("PPB_ContentDecryptor_Private;0.14", &_PPB_ContentDecryptor_Private_0_14)); + gInterfaces.insert(pair("PPB_DisplayColorProfile_Private;0.1", &_PPB_DisplayColorProfile_Private_0_1)); + gInterfaces.insert(pair("PPB_Ext_CrxFileSystem_Private;0.1", &_PPB_Ext_CrxFileSystem_Private_0_1)); + gInterfaces.insert(pair("PPB_FileIO_Private;0.1", &_PPB_FileIO_Private_0_1)); + gInterfaces.insert(pair("PPB_FileRefPrivate;0.1", &_PPB_FileRefPrivate_0_1)); + gInterfaces.insert(pair("PPB_Find_Private;0.3", &_PPB_Find_Private_0_3)); + gInterfaces.insert(pair("PPB_Flash;12.4", &_PPB_Flash_12_4)); + gInterfaces.insert(pair("PPB_Flash;12.5", &_PPB_Flash_12_5)); + gInterfaces.insert(pair("PPB_Flash;12.6", &_PPB_Flash_12_6)); + gInterfaces.insert(pair("PPB_Flash;13.0", &_PPB_Flash_13_0)); + gInterfaces.insert(pair("PPB_Flash_Clipboard;4.0", &_PPB_Flash_Clipboard_4_0)); + gInterfaces.insert(pair("PPB_Flash_Clipboard;5.0", &_PPB_Flash_Clipboard_5_0)); + gInterfaces.insert(pair("PPB_Flash_Clipboard;5.1", &_PPB_Flash_Clipboard_5_1)); + gInterfaces.insert(pair("PPB_Flash_DeviceID;1.0", &_PPB_Flash_DeviceID_1_0)); + gInterfaces.insert(pair("PPB_Flash_DRM;1.0", &_PPB_Flash_DRM_1_0)); + gInterfaces.insert(pair("PPB_Flash_DRM;1.1", &_PPB_Flash_DRM_1_1)); + gInterfaces.insert(pair("PPB_Flash_File_ModuleLocal;3", &_PPB_Flash_File_ModuleLocal_3_0)); + gInterfaces.insert(pair("PPB_Flash_File_FileRef;2", &_PPB_Flash_File_FileRef_2_0)); + gInterfaces.insert(pair("PPB_Flash_FontFile;0.1", &_PPB_Flash_FontFile_0_1)); + gInterfaces.insert(pair("PPB_Flash_FontFile;0.2", &_PPB_Flash_FontFile_0_2)); + gInterfaces.insert(pair("PPB_FlashFullscreen;0.1", &_PPB_FlashFullscreen_0_1)); + gInterfaces.insert(pair("PPB_FlashFullscreen;1.0", &_PPB_FlashFullscreen_1_0)); + gInterfaces.insert(pair("PPB_Flash_Menu;0.2", &_PPB_Flash_Menu_0_2)); + gInterfaces.insert(pair("PPB_Flash_MessageLoop;0.1", &_PPB_Flash_MessageLoop_0_1)); + gInterfaces.insert(pair("PPB_Flash_Print;1.0", &_PPB_Flash_Print_1_0)); + gInterfaces.insert(pair("PPB_HostResolver_Private;0.1", &_PPB_HostResolver_Private_0_1)); + gInterfaces.insert(pair("PPB_Instance_Private;0.1", &_PPB_Instance_Private_0_1)); + gInterfaces.insert(pair("PPB_IsolatedFileSystem_Private;0.2", &_PPB_IsolatedFileSystem_Private_0_2)); + gInterfaces.insert(pair("PPB_NetAddress_Private;0.1", &_PPB_NetAddress_Private_0_1)); + gInterfaces.insert(pair("PPB_NetAddress_Private;1.0", &_PPB_NetAddress_Private_1_0)); + gInterfaces.insert(pair("PPB_NetAddress_Private;1.1", &_PPB_NetAddress_Private_1_1)); + gInterfaces.insert(pair("PPB_OutputProtection_Private;0.1", &_PPB_OutputProtection_Private_0_1)); + gInterfaces.insert(pair("PPB_PDF;1", &_PPB_PDF_0_1)); + gInterfaces.insert(pair("PPB_PlatformVerification_Private;0.2", &_PPB_PlatformVerification_Private_0_2)); + gInterfaces.insert(pair("PPB_TCPServerSocket_Private;0.1", &_PPB_TCPServerSocket_Private_0_1)); + gInterfaces.insert(pair("PPB_TCPServerSocket_Private;0.2", &_PPB_TCPServerSocket_Private_0_2)); + gInterfaces.insert(pair("PPB_TCPSocket_Private;0.3", &_PPB_TCPSocket_Private_0_3)); + gInterfaces.insert(pair("PPB_TCPSocket_Private;0.4", &_PPB_TCPSocket_Private_0_4)); + gInterfaces.insert(pair("PPB_TCPSocket_Private;0.5", &_PPB_TCPSocket_Private_0_5)); + gInterfaces.insert(pair("PPB_Testing_Private;1.0", &_PPB_Testing_Private_1_0)); + gInterfaces.insert(pair("PPB_UDPSocket_Private;0.2", &_PPB_UDPSocket_Private_0_2)); + gInterfaces.insert(pair("PPB_UDPSocket_Private;0.3", &_PPB_UDPSocket_Private_0_3)); + gInterfaces.insert(pair("PPB_UDPSocket_Private;0.4", &_PPB_UDPSocket_Private_0_4)); + gInterfaces.insert(pair("PPB_UMA_Private;0.3", &_PPB_UMA_Private_0_3)); + gInterfaces.insert(pair("PPB_VideoDestination_Private;0.1", &_PPB_VideoDestination_Private_0_1)); + gInterfaces.insert(pair("PPB_VideoSource_Private;0.1", &_PPB_VideoSource_Private_0_1)); + gInterfaces.insert(pair("PPB_X509Certificate_Private;0.1", &_PPB_X509Certificate_Private_0_1)); + gInterfaceMemberCallers.insert(pair("PPP_Graphics_3D;1.0", Call_PPP_Graphics3D)); + gInterfaceMemberCallers.insert(pair("PPP_InputEvent;0.1", Call_PPP_InputEvent)); + gInterfaceMemberCallers.insert(pair("PPP_Instance;1.0", Call_PPP_Instance_1_0)); + gInterfaceMemberCallers.insert(pair("PPP_Instance;1.1", Call_PPP_Instance)); + gInterfaceMemberCallers.insert(pair("PPP_MessageHandler;0.2", Call_PPP_MessageHandler)); + gInterfaceMemberCallers.insert(pair("PPP_Messaging;1.0", Call_PPP_Messaging)); + gInterfaceMemberCallers.insert(pair("PPP_MouseLock;1.0", Call_PPP_MouseLock)); + gInterfaceMemberCallers.insert(pair("PPP_Class_Deprecated;1.0", Call_PPP_Class_Deprecated)); + gInterfaceMemberCallers.insert(pair("PPP_NetworkState(Dev);0.1", Call_PPP_NetworkState_Dev)); + gInterfaceMemberCallers.insert(pair("PPP_Printing(Dev);0.6", Call_PPP_Printing_Dev)); + gInterfaceMemberCallers.insert(pair("PPP_TextInput(Dev);0.1", Call_PPP_TextInput_Dev)); + gInterfaceMemberCallers.insert(pair("PPP_VideoCapture(Dev);0.1", Call_PPP_VideoCapture_Dev)); + gInterfaceMemberCallers.insert(pair("PPP_VideoDecoder(Dev);0.11", Call_PPP_VideoDecoder_Dev)); + gInterfaceMemberCallers.insert(pair("PPP_ContentDecryptor_Private;0.16", Call_PPP_ContentDecryptor_Private)); + gInterfaceMemberCallers.insert(pair("PPP_Find_Private;0.3", Call_PPP_Find_Private)); + gInterfaceMemberCallers.insert(pair("PPP_Flash_BrowserOperations;1.0", Call_PPP_Flash_BrowserOperations_1_0)); + gInterfaceMemberCallers.insert(pair("PPP_Flash_BrowserOperations;1.2", Call_PPP_Flash_BrowserOperations_1_2)); + gInterfaceMemberCallers.insert(pair("PPP_Flash_BrowserOperations;1.3", Call_PPP_Flash_BrowserOperations)); + gInterfaceMemberCallers.insert(pair("PPP_Instance_Private;0.1", Call_PPP_Instance_Private)); + gInterfaceMemberCallers.insert(pair("PPP_PexeStreamHandler;1.0", Call_PPP_PexeStreamHandler)); +}; + From 6c19bb7391f0daadd68deab328948ea90a621492 Mon Sep 17 00:00:00 2001 From: lochang Date: Tue, 29 Nov 2016 18:21:00 -0500 Subject: [PATCH 14/70] Bug 1313295 - Integrate mortar into gecko build system. r=glandium --HG-- extra : rebase_source : 8c7b15dc524f196317754772394a0fc4bef6d3ad --- browser/extensions/mortar/moz.build | 11 +++++++++++ browser/extensions/moz.build | 6 ++++++ toolkit/moz.configure | 6 ++++++ 3 files changed, 23 insertions(+) create mode 100644 browser/extensions/mortar/moz.build diff --git a/browser/extensions/mortar/moz.build b/browser/extensions/mortar/moz.build new file mode 100644 index 000000000000..e53c88c23330 --- /dev/null +++ b/browser/extensions/mortar/moz.build @@ -0,0 +1,11 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +SOURCES += [ + 'host/rpc.cc', +] + +SharedLibrary('rpc') diff --git a/browser/extensions/moz.build b/browser/extensions/moz.build index 1aef7d916f4a..9dee8913b54c 100644 --- a/browser/extensions/moz.build +++ b/browser/extensions/moz.build @@ -19,3 +19,9 @@ if 'a' in CONFIG['GRE_MILESTONE']: 'formautofill', 'presentation', ] + +# Only include mortar system add-ons if we locally enable it +if CONFIG['MOZ_MORTAR']: + DIRS += [ + 'mortar', + ] diff --git a/toolkit/moz.configure b/toolkit/moz.configure index 331ca98fd434..eff00a8aaae4 100644 --- a/toolkit/moz.configure +++ b/toolkit/moz.configure @@ -866,6 +866,12 @@ with only_when('--enable-compile-environment'): set_config('LIBFUZZER', enable_libfuzzer) set_define('LIBFUZZER', enable_libfuzzer) +# Mortar +# ============================================================== +option('--enable-mortar', help='Enable mortar extension') + +set_config('MOZ_MORTAR', True, when='--enable-mortar') + # Marionette is a Web Driver / Selenium comamnd server and client automation # driver for Mozilla's Gecko engine. For more, see # https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette. From f861aecae82b0546d8bf242cf4a1d5cf0509aad2 Mon Sep 17 00:00:00 2001 From: Laurent Date: Sun, 4 Dec 2016 02:19:00 -0500 Subject: [PATCH 15/70] Bug 1322033 - Support Function Keys in WebExtensions. r=kmag --HG-- extra : rebase_source : 4aae66a0868bd711b92e3ce29a1cdc3ecdb7f13d --- .../components/extensions/schemas/commands.json | 4 ++++ .../browser/browser_ext_commands_onCommand.js | 15 +++++++++++++++ .../test/xpcshell/test_ext_manifest_commands.js | 1 + 3 files changed, 20 insertions(+) diff --git a/browser/components/extensions/schemas/commands.json b/browser/components/extensions/schemas/commands.json index a1632088e35d..9dbaf43ee1b6 100644 --- a/browser/components/extensions/schemas/commands.json +++ b/browser/components/extensions/schemas/commands.json @@ -13,6 +13,10 @@ "type": "string", "pattern": "^\\s*(Alt|Ctrl|Command|MacCtrl)\\s*\\+\\s*(Shift\\s*\\+\\s*)?([A-Z0-9]|Comma|Period|Home|End|PageUp|PageDown|Space|Insert|Delete|Up|Down|Left|Right)\\s*$" }, + { + "type": "string", + "pattern": "^\\s*((Alt|Ctrl|Command|MacCtrl)\\s*\\+\\s*)?(Shift\\s*\\+\\s*)?(F[1-9]|F1[0-2])\\s*$" + }, { "type": "string", "pattern": "^(MediaNextTrack|MediaPlayPause|MediaPrevTrack|MediaStop)$" diff --git a/browser/components/extensions/test/browser/browser_ext_commands_onCommand.js b/browser/components/extensions/test/browser/browser_ext_commands_onCommand.js index dd959dceceb8..fed5e10434a3 100644 --- a/browser/components/extensions/test/browser/browser_ext_commands_onCommand.js +++ b/browser/components/extensions/test/browser/browser_ext_commands_onCommand.js @@ -98,6 +98,21 @@ add_task(function* test_user_defined_commands() { shiftKey: true, }, }, + // Function keys + { + name: "function-keys", + shortcut: "Alt+Shift+F3", + key: "VK_F3", + modifiers: { + altKey: true, + shiftKey: true, + }, + }, + { + name: "function-keys", + shortcut: "F2", + key: "VK_F2", + }, // Misc Shortcuts { name: "valid-command-with-unrecognized-property-name", diff --git a/browser/components/extensions/test/xpcshell/test_ext_manifest_commands.js b/browser/components/extensions/test/xpcshell/test_ext_manifest_commands.js index 4de7afe01ab6..7a014e8659d9 100644 --- a/browser/components/extensions/test/xpcshell/test_ext_manifest_commands.js +++ b/browser/components/extensions/test/xpcshell/test_ext_manifest_commands.js @@ -16,6 +16,7 @@ add_task(function* test_manifest_commands() { let expectedError = ( String.raw`commands.toggle-feature.suggested_key.default: Value must either: ` + String.raw`match the pattern /^\s*(Alt|Ctrl|Command|MacCtrl)\s*\+\s*(Shift\s*\+\s*)?([A-Z0-9]|Comma|Period|Home|End|PageUp|PageDown|Space|Insert|Delete|Up|Down|Left|Right)\s*$/, or ` + + String.raw`match the pattern /^\s*((Alt|Ctrl|Command|MacCtrl)\s*\+\s*)?(Shift\s*\+\s*)?(F[1-9]|F1[0-2])\s*$/, or ` + String.raw`match the pattern /^(MediaNextTrack|MediaPlayPause|MediaPrevTrack|MediaStop)$/` ); From 7933f0e866fa08f5c76b15fe961d911040d39feb Mon Sep 17 00:00:00 2001 From: Pavan Date: Sun, 18 Dec 2016 08:11:00 -0500 Subject: [PATCH 16/70] Bug 1299967 - Sort page permissions list alphabetically. r=Gijs --HG-- extra : rebase_source : 9fddcb31e39933345eb3e0d3af7c4f8e33b26732 --- browser/base/content/pageinfo/permissions.js | 7 ++++++- browser/modules/SitePermissions.jsm | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/browser/base/content/pageinfo/permissions.js b/browser/base/content/pageinfo/permissions.js index ec505081c4db..b3e1720dc544 100644 --- a/browser/base/content/pageinfo/permissions.js +++ b/browser/base/content/pageinfo/permissions.js @@ -11,7 +11,12 @@ var gPermURI; var gPermPrincipal; var gUsageRequest; -var gPermissions = SitePermissions.listPermissions(); +// Array of permissionIDs sorted alphabetically by label. +var gPermissions = SitePermissions.listPermissions().sort((a, b) => { + let firstLabel = SitePermissions.getPermissionLabel(a); + let secondLabel = SitePermissions.getPermissionLabel(b); + return firstLabel.localeCompare(secondLabel); +}); gPermissions.push("plugins"); var permissionObserver = { diff --git a/browser/modules/SitePermissions.jsm b/browser/modules/SitePermissions.jsm index 3106d9d2dea2..38fd1ab93b61 100644 --- a/browser/modules/SitePermissions.jsm +++ b/browser/modules/SitePermissions.jsm @@ -97,7 +97,7 @@ this.SitePermissions = { /* Returns an array of all permission IDs. */ listPermissions: function() { - return kPermissionIDs; + return Object.keys(gPermissionObject); }, /* Returns an array of permission states to be exposed to the user for a From 0f319635c2b09bfd893831767b57adb1a0357ed9 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Mon, 19 Dec 2016 20:17:50 +1100 Subject: [PATCH 17/70] Bug 1324306: [MSE] Bump audio memory threshold to 20MB. r=gerald MozReview-Commit-ID: LSAv3ujW2TX --HG-- extra : rebase_source : 649dbc4b9d847c3d734c92408467fe309748682c --- dom/media/mediasource/TrackBuffersManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dom/media/mediasource/TrackBuffersManager.cpp b/dom/media/mediasource/TrackBuffersManager.cpp index 2dca1f7d1597..4b826f5efe7d 100644 --- a/dom/media/mediasource/TrackBuffersManager.cpp +++ b/dom/media/mediasource/TrackBuffersManager.cpp @@ -100,7 +100,7 @@ TrackBuffersManager::TrackBuffersManager(MediaSourceDecoder* aParentDecoder, , mVideoEvictionThreshold(Preferences::GetUint("media.mediasource.eviction_threshold.video", 100 * 1024 * 1024)) , mAudioEvictionThreshold(Preferences::GetUint("media.mediasource.eviction_threshold.audio", - 12 * 1024 * 1024)) + 20 * 1024 * 1024)) , mEvictionState(EvictionState::NO_EVICTION_NEEDED) , mMonitor("TrackBuffersManager") { From e9793294c181f6b46154c5f9da95b356a522d348 Mon Sep 17 00:00:00 2001 From: Mike Conley Date: Mon, 28 Nov 2016 16:07:01 -0800 Subject: [PATCH 18/70] Bug 1321376 - In single-process mode, don't change -
-  
-

Bottom

- - diff --git a/dom/events/test/bug989198_helper.js b/dom/events/test/bug989198_helper.js index 2d74831e9de5..65732d5ec0f4 100644 --- a/dom/events/test/bug989198_helper.js +++ b/dom/events/test/bug989198_helper.js @@ -5,7 +5,6 @@ const kUnknownEvent = 0x000; const kKeyDownEvent = 0x001; const kKeyUpEvent = 0x002; -const kBeforeEvent = 0x010; const kAfterEvent = 0x020; const kParent = 0x100; const kChild = 0x200; @@ -22,8 +21,6 @@ function frameScript() } addEventListener('keydown', handler); addEventListener('keyup', handler); - addEventListener('mozbrowserbeforekeydown', handler); - addEventListener('mozbrowserbeforekeyup', handler); addEventListener('mozbrowserafterkeydown', handler); addEventListener('mozbrowserafterkeyup', handler); } @@ -61,8 +58,6 @@ function setupHandlers(element, handler) { element.addEventListener('keydown', handler); element.addEventListener('keyup', handler); - element.addEventListener('mozbrowserbeforekeydown', handler); - element.addEventListener('mozbrowserbeforekeyup', handler); element.addEventListener('mozbrowserafterkeydown', handler); element.addEventListener('mozbrowserafterkeyup', handler); } @@ -71,8 +66,6 @@ function teardownHandlers(element, handler) { element.removeEventListener('keydown', handler); element.removeEventListener('keyup', handler); - element.removeEventListener('mozbrowserbeforekeydown', handler); - element.removeEventListener('mozbrowserbeforekeyup', handler); element.removeEventListener('mozbrowserafterkeydown', handler); element.removeEventListener('mozbrowserafterkeyup', handler); } @@ -80,12 +73,8 @@ function teardownHandlers(element, handler) function convertNameToCode(name) { switch (name) { - case "mozbrowserbeforekeydown": - return kBeforeEvent | kKeyDownEvent; case "mozbrowserafterkeydown": return kAfterEvent | kKeyDownEvent; - case "mozbrowserbeforekeyup": - return kBeforeEvent | kKeyUpEvent; case "mozbrowserafterkeyup": return kAfterEvent | kKeyUpEvent; case "keydown": @@ -162,11 +151,6 @@ function embedderHandlerWithCheck(e) // Verify value of attribute embeddedCancelled embedderHandler(e, function checkEmbeddedCancelled(code){ switch (code) { - case kBeforeEvent | kKeyDownEvent: - case kBeforeEvent | kKeyUpEvent: - is(e.embeddedCancelled, null, - gCurrentTest.description + ": embeddedCancelled should be null"); - break; case kAfterEvent | kKeyDownEvent: if ((gCurrentTest.doPreventDefaultAt & 0xFF) == kKeyDownEvent) { is(e.embeddedCancelled, true, diff --git a/dom/events/test/mochitest.ini b/dom/events/test/mochitest.ini index 3338eb6eadb0..88815692c166 100644 --- a/dom/events/test/mochitest.ini +++ b/dom/events/test/mochitest.ini @@ -134,9 +134,6 @@ support-files = bug1017086_inner.html [test_bug1017086_enable.html] support-files = bug1017086_inner.html [test_bug1079236.html] -[test_bug1096146.html] -support-files = - bug1096146_embedded.html [test_bug1145910.html] [test_bug1150308.html] [test_bug1248459.html] diff --git a/dom/events/test/test_bug1096146.html b/dom/events/test/test_bug1096146.html deleted file mode 100644 index 85b7a35f0c44..000000000000 --- a/dom/events/test/test_bug1096146.html +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - Test for Bug 1096146 - - - - - -
Mozilla Bug 1096146 - -
-
-
- - diff --git a/dom/events/test/test_dom_before_after_keyboard_event.html b/dom/events/test/test_dom_before_after_keyboard_event.html index 533a7e73a372..0ee8906a7edd 100644 --- a/dom/events/test/test_dom_before_after_keyboard_event.html +++ b/dom/events/test/test_dom_before_after_keyboard_event.html @@ -28,45 +28,19 @@ function testEventOrderAndAttr() const kTests = [ { description: "Testing the order of the events", - expectedEvents: [ [ kParent | kBeforeEvent | kKeyDownEvent, - kChild | kKeyDownEvent, + expectedEvents: [ [ kChild | kKeyDownEvent, kParent | kAfterEvent | kKeyDownEvent ], - [ kParent | kBeforeEvent | kKeyUpEvent, - kChild | kKeyUpEvent, + [ kChild | kKeyUpEvent, kParent | kAfterEvent | kKeyUpEvent ] ], resultEvents: [], classifiedEvents: [ [], [] ], doPreventDefaultAt: kUnknownEvent }, - { - description: "Testing the order of the events, calling preventDefault() at \"mozbrowserbeforekeydown\" event", - expectedEvents: [ [ kParent | kBeforeEvent | kKeyDownEvent, - kParent | kAfterEvent | kKeyDownEvent ], - [ kParent | kBeforeEvent | kKeyUpEvent, - kChild | kKeyUpEvent, - kParent | kAfterEvent | kKeyUpEvent ] ], - resultEvents: [], - classifiedEvents: [ [], [] ], - doPreventDefaultAt: kParent | kBeforeEvent | kKeyDownEvent - }, - { - description: "Testing the order of the events, calling preventDefault() at \"mozbrowserbeforekeyup\" event", - expectedEvents: [ [ kParent | kBeforeEvent | kKeyDownEvent, - kChild | kKeyDownEvent, - kParent | kAfterEvent | kKeyDownEvent ], - [ kParent | kBeforeEvent | kKeyUpEvent, - kParent | kAfterEvent | kKeyUpEvent ] ], - resultEvents: [], - classifiedEvents: [ [], [] ], - doPreventDefaultAt: kParent | kBeforeEvent | kKeyUpEvent - }, { description: "Testing the order of the events, calling preventDefault() at \"keydown\" event", - expectedEvents: [ [ kParent | kBeforeEvent | kKeyDownEvent, - kChild | kKeyDownEvent, + expectedEvents: [ [ kChild | kKeyDownEvent, kParent | kAfterEvent | kKeyDownEvent ], - [ kParent | kBeforeEvent | kKeyUpEvent, - kChild | kKeyUpEvent, + [ kChild | kKeyUpEvent, kParent | kAfterEvent | kKeyUpEvent ] ], resultEvents: [], classifiedEvents: [ [], [] ], @@ -74,11 +48,9 @@ function testEventOrderAndAttr() }, { description: "Testing the order of the events, calling preventDefault() at \"keyup\" event", - expectedEvents: [ [ kParent | kBeforeEvent | kKeyDownEvent, - kChild | kKeyDownEvent, + expectedEvents: [ [ kChild | kKeyDownEvent, kParent | kAfterEvent | kKeyDownEvent ], - [ kParent | kBeforeEvent | kKeyUpEvent, - kChild | kKeyUpEvent, + [ kChild | kKeyUpEvent, kParent | kAfterEvent | kKeyUpEvent ] ], resultEvents: [], classifiedEvents: [ [], [] ], diff --git a/dom/events/test/test_dom_before_after_keyboard_event_remote.html b/dom/events/test/test_dom_before_after_keyboard_event_remote.html index b82b102a913b..e1bf1e517074 100644 --- a/dom/events/test/test_dom_before_after_keyboard_event_remote.html +++ b/dom/events/test/test_dom_before_after_keyboard_event_remote.html @@ -23,52 +23,22 @@ SimpleTest.requestFlakyTimeout("untriaged"); var testsForEventOrder = [ { description: "Testing the order of the events (OOP)", - expectedEvents: [ [ kParent | kBeforeEvent | kKeyDownEvent, - kParent | kKeyDownEvent, + expectedEvents: [ [ kParent | kKeyDownEvent, kChild | kKeyDownEvent, kParent | kAfterEvent | kKeyDownEvent ], - [ kParent | kBeforeEvent | kKeyUpEvent, - kParent | kKeyUpEvent, + [ kParent | kKeyUpEvent, kChild | kKeyUpEvent, kParent | kAfterEvent | kKeyUpEvent ] ], resultEvents: [], classifiedEvents: [ [], [] ], doPreventDefaultAt: kUnknownEvent }, - { - description: "Testing the order of the events (OOP), calling " + - "preventDefault() at \"mozbrowserbeforekeydown\" event", - expectedEvents: [ [ kParent | kBeforeEvent | kKeyDownEvent, - kParent | kAfterEvent | kKeyDownEvent ], - [ kParent | kBeforeEvent | kKeyUpEvent, - kParent | kKeyUpEvent, - kChild | kKeyUpEvent, - kParent | kAfterEvent | kKeyUpEvent ] ], - resultEvents: [], - classifiedEvents: [ [], [] ], - doPreventDefaultAt: kParent | kBeforeEvent | kKeyDownEvent - }, - { - description: "Testing the order of the events (OOP), calling " + - "preventDefault() at \"mozbrowserbeforekeyup\" event", - expectedEvents: [ [ kParent | kBeforeEvent | kKeyDownEvent, - kParent | kKeyDownEvent, - kChild | kKeyDownEvent, - kParent | kAfterEvent | kKeyDownEvent ], - [ kParent | kBeforeEvent | kKeyUpEvent, - kParent | kAfterEvent | kKeyUpEvent ] ], - resultEvents: [], - classifiedEvents: [ [], [] ], - doPreventDefaultAt: kParent | kBeforeEvent | kKeyUpEvent - }, { description: "Testing the order of the events (OOP), calling " + "preventDefault() at \"keydown\" event in parent process", - expectedEvents: [ [ kParent | kBeforeEvent | kKeyDownEvent, - kParent | kKeyDownEvent, + expectedEvents: [ [ kParent | kKeyDownEvent, kParent | kAfterEvent | kKeyDownEvent ], - [ kParent | kBeforeEvent | kKeyUpEvent, - kParent | kKeyUpEvent, + [ kParent | kKeyUpEvent, kChild | kKeyUpEvent, kParent | kAfterEvent | kKeyUpEvent ] ], resultEvents: [], @@ -78,12 +48,10 @@ var testsForEventOrder = [ { description: "Testing the order of the events (OOP), calling " + "preventDefault() at \"keydown\" event in child process", - expectedEvents: [ [ kParent | kBeforeEvent | kKeyDownEvent, - kParent | kKeyDownEvent, + expectedEvents: [ [ kParent | kKeyDownEvent, kChild | kKeyDownEvent, kParent | kAfterEvent | kKeyDownEvent ], - [ kParent | kBeforeEvent | kKeyUpEvent, - kParent | kKeyUpEvent, + [ kParent | kKeyUpEvent, kChild | kKeyUpEvent, kParent | kAfterEvent | kKeyUpEvent ] ], resultEvents: [], @@ -93,12 +61,10 @@ var testsForEventOrder = [ { description: "Testing the order of the events (OOP), calling " + "preventDefault() at \"keyup\" event in parent process", - expectedEvents: [ [ kParent | kBeforeEvent | kKeyDownEvent, - kParent | kKeyDownEvent, + expectedEvents: [ [ kParent | kKeyDownEvent, kChild | kKeyDownEvent, kParent | kAfterEvent | kKeyDownEvent ], - [ kParent | kBeforeEvent | kKeyUpEvent, - kParent | kKeyUpEvent, + [ kParent | kKeyUpEvent, kParent | kAfterEvent | kKeyUpEvent ] ], resultEvents: [], classifiedEvents: [ [], [] ], @@ -107,12 +73,10 @@ var testsForEventOrder = [ { description: "Testing the order of the events (OOP), calling " + "preventDefault() at \"keyup\" event in child process", - expectedEvents: [ [ kParent | kBeforeEvent | kKeyDownEvent, - kParent | kKeyDownEvent, + expectedEvents: [ [ kParent | kKeyDownEvent, kChild | kKeyDownEvent, kParent | kAfterEvent | kKeyDownEvent ], - [ kParent | kBeforeEvent | kKeyUpEvent, - kParent | kKeyUpEvent, + [ kParent | kKeyUpEvent, kChild | kKeyUpEvent, kParent | kAfterEvent | kKeyUpEvent ] ], resultEvents: [], diff --git a/dom/webidl/BeforeAfterKeyboardEvent.webidl b/dom/webidl/BeforeAfterKeyboardEvent.webidl index 32c582f17705..bf5c4ec19450 100644 --- a/dom/webidl/BeforeAfterKeyboardEvent.webidl +++ b/dom/webidl/BeforeAfterKeyboardEvent.webidl @@ -11,8 +11,6 @@ interface BeforeAfterKeyboardEvent : KeyboardEvent { // The valid value of embeddedCancelled is: - // - "mozbrowserbeforekeydown": null - // - "mozbrowserbeforekeyup": null // - "mozbrowserafterkeydown": true/false // - "mozbrowserafterkeyup": true/false readonly attribute boolean? embeddedCancelled; diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp index 34f418698fda..212e54707e24 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp @@ -7093,40 +7093,6 @@ BuildTargetChainForBeforeAfterKeyboardEvent(nsINode* aTarget, } } -void -PresShell::DispatchBeforeKeyboardEventInternal(const nsTArray >& aChain, - const WidgetKeyboardEvent& aEvent, - size_t& aChainIndex, - bool& aDefaultPrevented) -{ - size_t length = aChain.Length(); - if (!CanDispatchEvent(&aEvent) || !length) { - return; - } - - EventMessage message = - (aEvent.mMessage == eKeyDown) ? eBeforeKeyDown : eBeforeKeyUp; - nsCOMPtr eventTarget; - // Dispatch before events from the outermost element. - for (int32_t i = length - 1; i >= 0; i--) { - eventTarget = do_QueryInterface(aChain[i]->OwnerDoc()->GetWindow()); - if (!eventTarget || !CanDispatchEvent(&aEvent)) { - return; - } - - aChainIndex = i; - InternalBeforeAfterKeyboardEvent beforeEvent(aEvent.IsTrusted(), - message, aEvent.mWidget); - beforeEvent.AssignBeforeAfterKeyEventData(aEvent, false); - EventDispatcher::Dispatch(eventTarget, mPresContext, &beforeEvent); - - if (beforeEvent.DefaultPrevented()) { - aDefaultPrevented = true; - return; - } - } -} - void PresShell::DispatchAfterKeyboardEventInternal(const nsTArray >& aChain, const WidgetKeyboardEvent& aEvent, @@ -7216,31 +7182,6 @@ PresShell::HandleKeyboardEvent(nsINode* aTarget, AutoTArray, 5> chain; BuildTargetChainForBeforeAfterKeyboardEvent(aTarget, chain, targetIsIframe); - // Dispatch before events. If each item in the chain consumes the before - // event and doesn't prevent the default action, we will go further to - // dispatch the actual key event and after events in the reverse order. - // Otherwise, only items which has handled the before event will receive an - // after event. - size_t chainIndex; - bool defaultPrevented = false; - DispatchBeforeKeyboardEventInternal(chain, aEvent, chainIndex, - defaultPrevented); - - // Before event is default-prevented. Dispatch after events with - // embeddedCancelled = false to partial items. - if (defaultPrevented) { - *aStatus = nsEventStatus_eConsumeNoDefault; - DispatchAfterKeyboardEventInternal(chain, aEvent, false, chainIndex); - // No need to forward the event to child process. - aEvent.StopCrossProcessForwarding(); - return; - } - - // Event listeners may kill nsPresContext and nsPresShell. - if (!CanDispatchEvent()) { - return; - } - if (ForwardKeyToInputMethodAppOrDispatch(targetIsIframe, aTarget, aEvent, aStatus, aEventCB)) { return; @@ -7251,7 +7192,7 @@ PresShell::HandleKeyboardEvent(nsINode* aTarget, // 'embeddedCancelled' of after event is false, i.e. |!targetIsIframe|. // On the contrary, if the defult action is prevented by embedded iframe, // 'embeddedCancelled' is true which equals to |!targetIsIframe|. - DispatchAfterKeyboardEventInternal(chain, aEvent, !targetIsIframe, chainIndex); + DispatchAfterKeyboardEventInternal(chain, aEvent, !targetIsIframe, 0); return; } diff --git a/layout/base/PresShell.h b/layout/base/PresShell.h index 5dd5c3903f75..613481e5c387 100644 --- a/layout/base/PresShell.h +++ b/layout/base/PresShell.h @@ -796,11 +796,6 @@ protected: bool aEmbeddedCancelled, nsEventStatus* aStatus, mozilla::EventDispatchingCallback* aEventCB); - void DispatchBeforeKeyboardEventInternal( - const nsTArray >& aChain, - const mozilla::WidgetKeyboardEvent& aEvent, - size_t& aChainIndex, - bool& aDefaultPrevented); void DispatchAfterKeyboardEventInternal( const nsTArray >& aChain, const mozilla::WidgetKeyboardEvent& aEvent, diff --git a/widget/EventMessageList.h b/widget/EventMessageList.h index 82fa8c1367e9..80a493921acc 100644 --- a/widget/EventMessageList.h +++ b/widget/EventMessageList.h @@ -47,9 +47,7 @@ NS_EVENT_MESSAGE(eKeyDown) NS_EVENT_MESSAGE(eKeyDownOnPlugin) NS_EVENT_MESSAGE(eKeyUpOnPlugin) -NS_EVENT_MESSAGE(eBeforeKeyDown) NS_EVENT_MESSAGE(eAfterKeyDown) -NS_EVENT_MESSAGE(eBeforeKeyUp) NS_EVENT_MESSAGE(eAfterKeyUp) // This message is sent after a content process handles a key event or accesskey diff --git a/widget/TextEvents.h b/widget/TextEvents.h index 6c29341144d5..133856266e7f 100644 --- a/widget/TextEvents.h +++ b/widget/TextEvents.h @@ -427,9 +427,7 @@ private: * This is extended from WidgetKeyboardEvent and is mapped to DOM event * "BeforeAfterKeyboardEvent". * - * Event mMessage: eBeforeKeyDown - * eBeforeKeyUp - * eAfterKeyDown + * Event mMessage: eAfterKeyDown * eAfterKeyUp ******************************************************************************/ class InternalBeforeAfterKeyboardEvent : public WidgetKeyboardEvent diff --git a/widget/WidgetEventImpl.cpp b/widget/WidgetEventImpl.cpp index a1baf2162729..1d734b81ea14 100644 --- a/widget/WidgetEventImpl.cpp +++ b/widget/WidgetEventImpl.cpp @@ -277,8 +277,6 @@ WidgetEvent::HasKeyEventMessage() const case eKeyUp: case eKeyDownOnPlugin: case eKeyUpOnPlugin: - case eBeforeKeyDown: - case eBeforeKeyUp: case eAfterKeyDown: case eAfterKeyUp: case eAccessKeyNotFound: From d48cef42557762435dfc3a31fa4794ca6bf813c5 Mon Sep 17 00:00:00 2001 From: Masayuki Nakano Date: Fri, 16 Dec 2016 16:01:51 +0900 Subject: [PATCH 62/70] Bug 1322736 part.2 Remove "after keydown" and "after keyup" events r=smaug MozReview-Commit-ID: ICFPyDhgfh7 --HG-- extra : rebase_source : 6d3a9d227ac99710ac2daa036e1e169d31ae9e6a --- dom/base/nsGkAtomList.h | 2 - dom/events/BeforeAfterKeyboardEvent.cpp | 6 - dom/events/BeforeAfterKeyboardEvent.h | 2 - dom/events/EventNameList.h | 8 - dom/events/EventStateManager.cpp | 3 - dom/events/KeyboardEvent.cpp | 4 - dom/events/test/bug989198_embedded.html | 20 -- dom/events/test/bug989198_helper.js | 176 ------------------ dom/events/test/mochitest.ini | 9 - .../test_dom_before_after_keyboard_event.html | 108 ----------- ...om_before_after_keyboard_event_remote.html | 159 ---------------- dom/inputmethod/HardwareKeyHandler.cpp | 40 +--- dom/inputmethod/HardwareKeyHandler.h | 2 - dom/ipc/PBrowser.ipdl | 2 - dom/ipc/TabChild.cpp | 4 - dom/ipc/TabParent.cpp | 22 --- dom/ipc/TabParent.h | 3 - dom/webidl/BeforeAfterKeyboardEvent.webidl | 3 - layout/base/PresShell.cpp | 89 +-------- layout/base/PresShell.h | 9 - layout/base/nsIPresShell.h | 7 - widget/EventMessageList.h | 3 - widget/TextEvents.h | 3 - widget/WidgetEventImpl.cpp | 2 - 24 files changed, 4 insertions(+), 682 deletions(-) delete mode 100644 dom/events/test/bug989198_embedded.html delete mode 100644 dom/events/test/bug989198_helper.js delete mode 100644 dom/events/test/test_dom_before_after_keyboard_event.html delete mode 100644 dom/events/test/test_dom_before_after_keyboard_event_remote.html diff --git a/dom/base/nsGkAtomList.h b/dom/base/nsGkAtomList.h index 099fd898d0fa..a0a30adadf3e 100644 --- a/dom/base/nsGkAtomList.h +++ b/dom/base/nsGkAtomList.h @@ -840,8 +840,6 @@ GK_ATOM(onmouseover, "onmouseover") GK_ATOM(onMozMouseHittest, "onMozMouseHittest") GK_ATOM(onmouseup, "onmouseup") GK_ATOM(onMozAfterPaint, "onMozAfterPaint") -GK_ATOM(onmozbrowserafterkeydown, "onmozbrowserafterkeydown") -GK_ATOM(onmozbrowserafterkeyup, "onmozbrowserafterkeyup") GK_ATOM(onmozfullscreenchange, "onmozfullscreenchange") GK_ATOM(onmozfullscreenerror, "onmozfullscreenerror") GK_ATOM(onmozkeydownonplugin, "onmozkeydownonplugin") diff --git a/dom/events/BeforeAfterKeyboardEvent.cpp b/dom/events/BeforeAfterKeyboardEvent.cpp index c94227755b9f..283d852a9ef0 100644 --- a/dom/events/BeforeAfterKeyboardEvent.cpp +++ b/dom/events/BeforeAfterKeyboardEvent.cpp @@ -66,12 +66,6 @@ BeforeAfterKeyboardEvent::Constructor( Nullable BeforeAfterKeyboardEvent::GetEmbeddedCancelled() { - nsAutoString type; - GetType(type); - if (type.EqualsLiteral("mozbrowserafterkeydown") || - type.EqualsLiteral("mozbrowserafterkeyup")) { - return mEvent->AsBeforeAfterKeyboardEvent()->mEmbeddedCancelled; - } return Nullable(); } diff --git a/dom/events/BeforeAfterKeyboardEvent.h b/dom/events/BeforeAfterKeyboardEvent.h index 5ada2e861e21..2f41b693d2fb 100644 --- a/dom/events/BeforeAfterKeyboardEvent.h +++ b/dom/events/BeforeAfterKeyboardEvent.h @@ -35,8 +35,6 @@ public: Constructor(EventTarget* aOwner, const nsAString& aType, const BeforeAfterKeyboardEventInit& aEventInitDict); - // This function returns a boolean value when event typs is either - // "mozbrowserafterkeydown" or "mozbrowserafterkeyup". Nullable GetEmbeddedCancelled(); }; diff --git a/dom/events/EventNameList.h b/dom/events/EventNameList.h index 68ffaf530444..ed098783a588 100644 --- a/dom/events/EventNameList.h +++ b/dom/events/EventNameList.h @@ -266,14 +266,6 @@ EVENT(mozkeyuponplugin, eKeyUpOnPlugin, EventNameType_None, eKeyboardEventClass) -NON_IDL_EVENT(mozbrowserafterkeydown, - eAfterKeyDown, - EventNameType_None, - eBeforeAfterKeyboardEventClass) -NON_IDL_EVENT(mozbrowserafterkeyup, - eAfterKeyUp, - EventNameType_None, - eBeforeAfterKeyboardEventClass) NON_IDL_EVENT(mozaccesskeynotfound, eAccessKeyNotFound, EventNameType_None, diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp index 0f20dbd720fa..97d1e1a402ad 100644 --- a/dom/events/EventStateManager.cpp +++ b/dom/events/EventStateManager.cpp @@ -758,9 +758,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext, // then fall through... MOZ_FALLTHROUGH; case eKeyDown: - case eAfterKeyDown: case eKeyUp: - case eAfterKeyUp: { nsIContent* content = GetFocusedContent(); if (content) @@ -3452,7 +3450,6 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext, break; case eKeyUp: - case eAfterKeyUp: break; case eKeyPress: diff --git a/dom/events/KeyboardEvent.cpp b/dom/events/KeyboardEvent.cpp index 5de3b8214ece..e267f9f4d52b 100644 --- a/dom/events/KeyboardEvent.cpp +++ b/dom/events/KeyboardEvent.cpp @@ -190,10 +190,8 @@ KeyboardEvent::CharCode() switch (mEvent->mMessage) { case eKeyDown: case eKeyDownOnPlugin: - case eAfterKeyDown: case eKeyUp: case eKeyUpOnPlugin: - case eAfterKeyUp: return 0; case eKeyPress: case eAccessKeyNotFound: @@ -237,10 +235,8 @@ KeyboardEvent::Which() switch (mEvent->mMessage) { case eKeyDown: case eKeyDownOnPlugin: - case eAfterKeyDown: case eKeyUp: case eKeyUpOnPlugin: - case eAfterKeyUp: return KeyCode(); case eKeyPress: //Special case for 4xp bug 62878. Try to make value of which diff --git a/dom/events/test/bug989198_embedded.html b/dom/events/test/bug989198_embedded.html deleted file mode 100644 index cee7683cfc6e..000000000000 --- a/dom/events/test/bug989198_embedded.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - Embedded iframe - - - - -

- - -
-  
-
-
diff --git a/dom/events/test/bug989198_helper.js b/dom/events/test/bug989198_helper.js
deleted file mode 100644
index 65732d5ec0f4..000000000000
--- a/dom/events/test/bug989198_helper.js
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Helper functions for testing BeforeAfterKeyboardEvent.
- */
-
-const kUnknownEvent       = 0x000;
-const kKeyDownEvent       = 0x001;
-const kKeyUpEvent         = 0x002;
-const kAfterEvent         = 0x020;
-const kParent             = 0x100;
-const kChild              = 0x200;
-
-var gCurrentTest;
-
-function frameScript()
-{
-  function handler(e) {
-    var results = sendSyncMessage("forwardevent", { type: e.type });
-    if (results[0]) {
-      e.preventDefault();
-    }
-  }
-  addEventListener('keydown', handler);
-  addEventListener('keyup', handler);
-  addEventListener('mozbrowserafterkeydown', handler);
-  addEventListener('mozbrowserafterkeyup', handler);
-}
-
-function prepareTest(useRemote)
-{
-  if (useRemote) {
-    setupHandlers(window, embedderHandler);
-  } else {
-    setupHandlers(window, embedderHandlerWithCheck);
-  }
-
-  var iframe = document.createElement("iframe");
-  iframe.id = "embedded";
-  iframe.src = "bug989198_embedded.html";
-  iframe.setAttribute("remote", useRemote ? "true" : "false");
-  SpecialPowers.wrap(iframe).mozbrowser = true;
-
-  iframe.addEventListener("mozbrowserloadend", function onloadend() {
-    iframe.removeEventListener("mozbrowserloadend", onloadend);
-    iframe.focus();
-    var mm = SpecialPowers.getBrowserFrameMessageManager(iframe);
-    mm.addMessageListener("forwardevent", function(msg) {
-      return embeddedHandler(msg.json);
-    });
-    mm.loadFrameScript("data:,(" + frameScript.toString() + ")();", false);
-    runTests();
-    return;
-  });
-
-  document.body.appendChild(iframe);
-}
-
-function setupHandlers(element, handler)
-{
-  element.addEventListener('keydown', handler);
-  element.addEventListener('keyup', handler);
-  element.addEventListener('mozbrowserafterkeydown', handler);
-  element.addEventListener('mozbrowserafterkeyup', handler);
-}
-
-function teardownHandlers(element, handler)
-{
-  element.removeEventListener('keydown', handler);
-  element.removeEventListener('keyup', handler);
-  element.removeEventListener('mozbrowserafterkeydown', handler);
-  element.removeEventListener('mozbrowserafterkeyup', handler);
-}
-
-function convertNameToCode(name)
-{
-  switch (name) {
-    case "mozbrowserafterkeydown":
-      return kAfterEvent | kKeyDownEvent;
-    case "mozbrowserafterkeyup":
-      return kAfterEvent | kKeyUpEvent;
-    case "keydown":
-      return kKeyDownEvent;
-    case "keyup":
-      return kKeyUpEvent;
-    default:
-      return kUnknownEvent;
-  }
-}
-
-function classifyEvents(test)
-{
-  // Categorize resultEvents into KEYDOWN group and KEYUP group.
-  for (var i = 0; i < gCurrentTest.resultEvents.length ; i++) {
-    var code = test.resultEvents[i];
-    if ((code & 0xF) == 0x1) { // KEYDOWN
-      test.classifiedEvents[0].push(code);
-    } else if ((code & 0xF) == 0x2) { // KEYUP
-      test.classifiedEvents[1].push(code);
-    } else {
-      ok(false, "Invalid code for events");
-    }
-  }
-}
-
-function verifyResults(test)
-{
-  for (var i = 0; i < gCurrentTest.expectedEvents.length; i++) {
-    is(test.classifiedEvents[i].length,
-       test.expectedEvents[i].length,
-       test.description + ": Wrong number of events");
-
-    for (var j = 0; j < gCurrentTest.classifiedEvents[i].length; j++) {
-      var item = test.classifiedEvents[i][j];
-      is(item, test.expectedEvents[i][j],
-         test.description + ": Wrong order of events");
-     }
-  }
-}
-
-function embeddedHandler(e)
-{
-  return handler(e, kChild);
-}
-
-function embedderHandler(e, callback)
-{
-  handler(e, kParent, callback);
-}
-
-function handler(e, highBit, callback)
-{
-  var code = convertNameToCode(e.type);
-  var newCode = highBit | code;
-  gCurrentTest.resultEvents.push(newCode);
-
-  if (callback) {
-    callback(code);
-  }
-
-  if (highBit == kChild) {
-    // return and let frameScript to handle
-    return newCode == gCurrentTest.doPreventDefaultAt;
-  }
-
-  if (newCode == gCurrentTest.doPreventDefaultAt) {
-    e.preventDefault();
-  }
-}
-
-function embedderHandlerWithCheck(e)
-{
-  // Verify value of attribute embeddedCancelled
-  embedderHandler(e, function checkEmbeddedCancelled(code){
-  switch (code) {
-    case kAfterEvent | kKeyDownEvent:
-      if ((gCurrentTest.doPreventDefaultAt & 0xFF) == kKeyDownEvent) {
-        is(e.embeddedCancelled, true,
-           gCurrentTest.description + ": embeddedCancelled should be true");
-      } else {
-        is(e.embeddedCancelled, false,
-           gCurrentTest.description + ": embeddedCancelled should be false");
-      }
-      break;
-    case kAfterEvent | kKeyUpEvent:
-      if ((gCurrentTest.doPreventDefaultAt & 0xFF) == kKeyUpEvent) {
-        is(e.embeddedCancelled, true,
-           gCurrentTest.description + ": embeddedCancelled should be true");
-      } else {
-        is(e.embeddedCancelled, false,
-           gCurrentTest.description + ": embeddedCancelled should be false");
-      }
-      break;
-    default:
-      break;
-    }
-  });
-}
diff --git a/dom/events/test/mochitest.ini b/dom/events/test/mochitest.ini
index 88815692c166..ac1b36a14d80 100644
--- a/dom/events/test/mochitest.ini
+++ b/dom/events/test/mochitest.ini
@@ -144,15 +144,6 @@ skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM
 [test_continuous_wheel_events.html]
 [test_dblclick_explicit_original_target.html]
 [test_dom_activate_event.html]
-[test_dom_before_after_keyboard_event.html]
-support-files =
-  bug989198_embedded.html
-  bug989198_helper.js
-[test_dom_before_after_keyboard_event_remote.html]
-support-files =
-  bug989198_embedded.html
-  bug989198_helper.js
-skip-if = e10s
 [test_dom_keyboard_event.html]
 skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM
 [test_dom_mouse_event.html]
diff --git a/dom/events/test/test_dom_before_after_keyboard_event.html b/dom/events/test/test_dom_before_after_keyboard_event.html
deleted file mode 100644
index 0ee8906a7edd..000000000000
--- a/dom/events/test/test_dom_before_after_keyboard_event.html
+++ /dev/null
@@ -1,108 +0,0 @@
-
-
-
-  Test for Bug 989198
-  
-  
-  
-  
-  
-
-
-Mozilla Bug 989198
-

-
-
-
-
diff --git a/dom/events/test/test_dom_before_after_keyboard_event_remote.html b/dom/events/test/test_dom_before_after_keyboard_event_remote.html
deleted file mode 100644
index e1bf1e517074..000000000000
--- a/dom/events/test/test_dom_before_after_keyboard_event_remote.html
+++ /dev/null
@@ -1,159 +0,0 @@
-
-
-
-  Test for Bug 989198
-  
-  
-  
-  
-  
-
-
-Mozilla Bug 989198
-

-
-
-
-
-
-
diff --git a/dom/inputmethod/HardwareKeyHandler.cpp b/dom/inputmethod/HardwareKeyHandler.cpp
index 9cc376e7cfaf..7a0b61d4121b 100644
--- a/dom/inputmethod/HardwareKeyHandler.cpp
+++ b/dom/inputmethod/HardwareKeyHandler.cpp
@@ -212,15 +212,9 @@ HardwareKeyHandler::OnHandledByInputMethodApp(const nsAString& aType,
 
   // Check whether the event is still valid to be fired
   if (CanDispatchEvent(keyInfo->mTarget, keyInfo->mEvent)) {
-    // If the key's defaultPrevented is true, it means that the
-    // input-method-app has already consumed this key,
-    // so we can dispatch |mozbrowserafterkey*| directly if
-    // preference "dom.beforeAfterKeyboardEvent.enabled" is enabled.
-    if (keyInfo->mEvent.mFlags.mDefaultPrevented) {
-      DispatchAfterKeyEvent(keyInfo->mTarget, keyInfo->mEvent);
-    // Otherwise, it means that input-method-app doesn't handle this key,
+    // If input-method-app doesn't handle this key,
     // so we need to dispatch it to its current event target.
-    } else {
+    if (!keyInfo->mEvent.mFlags.mDefaultPrevented) {
       DispatchToTargetApp(keyInfo->mTarget,
                           keyInfo->mEvent,
                           keyInfo->mStatus);
@@ -297,25 +291,6 @@ HardwareKeyHandler::DispatchKeyPress(nsINode* aTarget,
   return ret;
 }
 
-void
-HardwareKeyHandler::DispatchAfterKeyEvent(nsINode* aTarget,
-                                          WidgetKeyboardEvent& aEvent)
-{
-  MOZ_ASSERT(aTarget, "No target provided");
-
-  if (!PresShell::BeforeAfterKeyboardEventEnabled() ||
-      aEvent.mMessage == eKeyPress) {
-    return;
-  }
-
-  nsCOMPtr presShell = GetPresShell(aTarget);
-  if (NS_WARN_IF(presShell)) {
-    presShell->DispatchAfterKeyboardEvent(aTarget,
-                                          aEvent,
-                                          aEvent.mFlags.mDefaultPrevented);
-  }
-}
-
 bool
 HardwareKeyHandler::DispatchToTargetApp(nsINode* aTarget,
                                         WidgetKeyboardEvent& aEvent,
@@ -354,22 +329,11 @@ HardwareKeyHandler::DispatchToTargetApp(nsINode* aTarget,
   // In-process case: the event target is in the current process
   if (!PresShell::IsTargetIframe(currentTarget)) {
     DispatchToCurrentProcess(presShell, currentTarget, aEvent, aStatus);
-
-    if (presShell->CanDispatchEvent(&aEvent)) {
-      DispatchAfterKeyEvent(aTarget, aEvent);
-    }
-
     return true;
   }
 
   // OOP case: the event target is in the child process
   return DispatchToCrossProcess(aTarget, aEvent);
-
-  // After the oop target receives the event from TabChild::RecvRealKeyEvent
-  // and return the result through TabChild::SendDispatchAfterKeyboardEvent,
-  // the |mozbrowserafterkey*| will be fired from
-  // TabParent::RecvDispatchAfterKeyboardEvent, so we don't need to dispatch
-  // |mozbrowserafterkey*| by ourselves in this module.
 }
 
 void
diff --git a/dom/inputmethod/HardwareKeyHandler.h b/dom/inputmethod/HardwareKeyHandler.h
index 7520c40cd6d1..7b1ee4d626d4 100644
--- a/dom/inputmethod/HardwareKeyHandler.h
+++ b/dom/inputmethod/HardwareKeyHandler.h
@@ -146,8 +146,6 @@ private:
                         WidgetKeyboardEvent& aEvent,
                         nsEventStatus& aStatus);
 
-  void DispatchAfterKeyEvent(nsINode* aTarget, WidgetKeyboardEvent& aEvent);
-
   void DispatchToCurrentProcess(nsIPresShell* aPresShell,
                                 nsIContent* aTarget,
                                 WidgetKeyboardEvent& aEvent,
diff --git a/dom/ipc/PBrowser.ipdl b/dom/ipc/PBrowser.ipdl
index d4bf4d48a903..07cbe1cde254 100644
--- a/dom/ipc/PBrowser.ipdl
+++ b/dom/ipc/PBrowser.ipdl
@@ -511,8 +511,6 @@ parent:
 
     async ReplyKeyEvent(WidgetKeyboardEvent event);
 
-    async DispatchAfterKeyboardEvent(WidgetKeyboardEvent event);
-
     sync RequestNativeKeyBindings(WidgetKeyboardEvent event)
         returns (MaybeNativeKeyBinding bindings);
 
diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp
index 157452d8300f..6f48897b2de2 100644
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -1817,10 +1817,6 @@ TabChild::RecvRealKeyEvent(const WidgetKeyboardEvent& event,
     SendAccessKeyNotHandled(localEvent);
   }
 
-  if (PresShell::BeforeAfterKeyboardEventEnabled()) {
-    SendDispatchAfterKeyboardEvent(localEvent);
-  }
-
   return IPC_OK();
 }
 
diff --git a/dom/ipc/TabParent.cpp b/dom/ipc/TabParent.cpp
index 977961ca765f..1b2eabf3ea1a 100644
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -1951,28 +1951,6 @@ TabParent::RecvReplyKeyEvent(const WidgetKeyboardEvent& event)
   return IPC_OK();
 }
 
-mozilla::ipc::IPCResult
-TabParent::RecvDispatchAfterKeyboardEvent(const WidgetKeyboardEvent& aEvent)
-{
-  NS_ENSURE_TRUE(mFrameElement, IPC_OK());
-
-  WidgetKeyboardEvent localEvent(aEvent);
-  localEvent.mWidget = GetWidget();
-
-  nsIDocument* doc = mFrameElement->OwnerDoc();
-  nsCOMPtr presShell = doc->GetShell();
-  NS_ENSURE_TRUE(presShell, IPC_OK());
-
-  if (mFrameElement &&
-      PresShell::BeforeAfterKeyboardEventEnabled() &&
-      localEvent.mMessage != eKeyPress) {
-    presShell->DispatchAfterKeyboardEvent(mFrameElement, localEvent,
-                                          aEvent.DefaultPrevented());
-  }
-
-  return IPC_OK();
-}
-
 mozilla::ipc::IPCResult
 TabParent::RecvAccessKeyNotHandled(const WidgetKeyboardEvent& aEvent)
 {
diff --git a/dom/ipc/TabParent.h b/dom/ipc/TabParent.h
index 626ec12c5576..6669f884e507 100644
--- a/dom/ipc/TabParent.h
+++ b/dom/ipc/TabParent.h
@@ -173,9 +173,6 @@ public:
 
   virtual mozilla::ipc::IPCResult RecvReplyKeyEvent(const WidgetKeyboardEvent& aEvent) override;
 
-  virtual mozilla::ipc::IPCResult
-  RecvDispatchAfterKeyboardEvent(const WidgetKeyboardEvent& aEvent) override;
-
   virtual mozilla::ipc::IPCResult
   RecvAccessKeyNotHandled(const WidgetKeyboardEvent& aEvent) override;
 
diff --git a/dom/webidl/BeforeAfterKeyboardEvent.webidl b/dom/webidl/BeforeAfterKeyboardEvent.webidl
index bf5c4ec19450..75359596b305 100644
--- a/dom/webidl/BeforeAfterKeyboardEvent.webidl
+++ b/dom/webidl/BeforeAfterKeyboardEvent.webidl
@@ -10,9 +10,6 @@
  ChromeOnly]
 interface BeforeAfterKeyboardEvent : KeyboardEvent
 {
-  // The valid value of embeddedCancelled is:
-  // - "mozbrowserafterkeydown": true/false
-  // - "mozbrowserafterkeyup": true/false
   readonly attribute boolean? embeddedCancelled;
 };
 
diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp
index 212e54707e24..8d851446be7b 100644
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -7093,56 +7093,6 @@ BuildTargetChainForBeforeAfterKeyboardEvent(nsINode* aTarget,
   }
 }
 
-void
-PresShell::DispatchAfterKeyboardEventInternal(const nsTArray >& aChain,
-                                              const WidgetKeyboardEvent& aEvent,
-                                              bool aEmbeddedCancelled,
-                                              size_t aStartOffset)
-{
-  size_t length = aChain.Length();
-  if (!CanDispatchEvent(&aEvent) || !length) {
-    return;
-  }
-
-  EventMessage message =
-    (aEvent.mMessage == eKeyDown) ? eAfterKeyDown : eAfterKeyUp;
-  bool embeddedCancelled = aEmbeddedCancelled;
-  nsCOMPtr eventTarget;
-  // Dispatch after events from the innermost element.
-  for (uint32_t i = aStartOffset; i < length; i++) {
-    eventTarget = do_QueryInterface(aChain[i]->OwnerDoc()->GetWindow());
-    if (!eventTarget || !CanDispatchEvent(&aEvent)) {
-      return;
-    }
-
-    InternalBeforeAfterKeyboardEvent afterEvent(aEvent.IsTrusted(),
-                                                message, aEvent.mWidget);
-    afterEvent.AssignBeforeAfterKeyEventData(aEvent, false);
-    afterEvent.mEmbeddedCancelled.SetValue(embeddedCancelled);
-    EventDispatcher::Dispatch(eventTarget, mPresContext, &afterEvent);
-    embeddedCancelled = afterEvent.DefaultPrevented();
-  }
-}
-
-void
-PresShell::DispatchAfterKeyboardEvent(nsINode* aTarget,
-                                      const WidgetKeyboardEvent& aEvent,
-                                      bool aEmbeddedCancelled)
-{
-  MOZ_ASSERT(aTarget);
-  MOZ_ASSERT(BeforeAfterKeyboardEventEnabled());
-
-  if (NS_WARN_IF(aEvent.mMessage != eKeyDown && aEvent.mMessage != eKeyUp)) {
-    return;
-  }
-
-  // Build up a target chain. Each item in the chain will receive an after event.
-  AutoTArray, 5> chain;
-  bool targetIsIframe = IsTargetIframe(aTarget);
-  BuildTargetChainForBeforeAfterKeyboardEvent(aTarget, chain, targetIsIframe);
-  DispatchAfterKeyboardEventInternal(chain, aEvent, aEmbeddedCancelled);
-}
-
 bool
 PresShell::CanDispatchEvent(const WidgetGUIEvent* aEvent) const
 {
@@ -7166,43 +7116,8 @@ PresShell::HandleKeyboardEvent(nsINode* aTarget,
   // return true if the event target is in its child process
   bool targetIsIframe = IsTargetIframe(aTarget);
 
-  // Dispatch event directly if the event is a keypress event, a key event on
-  // plugin, or there is no need to fire beforeKey* and afterKey* events.
-  if (aEvent.mMessage == eKeyPress ||
-      aEvent.IsKeyEventOnPlugin() ||
-      !BeforeAfterKeyboardEventEnabled()) {
-    ForwardKeyToInputMethodAppOrDispatch(targetIsIframe, aTarget, aEvent,
-                                         aStatus, aEventCB);
-    return;
-  }
-
-  MOZ_ASSERT(aEvent.mMessage == eKeyDown || aEvent.mMessage == eKeyUp);
-
-  // Build up a target chain. Each item in the chain will receive a before event.
-  AutoTArray, 5> chain;
-  BuildTargetChainForBeforeAfterKeyboardEvent(aTarget, chain, targetIsIframe);
-
-  if (ForwardKeyToInputMethodAppOrDispatch(targetIsIframe, aTarget, aEvent,
-                                           aStatus, aEventCB)) {
-    return;
-  }
-
-  if (aEvent.DefaultPrevented()) {
-    // When embedder prevents the default action of actual key event, attribute
-    // 'embeddedCancelled' of after event is false, i.e. |!targetIsIframe|.
-    // On the contrary, if the defult action is prevented by embedded iframe,
-    // 'embeddedCancelled' is true which equals to |!targetIsIframe|.
-    DispatchAfterKeyboardEventInternal(chain, aEvent, !targetIsIframe, 0);
-    return;
-  }
-
-  // Event listeners may kill nsPresContext and nsPresShell.
-  if (targetIsIframe || !CanDispatchEvent()) {
-    return;
-  }
-
-  // Dispatch after events to all items in the chain.
-  DispatchAfterKeyboardEventInternal(chain, aEvent, aEvent.DefaultPrevented());
+  ForwardKeyToInputMethodAppOrDispatch(targetIsIframe, aTarget, aEvent,
+                                       aStatus, aEventCB);
 }
 
 #ifdef MOZ_B2G
diff --git a/layout/base/PresShell.h b/layout/base/PresShell.h
index 613481e5c387..839d1925ef80 100644
--- a/layout/base/PresShell.h
+++ b/layout/base/PresShell.h
@@ -416,10 +416,6 @@ public:
 
   virtual void RecordShadowStyleChange(mozilla::dom::ShadowRoot* aShadowRoot) override;
 
-  virtual void DispatchAfterKeyboardEvent(nsINode* aTarget,
-                                          const mozilla::WidgetKeyboardEvent& aEvent,
-                                          bool aEmbeddedCancelled) override;
-
   virtual bool CanDispatchEvent(
       const mozilla::WidgetGUIEvent* aEvent = nullptr) const override;
 
@@ -796,11 +792,6 @@ protected:
                            bool aEmbeddedCancelled,
                            nsEventStatus* aStatus,
                            mozilla::EventDispatchingCallback* aEventCB);
-  void DispatchAfterKeyboardEventInternal(
-         const nsTArray >& aChain,
-         const mozilla::WidgetKeyboardEvent& aEvent,
-         bool aEmbeddedCancelled,
-         size_t aChainIndex = 0);
 
 #ifdef MOZ_B2G
   // This method is used to forward the keyboard event to the input-method-app
diff --git a/layout/base/nsIPresShell.h b/layout/base/nsIPresShell.h
index b8edbca9dab6..e637dc33e58f 100644
--- a/layout/base/nsIPresShell.h
+++ b/layout/base/nsIPresShell.h
@@ -866,13 +866,6 @@ public:
                                                         nsIDOMEvent* aEvent,
                                                         nsEventStatus* aStatus) = 0;
 
-  /**
-   * Dispatch AfterKeyboardEvent with specific target.
-   */
-  virtual void DispatchAfterKeyboardEvent(nsINode* aTarget,
-                                          const mozilla::WidgetKeyboardEvent& aEvent,
-                                          bool aEmbeddedCancelled) = 0;
-
   /**
    * Return whether or not the event is valid to be dispatched
    */
diff --git a/widget/EventMessageList.h b/widget/EventMessageList.h
index 80a493921acc..6665b7945ecf 100644
--- a/widget/EventMessageList.h
+++ b/widget/EventMessageList.h
@@ -47,9 +47,6 @@ NS_EVENT_MESSAGE(eKeyDown)
 NS_EVENT_MESSAGE(eKeyDownOnPlugin)
 NS_EVENT_MESSAGE(eKeyUpOnPlugin)
 
-NS_EVENT_MESSAGE(eAfterKeyDown)
-NS_EVENT_MESSAGE(eAfterKeyUp)
-
 // This message is sent after a content process handles a key event or accesskey
 // to indicate that an potential accesskey was not found. The parent process may
 // then respond by, for example, opening menus and processing other shortcuts.
diff --git a/widget/TextEvents.h b/widget/TextEvents.h
index 133856266e7f..f7e1e3b4acbb 100644
--- a/widget/TextEvents.h
+++ b/widget/TextEvents.h
@@ -426,9 +426,6 @@ private:
  *
  * This is extended from WidgetKeyboardEvent and is mapped to DOM event
  * "BeforeAfterKeyboardEvent".
- *
- * Event mMessage: eAfterKeyDown
- *                 eAfterKeyUp
  ******************************************************************************/
 class InternalBeforeAfterKeyboardEvent : public WidgetKeyboardEvent
 {
diff --git a/widget/WidgetEventImpl.cpp b/widget/WidgetEventImpl.cpp
index 1d734b81ea14..1b761166356c 100644
--- a/widget/WidgetEventImpl.cpp
+++ b/widget/WidgetEventImpl.cpp
@@ -277,8 +277,6 @@ WidgetEvent::HasKeyEventMessage() const
     case eKeyUp:
     case eKeyDownOnPlugin:
     case eKeyUpOnPlugin:
-    case eAfterKeyDown:
-    case eAfterKeyUp:
     case eAccessKeyNotFound:
       return true;
     default:

From e0dcff15d2d5ffa629eecd8cb5ed8d5911b869e6 Mon Sep 17 00:00:00 2001
From: Masayuki Nakano 
Date: Fri, 16 Dec 2016 16:25:22 +0900
Subject: [PATCH 63/70] Bug 1322736 part.3 Remove dom::BeforeAfterKeyboardEvent
 and InternalBeforeAfterKeyboardEvent r=smaug

MozReview-Commit-ID: Eyz2HjIdQEW

--HG--
extra : rebase_source : 182f4f8236dcfb83f8725a9c66cc46dedbb14f2c
---
 dom/events/BeforeAfterKeyboardEvent.cpp       | 86 -------------------
 dom/events/BeforeAfterKeyboardEvent.h         | 49 -----------
 dom/events/EventDispatcher.cpp                |  4 -
 dom/events/moz.build                          |  2 -
 .../test/test_all_synthetic_events.html       |  4 -
 dom/webidl/BeforeAfterKeyboardEvent.webidl    | 19 ----
 dom/webidl/moz.build                          |  1 -
 layout/base/PresShell.cpp                     |  2 -
 layout/base/PresShell.h                       |  2 +-
 widget/EventClassList.h                       |  1 -
 widget/TextEvents.h                           | 62 -------------
 widget/nsGUIEventIPC.h                        | 31 -------
 12 files changed, 1 insertion(+), 262 deletions(-)
 delete mode 100644 dom/events/BeforeAfterKeyboardEvent.cpp
 delete mode 100644 dom/events/BeforeAfterKeyboardEvent.h
 delete mode 100644 dom/webidl/BeforeAfterKeyboardEvent.webidl

diff --git a/dom/events/BeforeAfterKeyboardEvent.cpp b/dom/events/BeforeAfterKeyboardEvent.cpp
deleted file mode 100644
index 283d852a9ef0..000000000000
--- a/dom/events/BeforeAfterKeyboardEvent.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/dom/BeforeAfterKeyboardEvent.h"
-#include "mozilla/TextEvents.h"
-#include "prtime.h"
-
-namespace mozilla {
-namespace dom {
-
-BeforeAfterKeyboardEvent::BeforeAfterKeyboardEvent(
-                                       EventTarget* aOwner,
-                                       nsPresContext* aPresContext,
-                                       InternalBeforeAfterKeyboardEvent* aEvent)
-  : KeyboardEvent(aOwner, aPresContext,
-                  aEvent ? aEvent :
-                           new InternalBeforeAfterKeyboardEvent(false,
-                                                                eVoidEvent,
-                                                                nullptr))
-{
-  MOZ_ASSERT(mEvent->mClass == eBeforeAfterKeyboardEventClass,
-             "event type mismatch eBeforeAfterKeyboardEventClass");
-
-  if (!aEvent) {
-    mEventIsInternal = true;
-    mEvent->mTime = PR_Now();
-  }
-}
-
-// static
-already_AddRefed
-BeforeAfterKeyboardEvent::Constructor(
-                            EventTarget* aOwner,
-                            const nsAString& aType,
-                            const BeforeAfterKeyboardEventInit& aParam)
-{
-  RefPtr event =
-    new BeforeAfterKeyboardEvent(aOwner, nullptr, nullptr);
-  ErrorResult rv;
-  event->InitWithKeyboardEventInit(aOwner, aType, aParam, rv);
-  if (NS_WARN_IF(rv.Failed())) {
-    rv.SuppressException();
-  }
-
-  event->mEvent->AsBeforeAfterKeyboardEvent()->mEmbeddedCancelled =
-    aParam.mEmbeddedCancelled;
-
-  return event.forget();
-}
-
-// static
-already_AddRefed
-BeforeAfterKeyboardEvent::Constructor(
-                            const GlobalObject& aGlobal,
-                            const nsAString& aType,
-                            const BeforeAfterKeyboardEventInit& aParam,
-                            ErrorResult& aRv)
-{
-  nsCOMPtr owner = do_QueryInterface(aGlobal.GetAsSupports());
-  return Constructor(owner, aType, aParam);
-}
-
-Nullable
-BeforeAfterKeyboardEvent::GetEmbeddedCancelled()
-{
-  return Nullable();
-}
-
-} // namespace dom
-} // namespace mozilla
-
-using namespace mozilla;
-using namespace mozilla::dom;
-
-already_AddRefed
-NS_NewDOMBeforeAfterKeyboardEvent(EventTarget* aOwner,
-                                  nsPresContext* aPresContext,
-                                  InternalBeforeAfterKeyboardEvent* aEvent)
-{
-  RefPtr it =
-    new BeforeAfterKeyboardEvent(aOwner, aPresContext, aEvent);
-  return it.forget();
-}
diff --git a/dom/events/BeforeAfterKeyboardEvent.h b/dom/events/BeforeAfterKeyboardEvent.h
deleted file mode 100644
index 2f41b693d2fb..000000000000
--- a/dom/events/BeforeAfterKeyboardEvent.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_BeforeAfterKeyboardEvent_h_
-#define mozilla_dom_BeforeAfterKeyboardEvent_h_
-
-#include "mozilla/dom/KeyboardEvent.h"
-#include "mozilla/dom/BeforeAfterKeyboardEventBinding.h"
-
-namespace mozilla {
-namespace dom {
-
-class BeforeAfterKeyboardEvent : public KeyboardEvent
-{
-public:
-  BeforeAfterKeyboardEvent(EventTarget* aOwner,
-                           nsPresContext* aPresContext,
-                           InternalBeforeAfterKeyboardEvent* aEvent);
-
-  virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override
-  {
-    return BeforeAfterKeyboardEventBinding::Wrap(aCx, this, aGivenProto);
-  }
-
-  static already_AddRefed
-  Constructor(const GlobalObject& aGlobal,
-              const nsAString& aType,
-              const BeforeAfterKeyboardEventInit& aParam,
-              ErrorResult& aRv);
-
-  static already_AddRefed
-  Constructor(EventTarget* aOwner, const nsAString& aType,
-              const BeforeAfterKeyboardEventInit& aEventInitDict);
-
-  Nullable GetEmbeddedCancelled();
-};
-
-} // namespace dom
-} // namespace mozilla
-
-already_AddRefed
-NS_NewDOMBeforeAfterKeyboardEvent(mozilla::dom::EventTarget* aOwner,
-                                  nsPresContext* aPresContext,
-                                  mozilla::InternalBeforeAfterKeyboardEvent* aEvent);
-
-#endif // mozilla_dom_BeforeAfterKeyboardEvent_h_
diff --git a/dom/events/EventDispatcher.cpp b/dom/events/EventDispatcher.cpp
index 59843605da5e..530262bd5768 100644
--- a/dom/events/EventDispatcher.cpp
+++ b/dom/events/EventDispatcher.cpp
@@ -13,7 +13,6 @@
 #include "nsINode.h"
 #include "nsPIDOMWindow.h"
 #include "AnimationEvent.h"
-#include "BeforeAfterKeyboardEvent.h"
 #include "BeforeUnloadEvent.h"
 #include "ClipboardEvent.h"
 #include "CommandEvent.h"
@@ -913,9 +912,6 @@ EventDispatcher::CreateEvent(EventTarget* aOwner,
     case eKeyboardEventClass:
       return NS_NewDOMKeyboardEvent(aOwner, aPresContext,
                                     aEvent->AsKeyboardEvent());
-    case eBeforeAfterKeyboardEventClass:
-      return NS_NewDOMBeforeAfterKeyboardEvent(aOwner, aPresContext,
-                                               aEvent->AsBeforeAfterKeyboardEvent());
     case eCompositionEventClass:
       return NS_NewDOMCompositionEvent(aOwner, aPresContext,
                                        aEvent->AsCompositionEvent());
diff --git a/dom/events/moz.build b/dom/events/moz.build
index ee494603888f..329cfae0c870 100644
--- a/dom/events/moz.build
+++ b/dom/events/moz.build
@@ -36,7 +36,6 @@ EXPORTS.mozilla += [
 
 EXPORTS.mozilla.dom += [
     'AnimationEvent.h',
-    'BeforeAfterKeyboardEvent.h',
     'BeforeUnloadEvent.h',
     'ClipboardEvent.h',
     'CommandEvent.h',
@@ -79,7 +78,6 @@ if CONFIG['MOZ_WEBSPEECH']:
 UNIFIED_SOURCES += [
     'AnimationEvent.cpp',
     'AsyncEventDispatcher.cpp',
-    'BeforeAfterKeyboardEvent.cpp',
     'BeforeUnloadEvent.cpp',
     'ClipboardEvent.cpp',
     'CommandEvent.cpp',
diff --git a/dom/events/test/test_all_synthetic_events.html b/dom/events/test/test_all_synthetic_events.html
index ddfcc9718215..42ff8f43b6ac 100644
--- a/dom/events/test/test_all_synthetic_events.html
+++ b/dom/events/test/test_all_synthetic_events.html
@@ -38,10 +38,6 @@ const kEventConstructors = {
                                              },
   AudioProcessingEvent:                      { create: null, // Cannot create untrusted event from JS.
                                              },
-  BeforeAfterKeyboardEvent:                  { create: function (aName, aProps) {
-                                                         return new BeforeAfterKeyboardEvent(aName, aProps);
-                                                       },
-                                             },
   BeforeUnloadEvent:                         { create: function (aName, aProps) {
                                                          var e = document.createEvent("beforeunloadevent");
                                                          e.initEvent(aName, aProps.bubbles, aProps.cancelable);
diff --git a/dom/webidl/BeforeAfterKeyboardEvent.webidl b/dom/webidl/BeforeAfterKeyboardEvent.webidl
deleted file mode 100644
index 75359596b305..000000000000
--- a/dom/webidl/BeforeAfterKeyboardEvent.webidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-[Constructor(DOMString typeArg,
- optional BeforeAfterKeyboardEventInit eventInitDict),
- Pref="dom.beforeAfterKeyboardEvent.enabled",
- ChromeOnly]
-interface BeforeAfterKeyboardEvent : KeyboardEvent
-{
-  readonly attribute boolean? embeddedCancelled;
-};
-
-dictionary BeforeAfterKeyboardEventInit : KeyboardEventInit
-{
-  boolean? embeddedCancelled = null;
-};
diff --git a/dom/webidl/moz.build b/dom/webidl/moz.build
index fbd859fb028b..3f2503df6294 100644
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -49,7 +49,6 @@ WEBIDL_FILES = [
     'BarProp.webidl',
     'BaseKeyframeTypes.webidl',
     'BatteryManager.webidl',
-    'BeforeAfterKeyboardEvent.webidl',
     'BeforeUnloadEvent.webidl',
     'BiquadFilterNode.webidl',
     'Blob.webidl',
diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp
index 8d851446be7b..ebf6513b425e 100644
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -48,7 +48,6 @@
 #include "nsPresContext.h"
 #include "nsIContent.h"
 #include "nsIContentIterator.h"
-#include "mozilla/dom/BeforeAfterKeyboardEvent.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/Event.h" // for Event::GetEventPopupControlState()
 #include "mozilla/dom/ShadowRoot.h"
@@ -89,7 +88,6 @@
 #include "nsILayoutHistoryState.h"
 #include "nsILineIterator.h" // for ScrollContentIntoView
 #include "PLDHashTable.h"
-#include "mozilla/dom/BeforeAfterKeyboardEventBinding.h"
 #include "mozilla/dom/Touch.h"
 #include "mozilla/dom/TouchEvent.h"
 #include "mozilla/dom/PointerEventBinding.h"
diff --git a/layout/base/PresShell.h b/layout/base/PresShell.h
index 839d1925ef80..06830cd385fc 100644
--- a/layout/base/PresShell.h
+++ b/layout/base/PresShell.h
@@ -784,7 +784,7 @@ protected:
 
 
   //////////////////////////////////////////////////////////////////////////////
-  // Methods for dispatching KeyboardEvent and BeforeAfterKeyboardEvent.
+  // Methods for dispatching KeyboardEvent.
   //////////////////////////////////////////////////////////////////////////////
 
   void HandleKeyboardEvent(nsINode* aTarget,
diff --git a/widget/EventClassList.h b/widget/EventClassList.h
index 9667a72c5b6f..e6a160fab86d 100644
--- a/widget/EventClassList.h
+++ b/widget/EventClassList.h
@@ -26,7 +26,6 @@ NS_EVENT_CLASS(Widget, CompositionEvent)
 NS_EVENT_CLASS(Widget, QueryContentEvent)
 NS_EVENT_CLASS(Widget, SelectionEvent)
 NS_EVENT_CLASS(Internal, EditorInputEvent)
-NS_EVENT_CLASS(Internal, BeforeAfterKeyboardEvent)
 
 // MouseEvents.h
 NS_EVENT_CLASS(Widget, MouseEventBase)
diff --git a/widget/TextEvents.h b/widget/TextEvents.h
index f7e1e3b4acbb..f378d92dd1b6 100644
--- a/widget/TextEvents.h
+++ b/widget/TextEvents.h
@@ -420,68 +420,6 @@ private:
   static CodeNameIndexHashtable* sCodeNameIndexHashtable;
 };
 
-
-/******************************************************************************
- * mozilla::InternalBeforeAfterKeyboardEvent
- *
- * This is extended from WidgetKeyboardEvent and is mapped to DOM event
- * "BeforeAfterKeyboardEvent".
- ******************************************************************************/
-class InternalBeforeAfterKeyboardEvent : public WidgetKeyboardEvent
-{
-private:
-  friend class dom::PBrowserParent;
-  friend class dom::PBrowserChild;
-
-  InternalBeforeAfterKeyboardEvent()
-  {
-  }
-
-public:
-  // Extra member for InternalBeforeAfterKeyboardEvent. Indicates whether
-  // default actions of keydown/keyup event is prevented.
-  Nullable mEmbeddedCancelled;
-
-  virtual InternalBeforeAfterKeyboardEvent* AsBeforeAfterKeyboardEvent() override
-  {
-    return this;
-  }
-
-  InternalBeforeAfterKeyboardEvent(bool aIsTrusted, EventMessage aMessage,
-                                   nsIWidget* aWidget)
-    : WidgetKeyboardEvent(aIsTrusted, aMessage, aWidget,
-                          eBeforeAfterKeyboardEventClass)
-  {
-  }
-
-  virtual WidgetEvent* Duplicate() const override
-  {
-    MOZ_ASSERT(mClass == eBeforeAfterKeyboardEventClass,
-               "Duplicate() must be overridden by sub class");
-    // Not copying widget, it is a weak reference.
-    InternalBeforeAfterKeyboardEvent* result =
-      new InternalBeforeAfterKeyboardEvent(false, mMessage, nullptr);
-    result->AssignBeforeAfterKeyEventData(*this, true);
-    result->mFlags = mFlags;
-    return result;
-  }
-
-  void AssignBeforeAfterKeyEventData(
-         const InternalBeforeAfterKeyboardEvent& aEvent,
-         bool aCopyTargets)
-  {
-    AssignKeyEventData(aEvent, aCopyTargets);
-    mEmbeddedCancelled = aEvent.mEmbeddedCancelled;
-  }
-
-  void AssignBeforeAfterKeyEventData(
-         const WidgetKeyboardEvent& aEvent,
-         bool aCopyTargets)
-  {
-    AssignKeyEventData(aEvent, aCopyTargets);
-  }
-};
-
 /******************************************************************************
  * mozilla::WidgetCompositionEvent
  ******************************************************************************/
diff --git a/widget/nsGUIEventIPC.h b/widget/nsGUIEventIPC.h
index e06e3784a0dc..c4d3fd5f3f02 100644
--- a/widget/nsGUIEventIPC.h
+++ b/widget/nsGUIEventIPC.h
@@ -482,37 +482,6 @@ struct ParamTraits
   }
 };
 
-template<>
-struct ParamTraits
-{
-  typedef mozilla::InternalBeforeAfterKeyboardEvent paramType;
-
-  static void Write(Message* aMsg, const paramType& aParam)
-  {
-    WriteParam(aMsg, static_cast(aParam));
-    WriteParam(aMsg, aParam.mEmbeddedCancelled.IsNull());
-    WriteParam(aMsg, aParam.mEmbeddedCancelled.Value());
-  }
-
-  static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
-  {
-    bool isNull;
-    bool value;
-    bool rv =
-      ReadParam(aMsg, aIter,
-                static_cast(aResult)) &&
-      ReadParam(aMsg, aIter, &isNull) &&
-      ReadParam(aMsg, aIter, &value);
-
-    aResult->mEmbeddedCancelled = Nullable();
-    if (rv && !isNull) {
-      aResult->mEmbeddedCancelled.SetValue(value);
-    }
-
-    return rv;
-  }
-};
-
 template<>
 struct ParamTraits
 {

From 91321b54b47ac7544e0afe0812e1c84cbdcea076 Mon Sep 17 00:00:00 2001
From: Masayuki Nakano 
Date: Fri, 16 Dec 2016 16:50:17 +0900
Subject: [PATCH 64/70] Bug 1322736 part.4 Remove pref to enable
 BeforeAfterKeyboardEvent and permission to allow to handle the event r=smaug

MozReview-Commit-ID: BcYcN4soTvg

--HG--
extra : rebase_source : e0695f539426dfb39180a45c7fc0d64ba8d644f3
---
 b2g/app/b2g.js                    |  3 --
 layout/base/PresShell.cpp         | 62 -------------------------------
 layout/base/PresShell.h           |  3 --
 modules/libpref/init/all.js       |  3 --
 testing/mochitest/manifest.webapp |  1 -
 5 files changed, 72 deletions(-)

diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js
index dd785e3c5538..5a6d6abe0a44 100644
--- a/b2g/app/b2g.js
+++ b/b2g/app/b2g.js
@@ -684,9 +684,6 @@ pref("dom.ipc.systemMessageCPULockTimeoutSec", 30);
 // Ignore the "dialog=1" feature in window.open.
 pref("dom.disable_window_open_dialog_feature", true);
 
-// Enable before keyboard events and after keyboard events.
-pref("dom.beforeAfterKeyboardEvent.enabled", true);
-
 // Screen reader support
 pref("accessibility.accessfu.activate", 2);
 pref("accessibility.accessfu.quicknav_modes", "Link,Heading,FormElement,Landmark,ListItem");
diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp
index ebf6513b425e..59da8b504050 100644
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -744,7 +744,6 @@ static bool sPointerEventEnabled = true;
 static bool sPointerEventImplicitCapture = false;
 static bool sAccessibleCaretEnabled = false;
 static bool sAccessibleCaretOnTouch = false;
-static bool sBeforeAfterKeyboardEventEnabled = false;
 
 /* static */ bool
 PresShell::AccessibleCaretEnabled(nsIDocShell* aDocShell)
@@ -768,18 +767,6 @@ PresShell::AccessibleCaretEnabled(nsIDocShell* aDocShell)
   return false;
 }
 
-/* static */ bool
-PresShell::BeforeAfterKeyboardEventEnabled()
-{
-  static bool sInitialized = false;
-  if (!sInitialized) {
-    Preferences::AddBoolVarCache(&sBeforeAfterKeyboardEventEnabled,
-      "dom.beforeAfterKeyboardEvent.enabled");
-    sInitialized = true;
-  }
-  return sBeforeAfterKeyboardEventEnabled;
-}
-
 /* static */ bool
 PresShell::IsTargetIframe(nsINode* aTarget)
 {
@@ -7042,55 +7029,6 @@ private:
   bool mIsSet;
 };
 
-static bool
-CheckPermissionForBeforeAfterKeyboardEvent(Element* aElement)
-{
-  // An element which is chrome-privileged should be able to handle before
-  // events and after events.
-  nsIPrincipal* principal = aElement->NodePrincipal();
-  if (nsContentUtils::IsSystemPrincipal(principal)) {
-    return true;
-  }
-
-  // An element which has "before-after-keyboard-event" permission should be
-  // able to handle before events and after events.
-  nsCOMPtr permMgr = services::GetPermissionManager();
-  uint32_t permission = nsIPermissionManager::DENY_ACTION;
-  if (permMgr) {
-    permMgr->TestPermissionFromPrincipal(principal, "before-after-keyboard-event", &permission);
-    if (permission == nsIPermissionManager::ALLOW_ACTION) {
-      return true;
-    }
-  }
-
-  return false;
-}
-
-static void
-BuildTargetChainForBeforeAfterKeyboardEvent(nsINode* aTarget,
-                                            nsTArray >& aChain,
-                                            bool aTargetIsIframe)
-{
-  Element* frameElement;
-  // If event target is not an iframe, skip the event target and get its
-  // parent frame.
-  if (aTargetIsIframe) {
-    frameElement = aTarget->AsElement();
-  } else {
-    nsPIDOMWindowOuter* window = aTarget->OwnerDoc()->GetWindow();
-    frameElement = window ? window->GetFrameElementInternal() : nullptr;
-  }
-
-  // Check permission for all ancestors and add them into the target chain.
-  while (frameElement) {
-    if (CheckPermissionForBeforeAfterKeyboardEvent(frameElement)) {
-      aChain.AppendElement(frameElement);
-    }
-    nsPIDOMWindowOuter* window = frameElement->OwnerDoc()->GetWindow();
-    frameElement = window ? window->GetFrameElementInternal() : nullptr;
-  }
-}
-
 bool
 PresShell::CanDispatchEvent(const WidgetGUIEvent* aEvent) const
 {
diff --git a/layout/base/PresShell.h b/layout/base/PresShell.h
index 06830cd385fc..da232fd35090 100644
--- a/layout/base/PresShell.h
+++ b/layout/base/PresShell.h
@@ -91,9 +91,6 @@ public:
 
   static bool AccessibleCaretEnabled(nsIDocShell* aDocShell);
 
-  // BeforeAfterKeyboardEvent preference
-  static bool BeforeAfterKeyboardEventEnabled();
-
   static bool IsTargetIframe(nsINode* aTarget);
 
   void Init(nsIDocument* aDocument, nsPresContext* aPresContext,
diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js
index e635036488ab..375d37e57797 100644
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -5252,9 +5252,6 @@ pref("camera.control.low_memory_thresholdMB", 404);
 // UDPSocket API
 pref("dom.udpsocket.enabled", false);
 
-// Disable before keyboard events and after keyboard events by default.
-pref("dom.beforeAfterKeyboardEvent.enabled", false);
-
 // Presentation API
 pref("dom.presentation.enabled", false);
 pref("dom.presentation.controller.enabled", false);
diff --git a/testing/mochitest/manifest.webapp b/testing/mochitest/manifest.webapp
index a1c03e257b91..a557652a16f1 100644
--- a/testing/mochitest/manifest.webapp
+++ b/testing/mochitest/manifest.webapp
@@ -26,7 +26,6 @@
     "network-events":{},
     "audio-channel-content":{},
     "audio-channel-alarm":{},
-    "before-after-keyboard-event":{}
   },
   "locales": {
     "en-US": {

From 8ff4e83b8c53b568335cbe7b6119a6fb7730d6cf Mon Sep 17 00:00:00 2001
From: Andreas Tolfsen 
Date: Mon, 19 Dec 2016 19:08:46 +0000
Subject: [PATCH 65/70] Bug 1324467 - Make copy of data to send to listener;
 r=automatedtester

The payload sent to the listener through `GeckoDriver#sendAsync` is
sometimes mutated if a `commandID` parameter is given.  Because `data`
is sometimes a reference to an object, the original object gets modified
with an additional `command_id` field.

To avoid this we copy the object before mutating it and pass it through
to the message manager.

MozReview-Commit-ID: HM2tnPqbAge

--HG--
extra : rebase_source : 6aa593973d82bdf4addd8003ce68df9ad3179a4a
---
 testing/marionette/driver.js   | 95 +++++++++++++++++++++-------------
 testing/marionette/listener.js |  3 +-
 2 files changed, 60 insertions(+), 38 deletions(-)

diff --git a/testing/marionette/driver.js b/testing/marionette/driver.js
index a6f924501d89..fbad2dd05764 100644
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -209,48 +209,61 @@ GeckoDriver.prototype.switchToGlobalMessageManager = function() {
 /**
  * Helper method to send async messages to the content listener.
  * Correct usage is to pass in the name of a function in listener.js,
- * a message object consisting of JSON serialisable primitives,
- * and the current command's ID.
+ * a serialisable object, and optionally the current command's ID
+ * when not using the modern dispatching technique.
  *
  * @param {string} name
- *     Suffix of the targetted message listener ({@code Marionette:}).
+ *     Suffix of the targetted message listener
+ *     ({@code Marionette:}).
  * @param {Object=} msg
- *     JSON serialisable object to send to the listener.
- * @param {number=} cmdId
- *     Command ID to ensure synchronisity.
+ *     Optional JSON serialisable object to send to the listener.
+ * @param {number=} commandID
+ *     Optional command ID to ensure synchronisity.
  */
-GeckoDriver.prototype.sendAsync = function (name, msg, cmdId) {
-  let curRemoteFrame = this.curBrowser.frameManager.currentRemoteFrame;
+GeckoDriver.prototype.sendAsync = function (name, data, commandID) {
   name = "Marionette:" + name;
+  let payload = copy(data);
 
   // TODO(ato): When proxy.AsyncMessageChannel
   // is used for all chrome <-> content communication
   // this can be removed.
-  if (cmdId) {
-    msg.command_id = cmdId;
+  if (commandID) {
+    payload.command_id = commandID;
   }
 
-  if (curRemoteFrame === null) {
-    this.curBrowser.executeWhenReady(() => {
-      if (this.curBrowser.curFrameId) {
-        this.mm.broadcastAsyncMessage(name + this.curBrowser.curFrameId, msg);
-      } else {
-        throw new NoSuchWindowError(
-            "No such content frame; perhaps the listener was not registered?");
-      }
-    });
+  if (!this.curBrowser.frameManager.currentRemoteFrame) {
+    this.broadcastDelayedAsyncMessage_(name, payload);
   } else {
-    let remoteFrameId = curRemoteFrame.targetFrameId;
-    try {
-      this.mm.sendAsyncMessage(name + remoteFrameId, msg);
-    } catch (e) {
-      switch(e.result) {
-        case Cr.NS_ERROR_FAILURE:
-        case Cr.NS_ERROR_NOT_INITIALIZED:
-          throw new NoSuchWindowError();
-        default:
-          throw new WebDriverError(e.toString());
-      }
+    this.sendTargettedAsyncMessage_(name, payload);
+  }
+};
+
+GeckoDriver.prototype.broadcastDelayedAsyncMessage_ = function (name, payload) {
+  this.curBrowser.executeWhenReady(() => {
+    if (this.curBrowser.curFrameId) {
+      const target = name + this.curBrowser.curFrameId;
+      this.mm.broadcastAsyncMessage(target, payload);
+    } else {
+      throw new NoSuchWindowError(
+          "No such content frame; perhaps the listener was not registered?");
+    }
+  });
+};
+
+GeckoDriver.prototype.sendTargettedAsyncMessage_ = function (name, payload) {
+  const curRemoteFrame = this.curBrowser.frameManager.currentRemoteFrame;
+  const target = name + curRemoteFrame.targetFrameId;
+
+  try {
+    this.mm.sendAsyncMessage(target, payload);
+  } catch (e) {
+    switch (e.result) {
+      case Cr.NS_ERROR_FAILURE:
+      case Cr.NS_ERROR_NOT_INITIALIZED:
+        throw new NoSuchWindowError();
+
+      default:
+        throw new WebDriverError(e);
     }
   }
 };
@@ -462,8 +475,8 @@ GeckoDriver.prototype.registerBrowser = function (id, be) {
 GeckoDriver.prototype.registerPromise = function() {
   const li = "Marionette:register";
 
-  return new Promise((resolve) => {
-    let cb = (msg) => {
+  return new Promise(resolve => {
+    let cb = msg => {
       let wid = msg.json.value;
       let be = msg.target;
       let rv = this.registerBrowser(wid, be);
@@ -486,7 +499,7 @@ GeckoDriver.prototype.registerPromise = function() {
 
 GeckoDriver.prototype.listeningPromise = function() {
   const li = "Marionette:listenersAttached";
-  return new Promise((resolve) => {
+  return new Promise(resolve => {
     let cb = () => {
       this.mm.removeMessageListener(li, cb);
       resolve();
@@ -584,8 +597,10 @@ GeckoDriver.prototype.newSession = function*(cmd, resp) {
   yield registerBrowsers;
   yield browserListening;
 
-  resp.body.sessionId = this.sessionId;
-  resp.body.capabilities = this.sessionCapabilities;
+  return {
+    sessionId: this.sessionId,
+    capabilities: this.sessionCapabilities,
+  };
 };
 
 /**
@@ -671,7 +686,6 @@ GeckoDriver.prototype.setSessionCapabilities = function (newCaps) {
   let caps = copy(this.sessionCapabilities);
   caps = copy(newCaps, caps);
   logger.config("Changing capabilities: " + JSON.stringify(caps));
-
   this.sessionCapabilities = caps;
 };
 
@@ -2895,3 +2909,12 @@ GeckoDriver.prototype.commands = {
   "addon:install": GeckoDriver.prototype.installAddon,
   "addon:uninstall": GeckoDriver.prototype.uninstallAddon,
 };
+
+function copy (obj) {
+  if (Array.isArray(obj)) {
+    return obj.slice();
+  } else if (typeof obj == "object") {
+    return Object.assign({}, obj);
+  }
+  return obj;
+}
diff --git a/testing/marionette/listener.js b/testing/marionette/listener.js
index 93b320c9f81d..4cf2b629f5b7 100644
--- a/testing/marionette/listener.js
+++ b/testing/marionette/listener.js
@@ -123,11 +123,10 @@ function registerSelf() {
   if (register[0]) {
     let {id, remotenessChange} = register[0][0];
     capabilities = register[0][2];
-    isB2G = capabilities.platformName == "b2g";
     listenerId = id;
     if (typeof id != "undefined") {
       // check if we're the main process
-      if (register[0][1] == true) {
+      if (register[0][1]) {
         addMessageListener("MarionetteMainListener:emitTouchEvent", emitTouchEventForIFrame);
       }
       startListeners();

From 0bb0d35bc055f5254c8e885e74f07d435cbcced0 Mon Sep 17 00:00:00 2001
From: Tomer Cohen 
Date: Tue, 20 Dec 2016 12:42:43 +0200
Subject: [PATCH 66/70] Bug 1323504 - Add RTL support for the Toolbox Options
 r=jdescottes

MozReview-Commit-ID: DkAfbQyIdkR

--HG--
extra : rebase_source : 667dff4d65612cb47615ef50ac170bdf71c0c739
---
 devtools/client/framework/options-panel.css     | 2 +-
 devtools/client/framework/toolbox-options.xhtml | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/devtools/client/framework/options-panel.css b/devtools/client/framework/options-panel.css
index 5f4cd992cc49..53b510eaf173 100644
--- a/devtools/client/framework/options-panel.css
+++ b/devtools/client/framework/options-panel.css
@@ -15,7 +15,7 @@
 
 .options-vertical-pane {
   display: inline;
-  float: left;
+  float: inline-start;
 }
 
 .options-vertical-pane {
diff --git a/devtools/client/framework/toolbox-options.xhtml b/devtools/client/framework/toolbox-options.xhtml
index c8279e211f3d..ba1ebde77a25 100644
--- a/devtools/client/framework/toolbox-options.xhtml
+++ b/devtools/client/framework/toolbox-options.xhtml
@@ -6,7 +6,7 @@
 
  %toolboxDTD;
 ]>
-
+
   
     Toolbox option
     

From 22418ad00dc719ab3bfd4a201cf8129fd80a034f Mon Sep 17 00:00:00 2001
From: Henrik Skupin 
Date: Tue, 20 Dec 2016 10:30:39 +0100
Subject: [PATCH 67/70] Bug 1324373 - Fix Javascript errors in Marionette's
 get_pref() method. r=ato

Given that all other code is using Components.interfaces it should also be
used in get_pref(). Further arguments is not iterable in older Firefox releases,
so we cannot use the unfolding - it would break Firefox UI update tests for
Firefox 45ESR -> 52ESR.

MozReview-Commit-ID: LZNdkW9XBvy

--HG--
extra : rebase_source : f01d9969fdefee944fa3dfc26113430ec1b32919
---
 .../marionette/client/marionette_driver/marionette.py  | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/testing/marionette/client/marionette_driver/marionette.py b/testing/marionette/client/marionette_driver/marionette.py
index 811d6c426c8b..7afdcab6d894 100644
--- a/testing/marionette/client/marionette_driver/marionette.py
+++ b/testing/marionette/client/marionette_driver/marionette.py
@@ -983,10 +983,12 @@ class Marionette(object):
             pref_value = self.execute_script("""
                 Components.utils.import("resource://gre/modules/Preferences.jsm");
 
-                let [pref, defaultBranch, valueType] = arguments;
+                let pref = arguments[0];
+                let defaultBranch = arguments[1];
+                let valueType = arguments[2];
 
                 prefs = new Preferences({defaultBranch: defaultBranch});
-                return prefs.get(pref, null, valueType=Ci[valueType]);
+                return prefs.get(pref, null, Components.interfaces[valueType]);
                 """, script_args=(pref, default_branch, value_type))
             return pref_value
 
@@ -1014,7 +1016,9 @@ class Marionette(object):
             self.execute_script("""
                 Components.utils.import("resource://gre/modules/Preferences.jsm");
 
-                let [pref, value, defaultBranch] = arguments;
+                let pref = arguments[0];
+                let value = arguments[1];
+                let defaultBranch = arguments[2];
 
                 prefs = new Preferences({defaultBranch: defaultBranch});
                 prefs.set(pref, value);

From 892dd1cb42c2829396e2c562fa85519172fd57ab Mon Sep 17 00:00:00 2001
From: Andreas Tolfsen 
Date: Mon, 19 Dec 2016 19:28:17 +0000
Subject: [PATCH 68/70] Bug 1324529 - Rename Marionette capability
 raisesAccessibilityExceptions to moz:accessibilityChecks; r=whimboo,yzen

This change renames the `raisesAccessibilityExceptions` capability to
`moz:accessibilityChecks` to conform with the format of extension
capabilities as defined in the WebDriver specification.

As this feature is not tested or used in the Firefox upgrade tests and
has limited deployment outside Mozilla, it is considered safe for this
to be a breaking change.

MozReview-Commit-ID: DRA16cWJDX0

--HG--
extra : rebase_source : 42fac27f655ce431ae68bbaeeec6a208d91e9033
---
 testing/marionette/driver.js                  | 20 ++++++++++---------
 .../tests/unit/test_accessibility.py          |  5 ++---
 .../tests/unit/test_capabilities.py           |  3 +++
 testing/marionette/listener.js                | 12 +++++------
 4 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/testing/marionette/driver.js b/testing/marionette/driver.js
index fbad2dd05764..f754f266ec0d 100644
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -156,7 +156,6 @@ this.GeckoDriver = function (appName, server) {
     "acceptInsecureCerts": !this.secureTLS,
 
     // supported features
-    "raisesAccessibilityExceptions": false,
     "rotatable": this.appName == "B2G",
     "proxy": {},
 
@@ -164,6 +163,7 @@ this.GeckoDriver = function (appName, server) {
     "specificationLevel": 0,
     "moz:processID": Services.appinfo.processID,
     "moz:profile": Services.dirsvc.get("ProfD", Ci.nsIFile).path,
+    "moz:accessibilityChecks": false,
   };
 
   this.mm = globalMessageManager;
@@ -183,6 +183,10 @@ this.GeckoDriver = function (appName, server) {
   this.actions = new action.Chain();
 };
 
+Object.defineProperty(GeckoDriver.prototype, "a11yChecks", {
+  get: function () { return this.sessionCapabilities["moz:accessibilityChecks"]; }
+});
+
 GeckoDriver.prototype.QueryInterface = XPCOMUtils.generateQI([
   Ci.nsIMessageListener,
   Ci.nsIObserver,
@@ -532,8 +536,7 @@ GeckoDriver.prototype.newSession = function*(cmd, resp) {
   // If we are testing accessibility with marionette, start a11y service in
   // chrome first. This will ensure that we do not have any content-only
   // services hanging around.
-  if (this.sessionCapabilities.raisesAccessibilityExceptions &&
-      accessibility.service) {
+  if (this.a11yChecks && accessibility.service) {
     logger.info("Preemptively starting accessibility service in Chrome");
   }
 
@@ -1784,8 +1787,7 @@ GeckoDriver.prototype.clickElement = function*(cmd, resp) {
     case Context.CHROME:
       let win = this.getCurrentWindow();
       let el = this.curBrowser.seenEls.get(id, {frame: win});
-      yield interaction.clickElement(
-          el, this.sessionCapabilities.raisesAccessibilityExceptions);
+      yield interaction.clickElement(el, this.a11yChecks);
       break;
 
     case Context.CONTENT:
@@ -1915,7 +1917,7 @@ GeckoDriver.prototype.isElementDisplayed = function*(cmd, resp) {
       let win = this.getCurrentWindow();
       let el = this.curBrowser.seenEls.get(id, {frame: win});
       resp.body.value = yield interaction.isElementDisplayed(
-          el, this.sessionCapabilities.raisesAccessibilityExceptions);
+          el, this.a11yChecks);
       break;
 
     case Context.CONTENT:
@@ -1964,7 +1966,7 @@ GeckoDriver.prototype.isElementEnabled = function*(cmd, resp) {
       let win = this.getCurrentWindow();
       let el = this.curBrowser.seenEls.get(id, {frame: win});
       resp.body.value = yield interaction.isElementEnabled(
-          el, this.sessionCapabilities.raisesAccessibilityExceptions);
+          el, this.a11yChecks);
       break;
 
     case Context.CONTENT:
@@ -1988,7 +1990,7 @@ GeckoDriver.prototype.isElementSelected = function*(cmd, resp) {
       let win = this.getCurrentWindow();
       let el = this.curBrowser.seenEls.get(id, {frame: win});
       resp.body.value = yield interaction.isElementSelected(
-          el, this.sessionCapabilities.raisesAccessibilityExceptions);
+          el, this.a11yChecks);
       break;
 
     case Context.CONTENT:
@@ -2036,7 +2038,7 @@ GeckoDriver.prototype.sendKeysToElement = function*(cmd, resp) {
       let win = this.getCurrentWindow();
       let el = this.curBrowser.seenEls.get(id, {frame: win});
       yield interaction.sendKeysToElement(
-          el, value, true, this.sessionCapabilities.raisesAccessibilityExceptions);
+          el, value, true, this.a11yChecks);
       break;
 
     case Context.CONTENT:
diff --git a/testing/marionette/harness/marionette_harness/tests/unit/test_accessibility.py b/testing/marionette/harness/marionette_harness/tests/unit/test_accessibility.py
index 22fd51ddaaed..03edb32486ce 100644
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_accessibility.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_accessibility.py
@@ -90,10 +90,9 @@ class TestAccessibility(MarionetteTestCase):
             element = self.marionette.find_element(By.ID, id)
             testFn(element)
 
-    def setup_accessibility(self, raisesAccessibilityExceptions=True, navigate=True):
+    def setup_accessibility(self, enable_a11y_checks=True, navigate=True):
         self.marionette.delete_session()
-        self.marionette.start_session(
-            {"raisesAccessibilityExceptions": raisesAccessibilityExceptions})
+        self.marionette.start_session({"moz:accessibilityChecks": enable_a11y_checks})
         # Navigate to test_accessibility.html
         if navigate:
             test_accessibility = self.marionette.absolute_url("test_accessibility.html")
diff --git a/testing/marionette/harness/marionette_harness/tests/unit/test_capabilities.py b/testing/marionette/harness/marionette_harness/tests/unit/test_capabilities.py
index a7d0e3951d2d..8cbc0e319ecf 100644
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_capabilities.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_capabilities.py
@@ -48,6 +48,9 @@ class TestCapabilities(MarionetteTestCase):
         self.assertEqual(self.caps["moz:profile"], current_profile)
         self.assertEqual(self.marionette.profile, current_profile)
 
+        self.assertIn("moz:accessibilityChecks", self.caps)
+        self.assertFalse(self.caps["moz:accessibilityChecks"])
+
     def test_we_can_pass_in_capabilities_on_session_start(self):
         self.marionette.delete_session()
         capabilities = {"desiredCapabilities": {"somethingAwesome": "cake"}}
diff --git a/testing/marionette/listener.js b/testing/marionette/listener.js
index 4cf2b629f5b7..df0f13961939 100644
--- a/testing/marionette/listener.js
+++ b/testing/marionette/listener.js
@@ -634,7 +634,7 @@ function singleTap(id, corx, cory) {
     throw new ElementNotVisibleError("Element is not currently visible and may not be manipulated");
   }
 
-  let a11y = accessibility.get(capabilities.raisesAccessibilityExceptions);
+  let a11y = accessibility.get(capabilities["moz:accessibilityChecks"]);
   return a11y.getAccessible(el, true).then(acc => {
     a11y.assertVisible(acc, el, visible);
     a11y.assertActionable(acc, el);
@@ -1157,7 +1157,7 @@ function clickElement(id) {
   let el = seenEls.get(id, curContainer);
   return interaction.clickElement(
       el,
-      !!capabilities.raisesAccessibilityExceptions,
+      !!capabilities["moz:accessibilityChecks"],
       capabilities.specificationLevel >= 1);
 }
 
@@ -1216,7 +1216,7 @@ function getElementTagName(id) {
 function isElementDisplayed(id) {
   let el = seenEls.get(id, curContainer);
   return interaction.isElementDisplayed(
-      el, capabilities.raisesAccessibilityExceptions);
+      el, capabilities["moz:accessibilityChecks"]);
 }
 
 /**
@@ -1269,7 +1269,7 @@ function getElementRect(id) {
 function isElementEnabled(id) {
   let el = seenEls.get(id, curContainer);
   return interaction.isElementEnabled(
-      el, capabilities.raisesAccessibilityExceptions);
+      el, capabilities["moz:accessibilityChecks"]);
 }
 
 /**
@@ -1281,7 +1281,7 @@ function isElementEnabled(id) {
 function isElementSelected(id) {
   let el = seenEls.get(id, curContainer);
   return interaction.isElementSelected(
-      el, capabilities.raisesAccessibilityExceptions);
+      el, capabilities["moz:accessibilityChecks"]);
 }
 
 function* sendKeysToElement(id, val) {
@@ -1291,7 +1291,7 @@ function* sendKeysToElement(id, val) {
     yield interaction.uploadFile(el, path);
   } else {
     yield interaction.sendKeysToElement(
-        el, val, false, capabilities.raisesAccessibilityExceptions);
+        el, val, false, capabilities["moz:accessibilityChecks"]);
   }
 }
 

From a948469c0d9bb4b6a844d81207d7a9f4a576cf42 Mon Sep 17 00:00:00 2001
From: ffxbld 
Date: Tue, 20 Dec 2016 06:26:59 -0800
Subject: [PATCH 69/70] No bug, Automated HSTS preload list update from host
 bld-linux64-spot-386 - a=hsts-update

---
 security/manager/ssl/nsSTSPreloadList.errors |   154 +-
 security/manager/ssl/nsSTSPreloadList.inc    | 26462 ++++++++---------
 2 files changed, 13305 insertions(+), 13311 deletions(-)

diff --git a/security/manager/ssl/nsSTSPreloadList.errors b/security/manager/ssl/nsSTSPreloadList.errors
index c79132f43e32..80d122f4c979 100644
--- a/security/manager/ssl/nsSTSPreloadList.errors
+++ b/security/manager/ssl/nsSTSPreloadList.errors
@@ -1,5 +1,7 @@
+0.me.uk: did not receive HSTS header
 020wifi.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121"  data: no]
 0p.no: did not receive HSTS header
+0x.cx: could not connect to host
 0x.sk: could not connect to host
 0x1337.eu: could not connect to host
 0x44.net: did not receive HSTS header
@@ -16,7 +18,6 @@
 1password.com: did not receive HSTS header
 1xcess.com: could not connect to host
 206rc.net: max-age too low: 2592000
-24hourpaint.com: did not receive HSTS header
 25daysof.io: could not connect to host
 2859cc.com: could not connect to host
 2or3.tk: could not connect to host
@@ -185,7 +186,6 @@ ancientkarma.com: could not connect to host
 andere-gedanken.net: max-age too low: 10
 andiplusben.com: could not connect to host
 andreasbreitenlohner.de: did not receive HSTS header
-andreaskrasa.com: could not connect to host
 andreasolsson.se: could not connect to host
 andreastoneman.com: could not connect to host
 andreigec.net: did not receive HSTS header
@@ -222,7 +222,6 @@ antscript.com: did not receive HSTS header
 any.pm: could not connect to host
 anycoin.me: could not connect to host
 aojiao.org: did not receive HSTS header
-aosc.io: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121"  data: no]
 apachelounge.com: did not receive HSTS header
 apeasternpower.com: max-age too low: 0
 api.lookout.com: could not connect to host
@@ -281,6 +280,7 @@ asset-alive.net: did not receive HSTS header
 astrath.net: could not connect to host
 astrolpost.com: could not connect to host
 astromelody.com: did not receive HSTS header
+asuhe.cc: did not receive HSTS header
 atavio.at: could not connect to host
 atavio.ch: could not connect to host
 atavio.de: did not receive HSTS header
@@ -297,6 +297,7 @@ aubiosales.com: did not receive HSTS header
 aucubin.moe: could not connect to host
 aufmerksamkeitsstudie.com: could not connect to host
 aujapan.ru: could not connect to host
+aurainfosec.com: did not receive HSTS header
 aurainfosec.com.au: could not connect to host
 ausnah.me: could not connect to host
 ausoptic.com.au: max-age too low: 2592000
@@ -338,7 +339,6 @@ baldwinkoo.com: could not connect to host
 bananabandy.com: could not connect to host
 bandb.xyz: could not connect to host
 bandrcrafts.com: could not connect to host
-bangzafran.com: did not receive HSTS header
 bannisbierblog.de: could not connect to host
 banqingdiao.com: could not connect to host
 barbaros.info: could not connect to host
@@ -412,6 +412,7 @@ bildschirmflackern.de: did not receive HSTS header
 billin.net: could not connect to host
 billkiss.com: max-age too low: 300
 billninja.com: could not connect to host
+binarization.com: could not connect to host
 binderapp.net: could not connect to host
 biofam.ru: did not receive HSTS header
 bionicspirit.com: could not connect to host
@@ -429,8 +430,6 @@ bitheus.com: could not connect to host
 bithosting.io: did not receive HSTS header
 bitnet.io: did not receive HSTS header
 bitsafe.systems: could not connect to host
-bitstorm.nl: could not connect to host
-bitstorm.org: could not connect to host
 bitvigor.com: could not connect to host
 bivsi.com: could not connect to host
 bizcms.com: did not receive HSTS header
@@ -460,6 +459,7 @@ blucas.org: did not receive HSTS header
 blueliv.com: did not receive HSTS header
 bluescloud.xyz: could not connect to host
 bluetenmeer.com: did not receive HSTS header
+blupig.net: did not receive HSTS header
 bm-trading.nl: did not receive HSTS header
 bngsecure.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121"  data: no]
 bobiji.com: did not receive HSTS header
@@ -536,7 +536,7 @@ butchersworkshop.com: did not receive HSTS header
 buttercoin.com: could not connect to host
 buybaby.eu: did not receive HSTS header
 buyfox.de: did not receive HSTS header
-bvalle.com: could not connect to host
+bvalle.com: did not receive HSTS header
 by4cqb.cn: could not connect to host
 bydisk.com: could not connect to host
 bypassed.press: could not connect to host
@@ -711,7 +711,6 @@ codabix.net: could not connect to host
 code.google.com: did not receive HSTS header (error ignored - included regardless)
 codeco.pw: could not connect to host
 codeforce.io: did not receive HSTS header
-codepult.com: could not connect to host
 codepx.com: did not receive HSTS header
 codiva.io: max-age too low: 2592000
 coffeeetc.co.uk: did not receive HSTS header
@@ -720,6 +719,7 @@ coiffeurschnittstelle.ch: did not receive HSTS header
 coindam.com: could not connect to host
 coldfff.com: could not connect to host
 coldlostsick.net: could not connect to host
+colinwolff.com: could not connect to host
 colisfrais.com: did not receive HSTS header
 collies.eu: did not receive HSTS header
 collins.kg: did not receive HSTS header
@@ -739,7 +739,6 @@ concord-group.co.jp: did not receive HSTS header
 condesaelectronics.com: max-age too low: 0
 confirm365.com: could not connect to host
 conformal.com: could not connect to host
-connect-ed.network: could not connect to host
 conrad-kostecki.de: did not receive HSTS header
 consciousandglamorous.com: could not connect to host
 console.python.org: did not receive HSTS header
@@ -783,8 +782,8 @@ criena.net: could not connect to host
 critical.today: could not connect to host
 criticalaim.com: could not connect to host
 crizk.com: could not connect to host
-crmdemo.website: could not connect to host
 crosssec.com: did not receive HSTS header
+crow.tw: could not connect to host
 crowd.supply: did not receive HSTS header
 crowdcurity.com: did not receive HSTS header
 crowdjuris.com: could not connect to host
@@ -807,6 +806,7 @@ csgoelemental.com: could not connect to host
 csgokings.eu: could not connect to host
 csohack.tk: could not connect to host
 cspbuilder.info: could not connect to host
+csvape.com: did not receive HSTS header
 ct.search.yahoo.com: did not receive HSTS header
 cthulhuden.com: could not connect to host
 cubeserver.eu: could not connect to host
@@ -833,8 +833,6 @@ dango.in: did not receive HSTS header
 daniel-steuer.de: did not receive HSTS header
 danielcowie.me: could not connect to host
 danieldk.eu: did not receive HSTS header
-danielmostertman.com: did not receive HSTS header
-danielmostertman.nl: did not receive HSTS header
 danielworthy.com: did not receive HSTS header
 danijobs.com: could not connect to host
 danpiel.net: could not connect to host
@@ -915,7 +913,6 @@ desiccantpackets.com: did not receive HSTS header
 destinationbijoux.fr: could not connect to host
 detector.exposed: could not connect to host
 detest.org: could not connect to host
-detutorial.com: did not receive HSTS header
 devcu.net: did not receive HSTS header
 devh.de: did not receive HSTS header
 devincrow.me: could not connect to host
@@ -923,13 +920,11 @@ devinfo.net: did not receive HSTS header
 devmsg.com: did not receive HSTS header
 devtub.com: did not receive HSTS header
 devuan.org: did not receive HSTS header
-dgeex.eu: could not connect to host
 diablotine.rocks: could not connect to host
 diarbag.us: did not receive HSTS header
 diasp.cz: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121"  data: no]
 diedrich.co: could not connect to host
 digidroom.be: did not receive HSTS header
-digitalbank.kz: could not connect to host
 digitaldaddy.net: could not connect to host
 digitalriver.tk: could not connect to host
 digitalskillswap.com: could not connect to host
@@ -941,6 +936,7 @@ dislocated.de: did not receive HSTS header
 disowned.net: max-age too low: 0
 dissimulo.me: could not connect to host
 dittvertshus.no: could not connect to host
+dixmag.com: could not connect to host
 dizihocasi.com: did not receive HSTS header
 dizorg.net: could not connect to host
 dj4et.de: did not receive HSTS header
@@ -949,7 +945,6 @@ dlouwrink.nl: could not connect to host
 dmarc.dk: did not receive HSTS header
 dmxledlights.com: could not connect to host
 dn42.eu: could not connect to host
-dn42.us: could not connect to host
 dns.google.com: did not receive HSTS header (error ignored - included regardless)
 do-do.tk: could not connect to host
 do.search.yahoo.com: did not receive HSTS header
@@ -964,6 +959,7 @@ dollarstore24.com: could not connect to host
 dollywiki.co.uk: could not connect to host
 dolphin-cloud.com: could not connect to host
 dolphincorp.co.uk: could not connect to host
+domadillo.com: could not connect to host
 domaris.de: did not receive HSTS header
 dominique-mueller.de: did not receive HSTS header
 donttrustrobots.nl: could not connect to host
@@ -982,7 +978,6 @@ download.jitsi.org: did not receive HSTS header
 downsouthweddings.com.au: did not receive HSTS header
 doyoucheck.com: did not receive HSTS header
 dpratt.de: could not connect to host
-dprd-wonogirikab.go.id: did not receive HSTS header
 dr2dr.ca: did not receive HSTS header
 dragonisles.net: could not connect to host
 dragons-of-highlands.cz: could not connect to host
@@ -993,7 +988,6 @@ drdevil.ru: could not connect to host
 drdim.ru: could not connect to host
 dreadbyte.com: could not connect to host
 dreaming.solutions: did not receive HSTS header
-dreamlinehost.com: did not receive HSTS header
 drishti.guru: could not connect to host
 drive.google.com: did not receive HSTS header (error ignored - included regardless)
 driving-lessons.co.uk: did not receive HSTS header
@@ -1065,7 +1059,7 @@ elanguest.pl: could not connect to host
 elbetech.net: could not connect to host
 electricianforum.co.uk: could not connect to host
 electromc.com: could not connect to host
-elemenx.com: could not connect to host
+elemenx.com: did not receive HSTS header
 elemprendedor.com.ve: could not connect to host
 elenag.ga: could not connect to host
 elenoon.ir: did not receive HSTS header
@@ -1117,7 +1111,7 @@ equatetechnologies.com.au: max-age too low: 3600
 equilibre-yoga-jennifer-will.com: could not connect to host
 erawanarifnugroho.com: did not receive HSTS header
 eressea.xyz: could not connect to host
-ericyl.com: did not receive HSTS header
+ericyl.com: could not connect to host
 ernesto.at: could not connect to host
 eromixx.com: did not receive HSTS header
 erotalia.es: could not connect to host
@@ -1129,7 +1123,6 @@ errors.zenpayroll.com: could not connect to host
 ersindemirtas.com: did not receive HSTS header
 esclear.de: did not receive HSTS header
 escotour.com: did not receive HSTS header
-escritoriodearte.com: did not receive HSTS header
 esec.rs: did not receive HSTS header
 espra.com: could not connect to host
 esquonic.com: could not connect to host
@@ -1139,6 +1132,7 @@ estilosapeca.com: could not connect to host
 etdonline.co.uk: could not connect to host
 eternitylove.us: could not connect to host
 ethack.org: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121"  data: no]
+ethanfaust.com: could not connect to host
 ethicalexploiting.com: could not connect to host
 etsysecure.com: could not connect to host
 etula.ga: could not connect to host
@@ -1219,7 +1213,6 @@ fexmen.com: could not connect to host
 ffmradio.de: did not receive HSTS header
 fhdhelp.de: could not connect to host
 fhdhilft.de: could not connect to host
-fifieldtech.com: could not connect to host
 fiftyshadesofluca.ml: could not connect to host
 fig.co: did not receive HSTS header
 fightr.co: could not connect to host
@@ -1264,6 +1257,7 @@ flowersandclouds.com: could not connect to host
 flukethoughts.com: could not connect to host
 flushstudios.com: did not receive HSTS header
 flyaces.com: did not receive HSTS header
+flyserver.co.il: did not receive HSTS header
 flyss.net: did not receive HSTS header
 fm83.nl: could not connect to host
 fndout.com: did not receive HSTS header
@@ -1288,6 +1282,7 @@ foxdev.io: could not connect to host
 foxelbox.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121"  data: no]
 foxtrot.pw: could not connect to host
 fr33d0m.link: could not connect to host
+fragmentspuren.de: could not connect to host
 francescopalazzo.com: could not connect to host
 francevpn.xyz: could not connect to host
 frangor.info: did not receive HSTS header
@@ -1329,7 +1324,6 @@ fx-rk.com: did not receive HSTS header
 fyfywka.com: could not connect to host
 fysiohaenraets.nl: did not receive HSTS header
 fzn.io: could not connect to host
-g01.in.ua: could not connect to host
 g2a.co: did not receive HSTS header
 g2g.com: did not receive HSTS header
 g4w.co: did not receive HSTS header (error ignored - included regardless)
@@ -1369,6 +1363,8 @@ gem-indonesia.net: could not connect to host
 genuu.com: could not connect to host
 genuxation.com: could not connect to host
 genyaa.com: could not connect to host
+georgemaschke.net: did not receive HSTS header
+georgmayer.eu: could not connect to host
 gerencianet.com.br: did not receive HSTS header
 get.zenpayroll.com: did not receive HSTS header
 getable.com: did not receive HSTS header
@@ -1383,6 +1379,7 @@ getlantern.org: did not receive HSTS header
 getlifti.com: did not receive HSTS header
 getlolaccount.com: could not connect to host
 getmassage.com.ng: did not receive HSTS header
+getremembrall.com: could not connect to host
 getsello.com: did not receive HSTS header
 getwashdaddy.com: did not receive HSTS header
 gfhgiro.nl: max-age too low: 604800
@@ -1461,12 +1458,14 @@ grandmascookieblog.com: did not receive HSTS header
 graph.no: did not receive HSTS header
 gravity-net.de: could not connect to host
 grazetech.com: could not connect to host
+grcnode.co.uk: could not connect to host
 greenhillantiques.co.uk: did not receive HSTS header
 greenvines.com.tw: did not receive HSTS header
 gregorytlee.me: could not connect to host
 gremots.com: did not receive HSTS header
 greplin.com: could not connect to host
 gribani.com: could not connect to host
+griesser2.de: could not connect to host
 grigalanzsoftware.com: could not connect to host
 grossmann.gr: could not connect to host
 groups.google.com: did not receive HSTS header (error ignored - included regardless)
@@ -1517,7 +1516,9 @@ halo.red: could not connect to host
 hancc.net: could not connect to host
 hanfu.la: could not connect to host
 hannover-banditen.de: did not receive HSTS header
+hao-zhang.com: could not connect to host
 hao2taiwan.com: max-age too low: 0
+haozhang.org: could not connect to host
 haozi.me: did not receive HSTS header
 happyfabric.me: did not receive HSTS header
 happygadget.me: could not connect to host
@@ -1598,6 +1599,7 @@ horseboners.xxx: did not receive HSTS header
 hortifarm.ro: did not receive HSTS header
 hosmussynergie.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121"  data: no]
 hosted-service.com: did not receive HSTS header
+hosted4u.de: could not connect to host
 hostedtalkgadget.google.com: did not receive HSTS header (error ignored - included regardless)
 hostgarou.com: did not receive HSTS header
 hostinaus.com.au: could not connect to host
@@ -1669,11 +1671,11 @@ ilikerainbows.co: could not connect to host
 ilikerainbows.co.uk: could not connect to host
 ilmconpm.de: did not receive HSTS header
 ilona.graphics: max-age too low: 3600
+iltisim.ch: could not connect to host
 iluvscotland.co.uk: did not receive HSTS header
 ime.moe: could not connect to host
 imguoguo.com: did not receive HSTS header
 imim.pw: did not receive HSTS header
-imjiangtao.com: did not receive HSTS header
 immoprotect.ca: did not receive HSTS header
 immortals-co.com: did not receive HSTS header
 immoverkauf24.at: did not receive HSTS header
@@ -1720,7 +1722,6 @@ intel.li: could not connect to host
 intelldynamics.com: could not connect to host
 interference.io: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121"  data: no]
 interlun.com: could not connect to host
-internect.co.za: did not receive HSTS header
 internetcasinos.de: did not receive HSTS header
 internetcensus.org: could not connect to host
 interserved.com: did not receive HSTS header
@@ -1854,7 +1855,6 @@ jonas-keidel.de: did not receive HSTS header
 jonasgroth.se: max-age too low: 2592000
 jonathan.ir: could not connect to host
 jonathancarter.org: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121"  data: no]
-jonfor.net: could not connect to host
 jonn.me: could not connect to host
 joostbovee.nl: did not receive HSTS header
 jordanhamilton.me: could not connect to host
@@ -1872,6 +1872,7 @@ jualssh.com: could not connect to host
 juchit.at: could not connect to host
 juliamweber.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121"  data: no]
 julian-kipka.de: did not receive HSTS header
+julibear.com: could not connect to host
 jumbox.xyz: could not connect to host
 junaos.xyz: did not receive HSTS header
 junge-selbsthilfe.info: could not connect to host
@@ -1888,7 +1889,6 @@ jxm.in: could not connect to host
 k-dev.de: could not connect to host
 ka-clan.com: could not connect to host
 kabuabc.com: did not receive HSTS header
-kabus.org: could not connect to host
 kadioglumakina.com.tr: did not receive HSTS header
 kaela.design: did not receive HSTS header
 kahopoon.net: could not connect to host
@@ -1926,17 +1926,19 @@ kg-rating.com: did not receive HSTS header
 kgxtech.com: max-age too low: 2592000
 kickass.al: could not connect to host
 kid-dachau.de: did not receive HSTS header
+kiedys.net: could not connect to host
 kiel-media.de: did not receive HSTS header
 kienlen.org: could not connect to host
 kimberg.co.uk: could not connect to host
 kimpost.org: could not connect to host
-kinderly.co.uk: could not connect to host
+kinderly.co.uk: did not receive HSTS header
 kinderwagen-test24.de: could not connect to host
 kingmanhall.org: could not connect to host
 kinnon.enterprises: could not connect to host
 kinogb.net: max-age too low: 0
 kionetworks.com: did not receive HSTS header
 kipira.com: could not connect to host
+kirbear.com: could not connect to host
 kircp.com: could not connect to host
 kirkforcongress.com: could not connect to host
 kirkforsenate.com: could not connect to host
@@ -1953,12 +1955,12 @@ kitsta.com: could not connect to host
 kiwiirc.com: max-age too low: 5256000
 kizil.net: could not connect to host
 kjaermaxi.me: did not receive HSTS header
+kjellvn.net: did not receive HSTS header
 kkaufmann.de: did not receive HSTS header
-klasfauseweh.de: could not connect to host
 klauwd.com: did not receive HSTS header
 klaxn.org: could not connect to host
 kleertjesvoordelig.nl: could not connect to host
-kleinblogje.nl: could not connect to host
+kleinblogje.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121"  data: no]
 kletterkater.com: did not receive HSTS header
 klicktojob.de: could not connect to host
 kmartin.io: did not receive HSTS header
@@ -1997,6 +1999,7 @@ kupelne-ptacek.sk: did not receive HSTS header
 kuppingercole.com: did not receive HSTS header
 kura.io: could not connect to host
 kurehun.org: could not connect to host
+kurtmclester.com: did not receive HSTS header
 kurz.pw: did not receive HSTS header
 kusaka-abacus.jp: max-age too low: 0
 kweddingplanning.com: did not receive HSTS header
@@ -2012,6 +2015,7 @@ labordata.io: could not connect to host
 labrador-retrievers.com.au: did not receive HSTS header
 labs.moscow: did not receive HSTS header
 lachlankidson.net: did not receive HSTS header
+lacicloud.net: could not connect to host
 lacledeslan.ninja: could not connect to host
 ladbroke.net: did not receive HSTS header
 laf.in.net: did not receive HSTS header
@@ -2035,7 +2039,6 @@ laxiongames.es: could not connect to host
 lbrt.xyz: could not connect to host
 ldarby.me.uk: could not connect to host
 leadership9.com: could not connect to host
-leakreporter.net: could not connect to host
 leardev.de: did not receive HSTS header
 learnfrenchfluently.com: did not receive HSTS header
 learningorder.com: could not connect to host
@@ -2082,7 +2085,6 @@ libbitcoin.org: could not connect to host
 libertyrp.org: could not connect to host
 library.linode.com: did not receive HSTS header
 librechan.net: could not connect to host
-libscode.com: did not receive HSTS header
 lifeguard.aecom.com: did not receive HSTS header
 lifeinitsownway.com: did not receive HSTS header
 lifeskillsdirect.com: did not receive HSTS header
@@ -2151,7 +2153,6 @@ lsp-sports.de: did not receive HSTS header
 lt.search.yahoo.com: did not receive HSTS header
 ltbytes.com: could not connect to host
 lu.search.yahoo.com: did not receive HSTS header
-lubot.net: could not connect to host
 lucidlogs.com: could not connect to host
 luelistan.net: could not connect to host
 luine.xyz: could not connect to host
@@ -2172,6 +2173,7 @@ lustrumxi.nl: did not receive HSTS header
 luxus-russen.de: did not receive HSTS header
 luxwatch.com: could not connect to host
 lv.search.yahoo.com: did not receive HSTS header
+lynkos.com: did not receive HSTS header
 lzkill.com: could not connect to host
 m-ali.xyz: did not receive HSTS header
 m.gparent.org: could not connect to host
@@ -2184,11 +2186,13 @@ macbolo.com: could not connect to host
 macchaberrycream.com: could not connect to host
 macgeneral.de: did not receive HSTS header
 machon.biz: could not connect to host
+macker.io: could not connect to host
 madars.org: did not receive HSTS header
 maddin.ga: could not connect to host
 madebymagnitude.com: did not receive HSTS header
 maderwin.com: did not receive HSTS header
 madusecurity.com: could not connect to host
+maelstrom.ninja: could not connect to host
 mafamane.com: could not connect to host
 mafiareturns.com: max-age too low: 2592000
 magenx.com: did not receive HSTS header
@@ -2199,7 +2203,6 @@ maildragon.com: could not connect to host
 makeitdynamic.com: could not connect to host
 makerstuff.net: did not receive HSTS header
 malerversand.de: did not receive HSTS header
-malibubeachrecoverycenter.com: did not receive HSTS header
 malwre.io: could not connect to host
 mamaison.io: could not connect to host
 mamaxi.org: did not receive HSTS header
@@ -2236,6 +2239,7 @@ matchneedle.com: could not connect to host
 matrip.de: could not connect to host
 matrix.ac: did not receive HSTS header
 matsuz.com: could not connect to host
+mattandyana.com: could not connect to host
 mattberryman.com: did not receive HSTS header
 mattcoles.io: did not receive HSTS header
 mattfin.ch: could not connect to host
@@ -2331,6 +2335,7 @@ milesgeek.com: did not receive HSTS header
 mindoktor.se: did not receive HSTS header
 minecraftserverz.com: could not connect to host
 minecraftvoter.com: could not connect to host
+minikneet.com: could not connect to host
 minikneet.nl: did not receive HSTS header
 minnesotadata.com: could not connect to host
 miragrow.com: could not connect to host
@@ -2340,7 +2345,6 @@ mirrorx.com: did not receive HSTS header
 missrain.tw: could not connect to host
 mister.hosting: could not connect to host
 misterl.net: did not receive HSTS header
-mita.me: could not connect to host
 mitchellrenouf.ca: could not connect to host
 mittenhacks.com: could not connect to host
 mivcon.net: could not connect to host
@@ -2423,7 +2427,6 @@ mustika.cf: could not connect to host
 mutamatic.com: could not connect to host
 mvsecurity.nl: could not connect to host
 mw.search.yahoo.com: did not receive HSTS header
-mwe.st: could not connect to host
 mx.org.ua: could not connect to host
 my-owncloud.com: could not connect to host
 my.alfresco.com: did not receive HSTS header
@@ -2465,6 +2468,7 @@ narada.com.ua: could not connect to host
 nargileh.nl: could not connect to host
 natalia.io: could not connect to host
 natalt.org: did not receive HSTS header
+nathanmfarrugia.com: did not receive HSTS header
 naturesystems.cz: max-age too low: 0
 natuurbehangnederland.nl: could not connect to host
 nauck.org: did not receive HSTS header
@@ -2488,6 +2492,7 @@ nella-project.org: could not connect to host
 nellacms.com: could not connect to host
 nellacms.org: could not connect to host
 nellafw.org: could not connect to host
+nemecl.eu: could not connect to host
 nemno.de: could not connect to host
 nemovement.org: did not receive HSTS header
 neonisi.com: could not connect to host
@@ -2537,10 +2542,11 @@ ninhs.org: could not connect to host
 nippler.org: did not receive HSTS header
 nippombashi.net: did not receive HSTS header
 nipponcareers.com: did not receive HSTS header
+nirada.info: could not connect to host
 nixien.fr: could not connect to host
 nkinka.de: did not receive HSTS header
 nmctest.net: could not connect to host
-nnya.cat: did not receive HSTS header
+nnya.cat: could not connect to host
 no17sifangjie.cc: could not connect to host
 nocallaghan.com: could not connect to host
 nocs.cn: did not receive HSTS header
@@ -2567,6 +2573,7 @@ novacoast.com: did not receive HSTS header
 novatrucking.de: could not connect to host
 nowak.ninja: did not receive HSTS header
 noworrywp.com: could not connect to host
+nozoe.jp: did not receive HSTS header
 np.search.yahoo.com: did not receive HSTS header
 npol.de: did not receive HSTS header
 ntbs.pro: could not connect to host
@@ -2593,7 +2600,6 @@ nutleyef.org: did not receive HSTS header
 nutrienti.eu: did not receive HSTS header
 nutritionculture.com: could not connect to host
 nutsandboltsmedia.com: did not receive HSTS header
-nwa.xyz: could not connect to host
 nwgh.org: max-age too low: 86400
 nwork.media: could not connect to host
 nyantec.com: did not receive HSTS header
@@ -2628,7 +2634,9 @@ ominto.com: max-age too low: 0
 omniasl.com: could not connect to host
 omniti.com: max-age too low: 1
 omquote.gq: could not connect to host
+omskit.ru: could not connect to host
 oneb4nk.com: could not connect to host
+onedot.nl: could not connect to host
 onefour.co: could not connect to host
 oneminute.io: did not receive HSTS header
 onepluscamps.com: did not receive HSTS header
@@ -2645,7 +2653,6 @@ onlinepollsph.com: could not connect to host
 onlinespielothek.com: did not receive HSTS header
 onlinewetten.de: could not connect to host
 onlyshopstation.com: did not receive HSTS header
-onlyzero.net: did not receive HSTS header
 ononpay.com: did not receive HSTS header
 onovlena.dn.ua: could not connect to host
 ontras.com: could not connect to host
@@ -2689,8 +2696,8 @@ osteammate.com: did not receive HSTS header
 osticketawesome.com: did not receive HSTS header
 otakuworld.de: could not connect to host
 othercode.nl: could not connect to host
-othermedia.cc: could not connect to host
-otherstuff.nl: could not connect to host
+othermedia.cc: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121"  data: no]
+otherstuff.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121"  data: no]
 otichi.com: did not receive HSTS header
 ottospora.nl: could not connect to host
 ourbank.com: did not receive HSTS header
@@ -2725,7 +2732,6 @@ panaceallc.net: could not connect to host
 pantsu.cat: did not receive HSTS header
 papeda.net: did not receive HSTS header
 papercard.co.uk: did not receive HSTS header
-paperwork.co.za: could not connect to host
 papierniak.net: could not connect to host
 papygeek.com: could not connect to host
 parent5446.us: could not connect to host
@@ -2733,7 +2739,7 @@ parentmail.co.uk: did not receive HSTS header
 parodybit.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121"  data: no]
 parpaing-paillette.net: could not connect to host
 particonpsplus.it: could not connect to host
-partijtjevoordevrijheid.nl: could not connect to host
+partijtjevoordevrijheid.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121"  data: no]
 partou.de: did not receive HSTS header
 partyvan.it: could not connect to host
 partyvan.moe: could not connect to host
@@ -2756,6 +2762,8 @@ patterson.mp: could not connect to host
 paulchen.at: did not receive HSTS header
 paulewen.ca: could not connect to host
 paulyang.cn: did not receive HSTS header
+paw.cloud: did not receive HSTS header
+paw.pt: did not receive HSTS header
 paxwinkel.nl: did not receive HSTS header
 pay.gigahost.dk: did not receive HSTS header
 payments.google.com: did not receive HSTS header (error ignored - included regardless)
@@ -2777,11 +2785,12 @@ pepperhead.com: did not receive HSTS header
 pepperworldhotshop.de: did not receive HSTS header
 perfectionis.me: could not connect to host
 performous.org: could not connect to host
-perlwork.nl: could not connect to host
+perlwork.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121"  data: no]
 perplex.nl: did not receive HSTS header
 perroud.pro: max-age too low: 2592000
 personaldatabasen.no: could not connect to host
 personalinjurylist.com: did not receive HSTS header
+persson.me: could not connect to host
 perthdevicelab.com: did not receive HSTS header
 pet-nsk.ru: could not connect to host
 petchart.net: could not connect to host
@@ -2794,6 +2803,7 @@ pettsy.com: could not connect to host
 pewboards.com: could not connect to host
 pgpm.io: could not connect to host
 pharmgkb.org: could not connect to host
+philpropertygroup.com: could not connect to host
 phonenumberinfo.co.uk: could not connect to host
 phongmay24h.com: could not connect to host
 phpfashion.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121"  data: no]
@@ -2821,7 +2831,7 @@ piwko.co: could not connect to host
 pixel.google.com: did not receive HSTS header (error ignored - included regardless)
 pixelcode.com.au: max-age too low: 0
 pixelhero.co.uk: did not receive HSTS header
-pixelminers.net: could not connect to host
+pixi.chat: could not connect to host
 pixi.me: could not connect to host
 pj83.duckdns.org: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121"  data: no]
 pk.search.yahoo.com: did not receive HSTS header
@@ -2857,10 +2867,8 @@ pontokay.com.br: did not receive HSTS header
 pontualcomp.com: max-age too low: 2592000
 poolsandstuff.com: did not receive HSTS header
 poon.tech: could not connect to host
-poris.web.id: did not receive HSTS header
 portalplatform.net: did not receive HSTS header
 postcodewise.co.uk: did not receive HSTS header
-posterspy.com: did not receive HSTS header
 postscheduler.org: could not connect to host
 posylka.de: did not receive HSTS header
 potatofrom.space: could not connect to host
@@ -2908,10 +2916,8 @@ proximato.com: could not connect to host
 proxybay.al: could not connect to host
 proxybay.club: could not connect to host
 proxybay.info: did not receive HSTS header
-prxio.date: could not connect to host
 prxio.site: did not receive HSTS header
 prytkov.com: did not receive HSTS header
-psncardplus.com: did not receive HSTS header
 psw.academy: did not receive HSTS header
 psw.consulting: did not receive HSTS header
 ptn.moscow: could not connect to host
@@ -2954,7 +2960,6 @@ qwilink.me: did not receive HSTS header
 r10n.com: did not receive HSTS header
 r15.me: could not connect to host
 r3bl.me: did not receive HSTS header
-r811.de: could not connect to host
 raajheshkannaa.com: could not connect to host
 radicaleducation.net: could not connect to host
 radiormi.com: did not receive HSTS header
@@ -3027,11 +3032,12 @@ reverie.pw: could not connect to host
 reviews.anime.my: max-age too low: 5184000
 revtut.net: did not receive HSTS header
 rewardstock.com: max-age too low: 0
+rezosup.net: could not connect to host
+rezosup.org: could not connect to host
 rgavmf.ru: did not receive HSTS header
 rhapsodhy.hu: could not connect to host
 rhdigital.pro: could not connect to host
 rhodri.io: could not connect to host
-riaucybersolution.net: did not receive HSTS header
 richiemail.net: did not receive HSTS header
 richmondsunlight.com: did not receive HSTS header
 rid-wan.com: could not connect to host
@@ -3044,15 +3050,15 @@ ring0.xyz: did not receive HSTS header
 ringh.am: could not connect to host
 rippleunion.com: could not connect to host
 riskmgt.com.au: could not connect to host
-rivermendhealthcenters.com: did not receive HSTS header
 rj.gg: could not connect to host
 rk6.cz: could not connect to host
 rkmantpur.org: did not receive HSTS header
 rme.li: did not receive HSTS header
 roan24.pl: did not receive HSTS header
+robandjanine.com: could not connect to host
 robertglastra.com: could not connect to host
-robertof.ovh: could not connect to host
 robigalia.org: did not receive HSTS header
+robspc.repair: could not connect to host
 robtex.com: did not receive HSTS header
 robtex.net: did not receive HSTS header
 robtex.org: did not receive HSTS header
@@ -3071,7 +3077,6 @@ room-checkin24.de: [Exception... "Component returned failure code: 0x80004005 (N
 rootforum.org: did not receive HSTS header
 rootservice.org: did not receive HSTS header
 rootwpn.com: could not connect to host
-rosewoodranch.com: did not receive HSTS header
 rotterdamjazz.info: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121"  data: no]
 roundtheme.com: did not receive HSTS header
 rous.se: could not connect to host
@@ -3146,6 +3151,7 @@ sb-group.dk: did not receive HSTS header
 sbox-archives.com: could not connect to host
 sby.de: did not receive HSTS header
 sc4le.com: could not connect to host
+schamlosharmlos.de: could not connect to host
 schmitz.link: could not connect to host
 schnell-gold.com: could not connect to host
 schoop.me: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121"  data: no]
@@ -3163,8 +3169,10 @@ scrapings.net: could not connect to host
 screencaster.io: did not receive HSTS header
 screenresolution.space: could not connect to host
 scribe.systems: could not connect to host
+scrion.com: could not connect to host
 script.google.com: did not receive HSTS header (error ignored - included regardless)
 scriptict.nl: could not connect to host
+scriptjunkie.us: could not connect to host
 sdmoscow.ru: could not connect to host
 sdrobs.com: could not connect to host
 sdsl-speedtest.de: could not connect to host
@@ -3177,6 +3185,7 @@ secpatrol.de: could not connect to host
 sectia22.ro: could not connect to host
 sectun.com: did not receive HSTS header
 secure-games.us: could not connect to host
+secure.link: did not receive HSTS header
 secureradio.net: could not connect to host
 security-carpet.com: could not connect to host
 security.google.com: did not receive HSTS header (error ignored - included regardless)
@@ -3256,6 +3265,7 @@ sifls.com: could not connect to host
 silentcircle.org: could not connect to host
 silicagelpackets.ca: did not receive HSTS header
 silver-drachenkrieger.de: did not receive HSTS header
+silverhome.ninja: could not connect to host
 silverpvp.com: could not connect to host
 silverwind.io: did not receive HSTS header
 simbast.com: could not connect to host
@@ -3347,7 +3357,6 @@ sotor.de: did not receive HSTS header
 soulboy.io: did not receive HSTS header
 soulema.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121"  data: no]
 soulfulglamour.uk: could not connect to host
-sour.is: could not connect to host
 sourcelair.com: did not receive HSTS header
 sourceway.de: could not connect to host
 southside-crew.club: could not connect to host
@@ -3372,6 +3381,7 @@ speedcounter.net: did not receive HSTS header
 speedmann.de: could not connect to host
 speeds.vip: could not connect to host
 speedtest-russia.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121"  data: no]
+speedy.lt: max-age too low: 0
 speidel.com.tr: did not receive HSTS header
 spencerbaer.com: could not connect to host
 sperohub.io: could not connect to host
@@ -3401,7 +3411,7 @@ ssl.rip: could not connect to host
 sslpoint.com: did not receive HSTS header
 ssmato.me: could not connect to host
 ssnc.org: max-age too low: 300
-sss3s.com: did not receive HSTS header
+sss3s.com: could not connect to host
 stabletoken.com: could not connect to host
 stadjerspasonline.nl: could not connect to host
 stahl.xyz: could not connect to host
@@ -3544,8 +3554,8 @@ tcomms.org: max-age too low: 0
 tcp.expert: did not receive HSTS header
 teachforcanada.ca: did not receive HSTS header
 team-pancake.eu: could not connect to host
-teamblueridge.org: could not connect to host
 teamsocial.co: did not receive HSTS header
+teamx-gaming.de: could not connect to host
 teamzeus.cz: could not connect to host
 techassist.io: did not receive HSTS header
 techhub.ml: could not connect to host
@@ -3556,7 +3566,6 @@ technosavvyport.com: did not receive HSTS header
 techpointed.com: could not connect to host
 techvalue.gr: did not receive HSTS header
 tegelsensanitaironline.nl: did not receive HSTS header
-teknologi.or.id: did not receive HSTS header
 tekshrek.com: did not receive HSTS header
 telefonnummer.online: could not connect to host
 telefoonnummerinfo.nl: could not connect to host
@@ -3603,7 +3612,6 @@ themerchandiser.net: [Exception... "Component returned failure code: 0x80004005
 themicrocapital.com: could not connect to host
 themillerslive.com: could not connect to host
 theodorejones.info: could not connect to host
-theojones.name: did not receive HSTS header
 thepartywarehouse.co.uk: did not receive HSTS header
 thepiratebay.al: could not connect to host
 thepiratebay.tech: could not connect to host
@@ -3627,9 +3635,7 @@ thiswebhost.com: did not receive HSTS header
 thomaswoo.com: could not connect to host
 thorncreek.net: did not receive HSTS header
 thriveapproach.co.uk: did not receive HSTS header
-thrx.net: could not connect to host
 thumbtack.com: did not receive HSTS header
-thyngster.com: could not connect to host
 tianshili.me: could not connect to host
 tickettoaster.de: max-age too low: 0
 tickopa.co.uk: could not connect to host
@@ -3640,7 +3646,6 @@ tiensnet.com: did not receive HSTS header
 tightlineproductions.com: did not receive HSTS header
 tikutiku.pl: max-age too low: 0
 tildebot.com: could not connect to host
-tilkah.com.au: did not receive HSTS header
 tillcraft.com: could not connect to host
 timbeilby.com: could not connect to host
 timcamara.com: did not receive HSTS header
@@ -3665,6 +3670,7 @@ tmitchell.io: could not connect to host
 tmprod.com: did not receive HSTS header
 tncnanet.com.br: could not connect to host
 tnrsca.jp: did not receive HSTS header
+tobi-mayer.de: could not connect to host
 tobias-bielefeld.de: did not receive HSTS header
 tobiasmathes.com: could not connect to host
 tobiasmathes.name: could not connect to host
@@ -3679,9 +3685,7 @@ tomharling.co.uk: max-age too low: 86400
 tomharling.uk: max-age too low: 86400
 tomharris.tech: could not connect to host
 tomlankhorst.nl: did not receive HSTS header
-tomli.me: could not connect to host
 tommsy.com: did not receive HSTS header
-tommyads.com: could not connect to host
 tonburi.jp: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121"  data: no]
 tonyfantjr.com: could not connect to host
 toomanypillows.com: could not connect to host
@@ -3748,12 +3752,12 @@ txclimbers.com: could not connect to host
 txf.pw: could not connect to host
 ty2u.com: did not receive HSTS header
 tylian.net: max-age too low: 0
+typingrevolution.com: did not receive HSTS header
 tyrelius.com: did not receive HSTS header
 tyroproducts.eu: did not receive HSTS header
 tzappa.net: could not connect to host
 u-blox.com: did not receive HSTS header
 ua.search.yahoo.com: did not receive HSTS header
-ub3rk1tten.com: could not connect to host
 ubicloud.de: could not connect to host
 ublox.com: did not receive HSTS header
 ubuntuhot.com: did not receive HSTS header
@@ -3890,7 +3894,7 @@ vratny.space: could not connect to host
 vvl.me: could not connect to host
 vxstream-sandbox.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121"  data: no]
 vyncke.org: max-age too low: 2678400
-vyskocil.eu: did not receive HSTS header
+vyskocil.eu: could not connect to host
 vzk.io: could not connect to host
 w4a.fr: max-age too low: 0
 w4xzr.top: could not connect to host
@@ -3910,9 +3914,11 @@ warped.com: did not receive HSTS header
 warsentech.com: could not connect to host
 wassim.is: could not connect to host
 watchium.com: did not receive HSTS header
+watertrails.io: could not connect to host
 watsonhall.uk: could not connect to host
 wave.is: could not connect to host
 wavefrontsystemstech.com: could not connect to host
+wayne.cloud: did not receive HSTS header
 wealthfactory.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121"  data: no]
 wear2work.nl: did not receive HSTS header
 wearandcare.net: could not connect to host
@@ -3941,7 +3947,6 @@ weekly.fyi: could not connect to host
 weicn.org: could not connect to host
 wellsolveit.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121"  data: no]
 weltmeisterschaft.net: could not connect to host
-weltverschwoerung.de: could not connect to host
 weme.eu: could not connect to host
 wendalyncheng.com: could not connect to host
 werdeeintimo.de: did not receive HSTS header
@@ -4005,11 +4010,9 @@ wolfesden.com: could not connect to host
 womosale.de: could not connect to host
 wonderfall.xyz: could not connect to host
 wonderhost.info: could not connect to host
-woodomat.com: could not connect to host
 woording.com: could not connect to host
 woresite.jp: did not receive HSTS header
 workfone.io: did not receive HSTS header
-workingclassmedia.com: could not connect to host
 workwithgo.com: could not connect to host
 wowapi.org: could not connect to host
 wphostingspot.com: did not receive HSTS header
@@ -4019,7 +4022,6 @@ wsscompany.com.ve: could not connect to host
 wufu.org: did not receive HSTS header
 wuhengmin.com: did not receive HSTS header
 wurzelzwerg.net: could not connect to host
-www.amazon.co.jp: did not receive HSTS header
 www.apollo-auto.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121"  data: no]
 www.braintreepayments.com: did not receive HSTS header
 www.calyxinstitute.org: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121"  data: no]
@@ -4081,6 +4083,7 @@ xn--ls8hi7a.tk: could not connect to host
 xn--maraa-rta.org: could not connect to host
 xn--mgbbh2a9fub.xn--ngbc5azd: did not receive HSTS header
 xn--neb-tma3u8u.xyz: could not connect to host
+xn--pq1a637b.xn--6qq986b3xl: could not connect to host
 xng.io: did not receive HSTS header
 xnode.org: did not receive HSTS header
 xombra.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121"  data: no]
@@ -4097,12 +4100,12 @@ xuyh0120.win: did not receive HSTS header
 xxbase.com: could not connect to host
 xyndrac.net: did not receive HSTS header
 y-o-w.com: did not receive HSTS header
-y-s.pw: did not receive HSTS header
 yabrt.cn: could not connect to host
 yamaken.jp: did not receive HSTS header
 yamamo10.com: could not connect to host
+yanaduday.com: could not connect to host
 yaporn.tv: did not receive HSTS header
-yard-fu.com: did not receive HSTS header
+yard-fu.com: could not connect to host
 yasinaydin.net: max-age too low: 2592000
 yaucy.win: did not receive HSTS header
 yello.website: could not connect to host
@@ -4122,11 +4125,13 @@ yokeepo.com: max-age too low: 0
 yoloboatrentals.com: did not receive HSTS header
 yoloprod.fr: could not connect to host
 yoloseo.com: could not connect to host
+yoramvandevelde.net: could not connect to host
 yorname.ml: could not connect to host
 youcontrol.ru: could not connect to host
 youngandunited.nl: did not receive HSTS header
 yourstrongbox.com: could not connect to host
 yout.com: max-age too low: 60000
+ytec.ca: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121"  data: no]
 yu.gg: did not receive HSTS header
 yuan.ga: did not receive HSTS header
 yuhen.ru: did not receive HSTS header
@@ -4161,6 +4166,8 @@ zera.com.au: could not connect to host
 zett4.me: could not connect to host
 zeytin.pro: could not connect to host
 zh.search.yahoo.com: did not receive HSTS header
+zhang-hao.com: could not connect to host
+zhanghao.me: could not connect to host
 zhaojin97.cn: did not receive HSTS header
 zhendingresources.com: max-age too low: 0
 zigcore.com.br: could not connect to host
@@ -4180,7 +4187,6 @@ zqhong.com: could not connect to host
 zrn.in: did not receive HSTS header
 ztan.tk: could not connect to host
 zten.org: could not connect to host
-zulu7.com: could not connect to host
 zvncloud.com: did not receive HSTS header
-zwy.me: did not receive HSTS header
+zwy.me: could not connect to host
 zyf.pw: could not connect to host
diff --git a/security/manager/ssl/nsSTSPreloadList.inc b/security/manager/ssl/nsSTSPreloadList.inc
index 9b9c10113f9f..c67e397c256e 100644
--- a/security/manager/ssl/nsSTSPreloadList.inc
+++ b/security/manager/ssl/nsSTSPreloadList.inc
@@ -8,10 +8,9 @@
 /*****************************************************************************/
 
 #include 
-const PRTime gPreloadListExpirationTime = INT64_C(1493043686565000);
+const PRTime gPreloadListExpirationTime = INT64_C(1493130222258000);
 
 static const char kSTSHostTable[] = {
-  /* "0.me.uk", true */ '0', '.', 'm', 'e', '.', 'u', 'k', '\0',
   /* "007-preisvergleich.de", true */ '0', '0', '7', '-', 'p', 'r', 'e', 'i', 's', 'v', 'e', 'r', 'g', 'l', 'e', 'i', 'c', 'h', '.', 'd', 'e', '\0',
   /* "007sascha.de", true */ '0', '0', '7', 's', 'a', 's', 'c', 'h', 'a', '.', 'd', 'e', '\0',
   /* "00f.net", true */ '0', '0', 'f', '.', 'n', 'e', 't', '\0',
@@ -23,7 +22,6 @@ static const char kSTSHostTable[] = {
   /* "0i0.nl", true */ '0', 'i', '0', '.', 'n', 'l', '\0',
   /* "0knowledge.de", true */ '0', 'k', 'n', 'o', 'w', 'l', 'e', 'd', 'g', 'e', '.', 'd', 'e', '\0',
   /* "0paste.com", true */ '0', 'p', 'a', 's', 't', 'e', '.', 'c', 'o', 'm', '\0',
-  /* "0x.cx", true */ '0', 'x', '.', 'c', 'x', '\0',
   /* "0x0a.net", true */ '0', 'x', '0', 'a', '.', 'n', 'e', 't', '\0',
   /* "0x17.de", true */ '0', 'x', '1', '7', '.', 'd', 'e', '\0',
   /* "0x52.net", true */ '0', 'x', '5', '2', '.', 'n', 'e', 't', '\0',
@@ -105,6 +103,7 @@ static const char kSTSHostTable[] = {
   /* "21.co.uk", true */ '2', '1', '.', 'c', 'o', '.', 'u', 'k', '\0',
   /* "247healthshop.com", true */ '2', '4', '7', 'h', 'e', 'a', 'l', 't', 'h', 's', 'h', 'o', 'p', '.', 'c', 'o', 'm', '\0',
   /* "247loan.com", true */ '2', '4', '7', 'l', 'o', 'a', 'n', '.', 'c', 'o', 'm', '\0',
+  /* "24hourpaint.com", true */ '2', '4', 'h', 'o', 'u', 'r', 'p', 'a', 'i', 'n', 't', '.', 'c', 'o', 'm', '\0',
   /* "24ip.com", true */ '2', '4', 'i', 'p', '.', 'c', 'o', 'm', '\0',
   /* "24ip.de", true */ '2', '4', 'i', 'p', '.', 'd', 'e', '\0',
   /* "24ip.fr", true */ '2', '4', 'i', 'p', '.', 'f', 'r', '\0',
@@ -647,6 +646,7 @@ static const char kSTSHostTable[] = {
   /* "andreas-kluge.eu", true */ 'a', 'n', 'd', 'r', 'e', 'a', 's', '-', 'k', 'l', 'u', 'g', 'e', '.', 'e', 'u', '\0',
   /* "andreasfeusi.ch", true */ 'a', 'n', 'd', 'r', 'e', 'a', 's', 'f', 'e', 'u', 's', 'i', '.', 'c', 'h', '\0',
   /* "andreaskluge.eu", true */ 'a', 'n', 'd', 'r', 'e', 'a', 's', 'k', 'l', 'u', 'g', 'e', '.', 'e', 'u', '\0',
+  /* "andreaskrasa.com", true */ 'a', 'n', 'd', 'r', 'e', 'a', 's', 'k', 'r', 'a', 's', 'a', '.', 'c', 'o', 'm', '\0',
   /* "andrepicard.de", true */ 'a', 'n', 'd', 'r', 'e', 'p', 'i', 'c', 'a', 'r', 'd', '.', 'd', 'e', '\0',
   /* "andrewbroekman.com", true */ 'a', 'n', 'd', 'r', 'e', 'w', 'b', 'r', 'o', 'e', 'k', 'm', 'a', 'n', '.', 'c', 'o', 'm', '\0',
   /* "andrewhowden.com", true */ 'a', 'n', 'd', 'r', 'e', 'w', 'h', 'o', 'w', 'd', 'e', 'n', '.', 'c', 'o', 'm', '\0',
@@ -727,6 +727,7 @@ static const char kSTSHostTable[] = {
   /* "ao2.it", true */ 'a', 'o', '2', '.', 'i', 't', '\0',
   /* "aojf.fr", true */ 'a', 'o', 'j', 'f', '.', 'f', 'r', '\0',
   /* "aopedeure.nl", true */ 'a', 'o', 'p', 'e', 'd', 'e', 'u', 'r', 'e', '.', 'n', 'l', '\0',
+  /* "aosc.io", false */ 'a', 'o', 's', 'c', '.', 'i', 'o', '\0',
   /* "aosus.org", true */ 'a', 'o', 's', 'u', 's', '.', 'o', 'r', 'g', '\0',
   /* "aovcentrum.nl", true */ 'a', 'o', 'v', 'c', 'e', 'n', 't', 'r', 'u', 'm', '.', 'n', 'l', '\0',
   /* "apachehaus.de", false */ 'a', 'p', 'a', 'c', 'h', 'e', 'h', 'a', 'u', 's', '.', 'd', 'e', '\0',
@@ -899,7 +900,6 @@ static const char kSTSHostTable[] = {
   /* "assindia.nl", true */ 'a', 's', 's', 'i', 'n', 'd', 'i', 'a', '.', 'n', 'l', '\0',
   /* "asta-bar.de", true */ 'a', 's', 't', 'a', '-', 'b', 'a', 'r', '.', 'd', 'e', '\0',
   /* "astengox.com", true */ 'a', 's', 't', 'e', 'n', 'g', 'o', 'x', '.', 'c', 'o', 'm', '\0',
-  /* "asuhe.cc", true */ 'a', 's', 'u', 'h', 'e', '.', 'c', 'c', '\0',
   /* "asun.co", true */ 'a', 's', 'u', 'n', '.', 'c', 'o', '\0',
   /* "asurepay.cc", true */ 'a', 's', 'u', 'r', 'e', 'p', 'a', 'y', '.', 'c', 'c', '\0',
   /* "at.search.yahoo.com", false */ 'a', 't', '.', 's', 'e', 'a', 'r', 'c', 'h', '.', 'y', 'a', 'h', 'o', 'o', '.', 'c', 'o', 'm', '\0',
@@ -959,7 +959,6 @@ static const char kSTSHostTable[] = {
   /* "aulo.in", false */ 'a', 'u', 'l', 'o', '.', 'i', 'n', '\0',
   /* "aunali1.com", true */ 'a', 'u', 'n', 'a', 'l', 'i', '1', '.', 'c', 'o', 'm', '\0',
   /* "aur.rocks", true */ 'a', 'u', 'r', '.', 'r', 'o', 'c', 'k', 's', '\0',
-  /* "aurainfosec.com", true */ 'a', 'u', 'r', 'a', 'i', 'n', 'f', 'o', 's', 'e', 'c', '.', 'c', 'o', 'm', '\0',
   /* "auraredeye.com", true */ 'a', 'u', 'r', 'a', 'r', 'e', 'd', 'e', 'y', 'e', '.', 'c', 'o', 'm', '\0',
   /* "auraredshield.com", true */ 'a', 'u', 'r', 'a', 'r', 'e', 'd', 's', 'h', 'i', 'e', 'l', 'd', '.', 'c', 'o', 'm', '\0',
   /* "aureus.pw", true */ 'a', 'u', 'r', 'e', 'u', 's', '.', 'p', 'w', '\0',
@@ -1099,6 +1098,7 @@ static const char kSTSHostTable[] = {
   /* "bandgap.io", true */ 'b', 'a', 'n', 'd', 'g', 'a', 'p', '.', 'i', 'o', '\0',
   /* "bandiga.it", true */ 'b', 'a', 'n', 'd', 'i', 'g', 'a', '.', 'i', 't', '\0',
   /* "bangkok.dating", true */ 'b', 'a', 'n', 'g', 'k', 'o', 'k', '.', 'd', 'a', 't', 'i', 'n', 'g', '\0',
+  /* "bangzafran.com", true */ 'b', 'a', 'n', 'g', 'z', 'a', 'f', 'r', 'a', 'n', '.', 'c', 'o', 'm', '\0',
   /* "bank.simple.com", false */ 'b', 'a', 'n', 'k', '.', 's', 'i', 'm', 'p', 'l', 'e', '.', 'c', 'o', 'm', '\0',
   /* "bankcardoffer.com", true */ 'b', 'a', 'n', 'k', 'c', 'a', 'r', 'd', 'o', 'f', 'f', 'e', 'r', '.', 'c', 'o', 'm', '\0',
   /* "bankcircle.co.in", true */ 'b', 'a', 'n', 'k', 'c', 'i', 'r', 'c', 'l', 'e', '.', 'c', 'o', '.', 'i', 'n', '\0',
@@ -1362,7 +1362,6 @@ static const char kSTSHostTable[] = {
   /* "biltullen.com", true */ 'b', 'i', 'l', 't', 'u', 'l', 'l', 'e', 'n', '.', 'c', 'o', 'm', '\0',
   /* "bimbo.com", true */ 'b', 'i', 'm', 'b', 'o', '.', 'c', 'o', 'm', '\0',
   /* "bimbobakeriesusa.com", true */ 'b', 'i', 'm', 'b', 'o', 'b', 'a', 'k', 'e', 'r', 'i', 'e', 's', 'u', 's', 'a', '.', 'c', 'o', 'm', '\0',
-  /* "binarization.com", true */ 'b', 'i', 'n', 'a', 'r', 'i', 'z', 'a', 't', 'i', 'o', 'n', '.', 'c', 'o', 'm', '\0',
   /* "binaryabstraction.com", true */ 'b', 'i', 'n', 'a', 'r', 'y', 'a', 'b', 's', 't', 'r', 'a', 'c', 't', 'i', 'o', 'n', '.', 'c', 'o', 'm', '\0',
   /* "binaryevolved.com", true */ 'b', 'i', 'n', 'a', 'r', 'y', 'e', 'v', 'o', 'l', 'v', 'e', 'd', '.', 'c', 'o', 'm', '\0',
   /* "binaryfigments.com", false */ 'b', 'i', 'n', 'a', 'r', 'y', 'f', 'i', 'g', 'm', 'e', 'n', 't', 's', '.', 'c', 'o', 'm', '\0',
@@ -1432,6 +1431,8 @@ static const char kSTSHostTable[] = {
   /* "bitshaker.net", true */ 'b', 'i', 't', 's', 'h', 'a', 'k', 'e', 'r', '.', 'n', 'e', 't', '\0',
   /* "bitskins.co", true */ 'b', 'i', 't', 's', 'k', 'i', 'n', 's', '.', 'c', 'o', '\0',
   /* "bitskrieg.net", true */ 'b', 'i', 't', 's', 'k', 'r', 'i', 'e', 'g', '.', 'n', 'e', 't', '\0',
+  /* "bitstorm.nl", true */ 'b', 'i', 't', 's', 't', 'o', 'r', 'm', '.', 'n', 'l', '\0',
+  /* "bitstorm.org", true */ 'b', 'i', 't', 's', 't', 'o', 'r', 'm', '.', 'o', 'r', 'g', '\0',
   /* "bittersweetcandybowl.com", true */ 'b', 'i', 't', 't', 'e', 'r', 's', 'w', 'e', 'e', 't', 'c', 'a', 'n', 'd', 'y', 'b', 'o', 'w', 'l', '.', 'c', 'o', 'm', '\0',
   /* "bittmann.me", true */ 'b', 'i', 't', 't', 'm', 'a', 'n', 'n', '.', 'm', 'e', '\0',
   /* "bittylicious.com", true */ 'b', 'i', 't', 't', 'y', 'l', 'i', 'c', 'i', 'o', 'u', 's', '.', 'c', 'o', 'm', '\0',
@@ -1547,7 +1548,6 @@ static const char kSTSHostTable[] = {
   /* "bluex.org", true */ 'b', 'l', 'u', 'e', 'x', '.', 'o', 'r', 'g', '\0',
   /* "blumenfeldart.com", true */ 'b', 'l', 'u', 'm', 'e', 'n', 'f', 'e', 'l', 'd', 'a', 'r', 't', '.', 'c', 'o', 'm', '\0',
   /* "blumiges-fischbachtal.de", true */ 'b', 'l', 'u', 'm', 'i', 'g', 'e', 's', '-', 'f', 'i', 's', 'c', 'h', 'b', 'a', 'c', 'h', 't', 'a', 'l', '.', 'd', 'e', '\0',
-  /* "blupig.net", true */ 'b', 'l', 'u', 'p', 'i', 'g', '.', 'n', 'e', 't', '\0',
   /* "blurringexistence.net", true */ 'b', 'l', 'u', 'r', 'r', 'i', 'n', 'g', 'e', 'x', 'i', 's', 't', 'e', 'n', 'c', 'e', '.', 'n', 'e', 't', '\0',
   /* "bluserv.net", true */ 'b', 'l', 'u', 's', 'e', 'r', 'v', '.', 'n', 'e', 't', '\0',
   /* "blusmurf.net", true */ 'b', 'l', 'u', 's', 'm', 'u', 'r', 'f', '.', 'n', 'e', 't', '\0',
@@ -2386,6 +2386,7 @@ static const char kSTSHostTable[] = {
   /* "codepoet.de", true */ 'c', 'o', 'd', 'e', 'p', 'o', 'e', 't', '.', 'd', 'e', '\0',
   /* "codepoints.net", true */ 'c', 'o', 'd', 'e', 'p', 'o', 'i', 'n', 't', 's', '.', 'n', 'e', 't', '\0',
   /* "codepref.com", true */ 'c', 'o', 'd', 'e', 'p', 'r', 'e', 'f', '.', 'c', 'o', 'm', '\0',
+  /* "codepult.com", true */ 'c', 'o', 'd', 'e', 'p', 'u', 'l', 't', '.', 'c', 'o', 'm', '\0',
   /* "codera.co.uk", true */ 'c', 'o', 'd', 'e', 'r', 'a', '.', 'c', 'o', '.', 'u', 'k', '\0',
   /* "codereview.appspot.com", false */ 'c', 'o', 'd', 'e', 'r', 'e', 'v', 'i', 'e', 'w', '.', 'a', 'p', 'p', 's', 'p', 'o', 't', '.', 'c', 'o', 'm', '\0',
   /* "codereview.chromium.org", false */ 'c', 'o', 'd', 'e', 'r', 'e', 'v', 'i', 'e', 'w', '.', 'c', 'h', 'r', 'o', 'm', 'i', 'u', 'm', '.', 'o', 'r', 'g', '\0',
@@ -2422,7 +2423,6 @@ static const char kSTSHostTable[] = {
   /* "colengo.com", true */ 'c', 'o', 'l', 'e', 'n', 'g', 'o', '.', 'c', 'o', 'm', '\0',
   /* "colinchartier.com", true */ 'c', 'o', 'l', 'i', 'n', 'c', 'h', 'a', 'r', 't', 'i', 'e', 'r', '.', 'c', 'o', 'm', '\0',
   /* "colinstark.ca", true */ 'c', 'o', 'l', 'i', 'n', 's', 't', 'a', 'r', 'k', '.', 'c', 'a', '\0',
-  /* "colinwolff.com", true */ 'c', 'o', 'l', 'i', 'n', 'w', 'o', 'l', 'f', 'f', '.', 'c', 'o', 'm', '\0',
   /* "collabornation.net", true */ 'c', 'o', 'l', 'l', 'a', 'b', 'o', 'r', 'n', 'a', 't', 'i', 'o', 'n', '.', 'n', 'e', 't', '\0',
   /* "collabra.email", true */ 'c', 'o', 'l', 'l', 'a', 'b', 'r', 'a', '.', 'e', 'm', 'a', 'i', 'l', '\0',
   /* "collaction.hk", true */ 'c', 'o', 'l', 'l', 'a', 'c', 't', 'i', 'o', 'n', '.', 'h', 'k', '\0',
@@ -2497,6 +2497,7 @@ static const char kSTSHostTable[] = {
   /* "conflux.tw", true */ 'c', 'o', 'n', 'f', 'l', 'u', 'x', '.', 't', 'w', '\0',
   /* "confucio.cl", true */ 'c', 'o', 'n', 'f', 'u', 'c', 'i', 'o', '.', 'c', 'l', '\0',
   /* "conjugacao.com.br", true */ 'c', 'o', 'n', 'j', 'u', 'g', 'a', 'c', 'a', 'o', '.', 'c', 'o', 'm', '.', 'b', 'r', '\0',
+  /* "connect-ed.network", true */ 'c', 'o', 'n', 'n', 'e', 'c', 't', '-', 'e', 'd', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '\0',
   /* "connect.dating", true */ 'c', 'o', 'n', 'n', 'e', 'c', 't', '.', 'd', 'a', 't', 'i', 'n', 'g', '\0',
   /* "connect.ua", false */ 'c', 'o', 'n', 'n', 'e', 'c', 't', '.', 'u', 'a', '\0',
   /* "connected-verhuurservice.nl", true */ 'c', 'o', 'n', 'n', 'e', 'c', 't', 'e', 'd', '-', 'v', 'e', 'r', 'h', 'u', 'u', 'r', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'n', 'l', '\0',
@@ -2643,13 +2644,13 @@ static const char kSTSHostTable[] = {
   /* "criticalsurveys.co.uk", true */ 'c', 'r', 'i', 't', 'i', 'c', 'a', 'l', 's', 'u', 'r', 'v', 'e', 'y', 's', '.', 'c', 'o', '.', 'u', 'k', '\0',
   /* "crl-autos.com", true */ 'c', 'r', 'l', '-', 'a', 'u', 't', 'o', 's', '.', 'c', 'o', 'm', '\0',
   /* "crm.onlime.ch", false */ 'c', 'r', 'm', '.', 'o', 'n', 'l', 'i', 'm', 'e', '.', 'c', 'h', '\0',
+  /* "crmdemo.website", true */ 'c', 'r', 'm', 'd', 'e', 'm', 'o', '.', 'w', 'e', 'b', 's', 'i', 't', 'e', '\0',
   /* "cross-view.com", true */ 'c', 'r', 'o', 's', 's', '-', 'v', 'i', 'e', 'w', '.', 'c', 'o', 'm', '\0',
   /* "cross-x.com", true */ 'c', 'r', 'o', 's', 's', '-', 'x', '.', 'c', 'o', 'm', '\0',
   /* "crossborderreturns.com", true */ 'c', 'r', 'o', 's', 's', 'b', 'o', 'r', 'd', 'e', 'r', 'r', 'e', 't', 'u', 'r', 'n', 's', '.', 'c', 'o', 'm', '\0',
   /* "crosscom.ch", true */ 'c', 'r', 'o', 's', 's', 'c', 'o', 'm', '.', 'c', 'h', '\0',
   /* "crossfitblackwater.com", true */ 'c', 'r', 'o', 's', 's', 'f', 'i', 't', 'b', 'l', 'a', 'c', 'k', 'w', 'a', 't', 'e', 'r', '.', 'c', 'o', 'm', '\0',
   /* "crosssellguide.com", true */ 'c', 'r', 'o', 's', 's', 's', 'e', 'l', 'l', 'g', 'u', 'i', 'd', 'e', '.', 'c', 'o', 'm', '\0',
-  /* "crow.tw", true */ 'c', 'r', 'o', 'w', '.', 't', 'w', '\0',
   /* "crowdsupply.com", true */ 'c', 'r', 'o', 'w', 'd', 's', 'u', 'p', 'p', 'l', 'y', '.', 'c', 'o', 'm', '\0',
   /* "crownruler.com", true */ 'c', 'r', 'o', 'w', 'n', 'r', 'u', 'l', 'e', 'r', '.', 'c', 'o', 'm', '\0',
   /* "crstat.ru", true */ 'c', 'r', 's', 't', 'a', 't', '.', 'r', 'u', '\0',
@@ -2701,7 +2702,6 @@ static const char kSTSHostTable[] = {
   /* "cssu.in", true */ 'c', 's', 's', 'u', '.', 'i', 'n', '\0',
   /* "cstkit.com", true */ 'c', 's', 't', 'k', 'i', 't', '.', 'c', 'o', 'm', '\0',
   /* "csuw.net", true */ 'c', 's', 'u', 'w', '.', 'n', 'e', 't', '\0',
-  /* "csvape.com", true */ 'c', 's', 'v', 'a', 'p', 'e', '.', 'c', 'o', 'm', '\0',
   /* "ct-status.org", true */ 'c', 't', '-', 's', 't', 'a', 't', 'u', 's', '.', 'o', 'r', 'g', '\0',
   /* "cthomas.work", true */ 'c', 't', 'h', 'o', 'm', 'a', 's', '.', 'w', 'o', 'r', 'k', '\0',
   /* "ctns.de", true */ 'c', 't', 'n', 's', '.', 'd', 'e', '\0',
@@ -2865,6 +2865,8 @@ static const char kSTSHostTable[] = {
   /* "danieljamesscott.org", true */ 'd', 'a', 'n', 'i', 'e', 'l', 'j', 'a', 'm', 'e', 's', 's', 'c', 'o', 't', 't', '.', 'o', 'r', 'g', '\0',
   /* "danielkoster.nl", true */ 'd', 'a', 'n', 'i', 'e', 'l', 'k', 'o', 's', 't', 'e', 'r', '.', 'n', 'l', '\0',
   /* "danielmarquard.com", true */ 'd', 'a', 'n', 'i', 'e', 'l', 'm', 'a', 'r', 'q', 'u', 'a', 'r', 'd', '.', 'c', 'o', 'm', '\0',
+  /* "danielmostertman.com", false */ 'd', 'a', 'n', 'i', 'e', 'l', 'm', 'o', 's', 't', 'e', 'r', 't', 'm', 'a', 'n', '.', 'c', 'o', 'm', '\0',
+  /* "danielmostertman.nl", false */ 'd', 'a', 'n', 'i', 'e', 'l', 'm', 'o', 's', 't', 'e', 'r', 't', 'm', 'a', 'n', '.', 'n', 'l', '\0',
   /* "danielrozenberg.com", true */ 'd', 'a', 'n', 'i', 'e', 'l', 'r', 'o', 'z', 'e', 'n', 'b', 'e', 'r', 'g', '.', 'c', 'o', 'm', '\0',
   /* "danielthompson.info", true */ 'd', 'a', 'n', 'i', 'e', 'l', 't', 'h', 'o', 'm', 'p', 's', 'o', 'n', '.', 'i', 'n', 'f', 'o', '\0',
   /* "danieltollot.de", true */ 'd', 'a', 'n', 'i', 'e', 'l', 't', 'o', 'l', 'l', 'o', 't', '.', 'd', 'e', '\0',
@@ -3112,6 +3114,7 @@ static const char kSTSHostTable[] = {
   /* "dethemium.com", true */ 'd', 'e', 't', 'h', 'e', 'm', 'i', 'u', 'm', '.', 'c', 'o', 'm', '\0',
   /* "detoxsinutritie.ro", true */ 'd', 'e', 't', 'o', 'x', 's', 'i', 'n', 'u', 't', 'r', 'i', 't', 'i', 'e', '.', 'r', 'o', '\0',
   /* "detteflies.com", true */ 'd', 'e', 't', 't', 'e', 'f', 'l', 'i', 'e', 's', '.', 'c', 'o', 'm', '\0',
+  /* "detutorial.com", true */ 'd', 'e', 't', 'u', 't', 'o', 'r', 'i', 'a', 'l', '.', 'c', 'o', 'm', '\0',
   /* "deusu.de", true */ 'd', 'e', 'u', 's', 'u', '.', 'd', 'e', '\0',
   /* "deusu.org", true */ 'd', 'e', 'u', 's', 'u', '.', 'o', 'r', 'g', '\0',
   /* "deux.solutions", true */ 'd', 'e', 'u', 'x', '.', 's', 'o', 'l', 'u', 't', 'i', 'o', 'n', 's', '\0',
@@ -3159,6 +3162,7 @@ static const char kSTSHostTable[] = {
   /* "dfektlan.no", true */ 'd', 'f', 'e', 'k', 't', 'l', 'a', 'n', '.', 'n', 'o', '\0',
   /* "dfl.mn", true */ 'd', 'f', 'l', '.', 'm', 'n', '\0',
   /* "dfranke.com", true */ 'd', 'f', 'r', 'a', 'n', 'k', 'e', '.', 'c', 'o', 'm', '\0',
+  /* "dgeex.eu", true */ 'd', 'g', 'e', 'e', 'x', '.', 'e', 'u', '\0',
   /* "dgpot.com", true */ 'd', 'g', 'p', 'o', 't', '.', 'c', 'o', 'm', '\0',
   /* "dgt-portal.de", true */ 'd', 'g', 't', '-', 'p', 'o', 'r', 't', 'a', 'l', '.', 'd', 'e', '\0',
   /* "dhautefeuille.eu", true */ 'd', 'h', 'a', 'u', 't', 'e', 'f', 'e', 'u', 'i', 'l', 'l', 'e', '.', 'e', 'u', '\0',
@@ -3211,6 +3215,7 @@ static const char kSTSHostTable[] = {
   /* "digital-coach.it", false */ 'd', 'i', 'g', 'i', 't', 'a', 'l', '-', 'c', 'o', 'a', 'c', 'h', '.', 'i', 't', '\0',
   /* "digital-eastside.de", true */ 'd', 'i', 'g', 'i', 't', 'a', 'l', '-', 'e', 'a', 's', 't', 's', 'i', 'd', 'e', '.', 'd', 'e', '\0',
   /* "digital1st.co.uk", true */ 'd', 'i', 'g', 'i', 't', 'a', 'l', '1', 's', 't', '.', 'c', 'o', '.', 'u', 'k', '\0',
+  /* "digitalbank.kz", true */ 'd', 'i', 'g', 'i', 't', 'a', 'l', 'b', 'a', 'n', 'k', '.', 'k', 'z', '\0',
   /* "digitaldeli.org", true */ 'd', 'i', 'g', 'i', 't', 'a', 'l', 'd', 'e', 'l', 'i', '.', 'o', 'r', 'g', '\0',
   /* "digitaldeli.tv", true */ 'd', 'i', 'g', 'i', 't', 'a', 'l', 'd', 'e', 'l', 'i', '.', 't', 'v', '\0',
   /* "digitaldeli.us", true */ 'd', 'i', 'g', 'i', 't', 'a', 'l', 'd', 'e', 'l', 'i', '.', 'u', 's', '\0',
@@ -3273,7 +3278,6 @@ static const char kSTSHostTable[] = {
   /* "diversityflags.com", true */ 'd', 'i', 'v', 'e', 'r', 's', 'i', 't', 'y', 'f', 'l', 'a', 'g', 's', '.', 'c', 'o', 'm', '\0',
   /* "divingwithnic.com", true */ 'd', 'i', 'v', 'i', 'n', 'g', 'w', 'i', 't', 'h', 'n', 'i', 'c', '.', 'c', 'o', 'm', '\0',
   /* "dixiediner.com", true */ 'd', 'i', 'x', 'i', 'e', 'd', 'i', 'n', 'e', 'r', '.', 'c', 'o', 'm', '\0',
-  /* "dixmag.com", true */ 'd', 'i', 'x', 'm', 'a', 'g', '.', 'c', 'o', 'm', '\0',
   /* "diybook.at", true */ 'd', 'i', 'y', 'b', 'o', 'o', 'k', '.', 'a', 't', '\0',
   /* "diycc.org", true */ 'd', 'i', 'y', 'c', 'c', '.', 'o', 'r', 'g', '\0',
   /* "djangoproject.com", true */ 'd', 'j', 'a', 'n', 'g', 'o', 'p', 'r', 'o', 'j', 'e', 'c', 't', '.', 'c', 'o', 'm', '\0',
@@ -3305,6 +3309,7 @@ static const char kSTSHostTable[] = {
   /* "dmwall.cn", true */ 'd', 'm', 'w', 'a', 'l', 'l', '.', 'c', 'n', '\0',
   /* "dmz.ninja", true */ 'd', 'm', 'z', '.', 'n', 'i', 'n', 'j', 'a', '\0',
   /* "dn3s.me", true */ 'd', 'n', '3', 's', '.', 'm', 'e', '\0',
+  /* "dn42.us", true */ 'd', 'n', '4', '2', '.', 'u', 's', '\0',
   /* "dna.li", true */ 'd', 'n', 'a', '.', 'l', 'i', '\0',
   /* "dnc.org.nz", true */ 'd', 'n', 'c', '.', 'o', 'r', 'g', '.', 'n', 'z', '\0',
   /* "dndtools.net", true */ 'd', 'n', 'd', 't', 'o', 'o', 'l', 's', '.', 'n', 'e', 't', '\0',
@@ -3354,7 +3359,6 @@ static const char kSTSHostTable[] = {
   /* "dolphin-hosting.com", true */ 'd', 'o', 'l', 'p', 'h', 'i', 'n', '-', 'h', 'o', 's', 't', 'i', 'n', 'g', '.', 'c', 'o', 'm', '\0',
   /* "dolphin-it.de", true */ 'd', 'o', 'l', 'p', 'h', 'i', 'n', '-', 'i', 't', '.', 'd', 'e', '\0',
   /* "dolphinswithlasers.com", true */ 'd', 'o', 'l', 'p', 'h', 'i', 'n', 's', 'w', 'i', 't', 'h', 'l', 'a', 's', 'e', 'r', 's', '.', 'c', 'o', 'm', '\0',
-  /* "domadillo.com", true */ 'd', 'o', 'm', 'a', 'd', 'i', 'l', 'l', 'o', '.', 'c', 'o', 'm', '\0',
   /* "domain001.info", true */ 'd', 'o', 'm', 'a', 'i', 'n', '0', '0', '1', '.', 'i', 'n', 'f', 'o', '\0',
   /* "domainexpress.de", true */ 'd', 'o', 'm', 'a', 'i', 'n', 'e', 'x', 'p', 'r', 'e', 's', 's', '.', 'd', 'e', '\0',
   /* "domainkauf.de", true */ 'd', 'o', 'm', 'a', 'i', 'n', 'k', 'a', 'u', 'f', '.', 'd', 'e', '\0',
@@ -3415,6 +3419,7 @@ static const char kSTSHostTable[] = {
   /* "downloadsoftwaregratisan.com", true */ 'd', 'o', 'w', 'n', 'l', 'o', 'a', 'd', 's', 'o', 'f', 't', 'w', 'a', 'r', 'e', 'g', 'r', 'a', 't', 'i', 's', 'a', 'n', '.', 'c', 'o', 'm', '\0',
   /* "doyoulyft.com", true */ 'd', 'o', 'y', 'o', 'u', 'l', 'y', 'f', 't', '.', 'c', 'o', 'm', '\0',
   /* "dpd.com.pl", true */ 'd', 'p', 'd', '.', 'c', 'o', 'm', '.', 'p', 'l', '\0',
+  /* "dprd-wonogirikab.go.id", true */ 'd', 'p', 'r', 'd', '-', 'w', 'o', 'n', 'o', 'g', 'i', 'r', 'i', 'k', 'a', 'b', '.', 'g', 'o', '.', 'i', 'd', '\0',
   /* "dpsg-roden.de", false */ 'd', 'p', 's', 'g', '-', 'r', 'o', 'd', 'e', 'n', '.', 'd', 'e', '\0',
   /* "dragon-aspect.com", true */ 'd', 'r', 'a', 'g', 'o', 'n', '-', 'a', 's', 'p', 'e', 'c', 't', '.', 'c', 'o', 'm', '\0',
   /* "dragon-chem.eu", true */ 'd', 'r', 'a', 'g', 'o', 'n', '-', 'c', 'h', 'e', 'm', '.', 'e', 'u', '\0',
@@ -3432,6 +3437,7 @@ static const char kSTSHostTable[] = {
   /* "drawesome.uy", true */ 'd', 'r', 'a', 'w', 'e', 's', 'o', 'm', 'e', '.', 'u', 'y', '\0',
   /* "drawingcode.net", true */ 'd', 'r', 'a', 'w', 'i', 'n', 'g', 'c', 'o', 'd', 'e', '.', 'n', 'e', 't', '\0',
   /* "dreamcreator108.com", true */ 'd', 'r', 'e', 'a', 'm', 'c', 'r', 'e', 'a', 't', 'o', 'r', '1', '0', '8', '.', 'c', 'o', 'm', '\0',
+  /* "dreamlinehost.com", true */ 'd', 'r', 'e', 'a', 'm', 'l', 'i', 'n', 'e', 'h', 'o', 's', 't', '.', 'c', 'o', 'm', '\0',
   /* "dreamsforabetterworld.com.au", true */ 'd', 'r', 'e', 'a', 'm', 's', 'f', 'o', 'r', 'a', 'b', 'e', 't', 't', 'e', 'r', 'w', 'o', 'r', 'l', 'd', '.', 'c', 'o', 'm', '.', 'a', 'u', '\0',
   /* "dreamtechie.com", true */ 'd', 'r', 'e', 'a', 'm', 't', 'e', 'c', 'h', 'i', 'e', '.', 'c', 'o', 'm', '\0',
   /* "dredgepress.com", true */ 'd', 'r', 'e', 'd', 'g', 'e', 'p', 'r', 'e', 's', 's', '.', 'c', 'o', 'm', '\0',
@@ -3904,6 +3910,7 @@ static const char kSTSHostTable[] = {
   /* "escalate.eu", true */ 'e', 's', 'c', 'a', 'l', 'a', 't', 'e', '.', 'e', 'u', '\0',
   /* "escapees.com", true */ 'e', 's', 'c', 'a', 'p', 'e', 'e', 's', '.', 'c', 'o', 'm', '\0',
   /* "escargotbistro.com", true */ 'e', 's', 'c', 'a', 'r', 'g', 'o', 't', 'b', 'i', 's', 't', 'r', 'o', '.', 'c', 'o', 'm', '\0',
+  /* "escritoriodearte.com", false */ 'e', 's', 'c', 'r', 'i', 't', 'o', 'r', 'i', 'o', 'd', 'e', 'a', 'r', 't', 'e', '.', 'c', 'o', 'm', '\0',
   /* "escyr.top", true */ 'e', 's', 'c', 'y', 'r', '.', 't', 'o', 'p', '\0',
   /* "eseth.de", true */ 'e', 's', 'e', 't', 'h', '.', 'd', 'e', '\0',
   /* "esg-abi2001.de", true */ 'e', 's', 'g', '-', 'a', 'b', 'i', '2', '0', '0', '1', '.', 'd', 'e', '\0',
@@ -3948,7 +3955,6 @@ static const char kSTSHostTable[] = {
   /* "eth9.net", true */ 'e', 't', 'h', '9', '.', 'n', 'e', 't', '\0',
   /* "etha.nz", true */ 'e', 't', 'h', 'a', '.', 'n', 'z', '\0',
   /* "ethan.pm", true */ 'e', 't', 'h', 'a', 'n', '.', 'p', 'm', '\0',
-  /* "ethanfaust.com", true */ 'e', 't', 'h', 'a', 'n', 'f', 'a', 'u', 's', 't', '.', 'c', 'o', 'm', '\0',
   /* "ethanlew.is", true */ 'e', 't', 'h', 'a', 'n', 'l', 'e', 'w', '.', 'i', 's', '\0',
   /* "ethercalc.com", true */ 'e', 't', 'h', 'e', 'r', 'c', 'a', 'l', 'c', '.', 'c', 'o', 'm', '\0',
   /* "ethercalc.org", true */ 'e', 't', 'h', 'e', 'r', 'c', 'a', 'l', 'c', '.', 'o', 'r', 'g', '\0',
@@ -4242,6 +4248,7 @@ static const char kSTSHostTable[] = {
   /* "fierman.eu", false */ 'f', 'i', 'e', 'r', 'm', 'a', 'n', '.', 'e', 'u', '\0',
   /* "fierman.net", false */ 'f', 'i', 'e', 'r', 'm', 'a', 'n', '.', 'n', 'e', 't', '\0',
   /* "fierman.us", false */ 'f', 'i', 'e', 'r', 'm', 'a', 'n', '.', 'u', 's', '\0',
+  /* "fifieldtech.com", true */ 'f', 'i', 'f', 'i', 'e', 'l', 'd', 't', 'e', 'c', 'h', '.', 'c', 'o', 'm', '\0',
   /* "figurasdelinguagem.com.br", true */ 'f', 'i', 'g', 'u', 'r', 'a', 's', 'd', 'e', 'l', 'i', 'n', 'g', 'u', 'a', 'g', 'e', 'm', '.', 'c', 'o', 'm', '.', 'b', 'r', '\0',
   /* "figuurzagers.nl", false */ 'f', 'i', 'g', 'u', 'u', 'r', 'z', 'a', 'g', 'e', 'r', 's', '.', 'n', 'l', '\0',
   /* "fiilr.com", true */ 'f', 'i', 'i', 'l', 'r', '.', 'c', 'o', 'm', '\0',
@@ -4373,7 +4380,6 @@ static const char kSTSHostTable[] = {
   /* "fluxoid.com", true */ 'f', 'l', 'u', 'x', 'o', 'i', 'd', '.', 'c', 'o', 'm', '\0',
   /* "fly.moe", true */ 'f', 'l', 'y', '.', 'm', 'o', 'e', '\0',
   /* "flynn.io", true */ 'f', 'l', 'y', 'n', 'n', '.', 'i', 'o', '\0',
-  /* "flyserver.co.il", true */ 'f', 'l', 'y', 's', 'e', 'r', 'v', 'e', 'r', '.', 'c', 'o', '.', 'i', 'l', '\0',
   /* "fm.ie", true */ 'f', 'm', '.', 'i', 'e', '\0',
   /* "fmarchal.fr", true */ 'f', 'm', 'a', 'r', 'c', 'h', 'a', 'l', '.', 'f', 'r', '\0',
   /* "fnb-griffinonline.com", true */ 'f', 'n', 'b', '-', 'g', 'r', 'i', 'f', 'f', 'i', 'n', 'o', 'n', 'l', 'i', 'n', 'e', '.', 'c', 'o', 'm', '\0',
@@ -4452,7 +4458,6 @@ static const char kSTSHostTable[] = {
   /* "fr.search.yahoo.com", false */ 'f', 'r', '.', 's', 'e', 'a', 'r', 'c', 'h', '.', 'y', 'a', 'h', 'o', 'o', '.', 'c', 'o', 'm', '\0',
   /* "frack.nl", true */ 'f', 'r', 'a', 'c', 'k', '.', 'n', 'l', '\0',
   /* "fraesentest.de", true */ 'f', 'r', 'a', 'e', 's', 'e', 'n', 't', 'e', 's', 't', '.', 'd', 'e', '\0',
-  /* "fragmentspuren.de", true */ 'f', 'r', 'a', 'g', 'm', 'e', 'n', 't', 's', 'p', 'u', 'r', 'e', 'n', '.', 'd', 'e', '\0',
   /* "fragnic.com", true */ 'f', 'r', 'a', 'g', 'n', 'i', 'c', '.', 'c', 'o', 'm', '\0',
   /* "fraho.eu", true */ 'f', 'r', 'a', 'h', 'o', '.', 'e', 'u', '\0',
   /* "fralef.me", false */ 'f', 'r', 'a', 'l', 'e', 'f', '.', 'm', 'e', '\0',
@@ -4609,6 +4614,7 @@ static const char kSTSHostTable[] = {
   /* "g-m-w.eu", true */ 'g', '-', 'm', '-', 'w', '.', 'e', 'u', '\0',
   /* "g-marketing.ro", true */ 'g', '-', 'm', 'a', 'r', 'k', 'e', 't', 'i', 'n', 'g', '.', 'r', 'o', '\0',
   /* "g-o.pl", true */ 'g', '-', 'o', '.', 'p', 'l', '\0',
+  /* "g01.in.ua", true */ 'g', '0', '1', '.', 'i', 'n', '.', 'u', 'a', '\0',
   /* "g2links.com", true */ 'g', '2', 'l', 'i', 'n', 'k', 's', '.', 'c', 'o', 'm', '\0',
   /* "g2pla.net", true */ 'g', '2', 'p', 'l', 'a', '.', 'n', 'e', 't', '\0',
   /* "g2soft.net", true */ 'g', '2', 's', 'o', 'f', 't', '.', 'n', 'e', 't', '\0',
@@ -4750,12 +4756,10 @@ static const char kSTSHostTable[] = {
   /* "geoip.stg.fedoraproject.org", true */ 'g', 'e', 'o', 'i', 'p', '.', 's', 't', 'g', '.', 'f', 'e', 'd', 'o', 'r', 'a', 'p', 'r', 'o', 'j', 'e', 'c', 't', '.', 'o', 'r', 'g', '\0',
   /* "geolad.com", false */ 'g', 'e', 'o', 'l', 'a', 'd', '.', 'c', 'o', 'm', '\0',
   /* "georgemaschke.com", true */ 'g', 'e', 'o', 'r', 'g', 'e', 'm', 'a', 's', 'c', 'h', 'k', 'e', '.', 'c', 'o', 'm', '\0',
-  /* "georgemaschke.net", true */ 'g', 'e', 'o', 'r', 'g', 'e', 'm', 'a', 's', 'c', 'h', 'k', 'e', '.', 'n', 'e', 't', '\0',
   /* "georgesonarthurs.com.au", true */ 'g', 'e', 'o', 'r', 'g', 'e', 's', 'o', 'n', 'a', 'r', 't', 'h', 'u', 'r', 's', '.', 'c', 'o', 'm', '.', 'a', 'u', '\0',
   /* "georgioskontaxis.com", true */ 'g', 'e', 'o', 'r', 'g', 'i', 'o', 's', 'k', 'o', 'n', 't', 'a', 'x', 'i', 's', '.', 'c', 'o', 'm', '\0',
   /* "georgioskontaxis.net", true */ 'g', 'e', 'o', 'r', 'g', 'i', 'o', 's', 'k', 'o', 'n', 't', 'a', 'x', 'i', 's', '.', 'n', 'e', 't', '\0',
   /* "georgioskontaxis.org", true */ 'g', 'e', 'o', 'r', 'g', 'i', 'o', 's', 'k', 'o', 'n', 't', 'a', 'x', 'i', 's', '.', 'o', 'r', 'g', '\0',
-  /* "georgmayer.eu", true */ 'g', 'e', 'o', 'r', 'g', 'm', 'a', 'y', 'e', 'r', '.', 'e', 'u', '\0',
   /* "geoscan.aero", true */ 'g', 'e', 'o', 's', 'c', 'a', 'n', '.', 'a', 'e', 'r', 'o', '\0',
   /* "geraintwhite.co.uk", true */ 'g', 'e', 'r', 'a', 'i', 'n', 't', 'w', 'h', 'i', 't', 'e', '.', 'c', 'o', '.', 'u', 'k', '\0',
   /* "gerardozamudio.mx", true */ 'g', 'e', 'r', 'a', 'r', 'd', 'o', 'z', 'a', 'm', 'u', 'd', 'i', 'o', '.', 'm', 'x', '\0',
@@ -4797,7 +4801,6 @@ static const char kSTSHostTable[] = {
   /* "getmdl.io", true */ 'g', 'e', 't', 'm', 'd', 'l', '.', 'i', 'o', '\0',
   /* "getmondo.co.uk", true */ 'g', 'e', 't', 'm', 'o', 'n', 'd', 'o', '.', 'c', 'o', '.', 'u', 'k', '\0',
   /* "getnikola.com", true */ 'g', 'e', 't', 'n', 'i', 'k', 'o', 'l', 'a', '.', 'c', 'o', 'm', '\0',
-  /* "getremembrall.com", true */ 'g', 'e', 't', 'r', 'e', 'm', 'e', 'm', 'b', 'r', 'a', 'l', 'l', '.', 'c', 'o', 'm', '\0',
   /* "getronics.care", true */ 'g', 'e', 't', 'r', 'o', 'n', 'i', 'c', 's', '.', 'c', 'a', 'r', 'e', '\0',
   /* "getsecure.nl", true */ 'g', 'e', 't', 's', 'e', 'c', 'u', 'r', 'e', '.', 'n', 'l', '\0',
   /* "getsensibill.com", true */ 'g', 'e', 't', 's', 'e', 'n', 's', 'i', 'b', 'i', 'l', 'l', '.', 'c', 'o', 'm', '\0',
@@ -5011,7 +5014,6 @@ static const char kSTSHostTable[] = {
   /* "graycell.net", true */ 'g', 'r', 'a', 'y', 'c', 'e', 'l', 'l', '.', 'n', 'e', 't', '\0',
   /* "graymalk.in", true */ 'g', 'r', 'a', 'y', 'm', 'a', 'l', 'k', '.', 'i', 'n', '\0',
   /* "grc.com", false */ 'g', 'r', 'c', '.', 'c', 'o', 'm', '\0',
-  /* "grcnode.co.uk", true */ 'g', 'r', 'c', 'n', 'o', 'd', 'e', '.', 'c', 'o', '.', 'u', 'k', '\0',
   /* "greatfire.org", true */ 'g', 'r', 'e', 'a', 't', 'f', 'i', 'r', 'e', '.', 'o', 'r', 'g', '\0',
   /* "greatnet.de", true */ 'g', 'r', 'e', 'a', 't', 'n', 'e', 't', '.', 'd', 'e', '\0',
   /* "greboid.co.uk", true */ 'g', 'r', 'e', 'b', 'o', 'i', 'd', '.', 'c', 'o', '.', 'u', 'k', '\0',
@@ -5054,7 +5056,6 @@ static const char kSTSHostTable[] = {
   /* "grieglogistics.no", true */ 'g', 'r', 'i', 'e', 'g', 'l', 'o', 'g', 'i', 's', 't', 'i', 'c', 's', '.', 'n', 'o', '\0',
   /* "griegshipbrokers.com", true */ 'g', 'r', 'i', 'e', 'g', 's', 'h', 'i', 'p', 'b', 'r', 'o', 'k', 'e', 'r', 's', '.', 'c', 'o', 'm', '\0',
   /* "griegshipbrokers.no", true */ 'g', 'r', 'i', 'e', 'g', 's', 'h', 'i', 'p', 'b', 'r', 'o', 'k', 'e', 'r', 's', '.', 'n', 'o', '\0',
-  /* "griesser2.de", true */ 'g', 'r', 'i', 'e', 's', 's', 'e', 'r', '2', '.', 'd', 'e', '\0',
   /* "grillinfools.com", true */ 'g', 'r', 'i', 'l', 'l', 'i', 'n', 'f', 'o', 'o', 'l', 's', '.', 'c', 'o', 'm', '\0',
   /* "grimcalc.com", true */ 'g', 'r', 'i', 'm', 'c', 'a', 'l', 'c', '.', 'c', 'o', 'm', '\0',
   /* "grimm-gastrobedarf.de", true */ 'g', 'r', 'i', 'm', 'm', '-', 'g', 'a', 's', 't', 'r', 'o', 'b', 'e', 'd', 'a', 'r', 'f', '.', 'd', 'e', '\0',
@@ -5216,10 +5217,8 @@ static const char kSTSHostTable[] = {
   /* "hansvaneijsden.nl", true */ 'h', 'a', 'n', 's', 'v', 'a', 'n', 'e', 'i', 'j', 's', 'd', 'e', 'n', '.', 'n', 'l', '\0',
   /* "hantse.com", true */ 'h', 'a', 'n', 't', 's', 'e', '.', 'c', 'o', 'm', '\0',
   /* "hanu.la", true */ 'h', 'a', 'n', 'u', '.', 'l', 'a', '\0',
-  /* "hao-zhang.com", true */ 'h', 'a', 'o', '-', 'z', 'h', 'a', 'n', 'g', '.', 'c', 'o', 'm', '\0',
   /* "haomwei.com", true */ 'h', 'a', 'o', 'm', 'w', 'e', 'i', '.', 'c', 'o', 'm', '\0',
   /* "haoyugao.com", true */ 'h', 'a', 'o', 'y', 'u', 'g', 'a', 'o', '.', 'c', 'o', 'm', '\0',
-  /* "haozhang.org", true */ 'h', 'a', 'o', 'z', 'h', 'a', 'n', 'g', '.', 'o', 'r', 'g', '\0',
   /* "hapijs.cn", true */ 'h', 'a', 'p', 'i', 'j', 's', '.', 'c', 'n', '\0',
   /* "hapissl.com", true */ 'h', 'a', 'p', 'i', 's', 's', 'l', '.', 'c', 'o', 'm', '\0',
   /* "hapivm.com", true */ 'h', 'a', 'p', 'i', 'v', 'm', '.', 'c', 'o', 'm', '\0',
@@ -5528,7 +5527,6 @@ static const char kSTSHostTable[] = {
   /* "hostanalyticsconsulting.com", true */ 'h', 'o', 's', 't', 'a', 'n', 'a', 'l', 'y', 't', 'i', 'c', 's', 'c', 'o', 'n', 's', 'u', 'l', 't', 'i', 'n', 'g', '.', 'c', 'o', 'm', '\0',
   /* "hosteasy.nl", true */ 'h', 'o', 's', 't', 'e', 'a', 's', 'y', '.', 'n', 'l', '\0',
   /* "hosted-oswa.org", true */ 'h', 'o', 's', 't', 'e', 'd', '-', 'o', 's', 'w', 'a', '.', 'o', 'r', 'g', '\0',
-  /* "hosted4u.de", true */ 'h', 'o', 's', 't', 'e', 'd', '4', 'u', '.', 'd', 'e', '\0',
   /* "hostedbgp.net", true */ 'h', 'o', 's', 't', 'e', 'd', 'b', 'g', 'p', '.', 'n', 'e', 't', '\0',
   /* "hostedtalkgadget.google.com", true */ 'h', 'o', 's', 't', 'e', 'd', 't', 'a', 'l', 'k', 'g', 'a', 'd', 'g', 'e', 't', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'c', 'o', 'm', '\0',
   /* "hostelite.com", true */ 'h', 'o', 's', 't', 'e', 'l', 'i', 't', 'e', '.', 'c', 'o', 'm', '\0',
@@ -5757,7 +5755,6 @@ static const char kSTSHostTable[] = {
   /* "ilmiobusinessonline.it", true */ 'i', 'l', 'm', 'i', 'o', 'b', 'u', 's', 'i', 'n', 'e', 's', 's', 'o', 'n', 'l', 'i', 'n', 'e', '.', 'i', 't', '\0',
   /* "ilprof.com", true */ 'i', 'l', 'p', 'r', 'o', 'f', '.', 'c', 'o', 'm', '\0',
   /* "ilrg.com", true */ 'i', 'l', 'r', 'g', '.', 'c', 'o', 'm', '\0',
-  /* "iltisim.ch", true */ 'i', 'l', 't', 'i', 's', 'i', 'm', '.', 'c', 'h', '\0',
   /* "im-c-shop.com", true */ 'i', 'm', '-', 'c', '-', 's', 'h', 'o', 'p', '.', 'c', 'o', 'm', '\0',
   /* "im2net.com", true */ 'i', 'm', '2', 'n', 'e', 't', '.', 'c', 'o', 'm', '\0',
   /* "imagefu.com", true */ 'i', 'm', 'a', 'g', 'e', 'f', 'u', '.', 'c', 'o', 'm', '\0',
@@ -5782,6 +5779,7 @@ static const char kSTSHostTable[] = {
   /* "imirhil.fr", true */ 'i', 'm', 'i', 'r', 'h', 'i', 'l', '.', 'f', 'r', '\0',
   /* "imitza.com", true */ 'i', 'm', 'i', 't', 'z', 'a', '.', 'c', 'o', 'm', '\0',
   /* "imjad.cn", true */ 'i', 'm', 'j', 'a', 'd', '.', 'c', 'n', '\0',
+  /* "imjiangtao.com", true */ 'i', 'm', 'j', 'i', 'a', 'n', 'g', 't', 'a', 'o', '.', 'c', 'o', 'm', '\0',
   /* "imlonghao.com", true */ 'i', 'm', 'l', 'o', 'n', 'g', 'h', 'a', 'o', '.', 'c', 'o', 'm', '\0',
   /* "immaterium.de", true */ 'i', 'm', 'm', 'a', 't', 'e', 'r', 'i', 'u', 'm', '.', 'd', 'e', '\0',
   /* "immersivewebportal.com", true */ 'i', 'm', 'm', 'e', 'r', 's', 'i', 'v', 'e', 'w', 'e', 'b', 'p', 'o', 'r', 't', 'a', 'l', '.', 'c', 'o', 'm', '\0',
@@ -5911,6 +5909,7 @@ static const char kSTSHostTable[] = {
   /* "interisaudit.com", true */ 'i', 'n', 't', 'e', 'r', 'i', 's', 'a', 'u', 'd', 'i', 't', '.', 'c', 'o', 'm', '\0',
   /* "interleucina.org", true */ 'i', 'n', 't', 'e', 'r', 'l', 'e', 'u', 'c', 'i', 'n', 'a', '.', 'o', 'r', 'g', '\0',
   /* "intermedinet.nl", true */ 'i', 'n', 't', 'e', 'r', 'm', 'e', 'd', 'i', 'n', 'e', 't', '.', 'n', 'l', '\0',
+  /* "internect.co.za", true */ 'i', 'n', 't', 'e', 'r', 'n', 'e', 'c', 't', '.', 'c', 'o', '.', 'z', 'a', '\0',
   /* "internet-pornografie.de", true */ 'i', 'n', 't', 'e', 'r', 'n', 'e', 't', '-', 'p', 'o', 'r', 'n', 'o', 'g', 'r', 'a', 'f', 'i', 'e', '.', 'd', 'e', '\0',
   /* "internetbank.swedbank.se", true */ 'i', 'n', 't', 'e', 'r', 'n', 'e', 't', 'b', 'a', 'n', 'k', '.', 's', 'w', 'e', 'd', 'b', 'a', 'n', 'k', '.', 's', 'e', '\0',
   /* "internetbugbounty.org", true */ 'i', 'n', 't', 'e', 'r', 'n', 'e', 't', 'b', 'u', 'g', 'b', 'o', 'u', 'n', 't', 'y', '.', 'o', 'r', 'g', '\0',
@@ -6220,7 +6219,7 @@ static const char kSTSHostTable[] = {
   /* "jayf.de", true */ 'j', 'a', 'y', 'f', '.', 'd', 'e', '\0',
   /* "jayharris.ca", true */ 'j', 'a', 'y', 'h', 'a', 'r', 'r', 'i', 's', '.', 'c', 'a', '\0',
   /* "jaylen.com.ar", true */ 'j', 'a', 'y', 'l', 'e', 'n', '.', 'c', 'o', 'm', '.', 'a', 'r', '\0',
-  /* "jaymecd.rocks", false */ 'j', 'a', 'y', 'm', 'e', 'c', 'd', '.', 'r', 'o', 'c', 'k', 's', '\0',
+  /* "jaymecd.rocks", true */ 'j', 'a', 'y', 'm', 'e', 'c', 'd', '.', 'r', 'o', 'c', 'k', 's', '\0',
   /* "jayxon.com", true */ 'j', 'a', 'y', 'x', 'o', 'n', '.', 'c', 'o', 'm', '\0',
   /* "jayxu.com", true */ 'j', 'a', 'y', 'x', 'u', '.', 'c', 'o', 'm', '\0',
   /* "jazz-alliance.com", true */ 'j', 'a', 'z', 'z', '-', 'a', 'l', 'l', 'i', 'a', 'n', 'c', 'e', '.', 'c', 'o', 'm', '\0',
@@ -6357,6 +6356,7 @@ static const char kSTSHostTable[] = {
   /* "jondevin.com", true */ 'j', 'o', 'n', 'd', 'e', 'v', 'i', 'n', '.', 'c', 'o', 'm', '\0',
   /* "jonesborostatebank.com", true */ 'j', 'o', 'n', 'e', 's', 'b', 'o', 'r', 'o', 's', 't', 'a', 't', 'e', 'b', 'a', 'n', 'k', '.', 'c', 'o', 'm', '\0',
   /* "jonferwerda.net", true */ 'j', 'o', 'n', 'f', 'e', 'r', 'w', 'e', 'r', 'd', 'a', '.', 'n', 'e', 't', '\0',
+  /* "jonfor.net", true */ 'j', 'o', 'n', 'f', 'o', 'r', '.', 'n', 'e', 't', '\0',
   /* "jongbloed.nl", true */ 'j', 'o', 'n', 'g', 'b', 'l', 'o', 'e', 'd', '.', 'n', 'l', '\0',
   /* "jonirrings.com", true */ 'j', 'o', 'n', 'i', 'r', 'r', 'i', 'n', 'g', 's', '.', 'c', 'o', 'm', '\0',
   /* "jonlabelle.com", true */ 'j', 'o', 'n', 'l', 'a', 'b', 'e', 'l', 'l', 'e', '.', 'c', 'o', 'm', '\0',
@@ -6415,7 +6415,6 @@ static const char kSTSHostTable[] = {
   /* "juliangonggrijp.com", true */ 'j', 'u', 'l', 'i', 'a', 'n', 'g', 'o', 'n', 'g', 'g', 'r', 'i', 'j', 'p', '.', 'c', 'o', 'm', '\0',
   /* "julianmeyer.de", true */ 'j', 'u', 'l', 'i', 'a', 'n', 'm', 'e', 'y', 'e', 'r', '.', 'd', 'e', '\0',
   /* "juliansimioni.com", true */ 'j', 'u', 'l', 'i', 'a', 'n', 's', 'i', 'm', 'i', 'o', 'n', 'i', '.', 'c', 'o', 'm', '\0',
-  /* "julibear.com", true */ 'j', 'u', 'l', 'i', 'b', 'e', 'a', 'r', '.', 'c', 'o', 'm', '\0',
   /* "julido.de", true */ 'j', 'u', 'l', 'i', 'd', 'o', '.', 'd', 'e', '\0',
   /* "juliekoubova.net", true */ 'j', 'u', 'l', 'i', 'e', 'k', 'o', 'u', 'b', 'o', 'v', 'a', '.', 'n', 'e', 't', '\0',
   /* "juliemaurel.fr", true */ 'j', 'u', 'l', 'i', 'e', 'm', 'a', 'u', 'r', 'e', 'l', '.', 'f', 'r', '\0',
@@ -6459,6 +6458,7 @@ static const char kSTSHostTable[] = {
   /* "kab-s.de", true */ 'k', 'a', 'b', '-', 's', '.', 'd', 'e', '\0',
   /* "kabat-fans.cz", true */ 'k', 'a', 'b', 'a', 't', '-', 'f', 'a', 'n', 's', '.', 'c', 'z', '\0',
   /* "kabeuchi.com", true */ 'k', 'a', 'b', 'e', 'u', 'c', 'h', 'i', '.', 'c', 'o', 'm', '\0',
+  /* "kabus.org", true */ 'k', 'a', 'b', 'u', 's', '.', 'o', 'r', 'g', '\0',
   /* "kachlikova2.cz", true */ 'k', 'a', 'c', 'h', 'l', 'i', 'k', 'o', 'v', 'a', '2', '.', 'c', 'z', '\0',
   /* "kackscharf.de", true */ 'k', 'a', 'c', 'k', 's', 'c', 'h', 'a', 'r', 'f', '.', 'd', 'e', '\0',
   /* "kadmec.com", true */ 'k', 'a', 'd', 'm', 'e', 'c', '.', 'c', 'o', 'm', '\0',
@@ -6647,7 +6647,6 @@ static const char kSTSHostTable[] = {
   /* "kickstart.com.pk", true */ 'k', 'i', 'c', 'k', 's', 't', 'a', 'r', 't', '.', 'c', 'o', 'm', '.', 'p', 'k', '\0',
   /* "kidbacker.com", true */ 'k', 'i', 'd', 'b', 'a', 'c', 'k', 'e', 'r', '.', 'c', 'o', 'm', '\0',
   /* "kiebel.de", true */ 'k', 'i', 'e', 'b', 'e', 'l', '.', 'd', 'e', '\0',
-  /* "kiedys.net", true */ 'k', 'i', 'e', 'd', 'y', 's', '.', 'n', 'e', 't', '\0',
   /* "kiefer-networks.de", true */ 'k', 'i', 'e', 'f', 'e', 'r', '-', 'n', 'e', 't', 'w', 'o', 'r', 'k', 's', '.', 'd', 'e', '\0',
   /* "kiekin.org", true */ 'k', 'i', 'e', 'k', 'i', 'n', '.', 'o', 'r', 'g', '\0',
   /* "kielderweather.org.uk", true */ 'k', 'i', 'e', 'l', 'd', 'e', 'r', 'w', 'e', 'a', 't', 'h', 'e', 'r', '.', 'o', 'r', 'g', '.', 'u', 'k', '\0',
@@ -6688,7 +6687,6 @@ static const char kSTSHostTable[] = {
   /* "kionetworks.es", true */ 'k', 'i', 'o', 'n', 'e', 't', 'w', 'o', 'r', 'k', 's', '.', 'e', 's', '\0',
   /* "kiragameforum.net", true */ 'k', 'i', 'r', 'a', 'g', 'a', 'm', 'e', 'f', 'o', 'r', 'u', 'm', '.', 'n', 'e', 't', '\0',
   /* "kirara.eu", true */ 'k', 'i', 'r', 'a', 'r', 'a', '.', 'e', 'u', '\0',
-  /* "kirbear.com", true */ 'k', 'i', 'r', 'b', 'e', 'a', 'r', '.', 'c', 'o', 'm', '\0',
   /* "kirei.se", true */ 'k', 'i', 'r', 'e', 'i', '.', 's', 'e', '\0',
   /* "kirinas.com", true */ 'k', 'i', 'r', 'i', 'n', 'a', 's', '.', 'c', 'o', 'm', '\0',
   /* "kirkovsky.com", true */ 'k', 'i', 'r', 'k', 'o', 'v', 's', 'k', 'y', '.', 'c', 'o', 'm', '\0',
@@ -6708,7 +6706,6 @@ static const char kSTSHostTable[] = {
   /* "kjarni.cc", true */ 'k', 'j', 'a', 'r', 'n', 'i', '.', 'c', 'c', '\0',
   /* "kjarrval.is", true */ 'k', 'j', 'a', 'r', 'r', 'v', 'a', 'l', '.', 'i', 's', '\0',
   /* "kjchernov.info", true */ 'k', 'j', 'c', 'h', 'e', 'r', 'n', 'o', 'v', '.', 'i', 'n', 'f', 'o', '\0',
-  /* "kjellvn.net", true */ 'k', 'j', 'e', 'l', 'l', 'v', 'n', '.', 'n', 'e', 't', '\0',
   /* "kk-neudorf-duissern.de", true */ 'k', 'k', '-', 'n', 'e', 'u', 'd', 'o', 'r', 'f', '-', 'd', 'u', 'i', 's', 's', 'e', 'r', 'n', '.', 'd', 'e', '\0',
   /* "kki.org", true */ 'k', 'k', 'i', '.', 'o', 'r', 'g', '\0',
   /* "kkovacs.eu", true */ 'k', 'k', 'o', 'v', 'a', 'c', 's', '.', 'e', 'u', '\0',
@@ -6720,6 +6717,7 @@ static const char kSTSHostTable[] = {
   /* "klares-licht.de", true */ 'k', 'l', 'a', 'r', 'e', 's', '-', 'l', 'i', 'c', 'h', 't', '.', 'd', 'e', '\0',
   /* "klarmobil-empfehlen.de", true */ 'k', 'l', 'a', 'r', 'm', 'o', 'b', 'i', 'l', '-', 'e', 'm', 'p', 'f', 'e', 'h', 'l', 'e', 'n', '.', 'd', 'e', '\0',
   /* "klas.or.id", true */ 'k', 'l', 'a', 's', '.', 'o', 'r', '.', 'i', 'd', '\0',
+  /* "klasfauseweh.de", true */ 'k', 'l', 'a', 's', 'f', 'a', 'u', 's', 'e', 'w', 'e', 'h', '.', 'd', 'e', '\0',
   /* "klatschreime.de", true */ 'k', 'l', 'a', 't', 's', 'c', 'h', 'r', 'e', 'i', 'm', 'e', '.', 'd', 'e', '\0',
   /* "klausbrinch.dk", true */ 'k', 'l', 'a', 'u', 's', 'b', 'r', 'i', 'n', 'c', 'h', '.', 'd', 'k', '\0',
   /* "klausimas.lt", true */ 'k', 'l', 'a', 'u', 's', 'i', 'm', 'a', 's', '.', 'l', 't', '\0',
@@ -6902,7 +6900,6 @@ static const char kSTSHostTable[] = {
   /* "kupschke.net", true */ 'k', 'u', 'p', 's', 'c', 'h', 'k', 'e', '.', 'n', 'e', 't', '\0',
   /* "kurofuku.me", true */ 'k', 'u', 'r', 'o', 'f', 'u', 'k', 'u', '.', 'm', 'e', '\0',
   /* "kurswahl-online.de", true */ 'k', 'u', 'r', 's', 'w', 'a', 'h', 'l', '-', 'o', 'n', 'l', 'i', 'n', 'e', '.', 'd', 'e', '\0',
-  /* "kurtmclester.com", true */ 'k', 'u', 'r', 't', 'm', 'c', 'l', 'e', 's', 't', 'e', 'r', '.', 'c', 'o', 'm', '\0',
   /* "kuschelmikroben.de", true */ 'k', 'u', 's', 'c', 'h', 'e', 'l', 'm', 'i', 'k', 'r', 'o', 'b', 'e', 'n', '.', 'd', 'e', '\0',
   /* "kuschelviren.de", true */ 'k', 'u', 's', 'c', 'h', 'e', 'l', 'v', 'i', 'r', 'e', 'n', '.', 'd', 'e', '\0',
   /* "kuschku.de", true */ 'k', 'u', 's', 'c', 'h', 'k', 'u', '.', 'd', 'e', '\0',
@@ -6943,7 +6940,6 @@ static const char kSTSHostTable[] = {
   /* "lacasseroy.com", true */ 'l', 'a', 'c', 'a', 's', 's', 'e', 'r', 'o', 'y', '.', 'c', 'o', 'm', '\0',
   /* "lacaverne.nl", true */ 'l', 'a', 'c', 'a', 'v', 'e', 'r', 'n', 'e', '.', 'n', 'l', '\0',
   /* "lacentral.com", false */ 'l', 'a', 'c', 'e', 'n', 't', 'r', 'a', 'l', '.', 'c', 'o', 'm', '\0',
-  /* "lacicloud.net", true */ 'l', 'a', 'c', 'i', 'c', 'l', 'o', 'u', 'd', '.', 'n', 'e', 't', '\0',
   /* "lacledeslan.com", false */ 'l', 'a', 'c', 'l', 'e', 'd', 'e', 's', 'l', 'a', 'n', '.', 'c', 'o', 'm', '\0',
   /* "lacliniquefinanciere.com", true */ 'l', 'a', 'c', 'l', 'i', 'n', 'i', 'q', 'u', 'e', 'f', 'i', 'n', 'a', 'n', 'c', 'i', 'e', 'r', 'e', '.', 'c', 'o', 'm', '\0',
   /* "lacocinadelila.com", true */ 'l', 'a', 'c', 'o', 'c', 'i', 'n', 'a', 'd', 'e', 'l', 'i', 'l', 'a', '.', 'c', 'o', 'm', '\0',
@@ -7061,6 +7057,7 @@ static const char kSTSHostTable[] = {
   /* "leadingsalons.com", true */ 'l', 'e', 'a', 'd', 'i', 'n', 'g', 's', 'a', 'l', 'o', 'n', 's', '.', 'c', 'o', 'm', '\0',
   /* "leakedminecraft.net", true */ 'l', 'e', 'a', 'k', 'e', 'd', 'm', 'i', 'n', 'e', 'c', 'r', 'a', 'f', 't', '.', 'n', 'e', 't', '\0',
   /* "leakforums.net", true */ 'l', 'e', 'a', 'k', 'f', 'o', 'r', 'u', 'm', 's', '.', 'n', 'e', 't', '\0',
+  /* "leakreporter.net", true */ 'l', 'e', 'a', 'k', 'r', 'e', 'p', 'o', 'r', 't', 'e', 'r', '.', 'n', 'e', 't', '\0',
   /* "leaks.directory", true */ 'l', 'e', 'a', 'k', 's', '.', 'd', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\0',
   /* "leanclub.org", true */ 'l', 'e', 'a', 'n', 'c', 'l', 'u', 'b', '.', 'o', 'r', 'g', '\0',
   /* "leandre.cn", true */ 'l', 'e', 'a', 'n', 'd', 'r', 'e', '.', 'c', 'n', '\0',
@@ -7168,6 +7165,7 @@ static const char kSTSHostTable[] = {
   /* "libreduca.com", true */ 'l', 'i', 'b', 'r', 'e', 'd', 'u', 'c', 'a', '.', 'c', 'o', 'm', '\0',
   /* "librelamp.com", true */ 'l', 'i', 'b', 'r', 'e', 'l', 'a', 'm', 'p', '.', 'c', 'o', 'm', '\0',
   /* "librends.org", true */ 'l', 'i', 'b', 'r', 'e', 'n', 'd', 's', '.', 'o', 'r', 'g', '\0',
+  /* "libscode.com", true */ 'l', 'i', 'b', 's', 'c', 'o', 'd', 'e', '.', 'c', 'o', 'm', '\0',
   /* "libskia.so", true */ 'l', 'i', 'b', 's', 'k', 'i', 'a', '.', 's', 'o', '\0',
   /* "libsodium.org", true */ 'l', 'i', 'b', 's', 'o', 'd', 'i', 'u', 'm', '.', 'o', 'r', 'g', '\0',
   /* "liceserv.com", true */ 'l', 'i', 'c', 'e', 's', 'e', 'r', 'v', '.', 'c', 'o', 'm', '\0',
@@ -7255,7 +7253,7 @@ static const char kSTSHostTable[] = {
   /* "litchidova.nl", true */ 'l', 'i', 't', 'c', 'h', 'i', 'd', 'o', 'v', 'a', '.', 'n', 'l', '\0',
   /* "litevault.net", true */ 'l', 'i', 't', 'e', 'v', 'a', 'u', 'l', 't', '.', 'n', 'e', 't', '\0',
   /* "litfin.name", true */ 'l', 'i', 't', 'f', 'i', 'n', '.', 'n', 'a', 'm', 'e', '\0',
-  /* "lithesalar.se", false */ 'l', 'i', 't', 'h', 'e', 's', 'a', 'l', 'a', 'r', '.', 's', 'e', '\0',
+  /* "lithesalar.se", true */ 'l', 'i', 't', 'h', 'e', 's', 'a', 'l', 'a', 'r', '.', 's', 'e', '\0',
   /* "little.pw", true */ 'l', 'i', 't', 't', 'l', 'e', '.', 'p', 'w', '\0',
   /* "littlefreelibrary.org", true */ 'l', 'i', 't', 't', 'l', 'e', 'f', 'r', 'e', 'e', 'l', 'i', 'b', 'r', 'a', 'r', 'y', '.', 'o', 'r', 'g', '\0',
   /* "littleswitch.co.jp", true */ 'l', 'i', 't', 't', 'l', 'e', 's', 'w', 'i', 't', 'c', 'h', '.', 'c', 'o', '.', 'j', 'p', '\0',
@@ -7411,6 +7409,7 @@ static const char kSTSHostTable[] = {
   /* "ls-alarm.de", true */ 'l', 's', '-', 'a', 'l', 'a', 'r', 'm', '.', 'd', 'e', '\0',
   /* "ltba.org", true */ 'l', 't', 'b', 'a', '.', 'o', 'r', 'g', '\0',
   /* "ltn-tom-morel.fr", true */ 'l', 't', 'n', '-', 't', 'o', 'm', '-', 'm', 'o', 'r', 'e', 'l', '.', 'f', 'r', '\0',
+  /* "lubot.net", false */ 'l', 'u', 'b', 'o', 't', '.', 'n', 'e', 't', '\0',
   /* "lucasantarella.com", true */ 'l', 'u', 'c', 'a', 's', 'a', 'n', 't', 'a', 'r', 'e', 'l', 'l', 'a', '.', 'c', 'o', 'm', '\0',
   /* "lucaterzini.com", true */ 'l', 'u', 'c', 'a', 't', 'e', 'r', 'z', 'i', 'n', 'i', '.', 'c', 'o', 'm', '\0',
   /* "luce.life", true */ 'l', 'u', 'c', 'e', '.', 'l', 'i', 'f', 'e', '\0',
@@ -7473,7 +7472,6 @@ static const char kSTSHostTable[] = {
   /* "lymia.moe", true */ 'l', 'y', 'm', 'i', 'a', '.', 'm', 'o', 'e', '\0',
   /* "lynero.dk", true */ 'l', 'y', 'n', 'e', 'r', 'o', '.', 'd', 'k', '\0',
   /* "lyness.io", true */ 'l', 'y', 'n', 'e', 's', 's', '.', 'i', 'o', '\0',
-  /* "lynkos.com", true */ 'l', 'y', 'n', 'k', 'o', 's', '.', 'c', 'o', 'm', '\0',
   /* "lynthium.com", true */ 'l', 'y', 'n', 't', 'h', 'i', 'u', 'm', '.', 'c', 'o', 'm', '\0',
   /* "lynx.nl", true */ 'l', 'y', 'n', 'x', '.', 'n', 'l', '\0',
   /* "lynxbroker.de", true */ 'l', 'y', 'n', 'x', 'b', 'r', 'o', 'k', 'e', 'r', '.', 'd', 'e', '\0',
@@ -7501,7 +7499,6 @@ static const char kSTSHostTable[] = {
   /* "machbach.net", true */ 'm', 'a', 'c', 'h', 'b', 'a', 'c', 'h', '.', 'n', 'e', 't', '\0',
   /* "machtweb.de", true */ 'm', 'a', 'c', 'h', 't', 'w', 'e', 'b', '.', 'd', 'e', '\0',
   /* "macinyasha.net", true */ 'm', 'a', 'c', 'i', 'n', 'y', 'a', 's', 'h', 'a', '.', 'n', 'e', 't', '\0',
-  /* "macker.io", true */ 'm', 'a', 'c', 'k', 'e', 'r', '.', 'i', 'o', '\0',
   /* "maclemon.at", true */ 'm', 'a', 'c', 'l', 'e', 'm', 'o', 'n', '.', 'a', 't', '\0',
   /* "macleod.io", true */ 'm', 'a', 'c', 'l', 'e', 'o', 'd', '.', 'i', 'o', '\0',
   /* "macnemo.de", true */ 'm', 'a', 'c', 'n', 'e', 'm', 'o', '.', 'd', 'e', '\0',
@@ -7518,7 +7515,6 @@ static const char kSTSHostTable[] = {
   /* "madreacqua.org", true */ 'm', 'a', 'd', 'r', 'e', 'a', 'c', 'q', 'u', 'a', '.', 'o', 'r', 'g', '\0',
   /* "madtec.de", true */ 'm', 'a', 'd', 't', 'e', 'c', '.', 'd', 'e', '\0',
   /* "mae-berlinistanbul.com", true */ 'm', 'a', 'e', '-', 'b', 'e', 'r', 'l', 'i', 'n', 'i', 's', 't', 'a', 'n', 'b', 'u', 'l', '.', 'c', 'o', 'm', '\0',
-  /* "maelstrom.ninja", true */ 'm', 'a', 'e', 'l', 's', 't', 'r', 'o', 'm', '.', 'n', 'i', 'n', 'j', 'a', '\0',
   /* "maff.scot", false */ 'm', 'a', 'f', 'f', '.', 's', 'c', 'o', 't', '\0',
   /* "mafiaforum.de", true */ 'm', 'a', 'f', 'i', 'a', 'f', 'o', 'r', 'u', 'm', '.', 'd', 'e', '\0',
   /* "mafiasi.de", true */ 'm', 'a', 'f', 'i', 'a', 's', 'i', '.', 'd', 'e', '\0',
@@ -7569,6 +7565,7 @@ static const char kSTSHostTable[] = {
   /* "malaysian.dating", true */ 'm', 'a', 'l', 'a', 'y', 's', 'i', 'a', 'n', '.', 'd', 'a', 't', 'i', 'n', 'g', '\0',
   /* "malena.com.ua", true */ 'm', 'a', 'l', 'e', 'n', 'a', '.', 'c', 'o', 'm', '.', 'u', 'a', '\0',
   /* "malfait.nl", true */ 'm', 'a', 'l', 'f', 'a', 'i', 't', '.', 'n', 'l', '\0',
+  /* "malibubeachrecoverycenter.com", true */ 'm', 'a', 'l', 'i', 'b', 'u', 'b', 'e', 'a', 'c', 'h', 'r', 'e', 'c', 'o', 'v', 'e', 'r', 'y', 'c', 'e', 'n', 't', 'e', 'r', '.', 'c', 'o', 'm', '\0',
   /* "malinator.net", false */ 'm', 'a', 'l', 'i', 'n', 'a', 't', 'o', 'r', '.', 'n', 'e', 't', '\0',
   /* "malinheadview.ie", true */ 'm', 'a', 'l', 'i', 'n', 'h', 'e', 'a', 'd', 'v', 'i', 'e', 'w', '.', 'i', 'e', '\0',
   /* "maliskovik.si", true */ 'm', 'a', 'l', 'i', 's', 'k', 'o', 'v', 'i', 'k', '.', 's', 'i', '\0',
@@ -7716,7 +7713,6 @@ static const char kSTSHostTable[] = {
   /* "matrixcheats.net", true */ 'm', 'a', 't', 'r', 'i', 'x', 'c', 'h', 'e', 'a', 't', 's', '.', 'n', 'e', 't', '\0',
   /* "matt.tf", true */ 'm', 'a', 't', 't', '.', 't', 'f', '\0',
   /* "mattandreko.com", true */ 'm', 'a', 't', 't', 'a', 'n', 'd', 'r', 'e', 'k', 'o', '.', 'c', 'o', 'm', '\0',
-  /* "mattandyana.com", true */ 'm', 'a', 't', 't', 'a', 'n', 'd', 'y', 'a', 'n', 'a', '.', 'c', 'o', 'm', '\0',
   /* "matteomarescotti.it", true */ 'm', 'a', 't', 't', 'e', 'o', 'm', 'a', 'r', 'e', 's', 'c', 'o', 't', 't', 'i', '.', 'i', 't', '\0',
   /* "matterconcern.com", true */ 'm', 'a', 't', 't', 'e', 'r', 'c', 'o', 'n', 'c', 'e', 'r', 'n', '.', 'c', 'o', 'm', '\0',
   /* "matthecat.com", true */ 'm', 'a', 't', 't', 'h', 'e', 'c', 'a', 't', '.', 'c', 'o', 'm', '\0',
@@ -8046,7 +8042,6 @@ static const char kSTSHostTable[] = {
   /* "minhanossasenhora.com.br", true */ 'm', 'i', 'n', 'h', 'a', 'n', 'o', 's', 's', 'a', 's', 'e', 'n', 'h', 'o', 'r', 'a', '.', 'c', 'o', 'm', '.', 'b', 'r', '\0',
   /* "mini-piraten.de", true */ 'm', 'i', 'n', 'i', '-', 'p', 'i', 'r', 'a', 't', 'e', 'n', '.', 'd', 'e', '\0',
   /* "mini2.fi", true */ 'm', 'i', 'n', 'i', '2', '.', 'f', 'i', '\0',
-  /* "minikneet.com", true */ 'm', 'i', 'n', 'i', 'k', 'n', 'e', 'e', 't', '.', 'c', 'o', 'm', '\0',
   /* "minimvc.com", true */ 'm', 'i', 'n', 'i', 'm', 'v', 'c', '.', 'c', 'o', 'm', '\0',
   /* "minipainting.net", true */ 'm', 'i', 'n', 'i', 'p', 'a', 'i', 'n', 't', 'i', 'n', 'g', '.', 'n', 'e', 't', '\0',
   /* "minis-hip.de", true */ 'm', 'i', 'n', 'i', 's', '-', 'h', 'i', 'p', '.', 'd', 'e', '\0',
@@ -8084,6 +8079,7 @@ static const char kSTSHostTable[] = {
   /* "mistreaded.com", true */ 'm', 'i', 's', 't', 'r', 'e', 'a', 'd', 'e', 'd', '.', 'c', 'o', 'm', '\0',
   /* "misupport.dk", true */ 'm', 'i', 's', 'u', 'p', 'p', 'o', 'r', 't', '.', 'd', 'k', '\0',
   /* "mit-uns.org", true */ 'm', 'i', 't', '-', 'u', 'n', 's', '.', 'o', 'r', 'g', '\0',
+  /* "mita.me", true */ 'm', 'i', 't', 'a', '.', 'm', 'e', '\0',
   /* "mitarbeiter-pc.de", true */ 'm', 'i', 't', 'a', 'r', 'b', 'e', 'i', 't', 'e', 'r', '-', 'p', 'c', '.', 'd', 'e', '\0',
   /* "mitell.jp", false */ 'm', 'i', 't', 'e', 'l', 'l', '.', 'j', 'p', '\0',
   /* "mitnetz-gas.de", true */ 'm', 'i', 't', 'n', 'e', 't', 'z', '-', 'g', 'a', 's', '.', 'd', 'e', '\0',
@@ -8344,6 +8340,7 @@ static const char kSTSHostTable[] = {
   /* "mvno.io", true */ 'm', 'v', 'n', 'o', '.', 'i', 'o', '\0',
   /* "mwavuli.co.ke", true */ 'm', 'w', 'a', 'v', 'u', 'l', 'i', '.', 'c', 'o', '.', 'k', 'e', '\0',
   /* "mwba.org", true */ 'm', 'w', 'b', 'a', '.', 'o', 'r', 'g', '\0',
+  /* "mwe.st", true */ 'm', 'w', 'e', '.', 's', 't', '\0',
   /* "mx.search.yahoo.com", false */ 'm', 'x', '.', 's', 'e', 'a', 'r', 'c', 'h', '.', 'y', 'a', 'h', 'o', 'o', '.', 'c', 'o', 'm', '\0',
   /* "my-hps.de", true */ 'm', 'y', '-', 'h', 'p', 's', '.', 'd', 'e', '\0',
   /* "my-pawnshop.com.ua", false */ 'm', 'y', '-', 'p', 'a', 'w', 'n', 's', 'h', 'o', 'p', '.', 'c', 'o', 'm', '.', 'u', 'a', '\0',
@@ -8497,7 +8494,6 @@ static const char kSTSHostTable[] = {
   /* "natenom.name", true */ 'n', 'a', 't', 'e', 'n', 'o', 'm', '.', 'n', 'a', 'm', 'e', '\0',
   /* "nathan.io", true */ 'n', 'a', 't', 'h', 'a', 'n', '.', 'i', 'o', '\0',
   /* "nathankonopinski.com", true */ 'n', 'a', 't', 'h', 'a', 'n', 'k', 'o', 'n', 'o', 'p', 'i', 'n', 's', 'k', 'i', '.', 'c', 'o', 'm', '\0',
-  /* "nathanmfarrugia.com", true */ 'n', 'a', 't', 'h', 'a', 'n', 'm', 'f', 'a', 'r', 'r', 'u', 'g', 'i', 'a', '.', 'c', 'o', 'm', '\0',
   /* "nathansmetana.com", true */ 'n', 'a', 't', 'h', 'a', 'n', 's', 'm', 'e', 't', 'a', 'n', 'a', '.', 'c', 'o', 'm', '\0',
   /* "nationalcentereg.org", true */ 'n', 'a', 't', 'i', 'o', 'n', 'a', 'l', 'c', 'e', 'n', 't', 'e', 'r', 'e', 'g', '.', 'o', 'r', 'g', '\0',
   /* "nationalcrimecheck.com.au", true */ 'n', 'a', 't', 'i', 'o', 'n', 'a', 'l', 'c', 'r', 'i', 'm', 'e', 'c', 'h', 'e', 'c', 'k', '.', 'c', 'o', 'm', '.', 'a', 'u', '\0',
@@ -8559,7 +8555,6 @@ static const char kSTSHostTable[] = {
   /* "nekomimi.pl", true */ 'n', 'e', 'k', 'o', 'm', 'i', 'm', 'i', '.', 'p', 'l', '\0',
   /* "nekosc.com", true */ 'n', 'e', 'k', 'o', 's', 'c', '.', 'c', 'o', 'm', '\0',
   /* "nelhage.com", true */ 'n', 'e', 'l', 'h', 'a', 'g', 'e', '.', 'c', 'o', 'm', '\0',
-  /* "nemecl.eu", true */ 'n', 'e', 'm', 'e', 'c', 'l', '.', 'e', 'u', '\0',
   /* "nemo.run", true */ 'n', 'e', 'm', 'o', '.', 'r', 'u', 'n', '\0',
   /* "nemunai.re", true */ 'n', 'e', 'm', 'u', 'n', 'a', 'i', '.', 'r', 'e', '\0',
   /* "neo19.com", false */ 'n', 'e', 'o', '1', '9', '.', 'c', 'o', 'm', '\0',
@@ -8751,7 +8746,6 @@ static const char kSTSHostTable[] = {
   /* "niouininon.eu", true */ 'n', 'i', 'o', 'u', 'i', 'n', 'i', 'n', 'o', 'n', '.', 'e', 'u', '\0',
   /* "nippon-oku.com", true */ 'n', 'i', 'p', 'p', 'o', 'n', '-', 'o', 'k', 'u', '.', 'c', 'o', 'm', '\0',
   /* "nippon.fr", true */ 'n', 'i', 'p', 'p', 'o', 'n', '.', 'f', 'r', '\0',
-  /* "nirada.info", true */ 'n', 'i', 'r', 'a', 'd', 'a', '.', 'i', 'n', 'f', 'o', '\0',
   /* "nitrix.me", true */ 'n', 'i', 't', 'r', 'i', 'x', '.', 'm', 'e', '\0',
   /* "nitropur.com", true */ 'n', 'i', 't', 'r', 'o', 'p', 'u', 'r', '.', 'c', 'o', 'm', '\0',
   /* "nitropur.de", true */ 'n', 'i', 't', 'r', 'o', 'p', 'u', 'r', '.', 'd', 'e', '\0',
@@ -8841,7 +8835,6 @@ static const char kSTSHostTable[] = {
   /* "nowhere.dk", true */ 'n', 'o', 'w', 'h', 'e', 'r', 'e', '.', 'd', 'k', '\0',
   /* "nowlas.org", true */ 'n', 'o', 'w', 'l', 'a', 's', '.', 'o', 'r', 'g', '\0',
   /* "noxlogic.nl", true */ 'n', 'o', 'x', 'l', 'o', 'g', 'i', 'c', '.', 'n', 'l', '\0',
-  /* "nozoe.jp", true */ 'n', 'o', 'z', 'o', 'e', '.', 'j', 'p', '\0',
   /* "npath.de", true */ 'n', 'p', 'a', 't', 'h', '.', 'd', 'e', '\0',
   /* "npm.li", true */ 'n', 'p', 'm', '.', 'l', 'i', '\0',
   /* "npmcdn.com", true */ 'n', 'p', 'm', 'c', 'd', 'n', '.', 'c', 'o', 'm', '\0',
@@ -8886,6 +8879,7 @@ static const char kSTSHostTable[] = {
   /* "nuxer.fr", true */ 'n', 'u', 'x', 'e', 'r', '.', 'f', 'r', '\0',
   /* "nvlop.xyz", true */ 'n', 'v', 'l', 'o', 'p', '.', 'x', 'y', 'z', '\0',
   /* "nvr.bz", true */ 'n', 'v', 'r', '.', 'b', 'z', '\0',
+  /* "nwa.xyz", true */ 'n', 'w', 'a', '.', 'x', 'y', 'z', '\0',
   /* "nwerc.party", true */ 'n', 'w', 'e', 'r', 'c', '.', 'p', 'a', 'r', 't', 'y', '\0',
   /* "nwk1.com", true */ 'n', 'w', 'k', '1', '.', 'c', 'o', 'm', '\0',
   /* "nwra.com", true */ 'n', 'w', 'r', 'a', '.', 'c', 'o', 'm', '\0',
@@ -8987,7 +8981,6 @@ static const char kSTSHostTable[] = {
   /* "omnienviro.com", true */ 'o', 'm', 'n', 'i', 'e', 'n', 'v', 'i', 'r', 'o', '.', 'c', 'o', 'm', '\0',
   /* "omnienviro.com.au", true */ 'o', 'm', 'n', 'i', 'e', 'n', 'v', 'i', 'r', 'o', '.', 'c', 'o', 'm', '.', 'a', 'u', '\0',
   /* "omniverse.ru", true */ 'o', 'm', 'n', 'i', 'v', 'e', 'r', 's', 'e', '.', 'r', 'u', '\0',
-  /* "omskit.ru", true */ 'o', 'm', 's', 'k', 'i', 't', '.', 'r', 'u', '\0',
   /* "onaboat.se", true */ 'o', 'n', 'a', 'b', 'o', 'a', 't', '.', 's', 'e', '\0',
   /* "onarto.com", true */ 'o', 'n', 'a', 'r', 't', 'o', '.', 'c', 'o', 'm', '\0',
   /* "ondrej.org", true */ 'o', 'n', 'd', 'r', 'e', 'j', '.', 'o', 'r', 'g', '\0',
@@ -8998,7 +8991,6 @@ static const char kSTSHostTable[] = {
   /* "oneclickloan.com", true */ 'o', 'n', 'e', 'c', 'l', 'i', 'c', 'k', 'l', 'o', 'a', 'n', '.', 'c', 'o', 'm', '\0',
   /* "onecycling.my", true */ 'o', 'n', 'e', 'c', 'y', 'c', 'l', 'i', 'n', 'g', '.', 'm', 'y', '\0',
   /* "onecycling.world", true */ 'o', 'n', 'e', 'c', 'y', 'c', 'l', 'i', 'n', 'g', '.', 'w', 'o', 'r', 'l', 'd', '\0',
-  /* "onedot.nl", true */ 'o', 'n', 'e', 'd', 'o', 't', '.', 'n', 'l', '\0',
   /* "onedrive.com", true */ 'o', 'n', 'e', 'd', 'r', 'i', 'v', 'e', '.', 'c', 'o', 'm', '\0',
   /* "onedrive.live.com", false */ 'o', 'n', 'e', 'd', 'r', 'i', 'v', 'e', '.', 'l', 'i', 'v', 'e', '.', 'c', 'o', 'm', '\0',
   /* "onefour.ga", true */ 'o', 'n', 'e', 'f', 'o', 'u', 'r', '.', 'g', 'a', '\0',
@@ -9027,6 +9019,7 @@ static const char kSTSHostTable[] = {
   /* "onlinemarketingtraining.co.uk", true */ 'o', 'n', 'l', 'i', 'n', 'e', 'm', 'a', 'r', 'k', 'e', 't', 'i', 'n', 'g', 't', 'r', 'a', 'i', 'n', 'i', 'n', 'g', '.', 'c', 'o', '.', 'u', 'k', '\0',
   /* "onlinetravelmoney.co.uk", true */ 'o', 'n', 'l', 'i', 'n', 'e', 't', 'r', 'a', 'v', 'e', 'l', 'm', 'o', 'n', 'e', 'y', '.', 'c', 'o', '.', 'u', 'k', '\0',
   /* "only-roses.com", true */ 'o', 'n', 'l', 'y', '-', 'r', 'o', 's', 'e', 's', '.', 'c', 'o', 'm', '\0',
+  /* "onlyzero.net", true */ 'o', 'n', 'l', 'y', 'z', 'e', 'r', 'o', '.', 'n', 'e', 't', '\0',
   /* "onmaps.de", true */ 'o', 'n', 'm', 'a', 'p', 's', '.', 'd', 'e', '\0',
   /* "onmarketbookbuilds.com", true */ 'o', 'n', 'm', 'a', 'r', 'k', 'e', 't', 'b', 'o', 'o', 'k', 'b', 'u', 'i', 'l', 'd', 's', '.', 'c', 'o', 'm', '\0',
   /* "onmuvo.com", true */ 'o', 'n', 'm', 'u', 'v', 'o', '.', 'c', 'o', 'm', '\0',
@@ -9220,6 +9213,7 @@ static const char kSTSHostTable[] = {
   /* "papercrunch.io", true */ 'p', 'a', 'p', 'e', 'r', 'c', 'r', 'u', 'n', 'c', 'h', '.', 'i', 'o', '\0',
   /* "papermasters.com", true */ 'p', 'a', 'p', 'e', 'r', 'm', 'a', 's', 't', 'e', 'r', 's', '.', 'c', 'o', 'm', '\0',
   /* "paperturn.com", true */ 'p', 'a', 'p', 'e', 'r', 't', 'u', 'r', 'n', '.', 'c', 'o', 'm', '\0',
+  /* "paperwork.co.za", true */ 'p', 'a', 'p', 'e', 'r', 'w', 'o', 'r', 'k', '.', 'c', 'o', '.', 'z', 'a', '\0',
   /* "paraborsa.net", true */ 'p', 'a', 'r', 'a', 'b', 'o', 'r', 's', 'a', '.', 'n', 'e', 't', '\0',
   /* "paradiselost.com", true */ 'p', 'a', 'r', 'a', 'd', 'i', 's', 'e', 'l', 'o', 's', 't', '.', 'c', 'o', 'm', '\0',
   /* "paradoxdesigns.org", true */ 'p', 'a', 'r', 'a', 'd', 'o', 'x', 'd', 'e', 's', 'i', 'g', 'n', 's', '.', 'o', 'r', 'g', '\0',
@@ -9302,8 +9296,6 @@ static const char kSTSHostTable[] = {
   /* "paulwatabe.com", true */ 'p', 'a', 'u', 'l', 'w', 'a', 't', 'a', 'b', 'e', '.', 'c', 'o', 'm', '\0',
   /* "pauspam.net", true */ 'p', 'a', 'u', 's', 'p', 'a', 'm', '.', 'n', 'e', 't', '\0',
   /* "pavelrebrov.com", true */ 'p', 'a', 'v', 'e', 'l', 'r', 'e', 'b', 'r', 'o', 'v', '.', 'c', 'o', 'm', '\0',
-  /* "paw.cloud", true */ 'p', 'a', 'w', '.', 'c', 'l', 'o', 'u', 'd', '\0',
-  /* "paw.pt", true */ 'p', 'a', 'w', '.', 'p', 't', '\0',
   /* "pay.ubuntu.com", true */ 'p', 'a', 'y', '.', 'u', 'b', 'u', 'n', 't', 'u', '.', 'c', 'o', 'm', '\0',
   /* "payclixpayments.com", true */ 'p', 'a', 'y', 'c', 'l', 'i', 'x', 'p', 'a', 'y', 'm', 'e', 'n', 't', 's', '.', 'c', 'o', 'm', '\0',
   /* "payfreez.com", true */ 'p', 'a', 'y', 'f', 'r', 'e', 'e', 'z', '.', 'c', 'o', 'm', '\0',
@@ -9403,7 +9395,6 @@ static const char kSTSHostTable[] = {
   /* "perot.me", true */ 'p', 'e', 'r', 'o', 't', '.', 'm', 'e', '\0',
   /* "perspectivum.com", true */ 'p', 'e', 'r', 's', 'p', 'e', 'c', 't', 'i', 'v', 'u', 'm', '.', 'c', 'o', 'm', '\0',
   /* "persson.im", true */ 'p', 'e', 'r', 's', 's', 'o', 'n', '.', 'i', 'm', '\0',
-  /* "persson.me", true */ 'p', 'e', 'r', 's', 's', 'o', 'n', '.', 'm', 'e', '\0',
   /* "pestici.de", true */ 'p', 'e', 's', 't', 'i', 'c', 'i', '.', 'd', 'e', '\0',
   /* "pet-hotel-mura.net", true */ 'p', 'e', 't', '-', 'h', 'o', 't', 'e', 'l', '-', 'm', 'u', 'r', 'a', '.', 'n', 'e', 't', '\0',
   /* "petabits.de", true */ 'p', 'e', 't', 'a', 'b', 'i', 't', 's', '.', 'd', 'e', '\0',
@@ -9465,7 +9456,6 @@ static const char kSTSHostTable[] = {
   /* "philosopherswool.com", true */ 'p', 'h', 'i', 'l', 'o', 's', 'o', 'p', 'h', 'e', 'r', 's', 'w', 'o', 'o', 'l', '.', 'c', 'o', 'm', '\0',
   /* "philosophyguides.org", true */ 'p', 'h', 'i', 'l', 'o', 's', 'o', 'p', 'h', 'y', 'g', 'u', 'i', 'd', 'e', 's', '.', 'o', 'r', 'g', '\0',
   /* "philphonic.de", true */ 'p', 'h', 'i', 'l', 'p', 'h', 'o', 'n', 'i', 'c', '.', 'd', 'e', '\0',
-  /* "philpropertygroup.com", true */ 'p', 'h', 'i', 'l', 'p', 'r', 'o', 'p', 'e', 'r', 't', 'y', 'g', 'r', 'o', 'u', 'p', '.', 'c', 'o', 'm', '\0',
   /* "philsturgeon.uk", true */ 'p', 'h', 'i', 'l', 's', 't', 'u', 'r', 'g', 'e', 'o', 'n', '.', 'u', 'k', '\0',
   /* "phishingusertraining.com", true */ 'p', 'h', 'i', 's', 'h', 'i', 'n', 'g', 'u', 's', 'e', 'r', 't', 'r', 'a', 'i', 'n', 'i', 'n', 'g', '.', 'c', 'o', 'm', '\0',
   /* "phocean.net", true */ 'p', 'h', 'o', 'c', 'e', 'a', 'n', '.', 'n', 'e', 't', '\0',
@@ -9571,7 +9561,7 @@ static const char kSTSHostTable[] = {
   /* "pixel.facebook.com", false */ 'p', 'i', 'x', 'e', 'l', '.', 'f', 'a', 'c', 'e', 'b', 'o', 'o', 'k', '.', 'c', 'o', 'm', '\0',
   /* "pixel.google.com", true */ 'p', 'i', 'x', 'e', 'l', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'c', 'o', 'm', '\0',
   /* "pixelbash.de", true */ 'p', 'i', 'x', 'e', 'l', 'b', 'a', 's', 'h', '.', 'd', 'e', '\0',
-  /* "pixi.chat", true */ 'p', 'i', 'x', 'i', '.', 'c', 'h', 'a', 't', '\0',
+  /* "pixelminers.net", true */ 'p', 'i', 'x', 'e', 'l', 'm', 'i', 'n', 'e', 'r', 's', '.', 'n', 'e', 't', '\0',
   /* "pixipics.com", false */ 'p', 'i', 'x', 'i', 'p', 'i', 'c', 's', '.', 'c', 'o', 'm', '\0',
   /* "pixiv.moe", false */ 'p', 'i', 'x', 'i', 'v', '.', 'm', 'o', 'e', '\0',
   /* "piyabute.com", true */ 'p', 'i', 'y', 'a', 'b', 'u', 't', 'e', '.', 'c', 'o', 'm', '\0',
@@ -9674,6 +9664,7 @@ static const char kSTSHostTable[] = {
   /* "ponythread.com", false */ 'p', 'o', 'n', 'y', 't', 'h', 'r', 'e', 'a', 'd', '.', 'c', 'o', 'm', '\0',
   /* "poolvilla-margarita.net", false */ 'p', 'o', 'o', 'l', 'v', 'i', 'l', 'l', 'a', '-', 'm', 'a', 'r', 'g', 'a', 'r', 'i', 't', 'a', '.', 'n', 'e', 't', '\0',
   /* "poon.io", true */ 'p', 'o', 'o', 'n', '.', 'i', 'o', '\0',
+  /* "poris.web.id", true */ 'p', 'o', 'r', 'i', 's', '.', 'w', 'e', 'b', '.', 'i', 'd', '\0',
   /* "pornbay.org", true */ 'p', 'o', 'r', 'n', 'b', 'a', 'y', '.', 'o', 'r', 'g', '\0',
   /* "porno-gif.ru", true */ 'p', 'o', 'r', 'n', 'o', '-', 'g', 'i', 'f', '.', 'r', 'u', '\0',
   /* "pornstars.me", true */ 'p', 'o', 'r', 'n', 's', 't', 'a', 'r', 's', '.', 'm', 'e', '\0',
@@ -9697,6 +9688,7 @@ static const char kSTSHostTable[] = {
   /* "postbox.life", true */ 'p', 'o', 's', 't', 'b', 'o', 'x', '.', 'l', 'i', 'f', 'e', '\0',
   /* "postcodegarant.nl", true */ 'p', 'o', 's', 't', 'c', 'o', 'd', 'e', 'g', 'a', 'r', 'a', 'n', 't', '.', 'n', 'l', '\0',
   /* "posteo.de", false */ 'p', 'o', 's', 't', 'e', 'o', '.', 'd', 'e', '\0',
+  /* "posterspy.com", true */ 'p', 'o', 's', 't', 'e', 'r', 's', 'p', 'y', '.', 'c', 'o', 'm', '\0',
   /* "postfinance.ch", true */ 'p', 'o', 's', 't', 'f', 'i', 'n', 'a', 'n', 'c', 'e', '.', 'c', 'h', '\0',
   /* "postmatescode.com", true */ 'p', 'o', 's', 't', 'm', 'a', 't', 'e', 's', 'c', 'o', 'd', 'e', '.', 'c', 'o', 'm', '\0',
   /* "postn.eu", true */ 'p', 'o', 's', 't', 'n', '.', 'e', 'u', '\0',
@@ -9864,6 +9856,7 @@ static const char kSTSHostTable[] = {
   /* "prt.in.th", true */ 'p', 'r', 't', '.', 'i', 'n', '.', 't', 'h', '\0',
   /* "prtpe.com", true */ 'p', 'r', 't', 'p', 'e', '.', 'c', 'o', 'm', '\0',
   /* "prvikvadrat.hr", true */ 'p', 'r', 'v', 'i', 'k', 'v', 'a', 'd', 'r', 'a', 't', '.', 'h', 'r', '\0',
+  /* "prxio.date", true */ 'p', 'r', 'x', 'i', 'o', '.', 'd', 'a', 't', 'e', '\0',
   /* "przemas.pl", true */ 'p', 'r', 'z', 'e', 'm', 'a', 's', '.', 'p', 'l', '\0',
   /* "ps-provider.co.jp", true */ 'p', 's', '-', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '.', 'c', 'o', '.', 'j', 'p', '\0',
   /* "ps-w.ru", true */ 'p', 's', '-', 'w', '.', 'r', 'u', '\0',
@@ -9872,6 +9865,7 @@ static const char kSTSHostTable[] = {
   /* "psbarrett.com", true */ 'p', 's', 'b', 'a', 'r', 'r', 'e', 't', 't', '.', 'c', 'o', 'm', '\0',
   /* "psicologia.co.ve", true */ 'p', 's', 'i', 'c', 'o', 'l', 'o', 'g', 'i', 'a', '.', 'c', 'o', '.', 'v', 'e', '\0',
   /* "psncardplus.be", true */ 'p', 's', 'n', 'c', 'a', 'r', 'd', 'p', 'l', 'u', 's', '.', 'b', 'e', '\0',
+  /* "psncardplus.com", true */ 'p', 's', 'n', 'c', 'a', 'r', 'd', 'p', 'l', 'u', 's', '.', 'c', 'o', 'm', '\0',
   /* "psncardplus.dk", true */ 'p', 's', 'n', 'c', 'a', 'r', 'd', 'p', 'l', 'u', 's', '.', 'd', 'k', '\0',
   /* "psncardplus.nl", true */ 'p', 's', 'n', 'c', 'a', 'r', 'd', 'p', 'l', 'u', 's', '.', 'n', 'l', '\0',
   /* "psncardplus.se", true */ 'p', 's', 'n', 'c', 'a', 'r', 'd', 'p', 'l', 'u', 's', '.', 's', 'e', '\0',
@@ -10040,6 +10034,7 @@ static const char kSTSHostTable[] = {
   /* "r3s1stanc3.me", true */ 'r', '3', 's', '1', 's', 't', 'a', 'n', 'c', '3', '.', 'm', 'e', '\0',
   /* "r40.us", true */ 'r', '4', '0', '.', 'u', 's', '\0',
   /* "r6-team.ru", true */ 'r', '6', '-', 't', 'e', 'a', 'm', '.', 'r', 'u', '\0',
+  /* "r811.de", true */ 'r', '8', '1', '1', '.', 'd', 'e', '\0',
   /* "ra-micro-koeln.de", true */ 'r', 'a', '-', 'm', 'i', 'c', 'r', 'o', '-', 'k', 'o', 'e', 'l', 'n', '.', 'd', 'e', '\0',
   /* "ra-schaal.de", true */ 'r', 'a', '-', 's', 'c', 'h', 'a', 'a', 'l', '.', 'd', 'e', '\0',
   /* "ra4wvpn.com", true */ 'r', 'a', '4', 'w', 'v', 'p', 'n', '.', 'c', 'o', 'm', '\0',
@@ -10305,8 +10300,6 @@ static const char kSTSHostTable[] = {
   /* "rex.tc", true */ 'r', 'e', 'x', '.', 't', 'c', '\0',
   /* "rezept-planer.de", true */ 'r', 'e', 'z', 'e', 'p', 't', '-', 'p', 'l', 'a', 'n', 'e', 'r', '.', 'd', 'e', '\0',
   /* "rezexpert.com", true */ 'r', 'e', 'z', 'e', 'x', 'p', 'e', 'r', 't', '.', 'c', 'o', 'm', '\0',
-  /* "rezosup.net", true */ 'r', 'e', 'z', 'o', 's', 'u', 'p', '.', 'n', 'e', 't', '\0',
-  /* "rezosup.org", true */ 'r', 'e', 'z', 'o', 's', 'u', 'p', '.', 'o', 'r', 'g', '\0',
   /* "rezun.cloud", true */ 'r', 'e', 'z', 'u', 'n', '.', 'c', 'l', 'o', 'u', 'd', '\0',
   /* "rgservers.com", true */ 'r', 'g', 's', 'e', 'r', 'v', 'e', 'r', 's', '.', 'c', 'o', 'm', '\0',
   /* "rheinneckarmetal.com", true */ 'r', 'h', 'e', 'i', 'n', 'n', 'e', 'c', 'k', 'a', 'r', 'm', 'e', 't', 'a', 'l', '.', 'c', 'o', 'm', '\0',
@@ -10318,6 +10311,7 @@ static const char kSTSHostTable[] = {
   /* "rhodosdreef.nl", true */ 'r', 'h', 'o', 'd', 'o', 's', 'd', 'r', 'e', 'e', 'f', '.', 'n', 'l', '\0',
   /* "rhymix.org", true */ 'r', 'h', 'y', 'm', 'i', 'x', '.', 'o', 'r', 'g', '\0',
   /* "rhynl.io", true */ 'r', 'h', 'y', 'n', 'l', '.', 'i', 'o', '\0',
+  /* "riaucybersolution.net", true */ 'r', 'i', 'a', 'u', 'c', 'y', 'b', 'e', 'r', 's', 'o', 'l', 'u', 't', 'i', 'o', 'n', '.', 'n', 'e', 't', '\0',
   /* "ribs.com", true */ 'r', 'i', 'b', 's', '.', 'c', 'o', 'm', '\0',
   /* "ricardobalk.nl", true */ 'r', 'i', 'c', 'a', 'r', 'd', 'o', 'b', 'a', 'l', 'k', '.', 'n', 'l', '\0',
   /* "riccy.org", true */ 'r', 'i', 'c', 'c', 'y', '.', 'o', 'r', 'g', '\0',
@@ -10368,6 +10362,7 @@ static const char kSTSHostTable[] = {
   /* "ristorantefattoamano.eu", true */ 'r', 'i', 's', 't', 'o', 'r', 'a', 'n', 't', 'e', 'f', 'a', 't', 't', 'o', 'a', 'm', 'a', 'n', 'o', '.', 'e', 'u', '\0',
   /* "rithm.ch", true */ 'r', 'i', 't', 'h', 'm', '.', 'c', 'h', '\0',
   /* "rivastation.de", true */ 'r', 'i', 'v', 'a', 's', 't', 'a', 't', 'i', 'o', 'n', '.', 'd', 'e', '\0',
+  /* "rivermendhealthcenters.com", true */ 'r', 'i', 'v', 'e', 'r', 'm', 'e', 'n', 'd', 'h', 'e', 'a', 'l', 't', 'h', 'c', 'e', 'n', 't', 'e', 'r', 's', '.', 'c', 'o', 'm', '\0',
   /* "riversideauto.net", true */ 'r', 'i', 'v', 'e', 'r', 's', 'i', 'd', 'e', 'a', 'u', 't', 'o', '.', 'n', 'e', 't', '\0',
   /* "rivy.org", true */ 'r', 'i', 'v', 'y', '.', 'o', 'r', 'g', '\0',
   /* "rix.ninja", true */ 'r', 'i', 'x', '.', 'n', 'i', 'n', 'j', 'a', '\0',
@@ -10385,10 +10380,10 @@ static const char kSTSHostTable[] = {
   /* "ro.search.yahoo.com", false */ 'r', 'o', '.', 's', 'e', 'a', 'r', 'c', 'h', '.', 'y', 'a', 'h', 'o', 'o', '.', 'c', 'o', 'm', '\0',
   /* "roadfeast.com", true */ 'r', 'o', 'a', 'd', 'f', 'e', 'a', 's', 't', '.', 'c', 'o', 'm', '\0',
   /* "roave.com", true */ 'r', 'o', 'a', 'v', 'e', '.', 'c', 'o', 'm', '\0',
-  /* "robandjanine.com", true */ 'r', 'o', 'b', 'a', 'n', 'd', 'j', 'a', 'n', 'i', 'n', 'e', '.', 'c', 'o', 'm', '\0',
   /* "roberthurlbut.com", true */ 'r', 'o', 'b', 'e', 'r', 't', 'h', 'u', 'r', 'l', 'b', 'u', 't', '.', 'c', 'o', 'm', '\0',
   /* "robertkrueger.de", true */ 'r', 'o', 'b', 'e', 'r', 't', 'k', 'r', 'u', 'e', 'g', 'e', 'r', '.', 'd', 'e', '\0',
   /* "roberto-webhosting.nl", true */ 'r', 'o', 'b', 'e', 'r', 't', 'o', '-', 'w', 'e', 'b', 'h', 'o', 's', 't', 'i', 'n', 'g', '.', 'n', 'l', '\0',
+  /* "robertof.ovh", true */ 'r', 'o', 'b', 'e', 'r', 't', 'o', 'f', '.', 'o', 'v', 'h', '\0',
   /* "robhorstmanshof.nl", true */ 'r', 'o', 'b', 'h', 'o', 'r', 's', 't', 'm', 'a', 'n', 's', 'h', 'o', 'f', '.', 'n', 'l', '\0',
   /* "robi-net.it", true */ 'r', 'o', 'b', 'i', '-', 'n', 'e', 't', '.', 'i', 't', '\0',
   /* "robin.info", true */ 'r', 'o', 'b', 'i', 'n', '.', 'i', 'n', 'f', 'o', '\0',
@@ -10399,7 +10394,6 @@ static const char kSTSHostTable[] = {
   /* "robjager-fotografie.nl", true */ 'r', 'o', 'b', 'j', 'a', 'g', 'e', 'r', '-', 'f', 'o', 't', 'o', 'g', 'r', 'a', 'f', 'i', 'e', '.', 'n', 'l', '\0',
   /* "robodeidentidad.gov", true */ 'r', 'o', 'b', 'o', 'd', 'e', 'i', 'd', 'e', 'n', 't', 'i', 'd', 'a', 'd', '.', 'g', 'o', 'v', '\0',
   /* "robohash.org", true */ 'r', 'o', 'b', 'o', 'h', 'a', 's', 'h', '.', 'o', 'r', 'g', '\0',
-  /* "robspc.repair", true */ 'r', 'o', 'b', 's', 'p', 'c', '.', 'r', 'e', 'p', 'a', 'i', 'r', '\0',
   /* "robteix.com", true */ 'r', 'o', 'b', 't', 'e', 'i', 'x', '.', 'c', 'o', 'm', '\0',
   /* "robud.info", true */ 'r', 'o', 'b', 'u', 'd', '.', 'i', 'n', 'f', 'o', '\0',
   /* "rockcanyonbank.com", true */ 'r', 'o', 'c', 'k', 'c', 'a', 'n', 'y', 'o', 'n', 'b', 'a', 'n', 'k', '.', 'c', 'o', 'm', '\0',
@@ -10458,6 +10452,7 @@ static const char kSTSHostTable[] = {
   /* "roseitsolutions.co.uk", true */ 'r', 'o', 's', 'e', 'i', 't', 's', 'o', 'l', 'u', 't', 'i', 'o', 'n', 's', '.', 'c', 'o', '.', 'u', 'k', '\0',
   /* "rosemariefloydballet.com", true */ 'r', 'o', 's', 'e', 'm', 'a', 'r', 'i', 'e', 'f', 'l', 'o', 'y', 'd', 'b', 'a', 'l', 'l', 'e', 't', '.', 'c', 'o', 'm', '\0',
   /* "rosenkeller.org", true */ 'r', 'o', 's', 'e', 'n', 'k', 'e', 'l', 'l', 'e', 'r', '.', 'o', 'r', 'g', '\0',
+  /* "rosewoodranch.com", true */ 'r', 'o', 's', 'e', 'w', 'o', 'o', 'd', 'r', 'a', 'n', 'c', 'h', '.', 'c', 'o', 'm', '\0',
   /* "roslynpad.net", true */ 'r', 'o', 's', 'l', 'y', 'n', 'p', 'a', 'd', '.', 'n', 'e', 't', '\0',
   /* "rossen.be", true */ 'r', 'o', 's', 's', 'e', 'n', '.', 'b', 'e', '\0',
   /* "rosset.me", true */ 'r', 'o', 's', 's', 'e', 't', '.', 'm', 'e', '\0',
@@ -10715,7 +10710,6 @@ static const char kSTSHostTable[] = {
   /* "schachburg.de", true */ 's', 'c', 'h', 'a', 'c', 'h', 'b', 'u', 'r', 'g', '.', 'd', 'e', '\0',
   /* "schadegarant.net", true */ 's', 'c', 'h', 'a', 'd', 'e', 'g', 'a', 'r', 'a', 'n', 't', '.', 'n', 'e', 't', '\0',
   /* "schallert.com", false */ 's', 'c', 'h', 'a', 'l', 'l', 'e', 'r', 't', '.', 'c', 'o', 'm', '\0',
-  /* "schamlosharmlos.de", true */ 's', 'c', 'h', 'a', 'm', 'l', 'o', 's', 'h', 'a', 'r', 'm', 'l', 'o', 's', '.', 'd', 'e', '\0',
   /* "schawe.me", true */ 's', 'c', 'h', 'a', 'w', 'e', '.', 'm', 'e', '\0',
   /* "schd.io", true */ 's', 'c', 'h', 'd', '.', 'i', 'o', '\0',
   /* "scheidtweiler.de", true */ 's', 'c', 'h', 'e', 'i', 'd', 't', 'w', 'e', 'i', 'l', 'e', 'r', '.', 'd', 'e', '\0',
@@ -10796,9 +10790,7 @@ static const char kSTSHostTable[] = {
   /* "scrayos.net", true */ 's', 'c', 'r', 'a', 'y', 'o', 's', '.', 'n', 'e', 't', '\0',
   /* "screenlight.tv", true */ 's', 'c', 'r', 'e', 'e', 'n', 'l', 'i', 'g', 'h', 't', '.', 't', 'v', '\0',
   /* "screensaversplanet.com", true */ 's', 'c', 'r', 'e', 'e', 'n', 's', 'a', 'v', 'e', 'r', 's', 'p', 'l', 'a', 'n', 'e', 't', '.', 'c', 'o', 'm', '\0',
-  /* "scrion.com", true */ 's', 'c', 'r', 'i', 'o', 'n', '.', 'c', 'o', 'm', '\0',
   /* "script.google.com", true */ 's', 'c', 'r', 'i', 'p', 't', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'c', 'o', 'm', '\0',
-  /* "scriptjunkie.us", true */ 's', 'c', 'r', 'i', 'p', 't', 'j', 'u', 'n', 'k', 'i', 'e', '.', 'u', 's', '\0',
   /* "scrollstory.com", true */ 's', 'c', 'r', 'o', 'l', 'l', 's', 't', 'o', 'r', 'y', '.', 'c', 'o', 'm', '\0',
   /* "scrumstack.co.uk", true */ 's', 'c', 'r', 'u', 'm', 's', 't', 'a', 'c', 'k', '.', 'c', 'o', '.', 'u', 'k', '\0',
   /* "scs-simulatoren.de", true */ 's', 'c', 's', '-', 's', 'i', 'm', 'u', 'l', 'a', 't', 'o', 'r', 'e', 'n', '.', 'd', 'e', '\0',
@@ -10847,7 +10839,6 @@ static const char kSTSHostTable[] = {
   /* "secure.chat", true */ 's', 'e', 'c', 'u', 'r', 'e', '.', 'c', 'h', 'a', 't', '\0',
   /* "secure.co.hu", true */ 's', 'e', 'c', 'u', 'r', 'e', '.', 'c', 'o', '.', 'h', 'u', '\0',
   /* "secure.facebook.com", false */ 's', 'e', 'c', 'u', 'r', 'e', '.', 'f', 'a', 'c', 'e', 'b', 'o', 'o', 'k', '.', 'c', 'o', 'm', '\0',
-  /* "secure.link", true */ 's', 'e', 'c', 'u', 'r', 'e', '.', 'l', 'i', 'n', 'k', '\0',
   /* "securedevelop.net", true */ 's', 'e', 'c', 'u', 'r', 'e', 'd', 'e', 'v', 'e', 'l', 'o', 'p', '.', 'n', 'e', 't', '\0',
   /* "securedrop.org", false */ 's', 'e', 'c', 'u', 'r', 'e', 'd', 'r', 'o', 'p', '.', 'o', 'r', 'g', '\0',
   /* "secureesolutions.com", true */ 's', 'e', 'c', 'u', 'r', 'e', 'e', 's', 'o', 'l', 'u', 't', 'i', 'o', 'n', 's', '.', 'c', 'o', 'm', '\0',
@@ -11120,7 +11111,6 @@ static const char kSTSHostTable[] = {
   /* "silvergoldbull.com", true */ 's', 'i', 'l', 'v', 'e', 'r', 'g', 'o', 'l', 'd', 'b', 'u', 'l', 'l', '.', 'c', 'o', 'm', '\0',
   /* "silvergoldbull.de", true */ 's', 'i', 'l', 'v', 'e', 'r', 'g', 'o', 'l', 'd', 'b', 'u', 'l', 'l', '.', 'd', 'e', '\0',
   /* "silvergoldbull.kr", true */ 's', 'i', 'l', 'v', 'e', 'r', 'g', 'o', 'l', 'd', 'b', 'u', 'l', 'l', '.', 'k', 'r', '\0',
-  /* "silverhome.ninja", false */ 's', 'i', 'l', 'v', 'e', 'r', 'h', 'o', 'm', 'e', '.', 'n', 'i', 'n', 'j', 'a', '\0',
   /* "silvistefi.com", true */ 's', 'i', 'l', 'v', 'i', 's', 't', 'e', 'f', 'i', '.', 'c', 'o', 'm', '\0',
   /* "simbihaiti.com", false */ 's', 'i', 'm', 'b', 'i', 'h', 'a', 'i', 't', 'i', '.', 'c', 'o', 'm', '\0',
   /* "simbolo.co.uk", false */ 's', 'i', 'm', 'b', 'o', 'l', 'o', '.', 'c', 'o', '.', 'u', 'k', '\0',
@@ -11453,6 +11443,7 @@ static const char kSTSHostTable[] = {
   /* "soundhunter.xyz", true */ 's', 'o', 'u', 'n', 'd', 'h', 'u', 'n', 't', 'e', 'r', '.', 'x', 'y', 'z', '\0',
   /* "soundtalks.be", true */ 's', 'o', 'u', 'n', 'd', 't', 'a', 'l', 'k', 's', '.', 'b', 'e', '\0',
   /* "soundtalks.com", true */ 's', 'o', 'u', 'n', 'd', 't', 'a', 'l', 'k', 's', '.', 'c', 'o', 'm', '\0',
+  /* "sour.is", true */ 's', 'o', 'u', 'r', '.', 'i', 's', '\0',
   /* "sourcebox.be", true */ 's', 'o', 'u', 'r', 'c', 'e', 'b', 'o', 'x', '.', 'b', 'e', '\0',
   /* "sourcecode.love", true */ 's', 'o', 'u', 'r', 'c', 'e', 'c', 'o', 'd', 'e', '.', 'l', 'o', 'v', 'e', '\0',
   /* "sourcely.net", true */ 's', 'o', 'u', 'r', 'c', 'e', 'l', 'y', '.', 'n', 'e', 't', '\0',
@@ -11486,7 +11477,6 @@ static const char kSTSHostTable[] = {
   /* "spectrosoftware.de", true */ 's', 'p', 'e', 'c', 't', 'r', 'o', 's', 'o', 'f', 't', 'w', 'a', 'r', 'e', '.', 'd', 'e', '\0',
   /* "spedplus.com.br", false */ 's', 'p', 'e', 'd', 'p', 'l', 'u', 's', '.', 'c', 'o', 'm', '.', 'b', 'r', '\0',
   /* "speeddate.it", false */ 's', 'p', 'e', 'e', 'd', 'd', 'a', 't', 'e', '.', 'i', 't', '\0',
-  /* "speedy.lt", true */ 's', 'p', 'e', 'e', 'd', 'y', '.', 'l', 't', '\0',
   /* "speedyprep.com", true */ 's', 'p', 'e', 'e', 'd', 'y', 'p', 'r', 'e', 'p', '.', 'c', 'o', 'm', '\0',
   /* "speich.net", true */ 's', 'p', 'e', 'i', 'c', 'h', '.', 'n', 'e', 't', '\0',
   /* "spenglerei-shop.de", true */ 's', 'p', 'e', 'n', 'g', 'l', 'e', 'r', 'e', 'i', '-', 's', 'h', 'o', 'p', '.', 'd', 'e', '\0',
@@ -12030,6 +12020,7 @@ static const char kSTSHostTable[] = {
   /* "team-teasers.com", true */ 't', 'e', 'a', 'm', '-', 't', 'e', 'a', 's', 'e', 'r', 's', '.', 'c', 'o', 'm', '\0',
   /* "team3482.com", true */ 't', 'e', 'a', 'm', '3', '4', '8', '2', '.', 'c', 'o', 'm', '\0',
   /* "teambeoplay.co.uk", true */ 't', 'e', 'a', 'm', 'b', 'e', 'o', 'p', 'l', 'a', 'y', '.', 'c', 'o', '.', 'u', 'k', '\0',
+  /* "teamblueridge.org", true */ 't', 'e', 'a', 'm', 'b', 'l', 'u', 'e', 'r', 'i', 'd', 'g', 'e', '.', 'o', 'r', 'g', '\0',
   /* "teamdaylo.xyz", true */ 't', 'e', 'a', 'm', 'd', 'a', 'y', 'l', 'o', '.', 'x', 'y', 'z', '\0',
   /* "teamhood.io", true */ 't', 'e', 'a', 'm', 'h', 'o', 'o', 'd', '.', 'i', 'o', '\0',
   /* "teamnetsol.com", true */ 't', 'e', 'a', 'm', 'n', 'e', 't', 's', 'o', 'l', '.', 'c', 'o', 'm', '\0',
@@ -12040,7 +12031,6 @@ static const char kSTSHostTable[] = {
   /* "teamtouring.net", true */ 't', 'e', 'a', 'm', 't', 'o', 'u', 'r', 'i', 'n', 'g', '.', 'n', 'e', 't', '\0',
   /* "teamtrack.uk", true */ 't', 'e', 'a', 'm', 't', 'r', 'a', 'c', 'k', '.', 'u', 'k', '\0',
   /* "teamupturn.com", true */ 't', 'e', 'a', 'm', 'u', 'p', 't', 'u', 'r', 'n', '.', 'c', 'o', 'm', '\0',
-  /* "teamx-gaming.de", true */ 't', 'e', 'a', 'm', 'x', '-', 'g', 'a', 'm', 'i', 'n', 'g', '.', 'd', 'e', '\0',
   /* "teasenetwork.com", true */ 't', 'e', 'a', 's', 'e', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'c', 'o', 'm', '\0',
   /* "tecart-cloud.de", true */ 't', 'e', 'c', 'a', 'r', 't', '-', 'c', 'l', 'o', 'u', 'd', '.', 'd', 'e', '\0',
   /* "tecart-system.de", true */ 't', 'e', 'c', 'a', 'r', 't', '-', 's', 'y', 's', 't', 'e', 'm', '.', 'd', 'e', '\0',
@@ -12083,6 +12073,7 @@ static const char kSTSHostTable[] = {
   /* "tege-elektronik.hu", true */ 't', 'e', 'g', 'e', '-', 'e', 'l', 'e', 'k', 't', 'r', 'o', 'n', 'i', 'k', '.', 'h', 'u', '\0',
   /* "tehotuotanto.net", true */ 't', 'e', 'h', 'o', 't', 'u', 'o', 't', 'a', 'n', 't', 'o', '.', 'n', 'e', 't', '\0',
   /* "tehrabbitt.com", false */ 't', 'e', 'h', 'r', 'a', 'b', 'b', 'i', 't', 't', '.', 'c', 'o', 'm', '\0',
+  /* "teknologi.or.id", true */ 't', 'e', 'k', 'n', 'o', 'l', 'o', 'g', 'i', '.', 'o', 'r', '.', 'i', 'd', '\0',
   /* "tektoria.de", false */ 't', 'e', 'k', 't', 'o', 'r', 'i', 'a', '.', 'd', 'e', '\0',
   /* "tel-dithmarschen.de", true */ 't', 'e', 'l', '-', 'd', 'i', 't', 'h', 'm', 'a', 'r', 's', 'c', 'h', 'e', 'n', '.', 'd', 'e', '\0',
   /* "telefisk.org", true */ 't', 'e', 'l', 'e', 'f', 'i', 's', 'k', '.', 'o', 'r', 'g', '\0',
@@ -12243,6 +12234,7 @@ static const char kSTSHostTable[] = {
   /* "thenib.com", true */ 't', 'h', 'e', 'n', 'i', 'b', '.', 'c', 'o', 'm', '\0',
   /* "thenocman.com", true */ 't', 'h', 'e', 'n', 'o', 'c', 'm', 'a', 'n', '.', 'c', 'o', 'm', '\0',
   /* "thenorthschool.org.uk", true */ 't', 'h', 'e', 'n', 'o', 'r', 't', 'h', 's', 'c', 'h', 'o', 'o', 'l', '.', 'o', 'r', 'g', '.', 'u', 'k', '\0',
+  /* "theojones.name", true */ 't', 'h', 'e', 'o', 'j', 'o', 'n', 'e', 's', '.', 'n', 'a', 'm', 'e', '\0',
   /* "thepasteb.in", true */ 't', 'h', 'e', 'p', 'a', 's', 't', 'e', 'b', '.', 'i', 'n', '\0',
   /* "thepaymentscompany.com", true */ 't', 'h', 'e', 'p', 'a', 'y', 'm', 'e', 'n', 't', 's', 'c', 'o', 'm', 'p', 'a', 'n', 'y', '.', 'c', 'o', 'm', '\0',
   /* "thepb.in", true */ 't', 'h', 'e', 'p', 'b', '.', 'i', 'n', '\0',
@@ -12329,10 +12321,12 @@ static const char kSTSHostTable[] = {
   /* "throughthelookingglasslens.co.uk", true */ 't', 'h', 'r', 'o', 'u', 'g', 'h', 't', 'h', 'e', 'l', 'o', 'o', 'k', 'i', 'n', 'g', 'g', 'l', 'a', 's', 's', 'l', 'e', 'n', 's', '.', 'c', 'o', '.', 'u', 'k', '\0',
   /* "throwaway.link", true */ 't', 'h', 'r', 'o', 'w', 'a', 'w', 'a', 'y', '.', 'l', 'i', 'n', 'k', '\0',
   /* "throwpass.com", true */ 't', 'h', 'r', 'o', 'w', 'p', 'a', 's', 's', '.', 'c', 'o', 'm', '\0',
+  /* "thrx.net", true */ 't', 'h', 'r', 'x', '.', 'n', 'e', 't', '\0',
   /* "thues.eu", true */ 't', 'h', 'u', 'e', 's', '.', 'e', 'u', '\0',
   /* "thunderfox.nl", true */ 't', 'h', 'u', 'n', 'd', 'e', 'r', 'f', 'o', 'x', '.', 'n', 'l', '\0',
   /* "thundr.eu", true */ 't', 'h', 'u', 'n', 'd', 'r', '.', 'e', 'u', '\0',
   /* "thusoy.com", true */ 't', 'h', 'u', 's', 'o', 'y', '.', 'c', 'o', 'm', '\0',
+  /* "thyngster.com", false */ 't', 'h', 'y', 'n', 'g', 's', 't', 'e', 'r', '.', 'c', 'o', 'm', '\0',
   /* "thynx.io", true */ 't', 'h', 'y', 'n', 'x', '.', 'i', 'o', '\0',
   /* "ti-pla.net", true */ 't', 'i', '-', 'p', 'l', 'a', '.', 'n', 'e', 't', '\0',
   /* "ti.blog.br", true */ 't', 'i', '.', 'b', 'l', 'o', 'g', '.', 'b', 'r', '\0',
@@ -12356,6 +12350,7 @@ static const char kSTSHostTable[] = {
   /* "tigerchef.com", true */ 't', 'i', 'g', 'e', 'r', 'c', 'h', 'e', 'f', '.', 'c', 'o', 'm', '\0',
   /* "tigerdile.com", true */ 't', 'i', 'g', 'e', 'r', 'd', 'i', 'l', 'e', '.', 'c', 'o', 'm', '\0',
   /* "tilikum.io", true */ 't', 'i', 'l', 'i', 'k', 'u', 'm', '.', 'i', 'o', '\0',
+  /* "tilkah.com.au", true */ 't', 'i', 'l', 'k', 'a', 'h', '.', 'c', 'o', 'm', '.', 'a', 'u', '\0',
   /* "tillseasyscore.com", true */ 't', 'i', 'l', 'l', 's', 'e', 'a', 's', 'y', 's', 'c', 'o', 'r', 'e', '.', 'c', 'o', 'm', '\0',
   /* "timbuktutimber.com", true */ 't', 'i', 'm', 'b', 'u', 'k', 't', 'u', 't', 'i', 'm', 'b', 'e', 'r', '.', 'c', 'o', 'm', '\0',
   /* "timdebruijn.nl", true */ 't', 'i', 'm', 'd', 'e', 'b', 'r', 'u', 'i', 'j', 'n', '.', 'n', 'l', '\0',
@@ -12417,7 +12412,6 @@ static const char kSTSHostTable[] = {
   /* "tno.io", true */ 't', 'n', 'o', '.', 'i', 'o', '\0',
   /* "tny.link", true */ 't', 'n', 'y', '.', 'l', 'i', 'n', 'k', '\0',
   /* "toast.al", true */ 't', 'o', 'a', 's', 't', '.', 'a', 'l', '\0',
-  /* "tobi-mayer.de", true */ 't', 'o', 'b', 'i', '-', 'm', 'a', 'y', 'e', 'r', '.', 'd', 'e', '\0',
   /* "tobias-kluge.de", true */ 't', 'o', 'b', 'i', 'a', 's', '-', 'k', 'l', 'u', 'g', 'e', '.', 'd', 'e', '\0',
   /* "tobias-picha.de", true */ 't', 'o', 'b', 'i', 'a', 's', '-', 'p', 'i', 'c', 'h', 'a', '.', 'd', 'e', '\0',
   /* "tobias-weidhase.de", true */ 't', 'o', 'b', 'i', 'a', 's', '-', 'w', 'e', 'i', 'd', 'h', 'a', 's', 'e', '.', 'd', 'e', '\0',
@@ -12460,7 +12454,9 @@ static const char kSTSHostTable[] = {
   /* "tomcort.com", true */ 't', 'o', 'm', 'c', 'o', 'r', 't', '.', 'c', 'o', 'm', '\0',
   /* "tomend.es", true */ 't', 'o', 'm', 'e', 'n', 'd', '.', 'e', 's', '\0',
   /* "tomfisher.eu", true */ 't', 'o', 'm', 'f', 'i', 's', 'h', 'e', 'r', '.', 'e', 'u', '\0',
+  /* "tomli.me", true */ 't', 'o', 'm', 'l', 'i', '.', 'm', 'e', '\0',
   /* "tomm.yt", true */ 't', 'o', 'm', 'm', '.', 'y', 't', '\0',
+  /* "tommyads.com", true */ 't', 'o', 'm', 'm', 'y', 'a', 'd', 's', '.', 'c', 'o', 'm', '\0',
   /* "tomo.gr", false */ 't', 'o', 'm', 'o', '.', 'g', 'r', '\0',
   /* "tomrei.com", true */ 't', 'o', 'm', 'r', 'e', 'i', '.', 'c', 'o', 'm', '\0',
   /* "tomrichards.net", true */ 't', 'o', 'm', 'r', 'i', 'c', 'h', 'a', 'r', 'd', 's', '.', 'n', 'e', 't', '\0',
@@ -12768,7 +12764,6 @@ static const char kSTSHostTable[] = {
   /* "typeria.net", true */ 't', 'y', 'p', 'e', 'r', 'i', 'a', '.', 'n', 'e', 't', '\0',
   /* "typewolf.com", true */ 't', 'y', 'p', 'e', 'w', 'o', 'l', 'f', '.', 'c', 'o', 'm', '\0',
   /* "typing.com", true */ 't', 'y', 'p', 'i', 'n', 'g', '.', 'c', 'o', 'm', '\0',
-  /* "typingrevolution.com", true */ 't', 'y', 'p', 'i', 'n', 'g', 'r', 'e', 'v', 'o', 'l', 'u', 't', 'i', 'o', 'n', '.', 'c', 'o', 'm', '\0',
   /* "typo3.com", true */ 't', 'y', 'p', 'o', '3', '.', 'c', 'o', 'm', '\0',
   /* "tysye.ca", true */ 't', 'y', 's', 'y', 'e', '.', 'c', 'a', '\0',
   /* "tzwe.com", true */ 't', 'z', 'w', 'e', '.', 'c', 'o', 'm', '\0',
@@ -12779,6 +12774,7 @@ static const char kSTSHostTable[] = {
   /* "uangteman.com", true */ 'u', 'a', 'n', 'g', 't', 'e', 'm', 'a', 'n', '.', 'c', 'o', 'm', '\0',
   /* "uasmi.com", true */ 'u', 'a', 's', 'm', 'i', '.', 'c', 'o', 'm', '\0',
   /* "uat-activesg.com", true */ 'u', 'a', 't', '-', 'a', 'c', 't', 'i', 'v', 'e', 's', 'g', '.', 'c', 'o', 'm', '\0',
+  /* "ub3rk1tten.com", false */ 'u', 'b', '3', 'r', 'k', '1', 't', 't', 'e', 'n', '.', 'c', 'o', 'm', '\0',
   /* "ubanquity.com", true */ 'u', 'b', 'a', 'n', 'q', 'u', 'i', 't', 'y', '.', 'c', 'o', 'm', '\0',
   /* "uber.com.au", true */ 'u', 'b', 'e', 'r', '.', 'c', 'o', 'm', '.', 'a', 'u', '\0',
   /* "uberboxen.net", true */ 'u', 'b', 'e', 'r', 'b', 'o', 'x', 'e', 'n', '.', 'n', 'e', 't', '\0',
@@ -13299,11 +13295,9 @@ static const char kSTSHostTable[] = {
   /* "waterfedpole.com", true */ 'w', 'a', 't', 'e', 'r', 'f', 'e', 'd', 'p', 'o', 'l', 'e', '.', 'c', 'o', 'm', '\0',
   /* "waterforlife.net.au", true */ 'w', 'a', 't', 'e', 'r', 'f', 'o', 'r', 'l', 'i', 'f', 'e', '.', 'n', 'e', 't', '.', 'a', 'u', '\0',
   /* "watersb.org", true */ 'w', 'a', 't', 'e', 'r', 's', 'b', '.', 'o', 'r', 'g', '\0',
-  /* "watertrails.io", true */ 'w', 'a', 't', 'e', 'r', 't', 'r', 'a', 'i', 'l', 's', '.', 'i', 'o', '\0',
   /* "wavesboardshop.com", true */ 'w', 'a', 'v', 'e', 's', 'b', 'o', 'a', 'r', 'd', 's', 'h', 'o', 'p', '.', 'c', 'o', 'm', '\0',
   /* "wawak.pl", true */ 'w', 'a', 'w', 'a', 'k', '.', 'p', 'l', '\0',
   /* "waylaydesign.com", true */ 'w', 'a', 'y', 'l', 'a', 'y', 'd', 'e', 's', 'i', 'g', 'n', '.', 'c', 'o', 'm', '\0',
-  /* "wayne.cloud", true */ 'w', 'a', 'y', 'n', 'e', '.', 'c', 'l', 'o', 'u', 'd', '\0',
   /* "wayohoo.com", true */ 'w', 'a', 'y', 'o', 'h', 'o', 'o', '.', 'c', 'o', 'm', '\0',
   /* "wayohoo.net", true */ 'w', 'a', 'y', 'o', 'h', 'o', 'o', '.', 'n', 'e', 't', '\0',
   /* "waze.com", true */ 'w', 'a', 'z', 'e', '.', 'c', 'o', 'm', '\0',
@@ -13419,6 +13413,7 @@ static const char kSTSHostTable[] = {
   /* "welteneroberer.de", true */ 'w', 'e', 'l', 't', 'e', 'n', 'e', 'r', 'o', 'b', 'e', 'r', 'e', 'r', '.', 'd', 'e', '\0',
   /* "weltengilde.de", true */ 'w', 'e', 'l', 't', 'e', 'n', 'g', 'i', 'l', 'd', 'e', '.', 'd', 'e', '\0',
   /* "weltenhueter.de", true */ 'w', 'e', 'l', 't', 'e', 'n', 'h', 'u', 'e', 't', 'e', 'r', '.', 'd', 'e', '\0',
+  /* "weltverschwoerung.de", true */ 'w', 'e', 'l', 't', 'v', 'e', 'r', 's', 'c', 'h', 'w', 'o', 'e', 'r', 'u', 'n', 'g', '.', 'd', 'e', '\0',
   /* "wemakemenus.com", true */ 'w', 'e', 'm', 'a', 'k', 'e', 'm', 'e', 'n', 'u', 's', '.', 'c', 'o', 'm', '\0',
   /* "wenjs.me", true */ 'w', 'e', 'n', 'j', 's', '.', 'm', 'e', '\0',
   /* "wepay.com", false */ 'w', 'e', 'p', 'a', 'y', '.', 'c', 'o', 'm', '\0',
@@ -13616,6 +13611,7 @@ static const char kSTSHostTable[] = {
   /* "woodlandschurch.net", true */ 'w', 'o', 'o', 'd', 'l', 'a', 'n', 'd', 's', 'c', 'h', 'u', 'r', 'c', 'h', '.', 'n', 'e', 't', '\0',
   /* "woodlandsmetro.church", true */ 'w', 'o', 'o', 'd', 'l', 'a', 'n', 'd', 's', 'm', 'e', 't', 'r', 'o', '.', 'c', 'h', 'u', 'r', 'c', 'h', '\0',
   /* "woodmafia.com.au", true */ 'w', 'o', 'o', 'd', 'm', 'a', 'f', 'i', 'a', '.', 'c', 'o', 'm', '.', 'a', 'u', '\0',
+  /* "woodomat.com", true */ 'w', 'o', 'o', 'd', 'o', 'm', 'a', 't', '.', 'c', 'o', 'm', '\0',
   /* "woodsidepottery.ca", true */ 'w', 'o', 'o', 'd', 's', 'i', 'd', 'e', 'p', 'o', 't', 't', 'e', 'r', 'y', '.', 'c', 'a', '\0',
   /* "woohooyeah.nl", true */ 'w', 'o', 'o', 'h', 'o', 'o', 'y', 'e', 'a', 'h', '.', 'n', 'l', '\0',
   /* "wootton95.com", true */ 'w', 'o', 'o', 't', 't', 'o', 'n', '9', '5', '.', 'c', 'o', 'm', '\0',
@@ -13626,6 +13622,7 @@ static const char kSTSHostTable[] = {
   /* "wordsmart.it", true */ 'w', 'o', 'r', 'd', 's', 'm', 'a', 'r', 't', '.', 'i', 't', '\0',
   /* "wordxtra.net", true */ 'w', 'o', 'r', 'd', 'x', 't', 'r', 'a', '.', 'n', 'e', 't', '\0',
   /* "work-and-jockel.de", true */ 'w', 'o', 'r', 'k', '-', 'a', 'n', 'd', '-', 'j', 'o', 'c', 'k', 'e', 'l', '.', 'd', 'e', '\0',
+  /* "workingclassmedia.com", true */ 'w', 'o', 'r', 'k', 'i', 'n', 'g', 'c', 'l', 'a', 's', 's', 'm', 'e', 'd', 'i', 'a', '.', 'c', 'o', 'm', '\0',
   /* "workray.com", true */ 'w', 'o', 'r', 'k', 'r', 'a', 'y', '.', 'c', 'o', 'm', '\0',
   /* "works-ginan.jp", true */ 'w', 'o', 'r', 'k', 's', '-', 'g', 'i', 'n', 'a', 'n', '.', 'j', 'p', '\0',
   /* "world-in-my-eyes.com", true */ 'w', 'o', 'r', 'l', 'd', '-', 'i', 'n', '-', 'm', 'y', '-', 'e', 'y', 'e', 's', '.', 'c', 'o', 'm', '\0',
@@ -13695,6 +13692,7 @@ static const char kSTSHostTable[] = {
   /* "www.airbnb.com", true */ 'w', 'w', 'w', '.', 'a', 'i', 'r', 'b', 'n', 'b', '.', 'c', 'o', 'm', '\0',
   /* "www.amazon.ca", true */ 'w', 'w', 'w', '.', 'a', 'm', 'a', 'z', 'o', 'n', '.', 'c', 'a', '\0',
   /* "www.amazon.cn", true */ 'w', 'w', 'w', '.', 'a', 'm', 'a', 'z', 'o', 'n', '.', 'c', 'n', '\0',
+  /* "www.amazon.co.jp", true */ 'w', 'w', 'w', '.', 'a', 'm', 'a', 'z', 'o', 'n', '.', 'c', 'o', '.', 'j', 'p', '\0',
   /* "www.amazon.co.uk", true */ 'w', 'w', 'w', '.', 'a', 'm', 'a', 'z', 'o', 'n', '.', 'c', 'o', '.', 'u', 'k', '\0',
   /* "www.amazon.com", true */ 'w', 'w', 'w', '.', 'a', 'm', 'a', 'z', 'o', 'n', '.', 'c', 'o', 'm', '\0',
   /* "www.amazon.com.au", true */ 'w', 'w', 'w', '.', 'a', 'm', 'a', 'z', 'o', 'n', '.', 'c', 'o', 'm', '.', 'a', 'u', '\0',
@@ -13845,7 +13843,6 @@ static const char kSTSHostTable[] = {
   /* "xn--knstler-n2a.tips", false */ 'x', 'n', '-', '-', 'k', 'n', 's', 't', 'l', 'e', 'r', '-', 'n', '2', 'a', '.', 't', 'i', 'p', 's', '\0',
   /* "xn--mentaltraining-fr-musiker-uwc.ch", true */ 'x', 'n', '-', '-', 'm', 'e', 'n', 't', 'a', 'l', 't', 'r', 'a', 'i', 'n', 'i', 'n', 'g', '-', 'f', 'r', '-', 'm', 'u', 's', 'i', 'k', 'e', 'r', '-', 'u', 'w', 'c', '.', 'c', 'h', '\0',
   /* "xn--pbt947am3ab71g.com", true */ 'x', 'n', '-', '-', 'p', 'b', 't', '9', '4', '7', 'a', 'm', '3', 'a', 'b', '7', '1', 'g', '.', 'c', 'o', 'm', '\0',
-  /* "xn--pq1a637b.xn--6qq986b3xl", true */ 'x', 'n', '-', '-', 'p', 'q', '1', 'a', '6', '3', '7', 'b', '.', 'x', 'n', '-', '-', '6', 'q', 'q', '9', '8', '6', 'b', '3', 'x', 'l', '\0',
   /* "xn--qckss0j.tk", true */ 'x', 'n', '-', '-', 'q', 'c', 'k', 's', 's', '0', 'j', '.', 't', 'k', '\0',
   /* "xn--rt-cja.eu", true */ 'x', 'n', '-', '-', 'r', 't', '-', 'c', 'j', 'a', '.', 'e', 'u', '\0',
   /* "xn--ruanmller-u9a.com", true */ 'x', 'n', '-', '-', 'r', 'u', 'a', 'n', 'm', 'l', 'l', 'e', 'r', '-', 'u', '9', 'a', '.', 'c', 'o', 'm', '\0',
@@ -13887,6 +13884,7 @@ static const char kSTSHostTable[] = {
   /* "xwaretech.info", true */ 'x', 'w', 'a', 'r', 'e', 't', 'e', 'c', 'h', '.', 'i', 'n', 'f', 'o', '\0',
   /* "xyfun.net", true */ 'x', 'y', 'f', 'u', 'n', '.', 'n', 'e', 't', '\0',
   /* "xynta.ch", true */ 'x', 'y', 'n', 't', 'a', '.', 'c', 'h', '\0',
+  /* "y-s.pw", true */ 'y', '-', 's', '.', 'p', 'w', '\0',
   /* "yachts-magazine.com", true */ 'y', 'a', 'c', 'h', 't', 's', '-', 'm', 'a', 'g', 'a', 'z', 'i', 'n', 'e', '.', 'c', 'o', 'm', '\0',
   /* "yacobo.com", true */ 'y', 'a', 'c', 'o', 'b', 'o', '.', 'c', 'o', 'm', '\0',
   /* "yafuoku.ru", true */ 'y', 'a', 'f', 'u', 'o', 'k', 'u', '.', 'r', 'u', '\0',
@@ -13899,7 +13897,6 @@ static const char kSTSHostTable[] = {
   /* "yalook.com", true */ 'y', 'a', 'l', 'o', 'o', 'k', '.', 'c', 'o', 'm', '\0',
   /* "yamadaya.tv", true */ 'y', 'a', 'm', 'a', 'd', 'a', 'y', 'a', '.', 't', 'v', '\0',
   /* "yameveo.com", false */ 'y', 'a', 'm', 'e', 'v', 'e', 'o', '.', 'c', 'o', 'm', '\0',
-  /* "yanaduday.com", true */ 'y', 'a', 'n', 'a', 'd', 'u', 'd', 'a', 'y', '.', 'c', 'o', 'm', '\0',
   /* "yanovich.net", true */ 'y', 'a', 'n', 'o', 'v', 'i', 'c', 'h', '.', 'n', 'e', 't', '\0',
   /* "yantrasthal.com", true */ 'y', 'a', 'n', 't', 'r', 'a', 's', 't', 'h', 'a', 'l', '.', 'c', 'o', 'm', '\0',
   /* "yanwh.xyz", true */ 'y', 'a', 'n', 'w', 'h', '.', 'x', 'y', 'z', '\0',
@@ -13949,7 +13946,6 @@ static const char kSTSHostTable[] = {
   /* "yolocelebs.com", false */ 'y', 'o', 'l', 'o', 'c', 'e', 'l', 'e', 'b', 's', '.', 'c', 'o', 'm', '\0',
   /* "yombo.net", true */ 'y', 'o', 'm', 'b', 'o', '.', 'n', 'e', 't', '\0',
   /* "yooooex.com", true */ 'y', 'o', 'o', 'o', 'o', 'e', 'x', '.', 'c', 'o', 'm', '\0',
-  /* "yoramvandevelde.net", true */ 'y', 'o', 'r', 'a', 'm', 'v', 'a', 'n', 'd', 'e', 'v', 'e', 'l', 'd', 'e', '.', 'n', 'e', 't', '\0',
   /* "yorcom.nl", true */ 'y', 'o', 'r', 'c', 'o', 'm', '.', 'n', 'l', '\0',
   /* "yosemo.de", true */ 'y', 'o', 's', 'e', 'm', 'o', '.', 'd', 'e', '\0',
   /* "yotilab.com", true */ 'y', 'o', 't', 'i', 'l', 'a', 'b', '.', 'c', 'o', 'm', '\0',
@@ -13980,7 +13976,6 @@ static const char kSTSHostTable[] = {
   /* "yplanapp.com", true */ 'y', 'p', 'l', 'a', 'n', 'a', 'p', 'p', '.', 'c', 'o', 'm', '\0',
   /* "ys-shop.biz", true */ 'y', 's', '-', 's', 'h', 'o', 'p', '.', 'b', 'i', 'z', '\0',
   /* "ytcuber.xyz", true */ 'y', 't', 'c', 'u', 'b', 'e', 'r', '.', 'x', 'y', 'z', '\0',
-  /* "ytec.ca", true */ 'y', 't', 'e', 'c', '.', 'c', 'a', '\0',
   /* "ytuquelees.net", true */ 'y', 't', 'u', 'q', 'u', 'e', 'l', 'e', 'e', 's', '.', 'n', 'e', 't', '\0',
   /* "ytvwld.de", true */ 'y', 't', 'v', 'w', 'l', 'd', '.', 'd', 'e', '\0',
   /* "yuanben.io", true */ 'y', 'u', 'a', 'n', 'b', 'e', 'n', '.', 'i', 'o', '\0',
@@ -14075,8 +14070,6 @@ static const char kSTSHostTable[] = {
   /* "zettaplan.ru", true */ 'z', 'e', 't', 't', 'a', 'p', 'l', 'a', 'n', '.', 'r', 'u', '\0',
   /* "zewtie.com", true */ 'z', 'e', 'w', 't', 'i', 'e', '.', 'c', 'o', 'm', '\0',
   /* "zgrep.org", true */ 'z', 'g', 'r', 'e', 'p', '.', 'o', 'r', 'g', '\0',
-  /* "zhang-hao.com", true */ 'z', 'h', 'a', 'n', 'g', '-', 'h', 'a', 'o', '.', 'c', 'o', 'm', '\0',
-  /* "zhanghao.me", true */ 'z', 'h', 'a', 'n', 'g', 'h', 'a', 'o', '.', 'm', 'e', '\0',
   /* "zhangruilin.com", true */ 'z', 'h', 'a', 'n', 'g', 'r', 'u', 'i', 'l', 'i', 'n', '.', 'c', 'o', 'm', '\0',
   /* "zhangyuhao.com", true */ 'z', 'h', 'a', 'n', 'g', 'y', 'u', 'h', 'a', 'o', '.', 'c', 'o', 'm', '\0',
   /* "zhaochen.xyz", true */ 'z', 'h', 'a', 'o', 'c', 'h', 'e', 'n', '.', 'x', 'y', 'z', '\0',
@@ -14139,6 +14132,7 @@ static const char kSTSHostTable[] = {
   /* "zubel.it", true */ 'z', 'u', 'b', 'e', 'l', '.', 'i', 't', '\0',
   /* "zuckerfloh.de", true */ 'z', 'u', 'c', 'k', 'e', 'r', 'f', 'l', 'o', 'h', '.', 'd', 'e', '\0',
   /* "zulu.ro", true */ 'z', 'u', 'l', 'u', '.', 'r', 'o', '\0',
+  /* "zulu7.com", true */ 'z', 'u', 'l', 'u', '7', '.', 'c', 'o', 'm', '\0',
   /* "zund-app.com", true */ 'z', 'u', 'n', 'd', '-', 'a', 'p', 'p', '.', 'c', 'o', 'm', '\0',
   /* "zundapp529.nl", true */ 'z', 'u', 'n', 'd', 'a', 'p', 'p', '5', '2', '9', '.', 'n', 'l', '\0',
   /* "zundappachterhoek.nl", true */ 'z', 'u', 'n', 'd', 'a', 'p', 'p', 'a', 'c', 'h', 't', 'e', 'r', 'h', 'o', 'e', 'k', '.', 'n', 'l', '\0',
@@ -14166,1357 +14160,1356 @@ struct nsSTSPreload
 
 static const nsSTSPreload kSTSPreloadList[] = {
   { 0, true },
-  { 8, true },
-  { 30, true },
+  { 22, true },
+  { 35, true },
   { 43, true },
-  { 51, true },
-  { 72, true },
-  { 91, true },
-  { 103, true },
-  { 113, true },
-  { 120, true },
-  { 127, true },
-  { 141, true },
-  { 152, true },
-  { 158, true },
-  { 167, true },
-  { 175, true },
-  { 184, true },
-  { 193, true },
-  { 202, true },
-  { 211, true },
-  { 219, true },
-  { 227, true },
-  { 237, true },
-  { 244, true },
-  { 254, true },
-  { 265, true },
-  { 278, true },
-  { 286, true },
-  { 295, true },
-  { 303, true },
+  { 64, true },
+  { 83, true },
+  { 95, true },
+  { 105, true },
+  { 112, true },
+  { 119, true },
+  { 133, true },
+  { 144, true },
+  { 153, true },
+  { 161, true },
+  { 170, true },
+  { 179, true },
+  { 188, true },
+  { 197, true },
+  { 205, true },
+  { 213, true },
+  { 223, true },
+  { 230, true },
+  { 240, true },
+  { 251, true },
+  { 264, true },
+  { 272, true },
+  { 281, true },
+  { 289, true },
+  { 296, true },
   { 310, true },
-  { 324, true },
-  { 334, false },
-  { 357, true },
-  { 373, true },
-  { 385, true },
-  { 401, true },
-  { 409, true },
-  { 417, true },
-  { 427, true },
-  { 434, true },
+  { 320, false },
+  { 343, true },
+  { 359, true },
+  { 371, true },
+  { 387, true },
+  { 395, true },
+  { 403, true },
+  { 413, true },
+  { 420, true },
+  { 435, true },
   { 449, true },
-  { 463, true },
-  { 475, true },
-  { 486, true },
-  { 497, true },
-  { 508, true },
-  { 519, true },
-  { 530, true },
-  { 549, true },
-  { 559, true },
-  { 569, true },
-  { 594, true },
-  { 602, true },
+  { 461, true },
+  { 472, true },
+  { 483, true },
+  { 494, true },
+  { 505, true },
+  { 516, true },
+  { 535, true },
+  { 545, true },
+  { 555, true },
+  { 580, true },
+  { 588, true },
+  { 596, true },
   { 610, true },
-  { 624, true },
-  { 635, true },
-  { 651, true },
-  { 662, true },
-  { 683, true },
-  { 699, false },
-  { 707, true },
-  { 732, true },
-  { 754, true },
-  { 771, true },
-  { 794, true },
-  { 804, true },
-  { 815, true },
+  { 621, true },
+  { 637, true },
+  { 648, true },
+  { 669, true },
+  { 685, false },
+  { 693, true },
+  { 718, true },
+  { 740, true },
+  { 757, true },
+  { 780, true },
+  { 790, true },
+  { 801, true },
+  { 812, true },
   { 826, true },
-  { 840, true },
-  { 862, true },
-  { 874, true },
-  { 881, true },
-  { 890, true },
-  { 897, true },
-  { 908, true },
+  { 848, true },
+  { 860, true },
+  { 867, true },
+  { 876, true },
+  { 883, true },
+  { 894, true },
+  { 905, true },
+  { 912, true },
   { 919, true },
-  { 926, true },
-  { 933, true },
-  { 944, true },
-  { 951, true },
-  { 963, true },
-  { 980, true },
+  { 930, true },
+  { 937, true },
+  { 949, true },
+  { 966, true },
+  { 984, true },
   { 998, true },
-  { 1012, true },
-  { 1024, true },
-  { 1035, true },
-  { 1045, true },
-  { 1054, true },
-  { 1060, true },
-  { 1075, true },
-  { 1083, true },
-  { 1092, true },
-  { 1110, true },
-  { 1122, true },
-  { 1131, true },
-  { 1139, true },
-  { 1147, true },
-  { 1158, true },
-  { 1167, true },
-  { 1179, true },
-  { 1187, true },
-  { 1197, true },
-  { 1213, false },
-  { 1226, true },
-  { 1235, true },
-  { 1249, true },
-  { 1258, true },
-  { 1279, true },
-  { 1288, true },
-  { 1298, true },
-  { 1313, true },
-  { 1330, true },
-  { 1346, true },
-  { 1353, true },
-  { 1366, true },
-  { 1375, true },
-  { 1387, false },
-  { 1399, true },
-  { 1407, true },
-  { 1418, true },
-  { 1425, true },
-  { 1434, true },
-  { 1443, false },
-  { 1459, true },
-  { 1472, true },
-  { 1481, true },
-  { 1500, true },
-  { 1519, true },
-  { 1531, true },
-  { 1545, true },
-  { 1557, true },
-  { 1570, true },
-  { 1578, true },
-  { 1594, true },
-  { 1609, true },
-  { 1621, true },
-  { 1634, true },
-  { 1644, true },
-  { 1658, true },
-  { 1674, true },
-  { 1688, true },
-  { 1703, true },
-  { 1717, true },
-  { 1725, true },
-  { 1732, true },
-  { 1744, true },
-  { 1755, true },
-  { 1768, true },
-  { 1777, true },
-  { 1789, true },
-  { 1800, true },
-  { 1813, true },
-  { 1828, true },
-  { 1836, false },
-  { 1845, false },
-  { 1858, true },
-  { 1866, true },
-  { 1878, true },
-  { 1890, true },
-  { 1905, true },
-  { 1924, true },
-  { 1931, false },
-  { 1950, true },
-  { 1960, true },
-  { 1966, true },
-  { 1975, true },
-  { 1988, true },
-  { 2000, true },
-  { 2009, true },
-  { 2022, true },
-  { 2032, true },
-  { 2040, false },
-  { 2047, true },
-  { 2058, true },
-  { 2070, true },
-  { 2078, true },
-  { 2091, true },
-  { 2098, true },
-  { 2107, true },
-  { 2119, true },
-  { 2128, true },
-  { 2149, true },
-  { 2173, true },
-  { 2188, true },
-  { 2199, true },
-  { 2205, true },
-  { 2218, true },
-  { 2230, true },
-  { 2242, true },
-  { 2252, true },
-  { 2269, true },
-  { 2276, true },
-  { 2285, true },
-  { 2306, true },
-  { 2319, false },
-  { 2332, true },
-  { 2342, true },
-  { 2395, true },
-  { 2407, true },
-  { 2416, true },
-  { 2425, true },
-  { 2435, true },
-  { 2445, true },
-  { 2456, true },
-  { 2464, true },
-  { 2476, true },
-  { 2486, true },
-  { 2505, true },
-  { 2516, true },
-  { 2527, true },
-  { 2536, true },
-  { 2549, true },
-  { 2569, true },
-  { 2584, true },
-  { 2599, true },
-  { 2607, true },
-  { 2617, true },
-  { 2634, true },
-  { 2649, true },
-  { 2659, true },
-  { 2666, false },
-  { 2677, true },
-  { 2692, true },
-  { 2711, true },
-  { 2721, true },
-  { 2732, true },
-  { 2750, true },
-  { 2761, true },
-  { 2775, true },
-  { 2787, true },
-  { 2809, true },
-  { 2825, true },
-  { 2836, false },
-  { 2852, false },
-  { 2864, true },
-  { 2877, true },
-  { 2890, true },
-  { 2907, true },
-  { 2932, false },
-  { 2940, true },
-  { 2964, true },
-  { 2977, true },
-  { 2989, true },
-  { 3000, true },
-  { 3024, true },
-  { 3037, true },
-  { 3046, true },
-  { 3063, true },
-  { 3075, true },
-  { 3094, true },
-  { 3117, true },
-  { 3131, true },
-  { 3147, true },
-  { 3160, true },
-  { 3177, true },
-  { 3197, true },
-  { 3212, true },
-  { 3233, true },
-  { 3253, true },
-  { 3265, true },
-  { 3276, true },
-  { 3295, false },
-  { 3302, true },
-  { 3314, true },
-  { 3335, true },
-  { 3347, true },
-  { 3364, true },
-  { 3377, true },
-  { 3393, true },
-  { 3405, true },
-  { 3418, true },
-  { 3433, false },
-  { 3442, false },
-  { 3452, true },
-  { 3467, true },
-  { 3484, true },
-  { 3498, true },
-  { 3514, true },
-  { 3525, true },
-  { 3537, true },
-  { 3558, false },
-  { 3568, true },
-  { 3583, true },
-  { 3597, false },
-  { 3610, true },
-  { 3619, true },
-  { 3633, true },
-  { 3645, true },
-  { 3660, true },
-  { 3673, true },
-  { 3685, true },
-  { 3697, true },
-  { 3709, true },
-  { 3721, true },
-  { 3733, true },
-  { 3741, true },
-  { 3752, true },
-  { 3766, true },
-  { 3782, true },
-  { 3795, true },
-  { 3812, true },
-  { 3827, true },
-  { 3842, true },
-  { 3860, true },
-  { 3869, true },
-  { 3882, true },
-  { 3903, true },
-  { 3912, true },
-  { 3922, true },
-  { 3947, true },
-  { 3958, true },
-  { 3977, true },
-  { 3989, true },
-  { 4008, true },
-  { 4027, true },
-  { 4046, true },
-  { 4058, true },
-  { 4073, true },
-  { 4084, true },
-  { 4097, true },
-  { 4109, true },
-  { 4122, true },
-  { 4136, true },
-  { 4147, true },
-  { 4156, true },
-  { 4170, true },
-  { 4182, true },
-  { 4209, true },
-  { 4235, true },
-  { 4248, true },
-  { 4259, true },
-  { 4283, true },
-  { 4300, true },
-  { 4328, true },
-  { 4344, true },
-  { 4353, true },
-  { 4363, true },
-  { 4377, true },
-  { 4396, true },
-  { 4406, true },
-  { 4420, true },
-  { 4428, false },
-  { 4449, true },
-  { 4467, true },
-  { 4475, true },
-  { 4484, true },
-  { 4503, true },
-  { 4517, true },
-  { 4536, true },
-  { 4549, true },
-  { 4560, true },
-  { 4580, true },
-  { 4598, true },
-  { 4616, false },
-  { 4635, true },
-  { 4649, true },
-  { 4670, true },
-  { 4686, true },
-  { 4696, true },
-  { 4709, true },
-  { 4722, true },
-  { 4736, true },
-  { 4750, true },
-  { 4760, true },
-  { 4770, true },
-  { 4780, true },
-  { 4790, true },
-  { 4800, true },
-  { 4810, true },
-  { 4827, true },
-  { 4837, false },
-  { 4845, true },
-  { 4856, true },
-  { 4867, true },
-  { 4878, true },
-  { 4887, true },
-  { 4907, true },
-  { 4918, true },
-  { 4935, true },
-  { 4959, true },
-  { 4973, true },
-  { 4992, true },
-  { 5004, true },
-  { 5020, true },
-  { 5031, true },
-  { 5045, true },
-  { 5061, true },
-  { 5076, true },
-  { 5084, true },
-  { 5101, true },
-  { 5113, true },
-  { 5130, true },
-  { 5138, false },
-  { 5154, true },
-  { 5162, true },
-  { 5176, true },
-  { 5188, true },
-  { 5201, true },
-  { 5213, true },
-  { 5225, true },
-  { 5239, true },
-  { 5251, true },
-  { 5261, true },
-  { 5269, true },
-  { 5279, true },
-  { 5293, true },
-  { 5306, true },
-  { 5318, true },
-  { 5337, true },
-  { 5356, true },
-  { 5389, true },
-  { 5399, true },
-  { 5413, true },
-  { 5420, true },
-  { 5437, true },
-  { 5444, true },
-  { 5458, true },
-  { 5466, true },
-  { 5477, true },
-  { 5492, true },
-  { 5507, true },
-  { 5524, true },
-  { 5534, true },
-  { 5545, true },
-  { 5560, true },
-  { 5571, true },
-  { 5583, true },
-  { 5594, true },
-  { 5614, true },
-  { 5625, true },
-  { 5636, true },
-  { 5647, true },
-  { 5660, true },
-  { 5678, true },
-  { 5690, true },
-  { 5699, true },
-  { 5713, true },
-  { 5724, true },
-  { 5741, true },
-  { 5752, true },
-  { 5761, false },
-  { 5787, true },
-  { 5798, true },
-  { 5808, false },
-  { 5825, true },
-  { 5835, true },
-  { 5849, true },
-  { 5861, true },
-  { 5870, true },
-  { 5887, true },
-  { 5894, true },
-  { 5918, true },
-  { 5934, true },
-  { 5954, true },
-  { 5979, true },
-  { 6004, true },
-  { 6029, true },
-  { 6041, true },
-  { 6053, true },
-  { 6062, true },
-  { 6089, true },
-  { 6102, false },
-  { 6111, true },
-  { 6127, true },
-  { 6143, true },
-  { 6155, true },
-  { 6169, true },
-  { 6189, true },
-  { 6204, true },
-  { 6225, true },
-  { 6237, true },
-  { 6247, true },
-  { 6259, true },
-  { 6271, true },
-  { 6280, true },
-  { 6292, true },
-  { 6311, true },
-  { 6324, true },
-  { 6335, true },
-  { 6344, true },
-  { 6358, true },
-  { 6372, true },
-  { 6388, true },
-  { 6404, true },
-  { 6424, true },
-  { 6445, true },
-  { 6459, true },
-  { 6469, true },
-  { 6484, true },
-  { 6494, true },
-  { 6509, true },
-  { 6527, true },
-  { 6541, true },
-  { 6553, true },
-  { 6568, true },
-  { 6582, true },
-  { 6597, true },
-  { 6607, true },
-  { 6621, true },
-  { 6638, true },
-  { 6653, true },
-  { 6667, true },
-  { 6681, true },
-  { 6697, true },
-  { 6709, true },
-  { 6721, true },
-  { 6736, true },
-  { 6750, true },
-  { 6772, true },
-  { 6784, true },
-  { 6805, true },
-  { 6817, true },
-  { 6830, true },
-  { 6842, true },
-  { 6855, true },
-  { 6870, true },
-  { 6881, true },
-  { 6897, true },
-  { 6908, true },
-  { 6920, true },
-  { 6933, true },
-  { 6953, true },
-  { 6966, true },
-  { 6984, true },
-  { 7001, true },
-  { 7025, true },
-  { 7044, true },
-  { 7055, true },
-  { 7069, true },
-  { 7085, true },
-  { 7104, true },
-  { 7117, true },
-  { 7138, true },
-  { 7158, true },
-  { 7178, true },
-  { 7191, false },
-  { 7204, true },
-  { 7216, true },
-  { 7226, true },
-  { 7239, true },
-  { 7253, true },
-  { 7269, true },
-  { 7283, true },
-  { 7299, true },
-  { 7311, true },
-  { 7325, true },
-  { 7338, true },
-  { 7352, true },
-  { 7360, true },
-  { 7373, true },
-  { 7388, true },
-  { 7407, true },
-  { 7419, true },
-  { 7433, true },
-  { 7447, true },
-  { 7459, true },
-  { 7474, true },
-  { 7485, true },
-  { 7496, true },
-  { 7508, true },
-  { 7516, true },
-  { 7527, true },
-  { 7535, true },
-  { 7543, true },
-  { 7551, true },
-  { 7559, true },
-  { 7572, true },
-  { 7579, true },
-  { 7589, true },
-  { 7602, true },
-  { 7614, true },
-  { 7627, true },
-  { 7647, true },
-  { 7659, true },
-  { 7670, true },
-  { 7688, true },
-  { 7701, true },
-  { 7710, true },
-  { 7722, true },
-  { 7736, true },
-  { 7749, true },
-  { 7760, true },
-  { 7770, true },
-  { 7781, true },
-  { 7791, true },
-  { 7802, true },
-  { 7811, true },
-  { 7820, true },
-  { 7836, true },
-  { 7852, true },
-  { 7880, true },
-  { 7899, true },
-  { 7914, true },
-  { 7934, true },
-  { 7946, true },
-  { 7958, true },
-  { 7969, true },
-  { 7980, true },
-  { 7995, true },
-  { 8015, true },
-  { 8033, true },
-  { 8043, false },
-  { 8054, true },
-  { 8064, true },
-  { 8081, true },
-  { 8092, true },
-  { 8101, true },
-  { 8112, true },
-  { 8131, true },
-  { 8142, true },
-  { 8160, true },
-  { 8186, true },
-  { 8208, true },
-  { 8222, true },
-  { 8237, true },
-  { 8251, true },
-  { 8265, true },
-  { 8280, true },
-  { 8301, true },
-  { 8311, true },
-  { 8322, true },
-  { 8343, true },
-  { 8361, true },
-  { 8374, true },
-  { 8382, true },
-  { 8395, true },
-  { 8409, true },
-  { 8427, true },
-  { 8449, true },
-  { 8464, true },
-  { 8481, true },
-  { 8503, true },
-  { 8518, true },
-  { 8535, true },
-  { 8551, true },
-  { 8567, true },
-  { 8582, true },
+  { 1010, true },
+  { 1021, true },
+  { 1031, true },
+  { 1040, true },
+  { 1046, true },
+  { 1061, true },
+  { 1069, true },
+  { 1078, true },
+  { 1096, true },
+  { 1108, true },
+  { 1124, true },
+  { 1133, true },
+  { 1141, true },
+  { 1149, true },
+  { 1160, true },
+  { 1169, true },
+  { 1181, true },
+  { 1189, true },
+  { 1199, true },
+  { 1215, false },
+  { 1228, true },
+  { 1237, true },
+  { 1251, true },
+  { 1260, true },
+  { 1281, true },
+  { 1290, true },
+  { 1300, true },
+  { 1315, true },
+  { 1332, true },
+  { 1348, true },
+  { 1355, true },
+  { 1368, true },
+  { 1377, true },
+  { 1389, false },
+  { 1401, true },
+  { 1409, true },
+  { 1420, true },
+  { 1427, true },
+  { 1436, true },
+  { 1445, false },
+  { 1461, true },
+  { 1474, true },
+  { 1483, true },
+  { 1502, true },
+  { 1521, true },
+  { 1533, true },
+  { 1547, true },
+  { 1559, true },
+  { 1572, true },
+  { 1580, true },
+  { 1596, true },
+  { 1611, true },
+  { 1623, true },
+  { 1636, true },
+  { 1646, true },
+  { 1660, true },
+  { 1676, true },
+  { 1690, true },
+  { 1705, true },
+  { 1719, true },
+  { 1727, true },
+  { 1734, true },
+  { 1746, true },
+  { 1757, true },
+  { 1770, true },
+  { 1779, true },
+  { 1791, true },
+  { 1802, true },
+  { 1815, true },
+  { 1830, true },
+  { 1838, false },
+  { 1847, false },
+  { 1860, true },
+  { 1868, true },
+  { 1880, true },
+  { 1892, true },
+  { 1907, true },
+  { 1926, true },
+  { 1933, false },
+  { 1952, true },
+  { 1962, true },
+  { 1968, true },
+  { 1977, true },
+  { 1990, true },
+  { 2002, true },
+  { 2011, true },
+  { 2024, true },
+  { 2034, true },
+  { 2042, false },
+  { 2049, true },
+  { 2060, true },
+  { 2072, true },
+  { 2080, true },
+  { 2093, true },
+  { 2100, true },
+  { 2109, true },
+  { 2121, true },
+  { 2130, true },
+  { 2151, true },
+  { 2175, true },
+  { 2190, true },
+  { 2201, true },
+  { 2207, true },
+  { 2220, true },
+  { 2232, true },
+  { 2244, true },
+  { 2254, true },
+  { 2271, true },
+  { 2278, true },
+  { 2287, true },
+  { 2308, true },
+  { 2321, false },
+  { 2334, true },
+  { 2344, true },
+  { 2397, true },
+  { 2409, true },
+  { 2418, true },
+  { 2427, true },
+  { 2437, true },
+  { 2447, true },
+  { 2458, true },
+  { 2466, true },
+  { 2478, true },
+  { 2488, true },
+  { 2507, true },
+  { 2518, true },
+  { 2529, true },
+  { 2538, true },
+  { 2551, true },
+  { 2571, true },
+  { 2586, true },
+  { 2601, true },
+  { 2609, true },
+  { 2619, true },
+  { 2636, true },
+  { 2651, true },
+  { 2661, true },
+  { 2668, false },
+  { 2679, true },
+  { 2694, true },
+  { 2713, true },
+  { 2723, true },
+  { 2734, true },
+  { 2752, true },
+  { 2763, true },
+  { 2777, true },
+  { 2789, true },
+  { 2811, true },
+  { 2827, true },
+  { 2838, false },
+  { 2854, false },
+  { 2866, true },
+  { 2879, true },
+  { 2892, true },
+  { 2909, true },
+  { 2934, false },
+  { 2942, true },
+  { 2966, true },
+  { 2979, true },
+  { 2991, true },
+  { 3002, true },
+  { 3026, true },
+  { 3039, true },
+  { 3048, true },
+  { 3065, true },
+  { 3077, true },
+  { 3096, true },
+  { 3119, true },
+  { 3133, true },
+  { 3149, true },
+  { 3162, true },
+  { 3179, true },
+  { 3199, true },
+  { 3214, true },
+  { 3235, true },
+  { 3255, true },
+  { 3267, true },
+  { 3278, true },
+  { 3297, false },
+  { 3304, true },
+  { 3316, true },
+  { 3337, true },
+  { 3349, true },
+  { 3366, true },
+  { 3379, true },
+  { 3395, true },
+  { 3407, true },
+  { 3420, true },
+  { 3435, false },
+  { 3444, false },
+  { 3454, true },
+  { 3469, true },
+  { 3486, true },
+  { 3500, true },
+  { 3516, true },
+  { 3527, true },
+  { 3539, true },
+  { 3560, false },
+  { 3570, true },
+  { 3585, true },
+  { 3599, false },
+  { 3612, true },
+  { 3621, true },
+  { 3635, true },
+  { 3647, true },
+  { 3662, true },
+  { 3675, true },
+  { 3687, true },
+  { 3699, true },
+  { 3711, true },
+  { 3723, true },
+  { 3735, true },
+  { 3743, true },
+  { 3754, true },
+  { 3768, true },
+  { 3784, true },
+  { 3797, true },
+  { 3814, true },
+  { 3829, true },
+  { 3844, true },
+  { 3862, true },
+  { 3871, true },
+  { 3884, true },
+  { 3905, true },
+  { 3914, true },
+  { 3924, true },
+  { 3949, true },
+  { 3960, true },
+  { 3979, true },
+  { 3991, true },
+  { 4010, true },
+  { 4029, true },
+  { 4048, true },
+  { 4060, true },
+  { 4075, true },
+  { 4086, true },
+  { 4099, true },
+  { 4111, true },
+  { 4124, true },
+  { 4138, true },
+  { 4149, true },
+  { 4158, true },
+  { 4172, true },
+  { 4184, true },
+  { 4211, true },
+  { 4237, true },
+  { 4250, true },
+  { 4261, true },
+  { 4285, true },
+  { 4302, true },
+  { 4330, true },
+  { 4346, true },
+  { 4355, true },
+  { 4365, true },
+  { 4379, true },
+  { 4398, true },
+  { 4408, true },
+  { 4422, true },
+  { 4430, false },
+  { 4451, true },
+  { 4469, true },
+  { 4477, true },
+  { 4486, true },
+  { 4505, true },
+  { 4519, true },
+  { 4538, true },
+  { 4551, true },
+  { 4562, true },
+  { 4582, true },
+  { 4600, true },
+  { 4618, false },
+  { 4637, true },
+  { 4651, true },
+  { 4672, true },
+  { 4688, true },
+  { 4698, true },
+  { 4711, true },
+  { 4724, true },
+  { 4738, true },
+  { 4752, true },
+  { 4762, true },
+  { 4772, true },
+  { 4782, true },
+  { 4792, true },
+  { 4802, true },
+  { 4812, true },
+  { 4829, true },
+  { 4839, false },
+  { 4847, true },
+  { 4858, true },
+  { 4869, true },
+  { 4880, true },
+  { 4889, true },
+  { 4909, true },
+  { 4920, true },
+  { 4937, true },
+  { 4961, true },
+  { 4975, true },
+  { 4994, true },
+  { 5006, true },
+  { 5022, true },
+  { 5033, true },
+  { 5047, true },
+  { 5063, true },
+  { 5078, true },
+  { 5086, true },
+  { 5103, true },
+  { 5115, true },
+  { 5132, true },
+  { 5140, false },
+  { 5156, true },
+  { 5164, true },
+  { 5178, true },
+  { 5190, true },
+  { 5203, true },
+  { 5215, true },
+  { 5227, true },
+  { 5241, true },
+  { 5253, true },
+  { 5263, true },
+  { 5271, true },
+  { 5281, true },
+  { 5295, true },
+  { 5308, true },
+  { 5320, true },
+  { 5339, true },
+  { 5358, true },
+  { 5391, true },
+  { 5401, true },
+  { 5415, true },
+  { 5422, true },
+  { 5439, true },
+  { 5446, true },
+  { 5460, true },
+  { 5468, true },
+  { 5479, true },
+  { 5494, true },
+  { 5509, true },
+  { 5526, true },
+  { 5536, true },
+  { 5547, true },
+  { 5562, true },
+  { 5573, true },
+  { 5585, true },
+  { 5596, true },
+  { 5616, true },
+  { 5627, true },
+  { 5638, true },
+  { 5649, true },
+  { 5662, true },
+  { 5680, true },
+  { 5692, true },
+  { 5701, true },
+  { 5715, true },
+  { 5726, true },
+  { 5743, true },
+  { 5754, true },
+  { 5763, false },
+  { 5789, true },
+  { 5800, true },
+  { 5810, false },
+  { 5827, true },
+  { 5837, true },
+  { 5851, true },
+  { 5863, true },
+  { 5872, true },
+  { 5889, true },
+  { 5896, true },
+  { 5920, true },
+  { 5936, true },
+  { 5956, true },
+  { 5981, true },
+  { 6006, true },
+  { 6031, true },
+  { 6043, true },
+  { 6055, true },
+  { 6064, true },
+  { 6091, true },
+  { 6104, false },
+  { 6113, true },
+  { 6129, true },
+  { 6145, true },
+  { 6157, true },
+  { 6171, true },
+  { 6191, true },
+  { 6206, true },
+  { 6227, true },
+  { 6239, true },
+  { 6249, true },
+  { 6261, true },
+  { 6273, true },
+  { 6282, true },
+  { 6294, true },
+  { 6313, true },
+  { 6326, true },
+  { 6337, true },
+  { 6346, true },
+  { 6360, true },
+  { 6374, true },
+  { 6390, true },
+  { 6406, true },
+  { 6426, true },
+  { 6447, true },
+  { 6461, true },
+  { 6471, true },
+  { 6486, true },
+  { 6496, true },
+  { 6511, true },
+  { 6529, true },
+  { 6543, true },
+  { 6555, true },
+  { 6570, true },
+  { 6584, true },
+  { 6599, true },
+  { 6609, true },
+  { 6623, true },
+  { 6640, true },
+  { 6655, true },
+  { 6669, true },
+  { 6683, true },
+  { 6699, true },
+  { 6711, true },
+  { 6723, true },
+  { 6738, true },
+  { 6752, true },
+  { 6774, true },
+  { 6786, true },
+  { 6807, true },
+  { 6819, true },
+  { 6832, true },
+  { 6844, true },
+  { 6857, true },
+  { 6872, true },
+  { 6883, true },
+  { 6899, true },
+  { 6910, true },
+  { 6922, true },
+  { 6935, true },
+  { 6955, true },
+  { 6968, true },
+  { 6986, true },
+  { 7003, true },
+  { 7027, true },
+  { 7046, true },
+  { 7057, true },
+  { 7071, true },
+  { 7087, true },
+  { 7106, true },
+  { 7119, true },
+  { 7140, true },
+  { 7160, true },
+  { 7180, true },
+  { 7193, false },
+  { 7206, true },
+  { 7218, true },
+  { 7228, true },
+  { 7241, true },
+  { 7255, true },
+  { 7271, true },
+  { 7285, true },
+  { 7301, true },
+  { 7313, true },
+  { 7327, true },
+  { 7340, true },
+  { 7354, true },
+  { 7362, true },
+  { 7375, true },
+  { 7390, true },
+  { 7409, true },
+  { 7421, true },
+  { 7435, true },
+  { 7449, true },
+  { 7461, true },
+  { 7476, true },
+  { 7487, true },
+  { 7498, true },
+  { 7510, true },
+  { 7518, true },
+  { 7529, true },
+  { 7537, true },
+  { 7545, true },
+  { 7553, true },
+  { 7561, true },
+  { 7574, true },
+  { 7581, true },
+  { 7591, true },
+  { 7604, true },
+  { 7616, true },
+  { 7629, true },
+  { 7649, true },
+  { 7661, true },
+  { 7672, true },
+  { 7690, true },
+  { 7703, true },
+  { 7712, true },
+  { 7724, true },
+  { 7738, true },
+  { 7751, true },
+  { 7762, true },
+  { 7772, true },
+  { 7783, true },
+  { 7793, true },
+  { 7804, true },
+  { 7813, true },
+  { 7822, true },
+  { 7838, true },
+  { 7854, true },
+  { 7882, true },
+  { 7901, true },
+  { 7916, true },
+  { 7936, true },
+  { 7948, true },
+  { 7960, true },
+  { 7971, true },
+  { 7982, true },
+  { 7997, true },
+  { 8017, true },
+  { 8035, true },
+  { 8045, false },
+  { 8056, true },
+  { 8066, true },
+  { 8083, true },
+  { 8094, true },
+  { 8103, true },
+  { 8114, true },
+  { 8133, true },
+  { 8144, true },
+  { 8162, true },
+  { 8188, true },
+  { 8210, true },
+  { 8224, true },
+  { 8239, true },
+  { 8253, true },
+  { 8267, true },
+  { 8282, true },
+  { 8303, true },
+  { 8313, true },
+  { 8324, true },
+  { 8345, true },
+  { 8363, true },
+  { 8376, true },
+  { 8384, true },
+  { 8397, true },
+  { 8411, true },
+  { 8429, true },
+  { 8451, true },
+  { 8466, true },
+  { 8483, true },
+  { 8505, true },
+  { 8520, true },
+  { 8537, true },
+  { 8553, true },
+  { 8569, true },
+  { 8586, true },
   { 8601, true },
-  { 8618, true },
-  { 8635, true },
-  { 8647, true },
-  { 8665, true },
-  { 8682, true },
-  { 8697, true },
-  { 8711, true },
-  { 8728, true },
-  { 8746, true },
-  { 8758, true },
-  { 8771, true },
-  { 8791, true },
-  { 8802, true },
-  { 8813, true },
-  { 8824, true },
-  { 8835, true },
-  { 8846, true },
-  { 8857, true },
-  { 8869, true },
-  { 8882, true },
+  { 8620, true },
+  { 8637, true },
+  { 8654, true },
+  { 8666, true },
+  { 8684, true },
+  { 8701, true },
+  { 8716, true },
+  { 8730, true },
+  { 8747, true },
+  { 8765, true },
+  { 8777, true },
+  { 8790, true },
+  { 8810, true },
+  { 8821, true },
+  { 8832, true },
+  { 8843, true },
+  { 8854, true },
+  { 8865, true },
+  { 8876, true },
+  { 8888, true },
   { 8901, true },
-  { 8912, true },
-  { 8925, true },
-  { 8939, false },
-  { 8952, false },
-  { 8961, true },
-  { 8978, true },
-  { 8998, true },
-  { 9009, true },
-  { 9027, true },
-  { 9059, true },
-  { 9086, true },
-  { 9096, true },
-  { 9114, true },
-  { 9129, true },
-  { 9141, true },
-  { 9153, true },
-  { 9173, true },
+  { 8920, true },
+  { 8931, true },
+  { 8944, true },
+  { 8958, false },
+  { 8971, false },
+  { 8980, true },
+  { 8997, true },
+  { 9017, true },
+  { 9028, true },
+  { 9046, true },
+  { 9078, true },
+  { 9105, true },
+  { 9115, true },
+  { 9133, true },
+  { 9148, true },
+  { 9160, true },
+  { 9172, true },
   { 9192, true },
-  { 9212, true },
-  { 9235, true },
-  { 9259, true },
-  { 9271, true },
-  { 9282, true },
-  { 9294, true },
-  { 9306, true },
-  { 9322, true },
-  { 9339, true },
+  { 9211, true },
+  { 9231, true },
+  { 9254, true },
+  { 9278, true },
+  { 9290, true },
+  { 9301, true },
+  { 9313, true },
+  { 9325, true },
+  { 9341, true },
   { 9358, true },
-  { 9372, true },
-  { 9383, true },
-  { 9394, true },
-  { 9407, true },
-  { 9419, false },
-  { 9443, true },
-  { 9459, true },
-  { 9475, true },
-  { 9487, true },
-  { 9503, true },
-  { 9520, true },
-  { 9534, true },
-  { 9545, true },
-  { 9563, true },
-  { 9579, true },
-  { 9600, true },
-  { 9614, true },
-  { 9629, true },
-  { 9639, true },
-  { 9656, true },
-  { 9669, true },
-  { 9682, true },
-  { 9698, true },
-  { 9709, true },
-  { 9721, true },
-  { 9732, true },
-  { 9739, true },
-  { 9747, true },
-  { 9760, true },
-  { 9770, true },
-  { 9784, false },
-  { 9798, true },
-  { 9814, true },
-  { 9844, true },
-  { 9867, true },
-  { 9880, true },
-  { 9899, true },
-  { 9912, false },
-  { 9931, true },
-  { 9947, true },
-  { 9963, false },
-  { 9978, false },
-  { 9991, true },
-  { 10007, true },
-  { 10019, true },
-  { 10038, true },
-  { 10053, true },
-  { 10074, true },
-  { 10087, true },
-  { 10097, true },
-  { 10108, true },
-  { 10119, true },
-  { 10133, true },
-  { 10149, true },
-  { 10166, false },
-  { 10183, true },
-  { 10196, true },
-  { 10222, true },
-  { 10235, true },
+  { 9377, true },
+  { 9391, true },
+  { 9402, true },
+  { 9413, true },
+  { 9426, true },
+  { 9438, false },
+  { 9462, true },
+  { 9478, true },
+  { 9494, true },
+  { 9506, true },
+  { 9522, true },
+  { 9539, true },
+  { 9553, true },
+  { 9564, true },
+  { 9582, true },
+  { 9598, true },
+  { 9619, true },
+  { 9633, true },
+  { 9648, true },
+  { 9658, true },
+  { 9675, true },
+  { 9688, true },
+  { 9701, true },
+  { 9717, true },
+  { 9728, true },
+  { 9740, true },
+  { 9751, true },
+  { 9758, true },
+  { 9766, true },
+  { 9779, false },
+  { 9787, true },
+  { 9797, true },
+  { 9811, false },
+  { 9825, true },
+  { 9841, true },
+  { 9871, true },
+  { 9894, true },
+  { 9907, true },
+  { 9926, true },
+  { 9939, false },
+  { 9958, true },
+  { 9974, true },
+  { 9990, false },
+  { 10005, false },
+  { 10018, true },
+  { 10034, true },
+  { 10046, true },
+  { 10065, true },
+  { 10080, true },
+  { 10101, true },
+  { 10114, true },
+  { 10124, true },
+  { 10135, true },
+  { 10146, true },
+  { 10160, true },
+  { 10176, true },
+  { 10193, false },
+  { 10210, true },
+  { 10223, true },
   { 10249, true },
-  { 10268, true },
-  { 10289, true },
-  { 10301, true },
-  { 10315, true },
-  { 10339, true },
-  { 10352, true },
-  { 10365, true },
+  { 10262, true },
+  { 10276, true },
+  { 10295, true },
+  { 10316, true },
+  { 10328, true },
+  { 10342, true },
+  { 10366, true },
   { 10379, true },
-  { 10390, true },
-  { 10399, true },
-  { 10412, true },
-  { 10425, true },
-  { 10437, false },
-  { 10455, true },
-  { 10478, true },
+  { 10392, true },
+  { 10406, true },
+  { 10417, true },
+  { 10426, true },
+  { 10439, true },
+  { 10452, true },
+  { 10464, false },
+  { 10482, true },
   { 10505, true },
-  { 10524, true },
-  { 10536, true },
-  { 10556, true },
-  { 10567, true },
-  { 10579, true },
-  { 10593, true },
-  { 10601, true },
-  { 10618, true },
-  { 10631, true },
-  { 10643, true },
-  { 10661, true },
-  { 10684, false },
-  { 10700, true },
-  { 10706, true },
-  { 10718, true },
-  { 10729, true },
-  { 10746, true },
-  { 10765, true },
-  { 10777, true },
-  { 10806, true },
-  { 10822, true },
-  { 10835, true },
+  { 10532, true },
+  { 10551, true },
+  { 10563, true },
+  { 10583, true },
+  { 10594, true },
+  { 10606, true },
+  { 10620, true },
+  { 10628, true },
+  { 10645, true },
+  { 10658, true },
+  { 10670, true },
+  { 10688, true },
+  { 10711, false },
+  { 10727, true },
+  { 10733, true },
+  { 10745, true },
+  { 10756, true },
+  { 10773, true },
+  { 10792, true },
+  { 10804, true },
+  { 10833, true },
   { 10849, true },
-  { 10865, true },
-  { 10878, true },
-  { 10889, true },
-  { 10898, true },
-  { 10910, true },
-  { 10926, true },
-  { 10940, true },
-  { 10956, true },
-  { 10970, true },
-  { 10984, true },
-  { 11004, true },
-  { 11016, true },
-  { 11032, true },
-  { 11046, false },
+  { 10862, true },
+  { 10876, true },
+  { 10892, true },
+  { 10905, true },
+  { 10916, true },
+  { 10925, true },
+  { 10937, true },
+  { 10953, true },
+  { 10967, true },
+  { 10983, true },
+  { 10997, true },
+  { 11011, true },
+  { 11031, true },
+  { 11043, true },
   { 11059, true },
-  { 11074, true },
-  { 11088, true },
-  { 11097, true },
-  { 11109, true },
-  { 11127, true },
-  { 11140, true },
-  { 11150, true },
-  { 11164, true },
-  { 11190, true },
-  { 11200, true },
-  { 11214, true },
-  { 11228, true },
-  { 11246, true },
-  { 11264, false },
-  { 11280, true },
-  { 11290, true },
-  { 11301, true },
+  { 11073, false },
+  { 11086, true },
+  { 11101, true },
+  { 11115, true },
+  { 11124, true },
+  { 11136, true },
+  { 11154, true },
+  { 11167, true },
+  { 11177, true },
+  { 11191, true },
+  { 11217, true },
+  { 11227, true },
+  { 11241, true },
+  { 11255, true },
+  { 11273, true },
+  { 11291, false },
+  { 11307, true },
   { 11317, true },
-  { 11325, true },
-  { 11333, true },
+  { 11328, true },
   { 11344, true },
-  { 11354, true },
-  { 11369, true },
-  { 11388, true },
-  { 11401, true },
-  { 11416, true },
-  { 11434, false },
-  { 11449, true },
-  { 11469, true },
-  { 11480, true },
-  { 11492, true },
-  { 11505, true },
-  { 11525, false },
-  { 11539, true },
-  { 11552, true },
-  { 11570, true },
-  { 11584, true },
+  { 11352, true },
+  { 11360, true },
+  { 11371, true },
+  { 11381, true },
+  { 11396, true },
+  { 11415, true },
+  { 11428, true },
+  { 11443, true },
+  { 11461, false },
+  { 11476, true },
+  { 11496, true },
+  { 11507, true },
+  { 11519, true },
+  { 11532, true },
+  { 11552, false },
+  { 11566, true },
+  { 11579, true },
   { 11597, true },
-  { 11609, true },
-  { 11623, true },
-  { 11637, true },
-  { 11649, true },
-  { 11660, true },
-  { 11671, true },
-  { 11684, true },
-  { 11699, true },
-  { 11710, true },
-  { 11721, true },
-  { 11736, true },
-  { 11747, true },
-  { 11757, true },
-  { 11766, true },
-  { 11773, true },
-  { 11787, false },
+  { 11611, true },
+  { 11624, true },
+  { 11636, true },
+  { 11650, true },
+  { 11664, true },
+  { 11676, true },
+  { 11687, true },
+  { 11698, true },
+  { 11711, true },
+  { 11726, true },
+  { 11737, true },
+  { 11748, true },
+  { 11763, true },
+  { 11774, true },
+  { 11784, true },
+  { 11793, true },
   { 11800, true },
-  { 11810, true },
-  { 11823, true },
-  { 11836, true },
-  { 11848, true },
-  { 11862, true },
-  { 11872, true },
-  { 11890, true },
-  { 11900, true },
-  { 11912, true },
-  { 11926, true },
-  { 11942, true },
+  { 11814, false },
+  { 11827, true },
+  { 11837, true },
+  { 11850, true },
+  { 11863, true },
+  { 11875, true },
+  { 11889, true },
+  { 11899, true },
+  { 11917, true },
+  { 11927, true },
+  { 11939, true },
   { 11953, true },
-  { 11970, true },
-  { 11984, true },
-  { 12006, true },
-  { 12032, true },
-  { 12047, true },
-  { 12065, true },
-  { 12076, true },
-  { 12086, true },
-  { 12096, true },
-  { 12115, true },
-  { 12135, true },
-  { 12147, true },
-  { 12161, true },
-  { 12168, true },
-  { 12178, true },
-  { 12196, true },
-  { 12218, true },
-  { 12230, true },
-  { 12242, true },
-  { 12255, true },
-  { 12264, true },
-  { 12272, true },
-  { 12284, false },
-  { 12304, true },
-  { 12311, true },
-  { 12327, true },
-  { 12343, true },
-  { 12358, true },
-  { 12368, true },
+  { 11969, true },
+  { 11980, true },
+  { 11997, true },
+  { 12011, true },
+  { 12033, true },
+  { 12059, true },
+  { 12074, true },
+  { 12092, true },
+  { 12103, true },
+  { 12113, true },
+  { 12123, true },
+  { 12142, true },
+  { 12162, true },
+  { 12174, true },
+  { 12188, true },
+  { 12195, true },
+  { 12205, true },
+  { 12223, true },
+  { 12245, true },
+  { 12257, true },
+  { 12269, true },
+  { 12282, true },
+  { 12290, true },
+  { 12302, false },
+  { 12322, true },
+  { 12329, true },
+  { 12345, true },
+  { 12361, true },
+  { 12376, true },
   { 12386, true },
-  { 12413, true },
-  { 12430, true },
+  { 12404, true },
+  { 12431, true },
   { 12448, true },
-  { 12456, true },
-  { 12470, true },
-  { 12481, true },
-  { 12490, true },
-  { 12517, true },
-  { 12527, true },
-  { 12543, true },
-  { 12555, true },
-  { 12570, true },
-  { 12582, true },
-  { 12597, true },
-  { 12612, true },
-  { 12624, true },
-  { 12645, true },
-  { 12662, true },
-  { 12676, true },
-  { 12688, true },
-  { 12698, true },
-  { 12708, true },
-  { 12723, true },
-  { 12738, true },
-  { 12751, true },
-  { 12763, true },
-  { 12771, true },
-  { 12784, true },
+  { 12466, true },
+  { 12474, true },
+  { 12488, true },
+  { 12499, true },
+  { 12508, true },
+  { 12535, true },
+  { 12545, true },
+  { 12561, true },
+  { 12573, true },
+  { 12588, true },
+  { 12600, true },
+  { 12615, true },
+  { 12630, true },
+  { 12642, true },
+  { 12663, true },
+  { 12680, true },
+  { 12694, true },
+  { 12706, true },
+  { 12716, true },
+  { 12726, true },
+  { 12741, true },
+  { 12756, true },
+  { 12769, true },
+  { 12781, true },
+  { 12789, true },
   { 12802, true },
-  { 12823, true },
-  { 12837, true },
-  { 12853, true },
-  { 12863, true },
-  { 12876, true },
-  { 12895, true },
-  { 12921, true },
-  { 12933, true },
-  { 12949, true },
-  { 12961, true },
-  { 12980, true },
-  { 12993, true },
-  { 13004, true },
-  { 13015, true },
+  { 12820, true },
+  { 12841, true },
+  { 12855, true },
+  { 12871, true },
+  { 12881, true },
+  { 12894, true },
+  { 12913, true },
+  { 12939, true },
+  { 12951, true },
+  { 12967, true },
+  { 12979, true },
+  { 12998, true },
+  { 13011, true },
+  { 13022, true },
   { 13033, true },
-  { 13063, true },
-  { 13086, true },
-  { 13099, false },
-  { 13107, true },
-  { 13119, true },
-  { 13129, true },
-  { 13145, true },
-  { 13160, true },
-  { 13178, true },
-  { 13188, true },
-  { 13209, true },
-  { 13238, true },
-  { 13254, true },
-  { 13270, true },
-  { 13291, true },
-  { 13302, true },
-  { 13314, true },
-  { 13326, true },
-  { 13349, true },
-  { 13367, true },
-  { 13388, true },
-  { 13413, true },
-  { 13427, true },
-  { 13440, true },
-  { 13455, true },
-  { 13468, true },
-  { 13481, true },
-  { 13492, true },
-  { 13508, true },
-  { 13518, true },
-  { 13530, true },
-  { 13547, true },
-  { 13559, true },
-  { 13572, true },
-  { 13580, true },
-  { 13591, true },
-  { 13602, true },
-  { 13620, true },
-  { 13635, true },
-  { 13653, true },
-  { 13662, true },
-  { 13673, true },
-  { 13687, true },
-  { 13698, true },
-  { 13706, true },
-  { 13716, true },
-  { 13727, true },
-  { 13735, true },
-  { 13745, true },
-  { 13760, true },
-  { 13780, true },
-  { 13788, true },
-  { 13813, true },
-  { 13829, true },
-  { 13836, true },
-  { 13844, true },
-  { 13853, false },
-  { 13862, true },
-  { 13878, true },
-  { 13891, true },
-  { 13900, true },
-  { 13909, true },
-  { 13924, true },
-  { 13934, true },
-  { 13946, true },
-  { 13964, false },
-  { 13980, true },
-  { 13992, true },
-  { 14002, true },
-  { 14012, true },
-  { 14022, true },
-  { 14034, true },
-  { 14047, true },
-  { 14060, true },
-  { 14070, true },
-  { 14080, true },
-  { 14092, false },
-  { 14104, true },
-  { 14120, true },
-  { 14131, false },
-  { 14141, true },
-  { 14149, true },
-  { 14158, true },
-  { 14172, true },
-  { 14187, false },
-  { 14196, true },
-  { 14210, true },
-  { 14224, true },
-  { 14235, true },
-  { 14248, true },
-  { 14272, true },
-  { 14285, true },
-  { 14297, true },
-  { 14314, true },
-  { 14325, true },
-  { 14345, true },
-  { 14363, true },
-  { 14381, true },
-  { 14396, true },
-  { 14417, true },
-  { 14441, true },
-  { 14451, true },
-  { 14461, true },
-  { 14471, true },
-  { 14482, true },
-  { 14507, true },
-  { 14536, true },
-  { 14549, true },
-  { 14561, true },
-  { 14571, true },
-  { 14579, true },
-  { 14588, true },
-  { 14602, false },
-  { 14619, true },
-  { 14631, true },
-  { 14646, true },
-  { 14653, true },
-  { 14666, true },
-  { 14678, true },
-  { 14686, true },
-  { 14701, true },
-  { 14710, true },
-  { 14722, true },
-  { 14733, true },
-  { 14749, true },
-  { 14759, true },
-  { 14774, true },
-  { 14791, true },
-  { 14804, true },
-  { 14814, true },
-  { 14827, true },
-  { 14841, true },
-  { 14855, true },
-  { 14867, true },
-  { 14882, true },
-  { 14898, true },
-  { 14913, true },
-  { 14927, true },
-  { 14940, true },
-  { 14952, true },
-  { 14966, true },
-  { 14978, true },
-  { 14990, true },
-  { 15001, true },
-  { 15012, true },
-  { 15027, false },
-  { 15043, true },
-  { 15061, true },
+  { 13051, true },
+  { 13081, true },
+  { 13104, true },
+  { 13117, false },
+  { 13125, true },
+  { 13137, true },
+  { 13147, true },
+  { 13162, true },
+  { 13180, true },
+  { 13190, true },
+  { 13211, true },
+  { 13240, true },
+  { 13256, true },
+  { 13272, true },
+  { 13293, true },
+  { 13304, true },
+  { 13316, true },
+  { 13328, true },
+  { 13351, true },
+  { 13369, true },
+  { 13390, true },
+  { 13415, true },
+  { 13429, true },
+  { 13442, true },
+  { 13457, true },
+  { 13470, true },
+  { 13483, true },
+  { 13494, true },
+  { 13510, true },
+  { 13520, true },
+  { 13532, true },
+  { 13549, true },
+  { 13561, true },
+  { 13574, true },
+  { 13582, true },
+  { 13593, true },
+  { 13604, true },
+  { 13622, true },
+  { 13637, true },
+  { 13655, true },
+  { 13664, true },
+  { 13675, true },
+  { 13689, true },
+  { 13700, true },
+  { 13708, true },
+  { 13718, true },
+  { 13729, true },
+  { 13737, true },
+  { 13747, true },
+  { 13762, true },
+  { 13782, true },
+  { 13790, true },
+  { 13815, true },
+  { 13831, true },
+  { 13838, true },
+  { 13846, true },
+  { 13855, false },
+  { 13864, true },
+  { 13880, true },
+  { 13893, true },
+  { 13902, true },
+  { 13911, true },
+  { 13926, true },
+  { 13936, true },
+  { 13948, true },
+  { 13966, false },
+  { 13982, true },
+  { 13994, true },
+  { 14004, true },
+  { 14014, true },
+  { 14024, true },
+  { 14036, true },
+  { 14049, true },
+  { 14062, true },
+  { 14072, true },
+  { 14082, true },
+  { 14094, false },
+  { 14106, true },
+  { 14122, true },
+  { 14133, false },
+  { 14143, true },
+  { 14151, true },
+  { 14160, true },
+  { 14174, true },
+  { 14189, false },
+  { 14198, true },
+  { 14212, true },
+  { 14226, true },
+  { 14237, true },
+  { 14250, true },
+  { 14274, true },
+  { 14287, true },
+  { 14299, true },
+  { 14316, true },
+  { 14327, true },
+  { 14347, true },
+  { 14365, true },
+  { 14383, true },
+  { 14398, true },
+  { 14419, true },
+  { 14443, true },
+  { 14453, true },
+  { 14463, true },
+  { 14473, true },
+  { 14484, true },
+  { 14509, true },
+  { 14538, true },
+  { 14551, true },
+  { 14563, true },
+  { 14573, true },
+  { 14581, true },
+  { 14590, true },
+  { 14604, false },
+  { 14621, true },
+  { 14633, true },
+  { 14648, true },
+  { 14655, true },
+  { 14668, true },
+  { 14680, true },
+  { 14688, true },
+  { 14703, true },
+  { 14712, true },
+  { 14724, true },
+  { 14735, true },
+  { 14751, true },
+  { 14761, true },
+  { 14776, true },
+  { 14793, true },
+  { 14806, true },
+  { 14816, true },
+  { 14829, true },
+  { 14843, true },
+  { 14857, true },
+  { 14869, true },
+  { 14884, true },
+  { 14900, true },
+  { 14915, true },
+  { 14929, true },
+  { 14942, true },
+  { 14954, true },
+  { 14968, true },
+  { 14980, true },
+  { 14992, true },
+  { 15003, true },
+  { 15014, true },
+  { 15029, true },
+  { 15044, false },
+  { 15060, true },
   { 15078, true },
-  { 15096, true },
-  { 15107, true },
-  { 15120, true },
+  { 15095, true },
+  { 15113, true },
+  { 15124, true },
   { 15137, true },
-  { 15153, true },
-  { 15173, true },
-  { 15188, true },
-  { 15199, true },
-  { 15211, true },
-  { 15224, true },
-  { 15238, true },
-  { 15251, true },
-  { 15269, true },
-  { 15287, true },
-  { 15305, true },
+  { 15154, true },
+  { 15170, true },
+  { 15190, true },
+  { 15205, true },
+  { 15216, true },
+  { 15228, true },
+  { 15241, true },
+  { 15255, true },
+  { 15268, true },
+  { 15286, true },
+  { 15304, true },
   { 15322, true },
-  { 15332, true },
-  { 15345, true },
-  { 15354, true },
-  { 15369, true },
-  { 15380, false },
-  { 15390, true },
-  { 15401, true },
-  { 15415, true },
-  { 15428, true },
-  { 15438, true },
-  { 15451, true },
-  { 15465, true },
-  { 15476, true },
-  { 15486, true },
-  { 15504, true },
-  { 15513, true },
+  { 15339, true },
+  { 15349, true },
+  { 15362, true },
+  { 15371, true },
+  { 15386, true },
+  { 15397, false },
+  { 15407, true },
+  { 15418, true },
+  { 15432, true },
+  { 15445, true },
+  { 15455, true },
+  { 15468, true },
+  { 15482, true },
+  { 15493, true },
+  { 15503, true },
+  { 15521, true },
   { 15530, true },
-  { 15549, true },
-  { 15564, true },
-  { 15582, true },
-  { 15595, true },
-  { 15610, true },
-  { 15621, true },
-  { 15635, true },
-  { 15646, true },
-  { 15654, true },
-  { 15664, true },
-  { 15675, true },
-  { 15686, true },
-  { 15713, true },
-  { 15723, true },
-  { 15735, true },
-  { 15747, true },
-  { 15756, true },
-  { 15765, true },
-  { 15774, true },
-  { 15789, true },
-  { 15800, true },
-  { 15809, true },
-  { 15821, true },
-  { 15830, true },
-  { 15840, true },
-  { 15851, true },
-  { 15861, true },
-  { 15873, true },
-  { 15887, true },
-  { 15897, true },
-  { 15907, true },
-  { 15917, false },
-  { 15928, true },
-  { 15946, true },
-  { 15956, true },
-  { 15975, true },
-  { 15987, true },
-  { 16002, true },
-  { 16023, true },
-  { 16036, true },
-  { 16049, true },
-  { 16063, true },
-  { 16076, false },
-  { 16090, true },
-  { 16102, true },
-  { 16116, true },
-  { 16134, true },
-  { 16147, false },
-  { 16156, true },
-  { 16174, true },
-  { 16185, true },
-  { 16199, true },
-  { 16212, true },
-  { 16226, true },
-  { 16239, true },
-  { 16253, true },
-  { 16265, true },
-  { 16281, false },
-  { 16292, true },
-  { 16307, true },
-  { 16320, true },
-  { 16333, true },
-  { 16349, true },
-  { 16361, true },
-  { 16374, true },
-  { 16386, true },
-  { 16402, true },
-  { 16415, true },
-  { 16425, true },
-  { 16453, true },
-  { 16468, true },
-  { 16484, true },
-  { 16495, true },
-  { 16506, true },
-  { 16516, true },
-  { 16526, false },
-  { 16540, true },
-  { 16552, false },
-  { 16571, true },
-  { 16598, true },
-  { 16619, true },
-  { 16635, true },
-  { 16646, true },
-  { 16664, true },
-  { 16679, true },
-  { 16690, true },
-  { 16705, false },
-  { 16720, true },
-  { 16730, true },
-  { 16744, true },
-  { 16766, true },
-  { 16781, true },
-  { 16802, true },
-  { 16812, true },
-  { 16826, true },
-  { 16839, true },
-  { 16854, true },
-  { 16875, true },
-  { 16887, true },
-  { 16905, true },
-  { 16923, true },
-  { 16937, true },
-  { 16956, false },
-  { 16970, true },
-  { 16980, true },
-  { 16991, true },
-  { 17001, true },
-  { 17014, true },
-  { 17029, true },
-  { 17043, true },
-  { 17056, true },
-  { 17069, true },
+  { 15547, true },
+  { 15566, true },
+  { 15581, true },
+  { 15599, true },
+  { 15612, true },
+  { 15627, true },
+  { 15638, true },
+  { 15652, true },
+  { 15663, true },
+  { 15671, true },
+  { 15681, true },
+  { 15692, true },
+  { 15703, true },
+  { 15730, true },
+  { 15740, true },
+  { 15752, true },
+  { 15764, true },
+  { 15773, true },
+  { 15782, true },
+  { 15791, true },
+  { 15806, true },
+  { 15817, true },
+  { 15826, true },
+  { 15838, true },
+  { 15847, true },
+  { 15857, true },
+  { 15868, true },
+  { 15878, true },
+  { 15890, true },
+  { 15904, true },
+  { 15914, true },
+  { 15924, true },
+  { 15934, false },
+  { 15945, true },
+  { 15963, true },
+  { 15973, true },
+  { 15992, true },
+  { 16004, true },
+  { 16019, true },
+  { 16040, true },
+  { 16053, true },
+  { 16066, true },
+  { 16080, true },
+  { 16093, false },
+  { 16107, true },
+  { 16119, true },
+  { 16133, true },
+  { 16151, true },
+  { 16164, false },
+  { 16173, true },
+  { 16191, true },
+  { 16202, true },
+  { 16216, true },
+  { 16229, true },
+  { 16243, true },
+  { 16256, true },
+  { 16270, true },
+  { 16282, true },
+  { 16298, false },
+  { 16309, true },
+  { 16324, true },
+  { 16337, true },
+  { 16350, true },
+  { 16366, true },
+  { 16378, true },
+  { 16391, true },
+  { 16403, true },
+  { 16419, true },
+  { 16432, true },
+  { 16442, true },
+  { 16470, true },
+  { 16485, true },
+  { 16501, true },
+  { 16512, true },
+  { 16523, true },
+  { 16533, true },
+  { 16543, false },
+  { 16557, true },
+  { 16569, false },
+  { 16588, true },
+  { 16615, true },
+  { 16636, true },
+  { 16652, true },
+  { 16663, true },
+  { 16681, true },
+  { 16696, true },
+  { 16707, true },
+  { 16722, false },
+  { 16737, true },
+  { 16747, true },
+  { 16761, true },
+  { 16783, true },
+  { 16798, true },
+  { 16819, true },
+  { 16829, true },
+  { 16843, true },
+  { 16856, true },
+  { 16871, true },
+  { 16892, true },
+  { 16904, true },
+  { 16922, true },
+  { 16940, true },
+  { 16954, true },
+  { 16973, false },
+  { 16987, true },
+  { 16997, true },
+  { 17008, true },
+  { 17018, true },
+  { 17031, true },
+  { 17046, true },
+  { 17060, true },
+  { 17073, true },
   { 17086, true },
-  { 17102, true },
-  { 17115, true },
+  { 17103, true },
+  { 17119, true },
   { 17132, true },
-  { 17146, true },
-  { 17158, true },
-  { 17176, true },
-  { 17189, true },
-  { 17209, true },
-  { 17225, true },
-  { 17241, true },
-  { 17250, true },
-  { 17259, true },
-  { 17268, true },
+  { 17149, true },
+  { 17163, true },
+  { 17175, true },
+  { 17193, true },
+  { 17206, true },
+  { 17226, true },
+  { 17242, true },
+  { 17258, true },
+  { 17267, true },
+  { 17276, true },
   { 17285, true },
-  { 17298, true },
-  { 17308, true },
-  { 17318, true },
-  { 17328, true },
-  { 17346, true },
-  { 17365, true },
-  { 17389, true },
-  { 17403, true },
-  { 17418, true },
-  { 17436, true },
-  { 17452, true },
-  { 17464, true },
-  { 17487, true },
-  { 17509, true },
-  { 17535, true },
-  { 17553, true },
-  { 17575, true },
-  { 17589, true },
-  { 17602, true },
-  { 17614, true },
-  { 17626, false },
-  { 17642, true },
-  { 17657, true },
-  { 17669, true },
-  { 17691, true },
+  { 17302, true },
+  { 17315, true },
+  { 17325, true },
+  { 17335, true },
+  { 17345, true },
+  { 17363, true },
+  { 17382, true },
+  { 17406, true },
+  { 17420, true },
+  { 17435, true },
+  { 17453, true },
+  { 17469, true },
+  { 17481, true },
+  { 17504, true },
+  { 17526, true },
+  { 17552, true },
+  { 17570, true },
+  { 17592, true },
+  { 17606, true },
+  { 17619, true },
+  { 17631, true },
+  { 17643, false },
+  { 17659, true },
+  { 17674, true },
+  { 17686, true },
   { 17708, true },
-  { 17723, true },
-  { 17744, true },
-  { 17758, true },
-  { 17777, true },
+  { 17725, true },
+  { 17740, true },
+  { 17761, true },
+  { 17775, true },
   { 17794, true },
-  { 17808, true },
-  { 17821, true },
-  { 17837, true },
-  { 17850, true },
-  { 17869, true },
+  { 17811, true },
+  { 17825, true },
+  { 17838, true },
+  { 17854, true },
+  { 17867, true },
   { 17886, true },
-  { 17904, true },
-  { 17922, true },
-  { 17931, true },
-  { 17947, true },
-  { 17963, true },
-  { 17982, true },
-  { 18000, true },
-  { 18016, true },
-  { 18030, true },
-  { 18042, true },
-  { 18053, true },
-  { 18067, true },
-  { 18077, true },
-  { 18088, true },
-  { 18097, false },
-  { 18106, true },
-  { 18120, true },
-  { 18134, true },
-  { 18146, true },
-  { 18161, true },
-  { 18171, true },
-  { 18184, true },
-  { 18195, true },
-  { 18218, true },
-  { 18230, true },
-  { 18245, true },
-  { 18261, true },
-  { 18270, true },
-  { 18285, true },
-  { 18301, true },
-  { 18316, true },
-  { 18329, true },
-  { 18342, true },
-  { 18361, true },
-  { 18371, true },
-  { 18381, true },
-  { 18393, true },
-  { 18408, true },
-  { 18423, true },
-  { 18433, true },
-  { 18448, true },
-  { 18464, true },
-  { 18483, true },
-  { 18492, true },
-  { 18505, true },
-  { 18525, true },
-  { 18540, false },
-  { 18555, true },
-  { 18570, true },
-  { 18585, true },
-  { 18595, true },
-  { 18605, true },
-  { 18620, true },
-  { 18642, true },
-  { 18657, true },
-  { 18670, true },
-  { 18697, true },
-  { 18711, true },
-  { 18723, true },
-  { 18738, true },
-  { 18752, true },
-  { 18762, true },
-  { 18783, true },
+  { 17903, true },
+  { 17921, true },
+  { 17939, true },
+  { 17948, true },
+  { 17964, true },
+  { 17980, true },
+  { 17999, true },
+  { 18017, true },
+  { 18033, true },
+  { 18047, true },
+  { 18059, true },
+  { 18070, true },
+  { 18084, true },
+  { 18094, true },
+  { 18105, true },
+  { 18114, false },
+  { 18123, true },
+  { 18137, true },
+  { 18151, true },
+  { 18163, true },
+  { 18178, true },
+  { 18188, true },
+  { 18201, true },
+  { 18212, true },
+  { 18235, true },
+  { 18247, true },
+  { 18262, true },
+  { 18278, true },
+  { 18287, true },
+  { 18302, true },
+  { 18318, true },
+  { 18333, true },
+  { 18346, true },
+  { 18359, true },
+  { 18378, true },
+  { 18388, true },
+  { 18398, true },
+  { 18410, true },
+  { 18425, true },
+  { 18440, true },
+  { 18450, true },
+  { 18465, true },
+  { 18481, true },
+  { 18500, true },
+  { 18509, true },
+  { 18522, true },
+  { 18542, true },
+  { 18557, false },
+  { 18572, true },
+  { 18587, true },
+  { 18602, true },
+  { 18612, true },
+  { 18622, true },
+  { 18637, true },
+  { 18659, true },
+  { 18674, true },
+  { 18687, true },
+  { 18714, true },
+  { 18728, true },
+  { 18740, true },
+  { 18755, true },
+  { 18769, true },
+  { 18779, true },
   { 18800, true },
   { 18822, true },
   { 18840, false },
@@ -15587,9289 +15580,9284 @@ static const nsSTSPreload kSTSPreloadList[] = {
   { 19708, true },
   { 19720, true },
   { 19734, true },
+  { 19746, true },
   { 19759, true },
-  { 19771, true },
-  { 19788, true },
-  { 19799, true },
-  { 19810, true },
-  { 19821, true },
-  { 19840, true },
-  { 19856, true },
-  { 19866, true },
-  { 19877, true },
-  { 19889, true },
-  { 19904, true },
-  { 19923, true },
-  { 19940, true },
+  { 19784, true },
+  { 19796, true },
+  { 19813, true },
+  { 19824, true },
+  { 19835, true },
+  { 19846, true },
+  { 19865, true },
+  { 19881, true },
+  { 19891, true },
+  { 19902, true },
+  { 19914, true },
+  { 19929, true },
   { 19948, true },
-  { 19964, true },
-  { 19978, true },
-  { 19995, true },
-  { 20012, true },
-  { 20025, true },
-  { 20038, true },
-  { 20051, true },
-  { 20064, true },
-  { 20077, true },
-  { 20090, true },
-  { 20103, true },
-  { 20116, true },
-  { 20129, true },
-  { 20142, true },
-  { 20155, true },
-  { 20168, true },
-  { 20181, true },
-  { 20194, true },
-  { 20211, true },
-  { 20226, true },
-  { 20238, true },
-  { 20260, true },
-  { 20272, true },
-  { 20295, true },
-  { 20319, true },
-  { 20337, true },
-  { 20356, false },
-  { 20377, true },
-  { 20390, true },
-  { 20405, true },
-  { 20421, true },
-  { 20447, true },
-  { 20457, true },
-  { 20474, true },
-  { 20489, true },
-  { 20508, true },
-  { 20525, true },
-  { 20536, true },
-  { 20552, true },
-  { 20564, true },
-  { 20574, true },
-  { 20584, true },
-  { 20605, true },
-  { 20627, true },
-  { 20639, true },
-  { 20650, true },
-  { 20665, true },
-  { 20676, true },
-  { 20691, true },
-  { 20706, true },
-  { 20718, true },
-  { 20737, true },
-  { 20750, true },
-  { 20764, true },
-  { 20786, true },
-  { 20805, true },
-  { 20825, true },
-  { 20833, true },
-  { 20846, true },
-  { 20860, true },
-  { 20874, true },
+  { 19965, true },
+  { 19973, true },
+  { 19989, true },
+  { 20003, true },
+  { 20020, true },
+  { 20037, true },
+  { 20050, true },
+  { 20063, true },
+  { 20076, true },
+  { 20089, true },
+  { 20102, true },
+  { 20115, true },
+  { 20128, true },
+  { 20141, true },
+  { 20154, true },
+  { 20167, true },
+  { 20180, true },
+  { 20193, true },
+  { 20206, true },
+  { 20219, true },
+  { 20236, true },
+  { 20251, true },
+  { 20263, true },
+  { 20285, true },
+  { 20297, true },
+  { 20320, true },
+  { 20344, true },
+  { 20362, true },
+  { 20381, false },
+  { 20402, true },
+  { 20415, true },
+  { 20430, true },
+  { 20446, true },
+  { 20472, true },
+  { 20482, true },
+  { 20499, true },
+  { 20514, true },
+  { 20533, true },
+  { 20550, true },
+  { 20561, true },
+  { 20577, true },
+  { 20589, true },
+  { 20599, true },
+  { 20609, true },
+  { 20630, true },
+  { 20652, true },
+  { 20664, true },
+  { 20675, true },
+  { 20690, true },
+  { 20701, true },
+  { 20716, true },
+  { 20731, true },
+  { 20743, true },
+  { 20762, true },
+  { 20775, true },
+  { 20789, true },
+  { 20811, true },
+  { 20830, true },
+  { 20850, true },
+  { 20858, true },
+  { 20871, true },
   { 20885, true },
-  { 20898, true },
-  { 20914, true },
-  { 20929, true },
-  { 20943, true },
-  { 20961, true },
-  { 20973, true },
-  { 20990, false },
-  { 21006, false },
-  { 21026, true },
-  { 21039, true },
-  { 21055, true },
+  { 20899, true },
+  { 20910, true },
+  { 20923, true },
+  { 20939, true },
+  { 20954, true },
+  { 20968, true },
+  { 20986, true },
+  { 20998, true },
+  { 21015, false },
+  { 21031, false },
+  { 21051, true },
+  { 21064, true },
   { 21080, true },
-  { 21096, true },
-  { 21109, true },
-  { 21122, true },
-  { 21133, true },
-  { 21149, true },
-  { 21163, true },
-  { 21179, true },
-  { 21190, true },
-  { 21203, true },
-  { 21218, true },
-  { 21232, true },
-  { 21244, true },
-  { 21264, true },
-  { 21276, true },
+  { 21105, true },
+  { 21121, true },
+  { 21134, true },
+  { 21147, true },
+  { 21158, true },
+  { 21174, true },
+  { 21188, true },
+  { 21204, true },
+  { 21215, true },
+  { 21228, true },
+  { 21243, true },
+  { 21257, true },
+  { 21269, true },
   { 21289, true },
-  { 21302, true },
-  { 21323, true },
-  { 21343, true },
-  { 21357, true },
-  { 21372, true },
-  { 21381, true },
-  { 21392, true },
-  { 21402, true },
-  { 21412, true },
-  { 21430, true },
+  { 21301, true },
+  { 21314, true },
+  { 21327, true },
+  { 21348, true },
+  { 21368, true },
+  { 21382, true },
+  { 21397, true },
+  { 21406, true },
+  { 21417, true },
+  { 21427, true },
+  { 21437, true },
   { 21455, true },
-  { 21466, true },
-  { 21488, true },
-  { 21500, true },
-  { 21513, true },
-  { 21526, true },
-  { 21534, true },
-  { 21553, true },
-  { 21563, true },
-  { 21576, true },
-  { 21591, true },
-  { 21608, true },
-  { 21624, true },
-  { 21636, true },
-  { 21648, true },
-  { 21659, true },
+  { 21480, true },
+  { 21502, true },
+  { 21514, true },
+  { 21527, true },
+  { 21540, true },
+  { 21548, true },
+  { 21567, true },
+  { 21577, true },
+  { 21590, true },
+  { 21605, true },
+  { 21622, true },
+  { 21638, true },
+  { 21650, true },
+  { 21662, true },
   { 21673, true },
-  { 21697, false },
-  { 21711, true },
-  { 21726, true },
-  { 21741, true },
-  { 21763, true },
-  { 21774, true },
-  { 21787, true },
-  { 21807, true },
-  { 21818, true },
-  { 21826, false },
-  { 21838, true },
-  { 21855, true },
-  { 21874, true },
+  { 21687, true },
+  { 21711, false },
+  { 21725, true },
+  { 21740, true },
+  { 21755, true },
+  { 21777, true },
+  { 21788, true },
+  { 21801, true },
+  { 21821, true },
+  { 21832, true },
+  { 21840, false },
+  { 21852, true },
+  { 21869, true },
   { 21888, true },
-  { 21903, true },
-  { 21918, true },
-  { 21928, false },
-  { 21937, true },
+  { 21902, true },
+  { 21917, true },
+  { 21932, true },
+  { 21942, false },
   { 21951, true },
-  { 21963, true },
-  { 21989, true },
-  { 22004, true },
-  { 22019, true },
-  { 22031, true },
-  { 22049, true },
-  { 22069, true },
-  { 22085, true },
-  { 22097, true },
-  { 22114, true },
-  { 22126, true },
+  { 21965, true },
+  { 21977, true },
+  { 22003, true },
+  { 22018, true },
+  { 22033, true },
+  { 22045, true },
+  { 22063, true },
+  { 22083, true },
+  { 22099, true },
+  { 22111, true },
+  { 22128, true },
   { 22140, true },
-  { 22160, true },
-  { 22172, true },
-  { 22189, true },
-  { 22198, true },
-  { 22210, true },
-  { 22232, false },
-  { 22246, true },
-  { 22262, true },
-  { 22279, true },
-  { 22291, true },
-  { 22309, false },
-  { 22331, false },
-  { 22356, false },
-  { 22380, true },
-  { 22392, true },
-  { 22402, true },
-  { 22415, true },
-  { 22425, true },
-  { 22435, true },
-  { 22445, true },
-  { 22455, true },
-  { 22465, true },
-  { 22475, true },
-  { 22485, true },
+  { 22154, true },
+  { 22174, true },
+  { 22186, true },
+  { 22203, true },
+  { 22212, true },
+  { 22224, true },
+  { 22246, false },
+  { 22260, true },
+  { 22276, true },
+  { 22293, true },
+  { 22305, true },
+  { 22323, false },
+  { 22345, false },
+  { 22370, false },
+  { 22394, true },
+  { 22406, true },
+  { 22416, true },
+  { 22429, true },
+  { 22439, true },
+  { 22449, true },
+  { 22459, true },
+  { 22469, true },
+  { 22479, true },
+  { 22489, true },
   { 22499, true },
-  { 22517, true },
-  { 22532, true },
+  { 22513, true },
+  { 22531, true },
   { 22546, true },
-  { 22558, true },
-  { 22570, true },
-  { 22581, true },
+  { 22560, true },
+  { 22572, true },
+  { 22584, true },
   { 22595, true },
-  { 22610, true },
+  { 22609, true },
   { 22624, true },
-  { 22631, true },
-  { 22645, false },
-  { 22665, true },
-  { 22684, true },
-  { 22699, true },
-  { 22711, true },
-  { 22722, true },
-  { 22733, true },
-  { 22745, true },
-  { 22758, false },
-  { 22771, true },
-  { 22787, true },
-  { 22800, true },
-  { 22812, true },
-  { 22827, true },
-  { 22837, true },
-  { 22862, true },
-  { 22879, true },
-  { 22899, true },
-  { 22911, true },
-  { 22927, true },
-  { 22955, false },
-  { 22967, true },
-  { 22980, true },
-  { 22989, true },
-  { 22999, true },
-  { 23008, true },
-  { 23017, true },
-  { 23024, true },
-  { 23039, true },
-  { 23050, false },
-  { 23066, true },
-  { 23083, true },
+  { 22638, true },
+  { 22645, true },
+  { 22659, false },
+  { 22679, true },
+  { 22698, true },
+  { 22713, true },
+  { 22725, true },
+  { 22736, true },
+  { 22747, true },
+  { 22759, true },
+  { 22772, false },
+  { 22785, true },
+  { 22801, true },
+  { 22814, true },
+  { 22826, true },
+  { 22841, true },
+  { 22851, true },
+  { 22876, true },
+  { 22893, true },
+  { 22913, true },
+  { 22925, true },
+  { 22941, true },
+  { 22969, false },
+  { 22981, true },
+  { 22994, true },
+  { 23003, true },
+  { 23013, true },
+  { 23022, true },
+  { 23031, true },
+  { 23038, true },
+  { 23053, true },
+  { 23064, false },
+  { 23080, true },
   { 23097, true },
-  { 23107, true },
-  { 23127, true },
-  { 23147, true },
-  { 23158, true },
+  { 23111, true },
+  { 23121, true },
+  { 23141, true },
+  { 23161, true },
   { 23172, true },
-  { 23187, true },
-  { 23200, true },
-  { 23215, true },
-  { 23232, true },
-  { 23240, true },
+  { 23186, true },
+  { 23201, true },
+  { 23214, true },
+  { 23229, true },
+  { 23246, true },
   { 23254, true },
-  { 23266, true },
-  { 23283, false },
-  { 23304, false },
-  { 23326, false },
-  { 23345, false },
-  { 23363, true },
-  { 23379, true },
-  { 23403, true },
-  { 23431, true },
-  { 23442, true },
-  { 23457, true },
-  { 23476, true },
-  { 23499, true },
-  { 23523, true },
-  { 23540, true },
+  { 23268, true },
+  { 23280, true },
+  { 23297, false },
+  { 23318, false },
+  { 23340, false },
+  { 23359, false },
+  { 23377, true },
+  { 23393, true },
+  { 23417, true },
+  { 23445, true },
+  { 23456, true },
+  { 23471, true },
+  { 23490, true },
+  { 23513, true },
+  { 23537, true },
   { 23554, true },
-  { 23565, true },
-  { 23583, true },
-  { 23598, true },
-  { 23611, true },
-  { 23624, true },
-  { 23639, true },
-  { 23654, true },
-  { 23666, true },
-  { 23681, true },
-  { 23700, true },
-  { 23718, true },
-  { 23726, true },
-  { 23734, true },
-  { 23746, true },
-  { 23758, true },
-  { 23776, true },
-  { 23791, true },
-  { 23806, true },
-  { 23821, true },
-  { 23837, true },
-  { 23854, true },
-  { 23867, true },
-  { 23877, true },
-  { 23890, false },
-  { 23904, true },
-  { 23920, false },
-  { 23927, true },
-  { 23937, true },
+  { 23568, true },
+  { 23579, true },
+  { 23597, true },
+  { 23612, true },
+  { 23625, true },
+  { 23638, true },
+  { 23653, true },
+  { 23668, true },
+  { 23680, true },
+  { 23695, true },
+  { 23714, true },
+  { 23732, true },
+  { 23740, true },
+  { 23748, true },
+  { 23760, true },
+  { 23772, true },
+  { 23790, true },
+  { 23805, true },
+  { 23820, true },
+  { 23835, true },
+  { 23851, true },
+  { 23868, true },
+  { 23881, true },
+  { 23891, true },
+  { 23904, false },
+  { 23918, true },
+  { 23934, false },
+  { 23941, true },
   { 23951, true },
-  { 23966, true },
-  { 23974, true },
-  { 23982, true },
-  { 23992, true },
-  { 24010, true },
-  { 24023, true },
-  { 24036, true },
+  { 23965, true },
+  { 23980, true },
+  { 23988, true },
+  { 23996, true },
+  { 24006, true },
+  { 24024, true },
+  { 24037, true },
   { 24050, true },
-  { 24059, true },
-  { 24074, true },
-  { 24103, true },
-  { 24120, true },
-  { 24138, true },
-  { 24148, true },
+  { 24064, true },
+  { 24073, true },
+  { 24088, true },
+  { 24117, true },
+  { 24134, true },
+  { 24152, true },
   { 24162, true },
-  { 24173, true },
-  { 24190, true },
+  { 24176, true },
+  { 24187, true },
   { 24204, true },
-  { 24226, true },
-  { 24251, true },
-  { 24264, true },
-  { 24277, true },
-  { 24294, true },
-  { 24312, true },
-  { 24327, true },
-  { 24337, true },
-  { 24358, true },
-  { 24368, false },
-  { 24387, true },
-  { 24399, true },
-  { 24428, true },
-  { 24449, true },
+  { 24218, true },
+  { 24240, true },
+  { 24265, true },
+  { 24278, true },
+  { 24291, true },
+  { 24308, true },
+  { 24326, true },
+  { 24341, true },
+  { 24351, true },
+  { 24372, true },
+  { 24382, false },
+  { 24401, true },
+  { 24413, true },
+  { 24442, true },
   { 24463, true },
-  { 24489, true },
+  { 24477, true },
   { 24503, true },
-  { 24511, true },
-  { 24524, true },
-  { 24536, true },
-  { 24548, true },
-  { 24564, true },
+  { 24517, true },
+  { 24525, true },
+  { 24538, true },
+  { 24550, true },
+  { 24562, true },
   { 24578, true },
-  { 24597, true },
-  { 24610, true },
-  { 24623, true },
-  { 24642, true },
-  { 24655, false },
-  { 24665, true },
-  { 24687, true },
+  { 24592, true },
+  { 24611, true },
+  { 24624, true },
+  { 24637, true },
+  { 24656, true },
+  { 24669, false },
+  { 24679, true },
   { 24701, true },
-  { 24717, true },
-  { 24732, true },
-  { 24748, true },
-  { 24765, true },
-  { 24776, false },
-  { 24784, true },
-  { 24800, true },
-  { 24820, true },
+  { 24715, true },
+  { 24731, true },
+  { 24746, true },
+  { 24762, true },
+  { 24779, true },
+  { 24790, false },
+  { 24798, true },
+  { 24814, true },
   { 24834, true },
-  { 24849, true },
-  { 24862, true },
-  { 24874, true },
-  { 24887, true },
-  { 24900, false },
-  { 24922, true },
-  { 24946, true },
-  { 24969, true },
-  { 24987, true },
-  { 25013, true },
-  { 25040, true },
-  { 25063, true },
-  { 25079, true },
-  { 25104, true },
-  { 25133, true },
-  { 25149, true },
-  { 25161, true },
-  { 25174, true },
-  { 25187, true },
-  { 25196, true },
-  { 25205, true },
-  { 25222, true },
-  { 25235, true },
-  { 25244, true },
-  { 25261, true },
-  { 25270, true },
-  { 25278, true },
-  { 25287, true },
-  { 25296, true },
-  { 25320, true },
-  { 25330, true },
-  { 25340, true },
-  { 25349, true },
-  { 25362, true },
-  { 25374, true },
+  { 24848, true },
+  { 24863, true },
+  { 24876, true },
+  { 24888, true },
+  { 24901, true },
+  { 24914, false },
+  { 24936, true },
+  { 24960, true },
+  { 24983, true },
+  { 25001, true },
+  { 25027, true },
+  { 25054, true },
+  { 25077, true },
+  { 25093, true },
+  { 25118, true },
+  { 25147, true },
+  { 25163, true },
+  { 25175, true },
+  { 25188, true },
+  { 25201, true },
+  { 25210, true },
+  { 25219, true },
+  { 25236, true },
+  { 25249, true },
+  { 25258, true },
+  { 25275, true },
+  { 25284, true },
+  { 25292, true },
+  { 25301, true },
+  { 25310, true },
+  { 25334, true },
+  { 25344, true },
+  { 25354, true },
+  { 25363, true },
+  { 25376, true },
   { 25388, true },
   { 25402, true },
-  { 25420, true },
-  { 25435, true },
+  { 25416, true },
+  { 25434, true },
   { 25449, true },
-  { 25461, true },
-  { 25477, true },
-  { 25490, true },
-  { 25505, true },
-  { 25517, true },
-  { 25532, true },
+  { 25463, true },
+  { 25475, true },
+  { 25491, true },
+  { 25504, true },
+  { 25519, true },
+  { 25531, true },
   { 25546, true },
-  { 25555, true },
-  { 25564, true },
+  { 25560, true },
+  { 25569, true },
   { 25578, true },
-  { 25587, true },
+  { 25592, true },
   { 25601, true },
-  { 25614, true },
-  { 25624, true },
-  { 25634, true },
-  { 25649, true },
-  { 25664, true },
+  { 25615, true },
+  { 25628, true },
+  { 25638, true },
+  { 25648, true },
+  { 25663, true },
   { 25678, true },
-  { 25693, true },
-  { 25706, true },
-  { 25725, true },
-  { 25741, true },
+  { 25692, true },
+  { 25707, true },
+  { 25720, true },
+  { 25739, true },
   { 25755, true },
-  { 25771, true },
-  { 25782, true },
+  { 25769, true },
+  { 25785, true },
   { 25796, true },
-  { 25806, true },
-  { 25818, true },
-  { 25834, true },
+  { 25810, true },
+  { 25820, true },
+  { 25832, true },
   { 25848, true },
-  { 25853, true },
-  { 25864, true },
-  { 25872, true },
-  { 25879, true },
-  { 25888, true },
-  { 25903, false },
-  { 25923, true },
-  { 25933, true },
-  { 25946, true },
-  { 25964, true },
-  { 25977, true },
-  { 25993, true },
-  { 26005, true },
-  { 26017, true },
-  { 26030, true },
-  { 26041, true },
-  { 26052, true },
+  { 25862, true },
+  { 25867, true },
+  { 25878, true },
+  { 25886, true },
+  { 25893, true },
+  { 25902, true },
+  { 25917, false },
+  { 25937, true },
+  { 25947, true },
+  { 25960, true },
+  { 25978, true },
+  { 25991, true },
+  { 26007, true },
+  { 26019, true },
+  { 26031, true },
+  { 26044, true },
+  { 26055, true },
   { 26066, true },
-  { 26084, true },
-  { 26097, true },
-  { 26110, true },
-  { 26126, true },
-  { 26146, true },
-  { 26154, true },
-  { 26165, false },
-  { 26175, true },
-  { 26187, true },
+  { 26080, true },
+  { 26098, true },
+  { 26111, true },
+  { 26124, true },
+  { 26140, true },
+  { 26160, true },
+  { 26168, true },
+  { 26179, false },
+  { 26189, true },
   { 26201, true },
-  { 26220, true },
-  { 26228, true },
-  { 26252, true },
-  { 26271, true },
-  { 26285, false },
-  { 26301, true },
+  { 26215, true },
+  { 26234, true },
+  { 26242, true },
+  { 26266, true },
+  { 26285, true },
+  { 26299, false },
   { 26315, true },
-  { 26327, false },
-  { 26342, true },
-  { 26354, false },
-  { 26362, true },
-  { 26374, true },
-  { 26388, false },
-  { 26400, true },
-  { 26412, true },
-  { 26423, true },
+  { 26329, true },
+  { 26341, false },
+  { 26356, true },
+  { 26368, false },
+  { 26376, true },
+  { 26388, true },
+  { 26402, false },
+  { 26414, true },
+  { 26426, true },
   { 26437, true },
-  { 26450, true },
-  { 26462, true },
-  { 26475, true },
-  { 26495, true },
-  { 26505, true },
-  { 26524, true },
-  { 26536, true },
-  { 26547, true },
-  { 26559, true },
-  { 26582, true },
-  { 26605, true },
-  { 26616, true },
-  { 26631, true },
-  { 26647, true },
-  { 26663, true },
-  { 26681, false },
-  { 26704, true },
-  { 26724, true },
+  { 26451, true },
+  { 26464, true },
+  { 26476, true },
+  { 26489, true },
+  { 26509, true },
+  { 26519, true },
+  { 26538, true },
+  { 26550, true },
+  { 26561, true },
+  { 26573, true },
+  { 26596, true },
+  { 26619, true },
+  { 26630, true },
+  { 26645, true },
+  { 26661, true },
+  { 26677, true },
+  { 26695, false },
+  { 26718, true },
   { 26738, true },
-  { 26761, true },
-  { 26780, true },
-  { 26798, true },
-  { 26815, true },
-  { 26841, true },
-  { 26860, true },
-  { 26876, true },
+  { 26752, true },
+  { 26775, true },
+  { 26794, true },
+  { 26812, true },
+  { 26829, true },
+  { 26855, true },
+  { 26874, true },
   { 26890, true },
-  { 26911, true },
-  { 26927, true },
-  { 26952, true },
+  { 26904, true },
+  { 26925, true },
+  { 26941, true },
   { 26966, true },
-  { 26984, true },
-  { 26993, true },
-  { 27005, true },
-  { 27018, true },
-  { 27030, true },
-  { 27043, true },
+  { 26980, true },
+  { 26998, true },
+  { 27007, true },
+  { 27019, true },
+  { 27032, true },
+  { 27044, true },
   { 27057, true },
-  { 27067, true },
-  { 27080, true },
-  { 27088, true },
-  { 27095, true },
-  { 27107, true },
-  { 27127, true },
-  { 27139, true },
-  { 27154, true },
-  { 27180, true },
-  { 27202, true },
+  { 27071, true },
+  { 27081, true },
+  { 27094, true },
+  { 27102, true },
+  { 27109, true },
+  { 27121, true },
+  { 27141, true },
+  { 27153, true },
+  { 27168, true },
+  { 27194, true },
   { 27216, true },
-  { 27228, true },
-  { 27238, true },
-  { 27251, true },
-  { 27259, true },
+  { 27230, true },
+  { 27242, true },
+  { 27252, true },
+  { 27265, true },
   { 27273, true },
-  { 27297, true },
+  { 27287, true },
   { 27311, true },
-  { 27335, true },
-  { 27346, true },
-  { 27355, true },
-  { 27377, true },
-  { 27400, true },
-  { 27424, true },
-  { 27447, false },
-  { 27478, false },
-  { 27493, true },
-  { 27505, true },
-  { 27525, true },
-  { 27540, true },
-  { 27556, true },
-  { 27567, true },
-  { 27583, true },
-  { 27594, true },
+  { 27325, true },
+  { 27349, true },
+  { 27360, true },
+  { 27369, true },
+  { 27391, true },
+  { 27414, true },
+  { 27438, true },
+  { 27461, false },
+  { 27492, false },
+  { 27507, true },
+  { 27519, true },
+  { 27539, true },
+  { 27554, true },
+  { 27570, true },
+  { 27581, true },
+  { 27597, true },
   { 27608, true },
-  { 27618, true },
-  { 27627, false },
-  { 27640, true },
-  { 27657, true },
+  { 27622, true },
+  { 27632, true },
+  { 27641, false },
+  { 27654, true },
   { 27671, true },
   { 27685, true },
-  { 27697, true },
-  { 27714, true },
-  { 27733, true },
-  { 27746, true },
-  { 27766, true },
-  { 27788, true },
-  { 27801, true },
-  { 27812, true },
+  { 27699, true },
+  { 27711, true },
+  { 27728, true },
+  { 27747, true },
+  { 27760, true },
+  { 27780, true },
+  { 27802, true },
+  { 27815, true },
   { 27826, true },
-  { 27837, true },
-  { 27853, true },
-  { 27862, true },
-  { 27877, true },
+  { 27840, true },
+  { 27851, true },
+  { 27867, true },
+  { 27876, true },
   { 27891, true },
-  { 27907, true },
-  { 27920, true },
-  { 27933, true },
-  { 27945, true },
-  { 27958, true },
-  { 27971, true },
-  { 27983, true },
-  { 27996, true },
-  { 28008, true },
-  { 28027, true },
-  { 28042, true },
-  { 28058, true },
-  { 28076, true },
-  { 28087, true },
-  { 28095, false },
-  { 28118, true },
-  { 28131, true },
-  { 28142, true },
-  { 28154, false },
-  { 28164, true },
-  { 28180, false },
-  { 28191, true },
-  { 28200, true },
-  { 28213, true },
-  { 28231, true },
-  { 28242, true },
-  { 28252, true },
-  { 28264, true },
-  { 28280, true },
-  { 28290, true },
-  { 28298, false },
-  { 28306, true },
-  { 28321, true },
+  { 27905, true },
+  { 27921, true },
+  { 27934, true },
+  { 27947, true },
+  { 27959, true },
+  { 27972, true },
+  { 27985, true },
+  { 27997, true },
+  { 28010, true },
+  { 28022, true },
+  { 28041, true },
+  { 28056, true },
+  { 28072, true },
+  { 28090, true },
+  { 28101, true },
+  { 28109, false },
+  { 28132, true },
+  { 28145, true },
+  { 28156, true },
+  { 28168, false },
+  { 28178, true },
+  { 28194, false },
+  { 28205, true },
+  { 28214, true },
+  { 28227, true },
+  { 28245, true },
+  { 28256, true },
+  { 28266, true },
+  { 28278, true },
+  { 28294, true },
+  { 28304, true },
+  { 28312, false },
+  { 28320, true },
   { 28335, true },
   { 28349, true },
-  { 28359, true },
-  { 28367, true },
+  { 28363, true },
+  { 28373, true },
   { 28381, true },
   { 28395, true },
-  { 28411, true },
-  { 28426, true },
-  { 28437, false },
-  { 28450, true },
-  { 28468, true },
-  { 28484, true },
-  { 28495, true },
-  { 28513, true },
-  { 28535, false },
-  { 28552, true },
-  { 28567, true },
-  { 28583, true },
-  { 28599, true },
-  { 28618, true },
-  { 28635, true },
-  { 28650, true },
-  { 28665, true },
-  { 28680, true },
-  { 28701, true },
-  { 28719, true },
-  { 28731, true },
-  { 28744, true },
-  { 28757, true },
+  { 28409, true },
+  { 28425, true },
+  { 28440, true },
+  { 28451, false },
+  { 28464, true },
+  { 28482, true },
+  { 28498, true },
+  { 28509, true },
+  { 28527, true },
+  { 28549, false },
+  { 28566, true },
+  { 28581, true },
+  { 28597, true },
+  { 28613, true },
+  { 28632, true },
+  { 28649, true },
+  { 28664, true },
+  { 28679, true },
+  { 28694, true },
+  { 28715, true },
+  { 28733, true },
+  { 28745, true },
+  { 28758, true },
   { 28771, true },
-  { 28786, true },
+  { 28785, true },
   { 28800, true },
-  { 28813, true },
-  { 28824, true },
-  { 28834, true },
-  { 28851, true },
-  { 28867, true },
-  { 28883, true },
-  { 28898, true },
-  { 28910, true },
-  { 28921, false },
-  { 28929, true },
-  { 28950, true },
-  { 28958, true },
-  { 28971, true },
-  { 28979, true },
-  { 28987, true },
-  { 29005, true },
+  { 28814, true },
+  { 28827, true },
+  { 28838, true },
+  { 28848, true },
+  { 28865, true },
+  { 28881, true },
+  { 28897, true },
+  { 28912, true },
+  { 28924, true },
+  { 28935, false },
+  { 28943, true },
+  { 28964, true },
+  { 28972, true },
+  { 28985, true },
+  { 28993, true },
+  { 29001, true },
   { 29019, true },
   { 29033, true },
-  { 29041, true },
-  { 29051, true },
-  { 29059, true },
+  { 29047, true },
+  { 29055, true },
+  { 29065, true },
   { 29073, true },
-  { 29093, true },
-  { 29101, true },
-  { 29110, false },
-  { 29130, true },
-  { 29148, true },
-  { 29159, true },
-  { 29177, true },
-  { 29195, true },
-  { 29215, true },
-  { 29227, true },
-  { 29239, true },
-  { 29255, true },
+  { 29087, true },
+  { 29107, true },
+  { 29115, true },
+  { 29124, false },
+  { 29144, true },
+  { 29162, true },
+  { 29173, true },
+  { 29191, true },
+  { 29209, true },
+  { 29229, true },
+  { 29241, true },
+  { 29253, true },
   { 29269, true },
-  { 29286, true },
-  { 29299, true },
-  { 29316, true },
-  { 29329, true },
+  { 29283, true },
+  { 29300, true },
+  { 29313, true },
+  { 29330, true },
   { 29343, true },
-  { 29356, true },
+  { 29357, true },
   { 29370, true },
-  { 29380, true },
-  { 29397, true },
-  { 29417, true },
-  { 29426, true },
-  { 29446, true },
-  { 29463, true },
-  { 29483, true },
+  { 29384, true },
+  { 29394, true },
+  { 29411, true },
+  { 29431, true },
+  { 29440, true },
+  { 29460, true },
+  { 29477, true },
   { 29497, true },
-  { 29517, true },
-  { 29535, true },
+  { 29511, true },
+  { 29531, true },
   { 29549, true },
-  { 29567, true },
-  { 29577, true },
-  { 29607, true },
-  { 29622, true },
-  { 29635, true },
-  { 29648, true },
+  { 29563, true },
+  { 29581, true },
+  { 29591, true },
+  { 29621, true },
+  { 29636, true },
+  { 29649, true },
   { 29662, true },
-  { 29677, true },
-  { 29697, false },
-  { 29707, true },
-  { 29724, true },
-  { 29734, true },
-  { 29745, true },
-  { 29753, true },
-  { 29766, true },
-  { 29787, true },
-  { 29808, true },
-  { 29829, false },
-  { 29845, true },
-  { 29858, true },
-  { 29873, true },
-  { 29885, false },
-  { 29906, true },
-  { 29926, true },
-  { 29948, true },
+  { 29676, true },
+  { 29691, true },
+  { 29711, false },
+  { 29721, true },
+  { 29738, true },
+  { 29748, true },
+  { 29759, true },
+  { 29767, true },
+  { 29780, true },
+  { 29801, true },
+  { 29822, true },
+  { 29843, false },
+  { 29859, true },
+  { 29872, true },
+  { 29887, true },
+  { 29899, false },
+  { 29920, true },
+  { 29940, true },
   { 29962, true },
-  { 29980, true },
-  { 30000, true },
-  { 30013, true },
+  { 29976, true },
+  { 29994, true },
+  { 30014, true },
   { 30027, true },
-  { 30043, true },
-  { 30061, true },
-  { 30072, true },
-  { 30085, true },
-  { 30097, true },
+  { 30041, true },
+  { 30057, true },
+  { 30075, true },
+  { 30086, true },
+  { 30099, true },
   { 30111, true },
-  { 30126, true },
-  { 30145, true },
-  { 30157, false },
-  { 30179, true },
-  { 30187, true },
-  { 30204, true },
+  { 30125, true },
+  { 30140, true },
+  { 30159, true },
+  { 30171, false },
+  { 30193, true },
+  { 30201, true },
   { 30218, true },
-  { 30235, true },
-  { 30253, true },
-  { 30264, true },
-  { 30288, true },
-  { 30304, true },
-  { 30320, true },
-  { 30335, true },
-  { 30348, true },
-  { 30369, true },
-  { 30378, true },
-  { 30393, true },
-  { 30406, false },
-  { 30416, true },
-  { 30435, true },
+  { 30232, true },
+  { 30249, true },
+  { 30267, true },
+  { 30278, true },
+  { 30302, true },
+  { 30318, true },
+  { 30334, true },
+  { 30349, true },
+  { 30362, true },
+  { 30383, true },
+  { 30392, true },
+  { 30407, true },
+  { 30420, false },
+  { 30430, true },
   { 30449, true },
-  { 30469, true },
-  { 30478, true },
-  { 30496, false },
-  { 30518, true },
-  { 30527, true },
-  { 30546, false },
-  { 30562, false },
-  { 30576, true },
-  { 30592, true },
-  { 30607, true },
-  { 30625, true },
-  { 30643, true },
-  { 30663, true },
-  { 30685, true },
-  { 30703, true },
-  { 30720, true },
-  { 30735, true },
-  { 30750, true },
-  { 30765, true },
-  { 30782, false },
-  { 30798, true },
+  { 30463, true },
+  { 30483, true },
+  { 30492, true },
+  { 30510, false },
+  { 30532, true },
+  { 30541, true },
+  { 30560, false },
+  { 30576, false },
+  { 30590, true },
+  { 30606, true },
+  { 30621, true },
+  { 30639, true },
+  { 30657, true },
+  { 30677, true },
+  { 30699, true },
+  { 30717, true },
+  { 30734, true },
+  { 30749, true },
+  { 30764, true },
+  { 30779, true },
+  { 30796, false },
   { 30812, true },
   { 30826, true },
-  { 30845, true },
-  { 30862, true },
-  { 30877, true },
-  { 30904, true },
-  { 30924, true },
-  { 30946, false },
-  { 30965, true },
-  { 30988, true },
-  { 31008, true },
-  { 31026, true },
-  { 31048, true },
-  { 31067, true },
-  { 31087, true },
-  { 31110, true },
-  { 31127, true },
+  { 30840, true },
+  { 30859, true },
+  { 30876, true },
+  { 30891, true },
+  { 30918, true },
+  { 30938, true },
+  { 30960, false },
+  { 30979, true },
+  { 31002, true },
+  { 31022, true },
+  { 31040, true },
+  { 31062, true },
+  { 31081, true },
+  { 31101, true },
+  { 31124, true },
   { 31141, true },
-  { 31154, true },
-  { 31191, false },
-  { 31202, true },
-  { 31220, true },
-  { 31240, true },
-  { 31263, true },
-  { 31288, false },
-  { 31319, true },
+  { 31155, true },
+  { 31168, true },
+  { 31205, false },
+  { 31216, true },
+  { 31234, true },
+  { 31254, true },
+  { 31277, true },
+  { 31302, false },
   { 31333, true },
-  { 31342, true },
-  { 31353, true },
-  { 31365, true },
-  { 31377, true },
-  { 31386, true },
-  { 31398, true },
-  { 31415, true },
-  { 31425, true },
-  { 31443, false },
-  { 31451, true },
-  { 31462, true },
-  { 31481, true },
-  { 31493, false },
-  { 31511, true },
-  { 31524, false },
-  { 31537, true },
-  { 31550, true },
-  { 31567, true },
-  { 31583, true },
-  { 31594, true },
+  { 31347, true },
+  { 31356, true },
+  { 31367, true },
+  { 31379, true },
+  { 31391, true },
+  { 31400, true },
+  { 31412, true },
+  { 31429, true },
+  { 31439, true },
+  { 31457, false },
+  { 31465, true },
+  { 31476, true },
+  { 31495, true },
+  { 31507, false },
+  { 31525, true },
+  { 31538, false },
+  { 31551, true },
+  { 31564, true },
+  { 31581, true },
+  { 31597, true },
   { 31608, true },
-  { 31620, true },
-  { 31635, true },
-  { 31643, true },
+  { 31622, true },
+  { 31634, true },
+  { 31649, true },
   { 31657, true },
-  { 31669, true },
-  { 31681, true },
-  { 31691, true },
-  { 31702, true },
-  { 31713, true },
+  { 31671, true },
+  { 31683, true },
+  { 31695, true },
+  { 31705, true },
+  { 31716, true },
   { 31727, true },
-  { 31750, true },
-  { 31766, true },
-  { 31774, true },
-  { 31789, true },
-  { 31808, true },
-  { 31827, true },
-  { 31843, true },
-  { 31853, true },
-  { 31872, true },
-  { 31885, true },
-  { 31893, true },
-  { 31908, true },
-  { 31920, true },
-  { 31928, true },
+  { 31741, true },
+  { 31764, true },
+  { 31780, true },
+  { 31788, true },
+  { 31803, true },
+  { 31822, true },
+  { 31841, true },
+  { 31857, true },
+  { 31867, true },
+  { 31886, true },
+  { 31899, true },
+  { 31907, true },
+  { 31922, true },
   { 31934, true },
-  { 31947, true },
-  { 31956, true },
+  { 31942, true },
+  { 31948, true },
+  { 31961, true },
   { 31970, true },
   { 31984, true },
-  { 31997, false },
-  { 32017, true },
-  { 32033, true },
-  { 32045, true },
-  { 32061, true },
-  { 32074, true },
-  { 32094, true },
+  { 31998, true },
+  { 32011, false },
+  { 32031, true },
+  { 32047, true },
+  { 32059, true },
+  { 32075, true },
+  { 32088, true },
   { 32108, true },
-  { 32124, true },
+  { 32122, true },
   { 32138, true },
-  { 32158, true },
+  { 32152, true },
   { 32172, true },
-  { 32187, true },
+  { 32186, true },
   { 32201, true },
-  { 32214, true },
-  { 32223, true },
-  { 32233, true },
-  { 32246, false },
-  { 32256, true },
-  { 32272, true },
-  { 32294, true },
-  { 32326, true },
-  { 32345, true },
-  { 32361, true },
-  { 32382, true },
-  { 32402, true },
-  { 32415, true },
-  { 32432, true },
-  { 32452, true },
+  { 32215, true },
+  { 32228, true },
+  { 32237, true },
+  { 32247, true },
+  { 32260, false },
+  { 32270, true },
+  { 32286, true },
+  { 32308, true },
+  { 32340, true },
+  { 32359, true },
+  { 32375, true },
+  { 32396, true },
+  { 32416, true },
+  { 32429, true },
+  { 32446, true },
   { 32466, true },
-  { 32485, true },
-  { 32504, true },
-  { 32519, true },
-  { 32532, true },
-  { 32547, true },
-  { 32563, true },
-  { 32575, true },
-  { 32590, true },
-  { 32613, true },
-  { 32629, true },
-  { 32641, false },
-  { 32662, true },
-  { 32670, true },
-  { 32679, true },
+  { 32480, true },
+  { 32499, true },
+  { 32518, true },
+  { 32533, true },
+  { 32546, true },
+  { 32561, true },
+  { 32577, true },
+  { 32589, true },
+  { 32604, true },
+  { 32627, true },
+  { 32643, true },
+  { 32655, false },
+  { 32676, true },
+  { 32684, true },
   { 32693, true },
-  { 32702, true },
-  { 32714, true },
-  { 32730, true },
-  { 32747, false },
-  { 32757, true },
-  { 32768, true },
-  { 32780, true },
-  { 32793, true },
-  { 32811, true },
-  { 32828, true },
-  { 32845, false },
-  { 32855, true },
-  { 32873, true },
+  { 32707, true },
+  { 32716, true },
+  { 32728, true },
+  { 32744, true },
+  { 32761, false },
+  { 32771, true },
+  { 32782, true },
+  { 32794, true },
+  { 32807, true },
+  { 32825, true },
+  { 32842, true },
+  { 32859, false },
+  { 32869, true },
   { 32887, true },
-  { 32904, true },
-  { 32926, true },
-  { 32939, true },
-  { 32960, true },
-  { 32982, true },
-  { 32998, true },
-  { 33013, true },
+  { 32901, true },
+  { 32918, true },
+  { 32940, true },
+  { 32953, true },
+  { 32974, true },
+  { 32996, true },
+  { 33012, true },
   { 33027, true },
-  { 33053, true },
-  { 33078, true },
-  { 33098, true },
+  { 33041, true },
+  { 33067, true },
+  { 33092, true },
   { 33112, true },
-  { 33127, true },
-  { 33140, true },
-  { 33152, true },
-  { 33162, true },
-  { 33177, true },
-  { 33187, true },
-  { 33196, true },
+  { 33126, true },
+  { 33141, true },
+  { 33154, true },
+  { 33166, true },
+  { 33176, true },
+  { 33191, true },
+  { 33201, true },
   { 33210, true },
-  { 33221, true },
-  { 33232, true },
-  { 33247, true },
-  { 33262, true },
-  { 33274, true },
+  { 33224, true },
+  { 33235, true },
+  { 33246, true },
+  { 33261, true },
+  { 33276, true },
   { 33288, true },
-  { 33301, true },
-  { 33317, true },
-  { 33335, true },
-  { 33345, true },
-  { 33355, true },
-  { 33364, true },
-  { 33376, true },
-  { 33387, true },
-  { 33396, true },
-  { 33412, true },
-  { 33427, true },
-  { 33437, true },
-  { 33448, true },
-  { 33459, false },
-  { 33479, true },
-  { 33503, true },
-  { 33524, true },
-  { 33532, true },
-  { 33542, true },
+  { 33302, true },
+  { 33315, true },
+  { 33331, true },
+  { 33349, true },
+  { 33359, true },
+  { 33369, true },
+  { 33378, true },
+  { 33390, true },
+  { 33401, true },
+  { 33410, true },
+  { 33426, true },
+  { 33441, true },
+  { 33451, true },
+  { 33462, true },
+  { 33473, false },
+  { 33493, true },
+  { 33517, true },
+  { 33538, true },
+  { 33546, true },
   { 33556, true },
-  { 33576, false },
-  { 33586, true },
-  { 33604, false },
-  { 33618, true },
-  { 33637, true },
-  { 33654, true },
-  { 33668, false },
-  { 33686, true },
-  { 33694, true },
-  { 33710, true },
-  { 33721, true },
-  { 33734, true },
-  { 33749, true },
-  { 33769, false },
-  { 33784, true },
-  { 33796, true },
-  { 33809, true },
-  { 33821, true },
-  { 33841, true },
-  { 33854, true },
-  { 33866, true },
-  { 33881, true },
-  { 33894, true },
-  { 33907, false },
-  { 33930, false },
-  { 33954, true },
-  { 33971, true },
-  { 33984, true },
-  { 33995, true },
-  { 34007, true },
-  { 34027, true },
-  { 34041, true },
-  { 34052, true },
-  { 34071, true },
-  { 34088, true },
-  { 34110, true },
-  { 34124, true },
-  { 34143, true },
-  { 34153, true },
-  { 34167, true },
-  { 34188, true },
-  { 34200, true },
+  { 33570, true },
+  { 33590, false },
+  { 33600, true },
+  { 33618, false },
+  { 33632, true },
+  { 33651, true },
+  { 33668, true },
+  { 33682, false },
+  { 33700, true },
+  { 33708, true },
+  { 33724, true },
+  { 33735, true },
+  { 33748, true },
+  { 33763, true },
+  { 33783, false },
+  { 33798, true },
+  { 33810, true },
+  { 33823, true },
+  { 33835, true },
+  { 33855, true },
+  { 33868, true },
+  { 33880, true },
+  { 33895, true },
+  { 33908, true },
+  { 33921, true },
+  { 33934, false },
+  { 33957, false },
+  { 33981, true },
+  { 33998, true },
+  { 34011, true },
+  { 34022, true },
+  { 34034, true },
+  { 34054, true },
+  { 34068, true },
+  { 34079, true },
+  { 34098, true },
+  { 34115, true },
+  { 34137, true },
+  { 34151, true },
+  { 34170, true },
+  { 34180, true },
+  { 34194, true },
   { 34215, true },
-  { 34229, true },
-  { 34240, true },
-  { 34254, true },
+  { 34227, true },
+  { 34242, true },
+  { 34256, true },
   { 34267, true },
-  { 34283, true },
-  { 34296, true },
-  { 34316, true },
-  { 34324, true },
-  { 34336, true },
-  { 34347, true },
-  { 34369, true },
-  { 34389, true },
-  { 34401, true },
-  { 34413, true },
-  { 34431, true },
-  { 34445, true },
-  { 34460, true },
-  { 34479, true },
-  { 34494, true },
-  { 34508, true },
+  { 34281, true },
+  { 34294, true },
+  { 34310, true },
+  { 34323, true },
+  { 34343, true },
+  { 34351, true },
+  { 34363, true },
+  { 34374, true },
+  { 34396, true },
+  { 34416, true },
+  { 34428, true },
+  { 34440, true },
+  { 34458, true },
+  { 34472, true },
+  { 34491, true },
+  { 34506, true },
   { 34520, true },
-  { 34536, true },
-  { 34557, true },
-  { 34576, true },
-  { 34593, true },
-  { 34620, false },
-  { 34639, true },
-  { 34653, true },
-  { 34673, true },
-  { 34693, true },
-  { 34706, true },
-  { 34727, true },
-  { 34748, true },
-  { 34761, true },
-  { 34768, true },
+  { 34532, true },
+  { 34548, true },
+  { 34569, true },
+  { 34588, true },
+  { 34605, true },
+  { 34632, false },
+  { 34651, true },
+  { 34665, true },
+  { 34685, true },
+  { 34705, true },
+  { 34718, true },
+  { 34739, true },
+  { 34760, true },
+  { 34773, true },
   { 34780, true },
-  { 34802, true },
-  { 34818, true },
-  { 34833, true },
-  { 34846, true },
-  { 34866, true },
-  { 34880, true },
-  { 34895, true },
-  { 34905, true },
-  { 34919, true },
-  { 34929, true },
+  { 34792, true },
+  { 34814, true },
+  { 34830, true },
+  { 34845, true },
+  { 34858, true },
+  { 34878, true },
+  { 34892, true },
+  { 34907, true },
+  { 34917, true },
+  { 34931, true },
   { 34941, true },
   { 34953, true },
-  { 34971, true },
-  { 34990, true },
-  { 35005, true },
-  { 35026, false },
-  { 35047, true },
-  { 35067, true },
-  { 35087, true },
-  { 35119, true },
-  { 35129, true },
-  { 35142, true },
-  { 35161, true },
-  { 35178, false },
-  { 35202, false },
-  { 35224, true },
-  { 35248, true },
-  { 35278, true },
-  { 35302, true },
-  { 35318, true },
-  { 35335, true },
-  { 35353, true },
-  { 35368, true },
-  { 35385, true },
-  { 35399, true },
-  { 35421, true },
-  { 35446, true },
-  { 35459, true },
-  { 35474, true },
-  { 35493, true },
-  { 35508, true },
-  { 35532, true },
-  { 35553, true },
-  { 35567, true },
-  { 35582, true },
-  { 35598, true },
-  { 35617, true },
-  { 35634, true },
-  { 35652, true },
-  { 35676, false },
-  { 35698, true },
-  { 35711, true },
-  { 35722, true },
+  { 34965, true },
+  { 34983, true },
+  { 35002, true },
+  { 35017, true },
+  { 35038, false },
+  { 35059, true },
+  { 35079, true },
+  { 35099, true },
+  { 35131, true },
+  { 35141, true },
+  { 35154, true },
+  { 35173, true },
+  { 35190, false },
+  { 35214, false },
+  { 35236, true },
+  { 35260, true },
+  { 35290, true },
+  { 35314, true },
+  { 35330, true },
+  { 35347, true },
+  { 35365, true },
+  { 35380, true },
+  { 35397, true },
+  { 35411, true },
+  { 35433, true },
+  { 35458, true },
+  { 35471, true },
+  { 35486, true },
+  { 35505, true },
+  { 35520, true },
+  { 35544, true },
+  { 35565, true },
+  { 35579, true },
+  { 35594, true },
+  { 35610, true },
+  { 35629, true },
+  { 35646, true },
+  { 35664, true },
+  { 35688, false },
+  { 35710, true },
+  { 35723, true },
   { 35734, true },
-  { 35752, true },
-  { 35767, false },
-  { 35778, true },
-  { 35806, true },
-  { 35821, true },
-  { 35844, true },
-  { 35857, true },
-  { 35868, true },
-  { 35881, true },
+  { 35746, true },
+  { 35764, true },
+  { 35783, true },
+  { 35798, false },
+  { 35809, true },
+  { 35837, true },
+  { 35852, true },
+  { 35875, true },
+  { 35888, true },
   { 35899, true },
-  { 35921, true },
-  { 35946, true },
-  { 35969, true },
-  { 35983, true },
-  { 35996, true },
-  { 36012, true },
-  { 36025, true },
+  { 35912, true },
+  { 35930, true },
+  { 35952, true },
+  { 35977, true },
+  { 36000, true },
+  { 36014, true },
+  { 36027, true },
   { 36043, true },
-  { 36053, true },
-  { 36066, true },
+  { 36056, true },
+  { 36074, true },
   { 36084, true },
-  { 36105, true },
-  { 36120, true },
-  { 36135, true },
-  { 36159, true },
-  { 36173, true },
-  { 36198, true },
-  { 36213, true },
-  { 36236, true },
-  { 36245, true },
-  { 36266, true },
-  { 36283, true },
-  { 36294, true },
-  { 36307, true },
-  { 36320, false },
-  { 36359, true },
-  { 36372, true },
-  { 36388, true },
-  { 36402, false },
-  { 36417, true },
-  { 36437, false },
-  { 36453, true },
-  { 36472, true },
-  { 36483, true },
-  { 36496, true },
-  { 36508, true },
-  { 36531, true },
-  { 36543, true },
-  { 36552, true },
+  { 36097, true },
+  { 36115, true },
+  { 36136, true },
+  { 36151, true },
+  { 36166, true },
+  { 36190, true },
+  { 36204, true },
+  { 36229, true },
+  { 36244, true },
+  { 36267, true },
+  { 36276, true },
+  { 36297, true },
+  { 36314, true },
+  { 36325, true },
+  { 36338, true },
+  { 36351, false },
+  { 36390, true },
+  { 36403, true },
+  { 36419, true },
+  { 36433, false },
+  { 36448, true },
+  { 36468, false },
+  { 36484, true },
+  { 36503, true },
+  { 36514, true },
+  { 36527, true },
+  { 36539, true },
   { 36562, true },
-  { 36576, true },
-  { 36591, true },
-  { 36605, true },
-  { 36616, true },
-  { 36635, true },
-  { 36651, true },
-  { 36667, true },
-  { 36684, true },
-  { 36696, true },
-  { 36719, true },
-  { 36744, true },
-  { 36764, true },
-  { 36776, true },
-  { 36791, true },
-  { 36810, true },
-  { 36823, true },
-  { 36845, true },
-  { 36857, true },
-  { 36887, true },
-  { 36901, true },
-  { 36925, true },
-  { 36948, true },
-  { 36962, true },
-  { 36975, true },
-  { 36987, true },
-  { 37007, true },
-  { 37019, true },
-  { 37042, true },
-  { 37061, true },
-  { 37072, true },
-  { 37086, true },
-  { 37098, true },
-  { 37116, true },
-  { 37132, true },
-  { 37150, true },
-  { 37166, true },
-  { 37183, true },
-  { 37196, true },
-  { 37207, true },
-  { 37225, true },
-  { 37243, true },
-  { 37266, true },
-  { 37283, false },
-  { 37298, true },
-  { 37310, true },
-  { 37322, true },
-  { 37335, true },
-  { 37344, true },
-  { 37359, true },
-  { 37378, true },
-  { 37392, true },
-  { 37407, true },
-  { 37419, true },
-  { 37431, true },
-  { 37445, false },
+  { 36574, true },
+  { 36583, true },
+  { 36593, true },
+  { 36607, true },
+  { 36622, true },
+  { 36636, true },
+  { 36647, true },
+  { 36666, true },
+  { 36682, true },
+  { 36698, true },
+  { 36715, true },
+  { 36727, true },
+  { 36750, true },
+  { 36775, true },
+  { 36795, true },
+  { 36807, true },
+  { 36822, true },
+  { 36841, true },
+  { 36854, true },
+  { 36876, true },
+  { 36888, true },
+  { 36918, true },
+  { 36932, true },
+  { 36956, true },
+  { 36979, true },
+  { 36993, true },
+  { 37006, true },
+  { 37018, true },
+  { 37038, true },
+  { 37050, true },
+  { 37073, true },
+  { 37092, true },
+  { 37103, true },
+  { 37117, true },
+  { 37129, true },
+  { 37147, true },
+  { 37163, true },
+  { 37181, true },
+  { 37197, true },
+  { 37214, true },
+  { 37227, true },
+  { 37238, true },
+  { 37256, true },
+  { 37274, true },
+  { 37297, true },
+  { 37314, false },
+  { 37329, true },
+  { 37341, true },
+  { 37353, true },
+  { 37366, true },
+  { 37375, true },
+  { 37390, true },
+  { 37409, true },
+  { 37423, true },
+  { 37438, true },
+  { 37450, true },
   { 37462, true },
-  { 37473, true },
-  { 37486, true },
-  { 37503, true },
-  { 37522, true },
-  { 37535, true },
+  { 37476, false },
+  { 37493, true },
+  { 37504, true },
+  { 37517, true },
+  { 37534, true },
   { 37553, true },
-  { 37579, true },
-  { 37596, true },
-  { 37615, true },
-  { 37630, true },
-  { 37644, true },
+  { 37566, true },
+  { 37584, true },
+  { 37610, true },
+  { 37627, true },
+  { 37646, true },
   { 37661, true },
-  { 37678, true },
-  { 37694, true },
-  { 37713, true },
-  { 37732, true },
-  { 37752, true },
-  { 37768, true },
-  { 37784, true },
-  { 37798, true },
-  { 37808, true },
-  { 37816, true },
-  { 37842, true },
-  { 37859, true },
-  { 37880, true },
-  { 37898, true },
-  { 37912, true },
-  { 37931, true },
+  { 37675, true },
+  { 37692, true },
+  { 37709, true },
+  { 37725, true },
+  { 37744, true },
+  { 37763, true },
+  { 37783, true },
+  { 37799, true },
+  { 37815, true },
+  { 37829, true },
+  { 37839, true },
+  { 37847, true },
+  { 37873, true },
+  { 37890, true },
+  { 37911, true },
+  { 37929, true },
   { 37943, true },
-  { 37959, false },
-  { 37978, true },
-  { 37987, true },
-  { 38001, true },
-  { 38016, true },
-  { 38033, true },
-  { 38044, true },
-  { 38063, true },
-  { 38076, true },
-  { 38098, true },
-  { 38112, false },
-  { 38126, true },
-  { 38141, true },
-  { 38153, true },
-  { 38176, true },
+  { 37962, true },
+  { 37974, true },
+  { 37990, false },
+  { 38009, true },
+  { 38018, true },
+  { 38032, true },
+  { 38047, true },
+  { 38064, true },
+  { 38075, true },
+  { 38094, true },
+  { 38107, true },
+  { 38129, true },
+  { 38143, false },
+  { 38157, true },
+  { 38173, true },
   { 38188, true },
-  { 38211, true },
-  { 38230, true },
-  { 38238, true },
-  { 38254, true },
-  { 38269, true },
-  { 38279, true },
-  { 38286, true },
-  { 38297, true },
-  { 38314, true },
-  { 38328, true },
-  { 38337, true },
-  { 38345, true },
-  { 38359, true },
-  { 38378, false },
-  { 38389, true },
-  { 38405, false },
-  { 38415, false },
-  { 38431, true },
-  { 38444, true },
-  { 38458, true },
-  { 38473, true },
-  { 38489, true },
-  { 38511, true },
-  { 38525, true },
-  { 38538, true },
-  { 38552, true },
-  { 38566, true },
-  { 38581, true },
-  { 38596, true },
-  { 38615, true },
-  { 38640, true },
-  { 38660, true },
-  { 38676, true },
-  { 38689, true },
-  { 38702, true },
-  { 38732, true },
-  { 38744, true },
-  { 38759, true },
-  { 38769, true },
-  { 38785, true },
-  { 38793, false },
-  { 38805, true },
-  { 38816, true },
-  { 38825, true },
-  { 38840, true },
-  { 38857, true },
-  { 38873, true },
-  { 38886, true },
-  { 38899, true },
-  { 38916, true },
+  { 38200, true },
+  { 38223, true },
+  { 38235, true },
+  { 38258, true },
+  { 38277, true },
+  { 38293, true },
+  { 38308, true },
+  { 38318, true },
+  { 38325, true },
+  { 38336, true },
+  { 38353, true },
+  { 38367, true },
+  { 38376, true },
+  { 38384, true },
+  { 38398, true },
+  { 38417, false },
+  { 38428, true },
+  { 38444, false },
+  { 38454, false },
+  { 38470, true },
+  { 38483, true },
+  { 38497, true },
+  { 38512, true },
+  { 38528, true },
+  { 38550, true },
+  { 38564, true },
+  { 38577, true },
+  { 38591, true },
+  { 38605, true },
+  { 38620, true },
+  { 38635, true },
+  { 38654, true },
+  { 38679, true },
+  { 38699, true },
+  { 38715, true },
+  { 38728, true },
+  { 38741, true },
+  { 38771, true },
+  { 38783, true },
+  { 38798, true },
+  { 38808, true },
+  { 38824, true },
+  { 38832, false },
+  { 38844, true },
+  { 38855, true },
+  { 38864, true },
+  { 38879, true },
+  { 38896, true },
+  { 38912, true },
   { 38925, true },
-  { 38933, true },
-  { 38944, true },
-  { 38953, true },
+  { 38938, true },
+  { 38955, true },
   { 38964, true },
-  { 38978, true },
-  { 38991, true },
-  { 38999, true },
-  { 39017, true },
-  { 39026, true },
-  { 39035, true },
-  { 39043, true },
-  { 39051, true },
-  { 39070, true },
-  { 39089, true },
+  { 38972, true },
+  { 38983, true },
+  { 38992, true },
+  { 39006, true },
+  { 39019, true },
+  { 39027, true },
+  { 39045, true },
+  { 39054, true },
+  { 39063, true },
+  { 39071, true },
+  { 39079, true },
   { 39098, true },
-  { 39118, true },
-  { 39141, true },
-  { 39151, true },
-  { 39161, true },
+  { 39117, true },
+  { 39126, true },
+  { 39146, true },
+  { 39169, true },
   { 39179, true },
-  { 39199, true },
-  { 39212, true },
-  { 39226, true },
-  { 39242, true },
-  { 39252, true },
-  { 39263, true },
-  { 39273, true },
-  { 39290, true },
-  { 39306, true },
-  { 39321, true },
-  { 39332, true },
-  { 39339, true },
-  { 39350, true },
-  { 39361, true },
-  { 39369, true },
+  { 39189, true },
+  { 39207, true },
+  { 39227, true },
+  { 39240, true },
+  { 39254, true },
+  { 39270, true },
+  { 39280, true },
+  { 39291, true },
+  { 39301, true },
+  { 39318, true },
+  { 39334, true },
+  { 39349, true },
+  { 39360, true },
+  { 39367, true },
+  { 39378, true },
   { 39389, true },
-  { 39410, true },
-  { 39429, true },
-  { 39444, true },
-  { 39466, true },
-  { 39478, false },
-  { 39500, true },
-  { 39519, true },
-  { 39535, true },
-  { 39553, true },
-  { 39568, true },
-  { 39585, true },
-  { 39600, true },
-  { 39619, true },
-  { 39631, true },
-  { 39651, true },
-  { 39668, true },
-  { 39682, true },
-  { 39691, true },
-  { 39703, true },
-  { 39713, true },
-  { 39722, true },
+  { 39397, true },
+  { 39417, true },
+  { 39438, true },
+  { 39457, true },
+  { 39472, true },
+  { 39494, true },
+  { 39506, false },
+  { 39528, true },
+  { 39547, true },
+  { 39563, true },
+  { 39581, true },
+  { 39596, true },
+  { 39613, true },
+  { 39628, true },
+  { 39647, true },
+  { 39659, true },
+  { 39679, true },
+  { 39696, true },
+  { 39710, true },
+  { 39719, true },
   { 39731, true },
-  { 39740, true },
-  { 39749, true },
+  { 39741, true },
+  { 39750, true },
   { 39759, true },
-  { 39769, true },
-  { 39778, true },
+  { 39768, true },
+  { 39777, true },
   { 39787, true },
-  { 39805, true },
-  { 39821, true },
-  { 39829, true },
-  { 39836, true },
+  { 39797, true },
+  { 39806, true },
+  { 39815, true },
+  { 39833, true },
   { 39849, true },
-  { 39866, true },
-  { 39880, true },
-  { 39887, true },
-  { 39897, true },
+  { 39857, true },
+  { 39864, true },
+  { 39877, true },
+  { 39894, true },
   { 39908, true },
+  { 39915, true },
   { 39925, true },
-  { 39945, true },
-  { 39964, false },
-  { 39978, true },
-  { 39996, true },
-  { 40009, true },
-  { 40026, true },
-  { 40040, true },
+  { 39936, true },
+  { 39953, true },
+  { 39973, true },
+  { 39992, false },
+  { 40006, true },
+  { 40024, true },
+  { 40037, true },
   { 40054, true },
-  { 40071, true },
-  { 40097, true },
-  { 40111, true },
-  { 40128, true },
-  { 40143, true },
-  { 40157, true },
-  { 40168, true },
-  { 40181, true },
-  { 40191, true },
-  { 40202, true },
-  { 40221, true },
-  { 40236, true },
-  { 40251, true },
-  { 40278, true },
-  { 40288, true },
-  { 40300, true },
-  { 40312, true },
-  { 40320, true },
-  { 40331, true },
+  { 40068, true },
+  { 40082, true },
+  { 40099, true },
+  { 40125, true },
+  { 40139, true },
+  { 40156, true },
+  { 40171, true },
+  { 40185, true },
+  { 40196, true },
+  { 40209, true },
+  { 40219, true },
+  { 40230, true },
+  { 40249, true },
+  { 40264, true },
+  { 40279, true },
+  { 40306, true },
+  { 40316, true },
+  { 40328, true },
   { 40340, true },
   { 40348, true },
   { 40359, true },
-  { 40386, true },
-  { 40396, true },
-  { 40407, true },
-  { 40418, true },
-  { 40428, true },
-  { 40442, true },
+  { 40368, true },
+  { 40376, true },
+  { 40387, true },
+  { 40414, true },
+  { 40424, true },
+  { 40435, true },
+  { 40446, true },
   { 40456, true },
-  { 40467, true },
-  { 40474, true },
-  { 40482, true },
-  { 40490, true },
-  { 40506, true },
-  { 40520, true },
+  { 40470, true },
+  { 40484, true },
+  { 40495, true },
+  { 40502, true },
+  { 40510, true },
+  { 40518, true },
   { 40534, true },
-  { 40543, true },
-  { 40555, true },
+  { 40548, true },
   { 40562, true },
-  { 40569, true },
-  { 40585, true },
+  { 40571, true },
+  { 40583, true },
+  { 40590, true },
   { 40597, true },
-  { 40611, true },
-  { 40633, true },
-  { 40644, true },
-  { 40655, true },
-  { 40666, true },
-  { 40677, true },
-  { 40693, true },
-  { 40710, true },
-  { 40723, true },
-  { 40749, false },
-  { 40772, true },
-  { 40784, true },
+  { 40613, true },
+  { 40625, true },
+  { 40639, true },
+  { 40661, true },
+  { 40672, true },
+  { 40683, true },
+  { 40694, true },
+  { 40705, true },
+  { 40721, true },
+  { 40738, true },
+  { 40751, true },
+  { 40777, false },
   { 40800, true },
-  { 40810, true },
-  { 40823, true },
-  { 40834, true },
-  { 40849, true },
-  { 40867, true },
-  { 40879, false },
-  { 40891, true },
-  { 40905, true },
+  { 40812, true },
+  { 40828, true },
+  { 40838, true },
+  { 40851, true },
+  { 40862, true },
+  { 40877, true },
+  { 40895, true },
+  { 40907, false },
   { 40919, true },
-  { 40936, true },
-  { 40954, true },
-  { 40967, true },
-  { 40986, true },
-  { 40996, true },
-  { 41007, true },
-  { 41020, true },
-  { 41037, true },
-  { 41055, true },
-  { 41071, true },
-  { 41084, true },
-  { 41102, true },
-  { 41116, true },
-  { 41134, true },
-  { 41149, true },
-  { 41170, true },
-  { 41186, true },
-  { 41207, true },
-  { 41223, true },
-  { 41242, true },
-  { 41262, true },
-  { 41282, true },
-  { 41298, true },
-  { 41315, true },
-  { 41334, true },
-  { 41352, true },
-  { 41372, true },
-  { 41388, true },
-  { 41399, false },
-  { 41409, true },
-  { 41418, true },
-  { 41436, true },
-  { 41450, true },
-  { 41468, true },
-  { 41481, true },
-  { 41496, true },
-  { 41511, true },
+  { 40933, true },
+  { 40947, true },
+  { 40964, true },
+  { 40982, true },
+  { 40995, true },
+  { 41014, true },
+  { 41024, true },
+  { 41035, true },
+  { 41048, true },
+  { 41065, true },
+  { 41083, true },
+  { 41099, true },
+  { 41112, true },
+  { 41130, true },
+  { 41144, true },
+  { 41162, true },
+  { 41177, true },
+  { 41198, true },
+  { 41214, true },
+  { 41235, true },
+  { 41251, true },
+  { 41270, false },
+  { 41291, false },
+  { 41311, true },
+  { 41331, true },
+  { 41351, true },
+  { 41367, true },
+  { 41384, true },
+  { 41403, true },
+  { 41421, true },
+  { 41441, true },
+  { 41457, true },
+  { 41468, false },
+  { 41478, true },
+  { 41487, true },
+  { 41505, true },
   { 41519, true },
-  { 41553, true },
-  { 41564, false },
-  { 41578, true },
-  { 41596, true },
-  { 41614, true },
-  { 41629, true },
-  { 41640, true },
-  { 41654, true },
-  { 41669, true },
-  { 41686, true },
-  { 41701, true },
-  { 41713, true },
-  { 41742, true },
-  { 41775, true },
-  { 41787, true },
-  { 41799, true },
-  { 41816, true },
-  { 41828, true },
-  { 41840, true },
-  { 41855, false },
-  { 41867, true },
-  { 41876, true },
-  { 41892, true },
-  { 41904, true },
-  { 41921, true },
-  { 41936, false },
-  { 41950, true },
-  { 41970, false },
-  { 41984, true },
-  { 41995, true },
-  { 42008, true },
-  { 42018, false },
-  { 42034, true },
-  { 42048, true },
-  { 42062, true },
-  { 42073, true },
-  { 42086, true },
-  { 42102, true },
-  { 42113, true },
-  { 42130, true },
-  { 42156, true },
-  { 42176, true },
-  { 42190, true },
-  { 42207, false },
-  { 42221, true },
-  { 42235, false },
-  { 42253, true },
-  { 42269, true },
-  { 42296, true },
-  { 42307, true },
+  { 41537, true },
+  { 41550, true },
+  { 41565, true },
+  { 41580, true },
+  { 41588, true },
+  { 41622, true },
+  { 41633, false },
+  { 41647, true },
+  { 41665, true },
+  { 41683, true },
+  { 41698, true },
+  { 41709, true },
+  { 41723, true },
+  { 41738, true },
+  { 41755, true },
+  { 41770, true },
+  { 41782, true },
+  { 41811, true },
+  { 41844, true },
+  { 41856, true },
+  { 41868, true },
+  { 41885, true },
+  { 41897, true },
+  { 41909, true },
+  { 41924, false },
+  { 41936, true },
+  { 41945, true },
+  { 41961, true },
+  { 41973, true },
+  { 41990, true },
+  { 42005, false },
+  { 42019, true },
+  { 42039, false },
+  { 42053, true },
+  { 42064, true },
+  { 42077, true },
+  { 42087, false },
+  { 42103, true },
+  { 42117, true },
+  { 42131, true },
+  { 42142, true },
+  { 42155, true },
+  { 42171, true },
+  { 42182, true },
+  { 42199, true },
+  { 42225, true },
+  { 42245, true },
+  { 42259, true },
+  { 42276, false },
+  { 42290, true },
+  { 42304, false },
   { 42322, true },
-  { 42334, true },
-  { 42349, true },
-  { 42371, true },
-  { 42389, true },
-  { 42405, true },
-  { 42425, true },
-  { 42439, true },
-  { 42455, true },
-  { 42473, true },
-  { 42486, true },
-  { 42503, true },
-  { 42516, true },
-  { 42531, true },
-  { 42547, true },
-  { 42566, true },
-  { 42583, true },
-  { 42599, true },
-  { 42611, true },
-  { 42624, true },
-  { 42650, true },
-  { 42670, true },
-  { 42681, true },
-  { 42699, true },
-  { 42718, true },
-  { 42732, true },
-  { 42741, true },
-  { 42758, true },
-  { 42769, true },
-  { 42781, true },
-  { 42791, true },
-  { 42802, true },
-  { 42823, true },
-  { 42835, true },
-  { 42846, true },
-  { 42854, true },
-  { 42862, true },
-  { 42873, true },
-  { 42889, true },
-  { 42899, true },
-  { 42912, true },
-  { 42927, true },
-  { 42944, true },
-  { 42966, true },
-  { 42987, true },
-  { 42995, true },
-  { 43008, true },
-  { 43019, false },
-  { 43039, true },
-  { 43054, true },
-  { 43066, true },
-  { 43087, true },
-  { 43101, true },
-  { 43115, true },
-  { 43132, true },
-  { 43147, true },
-  { 43161, true },
-  { 43175, true },
-  { 43189, true },
-  { 43203, true },
-  { 43217, true },
-  { 43232, true },
+  { 42338, true },
+  { 42365, true },
+  { 42376, true },
+  { 42391, true },
+  { 42403, true },
+  { 42418, true },
+  { 42440, true },
+  { 42458, true },
+  { 42474, true },
+  { 42494, true },
+  { 42508, true },
+  { 42524, true },
+  { 42542, true },
+  { 42555, true },
+  { 42572, true },
+  { 42585, true },
+  { 42600, true },
+  { 42616, true },
+  { 42635, true },
+  { 42652, true },
+  { 42668, true },
+  { 42680, true },
+  { 42693, true },
+  { 42719, true },
+  { 42739, true },
+  { 42750, true },
+  { 42768, true },
+  { 42787, true },
+  { 42801, true },
+  { 42810, true },
+  { 42827, true },
+  { 42838, true },
+  { 42850, true },
+  { 42860, true },
+  { 42871, true },
+  { 42892, true },
+  { 42904, true },
+  { 42915, true },
+  { 42923, true },
+  { 42931, true },
+  { 42942, true },
+  { 42958, true },
+  { 42968, true },
+  { 42981, true },
+  { 42996, true },
+  { 43013, true },
+  { 43035, true },
+  { 43056, true },
+  { 43064, true },
+  { 43077, true },
+  { 43088, false },
+  { 43108, true },
+  { 43123, true },
+  { 43135, true },
+  { 43156, true },
+  { 43170, true },
+  { 43184, true },
+  { 43201, true },
+  { 43216, true },
+  { 43230, true },
   { 43244, true },
   { 43258, true },
-  { 43276, true },
-  { 43291, true },
+  { 43272, true },
+  { 43286, true },
   { 43301, true },
-  { 43317, true },
-  { 43328, true },
-  { 43349, true },
-  { 43364, true },
-  { 43377, true },
-  { 43392, true },
-  { 43404, true },
-  { 43419, true },
-  { 43436, true },
-  { 43453, true },
-  { 43465, true },
-  { 43474, true },
-  { 43494, true },
+  { 43313, true },
+  { 43327, true },
+  { 43345, true },
+  { 43360, true },
+  { 43370, true },
+  { 43386, true },
+  { 43397, true },
+  { 43418, true },
+  { 43433, true },
+  { 43446, true },
+  { 43461, true },
+  { 43473, true },
+  { 43488, true },
   { 43505, true },
-  { 43520, true },
-  { 43536, true },
+  { 43522, true },
+  { 43534, true },
   { 43543, true },
-  { 43566, true },
-  { 43580, true },
-  { 43595, true },
-  { 43610, true },
-  { 43625, true },
-  { 43636, true },
-  { 43646, true },
-  { 43655, true },
-  { 43666, true },
-  { 43678, true },
-  { 43689, true },
-  { 43700, true },
-  { 43713, true },
-  { 43729, true },
-  { 43744, true },
-  { 43760, true },
-  { 43777, true },
-  { 43794, true },
-  { 43805, true },
-  { 43819, true },
-  { 43834, true },
-  { 43850, true },
-  { 43865, true },
-  { 43875, true },
+  { 43563, true },
+  { 43574, true },
+  { 43589, true },
+  { 43605, true },
+  { 43612, true },
+  { 43635, true },
+  { 43649, true },
+  { 43664, true },
+  { 43679, true },
+  { 43694, true },
+  { 43705, true },
+  { 43715, true },
+  { 43724, true },
+  { 43735, true },
+  { 43747, true },
+  { 43758, true },
+  { 43769, true },
+  { 43782, true },
+  { 43798, true },
+  { 43813, true },
+  { 43829, true },
+  { 43846, true },
+  { 43863, true },
+  { 43874, true },
   { 43888, true },
-  { 43900, true },
-  { 43928, true },
-  { 43940, true },
-  { 43954, true },
-  { 43970, true },
-  { 43983, true },
-  { 43994, true },
-  { 44016, true },
-  { 44036, true },
-  { 44057, true },
-  { 44072, true },
-  { 44086, true },
-  { 44096, true },
-  { 44107, true },
+  { 43903, true },
+  { 43919, true },
+  { 43934, true },
+  { 43944, true },
+  { 43957, true },
+  { 43969, true },
+  { 43997, true },
+  { 44009, true },
+  { 44023, true },
+  { 44039, true },
+  { 44052, true },
+  { 44063, true },
+  { 44085, true },
+  { 44105, true },
   { 44126, true },
-  { 44143, true },
-  { 44156, true },
-  { 44170, false },
-  { 44183, true },
+  { 44141, true },
+  { 44155, true },
+  { 44165, true },
+  { 44176, true },
   { 44195, true },
-  { 44208, true },
-  { 44220, true },
-  { 44233, true },
-  { 44246, true },
-  { 44257, true },
-  { 44275, true },
-  { 44293, true },
-  { 44305, true },
-  { 44320, true },
-  { 44334, true },
-  { 44348, true },
-  { 44356, true },
-  { 44385, true },
-  { 44404, true },
+  { 44212, true },
+  { 44225, true },
+  { 44239, false },
+  { 44252, true },
+  { 44264, true },
+  { 44277, true },
+  { 44289, true },
+  { 44302, true },
+  { 44315, true },
+  { 44326, true },
+  { 44344, true },
+  { 44362, true },
+  { 44374, true },
+  { 44389, true },
+  { 44403, true },
   { 44417, true },
-  { 44442, true },
-  { 44459, true },
-  { 44480, true },
-  { 44492, true },
-  { 44516, true },
+  { 44425, true },
+  { 44454, true },
+  { 44473, true },
+  { 44486, true },
+  { 44511, true },
+  { 44528, true },
   { 44549, true },
   { 44561, true },
-  { 44583, true },
-  { 44600, true },
-  { 44615, true },
-  { 44629, true },
-  { 44655, true },
-  { 44674, true },
-  { 44687, true },
-  { 44697, true },
-  { 44707, true },
-  { 44725, true },
+  { 44585, true },
+  { 44618, true },
+  { 44630, true },
+  { 44652, true },
+  { 44669, true },
+  { 44684, true },
+  { 44698, true },
+  { 44724, true },
   { 44743, true },
-  { 44770, true },
-  { 44786, true },
-  { 44811, true },
-  { 44826, true },
-  { 44846, false },
-  { 44867, true },
-  { 44882, true },
-  { 44897, true },
-  { 44918, true },
-  { 44929, true },
-  { 44953, true },
+  { 44756, true },
+  { 44766, true },
+  { 44776, true },
+  { 44794, true },
+  { 44812, true },
+  { 44839, true },
+  { 44855, true },
+  { 44880, true },
+  { 44895, true },
+  { 44915, false },
+  { 44936, true },
+  { 44951, true },
   { 44966, true },
-  { 44976, false },
-  { 44990, true },
-  { 45004, true },
-  { 45023, true },
-  { 45038, true },
-  { 45047, true },
-  { 45057, true },
-  { 45072, true },
-  { 45084, true },
-  { 45102, true },
-  { 45113, true },
-  { 45130, true },
-  { 45138, true },
-  { 45147, true },
-  { 45157, true },
-  { 45170, true },
-  { 45180, true },
-  { 45194, false },
-  { 45219, true },
-  { 45237, false },
-  { 45261, true },
-  { 45275, true },
-  { 45294, true },
-  { 45321, true },
-  { 45333, true },
-  { 45342, true },
-  { 45356, true },
-  { 45373, true },
-  { 45389, true },
-  { 45404, true },
-  { 45416, true },
-  { 45433, true },
-  { 45445, true },
+  { 44987, true },
+  { 44998, true },
+  { 45022, true },
+  { 45035, true },
+  { 45045, false },
+  { 45059, true },
+  { 45073, true },
+  { 45092, true },
+  { 45107, true },
+  { 45122, true },
+  { 45131, true },
+  { 45141, true },
+  { 45156, true },
+  { 45168, true },
+  { 45186, true },
+  { 45197, true },
+  { 45214, true },
+  { 45222, true },
+  { 45231, true },
+  { 45241, true },
+  { 45254, true },
+  { 45264, true },
+  { 45278, false },
+  { 45303, true },
+  { 45321, false },
+  { 45345, true },
+  { 45359, true },
+  { 45378, true },
+  { 45405, true },
+  { 45417, true },
+  { 45426, true },
+  { 45440, true },
   { 45457, true },
-  { 45467, true },
-  { 45479, true },
-  { 45492, true },
-  { 45506, true },
-  { 45523, true },
-  { 45534, true },
-  { 45552, false },
-  { 45572, true },
-  { 45584, true },
-  { 45596, true },
-  { 45606, true },
-  { 45619, true },
-  { 45641, true },
-  { 45655, true },
-  { 45664, true },
-  { 45676, true },
-  { 45683, true },
-  { 45695, true },
-  { 45705, true },
-  { 45719, true },
-  { 45736, true },
-  { 45747, true },
-  { 45761, true },
-  { 45770, true },
+  { 45473, true },
+  { 45488, true },
+  { 45500, true },
+  { 45517, true },
+  { 45529, true },
+  { 45541, true },
+  { 45551, true },
+  { 45563, true },
+  { 45576, true },
+  { 45590, true },
+  { 45607, true },
+  { 45618, true },
+  { 45636, false },
+  { 45656, true },
+  { 45668, true },
+  { 45680, true },
+  { 45690, true },
+  { 45703, true },
+  { 45725, true },
+  { 45739, true },
+  { 45748, true },
+  { 45760, true },
+  { 45767, true },
   { 45779, true },
-  { 45794, true },
-  { 45806, true },
-  { 45822, true },
-  { 45838, true },
-  { 45855, true },
-  { 45865, true },
+  { 45788, true },
+  { 45798, true },
+  { 45812, true },
+  { 45829, true },
+  { 45840, true },
+  { 45854, true },
+  { 45863, true },
+  { 45872, true },
   { 45887, true },
-  { 45896, true },
-  { 45908, true },
-  { 45922, true },
-  { 45955, true },
+  { 45899, true },
+  { 45915, true },
+  { 45931, true },
+  { 45948, true },
+  { 45958, true },
   { 45980, true },
   { 45989, true },
-  { 46005, true },
-  { 46017, true },
-  { 46028, true },
-  { 46053, true },
-  { 46068, true },
-  { 46090, true },
-  { 46115, true },
+  { 46001, true },
+  { 46015, true },
+  { 46048, true },
+  { 46073, true },
+  { 46082, true },
+  { 46098, true },
+  { 46110, true },
+  { 46121, true },
   { 46146, true },
-  { 46157, true },
-  { 46173, true },
-  { 46187, true },
-  { 46205, true },
-  { 46219, true },
-  { 46234, false },
-  { 46251, true },
-  { 46269, true },
-  { 46282, true },
-  { 46292, true },
-  { 46304, true },
-  { 46319, true },
-  { 46330, true },
+  { 46161, true },
+  { 46183, true },
+  { 46208, true },
+  { 46239, true },
+  { 46250, true },
+  { 46266, true },
+  { 46280, true },
+  { 46298, true },
+  { 46312, true },
+  { 46327, false },
   { 46344, true },
-  { 46357, true },
-  { 46369, true },
-  { 46381, true },
-  { 46392, true },
-  { 46408, true },
-  { 46421, true },
-  { 46433, false },
+  { 46362, true },
+  { 46375, true },
+  { 46385, true },
+  { 46397, true },
+  { 46412, true },
+  { 46423, true },
+  { 46437, true },
   { 46450, true },
-  { 46470, true },
-  { 46487, true },
-  { 46503, true },
-  { 46518, true },
-  { 46533, true },
-  { 46556, true },
-  { 46582, true },
-  { 46602, true },
-  { 46617, false },
-  { 46635, true },
-  { 46654, true },
-  { 46671, true },
-  { 46684, true },
-  { 46701, true },
-  { 46711, false },
-  { 46728, true },
-  { 46747, true },
-  { 46764, true },
-  { 46777, true },
-  { 46791, true },
-  { 46808, true },
-  { 46816, true },
-  { 46828, true },
-  { 46838, true },
-  { 46849, true },
-  { 46859, true },
+  { 46462, true },
+  { 46474, true },
+  { 46485, true },
+  { 46501, true },
+  { 46514, true },
+  { 46526, false },
+  { 46543, true },
+  { 46563, true },
+  { 46580, true },
+  { 46595, true },
+  { 46611, true },
+  { 46626, true },
+  { 46641, true },
+  { 46664, true },
+  { 46690, true },
+  { 46710, true },
+  { 46725, false },
+  { 46743, true },
+  { 46762, true },
+  { 46779, true },
+  { 46792, true },
+  { 46809, true },
+  { 46819, false },
+  { 46836, true },
+  { 46855, true },
   { 46872, true },
-  { 46886, true },
-  { 46897, true },
-  { 46910, true },
-  { 46929, false },
-  { 46937, true },
-  { 46948, true },
-  { 46961, true },
-  { 46974, true },
-  { 46993, true },
-  { 47009, true },
-  { 47021, true },
-  { 47035, true },
-  { 47049, true },
-  { 47061, true },
-  { 47077, true },
-  { 47089, true },
-  { 47104, true },
-  { 47122, true },
-  { 47137, true },
-  { 47152, true },
-  { 47168, true },
-  { 47182, true },
-  { 47203, true },
-  { 47219, true },
-  { 47238, true },
-  { 47257, true },
-  { 47274, false },
-  { 47294, true },
-  { 47324, true },
-  { 47350, true },
-  { 47367, true },
-  { 47379, true },
-  { 47399, true },
-  { 47413, true },
+  { 46885, true },
+  { 46899, true },
+  { 46916, true },
+  { 46924, true },
+  { 46936, true },
+  { 46946, true },
+  { 46957, true },
+  { 46967, true },
+  { 46980, true },
+  { 46994, true },
+  { 47005, true },
+  { 47018, true },
+  { 47037, false },
+  { 47045, true },
+  { 47056, true },
+  { 47069, true },
+  { 47082, true },
+  { 47101, true },
+  { 47117, true },
+  { 47129, true },
+  { 47143, true },
+  { 47157, true },
+  { 47169, true },
+  { 47185, true },
+  { 47197, true },
+  { 47212, true },
+  { 47230, true },
+  { 47245, true },
+  { 47260, true },
+  { 47276, true },
+  { 47290, true },
+  { 47311, true },
+  { 47327, true },
+  { 47346, true },
+  { 47365, true },
+  { 47382, false },
+  { 47402, true },
   { 47432, true },
-  { 47450, true },
-  { 47465, true },
-  { 47476, true },
+  { 47458, true },
+  { 47475, true },
   { 47487, true },
-  { 47497, true },
-  { 47515, true },
-  { 47534, true },
-  { 47544, true },
-  { 47562, true },
-  { 47571, false },
-  { 47582, false },
-  { 47596, false },
-  { 47616, true },
-  { 47624, true },
-  { 47638, true },
-  { 47651, true },
-  { 47667, true },
-  { 47678, true },
-  { 47688, true },
-  { 47697, true },
-  { 47717, false },
-  { 47732, false },
-  { 47749, true },
-  { 47758, true },
-  { 47774, true },
-  { 47791, true },
-  { 47800, true },
-  { 47807, true },
-  { 47815, true },
-  { 47827, true },
-  { 47836, true },
+  { 47507, true },
+  { 47521, true },
+  { 47540, true },
+  { 47558, true },
+  { 47573, true },
+  { 47584, true },
+  { 47594, true },
+  { 47612, true },
+  { 47631, true },
+  { 47641, true },
+  { 47659, true },
+  { 47668, false },
+  { 47679, false },
+  { 47693, false },
+  { 47713, true },
+  { 47721, true },
+  { 47735, true },
+  { 47748, true },
+  { 47764, true },
+  { 47775, true },
+  { 47785, true },
+  { 47794, true },
+  { 47814, false },
+  { 47829, false },
   { 47846, true },
-  { 47856, true },
-  { 47864, true },
+  { 47855, true },
   { 47871, true },
-  { 47882, true },
-  { 47895, true },
-  { 47902, true },
+  { 47888, true },
+  { 47897, true },
+  { 47904, true },
   { 47912, true },
-  { 47927, true },
-  { 47942, true },
-  { 47955, true },
-  { 47967, true },
-  { 47982, true },
-  { 47993, true },
-  { 48003, true },
-  { 48011, true },
-  { 48020, true },
-  { 48028, true },
-  { 48042, true },
-  { 48054, true },
-  { 48069, true },
-  { 48079, true },
-  { 48096, true },
-  { 48105, true },
-  { 48115, true },
-  { 48131, true },
+  { 47924, true },
+  { 47933, true },
+  { 47943, true },
+  { 47953, true },
+  { 47961, true },
+  { 47969, true },
+  { 47976, true },
+  { 47987, true },
+  { 48000, true },
+  { 48007, true },
+  { 48017, true },
+  { 48032, true },
+  { 48047, true },
+  { 48060, true },
+  { 48072, true },
+  { 48087, true },
+  { 48098, true },
+  { 48108, true },
+  { 48116, true },
+  { 48125, true },
+  { 48133, true },
   { 48147, true },
-  { 48166, true },
-  { 48180, true },
-  { 48196, true },
-  { 48209, true },
-  { 48224, true },
-  { 48237, true },
-  { 48248, true },
-  { 48260, true },
-  { 48285, false },
-  { 48294, true },
-  { 48307, true },
-  { 48316, true },
-  { 48332, true },
+  { 48159, true },
+  { 48174, true },
+  { 48184, true },
+  { 48201, true },
+  { 48210, true },
+  { 48220, true },
+  { 48236, true },
+  { 48252, true },
+  { 48271, true },
+  { 48285, true },
+  { 48301, true },
+  { 48314, true },
+  { 48329, true },
+  { 48342, true },
   { 48353, true },
-  { 48367, true },
-  { 48381, true },
-  { 48393, true },
-  { 48415, false },
-  { 48426, true },
-  { 48438, true },
-  { 48449, true },
-  { 48463, true },
-  { 48483, true },
-  { 48497, true },
-  { 48520, true },
-  { 48534, true },
-  { 48549, true },
-  { 48566, true },
-  { 48580, true },
-  { 48599, true },
-  { 48615, true },
-  { 48626, true },
-  { 48637, true },
-  { 48649, true },
-  { 48670, false },
-  { 48686, true },
-  { 48703, true },
-  { 48721, true },
-  { 48736, true },
-  { 48764, false },
-  { 48774, false },
-  { 48784, true },
-  { 48803, false },
-  { 48815, true },
-  { 48829, true },
-  { 48842, true },
-  { 48861, true },
-  { 48877, true },
-  { 48892, true },
-  { 48915, true },
-  { 48928, true },
-  { 48945, true },
-  { 48954, true },
-  { 48975, true },
-  { 48990, true },
+  { 48365, true },
+  { 48390, false },
+  { 48399, true },
+  { 48412, true },
+  { 48421, true },
+  { 48437, true },
+  { 48458, true },
+  { 48472, true },
+  { 48486, true },
+  { 48498, true },
+  { 48520, false },
+  { 48531, true },
+  { 48543, true },
+  { 48554, true },
+  { 48568, true },
+  { 48588, true },
+  { 48602, true },
+  { 48625, true },
+  { 48640, true },
+  { 48657, true },
+  { 48671, true },
+  { 48690, true },
+  { 48706, true },
+  { 48717, true },
+  { 48728, true },
+  { 48740, true },
+  { 48761, false },
+  { 48777, true },
+  { 48794, true },
+  { 48812, true },
+  { 48827, true },
+  { 48855, false },
+  { 48865, false },
+  { 48875, true },
+  { 48894, false },
+  { 48906, true },
+  { 48920, true },
+  { 48933, true },
+  { 48952, true },
+  { 48968, true },
+  { 48983, true },
   { 49006, true },
   { 49019, true },
-  { 49032, true },
-  { 49044, true },
-  { 49058, true },
-  { 49075, true },
-  { 49092, true },
-  { 49103, true },
-  { 49117, true },
-  { 49124, true },
-  { 49133, true },
-  { 49148, true },
-  { 49159, true },
+  { 49036, true },
+  { 49045, true },
+  { 49066, true },
+  { 49081, true },
+  { 49097, true },
+  { 49110, true },
+  { 49123, true },
+  { 49135, true },
+  { 49149, true },
+  { 49166, true },
   { 49183, true },
   { 49194, true },
-  { 49204, true },
-  { 49217, true },
-  { 49228, true },
-  { 49240, true },
-  { 49261, true },
-  { 49275, true },
-  { 49290, true },
-  { 49305, true },
-  { 49317, true },
-  { 49334, true },
-  { 49350, true },
-  { 49371, true },
-  { 49388, true },
-  { 49417, true },
-  { 49431, true },
-  { 49442, false },
-  { 49456, true },
-  { 49474, true },
-  { 49489, true },
-  { 49506, true },
-  { 49523, true },
-  { 49534, true },
-  { 49552, true },
-  { 49575, true },
-  { 49589, true },
-  { 49608, true },
-  { 49627, true },
-  { 49641, true },
-  { 49652, true },
-  { 49662, true },
-  { 49675, true },
-  { 49691, true },
-  { 49711, true },
-  { 49740, true },
-  { 49756, true },
-  { 49772, true },
-  { 49782, true },
-  { 49798, true },
-  { 49807, true },
-  { 49822, true },
-  { 49834, true },
-  { 49848, true },
-  { 49863, true },
-  { 49876, true },
-  { 49892, false },
-  { 49902, true },
-  { 49919, true },
-  { 49932, true },
-  { 49950, true },
-  { 49972, true },
-  { 49983, true },
-  { 49992, true },
-  { 50013, true },
-  { 50025, false },
-  { 50038, true },
-  { 50050, true },
-  { 50063, true },
-  { 50078, true },
-  { 50090, true },
-  { 50107, true },
-  { 50122, true },
-  { 50153, true },
-  { 50185, true },
-  { 50213, true },
-  { 50243, true },
-  { 50255, true },
-  { 50269, true },
+  { 49208, true },
+  { 49215, true },
+  { 49224, true },
+  { 49239, true },
+  { 49250, true },
+  { 49274, true },
+  { 49285, true },
+  { 49295, true },
+  { 49308, true },
+  { 49319, true },
+  { 49331, true },
+  { 49352, true },
+  { 49366, true },
+  { 49381, true },
+  { 49396, true },
+  { 49408, true },
+  { 49425, true },
+  { 49441, true },
+  { 49462, true },
+  { 49479, true },
+  { 49508, true },
+  { 49522, true },
+  { 49533, true },
+  { 49556, false },
+  { 49570, true },
+  { 49588, true },
+  { 49603, true },
+  { 49620, true },
+  { 49637, true },
+  { 49648, true },
+  { 49666, true },
+  { 49689, true },
+  { 49703, true },
+  { 49722, true },
+  { 49741, true },
+  { 49755, true },
+  { 49766, true },
+  { 49776, true },
+  { 49789, true },
+  { 49805, true },
+  { 49825, true },
+  { 49843, true },
+  { 49872, true },
+  { 49888, true },
+  { 49904, true },
+  { 49914, true },
+  { 49930, true },
+  { 49939, true },
+  { 49954, true },
+  { 49966, true },
+  { 49980, true },
+  { 49995, true },
+  { 50008, true },
+  { 50024, false },
+  { 50034, true },
+  { 50051, true },
+  { 50064, true },
+  { 50082, true },
+  { 50104, true },
+  { 50115, true },
+  { 50124, true },
+  { 50145, true },
+  { 50157, false },
+  { 50170, true },
+  { 50182, true },
+  { 50195, true },
+  { 50210, true },
+  { 50222, true },
+  { 50239, true },
+  { 50254, true },
   { 50285, true },
-  { 50295, true },
-  { 50305, true },
-  { 50320, true },
-  { 50342, true },
-  { 50356, true },
-  { 50366, true },
-  { 50377, true },
-  { 50393, true },
-  { 50411, true },
-  { 50419, true },
-  { 50433, true },
-  { 50448, true },
-  { 50456, true },
-  { 50465, true },
+  { 50317, true },
+  { 50345, true },
+  { 50375, true },
+  { 50387, true },
+  { 50401, true },
+  { 50417, true },
+  { 50427, true },
+  { 50437, true },
+  { 50452, true },
+  { 50474, true },
   { 50488, true },
-  { 50503, true },
-  { 50518, true },
-  { 50536, true },
-  { 50548, true },
-  { 50564, true },
-  { 50579, true },
-  { 50592, true },
-  { 50603, true },
-  { 50618, true },
+  { 50498, true },
+  { 50509, true },
+  { 50525, true },
+  { 50543, true },
+  { 50551, true },
+  { 50565, true },
+  { 50580, true },
+  { 50588, true },
+  { 50597, true },
+  { 50620, true },
   { 50635, true },
-  { 50646, true },
-  { 50655, true },
-  { 50671, true },
-  { 50681, false },
-  { 50700, true },
-  { 50714, true },
-  { 50722, true },
-  { 50731, true },
-  { 50741, true },
-  { 50762, true },
-  { 50771, true },
-  { 50782, true },
-  { 50798, true },
-  { 50808, true },
-  { 50827, true },
-  { 50841, true },
+  { 50650, true },
+  { 50668, true },
+  { 50680, true },
+  { 50696, true },
+  { 50711, true },
+  { 50724, true },
+  { 50735, true },
+  { 50750, true },
+  { 50767, true },
+  { 50778, true },
+  { 50787, true },
+  { 50803, true },
+  { 50813, false },
+  { 50832, true },
+  { 50846, true },
   { 50854, true },
-  { 50872, true },
-  { 50892, true },
-  { 50912, true },
-  { 50920, true },
-  { 50933, true },
-  { 50944, true },
-  { 50962, true },
-  { 50972, true },
-  { 50981, true },
-  { 50990, true },
-  { 51001, true },
-  { 51009, true },
-  { 51019, true },
-  { 51031, true },
-  { 51041, true },
-  { 51056, true },
-  { 51063, true },
+  { 50863, true },
+  { 50873, true },
+  { 50894, true },
+  { 50903, true },
+  { 50914, true },
+  { 50930, true },
+  { 50940, true },
+  { 50959, true },
+  { 50973, true },
+  { 50986, true },
+  { 51004, true },
+  { 51024, true },
+  { 51044, true },
+  { 51052, true },
+  { 51065, true },
   { 51076, true },
-  { 51100, false },
-  { 51115, true },
-  { 51135, true },
-  { 51154, true },
-  { 51171, true },
-  { 51182, true },
-  { 51197, true },
-  { 51207, true },
-  { 51223, true },
-  { 51240, true },
-  { 51254, true },
-  { 51271, true },
-  { 51292, true },
-  { 51301, true },
+  { 51094, true },
+  { 51104, true },
+  { 51113, true },
+  { 51122, true },
+  { 51133, true },
+  { 51141, true },
+  { 51151, true },
+  { 51163, true },
+  { 51173, true },
+  { 51188, true },
+  { 51195, true },
+  { 51208, true },
+  { 51232, false },
+  { 51247, true },
+  { 51267, true },
+  { 51286, true },
+  { 51303, true },
   { 51314, true },
-  { 51324, true },
-  { 51336, true },
-  { 51345, true },
+  { 51329, true },
+  { 51339, true },
   { 51355, true },
-  { 51367, true },
-  { 51378, true },
+  { 51372, true },
   { 51386, true },
-  { 51393, true },
-  { 51418, true },
-  { 51436, true },
-  { 51454, true },
+  { 51403, true },
+  { 51424, true },
+  { 51433, true },
+  { 51446, true },
+  { 51456, true },
   { 51468, true },
   { 51477, true },
-  { 51490, true },
-  { 51507, true },
-  { 51520, true },
-  { 51535, true },
-  { 51553, false },
-  { 51566, true },
-  { 51582, true },
-  { 51598, true },
-  { 51611, true },
-  { 51624, true },
-  { 51637, true },
-  { 51647, false },
-  { 51665, true },
-  { 51678, true },
-  { 51691, true },
-  { 51707, true },
-  { 51726, true },
-  { 51741, true },
-  { 51748, true },
-  { 51761, true },
-  { 51790, true },
-  { 51812, true },
-  { 51833, true },
-  { 51860, true },
+  { 51487, true },
+  { 51499, true },
+  { 51510, true },
+  { 51518, true },
+  { 51525, true },
+  { 51550, true },
+  { 51568, true },
+  { 51586, true },
+  { 51600, true },
+  { 51609, true },
+  { 51622, true },
+  { 51639, true },
+  { 51652, true },
+  { 51667, true },
+  { 51685, false },
+  { 51698, true },
+  { 51714, true },
+  { 51730, true },
+  { 51743, true },
+  { 51756, true },
+  { 51769, true },
+  { 51779, false },
+  { 51797, true },
+  { 51810, true },
+  { 51823, true },
+  { 51839, true },
+  { 51858, true },
+  { 51873, true },
   { 51880, true },
-  { 51888, true },
-  { 51899, true },
-  { 51919, true },
-  { 51938, true },
-  { 51953, true },
-  { 51972, true },
-  { 51988, true },
-  { 52004, false },
-  { 52019, true },
-  { 52034, true },
-  { 52049, true },
-  { 52068, true },
-  { 52082, true },
-  { 52100, true },
-  { 52109, true },
-  { 52119, true },
-  { 52130, true },
-  { 52146, true },
-  { 52160, true },
-  { 52174, true },
-  { 52207, true },
-  { 52221, true },
-  { 52235, true },
-  { 52244, true },
-  { 52255, true },
-  { 52279, true },
-  { 52291, true },
-  { 52302, false },
-  { 52315, true },
-  { 52321, true },
-  { 52331, true },
-  { 52340, true },
-  { 52354, true },
-  { 52364, true },
-  { 52380, true },
-  { 52393, true },
-  { 52406, true },
-  { 52418, true },
-  { 52434, true },
-  { 52445, true },
-  { 52457, true },
+  { 51893, true },
+  { 51922, true },
+  { 51944, true },
+  { 51965, true },
+  { 51992, true },
+  { 52012, true },
+  { 52020, true },
+  { 52031, true },
+  { 52051, true },
+  { 52070, true },
+  { 52085, true },
+  { 52104, true },
+  { 52120, true },
+  { 52136, false },
+  { 52151, true },
+  { 52166, true },
+  { 52181, true },
+  { 52200, true },
+  { 52214, true },
+  { 52232, true },
+  { 52241, true },
+  { 52251, true },
+  { 52262, true },
+  { 52278, true },
+  { 52292, true },
+  { 52306, true },
+  { 52339, true },
+  { 52353, true },
+  { 52367, true },
+  { 52376, true },
+  { 52387, true },
+  { 52411, true },
+  { 52423, true },
+  { 52434, false },
+  { 52447, true },
+  { 52453, true },
+  { 52463, true },
   { 52472, true },
-  { 52489, true },
-  { 52500, true },
+  { 52486, true },
+  { 52496, true },
   { 52512, true },
-  { 52528, false },
-  { 52543, true },
-  { 52553, true },
-  { 52569, true },
-  { 52581, true },
-  { 52592, true },
-  { 52609, true },
-  { 52628, true },
-  { 52651, true },
-  { 52668, true },
-  { 52677, false },
-  { 52686, true },
-  { 52697, true },
-  { 52714, true },
-  { 52730, true },
-  { 52744, true },
-  { 52758, true },
-  { 52776, false },
-  { 52784, true },
-  { 52793, true },
-  { 52806, true },
-  { 52823, true },
-  { 52835, true },
-  { 52845, true },
-  { 52853, true },
-  { 52863, true },
-  { 52869, true },
-  { 52877, true },
-  { 52895, true },
-  { 52904, true },
+  { 52525, true },
+  { 52538, true },
+  { 52550, true },
+  { 52566, true },
+  { 52577, true },
+  { 52589, true },
+  { 52604, true },
+  { 52621, true },
+  { 52632, true },
+  { 52644, true },
+  { 52660, false },
+  { 52675, true },
+  { 52685, true },
+  { 52701, true },
+  { 52713, true },
+  { 52724, true },
+  { 52741, true },
+  { 52760, true },
+  { 52783, true },
+  { 52800, true },
+  { 52809, false },
+  { 52818, true },
+  { 52829, true },
+  { 52846, true },
+  { 52862, true },
+  { 52876, true },
+  { 52890, true },
+  { 52908, false },
   { 52916, true },
   { 52925, true },
-  { 52940, true },
-  { 52950, true },
-  { 52959, true },
-  { 52971, true },
-  { 52992, true },
-  { 53003, true },
-  { 53017, true },
+  { 52938, true },
+  { 52955, true },
+  { 52967, true },
+  { 52977, true },
+  { 52985, true },
+  { 52995, true },
+  { 53001, true },
+  { 53009, true },
   { 53027, true },
-  { 53044, true },
-  { 53056, true },
-  { 53079, true },
-  { 53093, true },
-  { 53108, true },
-  { 53119, true },
+  { 53036, true },
+  { 53048, true },
+  { 53057, true },
+  { 53072, true },
+  { 53082, true },
+  { 53091, true },
+  { 53103, true },
+  { 53124, true },
   { 53135, true },
-  { 53146, true },
-  { 53162, true },
-  { 53190, true },
-  { 53206, true },
-  { 53218, false },
-  { 53236, true },
-  { 53247, true },
-  { 53257, true },
+  { 53149, true },
+  { 53159, true },
+  { 53176, true },
+  { 53188, true },
+  { 53211, true },
+  { 53225, true },
+  { 53240, true },
+  { 53251, true },
+  { 53267, true },
   { 53278, true },
-  { 53288, true },
-  { 53303, true },
-  { 53317, true },
-  { 53327, true },
-  { 53342, true },
-  { 53353, true },
-  { 53365, true },
-  { 53383, true },
-  { 53396, true },
-  { 53409, true },
-  { 53418, true },
-  { 53427, true },
-  { 53439, true },
-  { 53455, true },
-  { 53466, true },
-  { 53482, true },
-  { 53501, true },
-  { 53517, true },
-  { 53532, true },
-  { 53563, true },
+  { 53294, true },
+  { 53322, true },
+  { 53338, true },
+  { 53350, false },
+  { 53368, true },
+  { 53379, true },
+  { 53389, true },
+  { 53410, true },
+  { 53420, true },
+  { 53435, true },
+  { 53449, true },
+  { 53459, true },
+  { 53474, true },
+  { 53485, true },
+  { 53497, true },
+  { 53515, true },
+  { 53528, true },
+  { 53541, true },
+  { 53550, true },
+  { 53559, true },
+  { 53571, true },
   { 53587, true },
-  { 53606, true },
-  { 53626, true },
-  { 53643, true },
-  { 53659, true },
-  { 53674, true },
-  { 53693, true },
-  { 53715, true },
-  { 53732, true },
-  { 53747, true },
-  { 53766, true },
-  { 53779, true },
-  { 53794, true },
-  { 53809, true },
-  { 53822, true },
-  { 53838, true },
-  { 53850, true },
-  { 53863, true },
-  { 53873, false },
-  { 53882, true },
-  { 53902, true },
-  { 53917, true },
-  { 53928, true },
-  { 53949, true },
-  { 53965, true },
-  { 53989, false },
-  { 54006, true },
-  { 54019, true },
-  { 54035, true },
-  { 54048, true },
-  { 54061, true },
-  { 54074, true },
-  { 54083, true },
-  { 54101, true },
-  { 54110, true },
-  { 54120, true },
-  { 54133, true },
-  { 54143, true },
-  { 54152, true },
-  { 54168, true },
-  { 54195, true },
+  { 53598, true },
+  { 53614, true },
+  { 53633, true },
+  { 53649, true },
+  { 53664, true },
+  { 53695, true },
+  { 53719, true },
+  { 53738, true },
+  { 53758, true },
+  { 53775, true },
+  { 53791, true },
+  { 53806, true },
+  { 53825, true },
+  { 53847, true },
+  { 53864, true },
+  { 53879, true },
+  { 53898, true },
+  { 53911, true },
+  { 53926, true },
+  { 53941, true },
+  { 53954, true },
+  { 53970, true },
+  { 53982, true },
+  { 53995, true },
+  { 54005, false },
+  { 54014, true },
+  { 54034, true },
+  { 54049, true },
+  { 54060, true },
+  { 54081, true },
+  { 54097, true },
+  { 54121, false },
+  { 54138, true },
+  { 54151, true },
+  { 54167, true },
+  { 54180, true },
+  { 54193, true },
   { 54206, true },
-  { 54223, true },
-  { 54236, true },
-  { 54250, true },
-  { 54267, true },
-  { 54282, true },
-  { 54305, true },
-  { 54315, true },
-  { 54330, true },
+  { 54215, true },
+  { 54233, true },
+  { 54242, true },
+  { 54252, true },
+  { 54265, true },
+  { 54275, true },
+  { 54284, true },
+  { 54300, true },
+  { 54327, true },
+  { 54338, true },
   { 54355, true },
-  { 54379, true },
-  { 54388, true },
-  { 54409, true },
-  { 54429, true },
-  { 54441, true },
-  { 54454, true },
-  { 54468, true },
-  { 54485, true },
-  { 54502, false },
-  { 54514, false },
-  { 54527, true },
+  { 54368, true },
+  { 54382, true },
+  { 54399, true },
+  { 54414, true },
+  { 54437, true },
+  { 54447, true },
+  { 54462, true },
+  { 54487, true },
+  { 54511, true },
+  { 54520, true },
   { 54541, true },
-  { 54558, true },
-  { 54567, true },
-  { 54578, true },
-  { 54592, true },
-  { 54603, true },
+  { 54561, true },
+  { 54573, true },
+  { 54586, true },
+  { 54600, true },
   { 54617, true },
-  { 54634, true },
-  { 54643, true },
-  { 54657, false },
-  { 54685, true },
-  { 54694, true },
-  { 54703, true },
-  { 54712, true },
-  { 54722, true },
-  { 54738, true },
-  { 54748, true },
-  { 54762, true },
-  { 54784, false },
-  { 54798, false },
-  { 54813, true },
-  { 54837, true },
-  { 54858, true },
+  { 54634, false },
+  { 54646, false },
+  { 54659, true },
+  { 54673, true },
+  { 54690, true },
+  { 54699, true },
+  { 54710, true },
+  { 54724, true },
+  { 54735, true },
+  { 54749, true },
+  { 54766, true },
+  { 54775, true },
+  { 54789, false },
+  { 54817, true },
+  { 54826, true },
+  { 54835, true },
+  { 54844, true },
+  { 54854, true },
+  { 54870, true },
   { 54880, true },
   { 54894, true },
-  { 54904, true },
-  { 54914, true },
-  { 54926, true },
-  { 54942, true },
-  { 54956, true },
-  { 54975, true },
-  { 54991, true },
-  { 55004, true },
-  { 55016, true },
-  { 55029, true },
-  { 55041, true },
-  { 55053, true },
-  { 55066, true },
-  { 55076, true },
-  { 55095, true },
-  { 55119, true },
-  { 55135, true },
-  { 55145, true },
+  { 54916, false },
+  { 54930, false },
+  { 54945, true },
+  { 54969, true },
+  { 54990, true },
+  { 55012, true },
+  { 55026, true },
+  { 55036, true },
+  { 55046, true },
+  { 55058, true },
+  { 55074, true },
+  { 55088, true },
+  { 55107, true },
+  { 55123, true },
+  { 55136, true },
+  { 55148, true },
   { 55161, true },
-  { 55180, true },
-  { 55194, true },
-  { 55212, true },
-  { 55229, true },
-  { 55246, true },
-  { 55254, false },
-  { 55280, true },
-  { 55292, true },
+  { 55173, true },
+  { 55185, true },
+  { 55198, true },
+  { 55208, true },
+  { 55227, true },
+  { 55251, true },
+  { 55267, true },
+  { 55277, true },
+  { 55293, true },
   { 55312, true },
-  { 55328, true },
-  { 55346, true },
-  { 55356, true },
-  { 55371, true },
-  { 55383, true },
-  { 55398, true },
-  { 55416, true },
-  { 55434, true },
-  { 55453, true },
-  { 55467, true },
-  { 55477, true },
+  { 55326, true },
+  { 55344, true },
+  { 55361, true },
+  { 55378, true },
+  { 55386, false },
+  { 55412, true },
+  { 55424, true },
+  { 55444, true },
+  { 55460, true },
+  { 55478, true },
   { 55488, true },
-  { 55504, true },
-  { 55523, true },
-  { 55533, true },
-  { 55552, true },
-  { 55564, true },
-  { 55575, true },
-  { 55588, true },
-  { 55612, true },
+  { 55503, true },
+  { 55515, true },
+  { 55530, true },
+  { 55548, true },
+  { 55566, true },
+  { 55585, true },
+  { 55599, true },
+  { 55609, true },
+  { 55620, true },
   { 55636, true },
-  { 55656, true },
-  { 55669, false },
-  { 55681, true },
-  { 55693, true },
-  { 55708, true },
-  { 55728, true },
-  { 55738, true },
-  { 55748, false },
-  { 55765, true },
-  { 55773, true },
-  { 55789, true },
-  { 55804, true },
-  { 55820, true },
-  { 55836, true },
-  { 55850, true },
-  { 55864, true },
-  { 55876, true },
-  { 55896, true },
-  { 55912, true },
-  { 55929, true },
-  { 55939, true },
+  { 55655, true },
+  { 55665, true },
+  { 55684, true },
+  { 55696, true },
+  { 55707, true },
+  { 55720, true },
+  { 55744, true },
+  { 55768, true },
+  { 55788, true },
+  { 55801, false },
+  { 55813, true },
+  { 55825, true },
+  { 55840, true },
+  { 55860, true },
+  { 55870, true },
+  { 55880, false },
+  { 55897, true },
+  { 55905, true },
+  { 55921, true },
+  { 55936, true },
   { 55952, true },
-  { 55966, true },
-  { 55979, true },
-  { 55989, true },
-  { 56003, true },
-  { 56015, true },
-  { 56031, true },
-  { 56055, true },
-  { 56080, true },
-  { 56093, true },
-  { 56106, true },
-  { 56118, true },
-  { 56137, true },
-  { 56150, true },
+  { 55968, true },
+  { 55982, true },
+  { 55996, true },
+  { 56008, true },
+  { 56028, true },
+  { 56044, true },
+  { 56061, true },
+  { 56071, true },
+  { 56084, true },
+  { 56098, true },
+  { 56111, true },
+  { 56121, true },
+  { 56135, true },
+  { 56147, true },
   { 56163, true },
-  { 56176, true },
-  { 56196, true },
-  { 56211, true },
-  { 56229, true },
+  { 56187, true },
+  { 56212, true },
+  { 56225, true },
   { 56238, true },
-  { 56249, true },
-  { 56260, true },
-  { 56272, true },
-  { 56283, true },
-  { 56293, true },
-  { 56307, true },
-  { 56319, true },
-  { 56329, true },
+  { 56250, true },
+  { 56269, true },
+  { 56282, true },
+  { 56295, true },
+  { 56308, true },
+  { 56328, true },
   { 56343, true },
-  { 56377, true },
-  { 56407, true },
-  { 56417, true },
-  { 56429, true },
-  { 56438, true },
-  { 56449, false },
-  { 56462, true },
-  { 56469, true },
-  { 56481, true },
-  { 56497, true },
-  { 56514, true },
-  { 56527, false },
-  { 56547, true },
-  { 56560, true },
-  { 56572, true },
-  { 56585, true },
-  { 56604, true },
-  { 56614, true },
-  { 56623, true },
-  { 56638, true },
-  { 56651, true },
-  { 56662, true },
-  { 56671, true },
-  { 56684, true },
-  { 56693, true },
-  { 56706, true },
-  { 56715, true },
-  { 56727, true },
-  { 56736, true },
-  { 56745, true },
-  { 56764, true },
-  { 56778, true },
-  { 56796, true },
-  { 56818, false },
-  { 56843, true },
-  { 56856, true },
-  { 56865, true },
-  { 56886, true },
-  { 56896, true },
-  { 56908, true },
-  { 56933, true },
+  { 56361, true },
+  { 56370, true },
+  { 56381, true },
+  { 56392, true },
+  { 56404, true },
+  { 56415, true },
+  { 56425, true },
+  { 56439, true },
+  { 56451, true },
+  { 56461, true },
+  { 56475, true },
+  { 56509, true },
+  { 56539, true },
+  { 56549, true },
+  { 56561, true },
+  { 56570, true },
+  { 56581, false },
+  { 56594, true },
+  { 56601, true },
+  { 56613, true },
+  { 56629, true },
+  { 56646, true },
+  { 56659, false },
+  { 56679, true },
+  { 56692, true },
+  { 56704, true },
+  { 56717, true },
+  { 56736, false },
+  { 56757, true },
+  { 56767, true },
+  { 56776, true },
+  { 56791, true },
+  { 56804, true },
+  { 56815, true },
+  { 56824, true },
+  { 56837, true },
+  { 56846, true },
+  { 56859, true },
+  { 56868, true },
+  { 56880, true },
+  { 56889, true },
+  { 56898, true },
+  { 56917, true },
+  { 56931, true },
   { 56949, true },
-  { 56962, true },
-  { 56977, true },
-  { 56991, true },
-  { 57000, true },
+  { 56971, false },
+  { 56996, true },
+  { 57009, true },
   { 57018, true },
-  { 57028, true },
-  { 57046, true },
-  { 57057, true },
-  { 57083, false },
-  { 57098, true },
-  { 57113, true },
-  { 57122, true },
-  { 57131, true },
-  { 57145, false },
-  { 57156, true },
-  { 57164, true },
-  { 57173, true },
+  { 57039, true },
+  { 57049, true },
+  { 57061, true },
+  { 57086, true },
+  { 57102, true },
+  { 57115, true },
+  { 57130, true },
+  { 57144, true },
+  { 57153, true },
+  { 57171, true },
   { 57181, true },
-  { 57190, true },
-  { 57205, true },
-  { 57217, true },
-  { 57231, true },
-  { 57245, true },
-  { 57265, true },
-  { 57277, true },
-  { 57295, true },
-  { 57311, true },
-  { 57325, true },
-  { 57342, true },
+  { 57199, true },
+  { 57210, true },
+  { 57236, false },
+  { 57251, true },
+  { 57266, true },
+  { 57275, true },
+  { 57284, true },
+  { 57298, false },
+  { 57309, true },
+  { 57317, true },
+  { 57326, true },
+  { 57334, true },
+  { 57343, true },
   { 57355, true },
-  { 57365, true },
-  { 57379, true },
-  { 57391, true },
-  { 57405, true },
-  { 57418, true },
-  { 57431, true },
-  { 57444, true },
-  { 57455, true },
-  { 57465, true },
-  { 57472, true },
-  { 57481, true },
-  { 57500, true },
-  { 57514, true },
-  { 57528, true },
-  { 57539, true },
-  { 57552, true },
-  { 57568, true },
-  { 57591, true },
-  { 57606, true },
-  { 57620, true },
-  { 57640, true },
+  { 57369, true },
+  { 57383, true },
+  { 57403, true },
+  { 57415, true },
+  { 57433, true },
+  { 57449, true },
+  { 57463, true },
+  { 57480, true },
+  { 57493, true },
+  { 57503, true },
+  { 57517, true },
+  { 57529, true },
+  { 57543, true },
+  { 57556, true },
+  { 57569, true },
+  { 57582, true },
+  { 57593, true },
+  { 57603, true },
+  { 57610, true },
+  { 57619, true },
+  { 57638, true },
   { 57652, true },
-  { 57667, true },
-  { 57686, true },
-  { 57700, true },
-  { 57718, true },
-  { 57736, true },
-  { 57743, true },
-  { 57755, true },
-  { 57772, true },
-  { 57791, true },
-  { 57801, true },
-  { 57814, true },
+  { 57666, true },
+  { 57677, true },
+  { 57690, true },
+  { 57706, true },
+  { 57729, true },
+  { 57744, true },
+  { 57758, true },
+  { 57778, true },
+  { 57790, true },
+  { 57805, true },
   { 57824, true },
   { 57838, true },
-  { 57855, true },
-  { 57868, true },
-  { 57878, true },
-  { 57890, true },
-  { 57902, true },
-  { 57915, false },
-  { 57930, true },
-  { 57943, true },
-  { 57957, true },
-  { 57974, true },
-  { 57986, true },
-  { 58005, true },
-  { 58012, true },
-  { 58024, true },
-  { 58036, true },
-  { 58046, true },
-  { 58057, true },
-  { 58071, true },
-  { 58096, true },
-  { 58119, false },
-  { 58129, true },
-  { 58140, true },
-  { 58153, true },
-  { 58164, true },
-  { 58173, true },
-  { 58183, true },
-  { 58196, true },
-  { 58207, true },
-  { 58227, true },
-  { 58247, true },
-  { 58265, true },
-  { 58277, true },
-  { 58296, true },
-  { 58319, true },
-  { 58337, true },
-  { 58354, true },
-  { 58368, true },
-  { 58391, true },
-  { 58401, true },
-  { 58416, true },
-  { 58432, true },
-  { 58445, true },
-  { 58453, true },
-  { 58465, true },
-  { 58479, true },
-  { 58501, true },
-  { 58508, true },
-  { 58521, true },
-  { 58541, true },
-  { 58559, true },
-  { 58581, true },
-  { 58594, true },
-  { 58605, true },
-  { 58619, true },
-  { 58632, true },
-  { 58651, true },
-  { 58667, true },
-  { 58686, true },
-  { 58705, true },
-  { 58720, true },
+  { 57856, true },
+  { 57874, true },
+  { 57881, true },
+  { 57893, true },
+  { 57910, true },
+  { 57929, true },
+  { 57939, true },
+  { 57952, true },
+  { 57962, true },
+  { 57976, true },
+  { 57993, true },
+  { 58006, true },
+  { 58016, true },
+  { 58028, true },
+  { 58040, true },
+  { 58053, false },
+  { 58068, true },
+  { 58081, true },
+  { 58095, true },
+  { 58112, true },
+  { 58124, true },
+  { 58143, true },
+  { 58150, true },
+  { 58162, true },
+  { 58174, true },
+  { 58184, true },
+  { 58195, true },
+  { 58209, true },
+  { 58234, true },
+  { 58257, false },
+  { 58267, true },
+  { 58278, true },
+  { 58291, true },
+  { 58302, true },
+  { 58311, true },
+  { 58321, true },
+  { 58334, true },
+  { 58345, true },
+  { 58365, true },
+  { 58385, true },
+  { 58403, true },
+  { 58415, true },
+  { 58434, true },
+  { 58457, true },
+  { 58475, true },
+  { 58492, true },
+  { 58506, true },
+  { 58529, true },
+  { 58539, true },
+  { 58554, true },
+  { 58570, true },
+  { 58583, true },
+  { 58591, true },
+  { 58603, true },
+  { 58617, true },
+  { 58639, true },
+  { 58646, true },
+  { 58659, true },
+  { 58679, true },
+  { 58697, true },
+  { 58719, true },
   { 58732, true },
-  { 58748, true },
-  { 58767, true },
-  { 58784, true },
+  { 58743, true },
+  { 58757, true },
+  { 58770, true },
+  { 58789, true },
   { 58805, true },
   { 58824, true },
-  { 58842, true },
-  { 58860, true },
-  { 58869, true },
-  { 58892, true },
-  { 58906, true },
-  { 58919, true },
-  { 58931, true },
-  { 58941, true },
-  { 58952, false },
+  { 58843, true },
+  { 58858, true },
+  { 58870, true },
+  { 58886, true },
+  { 58905, true },
+  { 58922, true },
+  { 58943, true },
   { 58962, true },
-  { 58982, true },
-  { 58995, true },
-  { 59010, true },
-  { 59019, true },
-  { 59031, true },
-  { 59041, true },
-  { 59048, true },
-  { 59065, true },
-  { 59078, true },
-  { 59087, true },
+  { 58980, true },
+  { 58998, true },
+  { 59007, true },
+  { 59030, true },
+  { 59044, true },
+  { 59057, true },
+  { 59069, true },
+  { 59079, true },
+  { 59090, false },
   { 59100, true },
-  { 59113, true },
-  { 59131, true },
-  { 59151, true },
-  { 59167, true },
-  { 59183, true },
-  { 59197, true },
-  { 59214, true },
-  { 59224, true },
+  { 59120, true },
+  { 59133, true },
+  { 59148, true },
+  { 59157, true },
+  { 59169, true },
+  { 59179, true },
+  { 59186, true },
+  { 59203, true },
+  { 59216, true },
+  { 59225, true },
+  { 59238, true },
   { 59251, true },
-  { 59286, true },
-  { 59312, false },
-  { 59325, true },
-  { 59338, true },
-  { 59357, true },
-  { 59382, true },
-  { 59397, true },
-  { 59417, false },
-  { 59427, true },
-  { 59444, true },
-  { 59461, true },
-  { 59471, true },
-  { 59481, true },
-  { 59494, true },
-  { 59509, true },
-  { 59522, true },
-  { 59537, true },
-  { 59553, true },
-  { 59566, true },
-  { 59579, true },
-  { 59593, true },
-  { 59608, true },
+  { 59269, true },
+  { 59289, true },
+  { 59305, true },
+  { 59321, true },
+  { 59335, true },
+  { 59352, true },
+  { 59362, true },
+  { 59389, true },
+  { 59424, true },
+  { 59450, false },
+  { 59463, true },
+  { 59476, true },
+  { 59495, true },
+  { 59520, true },
+  { 59535, true },
+  { 59555, false },
+  { 59565, true },
+  { 59582, true },
+  { 59599, true },
+  { 59609, true },
   { 59619, true },
-  { 59631, true },
-  { 59644, true },
-  { 59663, true },
-  { 59687, true },
-  { 59709, true },
-  { 59730, true },
-  { 59755, true },
-  { 59778, true },
-  { 59798, true },
-  { 59809, true },
-  { 59821, true },
-  { 59841, true },
-  { 59858, true },
-  { 59879, true },
-  { 59897, true },
-  { 59920, true },
+  { 59632, true },
+  { 59647, true },
+  { 59660, true },
+  { 59675, true },
+  { 59691, true },
+  { 59704, true },
+  { 59717, true },
+  { 59731, true },
+  { 59746, true },
+  { 59757, true },
+  { 59769, true },
+  { 59782, true },
+  { 59801, true },
+  { 59825, true },
+  { 59847, true },
+  { 59868, true },
+  { 59893, true },
+  { 59916, true },
   { 59936, true },
-  { 59956, true },
-  { 59969, true },
+  { 59947, true },
+  { 59959, true },
   { 59979, true },
-  { 59990, true },
-  { 60009, true },
-  { 60019, true },
-  { 60029, true },
-  { 60037, true },
-  { 60050, true },
-  { 60063, true },
-  { 60072, true },
-  { 60079, true },
-  { 60086, false },
-  { 60102, true },
-  { 60111, true },
+  { 59996, true },
+  { 60017, true },
+  { 60035, true },
+  { 60058, true },
+  { 60074, true },
+  { 60094, true },
+  { 60107, true },
+  { 60117, true },
   { 60128, true },
-  { 60142, true },
-  { 60161, true },
-  { 60173, true },
-  { 60196, true },
+  { 60147, true },
+  { 60157, true },
+  { 60167, true },
+  { 60175, true },
+  { 60188, true },
+  { 60201, true },
   { 60210, true },
-  { 60226, true },
-  { 60238, true },
-  { 60254, true },
-  { 60271, true },
-  { 60289, true },
-  { 60310, true },
-  { 60327, true },
-  { 60344, true },
-  { 60361, true },
-  { 60378, true },
-  { 60395, true },
-  { 60412, true },
-  { 60428, true },
-  { 60442, true },
-  { 60467, true },
-  { 60478, true },
-  { 60494, true },
-  { 60510, true },
-  { 60526, false },
-  { 60539, false },
-  { 60555, true },
-  { 60569, true },
-  { 60582, true },
-  { 60593, true },
-  { 60607, true },
-  { 60621, true },
-  { 60631, false },
-  { 60641, true },
-  { 60650, true },
-  { 60669, true },
-  { 60678, false },
-  { 60698, true },
-  { 60721, true },
-  { 60738, true },
-  { 60757, true },
-  { 60774, true },
-  { 60786, true },
-  { 60797, false },
-  { 60809, true },
-  { 60820, true },
-  { 60835, true },
-  { 60853, true },
-  { 60863, true },
-  { 60871, true },
-  { 60885, true },
-  { 60898, false },
-  { 60911, true },
-  { 60926, true },
-  { 60940, true },
-  { 60952, true },
-  { 60966, true },
-  { 60980, true },
-  { 60990, true },
-  { 61006, true },
-  { 61022, true },
-  { 61041, false },
-  { 61070, true },
-  { 61084, true },
-  { 61098, true },
-  { 61119, true },
-  { 61137, true },
-  { 61152, true },
-  { 61168, true },
-  { 61181, true },
-  { 61199, true },
-  { 61219, true },
-  { 61231, true },
-  { 61243, true },
-  { 61258, true },
-  { 61281, true },
-  { 61305, true },
-  { 61329, true },
-  { 61339, true },
-  { 61361, true },
-  { 61393, true },
-  { 61404, true },
-  { 61414, true },
-  { 61429, true },
-  { 61443, false },
-  { 61463, true },
-  { 61481, true },
-  { 61490, true },
-  { 61497, true },
-  { 61508, true },
-  { 61517, true },
-  { 61530, true },
-  { 61553, true },
-  { 61568, false },
-  { 61579, false },
-  { 61591, false },
-  { 61602, true },
-  { 61628, false },
-  { 61644, true },
-  { 61654, true },
-  { 61662, true },
-  { 61671, true },
-  { 61683, true },
-  { 61695, false },
-  { 61707, true },
-  { 61720, true },
-  { 61737, true },
-  { 61757, true },
-  { 61768, true },
-  { 61784, true },
-  { 61796, true },
-  { 61813, true },
-  { 61822, true },
-  { 61835, true },
-  { 61848, true },
-  { 61866, true },
-  { 61879, true },
-  { 61903, true },
-  { 61917, true },
-  { 61934, true },
-  { 61949, true },
-  { 61959, true },
-  { 61971, true },
-  { 61983, false },
-  { 61998, true },
-  { 62013, true },
-  { 62030, true },
-  { 62038, true },
+  { 60217, true },
+  { 60224, false },
+  { 60240, true },
+  { 60249, true },
+  { 60266, true },
+  { 60280, true },
+  { 60299, true },
+  { 60311, true },
+  { 60334, true },
+  { 60348, true },
+  { 60364, true },
+  { 60376, true },
+  { 60392, true },
+  { 60409, true },
+  { 60427, true },
+  { 60448, true },
+  { 60465, true },
+  { 60482, true },
+  { 60499, true },
+  { 60516, true },
+  { 60533, true },
+  { 60550, true },
+  { 60566, true },
+  { 60580, true },
+  { 60605, true },
+  { 60616, true },
+  { 60632, true },
+  { 60648, true },
+  { 60664, false },
+  { 60677, false },
+  { 60693, true },
+  { 60707, true },
+  { 60720, true },
+  { 60731, true },
+  { 60745, true },
+  { 60759, true },
+  { 60769, false },
+  { 60779, true },
+  { 60788, true },
+  { 60807, true },
+  { 60816, false },
+  { 60836, true },
+  { 60859, true },
+  { 60876, true },
+  { 60895, true },
+  { 60912, true },
+  { 60924, true },
+  { 60935, false },
+  { 60947, true },
+  { 60958, true },
+  { 60973, true },
+  { 60991, true },
+  { 61001, true },
+  { 61009, true },
+  { 61023, true },
+  { 61036, false },
+  { 61049, true },
+  { 61064, true },
+  { 61078, true },
+  { 61090, true },
+  { 61104, true },
+  { 61118, true },
+  { 61128, true },
+  { 61144, true },
+  { 61160, true },
+  { 61179, false },
+  { 61208, true },
+  { 61222, true },
+  { 61236, true },
+  { 61257, true },
+  { 61275, true },
+  { 61290, true },
+  { 61306, true },
+  { 61319, true },
+  { 61337, true },
+  { 61357, true },
+  { 61369, true },
+  { 61381, true },
+  { 61396, true },
+  { 61419, true },
+  { 61443, true },
+  { 61467, true },
+  { 61477, true },
+  { 61499, true },
+  { 61531, true },
+  { 61542, true },
+  { 61552, true },
+  { 61567, true },
+  { 61581, false },
+  { 61601, true },
+  { 61619, true },
+  { 61628, true },
+  { 61635, true },
+  { 61646, true },
+  { 61655, true },
+  { 61668, true },
+  { 61691, true },
+  { 61706, false },
+  { 61717, false },
+  { 61729, false },
+  { 61740, true },
+  { 61756, true },
+  { 61782, false },
+  { 61798, true },
+  { 61808, true },
+  { 61816, true },
+  { 61825, true },
+  { 61837, true },
+  { 61849, false },
+  { 61861, true },
+  { 61874, true },
+  { 61891, true },
+  { 61911, true },
+  { 61922, true },
+  { 61938, true },
+  { 61950, true },
+  { 61967, true },
+  { 61976, true },
+  { 61989, true },
+  { 62002, true },
+  { 62020, true },
+  { 62033, true },
   { 62057, true },
-  { 62074, true },
-  { 62091, true },
-  { 62106, true },
-  { 62118, true },
-  { 62143, false },
-  { 62156, false },
-  { 62168, true },
-  { 62188, true },
-  { 62201, true },
-  { 62213, true },
-  { 62237, true },
-  { 62250, true },
-  { 62269, true },
-  { 62281, true },
-  { 62293, true },
-  { 62314, true },
-  { 62328, true },
-  { 62353, true },
+  { 62071, true },
+  { 62088, true },
+  { 62103, true },
+  { 62113, true },
+  { 62125, true },
+  { 62137, false },
+  { 62152, true },
+  { 62167, true },
+  { 62184, true },
+  { 62192, true },
+  { 62211, true },
+  { 62228, true },
+  { 62245, true },
+  { 62260, true },
+  { 62272, true },
+  { 62297, false },
+  { 62310, false },
+  { 62322, true },
+  { 62342, true },
+  { 62355, true },
   { 62367, true },
-  { 62380, false },
-  { 62396, true },
-  { 62408, true },
-  { 62421, true },
-  { 62431, true },
-  { 62443, true },
-  { 62454, true },
-  { 62465, true },
-  { 62477, true },
-  { 62486, true },
-  { 62496, true },
-  { 62510, true },
-  { 62522, true },
-  { 62538, true },
-  { 62560, true },
-  { 62570, false },
-  { 62584, true },
+  { 62391, true },
+  { 62404, true },
+  { 62423, true },
+  { 62435, true },
+  { 62447, true },
+  { 62468, true },
+  { 62482, true },
+  { 62507, true },
+  { 62521, true },
+  { 62534, false },
+  { 62550, true },
+  { 62562, true },
+  { 62575, true },
+  { 62585, true },
   { 62597, true },
-  { 62618, true },
+  { 62608, true },
+  { 62619, true },
   { 62631, true },
-  { 62644, true },
-  { 62652, false },
-  { 62669, true },
-  { 62683, true },
-  { 62699, true },
-  { 62718, true },
-  { 62728, true },
-  { 62740, true },
-  { 62754, true },
-  { 62762, true },
-  { 62781, false },
-  { 62799, true },
-  { 62808, true },
-  { 62821, true },
-  { 62836, true },
-  { 62856, false },
-  { 62869, true },
-  { 62886, true },
-  { 62899, true },
-  { 62912, true },
-  { 62936, true },
-  { 62963, true },
-  { 62976, false },
+  { 62640, true },
+  { 62650, true },
+  { 62664, true },
+  { 62676, true },
+  { 62692, true },
+  { 62714, true },
+  { 62724, false },
+  { 62738, true },
+  { 62751, true },
+  { 62772, true },
+  { 62785, true },
+  { 62798, true },
+  { 62806, false },
+  { 62823, true },
+  { 62837, true },
+  { 62853, true },
+  { 62872, true },
+  { 62882, true },
+  { 62894, true },
+  { 62908, true },
+  { 62916, true },
+  { 62935, false },
+  { 62953, true },
+  { 62962, true },
+  { 62975, true },
   { 62990, true },
-  { 63002, true },
-  { 63015, false },
-  { 63027, true },
-  { 63039, true },
-  { 63054, true },
-  { 63072, true },
-  { 63085, true },
-  { 63108, false },
-  { 63119, true },
-  { 63135, true },
-  { 63153, true },
-  { 63173, true },
-  { 63195, true },
-  { 63211, true },
-  { 63228, true },
-  { 63245, true },
-  { 63263, true },
-  { 63276, true },
-  { 63293, true },
-  { 63308, true },
-  { 63322, true },
-  { 63338, true },
-  { 63346, true },
+  { 63010, false },
+  { 63023, true },
+  { 63040, true },
+  { 63053, true },
+  { 63066, true },
+  { 63090, true },
+  { 63117, true },
+  { 63130, false },
+  { 63144, true },
+  { 63156, true },
+  { 63169, false },
+  { 63181, true },
+  { 63193, true },
+  { 63208, true },
+  { 63226, true },
+  { 63239, true },
+  { 63262, false },
+  { 63273, true },
+  { 63289, true },
+  { 63307, true },
+  { 63327, true },
+  { 63349, true },
   { 63365, true },
-  { 63375, true },
-  { 63383, true },
-  { 63392, true },
-  { 63407, true },
-  { 63422, true },
-  { 63439, false },
-  { 63450, true },
-  { 63466, true },
-  { 63480, true },
+  { 63382, true },
+  { 63399, true },
+  { 63417, true },
+  { 63430, true },
+  { 63447, true },
+  { 63462, true },
+  { 63476, true },
   { 63492, true },
   { 63500, true },
-  { 63509, true },
-  { 63525, true },
-  { 63531, true },
-  { 63543, true },
-  { 63565, true },
-  { 63579, true },
-  { 63594, true },
-  { 63605, true },
-  { 63618, true },
+  { 63519, true },
+  { 63529, true },
+  { 63537, true },
+  { 63546, true },
+  { 63561, true },
+  { 63576, true },
+  { 63593, false },
+  { 63604, true },
+  { 63620, true },
   { 63634, true },
-  { 63652, false },
-  { 63665, true },
-  { 63674, true },
-  { 63685, true },
-  { 63704, true },
-  { 63712, true },
-  { 63729, true },
-  { 63738, true },
-  { 63747, true },
-  { 63766, true },
-  { 63777, true },
-  { 63793, true },
-  { 63814, true },
-  { 63831, true },
-  { 63844, true },
-  { 63855, true },
-  { 63872, true },
-  { 63897, true },
-  { 63916, false },
-  { 63930, true },
-  { 63945, true },
-  { 63957, true },
-  { 63968, true },
+  { 63646, true },
+  { 63654, true },
+  { 63663, true },
+  { 63669, true },
+  { 63681, true },
+  { 63703, true },
+  { 63717, true },
+  { 63732, true },
+  { 63743, true },
+  { 63756, true },
+  { 63772, true },
+  { 63790, false },
+  { 63803, true },
+  { 63812, true },
+  { 63823, true },
+  { 63842, true },
+  { 63850, true },
+  { 63867, true },
+  { 63876, true },
+  { 63885, true },
+  { 63904, true },
+  { 63915, true },
+  { 63931, true },
+  { 63952, true },
+  { 63969, true },
   { 63982, true },
-  { 63996, true },
-  { 64013, true },
-  { 64033, true },
-  { 64042, true },
-  { 64056, true },
-  { 64067, true },
-  { 64087, false },
-  { 64111, true },
-  { 64129, false },
-  { 64137, true },
-  { 64155, true },
-  { 64173, true },
-  { 64195, true },
-  { 64217, true },
-  { 64233, true },
-  { 64245, true },
-  { 64257, true },
-  { 64271, true },
-  { 64284, false },
-  { 64301, true },
-  { 64310, true },
-  { 64332, true },
-  { 64352, true },
-  { 64379, true },
-  { 64398, true },
-  { 64418, true },
-  { 64427, true },
-  { 64444, true },
-  { 64459, true },
-  { 64488, true },
-  { 64510, true },
-  { 64528, true },
-  { 64542, true },
-  { 64557, true },
-  { 64570, true },
-  { 64583, true },
-  { 64593, true },
-  { 64611, true },
-  { 64630, true },
+  { 63993, true },
+  { 64010, true },
+  { 64035, true },
+  { 64054, false },
+  { 64068, true },
+  { 64083, true },
+  { 64095, true },
+  { 64106, true },
+  { 64120, true },
+  { 64134, true },
+  { 64151, true },
+  { 64171, true },
+  { 64180, true },
+  { 64194, true },
+  { 64205, true },
+  { 64225, false },
+  { 64249, true },
+  { 64267, false },
+  { 64275, true },
+  { 64293, true },
+  { 64311, true },
+  { 64333, true },
+  { 64355, true },
+  { 64371, true },
+  { 64383, true },
+  { 64395, true },
+  { 64409, true },
+  { 64422, false },
+  { 64439, true },
+  { 64448, true },
+  { 64470, true },
+  { 64490, true },
+  { 64517, true },
+  { 64536, true },
+  { 64556, true },
+  { 64565, true },
+  { 64582, true },
+  { 64597, true },
+  { 64626, true },
   { 64648, true },
   { 64666, true },
-  { 64674, true },
-  { 64681, false },
-  { 64701, true },
-  { 64710, true },
-  { 64725, true },
-  { 64743, true },
-  { 64755, true },
-  { 64764, false },
-  { 64774, true },
-  { 64782, true },
-  { 64799, true },
-  { 64810, true },
-  { 64820, true },
-  { 64837, true },
-  { 64859, true },
-  { 64874, true },
-  { 64891, true },
-  { 64901, true },
-  { 64914, true },
-  { 64929, true },
-  { 64945, true },
-  { 64956, true },
-  { 64968, true },
-  { 64990, true },
-  { 65003, true },
-  { 65014, true },
-  { 65030, true },
-  { 65046, true },
-  { 65056, true },
-  { 65068, true },
+  { 64680, true },
+  { 64695, true },
+  { 64708, true },
+  { 64721, true },
+  { 64731, true },
+  { 64749, true },
+  { 64768, true },
+  { 64786, true },
+  { 64804, true },
+  { 64812, true },
+  { 64819, false },
+  { 64839, true },
+  { 64848, true },
+  { 64863, true },
+  { 64875, true },
+  { 64884, false },
+  { 64894, true },
+  { 64902, true },
+  { 64919, true },
+  { 64930, true },
+  { 64940, true },
+  { 64957, true },
+  { 64979, true },
+  { 64994, true },
+  { 65011, true },
+  { 65021, true },
+  { 65034, true },
+  { 65049, true },
+  { 65065, true },
   { 65076, true },
-  { 65095, true },
-  { 65114, true },
-  { 65127, true },
-  { 65141, true },
-  { 65158, true },
-  { 65170, true },
-  { 65184, true },
+  { 65088, true },
+  { 65110, true },
+  { 65123, true },
+  { 65134, true },
+  { 65150, true },
+  { 65166, true },
+  { 65176, true },
+  { 65188, true },
   { 65196, true },
-  { 65210, true },
-  { 65224, true },
-  { 65246, true },
-  { 65262, true },
-  { 65281, true },
-  { 65294, true },
-  { 65312, true },
-  { 65327, true },
-  { 65342, true },
-  { 65361, true },
-  { 65374, true },
-  { 65399, true },
-  { 65422, true },
-  { 65435, true },
-  { 65446, true },
-  { 65460, true },
-  { 65473, true },
-  { 65491, true },
-  { 65510, true },
-  { 65524, true },
-  { 65535, true },
-  { 65548, true },
-  { 65564, true },
-  { 65576, true },
-  { 65592, true },
-  { 65605, true },
-  { 65621, true },
-  { 65636, true },
-  { 65651, true },
-  { 65665, true },
+  { 65215, true },
+  { 65234, true },
+  { 65247, true },
+  { 65261, true },
+  { 65278, true },
+  { 65290, true },
+  { 65304, true },
+  { 65316, true },
+  { 65330, true },
+  { 65344, true },
+  { 65366, true },
+  { 65382, true },
+  { 65401, true },
+  { 65414, true },
+  { 65432, true },
+  { 65447, true },
+  { 65462, true },
+  { 65481, true },
+  { 65494, true },
+  { 65519, true },
+  { 65542, true },
+  { 65555, true },
+  { 65566, true },
+  { 65580, true },
+  { 65593, true },
+  { 65611, true },
+  { 65630, true },
+  { 65644, true },
+  { 65655, true },
+  { 65668, true },
   { 65684, true },
-  { 65697, true },
-  { 65707, true },
-  { 65719, true },
-  { 65729, true },
-  { 65745, true },
-  { 65753, true },
-  { 65761, true },
-  { 65774, false },
+  { 65696, true },
+  { 65712, true },
+  { 65725, true },
+  { 65741, true },
+  { 65756, true },
+  { 65771, true },
   { 65785, true },
-  { 65801, true },
-  { 65811, true },
-  { 65828, true },
-  { 65846, false },
-  { 65859, true },
-  { 65872, true },
+  { 65804, true },
+  { 65817, true },
+  { 65827, true },
+  { 65839, true },
+  { 65849, true },
+  { 65865, true },
+  { 65873, true },
   { 65881, true },
-  { 65896, true },
-  { 65914, true },
-  { 65928, true },
-  { 65946, true },
-  { 65962, true },
-  { 65971, true },
-  { 65980, true },
-  { 65995, true },
-  { 66005, true },
-  { 66015, true },
-  { 66029, true },
-  { 66041, true },
-  { 66058, true },
-  { 66072, true },
-  { 66080, true },
-  { 66088, true },
-  { 66097, true },
-  { 66109, true },
-  { 66122, false },
-  { 66130, true },
-  { 66156, true },
-  { 66169, true },
-  { 66183, true },
-  { 66193, true },
-  { 66210, true },
-  { 66225, true },
-  { 66236, true },
-  { 66247, true },
-  { 66258, true },
-  { 66270, true },
-  { 66283, true },
-  { 66291, false },
-  { 66305, true },
-  { 66326, true },
-  { 66351, true },
-  { 66362, true },
-  { 66376, true },
-  { 66394, true },
-  { 66405, true },
-  { 66419, true },
-  { 66435, true },
-  { 66448, true },
-  { 66464, true },
-  { 66475, true },
-  { 66494, true },
-  { 66508, true },
-  { 66517, true },
-  { 66531, true },
-  { 66542, true },
-  { 66551, true },
-  { 66569, true },
-  { 66583, true },
-  { 66601, true },
-  { 66620, true },
-  { 66630, true },
-  { 66643, true },
-  { 66654, true },
-  { 66663, true },
-  { 66683, true },
-  { 66697, true },
-  { 66705, true },
-  { 66715, true },
-  { 66722, true },
-  { 66735, true },
-  { 66746, true },
-  { 66760, true },
+  { 65894, false },
+  { 65905, true },
+  { 65921, true },
+  { 65931, true },
+  { 65948, true },
+  { 65966, false },
+  { 65979, true },
+  { 65992, true },
+  { 66001, true },
+  { 66016, true },
+  { 66034, true },
+  { 66048, true },
+  { 66066, true },
+  { 66082, true },
+  { 66091, true },
+  { 66100, true },
+  { 66115, true },
+  { 66125, true },
+  { 66135, true },
+  { 66149, true },
+  { 66161, true },
+  { 66178, true },
+  { 66192, true },
+  { 66200, true },
+  { 66208, true },
+  { 66217, true },
+  { 66229, true },
+  { 66242, false },
+  { 66250, true },
+  { 66276, true },
+  { 66289, true },
+  { 66303, true },
+  { 66313, true },
+  { 66330, true },
+  { 66345, true },
+  { 66356, true },
+  { 66367, true },
+  { 66378, true },
+  { 66390, true },
+  { 66403, true },
+  { 66411, false },
+  { 66425, true },
+  { 66446, true },
+  { 66471, true },
+  { 66482, true },
+  { 66496, true },
+  { 66514, true },
+  { 66525, true },
+  { 66539, true },
+  { 66555, true },
+  { 66568, true },
+  { 66584, true },
+  { 66595, true },
+  { 66614, true },
+  { 66628, true },
+  { 66637, true },
+  { 66651, true },
+  { 66662, true },
+  { 66671, true },
+  { 66689, true },
+  { 66703, true },
+  { 66721, true },
+  { 66740, true },
+  { 66750, true },
+  { 66763, true },
   { 66774, true },
-  { 66788, true },
-  { 66798, true },
-  { 66808, true },
-  { 66818, true },
+  { 66783, true },
+  { 66803, true },
+  { 66817, true },
   { 66825, true },
   { 66835, true },
-  { 66844, true },
-  { 66859, true },
+  { 66842, true },
+  { 66855, true },
   { 66866, true },
-  { 66878, true },
-  { 66888, true },
-  { 66899, true },
-  { 66906, true },
-  { 66915, true },
-  { 66927, true },
-  { 66936, true },
-  { 66950, true },
-  { 66963, true },
-  { 66972, true },
-  { 66984, false },
-  { 66997, true },
-  { 67019, true },
-  { 67042, true },
-  { 67056, true },
-  { 67071, true },
-  { 67086, true },
+  { 66880, true },
+  { 66894, true },
+  { 66908, true },
+  { 66918, true },
+  { 66928, true },
+  { 66938, true },
+  { 66945, true },
+  { 66955, true },
+  { 66964, true },
+  { 66979, true },
+  { 66986, true },
+  { 66996, true },
+  { 67008, true },
+  { 67018, true },
+  { 67029, true },
+  { 67036, true },
+  { 67045, true },
+  { 67057, true },
+  { 67066, true },
+  { 67080, true },
+  { 67093, true },
   { 67102, true },
-  { 67120, true },
-  { 67130, true },
-  { 67150, true },
-  { 67160, true },
-  { 67171, true },
-  { 67189, true },
+  { 67114, false },
+  { 67127, true },
+  { 67149, true },
+  { 67172, true },
+  { 67186, true },
   { 67201, true },
-  { 67212, true },
-  { 67228, true },
-  { 67245, true },
+  { 67216, true },
+  { 67232, true },
+  { 67250, true },
   { 67260, true },
-  { 67276, true },
-  { 67291, true },
-  { 67307, true },
-  { 67316, true },
-  { 67333, true },
-  { 67350, true },
-  { 67368, true },
-  { 67380, true },
-  { 67397, true },
-  { 67411, true },
-  { 67425, true },
-  { 67440, true },
-  { 67455, true },
-  { 67466, true },
+  { 67280, true },
+  { 67290, true },
+  { 67301, true },
+  { 67319, true },
+  { 67331, true },
+  { 67342, true },
+  { 67358, true },
+  { 67375, true },
+  { 67390, true },
+  { 67406, true },
+  { 67421, true },
+  { 67437, true },
+  { 67446, true },
+  { 67463, true },
   { 67480, true },
-  { 67495, true },
+  { 67498, true },
   { 67510, true },
-  { 67525, true },
-  { 67547, true },
-  { 67565, true },
-  { 67586, true },
+  { 67527, true },
+  { 67541, true },
+  { 67555, true },
+  { 67570, true },
+  { 67585, true },
+  { 67596, true },
   { 67610, true },
-  { 67632, true },
-  { 67644, true },
-  { 67657, true },
-  { 67672, true },
-  { 67688, true },
-  { 67702, true },
-  { 67715, true },
-  { 67733, true },
-  { 67746, false },
-  { 67767, true },
-  { 67785, true },
-  { 67801, true },
-  { 67814, true },
-  { 67829, true },
-  { 67843, true },
-  { 67854, true },
-  { 67879, true },
-  { 67895, true },
-  { 67912, true },
-  { 67924, true },
-  { 67941, true },
-  { 67953, true },
-  { 67966, true },
-  { 67977, true },
-  { 67992, true },
-  { 68004, true },
-  { 68015, true },
-  { 68029, true },
-  { 68039, true },
-  { 68048, true },
-  { 68055, true },
-  { 68072, true },
-  { 68084, true },
-  { 68093, true },
-  { 68104, true },
-  { 68116, true },
-  { 68123, false },
-  { 68130, false },
-  { 68139, true },
-  { 68151, true },
-  { 68163, true },
-  { 68173, true },
-  { 68182, true },
-  { 68191, true },
-  { 68198, true },
-  { 68210, false },
-  { 68222, false },
-  { 68230, true },
-  { 68242, true },
-  { 68255, true },
+  { 67625, true },
+  { 67640, true },
+  { 67655, true },
+  { 67677, true },
+  { 67695, true },
+  { 67716, true },
+  { 67740, true },
+  { 67762, true },
+  { 67774, true },
+  { 67787, true },
+  { 67802, true },
+  { 67818, true },
+  { 67832, true },
+  { 67845, true },
+  { 67863, true },
+  { 67876, false },
+  { 67897, true },
+  { 67915, true },
+  { 67931, true },
+  { 67944, true },
+  { 67959, true },
+  { 67973, true },
+  { 67984, true },
+  { 68009, true },
+  { 68025, true },
+  { 68042, true },
+  { 68054, true },
+  { 68071, true },
+  { 68083, true },
+  { 68096, true },
+  { 68107, true },
+  { 68122, true },
+  { 68134, true },
+  { 68145, true },
+  { 68159, true },
+  { 68169, true },
+  { 68178, true },
+  { 68185, true },
+  { 68202, true },
+  { 68214, true },
+  { 68223, true },
+  { 68234, true },
+  { 68246, true },
+  { 68253, false },
+  { 68260, false },
   { 68269, true },
-  { 68282, true },
-  { 68294, true },
-  { 68305, true },
-  { 68315, true },
-  { 68323, true },
-  { 68336, true },
-  { 68348, true },
-  { 68359, true },
-  { 68371, true },
-  { 68381, false },
+  { 68281, true },
+  { 68293, true },
+  { 68303, true },
+  { 68312, true },
+  { 68321, true },
+  { 68328, true },
+  { 68340, false },
+  { 68352, false },
+  { 68360, true },
+  { 68372, true },
+  { 68385, true },
   { 68399, true },
-  { 68417, true },
-  { 68439, true },
-  { 68461, true },
-  { 68472, true },
-  { 68484, true },
-  { 68499, true },
-  { 68510, true },
-  { 68526, true },
-  { 68549, true },
-  { 68567, true },
-  { 68578, true },
-  { 68596, true },
-  { 68623, true },
-  { 68643, true },
-  { 68655, true },
-  { 68673, true },
-  { 68687, true },
-  { 68703, true },
-  { 68719, true },
-  { 68732, true },
-  { 68746, true },
-  { 68760, true },
-  { 68774, true },
+  { 68412, true },
+  { 68424, true },
+  { 68435, true },
+  { 68445, true },
+  { 68453, true },
+  { 68466, true },
+  { 68478, true },
+  { 68489, true },
+  { 68501, true },
+  { 68511, false },
+  { 68529, true },
+  { 68547, true },
+  { 68569, true },
+  { 68591, true },
+  { 68602, true },
+  { 68614, true },
+  { 68629, true },
+  { 68640, true },
+  { 68656, true },
+  { 68679, true },
+  { 68697, true },
+  { 68708, true },
+  { 68726, true },
+  { 68753, true },
+  { 68773, true },
   { 68785, true },
-  { 68809, true },
-  { 68837, false },
-  { 68848, true },
-  { 68866, true },
-  { 68884, true },
-  { 68908, true },
-  { 68929, true },
-  { 68950, true },
-  { 68971, true },
-  { 68985, true },
-  { 68998, true },
-  { 69017, true },
-  { 69035, true },
-  { 69045, false },
-  { 69063, true },
-  { 69081, true },
-  { 69102, true },
+  { 68803, true },
+  { 68817, true },
+  { 68833, true },
+  { 68849, true },
+  { 68862, true },
+  { 68876, true },
+  { 68890, true },
+  { 68904, true },
+  { 68915, true },
+  { 68939, true },
+  { 68967, false },
+  { 68978, true },
+  { 68996, true },
+  { 69020, true },
+  { 69041, true },
+  { 69062, true },
+  { 69083, true },
+  { 69096, true },
   { 69115, true },
-  { 69135, true },
-  { 69145, true },
+  { 69133, true },
+  { 69143, false },
   { 69161, true },
-  { 69175, true },
-  { 69191, true },
-  { 69202, true },
+  { 69179, true },
+  { 69200, true },
   { 69213, true },
-  { 69223, true },
   { 69233, true },
-  { 69250, true },
-  { 69264, false },
-  { 69277, true },
+  { 69243, true },
+  { 69259, true },
+  { 69273, true },
   { 69289, true },
   { 69300, true },
-  { 69317, true },
-  { 69327, true },
-  { 69341, true },
-  { 69360, true },
-  { 69378, true },
-  { 69389, true },
-  { 69400, true },
-  { 69411, true },
-  { 69422, true },
-  { 69433, true },
-  { 69444, true },
-  { 69455, true },
-  { 69475, true },
-  { 69488, true },
-  { 69506, true },
-  { 69519, true },
-  { 69529, true },
-  { 69544, true },
-  { 69558, true },
-  { 69576, true },
-  { 69591, true },
+  { 69311, true },
+  { 69321, true },
+  { 69331, true },
+  { 69348, true },
+  { 69362, false },
+  { 69375, true },
+  { 69387, true },
+  { 69398, true },
+  { 69415, true },
+  { 69425, true },
+  { 69439, true },
+  { 69458, true },
+  { 69476, true },
+  { 69487, true },
+  { 69498, true },
+  { 69509, true },
+  { 69520, true },
+  { 69531, true },
+  { 69542, true },
+  { 69553, true },
+  { 69573, true },
+  { 69586, true },
   { 69604, true },
-  { 69621, true },
-  { 69638, true },
-  { 69651, true },
-  { 69665, true },
-  { 69674, true },
-  { 69693, true },
-  { 69704, true },
-  { 69714, true },
+  { 69617, true },
+  { 69627, true },
+  { 69642, true },
+  { 69656, true },
+  { 69671, true },
+  { 69684, true },
+  { 69701, true },
+  { 69718, true },
   { 69731, true },
-  { 69740, true },
+  { 69745, true },
   { 69754, true },
-  { 69762, true },
-  { 69770, true },
-  { 69777, true },
+  { 69773, true },
   { 69784, true },
-  { 69793, true },
-  { 69812, true },
-  { 69827, true },
-  { 69848, true },
-  { 69868, true },
-  { 69885, true },
-  { 69901, true },
-  { 69921, true },
-  { 69940, true },
-  { 69961, true },
-  { 69974, true },
-  { 69989, true },
+  { 69794, true },
+  { 69811, true },
+  { 69820, true },
+  { 69834, true },
+  { 69842, true },
+  { 69850, true },
+  { 69857, true },
+  { 69864, true },
+  { 69873, true },
+  { 69892, true },
+  { 69907, true },
+  { 69928, true },
+  { 69948, true },
+  { 69965, true },
+  { 69981, true },
   { 70001, true },
-  { 70017, false },
-  { 70031, false },
-  { 70044, false },
-  { 70051, true },
-  { 70059, true },
-  { 70071, true },
+  { 70020, true },
+  { 70041, true },
+  { 70054, true },
+  { 70069, true },
   { 70081, true },
-  { 70096, true },
-  { 70109, true },
-  { 70120, true },
-  { 70135, true },
-  { 70157, true },
+  { 70097, false },
+  { 70111, false },
+  { 70124, false },
+  { 70131, true },
+  { 70139, true },
+  { 70151, true },
+  { 70161, true },
   { 70176, true },
-  { 70188, true },
-  { 70199, true },
+  { 70189, true },
+  { 70200, true },
   { 70215, true },
-  { 70231, true },
-  { 70249, true },
-  { 70267, true },
-  { 70277, true },
-  { 70284, true },
+  { 70237, true },
+  { 70256, true },
+  { 70268, true },
+  { 70279, true },
   { 70295, true },
-  { 70307, false },
-  { 70327, false },
-  { 70343, true },
-  { 70354, true },
-  { 70369, true },
-  { 70382, true },
-  { 70395, true },
-  { 70407, true },
-  { 70424, true },
-  { 70435, false },
-  { 70445, true },
-  { 70456, true },
-  { 70471, true },
+  { 70311, true },
+  { 70329, true },
+  { 70347, true },
+  { 70357, true },
+  { 70364, true },
+  { 70375, true },
+  { 70387, false },
+  { 70407, false },
+  { 70423, true },
+  { 70434, true },
+  { 70449, true },
+  { 70462, true },
+  { 70475, true },
   { 70487, true },
-  { 70516, true },
-  { 70535, true },
-  { 70549, true },
-  { 70566, true },
-  { 70592, true },
-  { 70607, true },
-  { 70622, true },
-  { 70637, true },
-  { 70651, true },
-  { 70670, true },
-  { 70695, true },
-  { 70709, true },
-  { 70725, true },
-  { 70746, true },
-  { 70780, true },
-  { 70804, true },
-  { 70833, false },
-  { 70848, true },
-  { 70864, true },
-  { 70889, true },
-  { 70901, true },
-  { 70915, true },
-  { 70924, true },
-  { 70944, false },
-  { 70954, true },
+  { 70504, true },
+  { 70515, false },
+  { 70525, true },
+  { 70536, true },
+  { 70551, true },
+  { 70567, true },
+  { 70596, true },
+  { 70615, true },
+  { 70629, true },
+  { 70646, true },
+  { 70672, true },
+  { 70687, true },
+  { 70702, true },
+  { 70717, true },
+  { 70731, true },
+  { 70750, true },
+  { 70775, true },
+  { 70789, true },
+  { 70805, true },
+  { 70826, true },
+  { 70860, true },
+  { 70884, true },
+  { 70913, false },
+  { 70928, true },
+  { 70944, true },
   { 70969, true },
-  { 70977, true },
-  { 70986, true },
-  { 70994, true },
-  { 71016, true },
-  { 71028, true },
-  { 71040, true },
-  { 71048, true },
-  { 71059, true },
-  { 71069, false },
-  { 71081, true },
-  { 71090, true },
-  { 71106, true },
-  { 71122, true },
-  { 71136, true },
-  { 71151, true },
-  { 71165, true },
-  { 71176, true },
-  { 71191, true },
-  { 71206, true },
-  { 71217, false },
-  { 71229, true },
-  { 71243, true },
-  { 71254, true },
-  { 71264, true },
-  { 71281, true },
-  { 71299, true },
+  { 70981, true },
+  { 70995, true },
+  { 71004, true },
+  { 71024, false },
+  { 71034, true },
+  { 71049, true },
+  { 71057, true },
+  { 71066, true },
+  { 71074, true },
+  { 71096, true },
+  { 71108, true },
+  { 71120, true },
+  { 71128, true },
+  { 71139, true },
+  { 71149, false },
+  { 71161, true },
+  { 71170, true },
+  { 71186, true },
+  { 71202, true },
+  { 71216, true },
+  { 71231, true },
+  { 71245, true },
+  { 71256, true },
+  { 71271, true },
+  { 71286, true },
+  { 71297, false },
   { 71309, true },
-  { 71332, true },
-  { 71346, true },
-  { 71362, true },
-  { 71375, true },
-  { 71394, true },
-  { 71407, true },
-  { 71424, true },
+  { 71323, true },
+  { 71334, true },
+  { 71344, true },
+  { 71361, true },
+  { 71379, true },
+  { 71389, true },
+  { 71412, true },
+  { 71426, true },
   { 71442, true },
   { 71455, true },
-  { 71469, true },
-  { 71479, true },
-  { 71490, true },
-  { 71499, true },
-  { 71515, true },
+  { 71474, true },
+  { 71487, true },
+  { 71504, true },
   { 71522, true },
-  { 71543, false },
-  { 71558, true },
-  { 71573, true },
-  { 71590, true },
-  { 71599, true },
-  { 71608, true },
-  { 71620, true },
+  { 71535, true },
+  { 71549, true },
+  { 71559, true },
+  { 71570, true },
+  { 71579, true },
+  { 71595, true },
+  { 71602, true },
+  { 71623, false },
   { 71638, true },
-  { 71651, true },
-  { 71662, true },
-  { 71677, true },
+  { 71653, true },
+  { 71670, true },
+  { 71679, true },
   { 71688, true },
-  { 71704, true },
-  { 71717, true },
-  { 71727, true },
-  { 71743, true },
-  { 71765, true },
-  { 71777, true },
-  { 71790, true },
-  { 71803, true },
-  { 71818, true },
-  { 71832, true },
-  { 71848, false },
-  { 71861, true },
-  { 71873, true },
-  { 71885, true },
-  { 71902, true },
-  { 71918, true },
-  { 71930, true },
-  { 71943, true },
-  { 71959, true },
-  { 71970, true },
-  { 71990, false },
+  { 71700, true },
+  { 71718, true },
+  { 71731, true },
+  { 71742, true },
+  { 71757, true },
+  { 71768, true },
+  { 71784, true },
+  { 71797, true },
+  { 71807, true },
+  { 71823, true },
+  { 71845, true },
+  { 71857, true },
+  { 71870, true },
+  { 71883, true },
+  { 71898, true },
+  { 71912, true },
+  { 71928, false },
+  { 71941, true },
+  { 71953, true },
+  { 71965, true },
+  { 71982, true },
   { 71998, true },
   { 72010, true },
-  { 72021, true },
-  { 72040, false },
-  { 72060, true },
-  { 72069, true },
-  { 72080, true },
-  { 72111, true },
-  { 72125, true },
-  { 72139, true },
-  { 72159, true },
-  { 72178, true },
-  { 72194, true },
-  { 72209, true },
-  { 72223, true },
-  { 72245, true },
-  { 72253, true },
-  { 72266, true },
-  { 72277, true },
+  { 72023, true },
+  { 72039, true },
+  { 72050, true },
+  { 72070, false },
+  { 72078, true },
+  { 72090, true },
+  { 72101, true },
+  { 72120, false },
+  { 72140, true },
+  { 72149, true },
+  { 72160, true },
+  { 72191, true },
+  { 72205, true },
+  { 72219, true },
+  { 72239, true },
+  { 72258, true },
+  { 72274, true },
   { 72289, true },
-  { 72301, true },
-  { 72317, true },
-  { 72328, true },
-  { 72353, true },
+  { 72303, true },
+  { 72325, true },
+  { 72333, true },
+  { 72346, true },
+  { 72357, true },
   { 72369, true },
-  { 72385, true },
-  { 72401, true },
-  { 72420, true },
-  { 72444, true },
-  { 72460, true },
-  { 72476, false },
-  { 72489, true },
-  { 72499, true },
-  { 72511, true },
-  { 72523, true },
-  { 72538, true },
-  { 72558, true },
-  { 72578, true },
-  { 72599, false },
-  { 72615, true },
-  { 72633, true },
-  { 72644, true },
-  { 72659, true },
-  { 72672, true },
-  { 72684, false },
-  { 72692, true },
-  { 72706, true },
-  { 72720, true },
-  { 72732, true },
-  { 72746, true },
-  { 72758, true },
+  { 72381, true },
+  { 72397, true },
+  { 72408, true },
+  { 72433, true },
+  { 72449, true },
+  { 72465, true },
+  { 72481, true },
+  { 72500, true },
+  { 72524, true },
+  { 72540, true },
+  { 72556, false },
+  { 72569, true },
+  { 72579, true },
+  { 72591, true },
+  { 72603, true },
+  { 72618, true },
+  { 72638, true },
+  { 72658, true },
+  { 72679, false },
+  { 72695, true },
+  { 72713, true },
+  { 72724, true },
+  { 72739, true },
+  { 72752, true },
+  { 72764, false },
   { 72772, true },
-  { 72785, true },
-  { 72803, true },
-  { 72819, true },
-  { 72839, true },
-  { 72870, true },
-  { 72901, true },
-  { 72923, true },
-  { 72941, true },
-  { 72955, true },
-  { 72977, true },
-  { 72992, true },
-  { 73011, true },
-  { 73020, true },
-  { 73030, true },
-  { 73045, true },
-  { 73060, true },
-  { 73075, true },
-  { 73092, true },
-  { 73105, true },
-  { 73118, true },
-  { 73128, true },
-  { 73138, true },
-  { 73161, true },
-  { 73172, true },
+  { 72786, true },
+  { 72798, true },
+  { 72812, true },
+  { 72824, true },
+  { 72838, true },
+  { 72851, true },
+  { 72869, true },
+  { 72885, true },
+  { 72905, true },
+  { 72936, true },
+  { 72967, true },
+  { 72989, true },
+  { 73007, true },
+  { 73021, true },
+  { 73043, true },
+  { 73058, true },
+  { 73077, true },
+  { 73086, true },
+  { 73096, true },
+  { 73111, true },
+  { 73126, true },
+  { 73141, true },
+  { 73158, true },
+  { 73171, true },
   { 73184, true },
-  { 73201, true },
-  { 73218, true },
-  { 73233, true },
-  { 73240, true },
-  { 73253, true },
-  { 73270, true },
-  { 73280, true },
-  { 73289, true },
-  { 73308, true },
-  { 73326, true },
-  { 73347, true },
-  { 73367, true },
-  { 73380, true },
-  { 73397, true },
-  { 73410, true },
-  { 73432, true },
-  { 73444, true },
-  { 73460, true },
-  { 73470, true },
-  { 73483, true },
-  { 73505, true },
-  { 73519, true },
-  { 73541, true },
+  { 73194, true },
+  { 73204, true },
+  { 73227, true },
+  { 73238, true },
+  { 73250, true },
+  { 73267, true },
+  { 73284, true },
+  { 73299, true },
+  { 73306, true },
+  { 73319, true },
+  { 73336, true },
+  { 73346, true },
+  { 73355, true },
+  { 73374, true },
+  { 73392, true },
+  { 73413, true },
+  { 73433, true },
+  { 73450, true },
+  { 73463, true },
+  { 73485, true },
+  { 73497, true },
+  { 73513, true },
+  { 73523, true },
+  { 73536, true },
   { 73558, true },
   { 73572, true },
-  { 73580, true },
-  { 73592, true },
-  { 73607, true },
-  { 73617, true },
-  { 73628, true },
-  { 73640, true },
-  { 73651, true },
+  { 73594, true },
+  { 73611, true },
+  { 73625, true },
+  { 73633, true },
+  { 73645, true },
   { 73660, true },
   { 73670, true },
-  { 73692, true },
+  { 73681, true },
+  { 73693, true },
   { 73704, true },
-  { 73722, true },
-  { 73733, true },
-  { 73748, true },
-  { 73761, true },
+  { 73713, true },
+  { 73723, true },
+  { 73745, true },
+  { 73757, true },
   { 73775, true },
-  { 73791, true },
-  { 73806, true },
-  { 73818, true },
+  { 73786, true },
+  { 73801, true },
+  { 73814, true },
   { 73828, true },
-  { 73846, true },
-  { 73857, true },
-  { 73865, true },
-  { 73876, true },
-  { 73890, true },
-  { 73905, true },
+  { 73844, true },
+  { 73859, true },
+  { 73871, true },
+  { 73881, true },
+  { 73899, true },
+  { 73910, true },
   { 73918, true },
   { 73929, true },
-  { 73940, false },
-  { 73956, true },
-  { 73969, true },
-  { 73990, true },
-  { 74005, true },
-  { 74016, true },
-  { 74032, true },
-  { 74050, true },
-  { 74071, true },
-  { 74083, true },
-  { 74092, true },
-  { 74105, true },
-  { 74123, true },
-  { 74132, true },
-  { 74143, true },
-  { 74155, false },
-  { 74173, true },
-  { 74191, true },
-  { 74210, true },
-  { 74229, true },
-  { 74243, true },
-  { 74263, false },
-  { 74283, true },
-  { 74295, true },
-  { 74308, true },
-  { 74320, true },
-  { 74339, true },
-  { 74356, true },
-  { 74368, true },
-  { 74381, true },
-  { 74396, true },
-  { 74410, true },
-  { 74420, true },
-  { 74430, true },
-  { 74440, true },
-  { 74452, true },
-  { 74461, true },
-  { 74476, true },
-  { 74491, true },
-  { 74500, true },
-  { 74513, true },
-  { 74540, true },
-  { 74548, true },
-  { 74569, true },
-  { 74583, true },
+  { 73943, true },
+  { 73958, true },
+  { 73971, true },
+  { 73982, true },
+  { 73993, false },
+  { 74009, true },
+  { 74022, true },
+  { 74043, true },
+  { 74058, true },
+  { 74069, true },
+  { 74085, true },
+  { 74103, true },
+  { 74124, true },
+  { 74136, true },
+  { 74145, true },
+  { 74158, true },
+  { 74176, true },
+  { 74185, true },
+  { 74196, true },
+  { 74208, false },
+  { 74226, true },
+  { 74244, true },
+  { 74263, true },
+  { 74282, true },
+  { 74296, true },
+  { 74316, false },
+  { 74336, true },
+  { 74348, true },
+  { 74361, true },
+  { 74373, true },
+  { 74392, true },
+  { 74409, true },
+  { 74421, true },
+  { 74434, true },
+  { 74449, true },
+  { 74463, true },
+  { 74473, true },
+  { 74483, true },
+  { 74493, true },
+  { 74505, true },
+  { 74514, true },
+  { 74529, true },
+  { 74544, true },
+  { 74553, true },
+  { 74566, true },
   { 74593, true },
   { 74601, true },
-  { 74610, true },
-  { 74619, true },
-  { 74632, true },
-  { 74649, true },
-  { 74661, true },
-  { 74669, true },
-  { 74690, true },
-  { 74709, true },
-  { 74721, true },
-  { 74739, true },
-  { 74751, true },
+  { 74622, true },
+  { 74636, true },
+  { 74646, true },
+  { 74654, true },
+  { 74663, true },
+  { 74672, true },
+  { 74685, true },
+  { 74702, true },
+  { 74714, true },
+  { 74722, true },
+  { 74743, true },
   { 74762, true },
   { 74774, true },
-  { 74783, true },
   { 74792, true },
-  { 74799, true },
-  { 74807, true },
-  { 74821, true },
-  { 74832, true },
-  { 74843, true },
-  { 74858, true },
-  { 74871, false },
-  { 74881, true },
-  { 74895, true },
-  { 74915, true },
-  { 74930, true },
-  { 74943, true },
-  { 74955, true },
-  { 74970, true },
+  { 74804, true },
+  { 74815, true },
+  { 74827, true },
+  { 74836, true },
+  { 74845, true },
+  { 74852, true },
+  { 74860, true },
+  { 74874, true },
+  { 74885, true },
+  { 74896, true },
+  { 74911, true },
+  { 74924, false },
+  { 74934, true },
+  { 74948, true },
+  { 74968, true },
   { 74983, true },
-  { 75010, true },
-  { 75024, true },
-  { 75041, true },
-  { 75061, true },
-  { 75076, true },
-  { 75086, true },
-  { 75099, true },
-  { 75116, true },
+  { 74996, true },
+  { 75008, true },
+  { 75023, true },
+  { 75036, true },
+  { 75063, true },
+  { 75077, true },
+  { 75094, true },
+  { 75114, true },
   { 75129, true },
   { 75139, true },
-  { 75166, true },
-  { 75176, true },
-  { 75185, true },
+  { 75152, true },
+  { 75169, true },
+  { 75182, true },
   { 75192, true },
-  { 75208, true },
   { 75219, true },
-  { 75230, true },
-  { 75244, true },
-  { 75255, true },
-  { 75265, true },
-  { 75286, true },
-  { 75294, true },
-  { 75304, true },
-  { 75316, true },
+  { 75229, true },
+  { 75238, true },
+  { 75245, true },
+  { 75261, true },
+  { 75272, true },
+  { 75283, true },
+  { 75297, true },
+  { 75308, true },
+  { 75318, true },
   { 75339, true },
-  { 75353, true },
-  { 75372, true },
-  { 75380, true },
-  { 75390, true },
-  { 75399, true },
-  { 75417, true },
-  { 75449, true },
-  { 75465, true },
-  { 75486, true },
-  { 75503, true },
-  { 75514, true },
-  { 75534, true },
-  { 75547, true },
-  { 75561, true },
-  { 75571, true },
-  { 75590, true },
-  { 75608, true },
-  { 75619, true },
-  { 75627, true },
-  { 75641, true },
-  { 75653, true },
-  { 75666, true },
-  { 75679, true },
-  { 75689, true },
-  { 75701, true },
-  { 75712, true },
-  { 75724, true },
-  { 75734, true },
-  { 75757, false },
-  { 75772, true },
-  { 75788, true },
-  { 75807, true },
-  { 75825, true },
-  { 75839, true },
-  { 75853, true },
-  { 75863, true },
-  { 75876, true },
-  { 75893, true },
-  { 75905, true },
+  { 75347, true },
+  { 75357, true },
+  { 75369, true },
+  { 75392, true },
+  { 75406, true },
+  { 75425, true },
+  { 75433, true },
+  { 75443, true },
+  { 75452, true },
+  { 75470, true },
+  { 75502, true },
+  { 75518, true },
+  { 75539, true },
+  { 75556, true },
+  { 75567, true },
+  { 75587, true },
+  { 75600, true },
+  { 75614, true },
+  { 75624, true },
+  { 75643, true },
+  { 75661, true },
+  { 75672, true },
+  { 75680, true },
+  { 75692, true },
+  { 75705, true },
+  { 75715, true },
+  { 75727, true },
+  { 75738, true },
+  { 75750, true },
+  { 75760, true },
+  { 75783, false },
+  { 75798, true },
+  { 75814, true },
+  { 75833, true },
+  { 75851, true },
+  { 75865, true },
+  { 75879, true },
+  { 75889, true },
+  { 75902, true },
   { 75919, true },
-  { 75935, true },
-  { 75950, true },
-  { 75959, true },
-  { 75978, true },
-  { 75993, true },
-  { 76006, true },
-  { 76022, true },
-  { 76039, false },
-  { 76056, true },
-  { 76078, true },
-  { 76100, true },
-  { 76122, true },
-  { 76134, true },
+  { 75931, true },
+  { 75945, true },
+  { 75961, true },
+  { 75976, true },
+  { 75985, true },
+  { 76004, true },
+  { 76019, true },
+  { 76032, true },
+  { 76048, true },
+  { 76065, false },
+  { 76082, true },
+  { 76104, true },
+  { 76126, true },
   { 76148, true },
-  { 76161, true },
-  { 76170, true },
-  { 76186, true },
-  { 76203, true },
-  { 76217, true },
-  { 76230, true },
-  { 76244, true },
+  { 76160, true },
+  { 76174, true },
+  { 76187, true },
+  { 76196, true },
+  { 76212, true },
+  { 76229, true },
+  { 76243, true },
   { 76256, true },
-  { 76269, true },
+  { 76270, true },
   { 76282, true },
-  { 76292, true },
-  { 76306, true },
-  { 76319, true },
-  { 76341, true },
-  { 76363, true },
-  { 76374, true },
+  { 76295, true },
+  { 76308, true },
+  { 76318, true },
+  { 76332, true },
+  { 76345, true },
+  { 76367, true },
   { 76389, true },
   { 76400, true },
-  { 76420, true },
-  { 76443, true },
-  { 76460, true },
-  { 76479, true },
-  { 76506, true },
-  { 76525, true },
-  { 76537, true },
-  { 76558, true },
-  { 76583, true },
-  { 76602, true },
-  { 76617, true },
-  { 76637, false },
-  { 76645, true },
-  { 76657, true },
-  { 76669, true },
+  { 76415, true },
+  { 76426, true },
+  { 76446, true },
+  { 76469, true },
+  { 76486, true },
+  { 76505, true },
+  { 76532, true },
+  { 76551, true },
+  { 76563, true },
+  { 76584, true },
+  { 76609, true },
+  { 76628, true },
+  { 76643, true },
+  { 76663, false },
+  { 76671, true },
   { 76683, true },
-  { 76693, true },
-  { 76706, true },
-  { 76724, true },
-  { 76739, true },
-  { 76753, true },
-  { 76769, true },
-  { 76776, true },
-  { 76783, true },
+  { 76695, true },
+  { 76709, true },
+  { 76719, true },
+  { 76732, true },
+  { 76750, true },
+  { 76765, true },
+  { 76779, true },
   { 76795, true },
-  { 76806, true },
-  { 76819, true },
-  { 76833, true },
-  { 76850, true },
-  { 76864, true },
-  { 76880, true },
-  { 76891, true },
-  { 76898, true },
-  { 76907, true },
-  { 76921, false },
-  { 76936, true },
-  { 76964, true },
-  { 76979, true },
-  { 77000, true },
-  { 77014, true },
-  { 77035, true },
-  { 77051, true },
+  { 76802, true },
+  { 76809, true },
+  { 76821, true },
+  { 76832, true },
+  { 76845, true },
+  { 76859, true },
+  { 76876, true },
+  { 76890, true },
+  { 76906, true },
+  { 76917, true },
+  { 76924, true },
+  { 76933, true },
+  { 76947, false },
+  { 76962, true },
+  { 76990, true },
+  { 77005, true },
+  { 77026, true },
+  { 77040, true },
   { 77061, true },
-  { 77072, true },
-  { 77082, true },
-  { 77095, true },
+  { 77077, true },
+  { 77087, true },
+  { 77098, true },
   { 77108, true },
-  { 77125, true },
-  { 77144, true },
-  { 77163, true },
-  { 77181, true },
-  { 77192, true },
-  { 77204, true },
-  { 77216, true },
-  { 77227, true },
-  { 77239, true },
-  { 77254, true },
+  { 77121, true },
+  { 77134, true },
+  { 77151, true },
+  { 77170, true },
+  { 77189, true },
+  { 77207, true },
+  { 77218, true },
+  { 77230, true },
+  { 77242, true },
+  { 77253, true },
   { 77265, true },
-  { 77276, true },
-  { 77287, true },
-  { 77299, true },
-  { 77310, true },
-  { 77323, true },
-  { 77332, true },
-  { 77341, true },
-  { 77354, true },
-  { 77361, false },
-  { 77369, true },
-  { 77377, true },
-  { 77392, true },
-  { 77405, true },
-  { 77416, false },
-  { 77428, true },
-  { 77452, true },
-  { 77467, true },
-  { 77480, true },
-  { 77494, true },
-  { 77512, true },
+  { 77280, true },
+  { 77291, true },
+  { 77302, true },
+  { 77313, true },
+  { 77325, true },
+  { 77336, true },
+  { 77349, true },
+  { 77358, true },
+  { 77367, true },
+  { 77380, true },
+  { 77387, false },
+  { 77395, true },
+  { 77403, true },
+  { 77418, true },
+  { 77431, true },
+  { 77442, false },
+  { 77454, true },
+  { 77478, true },
+  { 77493, true },
+  { 77506, true },
   { 77520, true },
-  { 77545, true },
-  { 77565, true },
-  { 77589, true },
-  { 77601, true },
-  { 77617, true },
-  { 77626, true },
-  { 77642, true },
-  { 77660, true },
-  { 77675, true },
-  { 77695, true },
-  { 77708, true },
-  { 77724, true },
-  { 77738, true },
-  { 77754, true },
-  { 77774, true },
-  { 77792, true },
-  { 77811, true },
-  { 77828, true },
-  { 77844, true },
-  { 77873, true },
-  { 77893, true },
-  { 77910, true },
-  { 77926, true },
-  { 77935, true },
-  { 77948, false },
-  { 77962, true },
-  { 77979, true },
-  { 78012, true },
-  { 78032, true },
-  { 78044, true },
-  { 78057, true },
-  { 78072, true },
+  { 77538, true },
+  { 77546, true },
+  { 77571, true },
+  { 77591, true },
+  { 77615, true },
+  { 77627, true },
+  { 77643, true },
+  { 77652, true },
+  { 77668, true },
+  { 77686, true },
+  { 77701, true },
+  { 77721, true },
+  { 77734, true },
+  { 77750, true },
+  { 77764, true },
+  { 77780, true },
+  { 77800, true },
+  { 77818, true },
+  { 77837, true },
+  { 77854, true },
+  { 77870, true },
+  { 77899, true },
+  { 77919, true },
+  { 77936, true },
+  { 77952, true },
+  { 77961, true },
+  { 77974, false },
+  { 77988, true },
+  { 78005, true },
+  { 78038, true },
+  { 78058, true },
+  { 78070, true },
   { 78083, true },
-  { 78100, true },
-  { 78112, true },
-  { 78124, true },
-  { 78133, true },
+  { 78098, true },
+  { 78109, true },
+  { 78126, true },
+  { 78138, true },
   { 78150, true },
-  { 78171, true },
-  { 78186, true },
-  { 78204, true },
-  { 78220, true },
-  { 78241, true },
-  { 78255, true },
-  { 78269, true },
-  { 78280, true },
-  { 78291, true },
-  { 78307, true },
-  { 78319, true },
-  { 78330, true },
-  { 78344, true },
-  { 78353, true },
-  { 78362, true },
-  { 78377, true },
-  { 78386, true },
-  { 78394, true },
-  { 78405, true },
-  { 78416, true },
-  { 78430, true },
-  { 78445, true },
-  { 78463, true },
-  { 78477, true },
-  { 78487, true },
-  { 78497, true },
-  { 78506, true },
-  { 78518, true },
-  { 78538, true },
-  { 78561, true },
-  { 78576, true },
-  { 78599, true },
-  { 78607, true },
-  { 78620, true },
-  { 78632, true },
-  { 78644, true },
-  { 78654, false },
-  { 78663, false },
-  { 78672, false },
-  { 78681, true },
-  { 78700, true },
-  { 78723, true },
-  { 78738, true },
-  { 78752, true },
-  { 78767, true },
-  { 78786, true },
-  { 78799, true },
-  { 78815, true },
-  { 78828, true },
-  { 78845, true },
-  { 78860, true },
-  { 78870, true },
+  { 78159, true },
+  { 78176, true },
+  { 78197, true },
+  { 78212, true },
+  { 78230, true },
+  { 78246, true },
+  { 78267, true },
+  { 78281, true },
+  { 78295, true },
+  { 78306, true },
+  { 78317, true },
+  { 78333, true },
+  { 78345, true },
+  { 78356, true },
+  { 78370, true },
+  { 78379, true },
+  { 78388, true },
+  { 78403, true },
+  { 78412, true },
+  { 78420, true },
+  { 78431, true },
+  { 78442, true },
+  { 78456, true },
+  { 78471, true },
+  { 78489, true },
+  { 78503, true },
+  { 78513, true },
+  { 78523, true },
+  { 78532, true },
+  { 78544, true },
+  { 78564, true },
+  { 78587, true },
+  { 78602, true },
+  { 78625, true },
+  { 78633, true },
+  { 78646, true },
+  { 78658, true },
+  { 78670, true },
+  { 78680, false },
+  { 78689, false },
+  { 78698, false },
+  { 78707, true },
+  { 78726, true },
+  { 78749, true },
+  { 78764, true },
+  { 78778, true },
+  { 78793, true },
+  { 78812, true },
+  { 78825, true },
+  { 78841, true },
+  { 78854, true },
+  { 78871, true },
   { 78886, true },
-  { 78905, true },
-  { 78920, true },
-  { 78939, true },
-  { 78953, true },
-  { 78967, true },
-  { 78984, false },
-  { 79004, true },
-  { 79017, true },
-  { 79029, true },
-  { 79044, true },
-  { 79062, true },
-  { 79073, true },
-  { 79083, true },
-  { 79097, true },
-  { 79110, true },
-  { 79125, true },
-  { 79150, true },
+  { 78896, true },
+  { 78912, true },
+  { 78931, true },
+  { 78946, true },
+  { 78965, true },
+  { 78979, true },
+  { 78993, true },
+  { 79010, false },
+  { 79030, true },
+  { 79043, true },
+  { 79055, true },
+  { 79070, true },
+  { 79088, true },
+  { 79099, true },
+  { 79109, true },
+  { 79123, true },
+  { 79136, true },
+  { 79151, true },
   { 79176, true },
-  { 79191, true },
-  { 79203, true },
-  { 79228, false },
-  { 79237, true },
-  { 79244, true },
-  { 79252, true },
-  { 79260, true },
-  { 79271, true },
-  { 79287, true },
-  { 79301, true },
-  { 79315, true },
-  { 79331, true },
-  { 79358, true },
-  { 79372, true },
-  { 79381, true },
-  { 79394, true },
-  { 79406, true },
-  { 79429, true },
-  { 79449, true },
-  { 79468, true },
-  { 79490, true },
-  { 79504, true },
-  { 79524, true },
-  { 79549, true },
-  { 79565, true },
-  { 79577, true },
-  { 79589, true },
-  { 79611, true },
-  { 79626, true },
-  { 79641, true },
-  { 79658, true },
-  { 79673, true },
-  { 79690, true },
-  { 79705, true },
-  { 79720, true },
-  { 79732, true },
-  { 79746, false },
-  { 79756, true },
-  { 79773, true },
-  { 79784, false },
+  { 79202, true },
+  { 79217, true },
+  { 79229, true },
+  { 79254, false },
+  { 79263, true },
+  { 79270, true },
+  { 79278, true },
+  { 79286, true },
+  { 79297, true },
+  { 79313, true },
+  { 79327, true },
+  { 79341, true },
+  { 79357, true },
+  { 79384, true },
+  { 79398, true },
+  { 79407, true },
+  { 79420, true },
+  { 79432, true },
+  { 79455, true },
+  { 79475, true },
+  { 79494, true },
+  { 79516, true },
+  { 79530, true },
+  { 79550, true },
+  { 79575, true },
+  { 79591, true },
+  { 79603, true },
+  { 79615, true },
+  { 79637, true },
+  { 79652, true },
+  { 79667, true },
+  { 79684, true },
+  { 79699, true },
+  { 79716, true },
+  { 79731, true },
+  { 79746, true },
+  { 79758, true },
+  { 79772, false },
+  { 79782, true },
   { 79799, true },
-  { 79816, true },
-  { 79830, true },
-  { 79843, true },
-  { 79855, true },
-  { 79865, true },
-  { 79877, true },
-  { 79892, true },
+  { 79810, false },
+  { 79825, true },
+  { 79842, true },
+  { 79856, true },
+  { 79869, true },
+  { 79881, true },
+  { 79891, true },
   { 79903, true },
-  { 79923, true },
-  { 79935, true },
-  { 79946, true },
-  { 79971, true },
-  { 79980, true },
-  { 79988, true },
-  { 80011, true },
-  { 80028, true },
-  { 80039, true },
-  { 80055, false },
-  { 80067, true },
-  { 80082, true },
-  { 80090, true },
-  { 80100, true },
-  { 80115, true },
-  { 80129, true },
-  { 80139, true },
-  { 80163, true },
-  { 80175, true },
-  { 80203, true },
-  { 80215, true },
-  { 80231, true },
-  { 80243, true },
+  { 79918, true },
+  { 79929, true },
+  { 79949, true },
+  { 79961, true },
+  { 79972, true },
+  { 79997, true },
+  { 80006, true },
+  { 80014, true },
+  { 80037, true },
+  { 80054, true },
+  { 80065, true },
+  { 80081, false },
+  { 80093, true },
+  { 80108, true },
+  { 80116, true },
+  { 80126, true },
+  { 80141, true },
+  { 80155, true },
+  { 80165, true },
+  { 80189, true },
+  { 80201, true },
+  { 80229, true },
+  { 80241, true },
   { 80257, true },
-  { 80285, true },
+  { 80271, true },
   { 80299, true },
-  { 80315, true },
-  { 80332, true },
+  { 80313, true },
+  { 80329, true },
   { 80346, true },
-  { 80363, true },
-  { 80385, true },
-  { 80395, true },
-  { 80413, true },
-  { 80432, true },
-  { 80451, true },
-  { 80476, true },
-  { 80495, true },
+  { 80360, true },
+  { 80377, true },
+  { 80399, true },
+  { 80409, true },
+  { 80427, true },
+  { 80446, true },
+  { 80465, true },
+  { 80490, true },
   { 80509, true },
-  { 80522, true },
-  { 80551, true },
-  { 80581, true },
-  { 80593, true },
-  { 80602, true },
-  { 80615, true },
-  { 80626, true },
-  { 80636, true },
-  { 80652, true },
-  { 80669, true },
-  { 80692, true },
-  { 80718, true },
+  { 80523, true },
+  { 80536, true },
+  { 80565, true },
+  { 80595, true },
+  { 80607, true },
+  { 80616, true },
+  { 80629, true },
+  { 80640, true },
+  { 80650, true },
+  { 80666, true },
+  { 80683, true },
+  { 80706, true },
   { 80732, true },
   { 80746, true },
-  { 80770, false },
-  { 80780, true },
-  { 80796, true },
-  { 80804, true },
-  { 80823, true },
-  { 80835, true },
-  { 80846, true },
-  { 80862, true },
+  { 80760, true },
+  { 80784, false },
+  { 80794, true },
+  { 80810, true },
+  { 80818, true },
+  { 80837, true },
+  { 80849, true },
+  { 80860, true },
   { 80876, true },
-  { 80888, true },
-  { 80901, true },
-  { 80920, true },
-  { 80931, true },
-  { 80943, true },
-  { 80956, true },
+  { 80890, true },
+  { 80902, true },
+  { 80915, true },
+  { 80934, true },
+  { 80945, true },
+  { 80957, true },
   { 80970, true },
-  { 80980, true },
-  { 80993, true },
-  { 81005, true },
-  { 81021, true },
-  { 81029, false },
-  { 81037, true },
-  { 81059, true },
-  { 81071, true },
-  { 81079, true },
-  { 81100, true },
-  { 81124, true },
-  { 81140, true },
+  { 80984, true },
+  { 80994, true },
+  { 81007, true },
+  { 81019, true },
+  { 81035, true },
+  { 81043, false },
+  { 81051, true },
+  { 81073, true },
+  { 81085, true },
+  { 81093, true },
+  { 81114, true },
+  { 81138, true },
   { 81154, true },
-  { 81171, true },
-  { 81183, true },
-  { 81193, true },
-  { 81208, true },
-  { 81218, true },
-  { 81241, true },
+  { 81168, true },
+  { 81185, true },
+  { 81197, true },
+  { 81207, true },
+  { 81222, true },
+  { 81232, true },
   { 81255, true },
-  { 81270, true },
-  { 81282, true },
-  { 81291, true },
-  { 81304, true },
-  { 81319, true },
+  { 81269, true },
+  { 81284, true },
+  { 81296, true },
+  { 81305, true },
+  { 81318, true },
   { 81333, true },
-  { 81345, true },
-  { 81360, false },
-  { 81377, true },
-  { 81388, true },
-  { 81399, true },
-  { 81409, true },
+  { 81347, true },
+  { 81359, true },
+  { 81374, false },
+  { 81391, true },
+  { 81402, true },
+  { 81413, true },
   { 81423, true },
-  { 81432, true },
-  { 81440, true },
-  { 81450, true },
-  { 81459, true },
-  { 81467, true },
-  { 81475, true },
-  { 81484, true },
-  { 81496, true },
-  { 81508, true },
-  { 81518, true },
-  { 81528, true },
-  { 81540, true },
+  { 81437, true },
+  { 81446, true },
+  { 81454, true },
+  { 81464, true },
+  { 81473, true },
+  { 81481, true },
+  { 81489, true },
+  { 81498, true },
+  { 81510, true },
+  { 81522, true },
+  { 81532, true },
+  { 81542, true },
   { 81554, true },
-  { 81569, true },
-  { 81580, true },
+  { 81568, true },
+  { 81583, true },
   { 81594, true },
-  { 81605, true },
-  { 81613, true },
-  { 81624, true },
-  { 81639, true },
-  { 81652, true },
-  { 81659, true },
-  { 81679, true },
-  { 81688, true },
-  { 81701, true },
-  { 81718, true },
-  { 81733, true },
-  { 81748, true },
-  { 81768, true },
-  { 81777, true },
-  { 81789, false },
-  { 81798, true },
-  { 81808, true },
-  { 81818, false },
-  { 81825, true },
-  { 81836, true },
-  { 81849, true },
-  { 81864, true },
-  { 81885, true },
-  { 81892, true },
-  { 81912, true },
-  { 81922, true },
-  { 81933, true },
-  { 81946, true },
+  { 81608, true },
+  { 81619, true },
+  { 81627, true },
+  { 81638, true },
+  { 81653, true },
+  { 81666, true },
+  { 81673, true },
+  { 81693, true },
+  { 81702, true },
+  { 81715, true },
+  { 81732, true },
+  { 81747, true },
+  { 81762, true },
+  { 81782, true },
+  { 81791, true },
+  { 81803, false },
+  { 81812, true },
+  { 81822, true },
+  { 81832, false },
+  { 81839, true },
+  { 81850, true },
+  { 81863, true },
+  { 81878, true },
+  { 81899, true },
+  { 81906, true },
+  { 81926, true },
+  { 81936, true },
+  { 81947, true },
   { 81960, true },
-  { 81969, true },
-  { 81985, true },
-  { 81994, false },
-  { 82003, true },
-  { 82011, true },
-  { 82023, true },
-  { 82030, true },
-  { 82042, true },
-  { 82054, true },
-  { 82073, true },
-  { 82086, true },
-  { 82102, true },
-  { 82115, false },
-  { 82124, true },
-  { 82133, true },
-  { 82144, true },
-  { 82164, true },
-  { 82181, true },
-  { 82196, true },
-  { 82212, false },
-  { 82227, true },
-  { 82246, true },
-  { 82257, true },
-  { 82274, false },
-  { 82295, false },
-  { 82311, false },
-  { 82331, true },
-  { 82343, true },
-  { 82366, true },
-  { 82378, true },
-  { 82391, true },
-  { 82403, true },
-  { 82415, true },
-  { 82426, true },
-  { 82438, true },
-  { 82447, true },
-  { 82458, true },
-  { 82476, true },
-  { 82503, true },
-  { 82513, true },
-  { 82521, true },
+  { 81974, true },
+  { 81983, true },
+  { 81999, true },
+  { 82008, false },
+  { 82017, true },
+  { 82025, true },
+  { 82037, true },
+  { 82044, true },
+  { 82056, true },
+  { 82068, true },
+  { 82087, true },
+  { 82100, true },
+  { 82116, true },
+  { 82129, false },
+  { 82138, true },
+  { 82147, true },
+  { 82158, true },
+  { 82178, true },
+  { 82195, true },
+  { 82210, true },
+  { 82226, false },
+  { 82241, true },
+  { 82260, true },
+  { 82271, true },
+  { 82288, false },
+  { 82309, false },
+  { 82325, false },
+  { 82345, true },
+  { 82357, true },
+  { 82380, true },
+  { 82392, true },
+  { 82405, true },
+  { 82417, true },
+  { 82429, true },
+  { 82440, true },
+  { 82452, true },
+  { 82461, true },
+  { 82472, true },
+  { 82490, true },
+  { 82517, true },
+  { 82527, true },
   { 82535, true },
-  { 82550, true },
-  { 82560, true },
-  { 82571, true },
-  { 82580, true },
+  { 82549, true },
+  { 82564, true },
+  { 82574, true },
+  { 82585, true },
   { 82594, true },
-  { 82613, true },
-  { 82626, true },
-  { 82636, true },
-  { 82644, true },
-  { 82651, true },
-  { 82664, true },
-  { 82674, true },
-  { 82683, false },
-  { 82693, true },
-  { 82702, true },
-  { 82714, true },
-  { 82724, false },
-  { 82741, true },
-  { 82750, true },
-  { 82760, true },
-  { 82768, true },
-  { 82778, true },
-  { 82788, true },
-  { 82801, true },
-  { 82813, true },
-  { 82828, true },
-  { 82840, true },
-  { 82856, true },
+  { 82608, true },
+  { 82627, true },
+  { 82640, true },
+  { 82650, true },
+  { 82658, true },
+  { 82665, true },
+  { 82678, true },
+  { 82688, true },
+  { 82697, false },
+  { 82707, true },
+  { 82716, true },
+  { 82728, true },
+  { 82738, false },
+  { 82755, true },
+  { 82764, true },
+  { 82774, true },
+  { 82782, true },
+  { 82792, true },
+  { 82802, true },
+  { 82815, true },
+  { 82827, true },
+  { 82842, true },
+  { 82854, true },
   { 82870, true },
   { 82884, true },
-  { 82891, true },
-  { 82903, true },
+  { 82898, true },
+  { 82905, true },
   { 82917, true },
-  { 82928, true },
-  { 82937, true },
+  { 82931, true },
+  { 82942, true },
   { 82951, true },
-  { 82963, true },
-  { 82973, true },
-  { 82983, true },
-  { 82995, true },
-  { 83005, true },
-  { 83023, true },
-  { 83038, true },
-  { 83051, true },
-  { 83058, true },
-  { 83075, true },
-  { 83086, true },
-  { 83096, true },
-  { 83106, true },
-  { 83115, true },
-  { 83137, true },
-  { 83156, true },
-  { 83163, true },
+  { 82965, true },
+  { 82977, true },
+  { 82987, true },
+  { 82997, true },
+  { 83009, true },
+  { 83019, true },
+  { 83037, true },
+  { 83052, true },
+  { 83065, true },
+  { 83072, true },
+  { 83089, true },
+  { 83100, true },
+  { 83110, true },
+  { 83120, true },
+  { 83129, true },
+  { 83151, true },
+  { 83170, true },
   { 83177, true },
-  { 83192, true },
-  { 83216, true },
-  { 83238, true },
+  { 83191, true },
+  { 83206, true },
+  { 83230, true },
   { 83252, true },
-  { 83265, true },
+  { 83266, true },
   { 83279, true },
-  { 83302, true },
-  { 83313, true },
-  { 83322, true },
-  { 83333, true },
-  { 83347, true },
-  { 83358, true },
-  { 83370, true },
-  { 83389, true },
-  { 83402, true },
-  { 83411, true },
-  { 83426, true },
-  { 83442, true },
-  { 83455, true },
-  { 83467, true },
-  { 83480, true },
-  { 83488, true },
-  { 83500, true },
-  { 83509, true },
-  { 83524, true },
-  { 83533, true },
-  { 83545, true },
-  { 83555, true },
-  { 83570, true },
-  { 83578, true },
-  { 83593, true },
-  { 83604, true },
-  { 83615, true },
-  { 83624, true },
-  { 83638, true },
-  { 83652, true },
-  { 83675, true },
-  { 83700, true },
-  { 83719, true },
-  { 83733, true },
-  { 83749, true },
-  { 83763, true },
-  { 83779, true },
+  { 83293, true },
+  { 83316, true },
+  { 83327, true },
+  { 83336, true },
+  { 83350, true },
+  { 83361, true },
+  { 83373, true },
+  { 83392, true },
+  { 83405, true },
+  { 83414, true },
+  { 83429, true },
+  { 83445, true },
+  { 83458, true },
+  { 83470, true },
+  { 83483, true },
+  { 83491, true },
+  { 83503, true },
+  { 83512, true },
+  { 83527, true },
+  { 83536, true },
+  { 83548, true },
+  { 83558, true },
+  { 83573, true },
+  { 83581, true },
+  { 83596, true },
+  { 83607, true },
+  { 83618, true },
+  { 83627, true },
+  { 83642, true },
+  { 83656, true },
+  { 83670, true },
+  { 83693, true },
+  { 83718, true },
+  { 83737, true },
+  { 83751, true },
+  { 83767, true },
+  { 83781, true },
   { 83797, true },
-  { 83814, true },
-  { 83829, true },
-  { 83844, true },
-  { 83853, true },
-  { 83866, true },
-  { 83883, true },
-  { 83896, true },
-  { 83906, true },
-  { 83917, true },
-  { 83928, true },
-  { 83938, true },
-  { 83950, true },
-  { 83971, true },
-  { 83985, false },
-  { 84005, false },
-  { 84017, true },
-  { 84030, true },
-  { 84040, true },
-  { 84053, true },
-  { 84066, true },
-  { 84082, true },
-  { 84099, true },
-  { 84111, true },
-  { 84125, true },
-  { 84139, true },
-  { 84155, true },
-  { 84167, true },
-  { 84188, false },
-  { 84202, true },
+  { 83815, true },
+  { 83832, true },
+  { 83847, true },
+  { 83862, true },
+  { 83871, true },
+  { 83884, true },
+  { 83901, true },
+  { 83914, true },
+  { 83924, true },
+  { 83935, true },
+  { 83946, true },
+  { 83956, true },
+  { 83968, true },
+  { 83989, true },
+  { 84003, false },
+  { 84023, false },
+  { 84035, true },
+  { 84048, true },
+  { 84058, true },
+  { 84071, true },
+  { 84084, true },
+  { 84100, true },
+  { 84117, true },
+  { 84129, true },
+  { 84143, true },
+  { 84157, true },
+  { 84173, true },
+  { 84185, true },
+  { 84206, false },
   { 84220, true },
-  { 84237, true },
-  { 84249, true },
-  { 84269, true },
-  { 84285, true },
-  { 84307, true },
-  { 84329, true },
-  { 84348, true },
-  { 84365, true },
-  { 84377, true },
-  { 84390, true },
-  { 84410, true },
-  { 84435, true },
-  { 84448, true },
-  { 84463, true },
-  { 84480, true },
-  { 84500, false },
-  { 84513, true },
-  { 84524, true },
-  { 84540, true },
-  { 84555, true },
-  { 84575, true },
-  { 84600, true },
-  { 84617, true },
-  { 84628, true },
-  { 84642, true },
-  { 84658, false },
-  { 84671, true },
-  { 84684, true },
-  { 84696, true },
-  { 84713, true },
-  { 84725, false },
-  { 84734, false },
-  { 84744, true },
-  { 84755, true },
-  { 84768, false },
-  { 84781, true },
-  { 84792, true },
-  { 84806, true },
-  { 84822, true },
-  { 84841, true },
-  { 84854, true },
-  { 84877, true },
-  { 84891, true },
-  { 84906, true },
-  { 84916, true },
-  { 84929, true },
-  { 84944, true },
-  { 84963, true },
-  { 84979, true },
-  { 84995, true },
-  { 85012, true },
-  { 85025, true },
-  { 85037, true },
-  { 85050, true },
-  { 85062, true },
-  { 85077, true },
-  { 85094, true },
-  { 85103, true },
-  { 85130, true },
-  { 85151, true },
-  { 85168, true },
-  { 85179, false },
-  { 85197, true },
-  { 85212, true },
-  { 85224, true },
-  { 85236, true },
-  { 85248, true },
-  { 85267, true },
-  { 85302, true },
-  { 85325, true },
-  { 85342, true },
-  { 85355, true },
-  { 85367, true },
-  { 85384, false },
-  { 85403, true },
+  { 84238, true },
+  { 84255, true },
+  { 84267, true },
+  { 84287, true },
+  { 84303, true },
+  { 84325, true },
+  { 84347, true },
+  { 84366, true },
+  { 84383, true },
+  { 84395, true },
+  { 84408, true },
+  { 84428, true },
+  { 84453, true },
+  { 84466, true },
+  { 84481, true },
+  { 84498, true },
+  { 84518, false },
+  { 84531, true },
+  { 84542, true },
+  { 84558, true },
+  { 84573, true },
+  { 84593, true },
+  { 84618, true },
+  { 84635, true },
+  { 84646, true },
+  { 84660, true },
+  { 84676, false },
+  { 84689, true },
+  { 84702, true },
+  { 84714, true },
+  { 84731, true },
+  { 84743, false },
+  { 84752, false },
+  { 84762, true },
+  { 84773, true },
+  { 84786, false },
+  { 84799, true },
+  { 84810, true },
+  { 84824, true },
+  { 84840, true },
+  { 84859, true },
+  { 84872, true },
+  { 84895, true },
+  { 84909, true },
+  { 84924, true },
+  { 84934, true },
+  { 84947, true },
+  { 84962, true },
+  { 84981, true },
+  { 84997, true },
+  { 85013, true },
+  { 85030, true },
+  { 85043, true },
+  { 85055, true },
+  { 85068, true },
+  { 85080, true },
+  { 85095, true },
+  { 85112, true },
+  { 85121, true },
+  { 85148, true },
+  { 85169, true },
+  { 85186, true },
+  { 85197, false },
+  { 85215, true },
+  { 85230, true },
+  { 85242, true },
+  { 85254, true },
+  { 85266, true },
+  { 85285, true },
+  { 85320, true },
+  { 85343, true },
+  { 85360, true },
+  { 85373, true },
+  { 85385, true },
+  { 85402, false },
   { 85421, true },
-  { 85452, true },
-  { 85467, true },
-  { 85489, true },
-  { 85501, true },
-  { 85518, true },
-  { 85535, true },
-  { 85547, true },
-  { 85566, true },
-  { 85578, true },
-  { 85593, true },
-  { 85610, true },
-  { 85627, true },
-  { 85643, true },
-  { 85667, true },
-  { 85692, true },
-  { 85714, true },
-  { 85741, true },
-  { 85759, true },
-  { 85776, true },
-  { 85791, true },
-  { 85809, true },
-  { 85830, true },
-  { 85858, true },
-  { 85882, true },
-  { 85906, true },
-  { 85919, true },
-  { 85932, true },
-  { 85949, true },
-  { 85964, true },
-  { 85989, false },
-  { 86003, true },
-  { 86013, true },
-  { 86032, true },
-  { 86048, true },
-  { 86072, true },
-  { 86087, true },
-  { 86104, true },
-  { 86114, true },
-  { 86124, true },
-  { 86136, true },
-  { 86149, true },
-  { 86162, true },
-  { 86180, true },
-  { 86193, true },
-  { 86207, true },
-  { 86217, true },
-  { 86230, true },
-  { 86246, true },
-  { 86259, true },
-  { 86278, true },
-  { 86296, true },
-  { 86310, true },
-  { 86320, true },
-  { 86328, true },
-  { 86338, true },
-  { 86348, true },
-  { 86360, true },
-  { 86374, false },
-  { 86387, true },
-  { 86395, true },
-  { 86406, true },
-  { 86417, true },
-  { 86425, true },
-  { 86441, true },
-  { 86457, true },
-  { 86464, true },
-  { 86472, true },
-  { 86482, true },
-  { 86494, true },
-  { 86508, true },
-  { 86517, true },
-  { 86533, true },
-  { 86543, false },
-  { 86561, true },
-  { 86573, true },
-  { 86585, false },
-  { 86596, true },
-  { 86609, true },
-  { 86619, true },
-  { 86629, true },
-  { 86639, true },
-  { 86649, true },
-  { 86659, true },
-  { 86678, true },
-  { 86687, true },
-  { 86698, true },
-  { 86707, true },
-  { 86727, true },
-  { 86743, true },
-  { 86751, true },
-  { 86767, true },
-  { 86784, true },
-  { 86795, true },
-  { 86807, true },
+  { 85439, true },
+  { 85470, true },
+  { 85485, true },
+  { 85507, true },
+  { 85519, true },
+  { 85536, true },
+  { 85553, true },
+  { 85565, true },
+  { 85584, true },
+  { 85596, true },
+  { 85611, true },
+  { 85628, true },
+  { 85645, true },
+  { 85661, true },
+  { 85677, true },
+  { 85701, true },
+  { 85726, true },
+  { 85748, true },
+  { 85775, true },
+  { 85793, true },
+  { 85810, true },
+  { 85825, true },
+  { 85843, true },
+  { 85864, true },
+  { 85892, true },
+  { 85916, true },
+  { 85940, true },
+  { 85953, true },
+  { 85966, true },
+  { 85983, true },
+  { 85998, true },
+  { 86023, false },
+  { 86037, true },
+  { 86047, true },
+  { 86066, true },
+  { 86082, true },
+  { 86106, true },
+  { 86121, true },
+  { 86138, true },
+  { 86148, true },
+  { 86158, true },
+  { 86170, true },
+  { 86183, true },
+  { 86196, true },
+  { 86214, true },
+  { 86227, true },
+  { 86241, true },
+  { 86251, true },
+  { 86264, true },
+  { 86280, true },
+  { 86293, true },
+  { 86312, true },
+  { 86330, true },
+  { 86344, true },
+  { 86354, true },
+  { 86362, true },
+  { 86372, true },
+  { 86382, true },
+  { 86394, true },
+  { 86408, false },
+  { 86421, true },
+  { 86429, true },
+  { 86440, true },
+  { 86451, true },
+  { 86459, true },
+  { 86475, true },
+  { 86491, true },
+  { 86498, true },
+  { 86506, true },
+  { 86516, true },
+  { 86528, true },
+  { 86542, true },
+  { 86551, true },
+  { 86567, true },
+  { 86577, false },
+  { 86595, true },
+  { 86607, true },
+  { 86619, false },
+  { 86630, true },
+  { 86643, true },
+  { 86653, true },
+  { 86663, true },
+  { 86673, true },
+  { 86683, true },
+  { 86693, true },
+  { 86712, true },
+  { 86721, true },
+  { 86732, true },
+  { 86741, true },
+  { 86761, true },
+  { 86777, true },
+  { 86785, true },
+  { 86801, true },
   { 86818, true },
-  { 86833, true },
-  { 86843, true },
+  { 86829, true },
+  { 86841, true },
   { 86852, true },
-  { 86861, true },
-  { 86879, true },
+  { 86867, true },
+  { 86877, true },
+  { 86886, true },
   { 86895, true },
-  { 86909, true },
-  { 86937, true },
-  { 86946, true },
-  { 86961, true },
-  { 86978, true },
-  { 87001, true },
-  { 87020, true },
-  { 87029, true },
-  { 87047, true },
-  { 87062, true },
-  { 87076, true },
-  { 87099, true },
-  { 87121, true },
-  { 87131, true },
-  { 87147, true },
-  { 87163, true },
-  { 87171, true },
+  { 86913, true },
+  { 86929, true },
+  { 86943, true },
+  { 86971, true },
+  { 86980, true },
+  { 86995, true },
+  { 87012, true },
+  { 87035, true },
+  { 87054, true },
+  { 87063, true },
+  { 87081, true },
+  { 87096, true },
+  { 87110, true },
+  { 87133, true },
+  { 87155, true },
+  { 87165, true },
   { 87181, true },
-  { 87193, true },
+  { 87197, true },
   { 87205, true },
-  { 87222, true },
+  { 87215, true },
+  { 87227, true },
   { 87239, true },
-  { 87271, true },
-  { 87289, true },
-  { 87303, true },
-  { 87317, true },
-  { 87329, true },
-  { 87347, true },
-  { 87366, true },
-  { 87377, true },
-  { 87388, true },
-  { 87406, true },
-  { 87419, true },
-  { 87430, true },
+  { 87256, true },
+  { 87273, true },
+  { 87305, true },
+  { 87323, true },
+  { 87337, true },
+  { 87351, true },
+  { 87363, true },
+  { 87381, true },
+  { 87400, true },
+  { 87411, true },
+  { 87422, true },
   { 87440, true },
-  { 87452, true },
-  { 87463, true },
+  { 87453, true },
+  { 87464, true },
   { 87474, true },
-  { 87484, true },
-  { 87493, true },
-  { 87510, true },
-  { 87529, true },
-  { 87542, true },
-  { 87555, true },
-  { 87574, true },
-  { 87591, true },
-  { 87623, true },
-  { 87637, true },
-  { 87649, true },
-  { 87673, true },
-  { 87696, true },
-  { 87721, true },
-  { 87734, true },
-  { 87753, true },
-  { 87767, true },
-  { 87780, true },
-  { 87795, false },
-  { 87815, true },
-  { 87828, true },
-  { 87845, true },
-  { 87860, true },
-  { 87877, true },
-  { 87886, true },
-  { 87895, true },
+  { 87486, true },
+  { 87497, true },
+  { 87508, true },
+  { 87518, true },
+  { 87527, true },
+  { 87544, true },
+  { 87563, true },
+  { 87576, true },
+  { 87589, true },
+  { 87608, true },
+  { 87625, true },
+  { 87657, true },
+  { 87671, true },
+  { 87683, true },
+  { 87707, true },
+  { 87730, true },
+  { 87755, true },
+  { 87768, true },
+  { 87787, true },
+  { 87801, true },
+  { 87814, true },
+  { 87829, false },
+  { 87849, true },
+  { 87862, true },
+  { 87879, true },
+  { 87894, true },
   { 87911, true },
-  { 87931, true },
-  { 87950, true },
-  { 87959, true },
-  { 87970, true },
-  { 87979, true },
-  { 87990, true },
-  { 88003, true },
-  { 88012, true },
-  { 88025, true },
-  { 88035, true },
-  { 88048, true },
-  { 88061, true },
-  { 88072, true },
-  { 88083, true },
-  { 88092, true },
+  { 87920, true },
+  { 87929, true },
+  { 87945, true },
+  { 87965, true },
+  { 87984, true },
+  { 87993, true },
+  { 88004, true },
+  { 88013, true },
+  { 88024, true },
+  { 88037, true },
+  { 88046, true },
+  { 88059, true },
+  { 88069, true },
+  { 88082, true },
+  { 88095, true },
   { 88106, true },
-  { 88123, true },
+  { 88117, true },
+  { 88126, true },
   { 88140, true },
-  { 88149, true },
-  { 88164, true },
-  { 88179, true },
+  { 88157, true },
+  { 88174, true },
+  { 88183, true },
   { 88198, true },
-  { 88210, true },
-  { 88223, true },
-  { 88235, true },
-  { 88248, true },
+  { 88213, true },
+  { 88232, true },
+  { 88244, true },
   { 88257, true },
-  { 88271, true },
-  { 88294, true },
-  { 88306, true },
-  { 88317, true },
-  { 88334, true },
-  { 88348, true },
-  { 88365, true },
-  { 88386, true },
-  { 88397, true },
-  { 88408, true },
-  { 88415, true },
-  { 88426, true },
-  { 88433, true },
-  { 88443, true },
-  { 88455, true },
-  { 88465, true },
-  { 88474, true },
-  { 88487, true },
+  { 88269, true },
+  { 88282, true },
+  { 88291, true },
+  { 88305, true },
+  { 88328, true },
+  { 88340, true },
+  { 88351, true },
+  { 88368, true },
+  { 88382, true },
+  { 88399, true },
+  { 88420, true },
+  { 88431, true },
+  { 88442, true },
+  { 88449, true },
+  { 88460, true },
+  { 88467, true },
+  { 88477, true },
+  { 88489, true },
   { 88499, true },
-  { 88516, true },
-  { 88530, true },
-  { 88544, true },
-  { 88551, true },
-  { 88558, true },
-  { 88567, true },
-  { 88575, true },
+  { 88508, true },
+  { 88521, true },
+  { 88533, true },
+  { 88550, true },
+  { 88564, true },
+  { 88578, true },
   { 88585, true },
-  { 88603, true },
-  { 88617, true },
-  { 88629, true },
-  { 88640, true },
+  { 88592, true },
+  { 88601, true },
+  { 88609, true },
+  { 88619, true },
+  { 88637, true },
   { 88651, true },
-  { 88662, true },
-  { 88675, true },
-  { 88686, true },
-  { 88695, false },
-  { 88707, true },
-  { 88724, true },
-  { 88735, true },
-  { 88742, true },
-  { 88749, true },
-  { 88763, true },
-  { 88771, true },
-  { 88778, true },
-  { 88789, true },
-  { 88802, true },
-  { 88815, true },
-  { 88825, true },
-  { 88838, true },
-  { 88853, true },
-  { 88866, true },
-  { 88875, true },
-  { 88894, false },
-  { 88906, true },
-  { 88920, true },
-  { 88933, true },
-  { 88948, true },
+  { 88663, true },
+  { 88674, true },
+  { 88685, true },
+  { 88696, true },
+  { 88709, true },
+  { 88720, true },
+  { 88729, false },
+  { 88741, true },
+  { 88758, true },
+  { 88769, true },
+  { 88776, true },
+  { 88783, true },
+  { 88797, true },
+  { 88805, true },
+  { 88812, true },
+  { 88823, true },
+  { 88836, true },
+  { 88849, true },
+  { 88859, true },
+  { 88872, true },
+  { 88887, true },
+  { 88900, true },
+  { 88909, true },
+  { 88928, false },
+  { 88940, true },
+  { 88954, true },
   { 88967, true },
-  { 88980, true },
-  { 88995, true },
-  { 89008, true },
-  { 89018, true },
-  { 89031, true },
-  { 89048, true },
-  { 89062, false },
-  { 89081, true },
-  { 89096, true },
-  { 89110, true },
-  { 89126, true },
-  { 89142, true },
-  { 89162, true },
-  { 89171, true },
-  { 89187, true },
-  { 89202, true },
-  { 89218, true },
-  { 89238, true },
-  { 89257, true },
-  { 89274, true },
-  { 89290, true },
-  { 89310, true },
-  { 89323, true },
-  { 89337, false },
-  { 89350, true },
-  { 89360, true },
-  { 89376, true },
-  { 89393, true },
-  { 89408, true },
-  { 89431, true },
-  { 89444, true },
-  { 89461, true },
-  { 89476, true },
-  { 89493, true },
-  { 89507, true },
-  { 89522, true },
-  { 89531, true },
-  { 89546, true },
-  { 89564, true },
-  { 89578, true },
-  { 89589, true },
-  { 89599, true },
-  { 89614, true },
-  { 89628, true },
-  { 89641, true },
-  { 89652, true },
-  { 89666, true },
-  { 89676, true },
-  { 89688, true },
-  { 89706, true },
-  { 89720, true },
-  { 89732, true },
-  { 89751, false },
+  { 88982, true },
+  { 89001, true },
+  { 89014, true },
+  { 89029, true },
+  { 89042, true },
+  { 89052, true },
+  { 89065, true },
+  { 89082, true },
+  { 89096, false },
+  { 89115, true },
+  { 89130, true },
+  { 89144, true },
+  { 89160, true },
+  { 89176, true },
+  { 89196, true },
+  { 89205, true },
+  { 89221, true },
+  { 89236, true },
+  { 89252, true },
+  { 89272, true },
+  { 89291, true },
+  { 89308, true },
+  { 89324, true },
+  { 89344, true },
+  { 89357, true },
+  { 89371, false },
+  { 89384, true },
+  { 89394, true },
+  { 89410, true },
+  { 89427, true },
+  { 89442, true },
+  { 89465, true },
+  { 89478, true },
+  { 89495, true },
+  { 89510, true },
+  { 89527, true },
+  { 89541, true },
+  { 89556, true },
+  { 89565, true },
+  { 89580, true },
+  { 89598, true },
+  { 89612, true },
+  { 89623, true },
+  { 89633, true },
+  { 89648, true },
+  { 89662, true },
+  { 89675, true },
+  { 89686, true },
+  { 89700, true },
+  { 89710, true },
+  { 89722, true },
+  { 89740, true },
+  { 89754, true },
   { 89766, true },
-  { 89785, true },
-  { 89796, true },
-  { 89808, true },
-  { 89826, true },
-  { 89839, true },
-  { 89856, true },
-  { 89875, true },
-  { 89892, true },
-  { 89910, true },
-  { 89932, true },
-  { 89951, true },
-  { 89964, true },
-  { 89980, true },
-  { 89995, true },
-  { 90003, true },
-  { 90016, true },
-  { 90030, false },
-  { 90044, true },
-  { 90055, true },
-  { 90065, true },
-  { 90083, true },
-  { 90101, true },
-  { 90114, true },
-  { 90122, true },
-  { 90134, true },
-  { 90145, true },
-  { 90157, true },
-  { 90167, true },
-  { 90175, true },
+  { 89785, false },
+  { 89800, true },
+  { 89819, true },
+  { 89830, true },
+  { 89842, true },
+  { 89860, true },
+  { 89873, true },
+  { 89890, true },
+  { 89909, true },
+  { 89926, true },
+  { 89944, true },
+  { 89966, true },
+  { 89985, true },
+  { 89998, true },
+  { 90014, true },
+  { 90029, true },
+  { 90037, true },
+  { 90050, true },
+  { 90064, true },
+  { 90078, true },
+  { 90089, true },
+  { 90099, true },
+  { 90117, true },
+  { 90135, true },
+  { 90148, true },
+  { 90156, true },
+  { 90168, true },
+  { 90179, true },
   { 90191, true },
-  { 90207, true },
-  { 90216, true },
-  { 90228, true },
+  { 90201, true },
+  { 90209, true },
+  { 90225, true },
   { 90241, true },
-  { 90255, true },
-  { 90274, true },
-  { 90288, true },
-  { 90301, true },
-  { 90317, false },
-  { 90334, true },
-  { 90355, true },
-  { 90374, true },
-  { 90393, true },
-  { 90412, false },
-  { 90428, true },
-  { 90443, true },
-  { 90453, true },
-  { 90463, true },
-  { 90472, true },
-  { 90485, true },
-  { 90495, false },
-  { 90513, true },
-  { 90535, true },
-  { 90552, true },
-  { 90568, false },
+  { 90250, true },
+  { 90262, true },
+  { 90275, true },
+  { 90289, true },
+  { 90308, true },
+  { 90322, true },
+  { 90335, true },
+  { 90351, false },
+  { 90368, true },
+  { 90389, true },
+  { 90408, true },
+  { 90427, true },
+  { 90446, false },
+  { 90462, true },
+  { 90477, true },
+  { 90487, true },
+  { 90497, true },
+  { 90506, true },
+  { 90519, true },
+  { 90529, false },
+  { 90547, true },
+  { 90569, true },
   { 90586, true },
-  { 90597, true },
-  { 90613, true },
+  { 90602, false },
+  { 90620, true },
   { 90631, true },
-  { 90646, true },
-  { 90660, true },
-  { 90677, true },
-  { 90695, true },
-  { 90714, true },
-  { 90725, true },
-  { 90741, true },
-  { 90758, true },
-  { 90774, true },
+  { 90647, true },
+  { 90665, true },
+  { 90680, true },
+  { 90694, true },
+  { 90711, true },
+  { 90729, true },
+  { 90748, true },
+  { 90759, true },
+  { 90775, true },
   { 90792, true },
-  { 90809, true },
-  { 90831, true },
-  { 90848, true },
-  { 90864, true },
-  { 90878, true },
-  { 90890, true },
-  { 90905, true },
-  { 90917, true },
-  { 90925, true },
-  { 90938, true },
-  { 90953, true },
-  { 90968, true },
-  { 90978, true },
+  { 90808, true },
+  { 90826, true },
+  { 90843, true },
+  { 90865, true },
+  { 90882, true },
+  { 90898, true },
+  { 90912, true },
+  { 90924, true },
+  { 90939, true },
+  { 90951, true },
+  { 90959, true },
+  { 90972, true },
   { 90987, true },
-  { 90997, true },
-  { 91007, true },
-  { 91017, true },
-  { 91031, false },
-  { 91044, true },
-  { 91052, true },
-  { 91061, true },
-  { 91070, true },
-  { 91080, true },
-  { 91089, true },
-  { 91109, false },
-  { 91119, true },
-  { 91135, true },
-  { 91148, true },
-  { 91161, true },
-  { 91168, true },
-  { 91184, true },
-  { 91197, true },
-  { 91210, true },
-  { 91223, true },
-  { 91238, true },
-  { 91250, true },
+  { 91002, true },
+  { 91012, true },
+  { 91021, true },
+  { 91031, true },
+  { 91041, true },
+  { 91051, true },
+  { 91065, false },
+  { 91078, true },
+  { 91086, true },
+  { 91095, true },
+  { 91104, true },
+  { 91114, true },
+  { 91123, true },
+  { 91143, false },
+  { 91153, true },
+  { 91169, true },
+  { 91182, true },
+  { 91195, true },
+  { 91202, true },
+  { 91218, true },
+  { 91231, true },
+  { 91244, true },
   { 91257, true },
-  { 91264, true },
-  { 91273, true },
-  { 91282, true },
+  { 91272, true },
+  { 91284, true },
   { 91291, true },
-  { 91302, true },
+  { 91298, true },
+  { 91307, true },
   { 91316, true },
-  { 91329, true },
-  { 91337, true },
-  { 91349, true },
+  { 91325, true },
+  { 91336, true },
+  { 91350, true },
   { 91363, true },
-  { 91374, true },
-  { 91390, true },
-  { 91404, true },
-  { 91419, true },
-  { 91429, false },
-  { 91443, true },
+  { 91371, true },
+  { 91383, true },
+  { 91397, true },
+  { 91408, true },
+  { 91424, true },
+  { 91438, true },
   { 91453, true },
-  { 91468, false },
-  { 91484, true },
-  { 91503, true },
-  { 91515, true },
-  { 91528, true },
-  { 91547, true },
-  { 91571, true },
-  { 91584, true },
-  { 91600, true },
-  { 91614, true },
-  { 91631, true },
+  { 91463, false },
+  { 91477, true },
+  { 91487, true },
+  { 91502, false },
+  { 91518, true },
+  { 91537, true },
+  { 91549, true },
+  { 91562, true },
+  { 91581, true },
+  { 91605, true },
+  { 91618, true },
+  { 91634, true },
   { 91648, true },
-  { 91658, true },
-  { 91673, true },
-  { 91687, true },
-  { 91700, true },
-  { 91715, true },
-  { 91731, true },
-  { 91745, true },
-  { 91760, true },
-  { 91774, true },
-  { 91789, true },
+  { 91665, true },
+  { 91682, true },
+  { 91692, true },
+  { 91707, true },
+  { 91721, true },
+  { 91734, true },
+  { 91749, true },
+  { 91765, true },
+  { 91779, true },
+  { 91794, true },
   { 91808, true },
   { 91823, true },
-  { 91838, true },
-  { 91856, true },
-  { 91875, true },
-  { 91888, true },
-  { 91901, true },
-  { 91924, true },
-  { 91940, true },
-  { 91953, true },
-  { 91968, true },
-  { 91983, true },
-  { 91999, true },
-  { 92014, true },
-  { 92030, true },
-  { 92047, true },
+  { 91842, true },
+  { 91857, true },
+  { 91872, true },
+  { 91890, true },
+  { 91909, true },
+  { 91922, true },
+  { 91935, true },
+  { 91958, true },
+  { 91974, true },
+  { 91985, true },
+  { 91998, true },
+  { 92013, true },
+  { 92028, true },
+  { 92044, true },
   { 92059, true },
-  { 92069, true },
-  { 92087, true },
-  { 92097, true },
-  { 92108, true },
-  { 92118, true },
-  { 92131, true },
-  { 92159, true },
-  { 92170, true },
-  { 92181, true },
-  { 92192, true },
-  { 92209, true },
-  { 92223, false },
-  { 92240, true },
+  { 92075, true },
+  { 92092, true },
+  { 92104, true },
+  { 92114, true },
+  { 92132, true },
+  { 92142, true },
+  { 92153, true },
+  { 92163, true },
+  { 92176, true },
+  { 92204, true },
+  { 92215, true },
+  { 92226, true },
+  { 92237, true },
   { 92254, true },
-  { 92263, true },
-  { 92280, true },
-  { 92297, true },
-  { 92309, true },
-  { 92323, true },
-  { 92335, true },
-  { 92351, true },
-  { 92377, true },
-  { 92387, true },
-  { 92400, true },
-  { 92410, true },
-  { 92423, true },
-  { 92431, true },
-  { 92442, true },
-  { 92457, true },
-  { 92475, true },
-  { 92491, true },
-  { 92499, true },
-  { 92513, true },
-  { 92530, true },
-  { 92550, true },
-  { 92560, true },
-  { 92576, true },
-  { 92589, true },
-  { 92599, false },
-  { 92613, true },
-  { 92624, true },
-  { 92640, true },
-  { 92648, true },
-  { 92663, true },
-  { 92679, true },
-  { 92698, true },
-  { 92711, true },
-  { 92731, true },
-  { 92746, true },
-  { 92764, true },
-  { 92777, true },
-  { 92787, true },
-  { 92804, true },
+  { 92268, false },
+  { 92285, true },
+  { 92299, true },
+  { 92308, true },
+  { 92325, true },
+  { 92342, true },
+  { 92354, true },
+  { 92368, true },
+  { 92380, true },
+  { 92396, true },
+  { 92422, true },
+  { 92432, true },
+  { 92445, true },
+  { 92455, true },
+  { 92468, true },
+  { 92476, true },
+  { 92487, true },
+  { 92502, true },
+  { 92520, true },
+  { 92536, true },
+  { 92544, true },
+  { 92558, true },
+  { 92575, true },
+  { 92595, true },
+  { 92605, true },
+  { 92621, true },
+  { 92634, true },
+  { 92644, false },
+  { 92658, true },
+  { 92669, true },
+  { 92685, true },
+  { 92693, true },
+  { 92708, true },
+  { 92724, true },
+  { 92743, true },
+  { 92756, true },
+  { 92776, true },
+  { 92791, true },
+  { 92809, true },
   { 92819, true },
-  { 92830, true },
-  { 92841, true },
-  { 92854, true },
+  { 92836, true },
+  { 92851, true },
   { 92862, true },
-  { 92871, true },
-  { 92882, true },
-  { 92896, true },
-  { 92919, true },
-  { 92932, true },
-  { 92943, true },
-  { 92957, true },
-  { 92985, true },
-  { 93000, true },
-  { 93024, true },
-  { 93039, true },
-  { 93059, true },
-  { 93072, true },
-  { 93088, true },
-  { 93103, true },
-  { 93116, true },
-  { 93130, true },
-  { 93141, true },
-  { 93152, true },
-  { 93166, true },
-  { 93178, true },
-  { 93195, true },
-  { 93208, true },
-  { 93223, true },
-  { 93231, true },
-  { 93251, true },
-  { 93262, true },
-  { 93272, true },
-  { 93282, true },
-  { 93293, true },
-  { 93303, true },
-  { 93315, true },
-  { 93330, true },
-  { 93339, true },
-  { 93353, true },
-  { 93366, true },
-  { 93381, true },
-  { 93395, true },
-  { 93406, true },
-  { 93421, false },
-  { 93431, true },
-  { 93450, true },
-  { 93463, true },
-  { 93472, true },
-  { 93483, true },
-  { 93497, true },
-  { 93517, true },
-  { 93533, true },
-  { 93544, true },
-  { 93560, true },
-  { 93577, true },
-  { 93592, true },
-  { 93605, true },
-  { 93622, true },
-  { 93632, true },
-  { 93642, true },
-  { 93650, true },
-  { 93661, true },
-  { 93671, true },
+  { 92873, true },
+  { 92886, true },
+  { 92894, true },
+  { 92903, true },
+  { 92914, true },
+  { 92928, true },
+  { 92951, true },
+  { 92964, true },
+  { 92975, true },
+  { 92989, true },
+  { 93017, true },
+  { 93032, true },
+  { 93056, true },
+  { 93071, true },
+  { 93091, true },
+  { 93104, true },
+  { 93120, true },
+  { 93135, true },
+  { 93148, true },
+  { 93162, true },
+  { 93173, true },
+  { 93184, true },
+  { 93198, true },
+  { 93210, true },
+  { 93227, true },
+  { 93240, true },
+  { 93255, true },
+  { 93263, true },
+  { 93283, true },
+  { 93294, true },
+  { 93304, true },
+  { 93314, true },
+  { 93325, true },
+  { 93335, true },
+  { 93347, true },
+  { 93362, true },
+  { 93371, true },
+  { 93385, true },
+  { 93398, true },
+  { 93408, true },
+  { 93423, true },
+  { 93437, true },
+  { 93448, true },
+  { 93463, false },
+  { 93473, true },
+  { 93492, true },
+  { 93505, true },
+  { 93514, true },
+  { 93525, true },
+  { 93539, true },
+  { 93559, true },
+  { 93575, true },
+  { 93586, true },
+  { 93602, true },
+  { 93619, true },
+  { 93634, true },
+  { 93647, true },
+  { 93664, true },
+  { 93674, true },
   { 93684, true },
-  { 93698, true },
-  { 93710, true },
-  { 93720, true },
-  { 93728, true },
-  { 93747, true },
-  { 93767, true },
-  { 93776, true },
-  { 93790, true },
-  { 93804, true },
+  { 93692, true },
+  { 93703, true },
+  { 93713, true },
+  { 93726, true },
+  { 93740, true },
+  { 93752, true },
+  { 93762, true },
+  { 93770, true },
+  { 93789, true },
+  { 93809, true },
   { 93818, true },
+  { 93832, true },
+  { 93846, true },
   { 93860, true },
-  { 93876, true },
-  { 93885, true },
-  { 93897, true },
-  { 93909, true },
-  { 93922, true },
-  { 93935, true },
-  { 93953, true },
-  { 93961, true },
-  { 93974, true },
-  { 93984, true },
-  { 93996, true },
-  { 94007, true },
-  { 94024, true },
-  { 94039, true },
-  { 94051, true },
-  { 94064, true },
-  { 94076, true },
-  { 94091, true },
-  { 94104, true },
-  { 94116, true },
-  { 94126, true },
-  { 94144, true },
-  { 94159, true },
-  { 94173, true },
-  { 94191, true },
-  { 94209, true },
-  { 94221, true },
-  { 94239, true },
-  { 94250, true },
-  { 94264, true },
-  { 94284, true },
-  { 94297, true },
-  { 94309, true },
-  { 94329, true },
-  { 94340, true },
-  { 94349, true },
-  { 94358, true },
-  { 94365, true },
-  { 94380, true },
-  { 94395, true },
-  { 94409, true },
-  { 94428, true },
-  { 94439, true },
-  { 94453, true },
-  { 94465, true },
-  { 94478, true },
-  { 94491, true },
-  { 94502, true },
-  { 94515, true },
-  { 94527, true },
-  { 94550, true },
-  { 94559, true },
-  { 94576, true },
-  { 94589, true },
+  { 93902, true },
+  { 93918, true },
+  { 93927, true },
+  { 93939, true },
+  { 93951, true },
+  { 93964, true },
+  { 93977, true },
+  { 93995, true },
+  { 94003, true },
+  { 94016, true },
+  { 94026, true },
+  { 94038, true },
+  { 94049, true },
+  { 94066, true },
+  { 94081, true },
+  { 94093, true },
+  { 94106, true },
+  { 94118, true },
+  { 94133, true },
+  { 94146, true },
+  { 94158, true },
+  { 94168, true },
+  { 94186, true },
+  { 94201, true },
+  { 94215, true },
+  { 94233, true },
+  { 94251, true },
+  { 94263, true },
+  { 94281, true },
+  { 94292, true },
+  { 94306, true },
+  { 94326, true },
+  { 94339, true },
+  { 94351, true },
+  { 94371, true },
+  { 94382, true },
+  { 94391, true },
+  { 94400, true },
+  { 94407, true },
+  { 94422, true },
+  { 94437, true },
+  { 94451, true },
+  { 94470, true },
+  { 94481, true },
+  { 94495, true },
+  { 94507, true },
+  { 94520, true },
+  { 94533, true },
+  { 94544, true },
+  { 94557, true },
+  { 94569, true },
+  { 94592, true },
   { 94601, true },
-  { 94612, true },
-  { 94627, true },
-  { 94641, true },
-  { 94649, true },
-  { 94663, true },
-  { 94677, true },
-  { 94685, true },
-  { 94698, true },
-  { 94709, true },
-  { 94721, false },
-  { 94734, true },
-  { 94745, true },
-  { 94769, true },
-  { 94783, true },
-  { 94791, true },
-  { 94801, true },
+  { 94618, true },
+  { 94631, true },
+  { 94643, true },
+  { 94654, true },
+  { 94669, true },
+  { 94683, true },
+  { 94691, true },
+  { 94705, true },
+  { 94719, true },
+  { 94727, true },
+  { 94740, true },
+  { 94751, true },
+  { 94763, false },
+  { 94776, true },
+  { 94787, true },
   { 94811, true },
-  { 94828, true },
-  { 94846, true },
-  { 94864, true },
-  { 94878, true },
+  { 94825, true },
+  { 94833, true },
+  { 94843, true },
+  { 94853, true },
+  { 94870, true },
   { 94888, true },
-  { 94912, true },
-  { 94926, true },
-  { 94945, true },
-  { 94957, true },
-  { 94976, true },
-  { 94993, true },
-  { 95003, true },
+  { 94906, true },
+  { 94920, true },
+  { 94930, true },
+  { 94954, true },
+  { 94968, true },
+  { 94987, true },
+  { 94999, true },
   { 95018, true },
-  { 95030, true },
-  { 95042, true },
-  { 95055, true },
-  { 95064, true },
-  { 95073, true },
-  { 95092, true },
-  { 95104, true },
-  { 95132, true },
-  { 95159, true },
-  { 95185, true },
-  { 95210, true },
-  { 95220, true },
-  { 95229, true },
-  { 95244, true },
-  { 95259, true },
-  { 95277, true },
-  { 95288, true },
-  { 95300, true },
-  { 95316, true },
+  { 95035, true },
+  { 95045, true },
+  { 95060, true },
+  { 95072, true },
+  { 95084, true },
+  { 95097, true },
+  { 95106, true },
+  { 95115, true },
+  { 95134, true },
+  { 95146, true },
+  { 95174, true },
+  { 95201, true },
+  { 95227, true },
+  { 95252, true },
+  { 95262, true },
+  { 95271, true },
+  { 95286, true },
+  { 95301, true },
+  { 95319, true },
   { 95330, true },
-  { 95345, true },
-  { 95361, true },
+  { 95342, true },
+  { 95358, true },
+  { 95372, true },
   { 95387, true },
-  { 95398, true },
-  { 95413, true },
-  { 95428, true },
-  { 95443, true },
-  { 95461, true },
-  { 95476, true },
-  { 95489, true },
-  { 95505, true },
-  { 95528, true },
-  { 95541, true },
-  { 95554, true },
-  { 95567, true },
-  { 95586, true },
-  { 95601, true },
-  { 95615, true },
-  { 95627, false },
-  { 95646, true },
-  { 95661, true },
-  { 95679, true },
-  { 95690, true },
-  { 95702, true },
-  { 95713, true },
-  { 95726, true },
-  { 95749, true },
-  { 95764, true },
-  { 95778, true },
-  { 95795, true },
+  { 95403, true },
+  { 95429, true },
+  { 95440, true },
+  { 95455, true },
+  { 95470, true },
+  { 95485, true },
+  { 95503, true },
+  { 95518, true },
+  { 95531, true },
+  { 95547, true },
+  { 95570, true },
+  { 95583, true },
+  { 95596, true },
+  { 95609, true },
+  { 95628, true },
+  { 95643, true },
+  { 95657, true },
+  { 95669, false },
+  { 95688, true },
+  { 95703, true },
+  { 95721, true },
+  { 95732, true },
+  { 95744, true },
+  { 95755, true },
+  { 95768, true },
+  { 95791, true },
   { 95806, true },
-  { 95822, true },
-  { 95835, true },
-  { 95845, true },
-  { 95856, true },
+  { 95820, true },
+  { 95837, true },
+  { 95848, true },
   { 95864, true },
-  { 95874, true },
-  { 95891, true },
+  { 95877, true },
+  { 95887, true },
+  { 95898, true },
   { 95906, true },
   { 95916, true },
-  { 95926, true },
-  { 95937, true },
+  { 95933, true },
   { 95948, true },
+  { 95958, true },
   { 95968, true },
-  { 95983, true },
-  { 96000, true },
-  { 96014, true },
-  { 96024, true },
-  { 96035, true },
-  { 96054, true },
-  { 96065, true },
-  { 96087, true },
-  { 96101, true },
-  { 96112, false },
-  { 96125, true },
-  { 96135, true },
-  { 96153, true },
-  { 96170, true },
+  { 95979, true },
+  { 95990, true },
+  { 96010, true },
+  { 96025, true },
+  { 96042, true },
+  { 96056, true },
+  { 96066, true },
+  { 96085, true },
+  { 96096, true },
+  { 96118, true },
+  { 96132, true },
+  { 96143, false },
+  { 96156, true },
+  { 96166, true },
   { 96184, true },
-  { 96196, true },
-  { 96212, true },
-  { 96223, true },
-  { 96233, true },
-  { 96253, true },
-  { 96280, true },
-  { 96296, true },
+  { 96201, true },
+  { 96215, true },
+  { 96227, true },
+  { 96243, true },
+  { 96254, true },
+  { 96264, true },
+  { 96284, true },
   { 96311, true },
-  { 96324, true },
-  { 96336, true },
-  { 96352, true },
-  { 96364, true },
-  { 96381, true },
-  { 96391, true },
-  { 96402, true },
-  { 96419, true },
-  { 96436, true },
-  { 96448, true },
-  { 96461, false },
-  { 96475, true },
-  { 96498, true },
-  { 96512, true },
-  { 96524, true },
-  { 96535, true },
-  { 96547, true },
-  { 96565, true },
+  { 96327, true },
+  { 96342, true },
+  { 96355, true },
+  { 96367, true },
+  { 96383, true },
+  { 96395, true },
+  { 96412, true },
+  { 96422, true },
+  { 96433, true },
+  { 96450, true },
+  { 96467, true },
+  { 96479, true },
+  { 96492, false },
+  { 96506, true },
+  { 96529, true },
+  { 96543, true },
+  { 96555, true },
+  { 96566, true },
   { 96578, true },
-  { 96593, true },
-  { 96611, true },
-  { 96621, true },
-  { 96633, true },
+  { 96596, true },
+  { 96609, true },
+  { 96624, true },
   { 96642, true },
-  { 96654, true },
-  { 96668, true },
-  { 96689, true },
-  { 96703, true },
-  { 96717, true },
-  { 96735, true },
-  { 96753, true },
-  { 96765, true },
-  { 96777, true },
-  { 96785, true },
-  { 96799, true },
-  { 96814, true },
-  { 96829, true },
-  { 96843, true },
-  { 96852, true },
+  { 96652, true },
+  { 96661, true },
+  { 96673, true },
+  { 96687, true },
+  { 96708, true },
+  { 96722, true },
+  { 96736, true },
+  { 96754, true },
+  { 96772, true },
+  { 96784, true },
+  { 96796, true },
+  { 96804, true },
+  { 96818, true },
+  { 96833, true },
+  { 96848, true },
   { 96862, true },
-  { 96874, true },
-  { 96889, true },
-  { 96901, true },
-  { 96924, true },
-  { 96932, true },
-  { 96943, true },
-  { 96952, true },
-  { 96960, true },
-  { 96973, true },
-  { 96996, true },
-  { 97008, true },
-  { 97024, true },
-  { 97047, true },
-  { 97058, true },
-  { 97074, true },
-  { 97089, true },
-  { 97102, true },
+  { 96871, true },
+  { 96881, true },
+  { 96893, true },
+  { 96908, true },
+  { 96931, true },
+  { 96939, true },
+  { 96950, true },
+  { 96959, true },
+  { 96967, true },
+  { 96980, true },
+  { 97003, true },
+  { 97015, true },
+  { 97031, true },
+  { 97054, true },
+  { 97065, true },
+  { 97081, true },
+  { 97097, true },
   { 97112, true },
-  { 97119, true },
-  { 97132, true },
+  { 97125, true },
+  { 97135, true },
+  { 97142, true },
   { 97155, true },
-  { 97172, true },
-  { 97190, true },
-  { 97219, true },
-  { 97236, true },
-  { 97246, true },
-  { 97260, true },
-  { 97272, true },
-  { 97281, true },
-  { 97297, true },
-  { 97312, true },
-  { 97325, true },
-  { 97343, true },
-  { 97361, true },
-  { 97371, true },
-  { 97379, true },
-  { 97389, true },
-  { 97399, true },
-  { 97407, true },
-  { 97419, true },
-  { 97433, true },
-  { 97451, true },
-  { 97460, true },
-  { 97471, true },
-  { 97486, true },
+  { 97178, true },
+  { 97195, true },
+  { 97213, true },
+  { 97242, true },
+  { 97259, true },
+  { 97269, true },
+  { 97283, true },
+  { 97295, true },
+  { 97304, true },
+  { 97320, true },
+  { 97335, true },
+  { 97348, true },
+  { 97366, true },
+  { 97384, true },
+  { 97394, true },
+  { 97402, true },
+  { 97412, true },
+  { 97422, true },
+  { 97430, true },
+  { 97442, true },
+  { 97456, true },
+  { 97474, true },
+  { 97483, true },
+  { 97494, true },
   { 97509, true },
-  { 97517, true },
   { 97532, true },
-  { 97550, true },
-  { 97562, true },
-  { 97572, true },
-  { 97583, true },
+  { 97540, true },
+  { 97555, true },
+  { 97573, true },
+  { 97585, true },
   { 97595, true },
-  { 97606, false },
-  { 97622, false },
-  { 97643, true },
-  { 97660, true },
-  { 97678, true },
-  { 97695, true },
-  { 97712, true },
-  { 97726, true },
-  { 97734, true },
-  { 97747, true },
-  { 97765, true },
-  { 97792, true },
-  { 97816, true },
-  { 97833, true },
-  { 97848, true },
-  { 97864, true },
-  { 97878, true },
-  { 97890, true },
+  { 97606, true },
+  { 97618, true },
+  { 97629, false },
+  { 97645, false },
+  { 97666, true },
+  { 97683, true },
+  { 97701, true },
+  { 97718, true },
+  { 97735, true },
+  { 97749, true },
+  { 97757, true },
+  { 97770, true },
+  { 97788, true },
+  { 97815, true },
+  { 97839, true },
+  { 97856, true },
+  { 97871, true },
+  { 97887, true },
   { 97901, true },
-  { 97912, true },
-  { 97922, true },
-  { 97933, false },
-  { 97954, true },
-  { 97965, true },
-  { 97979, true },
-  { 97991, true },
-  { 98005, true },
-  { 98023, true },
-  { 98037, true },
-  { 98048, true },
-  { 98065, true },
-  { 98076, true },
-  { 98086, true },
-  { 98106, true },
-  { 98117, true },
-  { 98131, true },
-  { 98145, true },
-  { 98158, true },
-  { 98169, true },
-  { 98188, true },
-  { 98201, true },
-  { 98215, true },
-  { 98223, true },
-  { 98237, true },
-  { 98250, true },
-  { 98262, true },
-  { 98275, true },
-  { 98287, true },
-  { 98299, true },
-  { 98314, true },
-  { 98324, true },
-  { 98339, true },
-  { 98353, true },
-  { 98366, true },
-  { 98376, false },
-  { 98387, true },
-  { 98397, true },
-  { 98408, true },
-  { 98419, true },
-  { 98430, true },
-  { 98443, true },
-  { 98455, true },
-  { 98467, true },
-  { 98477, true },
-  { 98485, true },
-  { 98507, true },
-  { 98519, true },
-  { 98528, true },
-  { 98537, true },
-  { 98549, true },
-  { 98561, true },
-  { 98571, true },
-  { 98582, true },
-  { 98592, true },
-  { 98605, false },
-  { 98616, true },
-  { 98629, true },
-  { 98654, true },
-  { 98666, true },
-  { 98676, true },
-  { 98685, true },
-  { 98702, true },
-  { 98720, true },
-  { 98732, true },
-  { 98740, true },
-  { 98759, true },
-  { 98772, true },
-  { 98786, true },
-  { 98796, true },
-  { 98808, true },
-  { 98832, true },
-  { 98846, true },
-  { 98864, true },
-  { 98882, true },
-  { 98896, true },
-  { 98914, true },
-  { 98933, true },
-  { 98943, true },
-  { 98957, true },
-  { 98970, true },
+  { 97913, true },
+  { 97924, true },
+  { 97935, true },
+  { 97945, true },
+  { 97956, false },
+  { 97977, true },
+  { 97988, true },
+  { 98002, true },
+  { 98014, true },
+  { 98028, true },
+  { 98046, true },
+  { 98060, true },
+  { 98071, true },
+  { 98088, true },
+  { 98099, true },
+  { 98109, true },
+  { 98129, true },
+  { 98140, true },
+  { 98154, true },
+  { 98168, true },
+  { 98181, true },
+  { 98192, true },
+  { 98211, true },
+  { 98224, true },
+  { 98238, true },
+  { 98246, true },
+  { 98260, true },
+  { 98273, true },
+  { 98285, true },
+  { 98298, true },
+  { 98310, true },
+  { 98322, true },
+  { 98337, true },
+  { 98347, true },
+  { 98362, true },
+  { 98376, true },
+  { 98389, true },
+  { 98399, false },
+  { 98410, true },
+  { 98420, true },
+  { 98431, true },
+  { 98442, true },
+  { 98453, true },
+  { 98466, true },
+  { 98478, true },
+  { 98490, true },
+  { 98500, true },
+  { 98508, true },
+  { 98530, true },
+  { 98542, true },
+  { 98551, true },
+  { 98560, true },
+  { 98572, true },
+  { 98584, true },
+  { 98594, true },
+  { 98605, true },
+  { 98615, true },
+  { 98628, false },
+  { 98639, true },
+  { 98652, true },
+  { 98677, true },
+  { 98689, true },
+  { 98699, true },
+  { 98708, true },
+  { 98725, true },
+  { 98743, true },
+  { 98755, true },
+  { 98763, true },
+  { 98782, true },
+  { 98795, true },
+  { 98809, true },
+  { 98819, true },
+  { 98831, true },
+  { 98855, true },
+  { 98869, true },
+  { 98887, true },
+  { 98905, true },
+  { 98919, true },
+  { 98937, true },
+  { 98956, true },
+  { 98966, true },
   { 98980, true },
   { 98993, true },
-  { 99002, true },
-  { 99013, true },
+  { 99003, true },
+  { 99016, true },
   { 99025, true },
-  { 99038, true },
+  { 99036, true },
   { 99048, true },
-  { 99056, true },
-  { 99068, true },
-  { 99080, true },
-  { 99095, true },
+  { 99061, true },
+  { 99071, true },
+  { 99079, true },
+  { 99091, true },
   { 99103, true },
-  { 99115, true },
-  { 99130, true },
-  { 99139, true },
-  { 99152, true },
-  { 99158, true },
-  { 99170, true },
-  { 99180, true },
-  { 99189, false },
-  { 99204, true },
-  { 99222, true },
-  { 99235, true },
-  { 99249, true },
-  { 99261, true },
-  { 99275, true },
-  { 99288, true },
-  { 99299, true },
-  { 99308, true },
-  { 99318, true },
+  { 99118, true },
+  { 99126, true },
+  { 99138, true },
+  { 99153, true },
+  { 99162, true },
+  { 99175, true },
+  { 99181, true },
+  { 99193, true },
+  { 99203, true },
+  { 99212, false },
+  { 99227, true },
+  { 99245, true },
+  { 99258, true },
+  { 99272, true },
+  { 99284, true },
+  { 99298, true },
+  { 99311, true },
+  { 99322, true },
   { 99331, true },
-  { 99339, true },
-  { 99352, true },
-  { 99364, true },
-  { 99377, true },
-  { 99397, true },
-  { 99416, true },
-  { 99433, true },
-  { 99445, true },
-  { 99460, true },
-  { 99473, true },
-  { 99485, true },
-  { 99504, true },
-  { 99521, true },
-  { 99540, true },
-  { 99556, true },
-  { 99567, true },
-  { 99582, true },
-  { 99592, true },
-  { 99606, true },
-  { 99617, true },
-  { 99636, true },
-  { 99645, false },
-  { 99656, true },
-  { 99664, true },
-  { 99672, true },
-  { 99680, true },
-  { 99696, true },
-  { 99704, true },
-  { 99715, true },
-  { 99727, true },
-  { 99739, true },
-  { 99753, true },
-  { 99767, true },
-  { 99778, true },
-  { 99787, true },
-  { 99803, true },
-  { 99825, true },
-  { 99837, true },
-  { 99844, true },
-  { 99856, true },
-  { 99866, true },
-  { 99876, true },
-  { 99888, true },
-  { 99906, true },
-  { 99916, true },
-  { 99939, true },
-  { 99994, true },
-  { 100009, true },
-  { 100019, true },
-  { 100037, true },
-  { 100052, true },
-  { 100065, false },
-  { 100079, true },
-  { 100093, false },
-  { 100109, true },
-  { 100134, true },
-  { 100153, true },
-  { 100163, true },
-  { 100174, true },
-  { 100186, true },
-  { 100208, true },
-  { 100231, true },
-  { 100241, true },
-  { 100251, false },
-  { 100265, true },
-  { 100283, true },
-  { 100294, true },
-  { 100305, true },
-  { 100324, true },
-  { 100340, true },
-  { 100353, true },
-  { 100367, true },
-  { 100380, true },
-  { 100409, true },
-  { 100422, true },
-  { 100432, true },
-  { 100444, true },
-  { 100456, true },
-  { 100475, true },
-  { 100485, true },
-  { 100499, true },
-  { 100509, true },
-  { 100526, true },
-  { 100537, true },
-  { 100553, true },
-  { 100572, true },
-  { 100587, true },
-  { 100599, true },
-  { 100608, true },
-  { 100628, true },
-  { 100644, true },
-  { 100658, true },
-  { 100671, true },
-  { 100686, true },
-  { 100698, true },
-  { 100708, true },
-  { 100722, true },
-  { 100737, true },
-  { 100749, true },
-  { 100767, true },
-  { 100777, true },
-  { 100789, true },
-  { 100803, true },
-  { 100815, true },
-  { 100827, true },
-  { 100848, true },
-  { 100864, true },
-  { 100877, true },
-  { 100894, true },
-  { 100909, true },
-  { 100922, true },
-  { 100935, true },
-  { 100949, true },
-  { 100964, true },
-  { 100977, true },
-  { 100996, true },
-  { 101019, false },
-  { 101032, false },
-  { 101050, true },
-  { 101070, true },
-  { 101083, true },
-  { 101098, true },
-  { 101113, true },
-  { 101128, true },
-  { 101142, true },
-  { 101157, true },
-  { 101170, true },
-  { 101195, true },
-  { 101217, true },
-  { 101228, true },
-  { 101244, true },
-  { 101258, true },
-  { 101285, true },
-  { 101310, true },
-  { 101324, true },
-  { 101338, true },
-  { 101352, true },
-  { 101363, true },
-  { 101387, true },
-  { 101398, true },
-  { 101410, true },
-  { 101438, true },
-  { 101448, true },
-  { 101458, true },
-  { 101468, true },
-  { 101485, true },
-  { 101502, true },
-  { 101512, true },
-  { 101535, true },
-  { 101545, true },
-  { 101554, true },
-  { 101576, true },
-  { 101588, true },
-  { 101600, true },
-  { 101612, true },
-  { 101623, true },
-  { 101641, true },
-  { 101656, true },
-  { 101666, true },
-  { 101675, true },
-  { 101693, false },
-  { 101704, true },
-  { 101715, true },
+  { 99341, true },
+  { 99354, true },
+  { 99362, true },
+  { 99375, true },
+  { 99387, true },
+  { 99400, true },
+  { 99420, true },
+  { 99439, true },
+  { 99456, true },
+  { 99468, true },
+  { 99483, true },
+  { 99496, true },
+  { 99508, true },
+  { 99527, true },
+  { 99546, true },
+  { 99562, true },
+  { 99573, true },
+  { 99588, true },
+  { 99598, true },
+  { 99612, true },
+  { 99623, true },
+  { 99642, true },
+  { 99651, false },
+  { 99662, true },
+  { 99670, true },
+  { 99678, true },
+  { 99686, true },
+  { 99702, true },
+  { 99710, true },
+  { 99721, true },
+  { 99733, true },
+  { 99745, true },
+  { 99759, true },
+  { 99773, true },
+  { 99784, true },
+  { 99793, true },
+  { 99809, true },
+  { 99831, true },
+  { 99843, true },
+  { 99850, true },
+  { 99862, true },
+  { 99872, true },
+  { 99882, true },
+  { 99894, true },
+  { 99912, true },
+  { 99922, true },
+  { 99945, true },
+  { 100000, true },
+  { 100015, true },
+  { 100025, true },
+  { 100043, true },
+  { 100058, true },
+  { 100071, false },
+  { 100085, false },
+  { 100101, true },
+  { 100126, true },
+  { 100145, true },
+  { 100155, true },
+  { 100166, true },
+  { 100178, true },
+  { 100200, true },
+  { 100223, true },
+  { 100233, true },
+  { 100243, false },
+  { 100257, true },
+  { 100275, true },
+  { 100286, true },
+  { 100297, true },
+  { 100316, true },
+  { 100332, true },
+  { 100345, true },
+  { 100359, true },
+  { 100372, true },
+  { 100401, true },
+  { 100414, true },
+  { 100424, true },
+  { 100436, true },
+  { 100448, true },
+  { 100467, true },
+  { 100477, true },
+  { 100491, true },
+  { 100501, true },
+  { 100518, true },
+  { 100529, true },
+  { 100545, true },
+  { 100564, true },
+  { 100579, true },
+  { 100591, true },
+  { 100600, true },
+  { 100620, true },
+  { 100636, true },
+  { 100650, true },
+  { 100663, true },
+  { 100678, true },
+  { 100690, true },
+  { 100700, true },
+  { 100714, true },
+  { 100729, true },
+  { 100741, true },
+  { 100759, true },
+  { 100769, true },
+  { 100781, true },
+  { 100795, true },
+  { 100807, true },
+  { 100819, true },
+  { 100840, true },
+  { 100856, true },
+  { 100869, true },
+  { 100886, true },
+  { 100901, true },
+  { 100914, true },
+  { 100927, true },
+  { 100941, true },
+  { 100956, true },
+  { 100969, true },
+  { 100988, true },
+  { 101011, false },
+  { 101024, false },
+  { 101042, true },
+  { 101062, true },
+  { 101075, true },
+  { 101090, true },
+  { 101105, true },
+  { 101120, true },
+  { 101134, true },
+  { 101149, true },
+  { 101162, true },
+  { 101187, true },
+  { 101209, true },
+  { 101220, true },
+  { 101236, true },
+  { 101250, true },
+  { 101277, true },
+  { 101302, true },
+  { 101316, true },
+  { 101330, true },
+  { 101344, true },
+  { 101355, true },
+  { 101379, true },
+  { 101390, true },
+  { 101402, true },
+  { 101430, true },
+  { 101440, true },
+  { 101450, true },
+  { 101460, true },
+  { 101477, true },
+  { 101494, true },
+  { 101504, true },
+  { 101527, true },
+  { 101537, true },
+  { 101546, true },
+  { 101568, true },
+  { 101580, true },
+  { 101592, true },
+  { 101604, true },
+  { 101615, true },
+  { 101633, true },
+  { 101648, true },
+  { 101658, true },
+  { 101667, true },
+  { 101685, false },
+  { 101696, true },
+  { 101707, true },
+  { 101717, true },
   { 101725, true },
-  { 101733, true },
-  { 101747, true },
-  { 101759, true },
-  { 101771, true },
-  { 101789, true },
-  { 101809, true },
-  { 101824, true },
-  { 101840, true },
-  { 101853, true },
-  { 101864, true },
-  { 101879, true },
-  { 101894, true },
-  { 101910, true },
-  { 101923, true },
-  { 101948, true },
-  { 101964, true },
-  { 101984, true },
-  { 101999, true },
-  { 102010, true },
-  { 102021, true },
-  { 102037, true },
-  { 102049, true },
-  { 102066, true },
-  { 102077, true },
-  { 102085, true },
-  { 102097, true },
-  { 102109, true },
-  { 102123, true },
-  { 102140, true },
-  { 102156, true },
-  { 102172, true },
-  { 102191, true },
-  { 102206, true },
-  { 102218, true },
-  { 102235, false },
-  { 102255, true },
-  { 102275, true },
-  { 102296, true },
-  { 102317, false },
-  { 102334, true },
-  { 102353, true },
-  { 102368, true },
-  { 102379, true },
-  { 102396, true },
-  { 102423, true },
-  { 102434, true },
-  { 102444, true },
-  { 102459, true },
-  { 102471, true },
-  { 102492, true },
+  { 101739, true },
+  { 101751, true },
+  { 101763, true },
+  { 101781, true },
+  { 101801, true },
+  { 101816, true },
+  { 101833, true },
+  { 101849, true },
+  { 101862, true },
+  { 101873, true },
+  { 101888, true },
+  { 101903, true },
+  { 101919, true },
+  { 101932, true },
+  { 101957, true },
+  { 101973, true },
+  { 101993, true },
+  { 102008, true },
+  { 102019, true },
+  { 102030, true },
+  { 102046, true },
+  { 102058, true },
+  { 102075, true },
+  { 102086, true },
+  { 102094, true },
+  { 102106, true },
+  { 102118, true },
+  { 102132, true },
+  { 102149, true },
+  { 102165, true },
+  { 102181, true },
+  { 102200, true },
+  { 102215, true },
+  { 102227, true },
+  { 102244, false },
+  { 102264, true },
+  { 102284, true },
+  { 102305, true },
+  { 102326, false },
+  { 102343, true },
+  { 102362, true },
+  { 102377, true },
+  { 102388, true },
+  { 102405, true },
+  { 102432, true },
+  { 102443, true },
+  { 102453, true },
+  { 102468, true },
+  { 102480, true },
   { 102501, true },
-  { 102514, true },
-  { 102527, true },
-  { 102545, true },
+  { 102510, true },
+  { 102523, true },
+  { 102536, true },
   { 102554, true },
-  { 102562, true },
+  { 102563, true },
   { 102571, true },
-  { 102580, false },
-  { 102597, true },
-  { 102608, true },
-  { 102626, true },
-  { 102637, true },
-  { 102652, true },
-  { 102668, true },
-  { 102690, true },
-  { 102698, true },
-  { 102711, true },
-  { 102723, true },
-  { 102740, true },
-  { 102754, true },
-  { 102764, true },
-  { 102782, true },
-  { 102799, true },
-  { 102816, true },
-  { 102824, true },
-  { 102848, true },
-  { 102866, true },
-  { 102880, true },
-  { 102893, true },
-  { 102911, true },
-  { 102925, true },
-  { 102944, true },
-  { 102954, true },
-  { 102966, true },
-  { 102978, true },
-  { 102990, true },
-  { 103003, true },
-  { 103010, true },
-  { 103030, true },
-  { 103042, true },
-  { 103058, true },
-  { 103068, true },
-  { 103079, true },
-  { 103086, true },
+  { 102580, true },
+  { 102589, false },
+  { 102606, true },
+  { 102617, true },
+  { 102635, true },
+  { 102646, true },
+  { 102661, true },
+  { 102677, true },
+  { 102699, true },
+  { 102707, true },
+  { 102720, true },
+  { 102732, true },
+  { 102749, true },
+  { 102763, true },
+  { 102773, true },
+  { 102791, true },
+  { 102808, true },
+  { 102825, true },
+  { 102833, true },
+  { 102857, true },
+  { 102875, true },
+  { 102889, true },
+  { 102902, true },
+  { 102920, true },
+  { 102934, true },
+  { 102953, true },
+  { 102963, true },
+  { 102975, true },
+  { 102987, true },
+  { 102999, true },
+  { 103012, true },
+  { 103019, true },
+  { 103039, true },
+  { 103051, true },
+  { 103067, true },
+  { 103077, true },
+  { 103088, true },
   { 103095, true },
-  { 103114, true },
-  { 103127, true },
-  { 103137, true },
-  { 103147, true },
-  { 103155, true },
-  { 103168, true },
-  { 103180, true },
-  { 103192, false },
-  { 103207, true },
-  { 103219, true },
-  { 103237, true },
-  { 103248, true },
-  { 103260, true },
-  { 103281, false },
-  { 103307, true },
-  { 103321, true },
-  { 103335, true },
-  { 103349, true },
-  { 103362, true },
-  { 103373, true },
-  { 103387, true },
-  { 103400, true },
-  { 103412, true },
-  { 103425, false },
-  { 103439, true },
-  { 103457, true },
-  { 103470, true },
-  { 103480, true },
-  { 103491, true },
+  { 103104, true },
+  { 103123, true },
+  { 103136, true },
+  { 103146, true },
+  { 103156, true },
+  { 103164, true },
+  { 103177, true },
+  { 103189, true },
+  { 103201, false },
+  { 103216, true },
+  { 103228, true },
+  { 103246, true },
+  { 103257, true },
+  { 103269, true },
+  { 103290, false },
+  { 103316, true },
+  { 103330, true },
+  { 103344, true },
+  { 103358, true },
+  { 103371, true },
+  { 103384, true },
+  { 103395, true },
+  { 103409, true },
+  { 103422, true },
+  { 103434, true },
+  { 103447, false },
+  { 103461, true },
+  { 103479, true },
+  { 103492, true },
   { 103502, true },
   { 103513, true },
-  { 103526, true },
-  { 103538, true },
-  { 103551, true },
-  { 103559, true },
+  { 103524, true },
+  { 103535, true },
+  { 103548, true },
+  { 103560, true },
   { 103573, true },
-  { 103588, true },
-  { 103611, true },
-  { 103622, true },
-  { 103636, false },
-  { 103651, true },
-  { 103667, true },
-  { 103679, true },
-  { 103693, true },
-  { 103707, true },
-  { 103720, true },
-  { 103733, true },
-  { 103747, true },
-  { 103775, true },
-  { 103803, true },
-  { 103813, true },
+  { 103581, true },
+  { 103595, true },
+  { 103610, true },
+  { 103633, true },
+  { 103644, true },
+  { 103658, false },
+  { 103673, true },
+  { 103689, true },
+  { 103701, true },
+  { 103715, true },
+  { 103729, true },
+  { 103742, true },
+  { 103755, true },
+  { 103769, true },
+  { 103797, true },
+  { 103825, true },
   { 103835, true },
-  { 103848, true },
-  { 103864, true },
-  { 103877, true },
-  { 103891, false },
-  { 103906, true },
-  { 103924, true },
-  { 103943, true },
-  { 103951, false },
-  { 103966, true },
-  { 103979, true },
-  { 103994, true },
-  { 104008, true },
-  { 104024, true },
-  { 104038, true },
-  { 104056, true },
-  { 104066, true },
-  { 104075, false },
-  { 104086, true },
-  { 104097, true },
-  { 104107, true },
+  { 103857, true },
+  { 103870, true },
+  { 103886, true },
+  { 103899, true },
+  { 103913, false },
+  { 103928, true },
+  { 103946, true },
+  { 103965, true },
+  { 103973, false },
+  { 103988, true },
+  { 104001, true },
+  { 104016, true },
+  { 104030, true },
+  { 104046, true },
+  { 104060, true },
+  { 104078, true },
+  { 104088, true },
+  { 104097, false },
+  { 104108, true },
   { 104119, true },
-  { 104130, true },
-  { 104157, true },
-  { 104168, true },
-  { 104177, true },
-  { 104186, true },
-  { 104203, false },
-  { 104217, true },
-  { 104240, true },
-  { 104256, true },
-  { 104277, true },
-  { 104293, true },
-  { 104313, true },
-  { 104323, true },
-  { 104331, true },
-  { 104340, true },
-  { 104351, true },
-  { 104365, true },
-  { 104375, true },
-  { 104390, true },
-  { 104400, true },
-  { 104420, true },
-  { 104430, true },
-  { 104444, true },
-  { 104457, true },
-  { 104469, true },
-  { 104488, true },
-  { 104501, true },
-  { 104525, false },
-  { 104544, true },
-  { 104572, true },
-  { 104586, true },
-  { 104600, true },
-  { 104612, false },
-  { 104626, true },
-  { 104636, true },
+  { 104129, true },
+  { 104141, true },
+  { 104152, true },
+  { 104179, true },
+  { 104190, true },
+  { 104199, true },
+  { 104208, true },
+  { 104225, false },
+  { 104239, true },
+  { 104262, true },
+  { 104278, true },
+  { 104299, true },
+  { 104315, true },
+  { 104335, true },
+  { 104345, true },
+  { 104353, true },
+  { 104362, true },
+  { 104373, true },
+  { 104387, true },
+  { 104397, true },
+  { 104412, true },
+  { 104422, true },
+  { 104442, true },
+  { 104452, true },
+  { 104466, true },
+  { 104479, true },
+  { 104491, true },
+  { 104510, true },
+  { 104523, true },
+  { 104547, false },
+  { 104566, true },
+  { 104594, true },
+  { 104608, true },
+  { 104622, true },
+  { 104634, true },
+  { 104648, true },
   { 104658, true },
-  { 104677, true },
-  { 104695, true },
-  { 104703, true },
-  { 104719, true },
-  { 104734, true },
-  { 104742, true },
-  { 104753, true },
-  { 104769, true },
-  { 104783, true },
-  { 104799, true },
-  { 104814, true },
-  { 104829, true },
-  { 104841, true },
-  { 104853, true },
-  { 104872, true },
-  { 104888, false },
-  { 104913, true },
-  { 104932, true },
-  { 104949, true },
-  { 104959, true },
-  { 104970, true },
-  { 104982, true },
-  { 104997, true },
-  { 105015, true },
-  { 105022, true },
-  { 105033, true },
-  { 105047, true },
-  { 105060, true },
-  { 105073, true },
-  { 105086, true },
-  { 105097, true },
-  { 105110, true },
-  { 105120, true },
-  { 105130, true },
+  { 104680, true },
+  { 104699, true },
+  { 104717, true },
+  { 104725, true },
+  { 104741, true },
+  { 104756, true },
+  { 104764, true },
+  { 104775, true },
+  { 104791, true },
+  { 104805, true },
+  { 104821, true },
+  { 104836, true },
+  { 104851, true },
+  { 104863, true },
+  { 104875, true },
+  { 104894, true },
+  { 104910, false },
+  { 104935, true },
+  { 104954, true },
+  { 104971, true },
+  { 104981, true },
+  { 104992, true },
+  { 105004, true },
+  { 105019, true },
+  { 105037, true },
+  { 105044, true },
+  { 105055, true },
+  { 105069, true },
+  { 105082, true },
+  { 105095, true },
+  { 105108, true },
+  { 105119, true },
+  { 105132, true },
   { 105142, true },
-  { 105154, true },
-  { 105163, true },
-  { 105170, true },
-  { 105180, true },
-  { 105191, true },
-  { 105201, true },
-  { 105219, true },
-  { 105237, true },
-  { 105251, true },
-  { 105265, true },
-  { 105275, true },
-  { 105290, true },
-  { 105308, true },
-  { 105325, true },
-  { 105339, true },
-  { 105353, true },
-  { 105366, true },
-  { 105378, true },
-  { 105390, true },
-  { 105402, true },
-  { 105415, true },
-  { 105428, false },
-  { 105439, true },
-  { 105453, true },
-  { 105466, true },
-  { 105481, true },
+  { 105152, true },
+  { 105164, true },
+  { 105176, true },
+  { 105185, true },
+  { 105192, true },
+  { 105202, true },
+  { 105213, true },
+  { 105223, true },
+  { 105241, true },
+  { 105259, true },
+  { 105273, true },
+  { 105287, true },
+  { 105297, true },
+  { 105312, true },
+  { 105330, true },
+  { 105347, true },
+  { 105361, true },
+  { 105375, true },
+  { 105388, true },
+  { 105400, true },
+  { 105412, true },
+  { 105424, true },
+  { 105437, true },
+  { 105450, false },
+  { 105461, true },
+  { 105475, true },
   { 105488, true },
-  { 105507, true },
-  { 105526, true },
-  { 105541, true },
-  { 105565, false },
-  { 105580, true },
-  { 105591, true },
-  { 105614, true },
-  { 105625, true },
+  { 105503, true },
+  { 105510, true },
+  { 105529, true },
+  { 105548, true },
+  { 105563, true },
+  { 105587, false },
+  { 105602, true },
+  { 105613, true },
   { 105636, true },
-  { 105648, true },
-  { 105662, true },
-  { 105675, true },
-  { 105688, true },
-  { 105701, true },
+  { 105647, true },
+  { 105658, true },
+  { 105670, true },
+  { 105684, true },
+  { 105697, true },
+  { 105710, true },
   { 105723, true },
-  { 105733, true },
-  { 105753, true },
-  { 105771, true },
-  { 105785, true },
-  { 105802, false },
-  { 105817, false },
-  { 105833, true },
-  { 105850, true },
-  { 105861, true },
+  { 105745, true },
+  { 105755, true },
+  { 105775, true },
+  { 105793, true },
+  { 105807, true },
+  { 105824, false },
+  { 105839, false },
+  { 105855, true },
+  { 105872, true },
   { 105883, true },
-  { 105897, true },
-  { 105917, true },
-  { 105927, true },
-  { 105938, true },
-  { 105947, true },
-  { 105958, true },
-  { 105970, true },
+  { 105905, true },
+  { 105919, true },
+  { 105939, true },
+  { 105949, true },
+  { 105960, true },
+  { 105969, true },
   { 105980, true },
-  { 105993, true },
-  { 106001, true },
-  { 106018, true },
-  { 106039, true },
-  { 106053, true },
-  { 106068, true },
-  { 106082, true },
-  { 106102, true },
-  { 106117, true },
-  { 106128, true },
-  { 106140, true },
-  { 106153, true },
-  { 106164, true },
-  { 106177, true },
-  { 106191, true },
-  { 106204, true },
-  { 106214, true },
-  { 106237, true },
-  { 106247, true },
-  { 106257, true },
-  { 106270, true },
-  { 106280, true },
-  { 106297, true },
-  { 106313, true },
-  { 106328, true },
-  { 106348, true },
-  { 106358, true },
-  { 106372, true },
-  { 106384, true },
-  { 106409, true },
-  { 106423, true },
-  { 106437, true },
-  { 106451, true },
-  { 106465, true },
-  { 106479, true },
-  { 106494, true },
-  { 106508, true },
-  { 106522, true },
-  { 106536, true },
-  { 106556, true },
-  { 106568, true },
-  { 106585, true },
-  { 106600, true },
-  { 106613, true },
-  { 106631, true },
-  { 106646, true },
-  { 106662, true },
-  { 106674, true },
-  { 106691, true },
-  { 106704, true },
-  { 106719, true },
-  { 106728, false },
-  { 106743, true },
-  { 106754, true },
-  { 106769, true },
-  { 106781, true },
-  { 106790, true },
-  { 106807, true },
-  { 106826, true },
-  { 106842, true },
-  { 106852, true },
-  { 106868, true },
-  { 106888, true },
-  { 106902, true },
-  { 106921, true },
-  { 106941, true },
-  { 106957, true },
-  { 106967, true },
-  { 106982, true },
-  { 106992, true },
-  { 107013, true },
-  { 107023, true },
-  { 107032, true },
-  { 107047, true },
-  { 107061, true },
-  { 107075, true },
-  { 107090, true },
-  { 107106, true },
+  { 105992, true },
+  { 106002, true },
+  { 106015, true },
+  { 106023, true },
+  { 106040, true },
+  { 106061, true },
+  { 106075, true },
+  { 106090, true },
+  { 106104, true },
+  { 106124, true },
+  { 106139, true },
+  { 106150, true },
+  { 106162, true },
+  { 106175, true },
+  { 106186, true },
+  { 106199, true },
+  { 106213, true },
+  { 106226, true },
+  { 106236, true },
+  { 106259, true },
+  { 106269, true },
+  { 106279, true },
+  { 106292, true },
+  { 106302, true },
+  { 106319, true },
+  { 106335, true },
+  { 106350, true },
+  { 106370, true },
+  { 106380, true },
+  { 106394, true },
+  { 106406, true },
+  { 106431, true },
+  { 106445, true },
+  { 106459, true },
+  { 106473, true },
+  { 106487, true },
+  { 106501, true },
+  { 106516, true },
+  { 106530, true },
+  { 106544, true },
+  { 106558, true },
+  { 106578, true },
+  { 106590, true },
+  { 106607, true },
+  { 106622, true },
+  { 106635, true },
+  { 106653, true },
+  { 106668, true },
+  { 106684, true },
+  { 106696, true },
+  { 106713, true },
+  { 106726, true },
+  { 106741, true },
+  { 106750, false },
+  { 106765, true },
+  { 106776, true },
+  { 106791, true },
+  { 106803, true },
+  { 106812, true },
+  { 106829, false },
+  { 106839, true },
+  { 106858, true },
+  { 106874, true },
+  { 106884, true },
+  { 106900, true },
+  { 106920, true },
+  { 106934, true },
+  { 106953, true },
+  { 106973, true },
+  { 106989, true },
+  { 106999, true },
+  { 107014, true },
+  { 107024, true },
+  { 107045, true },
+  { 107055, true },
+  { 107064, true },
+  { 107079, true },
+  { 107093, true },
+  { 107107, true },
   { 107122, true },
-  { 107130, true },
-  { 107142, true },
+  { 107138, true },
   { 107154, true },
-  { 107166, true },
-  { 107179, true },
-  { 107192, true },
-  { 107206, true },
-  { 107221, true },
-  { 107235, false },
-  { 107261, true },
-  { 107272, true },
-  { 107280, true },
-  { 107288, true },
-  { 107296, true },
+  { 107162, true },
+  { 107174, true },
+  { 107186, true },
+  { 107198, true },
+  { 107211, true },
+  { 107224, true },
+  { 107238, true },
+  { 107253, true },
+  { 107267, false },
+  { 107293, true },
   { 107304, true },
-  { 107314, true },
-  { 107323, true },
-  { 107335, true },
-  { 107347, true },
-  { 107366, true },
-  { 107376, true },
-  { 107387, true },
-  { 107397, true },
-  { 107414, true },
-  { 107427, true },
-  { 107437, true },
-  { 107448, true },
-  { 107466, true },
-  { 107484, true },
+  { 107312, true },
+  { 107320, true },
+  { 107328, true },
+  { 107336, true },
+  { 107346, true },
+  { 107355, true },
+  { 107367, true },
+  { 107379, true },
+  { 107398, true },
+  { 107408, true },
+  { 107419, true },
+  { 107429, true },
+  { 107446, true },
+  { 107459, true },
+  { 107469, true },
+  { 107480, true },
   { 107498, true },
-  { 107508, true },
-  { 107515, true },
+  { 107516, true },
   { 107530, true },
-  { 107552, true },
-  { 107560, true },
-  { 107570, true },
-  { 107589, true },
-  { 107601, true },
-  { 107611, true },
+  { 107540, true },
+  { 107547, true },
+  { 107562, true },
+  { 107584, true },
+  { 107592, true },
+  { 107602, true },
   { 107621, true },
-  { 107631, true },
-  { 107642, true },
-  { 107655, true },
+  { 107633, true },
+  { 107643, true },
+  { 107653, true },
   { 107663, true },
-  { 107677, true },
-  { 107687, true },
+  { 107676, true },
+  { 107684, true },
   { 107698, true },
-  { 107705, true },
-  { 107713, true },
-  { 107731, true },
-  { 107742, false },
-  { 107757, true },
-  { 107767, true },
-  { 107776, true },
-  { 107787, true },
-  { 107796, true },
-  { 107804, true },
-  { 107813, true },
-  { 107833, true },
-  { 107849, true },
-  { 107858, false },
-  { 107869, false },
-  { 107883, true },
-  { 107892, true },
-  { 107908, true },
-  { 107921, true },
-  { 107934, true },
-  { 107946, true },
-  { 107961, true },
-  { 107971, true },
-  { 107983, true },
+  { 107708, true },
+  { 107719, true },
+  { 107726, true },
+  { 107734, true },
+  { 107752, true },
+  { 107763, false },
+  { 107778, true },
+  { 107788, true },
+  { 107797, true },
+  { 107808, true },
+  { 107817, true },
+  { 107825, true },
+  { 107834, true },
+  { 107854, true },
+  { 107870, true },
+  { 107879, false },
+  { 107890, false },
+  { 107904, true },
+  { 107913, true },
+  { 107929, true },
+  { 107942, true },
+  { 107955, true },
+  { 107967, true },
+  { 107982, true },
   { 107994, true },
   { 108005, true },
-  { 108017, true },
-  { 108040, true },
-  { 108050, true },
-  { 108066, true },
-  { 108081, true },
-  { 108094, true },
-  { 108103, true },
-  { 108118, true },
-  { 108131, true },
-  { 108144, true },
-  { 108159, true },
-  { 108169, true },
-  { 108192, true },
-  { 108208, false },
-  { 108218, true },
-  { 108232, true },
-  { 108243, true },
-  { 108253, true },
-  { 108267, true },
-  { 108278, true },
-  { 108291, true },
-  { 108304, true },
-  { 108316, true },
-  { 108334, true },
-  { 108345, true },
-  { 108358, true },
-  { 108369, true },
-  { 108393, true },
-  { 108408, true },
-  { 108433, true },
-  { 108441, true },
-  { 108457, false },
-  { 108472, true },
-  { 108484, true },
-  { 108496, true },
-  { 108510, true },
-  { 108524, true },
-  { 108538, true },
-  { 108552, true },
-  { 108564, true },
-  { 108581, true },
-  { 108598, true },
-  { 108610, true },
-  { 108624, true },
-  { 108646, true },
-  { 108660, true },
-  { 108678, true },
-  { 108699, true },
-  { 108716, true },
-  { 108727, true },
-  { 108740, true },
-  { 108756, true },
-  { 108768, true },
-  { 108782, true },
-  { 108798, true },
-  { 108815, true },
-  { 108829, true },
-  { 108841, false },
-  { 108866, true },
-  { 108876, false },
-  { 108902, true },
-  { 108919, true },
-  { 108933, true },
-  { 108944, false },
-  { 108958, true },
-  { 108975, true },
-  { 108989, true },
-  { 109012, true },
-  { 109030, true },
-  { 109045, true },
-  { 109053, true },
-  { 109061, true },
-  { 109069, true },
-  { 109077, true },
-  { 109085, true },
-  { 109096, true },
-  { 109106, true },
+  { 108016, true },
+  { 108028, true },
+  { 108051, true },
+  { 108061, true },
+  { 108077, true },
+  { 108092, true },
+  { 108105, true },
+  { 108114, true },
+  { 108129, true },
+  { 108142, true },
+  { 108155, true },
+  { 108170, true },
+  { 108180, true },
+  { 108203, false },
+  { 108213, true },
+  { 108227, true },
+  { 108238, true },
+  { 108248, true },
+  { 108262, true },
+  { 108273, true },
+  { 108286, true },
+  { 108299, true },
+  { 108311, true },
+  { 108329, true },
+  { 108340, true },
+  { 108353, true },
+  { 108364, true },
+  { 108388, true },
+  { 108403, true },
+  { 108428, true },
+  { 108436, true },
+  { 108452, false },
+  { 108467, true },
+  { 108479, true },
+  { 108491, true },
+  { 108505, true },
+  { 108519, true },
+  { 108533, true },
+  { 108547, true },
+  { 108559, true },
+  { 108576, true },
+  { 108593, true },
+  { 108605, true },
+  { 108619, true },
+  { 108641, true },
+  { 108655, true },
+  { 108673, true },
+  { 108694, true },
+  { 108711, true },
+  { 108722, true },
+  { 108735, true },
+  { 108751, true },
+  { 108763, true },
+  { 108777, true },
+  { 108793, true },
+  { 108810, true },
+  { 108824, true },
+  { 108836, false },
+  { 108861, true },
+  { 108871, false },
+  { 108897, true },
+  { 108914, true },
+  { 108928, true },
+  { 108939, true },
+  { 108969, false },
+  { 108983, true },
+  { 109000, true },
+  { 109014, true },
+  { 109037, true },
+  { 109055, true },
+  { 109070, true },
+  { 109078, true },
+  { 109086, true },
+  { 109094, true },
+  { 109102, true },
+  { 109110, true },
   { 109121, true },
-  { 109135, true },
-  { 109151, true },
-  { 109162, true },
+  { 109131, true },
+  { 109146, true },
+  { 109160, true },
+  { 109176, true },
   { 109187, true },
-  { 109196, false },
   { 109212, true },
-  { 109222, false },
-  { 109244, true },
-  { 109259, true },
-  { 109273, true },
-  { 109286, true },
-  { 109303, true },
-  { 109319, true },
-  { 109342, true },
-  { 109364, true },
-  { 109382, true },
-  { 109401, false },
-  { 109420, true },
-  { 109433, true },
-  { 109446, true },
-  { 109470, true },
-  { 109481, true },
-  { 109500, true },
-  { 109528, true },
-  { 109549, true },
-  { 109562, true },
-  { 109578, true },
-  { 109598, true },
-  { 109618, true },
-  { 109638, true },
-  { 109652, true },
-  { 109673, false },
-  { 109684, true },
-  { 109703, true },
-  { 109714, true },
-  { 109726, true },
-  { 109737, true },
-  { 109752, true },
-  { 109782, true },
-  { 109793, true },
+  { 109221, false },
+  { 109237, true },
+  { 109247, false },
+  { 109269, true },
+  { 109284, true },
+  { 109298, true },
+  { 109311, true },
+  { 109328, true },
+  { 109344, true },
+  { 109367, true },
+  { 109389, true },
+  { 109407, true },
+  { 109426, false },
+  { 109445, true },
+  { 109458, true },
+  { 109471, true },
+  { 109495, true },
+  { 109506, true },
+  { 109525, true },
+  { 109553, true },
+  { 109574, true },
+  { 109587, true },
+  { 109603, true },
+  { 109623, true },
+  { 109643, true },
+  { 109663, true },
+  { 109677, true },
+  { 109698, false },
+  { 109709, true },
+  { 109728, true },
+  { 109739, true },
+  { 109751, true },
+  { 109762, true },
+  { 109777, true },
   { 109807, true },
-  { 109821, true },
-  { 109833, true },
-  { 109844, true },
-  { 109868, true },
-  { 109889, true },
-  { 109902, true },
-  { 109919, true },
-  { 109935, true },
-  { 109953, true },
-  { 109970, true },
-  { 109984, true },
-  { 109998, true },
-  { 110014, true },
-  { 110034, true },
-  { 110045, true },
-  { 110060, true },
-  { 110087, true },
-  { 110106, true },
-  { 110121, true },
-  { 110132, true },
+  { 109818, true },
+  { 109832, true },
+  { 109846, true },
+  { 109858, true },
+  { 109869, true },
+  { 109893, true },
+  { 109914, true },
+  { 109927, true },
+  { 109944, true },
+  { 109960, true },
+  { 109978, true },
+  { 109995, true },
+  { 110009, true },
+  { 110023, true },
+  { 110039, true },
+  { 110059, true },
+  { 110070, true },
+  { 110085, true },
+  { 110112, true },
+  { 110131, true },
   { 110146, true },
-  { 110163, true },
-  { 110179, true },
-  { 110196, true },
-  { 110211, true },
-  { 110227, true },
-  { 110244, true },
-  { 110264, true },
-  { 110279, true },
-  { 110298, true },
-  { 110314, true },
-  { 110324, true },
-  { 110337, true },
-  { 110356, true },
-  { 110372, true },
-  { 110392, true },
-  { 110404, true },
-  { 110421, false },
-  { 110436, true },
-  { 110448, true },
+  { 110157, true },
+  { 110171, true },
+  { 110188, true },
+  { 110204, true },
+  { 110221, true },
+  { 110236, true },
+  { 110252, true },
+  { 110269, true },
+  { 110289, true },
+  { 110304, true },
+  { 110323, true },
+  { 110339, true },
+  { 110349, true },
+  { 110362, true },
+  { 110381, true },
+  { 110397, true },
+  { 110417, true },
+  { 110429, true },
+  { 110446, false },
   { 110461, true },
-  { 110471, true },
-  { 110488, true },
-  { 110500, true },
-  { 110510, true },
-  { 110527, true },
-  { 110550, true },
-  { 110564, true },
-  { 110581, true },
-  { 110596, true },
-  { 110615, true },
-  { 110648, true },
-  { 110658, true },
-  { 110672, true },
-  { 110688, false },
-  { 110711, true },
-  { 110725, true },
-  { 110740, true },
-  { 110760, true },
-  { 110772, true },
-  { 110790, true },
-  { 110803, true },
-  { 110816, true },
-  { 110829, true },
-  { 110840, true },
-  { 110855, true },
-  { 110866, true },
+  { 110473, true },
+  { 110486, true },
+  { 110496, true },
+  { 110513, true },
+  { 110525, true },
+  { 110535, true },
+  { 110552, true },
+  { 110575, true },
+  { 110589, true },
+  { 110606, true },
+  { 110621, true },
+  { 110640, true },
+  { 110673, true },
+  { 110683, true },
+  { 110697, true },
+  { 110713, false },
+  { 110736, true },
+  { 110750, true },
+  { 110765, true },
+  { 110785, true },
+  { 110797, true },
+  { 110815, true },
+  { 110828, true },
+  { 110841, true },
+  { 110854, true },
+  { 110865, true },
   { 110880, true },
-  { 110892, true },
-  { 110906, true },
-  { 110914, true },
-  { 110933, true },
-  { 110955, true },
-  { 110968, true },
-  { 110978, false },
-  { 110990, true },
-  { 111013, true },
-  { 111027, true },
-  { 111042, true },
-  { 111058, true },
-  { 111077, true },
-  { 111091, true },
-  { 111105, true },
-  { 111124, true },
-  { 111141, true },
-  { 111154, true },
-  { 111171, true },
-  { 111187, true },
-  { 111206, true },
-  { 111223, true },
+  { 110891, true },
+  { 110905, true },
+  { 110917, true },
+  { 110931, true },
+  { 110939, true },
+  { 110958, true },
+  { 110980, true },
+  { 110993, true },
+  { 111003, false },
+  { 111015, true },
+  { 111038, true },
+  { 111052, true },
+  { 111067, true },
+  { 111083, true },
+  { 111102, true },
+  { 111116, true },
+  { 111130, true },
+  { 111149, true },
+  { 111166, true },
+  { 111179, true },
+  { 111196, true },
+  { 111212, true },
   { 111231, true },
-  { 111247, true },
-  { 111263, true },
-  { 111283, true },
-  { 111301, true },
-  { 111315, true },
-  { 111332, true },
-  { 111351, true },
-  { 111368, true },
-  { 111387, true },
-  { 111405, true },
-  { 111418, true },
-  { 111428, true },
-  { 111446, true },
-  { 111466, true },
+  { 111248, true },
+  { 111256, true },
+  { 111272, true },
+  { 111292, true },
+  { 111310, true },
+  { 111324, true },
+  { 111341, true },
+  { 111360, true },
+  { 111377, true },
+  { 111396, true },
+  { 111414, true },
+  { 111427, true },
+  { 111437, true },
+  { 111455, true },
   { 111475, true },
-  { 111489, true },
-  { 111506, true },
-  { 111529, true },
+  { 111484, true },
+  { 111498, true },
+  { 111515, true },
   { 111538, true },
-  { 111554, true },
-  { 111572, true },
-  { 111584, true },
+  { 111547, true },
+  { 111563, true },
+  { 111581, true },
   { 111593, true },
-  { 111606, true },
-  { 111619, true },
-  { 111635, true },
-  { 111643, false },
-  { 111655, true },
-  { 111665, true },
-  { 111684, true },
-  { 111699, true },
-  { 111714, true },
-  { 111733, true },
-  { 111755, true },
-  { 111774, true },
-  { 111788, true },
-  { 111800, true },
-  { 111814, false },
-  { 111836, true },
-  { 111854, true },
-  { 111867, true },
-  { 111881, true },
-  { 111892, true },
-  { 111906, false },
-  { 111926, true },
-  { 111937, false },
-  { 111946, true },
-  { 111961, false },
-  { 111979, true },
-  { 111989, true },
-  { 112000, false },
-  { 112015, true },
+  { 111602, true },
+  { 111615, true },
+  { 111628, true },
+  { 111644, true },
+  { 111652, false },
+  { 111664, true },
+  { 111674, true },
+  { 111693, true },
+  { 111708, true },
+  { 111723, true },
+  { 111742, true },
+  { 111764, true },
+  { 111783, true },
+  { 111797, true },
+  { 111809, true },
+  { 111823, false },
+  { 111845, true },
+  { 111863, true },
+  { 111876, true },
+  { 111890, true },
+  { 111901, true },
+  { 111915, false },
+  { 111935, true },
+  { 111946, false },
+  { 111955, true },
+  { 111970, false },
+  { 111988, true },
+  { 111998, true },
+  { 112009, false },
   { 112024, true },
-  { 112036, true },
+  { 112033, true },
   { 112045, true },
-  { 112058, true },
-  { 112071, true },
-  { 112082, true },
-  { 112096, true },
-  { 112109, true },
-  { 112126, false },
-  { 112143, true },
-  { 112150, true },
-  { 112158, true },
+  { 112054, true },
+  { 112067, true },
+  { 112080, true },
+  { 112091, true },
+  { 112105, true },
+  { 112118, true },
+  { 112135, false },
+  { 112152, true },
+  { 112159, true },
   { 112167, true },
-  { 112179, true },
-  { 112202, true },
-  { 112216, true },
-  { 112230, true },
-  { 112247, true },
-  { 112263, true },
-  { 112277, true },
-  { 112284, true },
-  { 112295, true },
-  { 112310, true },
-  { 112322, true },
-  { 112330, true },
-  { 112345, false },
-  { 112355, true },
-  { 112367, true },
-  { 112379, true },
-  { 112394, true },
-  { 112423, true },
-  { 112437, true },
-  { 112445, true },
-  { 112453, true },
+  { 112176, true },
+  { 112188, true },
+  { 112211, true },
+  { 112225, true },
+  { 112239, true },
+  { 112256, true },
+  { 112272, true },
+  { 112286, true },
+  { 112293, true },
+  { 112304, true },
+  { 112319, true },
+  { 112331, true },
+  { 112339, true },
+  { 112354, false },
+  { 112364, true },
+  { 112376, true },
+  { 112388, true },
+  { 112403, true },
+  { 112432, true },
+  { 112446, true },
+  { 112454, true },
   { 112462, true },
-  { 112475, true },
-  { 112483, true },
-  { 112494, true },
-  { 112505, true },
-  { 112512, true },
+  { 112471, true },
+  { 112484, true },
+  { 112492, true },
+  { 112503, true },
+  { 112514, true },
   { 112521, true },
-  { 112531, true },
-  { 112551, true },
-  { 112563, true },
-  { 112574, true },
-  { 112583, false },
+  { 112530, true },
+  { 112540, true },
+  { 112560, true },
+  { 112572, true },
+  { 112583, true },
   { 112592, false },
-  { 112613, true },
-  { 112624, true },
+  { 112601, false },
+  { 112622, true },
   { 112633, true },
-  { 112647, true },
-  { 112664, true },
-  { 112680, true },
-  { 112697, true },
-  { 112709, true },
-  { 112722, true },
-  { 112734, true },
-  { 112748, true },
-  { 112766, true },
-  { 112780, true },
-  { 112796, false },
-  { 112814, true },
-  { 112831, true },
-  { 112853, true },
-  { 112864, true },
-  { 112876, true },
-  { 112887, true },
-  { 112898, true },
-  { 112909, true },
-  { 112923, true },
-  { 112934, true },
-  { 112950, true },
-  { 112979, true },
-  { 112998, true },
-  { 113017, true },
-  { 113033, true },
-  { 113059, true },
-  { 113073, true },
-  { 113090, true },
-  { 113109, true },
-  { 113126, true },
-  { 113137, true },
-  { 113145, true },
-  { 113157, true },
-  { 113170, true },
-  { 113185, true },
-  { 113198, true },
-  { 113211, true },
-  { 113225, true },
-  { 113237, true },
-  { 113249, true },
-  { 113266, true },
-  { 113279, true },
-  { 113294, true },
-  { 113307, true },
-  { 113319, true },
-  { 113333, true },
-  { 113344, true },
-  { 113367, true },
-  { 113385, true },
-  { 113404, true },
-  { 113417, true },
-  { 113435, true },
-  { 113452, true },
-  { 113463, true },
-  { 113485, true },
-  { 113497, true },
-  { 113505, true },
-  { 113526, true },
-  { 113547, true },
-  { 113565, true },
-  { 113581, true },
-  { 113593, true },
-  { 113605, true },
-  { 113623, true },
-  { 113633, true },
-  { 113647, true },
-  { 113663, true },
-  { 113689, false },
-  { 113718, true },
-  { 113729, true },
-  { 113744, true },
-  { 113760, true },
-  { 113775, true },
-  { 113789, true },
-  { 113816, true },
-  { 113834, false },
-  { 113845, true },
-  { 113855, true },
-  { 113870, true },
-  { 113881, true },
-  { 113899, true },
-  { 113922, true },
-  { 113940, true },
-  { 113953, true },
-  { 113964, false },
-  { 113978, true },
-  { 114000, true },
-  { 114019, true },
-  { 114033, true },
-  { 114045, false },
-  { 114065, true },
-  { 114081, true },
-  { 114091, true },
-  { 114105, true },
-  { 114123, true },
-  { 114135, true },
-  { 114145, true },
-  { 114157, true },
-  { 114165, true },
-  { 114179, true },
-  { 114191, true },
-  { 114209, true },
-  { 114221, true },
-  { 114233, true },
-  { 114245, true },
-  { 114257, true },
-  { 114269, true },
-  { 114281, true },
-  { 114293, true },
-  { 114305, true },
-  { 114321, false },
-  { 114341, true },
+  { 112642, true },
+  { 112656, true },
+  { 112673, true },
+  { 112689, true },
+  { 112706, true },
+  { 112718, true },
+  { 112731, true },
+  { 112743, true },
+  { 112757, true },
+  { 112775, true },
+  { 112789, true },
+  { 112805, false },
+  { 112823, true },
+  { 112840, true },
+  { 112862, true },
+  { 112873, true },
+  { 112885, true },
+  { 112896, true },
+  { 112907, true },
+  { 112918, true },
+  { 112932, true },
+  { 112943, true },
+  { 112959, true },
+  { 112988, true },
+  { 113007, true },
+  { 113026, true },
+  { 113042, true },
+  { 113068, true },
+  { 113082, true },
+  { 113099, true },
+  { 113118, true },
+  { 113135, true },
+  { 113146, true },
+  { 113154, true },
+  { 113166, true },
+  { 113179, true },
+  { 113194, true },
+  { 113207, true },
+  { 113220, true },
+  { 113234, true },
+  { 113246, true },
+  { 113258, true },
+  { 113275, true },
+  { 113288, true },
+  { 113303, true },
+  { 113316, true },
+  { 113328, true },
+  { 113342, true },
+  { 113353, true },
+  { 113376, true },
+  { 113394, true },
+  { 113413, true },
+  { 113426, true },
+  { 113444, true },
+  { 113461, true },
+  { 113472, true },
+  { 113494, true },
+  { 113506, true },
+  { 113514, true },
+  { 113535, true },
+  { 113556, true },
+  { 113574, true },
+  { 113590, true },
+  { 113602, true },
+  { 113614, true },
+  { 113632, true },
+  { 113642, true },
+  { 113656, true },
+  { 113672, true },
+  { 113698, false },
+  { 113727, true },
+  { 113738, true },
+  { 113753, true },
+  { 113769, true },
+  { 113784, true },
+  { 113798, true },
+  { 113825, true },
+  { 113843, false },
+  { 113854, true },
+  { 113864, true },
+  { 113879, true },
+  { 113890, true },
+  { 113908, true },
+  { 113931, true },
+  { 113949, true },
+  { 113962, true },
+  { 113973, false },
+  { 113987, true },
+  { 114009, true },
+  { 114028, true },
+  { 114042, true },
+  { 114054, false },
+  { 114074, true },
+  { 114090, true },
+  { 114100, true },
+  { 114114, true },
+  { 114132, true },
+  { 114144, true },
+  { 114154, true },
+  { 114166, true },
+  { 114174, true },
+  { 114188, true },
+  { 114200, true },
+  { 114218, true },
+  { 114230, true },
+  { 114242, true },
+  { 114254, true },
+  { 114266, true },
+  { 114278, true },
+  { 114290, true },
+  { 114302, true },
+  { 114314, true },
+  { 114330, false },
   { 114350, true },
-  { 114364, true },
-  { 114380, true },
-  { 114393, true },
-  { 114416, true },
-  { 114429, true },
-  { 114437, false },
-  { 114453, true },
-  { 114471, true },
-  { 114485, true },
-  { 114498, true },
-  { 114514, true },
-  { 114531, false },
-  { 114545, true },
-  { 114561, true },
-  { 114568, true },
-  { 114583, true },
-  { 114598, true },
-  { 114610, true },
-  { 114628, true },
-  { 114647, true },
-  { 114669, true },
-  { 114689, true },
-  { 114706, true },
-  { 114724, true },
-  { 114742, true },
-  { 114764, true },
-  { 114778, true },
-  { 114794, true },
-  { 114811, true },
-  { 114832, true },
-  { 114847, true },
-  { 114871, true },
-  { 114888, true },
-  { 114901, true },
-  { 114912, true },
-  { 114925, true },
-  { 114938, true },
-  { 114952, true },
-  { 114964, true },
-  { 114974, true },
-  { 114985, true },
-  { 115000, true },
-  { 115011, true },
-  { 115023, true },
+  { 114359, true },
+  { 114373, true },
+  { 114389, true },
+  { 114402, true },
+  { 114425, true },
+  { 114438, true },
+  { 114446, false },
+  { 114462, true },
+  { 114480, true },
+  { 114494, true },
+  { 114507, true },
+  { 114523, true },
+  { 114540, false },
+  { 114554, true },
+  { 114570, true },
+  { 114577, true },
+  { 114592, true },
+  { 114607, true },
+  { 114619, true },
+  { 114637, true },
+  { 114656, true },
+  { 114678, true },
+  { 114698, true },
+  { 114715, true },
+  { 114733, true },
+  { 114751, true },
+  { 114773, true },
+  { 114787, true },
+  { 114803, true },
+  { 114820, true },
+  { 114841, true },
+  { 114856, true },
+  { 114880, true },
+  { 114897, true },
+  { 114910, true },
+  { 114921, true },
+  { 114934, true },
+  { 114947, true },
+  { 114961, true },
+  { 114973, true },
+  { 114983, true },
+  { 114994, true },
+  { 115009, true },
+  { 115020, true },
   { 115032, true },
-  { 115042, true },
+  { 115041, true },
   { 115051, true },
-  { 115062, true },
-  { 115087, true },
-  { 115099, true },
-  { 115117, true },
-  { 115133, true },
-  { 115144, true },
-  { 115167, true },
-  { 115188, true },
-  { 115206, true },
-  { 115225, false },
-  { 115239, true },
-  { 115250, true },
-  { 115263, true },
-  { 115277, true },
-  { 115292, true },
-  { 115303, true },
-  { 115317, true },
-  { 115330, true },
-  { 115344, true },
-  { 115357, true },
-  { 115368, true },
-  { 115381, true },
-  { 115395, true },
+  { 115060, true },
+  { 115071, true },
+  { 115096, true },
+  { 115108, true },
+  { 115126, true },
+  { 115142, true },
+  { 115153, true },
+  { 115176, true },
+  { 115197, true },
+  { 115215, true },
+  { 115234, false },
+  { 115248, true },
+  { 115259, true },
+  { 115272, true },
+  { 115286, true },
+  { 115301, true },
+  { 115312, true },
+  { 115326, true },
+  { 115339, true },
+  { 115353, true },
+  { 115366, true },
+  { 115377, true },
+  { 115390, true },
   { 115404, true },
-  { 115419, true },
-  { 115430, true },
-  { 115443, true },
-  { 115456, true },
-  { 115475, true },
-  { 115493, true },
-  { 115509, true },
-  { 115522, true },
-  { 115534, true },
-  { 115549, true },
-  { 115559, true },
-  { 115569, true },
-  { 115583, true },
-  { 115594, true },
-  { 115621, true },
-  { 115635, true },
-  { 115643, true },
-  { 115665, true },
-  { 115679, true },
-  { 115692, true },
-  { 115706, true },
-  { 115725, true },
-  { 115744, true },
-  { 115763, true },
-  { 115782, true },
-  { 115802, true },
-  { 115822, true },
-  { 115842, true },
-  { 115860, true },
-  { 115879, true },
-  { 115898, true },
-  { 115917, true },
-  { 115936, true },
-  { 115950, true },
-  { 115962, true },
-  { 115974, true },
-  { 115987, false },
-  { 116009, true },
-  { 116024, true },
-  { 116036, true },
-  { 116044, true },
-  { 116069, true },
-  { 116085, true },
+  { 115413, true },
+  { 115428, true },
+  { 115439, true },
+  { 115452, true },
+  { 115465, true },
+  { 115484, true },
+  { 115502, true },
+  { 115518, true },
+  { 115531, true },
+  { 115543, true },
+  { 115558, true },
+  { 115568, true },
+  { 115578, true },
+  { 115592, true },
+  { 115603, true },
+  { 115630, true },
+  { 115644, true },
+  { 115652, true },
+  { 115674, true },
+  { 115688, true },
+  { 115701, true },
+  { 115715, true },
+  { 115734, true },
+  { 115753, true },
+  { 115772, true },
+  { 115791, true },
+  { 115811, true },
+  { 115831, true },
+  { 115851, true },
+  { 115869, true },
+  { 115888, true },
+  { 115907, true },
+  { 115926, true },
+  { 115945, true },
+  { 115959, true },
+  { 115971, true },
+  { 115983, true },
+  { 115996, false },
+  { 116018, true },
+  { 116033, true },
+  { 116045, true },
+  { 116053, true },
+  { 116078, true },
   { 116094, true },
-  { 116108, true },
-  { 116120, true },
-  { 116137, true },
-  { 116150, true },
-  { 116165, true },
-  { 116181, true },
-  { 116194, true },
-  { 116206, true },
-  { 116216, true },
-  { 116227, true },
-  { 116241, true },
-  { 116256, true },
-  { 116269, true },
-  { 116280, true },
-  { 116294, true },
-  { 116309, true },
-  { 116318, true },
-  { 116334, true },
-  { 116353, true },
-  { 116367, true },
-  { 116382, true },
-  { 116393, true },
-  { 116403, true },
-  { 116415, true },
-  { 116430, true },
-  { 116447, true },
-  { 116478, true },
-  { 116493, true },
-  { 116514, true },
-  { 116528, true },
-  { 116546, true },
-  { 116556, true },
-  { 116568, true },
-  { 116578, true },
-  { 116591, true },
-  { 116606, true },
-  { 116619, true },
-  { 116631, true },
-  { 116649, false },
-  { 116659, true },
-  { 116674, true },
-  { 116691, true },
-  { 116706, true },
-  { 116719, true },
-  { 116731, true },
-  { 116747, true },
-  { 116767, true },
-  { 116782, true },
-  { 116798, true },
-  { 116812, true },
-  { 116824, true },
-  { 116837, true },
-  { 116847, true },
-  { 116861, true },
-  { 116871, true },
-  { 116891, true },
-  { 116900, true },
-  { 116910, true },
-  { 116921, false },
-  { 116930, true },
-  { 116943, true },
-  { 116962, true },
-  { 116972, true },
-  { 116983, true },
-  { 116996, true },
-  { 117003, true },
-  { 117012, true },
-  { 117028, true },
-  { 117039, true },
-  { 117046, true },
-  { 117055, true },
-  { 117063, true },
-  { 117073, true },
-  { 117094, true },
-  { 117106, true },
-  { 117115, true },
-  { 117123, true },
-  { 117132, true },
-  { 117143, true },
-  { 117153, true },
-  { 117164, true },
-  { 117171, true },
-  { 117180, true },
-  { 117188, true },
-  { 117199, true },
-  { 117207, true },
-  { 117215, true },
-  { 117229, true },
-  { 117239, true },
-  { 117255, true },
-  { 117267, true },
-  { 117297, true },
-  { 117317, true },
-  { 117331, false },
-  { 117349, false },
-  { 117365, true },
-  { 117380, true },
-  { 117401, true },
-  { 117415, true },
-  { 117434, true },
-  { 117445, true },
-  { 117455, true },
-  { 117466, true },
-  { 117480, true },
-  { 117493, true },
-  { 117503, false },
-  { 117519, true },
-  { 117538, true },
-  { 117564, true },
-  { 117587, true },
-  { 117604, true },
-  { 117617, true },
-  { 117633, true },
-  { 117641, true },
-  { 117654, true },
-  { 117661, true },
-  { 117673, true },
-  { 117683, true },
-  { 117695, true },
-  { 117715, false },
-  { 117733, true },
-  { 117746, true },
-  { 117757, true },
-  { 117767, true },
-  { 117781, false },
-  { 117797, true },
-  { 117808, true },
-  { 117817, true },
-  { 117825, true },
-  { 117835, true },
-  { 117852, true },
-  { 117863, true },
-  { 117879, true },
-  { 117890, true },
-  { 117902, true },
-  { 117912, false },
-  { 117927, true },
-  { 117942, true },
-  { 117957, true },
-  { 117976, true },
-  { 117987, true },
-  { 118001, true },
-  { 118016, true },
-  { 118032, true },
-  { 118054, true },
-  { 118067, true },
-  { 118086, true },
-  { 118099, true },
-  { 118108, true },
-  { 118123, true },
-  { 118136, true },
-  { 118148, true },
-  { 118165, true },
-  { 118189, true },
-  { 118202, true },
-  { 118219, true },
-  { 118231, true },
-  { 118244, true },
-  { 118259, true },
-  { 118266, true },
-  { 118279, true },
-  { 118292, true },
-  { 118306, true },
-  { 118323, true },
-  { 118338, true },
-  { 118352, true },
-  { 118364, true },
-  { 118379, true },
-  { 118394, true },
-  { 118409, true },
-  { 118428, true },
-  { 118447, true },
-  { 118466, true },
-  { 118481, true },
-  { 118491, true },
-  { 118504, false },
-  { 118517, true },
-  { 118531, true },
-  { 118542, true },
-  { 118557, true },
-  { 118573, true },
-  { 118586, true },
-  { 118599, true },
-  { 118619, true },
-  { 118628, true },
-  { 118644, true },
-  { 118657, true },
-  { 118672, true },
-  { 118685, true },
-  { 118703, true },
-  { 118711, false },
-  { 118724, true },
-  { 118742, true },
-  { 118760, true },
-  { 118791, true },
-  { 118821, true },
-  { 118843, true },
-  { 118859, true },
-  { 118870, false },
-  { 118883, true },
-  { 118895, true },
-  { 118910, true },
-  { 118927, false },
-  { 118946, true },
-  { 118957, true },
-  { 118973, true },
-  { 118983, true },
-  { 118993, true },
-  { 119005, true },
-  { 119021, true },
-  { 119032, true },
-  { 119049, true },
-  { 119062, true },
-  { 119082, true },
-  { 119092, true },
-  { 119103, true },
-  { 119113, true },
-  { 119128, true },
-  { 119143, true },
-  { 119160, true },
-  { 119175, true },
-  { 119186, true },
-  { 119199, true },
-  { 119212, true },
-  { 119229, true },
-  { 119241, true },
-  { 119258, true },
-  { 119271, true },
-  { 119280, true },
-  { 119291, true },
-  { 119301, true },
-  { 119315, true },
-  { 119326, true },
-  { 119334, true },
-  { 119343, true },
-  { 119357, true },
-  { 119367, true },
-  { 119379, true },
-  { 119389, true },
-  { 119398, true },
-  { 119409, false },
-  { 119417, true },
-  { 119424, true },
-  { 119435, false },
-  { 119455, true },
-  { 119462, false },
-  { 119478, true },
-  { 119490, true },
-  { 119510, true },
-  { 119524, false },
-  { 119535, true },
-  { 119551, true },
-  { 119561, true },
-  { 119574, true },
-  { 119592, true },
-  { 119606, true },
-  { 119623, true },
-  { 119642, true },
-  { 119665, true },
-  { 119677, true },
-  { 119699, true },
-  { 119709, true },
-  { 119723, true },
-  { 119733, true },
-  { 119744, true },
-  { 119753, true },
-  { 119762, true },
-  { 119775, true },
-  { 119792, true },
-  { 119808, true },
-  { 119822, true },
-  { 119830, true },
-  { 119844, true },
-  { 119863, true },
-  { 119879, false },
-  { 119893, true },
-  { 119906, true },
-  { 119923, true },
-  { 119938, true },
-  { 119949, true },
-  { 119960, true },
-  { 119974, true },
-  { 119988, true },
-  { 120003, true },
-  { 120024, true },
-  { 120040, true },
-  { 120058, true },
-  { 120076, true },
-  { 120089, true },
-  { 120101, true },
-  { 120117, true },
-  { 120141, true },
-  { 120158, true },
-  { 120169, true },
-  { 120188, true },
-  { 120196, true },
-  { 120210, true },
-  { 120219, false },
-  { 120239, true },
-  { 120249, false },
-  { 120268, false },
-  { 120281, false },
-  { 120293, true },
-  { 120314, true },
-  { 120327, true },
-  { 120345, true },
-  { 120363, true },
-  { 120372, true },
-  { 120388, true },
-  { 120412, false },
-  { 120428, true },
-  { 120446, true },
-  { 120458, true },
-  { 120475, true },
-  { 120489, true },
-  { 120504, true },
-  { 120523, true },
-  { 120537, true },
-  { 120555, true },
-  { 120565, false },
-  { 120594, true },
-  { 120618, true },
+  { 116103, true },
+  { 116115, true },
+  { 116132, true },
+  { 116145, true },
+  { 116160, true },
+  { 116176, true },
+  { 116189, true },
+  { 116201, true },
+  { 116211, true },
+  { 116222, true },
+  { 116236, true },
+  { 116251, true },
+  { 116264, true },
+  { 116275, true },
+  { 116289, true },
+  { 116304, true },
+  { 116313, true },
+  { 116329, true },
+  { 116348, true },
+  { 116362, true },
+  { 116377, true },
+  { 116388, true },
+  { 116398, true },
+  { 116410, true },
+  { 116425, true },
+  { 116442, true },
+  { 116473, true },
+  { 116488, true },
+  { 116509, true },
+  { 116523, true },
+  { 116541, true },
+  { 116551, true },
+  { 116563, true },
+  { 116573, true },
+  { 116586, true },
+  { 116601, true },
+  { 116614, true },
+  { 116626, true },
+  { 116634, true },
+  { 116652, false },
+  { 116662, true },
+  { 116677, true },
+  { 116694, true },
+  { 116709, true },
+  { 116722, true },
+  { 116734, true },
+  { 116750, true },
+  { 116770, true },
+  { 116785, true },
+  { 116801, true },
+  { 116815, true },
+  { 116827, true },
+  { 116840, true },
+  { 116850, true },
+  { 116864, true },
+  { 116874, true },
+  { 116894, true },
+  { 116903, true },
+  { 116913, true },
+  { 116924, false },
+  { 116933, true },
+  { 116946, true },
+  { 116965, true },
+  { 116975, true },
+  { 116986, true },
+  { 116999, true },
+  { 117006, true },
+  { 117015, true },
+  { 117031, true },
+  { 117042, true },
+  { 117049, true },
+  { 117058, true },
+  { 117066, true },
+  { 117076, true },
+  { 117097, true },
+  { 117109, true },
+  { 117118, true },
+  { 117126, true },
+  { 117135, true },
+  { 117146, true },
+  { 117156, true },
+  { 117167, true },
+  { 117174, true },
+  { 117183, true },
+  { 117191, true },
+  { 117202, true },
+  { 117210, true },
+  { 117218, true },
+  { 117232, true },
+  { 117242, true },
+  { 117258, true },
+  { 117270, true },
+  { 117300, true },
+  { 117320, true },
+  { 117334, false },
+  { 117352, false },
+  { 117368, true },
+  { 117383, true },
+  { 117404, true },
+  { 117418, true },
+  { 117437, true },
+  { 117448, true },
+  { 117458, true },
+  { 117469, true },
+  { 117483, true },
+  { 117496, true },
+  { 117506, false },
+  { 117522, true },
+  { 117541, true },
+  { 117567, true },
+  { 117590, true },
+  { 117607, true },
+  { 117620, true },
+  { 117636, true },
+  { 117644, true },
+  { 117657, true },
+  { 117664, true },
+  { 117676, true },
+  { 117686, true },
+  { 117698, true },
+  { 117718, false },
+  { 117736, true },
+  { 117749, true },
+  { 117760, true },
+  { 117770, true },
+  { 117784, false },
+  { 117800, true },
+  { 117811, true },
+  { 117820, true },
+  { 117828, true },
+  { 117838, true },
+  { 117855, true },
+  { 117866, true },
+  { 117882, true },
+  { 117893, true },
+  { 117905, true },
+  { 117915, false },
+  { 117930, true },
+  { 117945, true },
+  { 117960, true },
+  { 117979, true },
+  { 117990, true },
+  { 118004, true },
+  { 118019, true },
+  { 118035, true },
+  { 118057, true },
+  { 118070, true },
+  { 118089, true },
+  { 118102, true },
+  { 118111, true },
+  { 118126, true },
+  { 118139, true },
+  { 118151, true },
+  { 118168, true },
+  { 118192, true },
+  { 118205, true },
+  { 118222, true },
+  { 118234, true },
+  { 118247, true },
+  { 118262, true },
+  { 118269, true },
+  { 118282, true },
+  { 118295, true },
+  { 118309, true },
+  { 118326, true },
+  { 118341, true },
+  { 118355, true },
+  { 118367, true },
+  { 118382, true },
+  { 118397, true },
+  { 118412, true },
+  { 118431, true },
+  { 118450, true },
+  { 118469, true },
+  { 118484, true },
+  { 118494, true },
+  { 118507, false },
+  { 118520, true },
+  { 118534, true },
+  { 118545, true },
+  { 118560, true },
+  { 118576, true },
+  { 118589, true },
+  { 118602, true },
+  { 118622, true },
+  { 118631, true },
+  { 118647, true },
+  { 118660, true },
+  { 118675, true },
+  { 118688, true },
+  { 118706, true },
+  { 118714, false },
+  { 118727, true },
+  { 118745, true },
+  { 118763, true },
+  { 118794, true },
+  { 118824, true },
+  { 118846, true },
+  { 118862, true },
+  { 118873, false },
+  { 118886, true },
+  { 118898, true },
+  { 118913, true },
+  { 118930, false },
+  { 118949, true },
+  { 118960, true },
+  { 118976, true },
+  { 118986, true },
+  { 118996, true },
+  { 119008, true },
+  { 119024, true },
+  { 119035, true },
+  { 119052, true },
+  { 119065, true },
+  { 119085, true },
+  { 119095, true },
+  { 119106, true },
+  { 119116, true },
+  { 119131, true },
+  { 119146, true },
+  { 119163, true },
+  { 119178, true },
+  { 119189, true },
+  { 119202, true },
+  { 119215, true },
+  { 119232, true },
+  { 119244, true },
+  { 119261, true },
+  { 119274, true },
+  { 119283, true },
+  { 119294, true },
+  { 119304, true },
+  { 119318, true },
+  { 119329, true },
+  { 119337, true },
+  { 119346, true },
+  { 119360, true },
+  { 119370, true },
+  { 119382, true },
+  { 119392, true },
+  { 119401, true },
+  { 119412, false },
+  { 119420, true },
+  { 119427, true },
+  { 119438, false },
+  { 119458, true },
+  { 119465, false },
+  { 119481, true },
+  { 119493, true },
+  { 119513, true },
+  { 119527, false },
+  { 119538, true },
+  { 119554, true },
+  { 119564, true },
+  { 119577, true },
+  { 119595, true },
+  { 119609, true },
+  { 119626, true },
+  { 119645, true },
+  { 119668, true },
+  { 119680, true },
+  { 119702, true },
+  { 119712, true },
+  { 119726, true },
+  { 119736, true },
+  { 119747, true },
+  { 119756, true },
+  { 119765, true },
+  { 119778, true },
+  { 119795, true },
+  { 119811, true },
+  { 119825, true },
+  { 119833, true },
+  { 119847, true },
+  { 119866, true },
+  { 119882, false },
+  { 119896, true },
+  { 119909, true },
+  { 119926, true },
+  { 119941, true },
+  { 119952, true },
+  { 119963, true },
+  { 119977, true },
+  { 119991, true },
+  { 120006, true },
+  { 120027, true },
+  { 120043, true },
+  { 120061, true },
+  { 120079, true },
+  { 120092, true },
+  { 120104, true },
+  { 120120, true },
+  { 120144, true },
+  { 120161, true },
+  { 120172, true },
+  { 120191, true },
+  { 120199, true },
+  { 120213, true },
+  { 120222, true },
+  { 120229, false },
+  { 120249, true },
+  { 120259, false },
+  { 120278, false },
+  { 120291, false },
+  { 120303, true },
+  { 120324, true },
+  { 120337, true },
+  { 120355, true },
+  { 120373, true },
+  { 120382, true },
+  { 120398, true },
+  { 120422, false },
+  { 120438, true },
+  { 120456, true },
+  { 120468, true },
+  { 120485, true },
+  { 120499, true },
+  { 120514, true },
+  { 120533, true },
+  { 120547, true },
+  { 120565, true },
+  { 120575, false },
+  { 120604, true },
   { 120628, true },
-  { 120647, true },
-  { 120660, true },
-  { 120675, true },
-  { 120689, true },
-  { 120704, true },
-  { 120722, true },
-  { 120732, false },
-  { 120747, true },
-  { 120755, true },
-  { 120768, false },
-  { 120782, true },
-  { 120793, true },
-  { 120801, true },
-  { 120809, true },
-  { 120823, true },
-  { 120845, true },
-  { 120857, true },
-  { 120869, true },
-  { 120884, true },
-  { 120904, true },
-  { 120927, true },
-  { 120946, true },
-  { 120965, true },
-  { 120984, true },
-  { 121003, true },
-  { 121022, true },
-  { 121041, true },
-  { 121060, true },
-  { 121077, true },
-  { 121095, true },
-  { 121112, true },
-  { 121125, true },
-  { 121139, true },
-  { 121154, true },
-  { 121172, true },
-  { 121187, true },
-  { 121200, false },
-  { 121214, true },
-  { 121238, true },
-  { 121255, true },
-  { 121273, true },
-  { 121289, true },
-  { 121307, true },
-  { 121324, true },
-  { 121340, true },
-  { 121353, true },
-  { 121366, true },
-  { 121383, true },
-  { 121415, true },
-  { 121432, true },
-  { 121440, true },
-  { 121453, true },
-  { 121467, true },
-  { 121494, true },
-  { 121510, true },
-  { 121526, true },
-  { 121540, true },
-  { 121553, true },
-  { 121566, true },
+  { 120638, true },
+  { 120657, true },
+  { 120670, true },
+  { 120685, true },
+  { 120699, true },
+  { 120714, true },
+  { 120732, true },
+  { 120742, false },
+  { 120757, true },
+  { 120765, true },
+  { 120778, false },
+  { 120792, true },
+  { 120803, true },
+  { 120811, true },
+  { 120819, true },
+  { 120833, true },
+  { 120855, true },
+  { 120867, true },
+  { 120879, true },
+  { 120894, true },
+  { 120914, true },
+  { 120937, true },
+  { 120956, true },
+  { 120975, true },
+  { 120994, true },
+  { 121013, true },
+  { 121032, true },
+  { 121051, true },
+  { 121070, true },
+  { 121087, true },
+  { 121105, true },
+  { 121122, true },
+  { 121135, true },
+  { 121149, true },
+  { 121164, true },
+  { 121182, true },
+  { 121197, true },
+  { 121210, false },
+  { 121224, true },
+  { 121248, true },
+  { 121265, true },
+  { 121283, true },
+  { 121299, true },
+  { 121317, true },
+  { 121334, true },
+  { 121350, true },
+  { 121363, true },
+  { 121376, true },
+  { 121393, true },
+  { 121425, true },
+  { 121442, true },
+  { 121450, true },
+  { 121463, true },
+  { 121477, true },
+  { 121504, true },
+  { 121520, true },
+  { 121536, true },
+  { 121550, true },
+  { 121563, true },
   { 121576, true },
-  { 121589, true },
+  { 121586, true },
   { 121599, true },
-  { 121614, true },
-  { 121629, false },
+  { 121609, true },
+  { 121624, true },
   { 121639, false },
-  { 121649, true },
-  { 121661, false },
-  { 121672, true },
-  { 121679, true },
-  { 121692, true },
-  { 121704, true },
-  { 121724, true },
-  { 121735, true },
-  { 121756, true },
-  { 121772, true },
-  { 121789, true },
-  { 121808, true },
+  { 121649, false },
+  { 121659, true },
+  { 121671, false },
+  { 121682, true },
+  { 121689, true },
+  { 121702, true },
+  { 121714, true },
+  { 121734, true },
+  { 121745, true },
+  { 121766, true },
+  { 121782, true },
+  { 121799, true },
   { 121818, true },
-  { 121829, true },
-  { 121838, true },
-  { 121847, true },
-  { 121860, true },
-  { 121889, true },
-  { 121908, true },
-  { 121925, true },
-  { 121948, true },
-  { 121956, true },
-  { 121974, false },
-  { 121988, false },
-  { 121999, true },
-  { 122012, true },
-  { 122023, true },
-  { 122036, true },
-  { 122053, true },
-  { 122066, true },
-  { 122077, false },
-  { 122089, true },
-  { 122098, true },
+  { 121828, true },
+  { 121839, true },
+  { 121848, true },
+  { 121857, true },
+  { 121870, true },
+  { 121899, true },
+  { 121918, true },
+  { 121935, true },
+  { 121958, true },
+  { 121966, true },
+  { 121984, false },
+  { 121998, false },
+  { 122009, true },
+  { 122022, true },
+  { 122033, true },
+  { 122046, true },
+  { 122063, true },
+  { 122076, true },
+  { 122087, false },
+  { 122099, true },
   { 122108, true },
-  { 122117, true },
+  { 122118, true },
   { 122127, true },
-  { 122140, true },
+  { 122137, true },
   { 122150, true },
-  { 122163, true },
+  { 122160, true },
   { 122173, true },
-  { 122186, true },
-  { 122205, true },
-  { 122216, true },
-  { 122231, true },
-  { 122245, true },
-  { 122256, true },
-  { 122268, true },
-  { 122276, true },
-  { 122290, true },
-  { 122305, false },
-  { 122319, true },
-  { 122331, true },
-  { 122346, true },
-  { 122360, true },
-  { 122369, true },
-  { 122388, true },
-  { 122409, true },
-  { 122424, true },
-  { 122436, true },
-  { 122447, true },
-  { 122460, true },
+  { 122183, true },
+  { 122196, true },
+  { 122215, true },
+  { 122226, true },
+  { 122241, true },
+  { 122255, true },
+  { 122266, true },
+  { 122278, true },
+  { 122286, true },
+  { 122300, true },
+  { 122315, false },
+  { 122329, true },
+  { 122341, true },
+  { 122356, true },
+  { 122370, true },
+  { 122379, true },
+  { 122398, true },
+  { 122419, true },
+  { 122434, true },
+  { 122446, true },
+  { 122457, true },
   { 122470, true },
-  { 122491, true },
-  { 122511, true },
-  { 122529, true },
-  { 122550, true },
-  { 122576, true },
-  { 122599, true },
-  { 122632, true },
-  { 122651, true },
-  { 122676, true },
-  { 122700, true },
-  { 122711, true },
-  { 122722, true },
-  { 122735, true },
-  { 122746, true },
-  { 122760, true },
+  { 122480, true },
+  { 122501, true },
+  { 122519, true },
+  { 122540, true },
+  { 122566, true },
+  { 122589, true },
+  { 122622, true },
+  { 122641, true },
+  { 122666, true },
+  { 122690, true },
+  { 122701, true },
+  { 122712, true },
+  { 122725, true },
+  { 122736, true },
+  { 122750, true },
+  { 122761, true },
   { 122771, true },
-  { 122781, true },
-  { 122789, true },
-  { 122796, true },
-  { 122807, true },
+  { 122779, true },
+  { 122786, true },
+  { 122797, true },
+  { 122808, true },
   { 122818, true },
-  { 122828, true },
-  { 122837, true },
-  { 122852, true },
-  { 122867, true },
-  { 122878, true },
-  { 122887, true },
-  { 122898, true },
-  { 122909, true },
-  { 122923, true },
-  { 122932, true },
-  { 122948, true },
-  { 122956, true },
-  { 122968, true },
-  { 122980, true },
+  { 122827, true },
+  { 122842, true },
+  { 122857, true },
+  { 122868, true },
+  { 122877, true },
+  { 122888, true },
+  { 122899, true },
+  { 122913, true },
+  { 122922, true },
+  { 122938, true },
+  { 122946, true },
+  { 122958, true },
+  { 122970, true },
+  { 122986, true },
   { 122996, true },
-  { 123006, true },
-  { 123025, true },
-  { 123033, true },
-  { 123046, true },
-  { 123055, true },
-  { 123076, true },
-  { 123095, true },
-  { 123111, true },
-  { 123126, true },
-  { 123139, true },
-  { 123156, true },
-  { 123172, true },
-  { 123181, true },
-  { 123189, true },
-  { 123203, true },
-  { 123222, false },
+  { 123015, true },
+  { 123023, true },
+  { 123036, true },
+  { 123045, true },
+  { 123066, true },
+  { 123085, true },
+  { 123101, true },
+  { 123116, true },
+  { 123129, true },
+  { 123146, true },
+  { 123162, true },
+  { 123171, true },
+  { 123179, true },
+  { 123193, true },
+  { 123212, false },
+  { 123221, true },
   { 123231, true },
-  { 123241, true },
-  { 123263, true },
-  { 123277, true },
-  { 123292, true },
-  { 123305, false },
-  { 123319, true },
-  { 123327, true },
-  { 123339, true },
-  { 123350, true },
-  { 123362, true },
-  { 123372, true },
-  { 123381, true },
-  { 123392, false },
-  { 123402, false },
+  { 123253, true },
+  { 123267, true },
+  { 123282, true },
+  { 123295, false },
+  { 123309, true },
+  { 123317, true },
+  { 123329, true },
+  { 123340, true },
+  { 123352, true },
+  { 123361, true },
+  { 123372, false },
+  { 123382, false },
+  { 123398, true },
+  { 123408, true },
   { 123418, true },
-  { 123428, true },
-  { 123438, true },
-  { 123452, true },
-  { 123467, true },
-  { 123479, true },
-  { 123488, true },
-  { 123501, true },
-  { 123511, true },
-  { 123524, true },
-  { 123535, true },
-  { 123558, false },
-  { 123572, true },
-  { 123584, true },
-  { 123597, true },
-  { 123610, true },
-  { 123626, true },
-  { 123637, true },
-  { 123651, true },
-  { 123665, true },
-  { 123675, true },
+  { 123432, true },
+  { 123447, true },
+  { 123459, true },
+  { 123468, true },
+  { 123481, true },
+  { 123491, true },
+  { 123504, true },
+  { 123515, true },
+  { 123538, false },
+  { 123552, true },
+  { 123564, true },
+  { 123577, true },
+  { 123590, true },
+  { 123606, true },
+  { 123617, true },
+  { 123631, true },
+  { 123645, true },
+  { 123655, true },
+  { 123664, true },
+  { 123674, true },
   { 123684, true },
-  { 123694, true },
-  { 123704, true },
-  { 123719, true },
-  { 123731, true },
-  { 123743, true },
-  { 123757, true },
-  { 123774, true },
-  { 123784, false },
-  { 123793, false },
-  { 123812, true },
-  { 123828, true },
-  { 123843, true },
-  { 123853, true },
-  { 123868, true },
-  { 123880, true },
-  { 123892, true },
-  { 123905, true },
-  { 123923, true },
-  { 123938, true },
-  { 123953, false },
-  { 123969, true },
-  { 123981, true },
-  { 123993, true },
-  { 124004, true },
-  { 124017, false },
-  { 124032, true },
-  { 124047, true },
+  { 123699, true },
+  { 123711, true },
+  { 123723, true },
+  { 123737, true },
+  { 123754, true },
+  { 123764, false },
+  { 123773, false },
+  { 123792, true },
+  { 123808, true },
+  { 123823, true },
+  { 123833, true },
+  { 123848, true },
+  { 123860, true },
+  { 123872, true },
+  { 123885, true },
+  { 123903, true },
+  { 123918, true },
+  { 123933, false },
+  { 123949, true },
+  { 123961, true },
+  { 123973, true },
+  { 123984, true },
+  { 123997, false },
+  { 124012, true },
+  { 124027, true },
+  { 124037, true },
   { 124057, true },
-  { 124077, true },
-  { 124087, true },
-  { 124101, true },
-  { 124115, true },
-  { 124127, true },
-  { 124138, true },
-  { 124154, true },
-  { 124165, true },
-  { 124183, true },
-  { 124201, true },
-  { 124214, false },
+  { 124067, true },
+  { 124081, true },
+  { 124095, true },
+  { 124107, true },
+  { 124118, true },
+  { 124134, true },
+  { 124145, true },
+  { 124163, true },
+  { 124181, true },
+  { 124194, false },
+  { 124213, true },
   { 124233, true },
-  { 124253, true },
-  { 124275, true },
-  { 124287, true },
-  { 124305, true },
-  { 124320, true },
-  { 124332, true },
-  { 124348, true },
-  { 124363, true },
-  { 124379, true },
-  { 124395, true },
-  { 124411, true },
-  { 124428, true },
-  { 124450, true },
-  { 124461, true },
+  { 124255, true },
+  { 124267, true },
+  { 124285, true },
+  { 124300, true },
+  { 124312, true },
+  { 124328, true },
+  { 124343, true },
+  { 124359, true },
+  { 124375, true },
+  { 124391, true },
+  { 124408, true },
+  { 124430, true },
+  { 124441, true },
+  { 124457, true },
   { 124477, true },
-  { 124497, true },
-  { 124508, true },
-  { 124523, true },
-  { 124539, true },
-  { 124554, true },
-  { 124569, true },
-  { 124592, true },
-  { 124607, true },
-  { 124632, true },
-  { 124650, true },
-  { 124665, true },
-  { 124681, true },
-  { 124696, true },
-  { 124725, true },
-  { 124750, true },
-  { 124772, true },
-  { 124790, true },
-  { 124804, true },
-  { 124817, true },
-  { 124832, true },
-  { 124839, true },
-  { 124855, true },
-  { 124866, true },
-  { 124877, true },
-  { 124887, true },
-  { 124901, true },
-  { 124915, true },
-  { 124927, true },
-  { 124939, true },
-  { 124950, true },
-  { 124965, true },
-  { 124980, true },
+  { 124488, true },
+  { 124503, true },
+  { 124519, true },
+  { 124534, true },
+  { 124549, true },
+  { 124572, true },
+  { 124587, true },
+  { 124612, true },
+  { 124630, true },
+  { 124645, true },
+  { 124661, true },
+  { 124676, true },
+  { 124705, true },
+  { 124730, true },
+  { 124752, true },
+  { 124770, true },
+  { 124784, true },
+  { 124797, true },
+  { 124812, true },
+  { 124819, true },
+  { 124835, true },
+  { 124846, true },
+  { 124857, true },
+  { 124867, true },
+  { 124881, true },
+  { 124895, true },
+  { 124907, true },
+  { 124919, true },
+  { 124930, true },
+  { 124945, true },
+  { 124960, true },
+  { 124967, true },
+  { 124977, true },
   { 124987, true },
-  { 124997, true },
-  { 125007, true },
-  { 125016, true },
-  { 125032, true },
-  { 125041, true },
-  { 125050, true },
-  { 125065, true },
-  { 125074, true },
-  { 125086, true },
-  { 125102, true },
-  { 125121, true },
-  { 125133, false },
+  { 124996, true },
+  { 125012, true },
+  { 125021, true },
+  { 125030, true },
+  { 125045, true },
+  { 125054, true },
+  { 125066, true },
+  { 125082, true },
+  { 125101, true },
+  { 125113, false },
+  { 125130, true },
   { 125150, true },
-  { 125170, true },
-  { 125185, true },
-  { 125198, true },
-  { 125216, true },
-  { 125231, true },
-  { 125240, true },
-  { 125255, true },
-  { 125269, true },
-  { 125285, true },
-  { 125300, true },
-  { 125322, true },
-  { 125341, true },
-  { 125360, true },
+  { 125165, true },
+  { 125178, true },
+  { 125196, true },
+  { 125211, true },
+  { 125220, true },
+  { 125235, true },
+  { 125249, true },
+  { 125265, true },
+  { 125280, true },
+  { 125302, true },
+  { 125321, true },
+  { 125340, true },
+  { 125356, true },
+  { 125367, true },
   { 125376, true },
-  { 125387, true },
-  { 125396, true },
-  { 125406, true },
-  { 125425, true },
-  { 125440, true },
-  { 125454, true },
-  { 125467, true },
-  { 125475, true },
-  { 125483, true },
-  { 125492, true },
-  { 125504, true },
-  { 125516, true },
+  { 125386, true },
+  { 125405, true },
+  { 125420, true },
+  { 125434, true },
+  { 125447, true },
+  { 125455, true },
+  { 125463, true },
+  { 125472, true },
+  { 125484, true },
+  { 125496, true },
+  { 125505, true },
+  { 125517, true },
   { 125525, true },
   { 125537, true },
-  { 125545, true },
-  { 125557, true },
-  { 125583, true },
-  { 125606, false },
+  { 125563, true },
+  { 125586, false },
+  { 125602, true },
   { 125622, true },
-  { 125642, true },
-  { 125663, true },
-  { 125682, true },
-  { 125696, true },
-  { 125710, true },
-  { 125727, true },
-  { 125741, true },
-  { 125755, true },
-  { 125765, false },
-  { 125780, true },
-  { 125788, true },
-  { 125803, true },
-  { 125818, true },
-  { 125832, true },
-  { 125850, true },
+  { 125643, true },
+  { 125662, true },
+  { 125676, true },
+  { 125690, true },
+  { 125707, true },
+  { 125721, true },
+  { 125735, true },
+  { 125745, false },
+  { 125760, true },
+  { 125768, true },
+  { 125783, true },
+  { 125798, true },
+  { 125812, true },
+  { 125830, true },
+  { 125847, true },
   { 125867, true },
-  { 125887, true },
-  { 125911, true },
-  { 125918, true },
-  { 125929, true },
-  { 125940, true },
-  { 125953, true },
-  { 125965, false },
-  { 125980, true },
-  { 125996, true },
-  { 126009, true },
-  { 126019, true },
-  { 126034, false },
-  { 126043, true },
-  { 126057, true },
+  { 125891, true },
+  { 125898, true },
+  { 125909, true },
+  { 125920, true },
+  { 125933, true },
+  { 125945, false },
+  { 125960, true },
+  { 125976, true },
+  { 125989, true },
+  { 125999, true },
+  { 126014, false },
+  { 126023, true },
+  { 126037, true },
+  { 126052, true },
+  { 126062, true },
   { 126072, true },
-  { 126082, true },
-  { 126094, true },
-  { 126104, true },
-  { 126117, true },
-  { 126129, true },
+  { 126085, true },
+  { 126097, true },
+  { 126105, true },
+  { 126116, true },
   { 126137, true },
-  { 126148, true },
-  { 126169, true },
-  { 126179, false },
-  { 126199, true },
-  { 126210, true },
-  { 126217, true },
-  { 126227, true },
-  { 126237, true },
-  { 126245, false },
-  { 126265, true },
-  { 126274, true },
-  { 126283, true },
-  { 126301, true },
-  { 126313, true },
-  { 126327, true },
-  { 126342, true },
-  { 126354, true },
-  { 126367, true },
-  { 126375, true },
-  { 126393, true },
-  { 126404, true },
+  { 126147, false },
+  { 126167, true },
+  { 126178, true },
+  { 126185, true },
+  { 126195, true },
+  { 126205, true },
+  { 126213, false },
+  { 126233, true },
+  { 126242, true },
+  { 126251, true },
+  { 126269, true },
+  { 126281, true },
+  { 126295, true },
+  { 126310, true },
+  { 126322, true },
+  { 126335, true },
+  { 126343, true },
+  { 126361, true },
+  { 126372, true },
+  { 126380, true },
+  { 126390, true },
+  { 126399, true },
   { 126412, true },
   { 126422, true },
-  { 126431, true },
-  { 126444, true },
-  { 126454, true },
-  { 126466, true },
-  { 126478, true },
-  { 126492, true },
-  { 126508, true },
-  { 126526, true },
-  { 126539, true },
-  { 126552, false },
-  { 126565, true },
-  { 126584, true },
+  { 126434, true },
+  { 126446, true },
+  { 126460, true },
+  { 126476, true },
+  { 126494, true },
+  { 126507, true },
+  { 126520, false },
+  { 126533, true },
+  { 126552, true },
+  { 126560, true },
+  { 126572, true },
   { 126592, true },
   { 126604, true },
-  { 126624, true },
-  { 126636, true },
-  { 126662, true },
-  { 126680, true },
-  { 126697, true },
-  { 126708, true },
-  { 126720, true },
-  { 126733, true },
+  { 126630, true },
+  { 126648, true },
+  { 126665, true },
+  { 126676, true },
+  { 126688, true },
+  { 126701, true },
+  { 126717, true },
+  { 126731, true },
   { 126749, true },
-  { 126763, true },
-  { 126781, true },
-  { 126797, true },
-  { 126820, true },
-  { 126839, true },
+  { 126765, true },
+  { 126788, true },
+  { 126807, true },
+  { 126821, true },
+  { 126837, true },
   { 126853, true },
-  { 126869, true },
-  { 126885, true },
-  { 126902, true },
-  { 126932, false },
-  { 126948, true },
-  { 126960, true },
-  { 126971, true },
-  { 126984, true },
-  { 127001, true },
+  { 126870, true },
+  { 126900, false },
+  { 126916, true },
+  { 126928, true },
+  { 126939, true },
+  { 126952, true },
+  { 126969, true },
+  { 126983, true },
+  { 127000, true },
   { 127015, true },
-  { 127032, true },
-  { 127047, true },
-  { 127062, true },
-  { 127073, true },
-  { 127091, true },
-  { 127107, true },
-  { 127119, true },
-  { 127136, true },
-  { 127148, false },
-  { 127162, true },
-  { 127169, false },
-  { 127201, true },
-  { 127215, true },
-  { 127225, true },
-  { 127239, true },
-  { 127256, true },
-  { 127268, true },
-  { 127282, true },
-  { 127298, true },
-  { 127313, true },
+  { 127030, true },
+  { 127041, true },
+  { 127059, true },
+  { 127075, true },
+  { 127087, true },
+  { 127104, true },
+  { 127116, false },
+  { 127130, true },
+  { 127137, false },
+  { 127169, true },
+  { 127183, true },
+  { 127193, true },
+  { 127207, true },
+  { 127224, true },
+  { 127236, true },
+  { 127250, true },
+  { 127266, true },
+  { 127281, true },
+  { 127292, true },
+  { 127303, true },
+  { 127315, true },
   { 127324, true },
-  { 127335, true },
-  { 127347, true },
-  { 127356, true },
-  { 127365, true },
-  { 127372, true },
-  { 127383, true },
-  { 127391, true },
-  { 127398, true },
-  { 127408, true },
-  { 127419, true },
-  { 127427, true },
-  { 127435, true },
-  { 127443, true },
-  { 127456, true },
-  { 127471, true },
-  { 127481, true },
-  { 127491, true },
-  { 127498, true },
-  { 127510, true },
-  { 127526, true },
-  { 127538, true },
-  { 127550, true },
-  { 127562, true },
-  { 127571, true },
-  { 127582, true },
-  { 127597, true },
-  { 127605, true },
+  { 127331, true },
+  { 127342, true },
+  { 127350, true },
+  { 127357, true },
+  { 127367, true },
+  { 127378, true },
+  { 127386, true },
+  { 127394, true },
+  { 127402, true },
+  { 127415, true },
+  { 127430, true },
+  { 127440, true },
+  { 127450, true },
+  { 127457, true },
+  { 127469, true },
+  { 127485, true },
+  { 127497, true },
+  { 127509, true },
+  { 127521, true },
+  { 127530, true },
+  { 127541, true },
+  { 127556, true },
+  { 127564, true },
+  { 127575, true },
+  { 127586, true },
+  { 127600, true },
   { 127616, true },
-  { 127627, true },
-  { 127641, true },
-  { 127657, true },
-  { 127669, true },
-  { 127683, true },
-  { 127697, false },
-  { 127707, true },
-  { 127728, true },
+  { 127628, true },
+  { 127642, true },
+  { 127656, false },
+  { 127666, true },
+  { 127687, true },
+  { 127708, true },
+  { 127722, true },
+  { 127734, true },
   { 127749, true },
-  { 127763, true },
-  { 127775, true },
-  { 127790, true },
-  { 127807, true },
-  { 127820, true },
-  { 127834, true },
-  { 127845, true },
-  { 127854, true },
-  { 127864, true },
-  { 127871, true },
-  { 127883, true },
-  { 127892, true },
-  { 127901, true },
-  { 127909, true },
-  { 127924, true },
-  { 127932, true },
-  { 127944, false },
-  { 127954, true },
-  { 127964, true },
-  { 127975, true },
-  { 127984, true },
-  { 128002, true },
-  { 128012, false },
-  { 128023, true },
-  { 128045, true },
-  { 128053, true },
-  { 128061, false },
-  { 128069, true },
-  { 128085, true },
-  { 128098, true },
-  { 128109, true },
-  { 128121, true },
-  { 128140, true },
-  { 128166, true },
-  { 128180, true },
-  { 128194, true },
+  { 127766, true },
+  { 127779, true },
+  { 127793, true },
+  { 127804, true },
+  { 127813, true },
+  { 127823, true },
+  { 127830, true },
+  { 127838, true },
+  { 127850, true },
+  { 127859, true },
+  { 127868, true },
+  { 127876, true },
+  { 127891, true },
+  { 127899, true },
+  { 127911, false },
+  { 127921, true },
+  { 127931, true },
+  { 127942, true },
+  { 127951, true },
+  { 127969, true },
+  { 127979, false },
+  { 127990, true },
+  { 128012, true },
+  { 128020, true },
+  { 128028, false },
+  { 128036, true },
+  { 128052, true },
+  { 128065, true },
+  { 128076, true },
+  { 128088, true },
+  { 128107, true },
+  { 128133, true },
+  { 128147, true },
+  { 128161, true },
+  { 128175, true },
+  { 128190, false },
   { 128208, true },
-  { 128223, false },
-  { 128241, true },
-  { 128257, true },
-  { 128272, true },
-  { 128283, true },
-  { 128299, true },
-  { 128311, true },
-  { 128323, true },
-  { 128336, true },
-  { 128348, true },
-  { 128355, true },
-  { 128368, true },
-  { 128385, true },
-  { 128407, true },
+  { 128224, true },
+  { 128239, true },
+  { 128250, true },
+  { 128266, true },
+  { 128278, true },
+  { 128290, true },
+  { 128303, true },
+  { 128315, true },
+  { 128322, true },
+  { 128335, true },
+  { 128352, true },
+  { 128374, true },
+  { 128384, true },
+  { 128394, true },
+  { 128406, false },
   { 128417, true },
-  { 128427, true },
-  { 128439, false },
-  { 128450, true },
-  { 128464, true },
-  { 128473, true },
-  { 128484, true },
-  { 128500, true },
-  { 128513, true },
-  { 128529, true },
-  { 128556, true },
-  { 128568, true },
-  { 128582, true },
+  { 128431, true },
+  { 128440, true },
+  { 128451, true },
+  { 128467, true },
+  { 128480, true },
+  { 128496, true },
+  { 128523, true },
+  { 128535, true },
+  { 128549, true },
+  { 128557, true },
+  { 128567, true },
   { 128590, true },
-  { 128600, true },
-  { 128623, true },
-  { 128632, false },
-  { 128655, true },
-  { 128673, true },
-  { 128690, true },
-  { 128699, true },
-  { 128711, true },
-  { 128725, true },
-  { 128734, true },
-  { 128742, true },
-  { 128755, true },
-  { 128780, true },
-  { 128791, true },
-  { 128804, true },
-  { 128818, true },
-  { 128831, false },
-  { 128842, true },
-  { 128850, true },
-  { 128862, false },
-  { 128873, true },
-  { 128888, true },
-  { 128908, true },
-  { 128916, true },
-  { 128934, true },
-  { 128954, true },
-  { 128973, true },
-  { 128994, true },
-  { 129012, true },
-  { 129022, true },
-  { 129035, true },
-  { 129066, true },
-  { 129086, true },
-  { 129103, true },
-  { 129116, true },
-  { 129131, true },
-  { 129143, true },
-  { 129153, true },
+  { 128599, false },
+  { 128622, true },
+  { 128640, true },
+  { 128657, true },
+  { 128666, true },
+  { 128678, true },
+  { 128692, true },
+  { 128701, true },
+  { 128709, true },
+  { 128722, true },
+  { 128747, true },
+  { 128758, true },
+  { 128771, true },
+  { 128785, true },
+  { 128798, false },
+  { 128809, true },
+  { 128817, true },
+  { 128829, false },
+  { 128840, true },
+  { 128855, true },
+  { 128875, true },
+  { 128883, true },
+  { 128901, true },
+  { 128921, true },
+  { 128940, true },
+  { 128961, true },
+  { 128979, true },
+  { 128989, true },
+  { 129002, true },
+  { 129033, true },
+  { 129053, true },
+  { 129070, true },
+  { 129083, true },
+  { 129098, true },
+  { 129110, true },
+  { 129120, true },
+  { 129127, true },
+  { 129144, true },
   { 129160, true },
-  { 129177, true },
-  { 129193, true },
-  { 129205, true },
+  { 129172, true },
+  { 129186, true },
+  { 129201, true },
   { 129219, true },
-  { 129234, true },
-  { 129252, true },
+  { 129232, true },
+  { 129243, true },
+  { 129254, true },
   { 129265, true },
-  { 129275, true },
-  { 129286, true },
-  { 129297, true },
-  { 129308, true },
-  { 129323, true },
-  { 129334, true },
-  { 129346, false },
-  { 129358, true },
-  { 129375, true },
-  { 129389, true },
-  { 129406, true },
-  { 129416, true },
-  { 129429, false },
-  { 129447, true },
-  { 129458, true },
-  { 129474, true },
-  { 129489, true },
-  { 129506, true },
-  { 129523, true },
-  { 129540, true },
-  { 129550, true },
-  { 129565, true },
-  { 129575, true },
-  { 129590, true },
-  { 129607, true },
-  { 129625, true },
-  { 129640, true },
+  { 129280, true },
+  { 129291, true },
+  { 129303, false },
+  { 129315, true },
+  { 129332, true },
+  { 129346, true },
+  { 129363, true },
+  { 129376, false },
+  { 129394, true },
+  { 129405, true },
+  { 129421, true },
+  { 129436, true },
+  { 129453, true },
+  { 129470, true },
+  { 129487, true },
+  { 129497, true },
+  { 129512, true },
+  { 129522, true },
+  { 129537, true },
+  { 129554, true },
+  { 129572, true },
+  { 129587, true },
+  { 129612, true },
+  { 129629, true },
+  { 129648, true },
   { 129665, true },
-  { 129682, true },
-  { 129701, true },
-  { 129718, true },
-  { 129738, true },
-  { 129759, true },
-  { 129773, true },
-  { 129798, true },
-  { 129819, true },
-  { 129841, true },
-  { 129871, true },
-  { 129895, true },
-  { 129910, true },
-  { 129920, true },
-  { 129943, true },
+  { 129685, true },
+  { 129706, true },
+  { 129720, true },
+  { 129745, true },
+  { 129766, true },
+  { 129788, true },
+  { 129818, true },
+  { 129842, true },
+  { 129857, true },
+  { 129870, true },
+  { 129880, true },
+  { 129903, true },
+  { 129914, true },
+  { 129921, true },
+  { 129935, true },
   { 129954, true },
   { 129961, true },
-  { 129975, true },
-  { 129994, true },
-  { 130001, true },
-  { 130021, true },
-  { 130032, true },
-  { 130051, true },
-  { 130067, true },
-  { 130077, true },
-  { 130088, true },
-  { 130098, true },
-  { 130109, true },
-  { 130123, true },
-  { 130135, true },
+  { 129981, true },
+  { 129992, true },
+  { 130011, true },
+  { 130027, true },
+  { 130037, true },
+  { 130048, true },
+  { 130058, true },
+  { 130069, true },
+  { 130083, true },
+  { 130095, true },
+  { 130111, true },
+  { 130119, true },
+  { 130129, true },
+  { 130139, true },
   { 130151, true },
-  { 130159, true },
-  { 130169, true },
-  { 130179, true },
-  { 130191, true },
-  { 130202, true },
-  { 130217, true },
+  { 130162, true },
+  { 130177, true },
+  { 130201, true },
+  { 130215, true },
+  { 130223, true },
   { 130241, true },
-  { 130255, true },
-  { 130263, true },
-  { 130281, true },
-  { 130292, true },
-  { 130305, true },
-  { 130316, true },
-  { 130335, true },
-  { 130346, true },
-  { 130361, true },
-  { 130376, true },
-  { 130388, true },
-  { 130406, true },
-  { 130426, true },
-  { 130438, true },
-  { 130455, true },
-  { 130470, true },
-  { 130484, true },
-  { 130498, true },
-  { 130509, true },
-  { 130518, true },
-  { 130527, true },
-  { 130545, true },
-  { 130556, true },
-  { 130570, true },
-  { 130577, true },
-  { 130594, false },
-  { 130620, false },
-  { 130632, true },
-  { 130645, true },
-  { 130659, true },
+  { 130252, true },
+  { 130265, true },
+  { 130276, true },
+  { 130295, true },
+  { 130306, true },
+  { 130321, true },
+  { 130336, true },
+  { 130348, true },
+  { 130366, true },
+  { 130386, true },
+  { 130398, true },
+  { 130415, true },
+  { 130430, true },
+  { 130444, true },
+  { 130458, true },
+  { 130469, true },
+  { 130478, true },
+  { 130487, true },
+  { 130505, true },
+  { 130516, true },
+  { 130530, true },
+  { 130537, true },
+  { 130554, false },
+  { 130580, false },
+  { 130592, true },
+  { 130605, true },
+  { 130619, true },
+  { 130630, true },
+  { 130647, true },
+  { 130657, true },
   { 130670, true },
-  { 130687, true },
-  { 130697, true },
-  { 130710, true },
-  { 130725, true },
-  { 130746, true },
-  { 130770, true },
-  { 130784, true },
-  { 130795, true },
-  { 130809, true },
-  { 130821, true },
-  { 130836, true },
-  { 130846, true },
-  { 130859, true },
-  { 130872, true },
-  { 130885, true },
-  { 130908, true },
-  { 130928, true },
-  { 130950, true },
-  { 130964, true },
-  { 130979, true },
-  { 130994, false },
-  { 131007, true },
-  { 131022, true },
-  { 131033, true },
-  { 131053, true },
-  { 131066, false },
-  { 131085, true },
-  { 131096, true },
-  { 131115, true },
-  { 131123, true },
-  { 131140, true },
+  { 130685, true },
+  { 130706, true },
+  { 130730, true },
+  { 130744, true },
+  { 130755, true },
+  { 130769, true },
+  { 130781, true },
+  { 130796, true },
+  { 130806, true },
+  { 130819, true },
+  { 130832, true },
+  { 130845, true },
+  { 130868, true },
+  { 130888, true },
+  { 130910, true },
+  { 130924, true },
+  { 130939, true },
+  { 130954, false },
+  { 130967, true },
+  { 130982, true },
+  { 130993, true },
+  { 131013, true },
+  { 131026, false },
+  { 131045, true },
+  { 131056, true },
+  { 131075, true },
+  { 131083, true },
+  { 131100, true },
+  { 131116, true },
+  { 131125, true },
+  { 131136, true },
+  { 131146, true },
   { 131156, true },
-  { 131165, true },
-  { 131176, true },
-  { 131186, true },
-  { 131196, true },
-  { 131207, true },
-  { 131217, true },
-  { 131224, true },
-  { 131242, true },
-  { 131254, true },
-  { 131265, true },
-  { 131287, true },
-  { 131301, true },
-  { 131320, true },
+  { 131167, true },
+  { 131177, true },
+  { 131184, true },
+  { 131202, true },
+  { 131214, true },
+  { 131225, true },
+  { 131247, true },
+  { 131261, true },
+  { 131280, true },
+  { 131288, true },
+  { 131307, true },
+  { 131316, true },
   { 131328, true },
-  { 131347, true },
-  { 131356, true },
-  { 131368, true },
-  { 131386, true },
-  { 131400, true },
-  { 131419, true },
-  { 131428, true },
-  { 131444, true },
-  { 131452, true },
-  { 131464, true },
-  { 131479, true },
-  { 131499, true },
-  { 131507, true },
-  { 131520, true },
-  { 131538, true },
-  { 131550, true },
-  { 131569, true },
-  { 131583, true },
-  { 131596, true },
+  { 131346, true },
+  { 131360, true },
+  { 131379, true },
+  { 131388, true },
+  { 131404, true },
+  { 131412, true },
+  { 131424, true },
+  { 131439, true },
+  { 131459, true },
+  { 131467, true },
+  { 131480, true },
+  { 131498, true },
+  { 131510, true },
+  { 131529, true },
+  { 131543, true },
+  { 131556, true },
+  { 131568, true },
+  { 131592, true },
   { 131608, true },
-  { 131632, true },
-  { 131648, true },
-  { 131662, true },
-  { 131676, true },
-  { 131693, true },
-  { 131709, true },
-  { 131726, true },
-  { 131734, true },
-  { 131752, true },
-  { 131761, false },
-  { 131770, true },
-  { 131784, true },
-  { 131794, true },
-  { 131805, true },
-  { 131814, true },
-  { 131837, true },
-  { 131849, true },
-  { 131859, false },
-  { 131868, true },
+  { 131622, true },
+  { 131636, true },
+  { 131653, true },
+  { 131669, true },
+  { 131686, true },
+  { 131694, true },
+  { 131712, true },
+  { 131721, false },
+  { 131730, true },
+  { 131744, true },
+  { 131754, true },
+  { 131765, true },
+  { 131774, true },
+  { 131797, true },
+  { 131809, true },
+  { 131819, false },
+  { 131828, true },
+  { 131835, true },
+  { 131844, true },
+  { 131852, true },
+  { 131861, false },
   { 131875, true },
-  { 131884, true },
-  { 131892, true },
-  { 131901, false },
-  { 131915, true },
-  { 131929, true },
-  { 131939, true },
-  { 131949, true },
-  { 131959, true },
-  { 131977, false },
-  { 131990, true },
-  { 132008, true },
-  { 132018, true },
-  { 132029, true },
-  { 132038, true },
-  { 132051, true },
-  { 132065, true },
-  { 132080, true },
-  { 132093, true },
-  { 132103, true },
-  { 132114, true },
-  { 132123, true },
-  { 132140, true },
-  { 132149, true },
-  { 132162, true },
+  { 131889, true },
+  { 131899, true },
+  { 131909, true },
+  { 131919, true },
+  { 131937, false },
+  { 131950, true },
+  { 131968, true },
+  { 131978, true },
+  { 131989, true },
+  { 131998, true },
+  { 132011, true },
+  { 132025, true },
+  { 132040, true },
+  { 132053, true },
+  { 132063, true },
+  { 132074, true },
+  { 132083, true },
+  { 132100, true },
+  { 132109, true },
+  { 132122, true },
+  { 132133, true },
+  { 132151, true },
+  { 132161, true },
   { 132173, true },
-  { 132191, true },
-  { 132201, true },
-  { 132213, true },
-  { 132225, false },
-  { 132242, true },
-  { 132265, true },
-  { 132276, true },
-  { 132293, true },
-  { 132306, true },
-  { 132320, true },
-  { 132329, true },
-  { 132342, false },
-  { 132351, false },
-  { 132362, true },
+  { 132185, false },
+  { 132202, true },
+  { 132225, true },
+  { 132236, true },
+  { 132253, true },
+  { 132266, true },
+  { 132280, true },
+  { 132289, true },
+  { 132302, false },
+  { 132311, false },
+  { 132322, true },
+  { 132334, false },
+  { 132349, false },
+  { 132360, true },
   { 132374, false },
-  { 132389, false },
-  { 132400, true },
-  { 132414, false },
-  { 132421, true },
-  { 132437, true },
-  { 132452, true },
-  { 132470, true },
-  { 132489, true },
-  { 132504, true },
-  { 132521, true },
-  { 132535, true },
-  { 132549, true },
-  { 132566, true },
-  { 132585, false },
-  { 132600, false },
-  { 132614, true },
-  { 132628, true },
-  { 132641, true },
-  { 132662, true },
-  { 132674, true },
-  { 132687, true },
-  { 132697, true },
-  { 132717, true },
-  { 132730, true },
-  { 132742, true },
-  { 132760, true },
-  { 132779, true },
-  { 132797, true },
-  { 132811, true },
+  { 132381, true },
+  { 132397, true },
+  { 132412, true },
+  { 132430, true },
+  { 132449, true },
+  { 132464, true },
+  { 132481, true },
+  { 132495, true },
+  { 132511, true },
+  { 132525, true },
+  { 132542, true },
+  { 132561, false },
+  { 132576, false },
+  { 132590, true },
+  { 132604, true },
+  { 132617, true },
+  { 132638, true },
+  { 132650, true },
+  { 132663, true },
+  { 132673, true },
+  { 132693, true },
+  { 132706, true },
+  { 132718, true },
+  { 132736, true },
+  { 132755, true },
+  { 132773, true },
+  { 132787, true },
+  { 132799, true },
+  { 132809, true },
   { 132823, true },
   { 132833, true },
-  { 132847, true },
-  { 132857, true },
-  { 132873, true },
-  { 132886, true },
-  { 132901, true },
+  { 132849, true },
+  { 132862, true },
+  { 132877, true },
+  { 132893, true },
   { 132917, true },
-  { 132941, true },
-  { 132957, true },
+  { 132933, true },
+  { 132947, true },
+  { 132959, true },
   { 132971, true },
-  { 132983, true },
-  { 132995, true },
-  { 133013, true },
-  { 133026, true },
-  { 133045, true },
-  { 133063, true },
-  { 133078, true },
-  { 133101, true },
-  { 133118, true },
-  { 133137, true },
-  { 133157, true },
-  { 133180, true },
-  { 133199, true },
-  { 133218, true },
-  { 133237, true },
-  { 133256, true },
-  { 133267, true },
-  { 133277, true },
-  { 133292, true },
-  { 133313, true },
-  { 133333, true },
-  { 133352, true },
+  { 132989, true },
+  { 133002, true },
+  { 133021, true },
+  { 133039, true },
+  { 133054, true },
+  { 133077, true },
+  { 133094, true },
+  { 133113, true },
+  { 133133, true },
+  { 133156, true },
+  { 133175, true },
+  { 133194, true },
+  { 133213, true },
+  { 133232, true },
+  { 133243, true },
+  { 133253, true },
+  { 133268, true },
+  { 133289, true },
+  { 133309, true },
+  { 133328, true },
+  { 133342, true },
+  { 133354, true },
   { 133366, true },
-  { 133378, true },
-  { 133390, true },
-  { 133408, true },
-  { 133424, true },
-  { 133445, true },
-  { 133457, true },
-  { 133467, false },
-  { 133479, true },
-  { 133496, true },
-  { 133514, true },
-  { 133534, true },
-  { 133549, true },
-  { 133561, true },
-  { 133572, true },
-  { 133584, true },
-  { 133596, false },
-  { 133613, true },
-  { 133626, true },
-  { 133644, true },
-  { 133659, true },
-  { 133674, true },
-  { 133694, true },
-  { 133706, true },
-  { 133720, true },
-  { 133738, true },
-  { 133751, true },
-  { 133767, true },
-  { 133782, true },
-  { 133794, true },
-  { 133810, true },
-  { 133820, true },
-  { 133827, true },
-  { 133842, true },
-  { 133862, true },
-  { 133875, true },
-  { 133886, true },
-  { 133899, true },
-  { 133908, true },
-  { 133928, true },
-  { 133948, true },
-  { 133971, true },
-  { 133991, true },
-  { 134003, true },
-  { 134014, true },
-  { 134025, false },
-  { 134036, true },
-  { 134047, false },
-  { 134057, false },
+  { 133384, true },
+  { 133400, true },
+  { 133421, true },
+  { 133433, true },
+  { 133443, false },
+  { 133455, true },
+  { 133472, true },
+  { 133490, true },
+  { 133510, true },
+  { 133525, true },
+  { 133537, true },
+  { 133548, true },
+  { 133560, true },
+  { 133572, false },
+  { 133589, true },
+  { 133602, true },
+  { 133620, true },
+  { 133635, true },
+  { 133650, true },
+  { 133670, true },
+  { 133682, true },
+  { 133696, true },
+  { 133714, true },
+  { 133727, true },
+  { 133743, true },
+  { 133758, true },
+  { 133770, true },
+  { 133786, true },
+  { 133801, true },
+  { 133821, true },
+  { 133834, true },
+  { 133845, true },
+  { 133858, true },
+  { 133867, true },
+  { 133887, true },
+  { 133907, true },
+  { 133930, true },
+  { 133950, true },
+  { 133962, true },
+  { 133973, true },
+  { 133984, false },
+  { 133995, true },
+  { 134006, false },
+  { 134016, false },
+  { 134033, true },
+  { 134045, true },
+  { 134061, true },
   { 134074, true },
-  { 134086, true },
-  { 134102, true },
-  { 134115, true },
-  { 134124, true },
+  { 134083, true },
+  { 134097, true },
+  { 134108, true },
+  { 134120, true },
   { 134138, true },
-  { 134149, true },
-  { 134161, true },
-  { 134179, true },
-  { 134193, true },
-  { 134206, true },
-  { 134215, true },
-  { 134230, true },
-  { 134241, true },
-  { 134261, true },
-  { 134273, true },
-  { 134283, true },
-  { 134294, true },
-  { 134327, true },
-  { 134339, true },
-  { 134358, true },
-  { 134369, true },
-  { 134383, true },
-  { 134397, false },
+  { 134152, true },
+  { 134165, true },
+  { 134174, true },
+  { 134189, true },
+  { 134200, true },
+  { 134220, true },
+  { 134232, true },
+  { 134242, true },
+  { 134253, true },
+  { 134286, true },
+  { 134298, true },
+  { 134317, true },
+  { 134328, true },
+  { 134342, true },
+  { 134356, false },
+  { 134376, true },
+  { 134393, true },
+  { 134404, true },
   { 134417, true },
-  { 134434, true },
-  { 134445, true },
-  { 134458, true },
-  { 134473, true },
-  { 134491, true },
-  { 134507, true },
-  { 134524, true },
-  { 134536, true },
+  { 134432, true },
+  { 134450, true },
+  { 134466, true },
+  { 134483, true },
+  { 134495, true },
+  { 134509, true },
+  { 134525, true },
+  { 134538, true },
   { 134550, true },
-  { 134566, true },
-  { 134579, true },
-  { 134591, true },
-  { 134602, true },
-  { 134619, true },
-  { 134628, true },
-  { 134637, true },
-  { 134650, true },
-  { 134681, true },
-  { 134694, true },
-  { 134707, true },
-  { 134720, true },
-  { 134731, true },
-  { 134740, true },
-  { 134755, true },
-  { 134767, true },
-  { 134783, true },
-  { 134804, true },
-  { 134821, false },
-  { 134834, true },
-  { 134848, true },
-  { 134860, true },
-  { 134871, true },
-  { 134888, true },
-  { 134899, true },
-  { 134918, true },
-  { 134936, true },
-  { 134972, true },
-  { 134985, true },
-  { 134999, true },
-  { 135008, true },
-  { 135018, true },
-  { 135030, true },
-  { 135048, true },
-  { 135062, true },
+  { 134561, true },
+  { 134578, true },
+  { 134587, true },
+  { 134596, true },
+  { 134609, true },
+  { 134640, true },
+  { 134653, true },
+  { 134666, true },
+  { 134679, true },
+  { 134690, true },
+  { 134699, true },
+  { 134714, true },
+  { 134726, true },
+  { 134742, true },
+  { 134763, true },
+  { 134780, false },
+  { 134793, true },
+  { 134807, true },
+  { 134819, true },
+  { 134830, true },
+  { 134847, true },
+  { 134858, true },
+  { 134877, true },
+  { 134895, true },
+  { 134931, true },
+  { 134944, true },
+  { 134958, true },
+  { 134967, true },
+  { 134977, true },
+  { 134989, true },
+  { 135007, true },
+  { 135021, true },
+  { 135039, true },
+  { 135060, true },
   { 135080, true },
-  { 135101, true },
-  { 135121, true },
-  { 135144, true },
-  { 135160, true },
-  { 135174, true },
-  { 135190, true },
-  { 135204, true },
+  { 135103, true },
+  { 135119, true },
+  { 135133, true },
+  { 135149, true },
+  { 135163, true },
+  { 135176, true },
+  { 135197, true },
   { 135217, true },
-  { 135238, true },
-  { 135258, true },
-  { 135267, true },
+  { 135226, true },
+  { 135243, true },
+  { 135254, true },
+  { 135265, true },
   { 135284, true },
-  { 135295, true },
-  { 135306, true },
-  { 135317, true },
-  { 135336, true },
-  { 135348, true },
-  { 135361, true },
-  { 135377, true },
-  { 135396, true },
+  { 135296, true },
+  { 135309, true },
+  { 135325, true },
+  { 135344, true },
+  { 135359, true },
+  { 135376, false },
+  { 135391, true },
   { 135411, true },
-  { 135428, false },
-  { 135443, true },
-  { 135463, true },
-  { 135474, true },
-  { 135485, true },
-  { 135505, false },
-  { 135514, true },
-  { 135523, true },
-  { 135534, true },
-  { 135546, true },
-  { 135560, true },
-  { 135578, true },
-  { 135592, true },
-  { 135604, true },
-  { 135619, true },
-  { 135632, true },
-  { 135649, true },
-  { 135659, true },
-  { 135680, true },
-  { 135708, false },
+  { 135422, true },
+  { 135433, true },
+  { 135453, false },
+  { 135462, true },
+  { 135471, true },
+  { 135482, true },
+  { 135494, true },
+  { 135508, true },
+  { 135526, true },
+  { 135540, true },
+  { 135552, true },
+  { 135567, true },
+  { 135580, true },
+  { 135597, true },
+  { 135607, true },
+  { 135628, true },
+  { 135656, false },
+  { 135667, true },
+  { 135674, true },
+  { 135685, true },
+  { 135695, true },
+  { 135705, true },
   { 135719, true },
-  { 135726, true },
-  { 135737, true },
-  { 135747, true },
-  { 135757, true },
-  { 135771, true },
-  { 135785, true },
-  { 135796, false },
-  { 135807, true },
-  { 135815, false },
-  { 135835, true },
-  { 135850, true },
-  { 135863, true },
-  { 135879, true },
-  { 135894, true },
-  { 135907, true },
+  { 135733, true },
+  { 135744, false },
+  { 135755, true },
+  { 135763, false },
+  { 135783, true },
+  { 135798, true },
+  { 135811, true },
+  { 135827, true },
+  { 135842, true },
+  { 135855, true },
+  { 135871, true },
+  { 135891, true },
+  { 135904, true },
   { 135923, true },
-  { 135943, true },
-  { 135956, true },
-  { 135975, true },
-  { 135993, true },
-  { 136003, true },
-  { 136017, true },
-  { 136035, true },
+  { 135941, true },
+  { 135951, true },
+  { 135965, true },
+  { 135983, true },
+  { 135991, true },
+  { 136011, true },
   { 136043, true },
-  { 136063, true },
-  { 136095, true },
-  { 136110, true },
-  { 136129, true },
-  { 136144, true },
-  { 136159, true },
-  { 136180, true },
-  { 136201, true },
-  { 136215, true },
-  { 136237, true },
-  { 136253, true },
-  { 136278, true },
-  { 136290, true },
-  { 136303, true },
-  { 136314, true },
-  { 136331, true },
-  { 136355, true },
-  { 136369, true },
-  { 136382, true },
-  { 136394, true },
-  { 136407, true },
-  { 136425, true },
-  { 136442, true },
-  { 136462, true },
-  { 136487, true },
-  { 136500, true },
-  { 136514, true },
-  { 136528, true },
-  { 136545, true },
-  { 136565, true },
-  { 136581, true },
-  { 136599, true },
-  { 136614, true },
-  { 136627, true },
-  { 136642, true },
-  { 136650, false },
-  { 136663, true },
-  { 136675, true },
-  { 136689, true },
-  { 136697, true },
-  { 136719, true },
-  { 136733, true },
-  { 136747, true },
-  { 136755, true },
-  { 136766, true },
-  { 136782, true },
-  { 136795, true },
-  { 136808, true },
-  { 136822, true },
-  { 136838, true },
-  { 136851, true },
-  { 136865, true },
-  { 136876, true },
-  { 136886, true },
-  { 136906, true },
-  { 136920, true },
-  { 136935, true },
-  { 136947, true },
-  { 136955, true },
-  { 136967, true },
-  { 136978, true },
-  { 136999, true },
-  { 137018, true },
-  { 137036, true },
-  { 137054, true },
-  { 137074, true },
-  { 137083, true },
-  { 137101, true },
-  { 137117, true },
-  { 137130, true },
-  { 137144, true },
-  { 137163, true },
-  { 137176, true },
-  { 137188, true },
-  { 137200, true },
-  { 137211, true },
-  { 137225, true },
-  { 137239, false },
+  { 136058, true },
+  { 136077, true },
+  { 136092, true },
+  { 136107, true },
+  { 136128, true },
+  { 136149, true },
+  { 136163, true },
+  { 136179, true },
+  { 136204, true },
+  { 136216, true },
+  { 136229, true },
+  { 136240, true },
+  { 136257, true },
+  { 136281, true },
+  { 136295, true },
+  { 136308, true },
+  { 136320, true },
+  { 136333, true },
+  { 136351, true },
+  { 136368, true },
+  { 136388, true },
+  { 136413, true },
+  { 136426, true },
+  { 136440, true },
+  { 136454, true },
+  { 136471, true },
+  { 136491, true },
+  { 136507, true },
+  { 136525, true },
+  { 136540, true },
+  { 136553, true },
+  { 136568, true },
+  { 136576, false },
+  { 136589, true },
+  { 136601, true },
+  { 136615, true },
+  { 136623, true },
+  { 136645, true },
+  { 136659, true },
+  { 136673, true },
+  { 136681, true },
+  { 136692, true },
+  { 136708, true },
+  { 136721, true },
+  { 136734, true },
+  { 136748, true },
+  { 136764, true },
+  { 136777, true },
+  { 136791, true },
+  { 136802, true },
+  { 136812, true },
+  { 136832, true },
+  { 136846, true },
+  { 136861, true },
+  { 136873, true },
+  { 136881, true },
+  { 136893, true },
+  { 136904, true },
+  { 136925, true },
+  { 136944, true },
+  { 136962, true },
+  { 136980, true },
+  { 137000, true },
+  { 137009, true },
+  { 137027, true },
+  { 137043, true },
+  { 137056, true },
+  { 137070, true },
+  { 137089, true },
+  { 137102, true },
+  { 137114, true },
+  { 137126, true },
+  { 137137, true },
+  { 137151, true },
+  { 137165, false },
+  { 137180, true },
+  { 137197, true },
+  { 137208, true },
+  { 137219, true },
+  { 137233, true },
   { 137254, true },
-  { 137271, true },
-  { 137282, true },
-  { 137293, true },
-  { 137307, true },
-  { 137328, true },
-  { 137344, true },
-  { 137363, true },
-  { 137379, true },
-  { 137397, true },
-  { 137420, true },
-  { 137432, true },
-  { 137441, true },
-  { 137454, true },
-  { 137472, true },
-  { 137487, true },
-  { 137502, true },
-  { 137518, true },
-  { 137533, true },
-  { 137548, true },
-  { 137563, true },
-  { 137579, true },
-  { 137594, true },
-  { 137609, true },
-  { 137624, true },
-  { 137640, true },
-  { 137650, true },
-  { 137663, true },
-  { 137676, true },
-  { 137686, true },
-  { 137698, false },
-  { 137709, true },
-  { 137723, true },
-  { 137735, false },
-  { 137754, true },
-  { 137771, true },
-  { 137784, true },
-  { 137794, false },
-  { 137807, false },
-  { 137817, true },
-  { 137830, true },
-  { 137840, true },
-  { 137850, false },
-  { 137859, false },
-  { 137867, false },
-  { 137887, true },
-  { 137900, true },
-  { 137912, false },
-  { 137924, true },
-  { 137941, true },
+  { 137270, true },
+  { 137289, true },
+  { 137305, true },
+  { 137323, true },
+  { 137346, true },
+  { 137358, true },
+  { 137367, true },
+  { 137380, true },
+  { 137398, true },
+  { 137413, true },
+  { 137428, true },
+  { 137444, true },
+  { 137459, true },
+  { 137474, true },
+  { 137489, true },
+  { 137505, true },
+  { 137520, true },
+  { 137535, true },
+  { 137550, true },
+  { 137566, true },
+  { 137576, true },
+  { 137589, true },
+  { 137602, true },
+  { 137612, true },
+  { 137624, false },
+  { 137635, true },
+  { 137649, true },
+  { 137661, false },
+  { 137680, true },
+  { 137697, true },
+  { 137710, true },
+  { 137726, false },
+  { 137739, false },
+  { 137749, true },
+  { 137762, true },
+  { 137772, true },
+  { 137782, false },
+  { 137791, false },
+  { 137799, false },
+  { 137819, true },
+  { 137832, true },
+  { 137844, false },
+  { 137856, true },
+  { 137873, true },
+  { 137890, true },
+  { 137906, true },
+  { 137925, true },
+  { 137941, false },
   { 137958, true },
-  { 137974, true },
-  { 137993, true },
-  { 138009, false },
-  { 138026, true },
-  { 138040, true },
-  { 138054, true },
-  { 138075, true },
-  { 138089, true },
-  { 138105, true },
-  { 138118, false },
-  { 138132, true },
-  { 138147, true },
-  { 138161, true },
-  { 138180, true },
-  { 138202, true },
-  { 138217, true },
-  { 138234, true },
-  { 138242, true },
-  { 138254, true },
-  { 138267, true },
+  { 137972, true },
+  { 137986, true },
+  { 138007, true },
+  { 138021, true },
+  { 138037, true },
+  { 138050, false },
+  { 138064, true },
+  { 138079, true },
+  { 138093, true },
+  { 138112, true },
+  { 138134, true },
+  { 138149, true },
+  { 138166, true },
+  { 138174, true },
+  { 138186, true },
+  { 138199, true },
+  { 138212, true },
+  { 138225, false },
+  { 138234, false },
+  { 138245, true },
+  { 138260, true },
+  { 138271, true },
   { 138280, true },
-  { 138293, false },
-  { 138302, false },
-  { 138313, true },
-  { 138328, true },
+  { 138289, false },
+  { 138303, true },
+  { 138321, true },
   { 138339, true },
-  { 138348, true },
-  { 138357, false },
-  { 138371, true },
-  { 138389, true },
-  { 138407, true },
-  { 138424, true },
-  { 138436, false },
-  { 138452, false },
-  { 138476, true },
-  { 138503, true },
-  { 138522, true },
-  { 138530, true },
-  { 138539, true },
-  { 138551, true },
-  { 138563, true },
-  { 138588, true },
-  { 138605, true },
-  { 138622, true },
-  { 138637, true },
-  { 138649, true },
-  { 138662, true },
-  { 138680, true },
-  { 138689, false },
-  { 138697, true },
-  { 138718, true },
-  { 138732, true },
-  { 138754, true },
-  { 138767, true },
+  { 138356, true },
+  { 138368, false },
+  { 138384, false },
+  { 138408, true },
+  { 138435, true },
+  { 138454, true },
+  { 138462, true },
+  { 138471, true },
+  { 138483, true },
+  { 138495, true },
+  { 138520, true },
+  { 138537, true },
+  { 138554, true },
+  { 138569, true },
+  { 138581, true },
+  { 138594, true },
+  { 138612, true },
+  { 138621, false },
+  { 138629, true },
+  { 138650, true },
+  { 138664, true },
+  { 138686, true },
+  { 138699, true },
+  { 138712, true },
+  { 138724, true },
+  { 138737, false },
+  { 138750, true },
+  { 138766, true },
   { 138780, true },
-  { 138792, true },
-  { 138805, false },
-  { 138818, true },
+  { 138801, true },
+  { 138813, true },
   { 138834, true },
-  { 138848, true },
-  { 138869, true },
-  { 138881, true },
-  { 138902, true },
-  { 138921, true },
-  { 138946, true },
-  { 138958, true },
-  { 138971, true },
-  { 138984, true },
+  { 138853, true },
+  { 138878, true },
+  { 138890, true },
+  { 138903, true },
+  { 138916, true },
+  { 138928, true },
+  { 138940, true },
+  { 138957, true },
+  { 138975, true },
+  { 138987, false },
   { 138996, true },
-  { 139008, true },
-  { 139025, true },
-  { 139043, true },
-  { 139055, false },
-  { 139064, true },
-  { 139079, true },
-  { 139101, true },
-  { 139115, true },
-  { 139128, true },
-  { 139150, true },
+  { 139011, true },
+  { 139033, true },
+  { 139047, true },
+  { 139060, true },
+  { 139082, true },
+  { 139097, true },
+  { 139112, true },
+  { 139123, true },
+  { 139148, true },
   { 139165, true },
-  { 139180, true },
-  { 139191, true },
-  { 139216, true },
-  { 139233, true },
-  { 139245, true },
-  { 139261, false },
-  { 139276, false },
-  { 139300, true },
-  { 139308, true },
-  { 139320, true },
-  { 139333, true },
-  { 139346, true },
-  { 139358, true },
-  { 139374, true },
-  { 139389, true },
-  { 139408, true },
-  { 139422, true },
+  { 139177, true },
+  { 139193, false },
+  { 139208, false },
+  { 139232, true },
+  { 139240, true },
+  { 139253, true },
+  { 139265, true },
+  { 139278, true },
+  { 139291, true },
+  { 139303, true },
+  { 139319, true },
+  { 139334, true },
+  { 139353, true },
+  { 139367, true },
+  { 139381, true },
+  { 139401, true },
+  { 139417, true },
   { 139436, true },
   { 139456, true },
-  { 139472, true },
-  { 139491, true },
-  { 139511, true },
-  { 139523, true },
-  { 139535, true },
-  { 139565, true },
-  { 139577, true },
-  { 139588, true },
+  { 139468, true },
+  { 139480, true },
+  { 139510, true },
+  { 139522, true },
+  { 139533, true },
+  { 139543, true },
+  { 139557, true },
+  { 139570, true },
+  { 139588, false },
   { 139598, true },
   { 139612, true },
-  { 139625, true },
-  { 139643, false },
-  { 139653, true },
-  { 139668, true },
-  { 139686, true },
-  { 139695, true },
-  { 139708, true },
+  { 139627, true },
+  { 139645, true },
+  { 139654, true },
+  { 139667, true },
+  { 139683, true },
+  { 139694, true },
+  { 139705, true },
+  { 139715, true },
   { 139724, true },
-  { 139735, true },
-  { 139746, true },
-  { 139756, true },
-  { 139765, true },
-  { 139779, true },
-  { 139800, true },
-  { 139811, true },
-  { 139833, true },
-  { 139848, true },
-  { 139858, true },
-  { 139880, true },
-  { 139902, true },
-  { 139919, true },
-  { 139933, true },
-  { 139946, true },
+  { 139738, true },
+  { 139759, true },
+  { 139770, true },
+  { 139792, true },
+  { 139807, true },
+  { 139817, true },
+  { 139839, true },
+  { 139861, true },
+  { 139878, true },
+  { 139892, true },
+  { 139905, true },
+  { 139922, true },
+  { 139947, true },
   { 139963, true },
-  { 139988, true },
-  { 140004, true },
-  { 140014, true },
-  { 140025, true },
-  { 140034, false },
-  { 140043, true },
+  { 139973, true },
+  { 139984, true },
+  { 139993, false },
+  { 140002, true },
+  { 140012, true },
+  { 140026, true },
+  { 140044, true },
   { 140053, true },
-  { 140067, true },
-  { 140085, true },
-  { 140094, true },
+  { 140077, true },
+  { 140098, true },
   { 140118, true },
-  { 140139, true },
-  { 140159, true },
-  { 140177, true },
-  { 140190, true },
-  { 140211, true },
-  { 140229, true },
+  { 140136, true },
+  { 140149, true },
+  { 140170, true },
+  { 140188, true },
+  { 140200, true },
+  { 140222, false },
   { 140241, true },
-  { 140263, false },
-  { 140282, true },
-  { 140293, true },
-  { 140306, true },
-  { 140327, true },
-  { 140338, true },
-  { 140353, true },
-  { 140365, true },
-  { 140382, true },
-  { 140408, true },
-  { 140425, false },
-  { 140443, true },
-  { 140462, false },
-  { 140481, true },
-  { 140493, true },
-  { 140513, true },
-  { 140535, true },
-  { 140548, true },
-  { 140570, true },
-  { 140583, true },
-  { 140606, true },
-  { 140620, true },
-  { 140643, true },
-  { 140653, true },
-  { 140663, true },
-  { 140682, true },
-  { 140695, true },
-  { 140710, false },
-  { 140722, true },
+  { 140252, true },
+  { 140265, true },
+  { 140286, true },
+  { 140297, true },
+  { 140312, true },
+  { 140324, true },
+  { 140341, true },
+  { 140367, true },
+  { 140384, false },
+  { 140402, true },
+  { 140421, false },
+  { 140440, true },
+  { 140452, true },
+  { 140472, true },
+  { 140494, true },
+  { 140507, true },
+  { 140529, true },
+  { 140542, true },
+  { 140565, true },
+  { 140579, true },
+  { 140602, true },
+  { 140612, true },
+  { 140622, true },
+  { 140641, true },
+  { 140654, true },
+  { 140669, false },
+  { 140681, true },
+  { 140701, true },
+  { 140711, true },
+  { 140730, true },
   { 140742, true },
-  { 140752, true },
-  { 140771, true },
-  { 140783, true },
+  { 140768, true },
+  { 140789, true },
   { 140809, true },
-  { 140830, true },
-  { 140850, true },
-  { 140862, true },
-  { 140876, true },
-  { 140895, true },
-  { 140907, true },
-  { 140930, true },
-  { 140946, true },
-  { 140958, true },
-  { 140983, true },
-  { 140998, true },
-  { 141019, true },
-  { 141036, true },
-  { 141057, false },
-  { 141074, true },
-  { 141084, true },
-  { 141098, true },
-  { 141112, true },
-  { 141122, true },
-  { 141134, true },
-  { 141146, true },
-  { 141156, true },
+  { 140821, true },
+  { 140835, true },
+  { 140854, true },
+  { 140866, true },
+  { 140889, true },
+  { 140905, true },
+  { 140917, true },
+  { 140942, true },
+  { 140957, true },
+  { 140978, true },
+  { 140995, true },
+  { 141016, false },
+  { 141033, true },
+  { 141043, true },
+  { 141057, true },
+  { 141071, true },
+  { 141081, true },
+  { 141093, true },
+  { 141105, true },
+  { 141115, true },
+  { 141129, true },
+  { 141141, true },
   { 141170, true },
-  { 141182, true },
-  { 141211, true },
-  { 141226, true },
-  { 141240, true },
-  { 141254, true },
-  { 141270, true },
-  { 141285, true },
-  { 141297, true },
-  { 141317, true },
-  { 141331, true },
-  { 141344, true },
-  { 141356, true },
-  { 141369, true },
-  { 141381, true },
-  { 141400, true },
-  { 141426, true },
-  { 141450, true },
-  { 141473, true },
-  { 141485, true },
-  { 141503, true },
-  { 141519, true },
-  { 141539, true },
-  { 141557, true },
-  { 141577, true },
-  { 141591, true },
+  { 141185, true },
+  { 141199, true },
+  { 141213, true },
+  { 141229, true },
+  { 141244, true },
+  { 141256, true },
+  { 141276, true },
+  { 141290, true },
+  { 141303, true },
+  { 141315, true },
+  { 141328, true },
+  { 141340, true },
+  { 141359, true },
+  { 141385, true },
+  { 141409, true },
+  { 141432, true },
+  { 141444, true },
+  { 141462, true },
+  { 141478, true },
+  { 141498, true },
+  { 141516, true },
+  { 141536, true },
+  { 141550, true },
+  { 141571, true },
+  { 141584, true },
+  { 141604, true },
   { 141612, true },
-  { 141625, true },
-  { 141645, true },
-  { 141653, true },
-  { 141672, true },
-  { 141691, true },
-  { 141705, true },
-  { 141723, true },
-  { 141739, false },
-  { 141758, true },
+  { 141631, true },
+  { 141650, true },
+  { 141664, true },
+  { 141682, true },
+  { 141698, false },
+  { 141717, true },
+  { 141738, true },
+  { 141752, true },
+  { 141761, true },
   { 141779, true },
-  { 141793, true },
-  { 141802, true },
-  { 141820, true },
-  { 141837, true },
-  { 141853, true },
-  { 141875, true },
-  { 141892, true },
-  { 141910, true },
-  { 141929, true },
-  { 141946, true },
-  { 141959, true },
-  { 141969, true },
-  { 141977, true },
-  { 142005, true },
-  { 142022, true },
-  { 142036, true },
-  { 142051, false },
-  { 142064, true },
-  { 142076, true },
-  { 142086, true },
-  { 142099, true },
-  { 142114, true },
-  { 142126, true },
-  { 142138, true },
-  { 142150, true },
-  { 142162, true },
+  { 141796, true },
+  { 141812, true },
+  { 141834, true },
+  { 141851, true },
+  { 141869, true },
+  { 141888, true },
+  { 141905, true },
+  { 141918, true },
+  { 141928, true },
+  { 141936, true },
+  { 141964, true },
+  { 141981, true },
+  { 141995, true },
+  { 142010, false },
+  { 142023, true },
+  { 142035, true },
+  { 142045, true },
+  { 142058, true },
+  { 142073, true },
+  { 142085, true },
+  { 142097, true },
+  { 142109, true },
+  { 142121, true },
+  { 142134, true },
+  { 142147, true },
+  { 142159, true },
   { 142175, true },
-  { 142188, true },
+  { 142187, true },
   { 142200, true },
-  { 142216, true },
-  { 142228, true },
-  { 142241, true },
-  { 142251, true },
-  { 142261, true },
-  { 142276, true },
-  { 142287, true },
-  { 142305, true },
-  { 142313, true },
-  { 142321, true },
-  { 142333, true },
-  { 142347, true },
-  { 142364, true },
-  { 142379, true },
-  { 142394, true },
-  { 142409, true },
-  { 142424, true },
-  { 142432, true },
-  { 142447, true },
-  { 142460, true },
-  { 142468, true },
-  { 142478, true },
-  { 142499, true },
-  { 142512, true },
-  { 142524, true },
-  { 142532, true },
-  { 142549, true },
-  { 142565, true },
-  { 142572, true },
-  { 142583, true },
-  { 142591, false },
-  { 142615, true },
-  { 142647, true },
-  { 142674, true },
-  { 142694, true },
-  { 142718, true },
-  { 142735, false },
-  { 142748, true },
-  { 142763, true },
-  { 142774, true },
-  { 142785, true },
-  { 142795, true },
-  { 142807, true },
-  { 142819, false },
-  { 142831, false },
-  { 142839, false },
-  { 142864, true },
-  { 142877, true },
+  { 142210, true },
+  { 142220, true },
+  { 142235, true },
+  { 142246, true },
+  { 142257, true },
+  { 142275, true },
+  { 142283, true },
+  { 142291, true },
+  { 142303, true },
+  { 142317, true },
+  { 142334, true },
+  { 142349, true },
+  { 142365, true },
+  { 142380, true },
+  { 142395, true },
+  { 142410, true },
+  { 142418, true },
+  { 142433, true },
+  { 142446, true },
+  { 142454, true },
+  { 142464, true },
+  { 142485, true },
+  { 142498, true },
+  { 142510, true },
+  { 142518, true },
+  { 142535, true },
+  { 142551, true },
+  { 142558, true },
+  { 142569, true },
+  { 142577, false },
+  { 142601, true },
+  { 142633, true },
+  { 142660, true },
+  { 142680, true },
+  { 142704, true },
+  { 142721, false },
+  { 142734, true },
+  { 142749, true },
+  { 142760, true },
+  { 142771, true },
+  { 142781, true },
+  { 142793, true },
+  { 142805, false },
+  { 142817, false },
+  { 142825, false },
+  { 142850, true },
+  { 142863, true },
+  { 142878, true },
   { 142892, true },
-  { 142906, true },
-  { 142919, true },
-  { 142931, true },
-  { 142944, true },
+  { 142905, true },
+  { 142917, true },
+  { 142930, true },
+  { 142947, true },
   { 142961, true },
-  { 142975, true },
+  { 142978, true },
   { 142992, true },
-  { 143006, true },
-  { 143021, true },
-  { 143036, true },
-  { 143047, true },
+  { 143007, true },
+  { 143022, true },
+  { 143033, true },
+  { 143040, true },
   { 143054, true },
-  { 143068, true },
-  { 143076, true },
-  { 143084, false },
-  { 143099, true },
+  { 143062, true },
+  { 143070, false },
+  { 143085, true },
+  { 143097, true },
   { 143111, true },
-  { 143125, true },
-  { 143135, true },
-  { 143145, true },
-  { 143152, true },
-  { 143165, true },
-  { 143178, true },
-  { 143187, true },
-  { 143195, true },
-  { 143212, true },
-  { 143220, true },
-  { 143229, true },
-  { 143245, true },
-  { 143256, true },
-  { 143268, true },
-  { 143278, true },
-  { 143295, false },
-  { 143306, true },
-  { 143314, true },
-  { 143324, true },
-  { 143333, true },
-  { 143358, true },
-  { 143374, true },
-  { 143386, true },
-  { 143398, true },
-  { 143411, true },
-  { 143419, true },
-  { 143427, false },
-  { 143447, false },
-  { 143466, false },
-  { 143485, false },
-  { 143505, false },
-  { 143525, false },
-  { 143545, false },
-  { 143564, false },
-  { 143583, true },
-  { 143594, true },
-  { 143604, true },
-  { 143613, true },
-  { 143626, true },
-  { 143641, true },
-  { 143651, true },
-  { 143664, true },
-  { 143676, false },
-  { 143687, true },
-  { 143698, true },
-  { 143707, true },
-  { 143715, true },
-  { 143728, true },
-  { 143736, true },
-  { 143746, true },
-  { 143755, true },
-  { 143778, true },
-  { 143797, false },
-  { 143808, true },
+  { 143121, true },
+  { 143131, true },
+  { 143138, true },
+  { 143151, true },
+  { 143164, true },
+  { 143173, true },
+  { 143181, true },
+  { 143198, true },
+  { 143206, true },
+  { 143215, true },
+  { 143231, true },
+  { 143242, true },
+  { 143254, true },
+  { 143264, true },
+  { 143281, false },
+  { 143292, true },
+  { 143300, true },
+  { 143310, true },
+  { 143319, true },
+  { 143344, true },
+  { 143360, true },
+  { 143372, true },
+  { 143384, true },
+  { 143397, true },
+  { 143405, true },
+  { 143413, false },
+  { 143433, false },
+  { 143452, false },
+  { 143471, false },
+  { 143491, false },
+  { 143511, false },
+  { 143531, false },
+  { 143550, false },
+  { 143569, true },
+  { 143580, true },
+  { 143590, true },
+  { 143599, true },
+  { 143612, true },
+  { 143627, true },
+  { 143637, true },
+  { 143650, true },
+  { 143662, false },
+  { 143673, true },
+  { 143684, true },
+  { 143693, true },
+  { 143701, true },
+  { 143714, true },
+  { 143722, true },
+  { 143732, true },
+  { 143741, true },
+  { 143764, true },
+  { 143783, false },
+  { 143794, true },
+  { 143816, true },
   { 143830, true },
-  { 143844, true },
-  { 143853, true },
-  { 143860, true },
-  { 143869, true },
-  { 143876, true },
-  { 143888, true },
-  { 143905, true },
-  { 143912, true },
-  { 143920, true },
+  { 143839, true },
+  { 143846, true },
+  { 143855, true },
+  { 143862, true },
+  { 143874, true },
+  { 143891, true },
+  { 143898, true },
+  { 143906, true },
+  { 143917, true },
   { 143931, true },
-  { 143945, true },
-  { 143957, true },
-  { 143969, true },
-  { 143978, true },
-  { 143987, true },
-  { 143999, false },
-  { 144010, true },
-  { 144023, true },
-  { 144049, true },
-  { 144072, false },
-  { 144092, true },
-  { 144109, true },
+  { 143943, true },
+  { 143955, true },
+  { 143964, true },
+  { 143973, true },
+  { 143985, false },
+  { 143996, true },
+  { 144009, true },
+  { 144035, true },
+  { 144058, false },
+  { 144078, true },
+  { 144095, true },
+  { 144110, true },
   { 144124, true },
-  { 144138, true },
-  { 144156, true },
-  { 144175, true },
-  { 144188, true },
-  { 144199, true },
-  { 144217, true },
-  { 144232, true },
-  { 144252, true },
-  { 144267, true },
-  { 144276, true },
-  { 144297, true },
-  { 144317, true },
-  { 144332, true },
-  { 144347, true },
+  { 144142, true },
+  { 144161, true },
+  { 144174, true },
+  { 144185, true },
+  { 144203, true },
+  { 144218, true },
+  { 144238, true },
+  { 144253, true },
+  { 144262, true },
+  { 144283, true },
+  { 144303, true },
+  { 144318, true },
+  { 144333, true },
+  { 144348, true },
   { 144362, true },
   { 144376, true },
-  { 144390, true },
-  { 144399, true },
-  { 144410, true },
-  { 144425, true },
-  { 144434, true },
-  { 144442, true },
-  { 144460, true },
-  { 144471, true },
-  { 144481, true },
-  { 144490, true },
-  { 144501, true },
-  { 144511, true },
-  { 144520, true },
-  { 144533, true },
-  { 144544, true },
-  { 144554, true },
-  { 144561, true },
-  { 144572, true },
+  { 144385, true },
+  { 144396, true },
+  { 144411, true },
+  { 144420, true },
+  { 144428, true },
+  { 144446, true },
+  { 144457, true },
+  { 144467, true },
+  { 144476, true },
+  { 144487, true },
+  { 144497, true },
+  { 144506, true },
+  { 144519, true },
+  { 144530, true },
+  { 144540, true },
+  { 144547, true },
+  { 144558, true },
+  { 144569, true },
   { 144583, true },
-  { 144597, true },
-  { 144604, true },
-  { 144615, true },
-  { 144633, true },
-  { 144646, true },
-  { 144658, true },
-  { 144666, true },
-  { 144686, false },
-  { 144702, true },
-  { 144721, true },
-  { 144744, true },
-  { 144763, true },
-  { 144774, true },
-  { 144796, true },
-  { 144809, true },
-  { 144818, true },
-  { 144841, true },
-  { 144875, true },
-  { 144891, true },
-  { 144907, true },
-  { 144929, true },
-  { 144956, true },
-  { 144970, true },
-  { 144980, true },
-  { 144998, true },
-  { 145008, true },
-  { 145027, true },
-  { 145041, true },
-  { 145055, true },
-  { 145071, true },
-  { 145082, true },
-  { 145097, true },
-  { 145108, true },
-  { 145131, true },
-  { 145154, true },
-  { 145172, true },
-  { 145189, true },
-  { 145199, true },
-  { 145224, true },
-  { 145242, true },
-  { 145252, true },
-  { 145264, true },
-  { 145277, true },
-  { 145288, true },
-  { 145305, true },
-  { 145315, true },
-  { 145336, true },
-  { 145358, true },
-  { 145376, true },
-  { 145387, true },
-  { 145400, true },
-  { 145411, true },
-  { 145425, true },
-  { 145438, true },
-  { 145449, true },
-  { 145459, true },
-  { 145473, true },
-  { 145483, true },
-  { 145494, true },
-  { 145507, false },
-  { 145525, true },
-  { 145534, true },
-  { 145549, true },
-  { 145565, true },
-  { 145581, false },
-  { 145594, false },
-  { 145607, false },
-  { 145619, true },
-  { 145636, true },
-  { 145647, true },
-  { 145662, true },
-  { 145674, true },
-  { 145691, true },
-  { 145705, true },
-  { 145718, true },
-  { 145727, true },
-  { 145738, true },
-  { 145749, true },
-  { 145761, true },
-  { 145774, true },
-  { 145783, true },
-  { 145794, true },
-  { 145810, true },
-  { 145822, true },
-  { 145834, true },
-  { 145846, true },
-  { 145863, true },
-  { 145875, true },
-  { 145889, true },
-  { 145899, true },
-  { 145912, true },
-  { 145929, true },
-  { 145943, true },
-  { 145958, true },
-  { 145968, true },
-  { 145984, true },
-  { 146000, true },
-  { 146009, true },
-  { 146016, true },
-  { 146027, true },
-  { 146044, true },
-  { 146057, true },
-  { 146072, true },
-  { 146082, true },
-  { 146093, true },
-  { 146116, true },
-  { 146128, false },
-  { 146142, true },
-  { 146158, true },
-  { 146169, true },
-  { 146185, false },
-  { 146204, true },
-  { 146223, true },
-  { 146234, true },
-  { 146255, true },
-  { 146271, true },
-  { 146283, true },
-  { 146297, true },
-  { 146311, true },
-  { 146322, true },
-  { 146343, true },
-  { 146356, true },
-  { 146366, true },
-  { 146377, true },
-  { 146394, true },
-  { 146414, true },
-  { 146429, true },
-  { 146448, false },
-  { 146465, true },
-  { 146481, true },
-  { 146504, true },
-  { 146519, true },
-  { 146535, true },
-  { 146546, true },
-  { 146554, true },
-  { 146577, true },
-  { 146589, true },
-  { 146597, true },
-  { 146623, true },
-  { 146641, true },
-  { 146654, true },
-  { 146666, true },
-  { 146693, true },
-  { 146724, true },
-  { 146735, true },
-  { 146745, true },
-  { 146760, true },
-  { 146771, true },
-  { 146782, false },
-  { 146795, true },
-  { 146804, true },
-  { 146817, true },
-  { 146845, true },
-  { 146866, true },
-  { 146880, true },
-  { 146902, true },
-  { 146919, true },
-  { 146929, true },
-  { 146941, true },
-  { 146957, true },
-  { 146971, true },
-  { 146982, true },
-  { 146996, true },
-  { 147014, true },
-  { 147031, true },
-  { 147051, true },
-  { 147062, true },
-  { 147073, false },
-  { 147080, true },
-  { 147107, true },
-  { 147127, true },
-  { 147145, true },
-  { 147160, false },
-  { 147171, true },
-  { 147187, true },
-  { 147204, true },
-  { 147221, true },
-  { 147243, true },
-  { 147257, true },
-  { 147273, false },
-  { 147290, true },
-  { 147306, true },
-  { 147316, true },
-  { 147337, true },
-  { 147355, true },
-  { 147373, true },
-  { 147387, true },
-  { 147397, true },
-  { 147408, true },
-  { 147430, true },
-  { 147447, true },
-  { 147467, true },
-  { 147481, true },
-  { 147496, true },
-  { 147513, true },
-  { 147530, true },
-  { 147551, true },
-  { 147567, true },
-  { 147590, true },
-  { 147607, true },
-  { 147625, true },
-  { 147635, true },
-  { 147651, true },
-  { 147662, false },
-  { 147682, true },
-  { 147695, true },
-  { 147705, true },
-  { 147722, true },
-  { 147742, true },
-  { 147757, true },
-  { 147774, true },
-  { 147788, true },
-  { 147806, true },
-  { 147820, true },
-  { 147841, true },
-  { 147852, true },
-  { 147866, false },
-  { 147880, true },
-  { 147897, true },
-  { 147914, true },
-  { 147930, true },
-  { 147950, true },
-  { 147973, true },
-  { 147982, false },
-  { 147990, true },
-  { 148002, false },
-  { 148024, true },
-  { 148039, true },
-  { 148053, true },
-  { 148067, true },
-  { 148080, true },
-  { 148095, true },
-  { 148109, true },
-  { 148130, true },
-  { 148141, true },
-  { 148151, true },
-  { 148159, true },
-  { 148171, true },
-  { 148196, true },
-  { 148206, true },
-  { 148231, true },
-  { 148244, false },
-  { 148269, true },
-  { 148286, true },
-  { 148299, true },
-  { 148307, true },
-  { 148316, true },
-  { 148330, true },
-  { 148343, true },
-  { 148359, true },
-  { 148369, true },
-  { 148380, true },
-  { 148391, true },
-  { 148407, true },
-  { 148417, false },
-  { 148429, true },
-  { 148441, true },
-  { 148456, true },
-  { 148474, true },
-  { 148486, true },
-  { 148496, true },
-  { 148512, true },
-  { 148536, true },
-  { 148549, true },
-  { 148556, true },
-  { 148563, true },
-  { 148580, true },
-  { 148594, true },
-  { 148606, true },
-  { 148618, true },
-  { 148630, true },
-  { 148644, true },
-  { 148665, true },
-  { 148678, true },
-  { 148689, true },
-  { 148706, true },
-  { 148721, true },
-  { 148746, true },
-  { 148761, true },
-  { 148772, true },
-  { 148781, true },
-  { 148790, true },
-  { 148805, true },
-  { 148815, true },
-  { 148831, true },
-  { 148844, true },
-  { 148856, true },
-  { 148873, true },
-  { 148894, true },
-  { 148915, true },
-  { 148932, true },
-  { 148950, true },
-  { 148962, true },
-  { 148977, true },
-  { 148993, true },
-  { 149007, true },
-  { 149019, true },
-  { 149033, true },
-  { 149045, true },
-  { 149064, true },
-  { 149080, true },
-  { 149096, true },
-  { 149112, true },
-  { 149130, true },
-  { 149147, true },
-  { 149165, true },
-  { 149179, true },
-  { 149197, true },
-  { 149214, true },
-  { 149233, true },
-  { 149253, true },
-  { 149270, true },
-  { 149286, true },
-  { 149304, false },
-  { 149317, true },
-  { 149334, true },
-  { 149351, false },
-  { 149372, true },
-  { 149389, true },
-  { 149408, true },
-  { 149422, true },
-  { 149435, true },
-  { 149450, true },
-  { 149463, true },
-  { 149474, true },
-  { 149492, true },
-  { 149504, true },
-  { 149517, true },
-  { 149541, true },
-  { 149550, true },
-  { 149565, true },
-  { 149583, true },
-  { 149592, true },
+  { 144590, true },
+  { 144601, true },
+  { 144609, true },
+  { 144627, true },
+  { 144640, true },
+  { 144652, true },
+  { 144660, true },
+  { 144680, false },
+  { 144696, true },
+  { 144715, true },
+  { 144738, true },
+  { 144757, true },
+  { 144768, true },
+  { 144790, true },
+  { 144803, true },
+  { 144812, true },
+  { 144835, true },
+  { 144869, true },
+  { 144885, true },
+  { 144901, true },
+  { 144923, true },
+  { 144950, true },
+  { 144964, true },
+  { 144974, true },
+  { 144992, true },
+  { 145002, true },
+  { 145021, true },
+  { 145035, true },
+  { 145049, true },
+  { 145065, true },
+  { 145076, true },
+  { 145091, true },
+  { 145102, true },
+  { 145125, true },
+  { 145148, true },
+  { 145166, true },
+  { 145183, true },
+  { 145193, true },
+  { 145218, true },
+  { 145236, true },
+  { 145246, true },
+  { 145258, true },
+  { 145271, true },
+  { 145282, true },
+  { 145299, true },
+  { 145309, true },
+  { 145330, true },
+  { 145352, true },
+  { 145370, true },
+  { 145381, true },
+  { 145394, true },
+  { 145405, true },
+  { 145419, true },
+  { 145432, true },
+  { 145443, true },
+  { 145453, true },
+  { 145467, true },
+  { 145477, true },
+  { 145488, true },
+  { 145501, false },
+  { 145519, true },
+  { 145528, true },
+  { 145543, true },
+  { 145559, true },
+  { 145575, false },
+  { 145588, false },
+  { 145601, false },
+  { 145613, true },
+  { 145630, true },
+  { 145641, true },
+  { 145656, true },
+  { 145668, true },
+  { 145685, true },
+  { 145699, true },
+  { 145712, true },
+  { 145721, true },
+  { 145732, true },
+  { 145743, true },
+  { 145755, true },
+  { 145768, true },
+  { 145777, true },
+  { 145788, true },
+  { 145804, true },
+  { 145816, true },
+  { 145828, true },
+  { 145840, true },
+  { 145857, true },
+  { 145869, true },
+  { 145883, true },
+  { 145893, true },
+  { 145906, true },
+  { 145923, true },
+  { 145937, true },
+  { 145952, true },
+  { 145962, true },
+  { 145978, true },
+  { 145994, true },
+  { 146003, true },
+  { 146010, true },
+  { 146021, true },
+  { 146038, true },
+  { 146051, true },
+  { 146066, true },
+  { 146076, true },
+  { 146087, true },
+  { 146110, true },
+  { 146122, false },
+  { 146136, true },
+  { 146152, true },
+  { 146163, true },
+  { 146179, false },
+  { 146198, true },
+  { 146217, true },
+  { 146228, true },
+  { 146249, true },
+  { 146265, true },
+  { 146277, true },
+  { 146291, true },
+  { 146305, true },
+  { 146316, true },
+  { 146337, true },
+  { 146350, true },
+  { 146360, true },
+  { 146371, true },
+  { 146388, true },
+  { 146408, true },
+  { 146423, true },
+  { 146442, false },
+  { 146459, true },
+  { 146475, true },
+  { 146498, true },
+  { 146513, true },
+  { 146529, true },
+  { 146540, true },
+  { 146548, true },
+  { 146571, true },
+  { 146583, true },
+  { 146591, true },
+  { 146617, true },
+  { 146635, true },
+  { 146648, true },
+  { 146660, true },
+  { 146687, true },
+  { 146718, true },
+  { 146729, true },
+  { 146739, true },
+  { 146754, true },
+  { 146765, true },
+  { 146776, false },
+  { 146789, true },
+  { 146798, true },
+  { 146811, true },
+  { 146839, true },
+  { 146860, true },
+  { 146874, true },
+  { 146896, true },
+  { 146913, true },
+  { 146923, true },
+  { 146935, true },
+  { 146951, true },
+  { 146965, true },
+  { 146976, true },
+  { 146990, true },
+  { 147008, true },
+  { 147025, true },
+  { 147045, true },
+  { 147056, true },
+  { 147067, false },
+  { 147074, true },
+  { 147101, true },
+  { 147121, true },
+  { 147139, true },
+  { 147154, false },
+  { 147165, true },
+  { 147181, true },
+  { 147198, true },
+  { 147215, true },
+  { 147237, true },
+  { 147251, true },
+  { 147267, false },
+  { 147284, true },
+  { 147300, true },
+  { 147310, true },
+  { 147331, true },
+  { 147349, true },
+  { 147367, true },
+  { 147381, true },
+  { 147391, true },
+  { 147402, true },
+  { 147424, true },
+  { 147441, true },
+  { 147461, true },
+  { 147475, true },
+  { 147490, true },
+  { 147507, true },
+  { 147524, true },
+  { 147545, true },
+  { 147561, true },
+  { 147584, true },
+  { 147601, true },
+  { 147619, true },
+  { 147629, true },
+  { 147645, true },
+  { 147656, false },
+  { 147676, true },
+  { 147689, true },
+  { 147699, true },
+  { 147716, true },
+  { 147736, true },
+  { 147751, true },
+  { 147768, true },
+  { 147782, true },
+  { 147800, true },
+  { 147814, true },
+  { 147835, true },
+  { 147846, true },
+  { 147860, false },
+  { 147874, true },
+  { 147891, true },
+  { 147908, true },
+  { 147924, true },
+  { 147944, true },
+  { 147967, true },
+  { 147976, false },
+  { 147984, true },
+  { 147996, false },
+  { 148018, true },
+  { 148033, true },
+  { 148047, true },
+  { 148061, true },
+  { 148074, true },
+  { 148089, true },
+  { 148103, true },
+  { 148124, true },
+  { 148135, true },
+  { 148145, true },
+  { 148153, true },
+  { 148165, true },
+  { 148190, true },
+  { 148200, true },
+  { 148225, true },
+  { 148238, false },
+  { 148263, true },
+  { 148280, true },
+  { 148293, true },
+  { 148301, true },
+  { 148310, true },
+  { 148324, true },
+  { 148337, true },
+  { 148353, true },
+  { 148363, true },
+  { 148374, true },
+  { 148385, true },
+  { 148401, true },
+  { 148411, false },
+  { 148423, true },
+  { 148435, true },
+  { 148450, true },
+  { 148468, true },
+  { 148480, true },
+  { 148490, true },
+  { 148506, true },
+  { 148530, true },
+  { 148543, true },
+  { 148550, true },
+  { 148557, true },
+  { 148574, true },
+  { 148588, true },
+  { 148600, true },
+  { 148614, true },
+  { 148635, true },
+  { 148648, true },
+  { 148659, true },
+  { 148676, true },
+  { 148691, true },
+  { 148716, true },
+  { 148731, true },
+  { 148742, true },
+  { 148751, true },
+  { 148773, true },
+  { 148782, true },
+  { 148797, true },
+  { 148807, true },
+  { 148823, true },
+  { 148836, true },
+  { 148848, true },
+  { 148865, true },
+  { 148886, true },
+  { 148907, true },
+  { 148924, true },
+  { 148942, true },
+  { 148954, true },
+  { 148969, true },
+  { 148985, true },
+  { 148999, true },
+  { 149011, true },
+  { 149025, true },
+  { 149037, true },
+  { 149056, true },
+  { 149072, true },
+  { 149088, true },
+  { 149104, true },
+  { 149122, true },
+  { 149139, true },
+  { 149157, true },
+  { 149171, true },
+  { 149189, true },
+  { 149206, true },
+  { 149225, true },
+  { 149245, true },
+  { 149262, true },
+  { 149278, true },
+  { 149296, false },
+  { 149309, true },
+  { 149326, true },
+  { 149343, false },
+  { 149364, true },
+  { 149381, true },
+  { 149400, true },
+  { 149414, true },
+  { 149427, true },
+  { 149442, true },
+  { 149455, true },
+  { 149466, true },
+  { 149484, true },
+  { 149496, true },
+  { 149509, true },
+  { 149533, true },
+  { 149542, true },
+  { 149557, true },
+  { 149584, true },
   { 149602, true },
-  { 149613, true },
-  { 149623, true },
-  { 149636, true },
-  { 149644, true },
-  { 149651, true },
+  { 149611, true },
+  { 149621, true },
+  { 149632, true },
+  { 149642, true },
+  { 149655, true },
+  { 149663, true },
   { 149670, true },
-  { 149677, true },
-  { 149692, true },
-  { 149701, true },
-  { 149713, true },
-  { 149725, false },
-  { 149745, true },
-  { 149759, true },
-  { 149769, true },
-  { 149786, true },
-  { 149804, true },
-  { 149821, true },
-  { 149843, true },
-  { 149862, true },
-  { 149874, true },
-  { 149885, true },
-  { 149898, true },
-  { 149917, true },
+  { 149689, true },
+  { 149696, true },
+  { 149711, true },
+  { 149720, true },
+  { 149732, true },
+  { 149744, false },
+  { 149764, true },
+  { 149778, true },
+  { 149788, true },
+  { 149806, true },
+  { 149823, true },
+  { 149845, true },
+  { 149858, true },
+  { 149877, true },
+  { 149889, true },
+  { 149900, true },
+  { 149913, true },
   { 149932, true },
-  { 149948, true },
-  { 149971, true },
-  { 149991, true },
-  { 150004, true },
-  { 150018, true },
-  { 150030, true },
-  { 150041, true },
-  { 150060, true },
-  { 150072, true },
-  { 150089, true },
-  { 150106, true },
-  { 150118, true },
-  { 150135, true },
-  { 150146, true },
-  { 150170, true },
-  { 150180, true },
-  { 150192, true },
-  { 150202, true },
-  { 150233, true },
-  { 150242, true },
-  { 150259, true },
-  { 150271, true },
-  { 150290, true },
-  { 150306, true },
-  { 150323, true },
-  { 150336, true },
-  { 150349, true },
-  { 150359, true },
-  { 150373, true },
-  { 150382, true },
-  { 150392, true },
-  { 150407, true },
-  { 150417, true },
-  { 150431, true },
-  { 150447, true },
-  { 150460, true },
-  { 150470, true },
-  { 150488, true },
-  { 150505, true },
-  { 150521, true },
-  { 150538, true },
-  { 150560, true },
-  { 150572, true },
-  { 150590, true },
-  { 150604, false },
-  { 150619, true },
-  { 150632, true },
-  { 150645, true },
-  { 150657, true },
-  { 150669, true },
-  { 150680, true },
-  { 150697, true },
-  { 150709, true },
-  { 150728, true },
-  { 150754, true },
-  { 150763, true },
-  { 150778, false },
-  { 150785, true },
-  { 150801, true },
-  { 150816, true },
-  { 150838, true },
-  { 150863, true },
-  { 150879, true },
-  { 150893, true },
-  { 150903, true },
-  { 150913, true },
-  { 150924, true },
-  { 150939, true },
-  { 150949, true },
-  { 150961, true },
-  { 150979, true },
-  { 150995, true },
-  { 151010, true },
-  { 151025, false },
-  { 151048, true },
-  { 151064, true },
-  { 151077, true },
-  { 151088, true },
-  { 151105, true },
-  { 151125, true },
-  { 151156, true },
-  { 151177, true },
-  { 151190, true },
-  { 151211, true },
-  { 151222, true },
-  { 151239, true },
-  { 151251, true },
-  { 151264, true },
-  { 151272, true },
+  { 149947, true },
+  { 149963, true },
+  { 149986, true },
+  { 150006, true },
+  { 150019, true },
+  { 150031, true },
+  { 150042, true },
+  { 150061, true },
+  { 150073, true },
+  { 150090, true },
+  { 150107, true },
+  { 150119, true },
+  { 150136, true },
+  { 150147, true },
+  { 150171, true },
+  { 150181, true },
+  { 150193, true },
+  { 150203, true },
+  { 150234, true },
+  { 150243, true },
+  { 150260, true },
+  { 150272, true },
+  { 150291, true },
+  { 150307, true },
+  { 150324, true },
+  { 150337, true },
+  { 150350, true },
+  { 150360, true },
+  { 150374, true },
+  { 150383, true },
+  { 150393, true },
+  { 150408, true },
+  { 150418, true },
+  { 150432, true },
+  { 150448, true },
+  { 150461, true },
+  { 150471, true },
+  { 150489, true },
+  { 150506, true },
+  { 150522, true },
+  { 150539, true },
+  { 150561, true },
+  { 150573, true },
+  { 150591, true },
+  { 150605, false },
+  { 150620, true },
+  { 150633, true },
+  { 150646, true },
+  { 150658, true },
+  { 150670, true },
+  { 150681, true },
+  { 150698, true },
+  { 150710, true },
+  { 150729, true },
+  { 150755, true },
+  { 150764, true },
+  { 150779, false },
+  { 150786, true },
+  { 150802, true },
+  { 150817, true },
+  { 150839, true },
+  { 150864, true },
+  { 150880, true },
+  { 150898, true },
+  { 150912, true },
+  { 150922, true },
+  { 150932, true },
+  { 150943, true },
+  { 150958, true },
+  { 150968, true },
+  { 150980, true },
+  { 150998, true },
+  { 151014, true },
+  { 151029, true },
+  { 151044, false },
+  { 151067, true },
+  { 151083, true },
+  { 151096, true },
+  { 151107, true },
+  { 151124, true },
+  { 151144, true },
+  { 151175, true },
+  { 151196, true },
+  { 151209, true },
+  { 151230, true },
+  { 151241, true },
+  { 151258, true },
+  { 151270, true },
   { 151283, true },
-  { 151292, true },
-  { 151301, true },
-  { 151315, true },
-  { 151327, false },
+  { 151291, true },
+  { 151302, true },
+  { 151311, true },
+  { 151320, true },
   { 151334, true },
-  { 151342, true },
-  { 151351, true },
-  { 151362, true },
-  { 151369, true },
-  { 151386, true },
-  { 151394, true },
-  { 151408, true },
-  { 151416, true },
-  { 151435, false },
-  { 151455, true },
-  { 151465, true },
-  { 151486, true },
-  { 151497, false },
-  { 151509, true },
-  { 151526, true },
-  { 151537, true },
-  { 151566, true },
-  { 151580, true },
-  { 151594, true },
-  { 151611, true },
-  { 151623, true },
-  { 151638, true },
-  { 151646, true },
-  { 151654, true },
-  { 151668, true },
-  { 151685, true },
-  { 151703, true },
-  { 151716, true },
-  { 151725, false },
-  { 151743, true },
-  { 151755, true },
-  { 151768, true },
-  { 151777, true },
-  { 151800, true },
-  { 151814, true },
-  { 151827, true },
-  { 151843, true },
-  { 151860, true },
-  { 151873, true },
-  { 151891, true },
-  { 151903, true },
+  { 151346, false },
+  { 151353, true },
+  { 151361, true },
+  { 151370, true },
+  { 151381, true },
+  { 151388, true },
+  { 151405, true },
+  { 151413, true },
+  { 151427, true },
+  { 151435, true },
+  { 151454, false },
+  { 151474, true },
+  { 151484, true },
+  { 151505, true },
+  { 151516, false },
+  { 151528, true },
+  { 151545, true },
+  { 151556, true },
+  { 151585, true },
+  { 151599, true },
+  { 151613, true },
+  { 151630, true },
+  { 151642, true },
+  { 151657, true },
+  { 151665, true },
+  { 151673, true },
+  { 151687, true },
+  { 151704, true },
+  { 151722, true },
+  { 151735, true },
+  { 151744, false },
+  { 151762, true },
+  { 151774, true },
+  { 151787, true },
+  { 151796, true },
+  { 151819, true },
+  { 151833, true },
+  { 151846, true },
+  { 151862, true },
+  { 151879, true },
+  { 151892, true },
+  { 151910, true },
   { 151922, true },
-  { 151944, true },
-  { 151966, true },
-  { 151986, false },
-  { 152002, true },
-  { 152025, true },
-  { 152034, true },
-  { 152049, true },
-  { 152057, true },
-  { 152072, true },
+  { 151941, true },
+  { 151963, true },
+  { 151985, true },
+  { 152005, false },
+  { 152021, true },
+  { 152044, true },
+  { 152053, true },
+  { 152068, true },
+  { 152076, true },
   { 152091, true },
-  { 152107, true },
-  { 152121, true },
-  { 152137, true },
-  { 152157, true },
-  { 152182, true },
-  { 152192, true },
-  { 152210, true },
-  { 152217, true },
+  { 152110, true },
+  { 152126, true },
+  { 152140, true },
+  { 152156, true },
+  { 152176, true },
+  { 152201, true },
+  { 152211, true },
   { 152229, true },
-  { 152242, true },
-  { 152252, true },
-  { 152260, true },
-  { 152268, true },
-  { 152276, false },
-  { 152299, true },
+  { 152236, true },
+  { 152248, true },
+  { 152261, true },
+  { 152271, true },
+  { 152279, true },
+  { 152287, true },
+  { 152295, false },
   { 152318, true },
-  { 152343, true },
-  { 152360, true },
-  { 152372, true },
-  { 152384, true },
-  { 152399, true },
-  { 152408, true },
-  { 152422, true },
-  { 152435, true },
-  { 152457, true },
-  { 152467, true },
-  { 152488, true },
-  { 152509, true },
-  { 152526, true },
-  { 152547, true },
-  { 152561, true },
-  { 152577, true },
-  { 152590, true },
-  { 152600, true },
-  { 152613, true },
-  { 152637, true },
+  { 152337, true },
+  { 152362, true },
+  { 152379, true },
+  { 152391, true },
+  { 152403, true },
+  { 152418, true },
+  { 152427, true },
+  { 152441, true },
+  { 152454, true },
+  { 152476, true },
+  { 152486, true },
+  { 152507, true },
+  { 152528, true },
+  { 152545, true },
+  { 152566, true },
+  { 152580, true },
+  { 152596, true },
+  { 152609, true },
+  { 152619, true },
+  { 152632, true },
   { 152656, true },
-  { 152668, true },
-  { 152686, true },
-  { 152695, true },
-  { 152712, true },
-  { 152730, true },
-  { 152743, true },
-  { 152756, false },
-  { 152777, true },
-  { 152787, true },
+  { 152675, true },
+  { 152687, true },
+  { 152705, true },
+  { 152714, true },
+  { 152731, true },
+  { 152749, true },
+  { 152762, true },
+  { 152775, false },
+  { 152796, true },
   { 152806, true },
-  { 152819, true },
-  { 152834, true },
-  { 152854, true },
-  { 152865, true },
-  { 152877, true },
-  { 152892, true },
-  { 152905, true },
-  { 152920, true },
-  { 152935, true },
-  { 152948, false },
-  { 152957, true },
+  { 152825, true },
+  { 152838, true },
+  { 152853, true },
+  { 152873, true },
+  { 152884, true },
+  { 152896, true },
+  { 152911, true },
+  { 152924, true },
+  { 152939, true },
+  { 152954, true },
+  { 152967, false },
   { 152976, true },
-  { 152993, false },
-  { 153008, true },
-  { 153022, true },
-  { 153032, true },
-  { 153045, true },
-  { 153061, true },
-  { 153079, true },
-  { 153089, true },
-  { 153101, true },
-  { 153114, true },
-  { 153127, true },
-  { 153136, true },
-  { 153160, true },
-  { 153184, true },
-  { 153201, false },
-  { 153214, true },
-  { 153225, true },
-  { 153241, true },
-  { 153253, true },
-  { 153269, true },
-  { 153286, true },
-  { 153303, true },
-  { 153322, false },
-  { 153331, true },
-  { 153353, true },
-  { 153367, true },
-  { 153380, false },
-  { 153395, true },
-  { 153410, true },
-  { 153422, true },
-  { 153441, false },
-  { 153464, true },
-  { 153480, true },
-  { 153496, false },
-  { 153516, true },
-  { 153529, true },
-  { 153545, true },
-  { 153556, true },
+  { 152995, true },
+  { 153012, false },
+  { 153027, true },
+  { 153041, true },
+  { 153051, true },
+  { 153064, true },
+  { 153080, true },
+  { 153098, true },
+  { 153108, true },
+  { 153120, true },
+  { 153133, true },
+  { 153146, true },
+  { 153155, true },
+  { 153179, true },
+  { 153203, true },
+  { 153220, false },
+  { 153233, true },
+  { 153244, true },
+  { 153260, true },
+  { 153272, true },
+  { 153288, true },
+  { 153305, true },
+  { 153322, true },
+  { 153341, false },
+  { 153350, true },
+  { 153372, true },
+  { 153386, true },
+  { 153399, false },
+  { 153414, true },
+  { 153429, true },
+  { 153441, true },
+  { 153460, false },
+  { 153483, true },
+  { 153499, true },
+  { 153515, false },
+  { 153535, true },
+  { 153548, true },
+  { 153564, true },
   { 153575, true },
-  { 153589, true },
-  { 153600, true },
-  { 153610, true },
-  { 153627, true },
-  { 153639, true },
-  { 153657, true },
+  { 153594, true },
+  { 153608, true },
+  { 153619, true },
+  { 153629, true },
+  { 153646, true },
+  { 153658, true },
   { 153676, true },
-  { 153688, true },
-  { 153699, true },
+  { 153695, true },
+  { 153707, true },
   { 153718, true },
-  { 153739, true },
-  { 153752, true },
-  { 153768, true },
-  { 153792, false },
-  { 153810, true },
-  { 153828, false },
-  { 153848, true },
+  { 153737, true },
+  { 153758, true },
+  { 153771, true },
+  { 153787, true },
+  { 153811, false },
+  { 153829, true },
+  { 153847, false },
   { 153867, true },
-  { 153883, true },
-  { 153901, true },
-  { 153913, true },
-  { 153930, true },
-  { 153953, true },
+  { 153886, true },
+  { 153902, true },
+  { 153920, true },
+  { 153932, true },
+  { 153949, true },
   { 153972, true },
-  { 153992, true },
-  { 154005, true },
-  { 154017, true },
-  { 154025, true },
-  { 154045, true },
-  { 154053, true },
-  { 154069, true },
-  { 154083, true },
-  { 154092, true },
-  { 154104, true },
-  { 154114, true },
+  { 153991, true },
+  { 154011, true },
+  { 154024, true },
+  { 154036, true },
+  { 154044, true },
+  { 154064, true },
+  { 154072, true },
+  { 154088, true },
+  { 154102, true },
+  { 154111, true },
   { 154123, true },
-  { 154140, true },
-  { 154152, true },
-  { 154163, true },
-  { 154173, true },
-  { 154184, true },
-  { 154197, true },
-  { 154214, true },
-  { 154225, true },
-  { 154235, true },
-  { 154252, true },
-  { 154280, true },
-  { 154294, true },
-  { 154306, true },
+  { 154133, true },
+  { 154142, true },
+  { 154159, true },
+  { 154171, true },
+  { 154182, true },
+  { 154192, true },
+  { 154203, true },
+  { 154216, true },
+  { 154233, true },
+  { 154244, true },
+  { 154254, true },
+  { 154271, true },
+  { 154299, true },
+  { 154313, true },
   { 154325, true },
-  { 154335, true },
-  { 154352, true },
-  { 154374, true },
-  { 154388, true },
-  { 154402, true },
-  { 154417, true },
-  { 154431, true },
-  { 154440, true },
-  { 154446, true },
-  { 154452, true },
-  { 154460, true },
-  { 154472, true },
-  { 154493, true },
-  { 154503, true },
-  { 154514, true },
-  { 154532, true },
-  { 154545, true },
+  { 154344, true },
+  { 154354, true },
+  { 154371, true },
+  { 154393, true },
+  { 154407, true },
+  { 154421, true },
+  { 154436, true },
+  { 154450, true },
+  { 154459, true },
+  { 154465, true },
+  { 154471, true },
+  { 154479, true },
+  { 154491, true },
+  { 154512, true },
+  { 154522, true },
+  { 154533, true },
+  { 154551, true },
   { 154564, true },
-  { 154580, true },
-  { 154593, true },
-  { 154604, true },
-  { 154617, true },
-  { 154631, true },
-  { 154648, false },
-  { 154662, true },
+  { 154583, true },
+  { 154599, true },
+  { 154612, true },
+  { 154623, true },
+  { 154636, true },
+  { 154650, true },
+  { 154667, false },
   { 154681, true },
   { 154691, true },
   { 154699, true },
@@ -24951,3363 +24939,3363 @@ static const nsSTSPreload kSTSPreloadList[] = {
   { 155885, true },
   { 155900, true },
   { 155923, true },
-  { 155934, true },
-  { 155952, true },
-  { 155968, true },
-  { 155984, true },
-  { 156001, true },
-  { 156020, true },
-  { 156038, true },
-  { 156044, true },
-  { 156062, false },
-  { 156082, true },
-  { 156099, true },
-  { 156113, true },
-  { 156125, true },
-  { 156144, false },
-  { 156161, true },
-  { 156180, true },
-  { 156191, true },
-  { 156210, true },
-  { 156233, true },
-  { 156244, true },
-  { 156262, true },
-  { 156279, true },
+  { 155941, true },
+  { 155957, true },
+  { 155974, true },
+  { 155993, true },
+  { 156011, true },
+  { 156017, true },
+  { 156035, false },
+  { 156055, true },
+  { 156072, true },
+  { 156086, true },
+  { 156098, true },
+  { 156117, false },
+  { 156134, true },
+  { 156153, true },
+  { 156164, true },
+  { 156183, true },
+  { 156206, true },
+  { 156217, true },
+  { 156235, true },
+  { 156252, true },
+  { 156271, true },
+  { 156289, true },
   { 156298, true },
-  { 156316, true },
-  { 156325, true },
-  { 156332, true },
-  { 156339, true },
-  { 156351, false },
-  { 156371, true },
-  { 156379, true },
-  { 156390, true },
-  { 156413, true },
-  { 156437, true },
-  { 156460, true },
-  { 156483, true },
-  { 156511, true },
-  { 156540, true },
-  { 156555, true },
-  { 156574, true },
-  { 156592, true },
-  { 156615, true },
-  { 156626, true },
-  { 156643, true },
-  { 156654, true },
-  { 156665, true },
-  { 156683, true },
-  { 156709, true },
-  { 156738, true },
-  { 156750, true },
-  { 156763, false },
-  { 156783, true },
-  { 156795, true },
-  { 156813, false },
-  { 156828, true },
-  { 156849, false },
-  { 156865, true },
-  { 156883, true },
-  { 156899, true },
-  { 156915, true },
-  { 156933, true },
-  { 156949, true },
-  { 156961, true },
+  { 156305, true },
+  { 156312, true },
+  { 156324, false },
+  { 156344, true },
+  { 156352, true },
+  { 156363, true },
+  { 156386, true },
+  { 156410, true },
+  { 156433, true },
+  { 156456, true },
+  { 156484, true },
+  { 156513, true },
+  { 156528, true },
+  { 156547, true },
+  { 156565, true },
+  { 156588, true },
+  { 156599, true },
+  { 156616, true },
+  { 156627, true },
+  { 156638, true },
+  { 156656, true },
+  { 156682, true },
+  { 156711, true },
+  { 156723, true },
+  { 156736, false },
+  { 156756, true },
+  { 156774, false },
+  { 156789, true },
+  { 156810, false },
+  { 156826, true },
+  { 156844, true },
+  { 156860, true },
+  { 156876, true },
+  { 156894, true },
+  { 156910, true },
+  { 156922, true },
+  { 156944, true },
+  { 156964, true },
   { 156983, true },
   { 157003, true },
   { 157022, true },
-  { 157042, true },
-  { 157061, true },
-  { 157078, true },
-  { 157096, false },
-  { 157114, true },
+  { 157039, true },
+  { 157057, false },
+  { 157075, true },
+  { 157094, true },
+  { 157121, true },
   { 157133, true },
-  { 157160, true },
-  { 157172, true },
-  { 157186, true },
-  { 157201, true },
-  { 157213, true },
-  { 157224, true },
-  { 157243, true },
+  { 157147, true },
+  { 157162, true },
+  { 157174, true },
+  { 157185, true },
+  { 157204, true },
+  { 157218, true },
+  { 157233, true },
+  { 157242, true },
   { 157257, true },
-  { 157272, true },
-  { 157281, true },
-  { 157296, true },
-  { 157306, true },
+  { 157267, true },
+  { 157280, true },
+  { 157300, true },
+  { 157309, true },
   { 157319, true },
-  { 157339, true },
-  { 157348, true },
-  { 157358, true },
-  { 157379, false },
+  { 157340, false },
+  { 157357, true },
+  { 157366, true },
+  { 157379, true },
   { 157396, true },
-  { 157405, true },
-  { 157418, true },
-  { 157435, true },
-  { 157449, true },
+  { 157410, true },
+  { 157424, true },
+  { 157436, true },
+  { 157453, true },
   { 157463, true },
-  { 157475, true },
-  { 157492, true },
-  { 157502, true },
+  { 157479, true },
+  { 157491, true },
+  { 157502, false },
   { 157518, true },
-  { 157530, true },
-  { 157541, false },
-  { 157557, true },
-  { 157568, true },
-  { 157584, true },
+  { 157529, true },
+  { 157545, true },
+  { 157558, true },
+  { 157567, true },
+  { 157580, true },
   { 157597, true },
-  { 157606, true },
-  { 157619, true },
-  { 157636, true },
-  { 157648, true },
-  { 157660, true },
-  { 157672, true },
-  { 157681, true },
+  { 157609, true },
+  { 157621, true },
+  { 157633, true },
+  { 157642, true },
+  { 157654, true },
+  { 157669, true },
+  { 157683, true },
   { 157693, true },
-  { 157708, true },
-  { 157722, true },
+  { 157714, true },
   { 157732, true },
-  { 157753, true },
-  { 157771, true },
-  { 157783, true },
-  { 157798, true },
+  { 157744, true },
+  { 157759, true },
+  { 157769, true },
+  { 157784, true },
+  { 157796, true },
   { 157808, true },
   { 157823, true },
-  { 157835, true },
-  { 157847, true },
-  { 157862, true },
-  { 157873, true },
-  { 157884, true },
-  { 157892, true },
+  { 157834, true },
+  { 157845, true },
+  { 157853, true },
+  { 157866, true },
+  { 157879, true },
+  { 157888, true },
   { 157905, true },
-  { 157918, true },
-  { 157927, true },
-  { 157944, true },
-  { 157954, true },
-  { 157967, true },
-  { 157984, true },
-  { 157998, true },
-  { 158007, true },
-  { 158022, true },
-  { 158036, true },
-  { 158049, true },
-  { 158063, true },
-  { 158077, true },
-  { 158096, true },
-  { 158104, true },
-  { 158121, true },
-  { 158136, true },
-  { 158151, true },
-  { 158165, true },
-  { 158181, true },
-  { 158197, true },
-  { 158211, true },
-  { 158227, true },
-  { 158244, true },
-  { 158257, true },
-  { 158271, false },
-  { 158289, true },
-  { 158304, true },
-  { 158321, true },
-  { 158338, false },
-  { 158364, true },
-  { 158379, true },
-  { 158397, true },
-  { 158410, true },
-  { 158423, true },
-  { 158435, true },
-  { 158454, true },
-  { 158464, true },
-  { 158480, true },
-  { 158492, true },
-  { 158505, true },
-  { 158516, true },
-  { 158533, true },
-  { 158564, true },
-  { 158574, true },
-  { 158585, true },
-  { 158596, true },
-  { 158608, true },
+  { 157915, true },
+  { 157928, true },
+  { 157945, true },
+  { 157959, true },
+  { 157968, true },
+  { 157983, true },
+  { 157997, true },
+  { 158010, true },
+  { 158024, true },
+  { 158038, true },
+  { 158057, true },
+  { 158065, true },
+  { 158082, true },
+  { 158097, true },
+  { 158112, true },
+  { 158126, true },
+  { 158142, true },
+  { 158158, true },
+  { 158172, true },
+  { 158188, true },
+  { 158205, true },
+  { 158218, true },
+  { 158232, false },
+  { 158250, true },
+  { 158265, true },
+  { 158282, true },
+  { 158299, false },
+  { 158325, true },
+  { 158340, true },
+  { 158358, true },
+  { 158371, true },
+  { 158384, true },
+  { 158396, true },
+  { 158415, true },
+  { 158425, true },
+  { 158441, true },
+  { 158453, true },
+  { 158466, true },
+  { 158477, true },
+  { 158494, true },
+  { 158525, true },
+  { 158535, true },
+  { 158546, true },
+  { 158557, true },
+  { 158569, true },
+  { 158583, true },
+  { 158595, true },
+  { 158603, true },
+  { 158611, true },
   { 158622, true },
-  { 158634, true },
-  { 158642, true },
-  { 158650, true },
-  { 158661, true },
-  { 158672, false },
-  { 158692, true },
-  { 158710, true },
-  { 158725, false },
-  { 158739, true },
-  { 158759, true },
-  { 158770, true },
-  { 158795, true },
-  { 158813, true },
-  { 158828, true },
-  { 158845, true },
-  { 158861, true },
-  { 158886, true },
-  { 158897, true },
-  { 158908, true },
-  { 158921, true },
-  { 158933, true },
-  { 158946, false },
-  { 158954, true },
-  { 158964, true },
-  { 158979, true },
-  { 158998, true },
-  { 159011, true },
-  { 159024, true },
-  { 159039, true },
-  { 159052, true },
-  { 159065, true },
-  { 159079, true },
-  { 159092, true },
-  { 159112, true },
+  { 158633, false },
+  { 158653, true },
+  { 158671, true },
+  { 158686, false },
+  { 158700, true },
+  { 158720, true },
+  { 158731, true },
+  { 158756, true },
+  { 158774, true },
+  { 158789, true },
+  { 158806, true },
+  { 158822, true },
+  { 158847, true },
+  { 158858, true },
+  { 158869, true },
+  { 158882, true },
+  { 158894, true },
+  { 158907, false },
+  { 158915, true },
+  { 158925, true },
+  { 158940, true },
+  { 158959, true },
+  { 158972, true },
+  { 158985, true },
+  { 159000, true },
+  { 159013, true },
+  { 159026, true },
+  { 159040, true },
+  { 159053, true },
+  { 159073, true },
+  { 159091, true },
+  { 159105, true },
+  { 159119, true },
   { 159130, true },
-  { 159144, true },
-  { 159158, true },
-  { 159169, true },
-  { 159180, true },
-  { 159193, true },
-  { 159210, true },
-  { 159218, true },
-  { 159233, true },
-  { 159246, true },
-  { 159260, true },
-  { 159275, true },
-  { 159300, true },
-  { 159336, true },
-  { 159349, true },
-  { 159359, true },
-  { 159374, true },
-  { 159387, true },
-  { 159409, true },
-  { 159427, true },
-  { 159440, true },
-  { 159451, true },
-  { 159463, true },
-  { 159481, true },
-  { 159489, true },
-  { 159522, true },
-  { 159529, true },
-  { 159546, true },
-  { 159564, false },
-  { 159582, true },
-  { 159600, true },
-  { 159612, true },
-  { 159624, true },
-  { 159637, true },
-  { 159653, true },
-  { 159667, true },
-  { 159687, true },
-  { 159707, true },
-  { 159718, true },
+  { 159141, true },
+  { 159154, true },
+  { 159171, true },
+  { 159179, true },
+  { 159194, true },
+  { 159207, true },
+  { 159221, true },
+  { 159236, true },
+  { 159261, true },
+  { 159297, true },
+  { 159310, true },
+  { 159320, true },
+  { 159335, true },
+  { 159348, true },
+  { 159370, true },
+  { 159388, true },
+  { 159401, true },
+  { 159412, true },
+  { 159424, true },
+  { 159442, true },
+  { 159450, true },
+  { 159483, true },
+  { 159490, true },
+  { 159507, true },
+  { 159525, false },
+  { 159543, true },
+  { 159561, true },
+  { 159573, true },
+  { 159585, true },
+  { 159598, true },
+  { 159614, true },
+  { 159628, true },
+  { 159648, true },
+  { 159668, true },
+  { 159679, true },
+  { 159689, true },
+  { 159698, true },
+  { 159709, true },
   { 159728, true },
-  { 159737, true },
-  { 159748, true },
-  { 159767, true },
-  { 159781, true },
-  { 159795, true },
-  { 159818, true },
-  { 159832, true },
-  { 159846, true },
-  { 159858, true },
-  { 159872, false },
-  { 159882, true },
-  { 159896, true },
-  { 159905, true },
-  { 159917, true },
-  { 159928, true },
-  { 159937, true },
-  { 159946, true },
-  { 159958, true },
-  { 159972, true },
-  { 159978, true },
-  { 159990, true },
-  { 160005, false },
-  { 160032, true },
-  { 160052, true },
-  { 160062, true },
-  { 160075, true },
-  { 160088, true },
-  { 160104, true },
-  { 160125, true },
-  { 160144, true },
-  { 160154, true },
-  { 160166, true },
-  { 160178, true },
-  { 160189, false },
-  { 160197, true },
-  { 160212, true },
-  { 160226, true },
-  { 160235, true },
-  { 160247, true },
-  { 160260, true },
-  { 160270, true },
-  { 160291, true },
-  { 160303, true },
+  { 159742, true },
+  { 159756, true },
+  { 159779, true },
+  { 159793, true },
+  { 159807, true },
+  { 159819, true },
+  { 159833, false },
+  { 159843, true },
+  { 159857, true },
+  { 159866, true },
+  { 159878, true },
+  { 159889, true },
+  { 159898, true },
+  { 159907, true },
+  { 159919, true },
+  { 159933, true },
+  { 159939, true },
+  { 159951, true },
+  { 159966, false },
+  { 159993, true },
+  { 160013, true },
+  { 160023, true },
+  { 160036, true },
+  { 160049, true },
+  { 160065, true },
+  { 160086, true },
+  { 160105, true },
+  { 160115, true },
+  { 160127, true },
+  { 160139, true },
+  { 160150, false },
+  { 160158, true },
+  { 160173, true },
+  { 160187, true },
+  { 160196, true },
+  { 160208, true },
+  { 160221, true },
+  { 160231, true },
+  { 160252, true },
+  { 160264, true },
+  { 160275, true },
+  { 160295, true },
   { 160314, true },
-  { 160334, true },
-  { 160353, true },
-  { 160364, true },
-  { 160379, true },
-  { 160404, false },
-  { 160432, false },
-  { 160444, true },
-  { 160455, true },
-  { 160466, true },
-  { 160481, true },
-  { 160496, true },
-  { 160513, true },
-  { 160525, false },
-  { 160542, true },
-  { 160558, true },
-  { 160572, true },
-  { 160587, true },
-  { 160602, true },
-  { 160618, true },
-  { 160635, true },
-  { 160658, true },
-  { 160677, true },
-  { 160691, true },
-  { 160712, true },
-  { 160732, true },
-  { 160750, true },
-  { 160769, true },
-  { 160787, true },
-  { 160805, false },
-  { 160822, true },
-  { 160837, false },
-  { 160852, false },
-  { 160866, true },
+  { 160325, true },
+  { 160340, true },
+  { 160365, false },
+  { 160393, false },
+  { 160405, true },
+  { 160416, true },
+  { 160427, true },
+  { 160442, true },
+  { 160457, true },
+  { 160474, true },
+  { 160486, false },
+  { 160503, true },
+  { 160519, true },
+  { 160533, true },
+  { 160548, true },
+  { 160563, true },
+  { 160579, true },
+  { 160596, true },
+  { 160619, true },
+  { 160638, true },
+  { 160652, true },
+  { 160673, true },
+  { 160693, true },
+  { 160711, true },
+  { 160730, true },
+  { 160748, true },
+  { 160766, true },
+  { 160781, false },
+  { 160796, false },
+  { 160810, true },
+  { 160821, true },
+  { 160832, true },
+  { 160844, true },
+  { 160859, true },
   { 160877, true },
-  { 160888, true },
-  { 160900, true },
-  { 160915, true },
-  { 160933, true },
-  { 160955, true },
-  { 160969, true },
-  { 160986, true },
-  { 161005, true },
-  { 161026, true },
-  { 161040, true },
-  { 161055, true },
-  { 161071, true },
-  { 161089, true },
-  { 161099, true },
-  { 161111, false },
-  { 161122, true },
-  { 161135, true },
-  { 161154, false },
-  { 161173, true },
-  { 161188, true },
-  { 161201, false },
-  { 161220, true },
-  { 161231, true },
-  { 161249, true },
-  { 161263, true },
-  { 161288, true },
-  { 161303, true },
-  { 161321, true },
-  { 161336, true },
-  { 161351, true },
-  { 161368, true },
-  { 161379, true },
-  { 161389, true },
-  { 161404, true },
-  { 161413, true },
-  { 161423, true },
-  { 161433, true },
-  { 161450, true },
-  { 161465, false },
-  { 161478, true },
-  { 161494, true },
-  { 161515, true },
-  { 161535, true },
-  { 161554, true },
-  { 161566, true },
-  { 161577, true },
-  { 161587, true },
-  { 161599, true },
-  { 161614, true },
+  { 160899, true },
+  { 160913, true },
+  { 160930, true },
+  { 160949, true },
+  { 160970, true },
+  { 160984, true },
+  { 160999, true },
+  { 161015, true },
+  { 161033, true },
+  { 161043, true },
+  { 161055, false },
+  { 161066, true },
+  { 161079, true },
+  { 161098, false },
+  { 161117, true },
+  { 161132, true },
+  { 161145, false },
+  { 161164, true },
+  { 161175, true },
+  { 161193, true },
+  { 161207, true },
+  { 161232, true },
+  { 161247, true },
+  { 161265, true },
+  { 161280, true },
+  { 161295, true },
+  { 161312, true },
+  { 161323, true },
+  { 161333, true },
+  { 161348, true },
+  { 161357, true },
+  { 161367, true },
+  { 161377, true },
+  { 161394, true },
+  { 161409, false },
+  { 161422, true },
+  { 161438, true },
+  { 161459, true },
+  { 161479, true },
+  { 161498, true },
+  { 161510, true },
+  { 161521, true },
+  { 161531, true },
+  { 161543, true },
+  { 161558, true },
+  { 161572, true },
+  { 161592, true },
+  { 161615, true },
   { 161628, true },
-  { 161648, true },
-  { 161671, true },
-  { 161684, true },
-  { 161702, true },
-  { 161710, true },
-  { 161718, true },
-  { 161730, true },
-  { 161742, true },
-  { 161759, true },
-  { 161770, true },
-  { 161787, false },
-  { 161804, true },
-  { 161817, true },
-  { 161828, false },
-  { 161841, true },
-  { 161856, false },
-  { 161880, false },
-  { 161892, true },
-  { 161917, true },
-  { 161926, true },
-  { 161938, true },
-  { 161958, true },
-  { 161975, true },
-  { 161985, true },
-  { 162006, true },
-  { 162015, true },
-  { 162034, true },
-  { 162052, true },
-  { 162068, true },
-  { 162083, true },
-  { 162098, true },
-  { 162113, true },
-  { 162133, true },
-  { 162146, true },
-  { 162159, true },
-  { 162168, true },
-  { 162182, true },
-  { 162205, true },
+  { 161646, true },
+  { 161654, true },
+  { 161662, true },
+  { 161674, true },
+  { 161686, true },
+  { 161703, true },
+  { 161714, true },
+  { 161731, false },
+  { 161748, true },
+  { 161761, true },
+  { 161772, false },
+  { 161785, true },
+  { 161800, false },
+  { 161824, false },
+  { 161836, true },
+  { 161861, true },
+  { 161870, true },
+  { 161882, true },
+  { 161902, true },
+  { 161919, true },
+  { 161929, true },
+  { 161950, true },
+  { 161959, true },
+  { 161978, true },
+  { 161996, true },
+  { 162012, true },
+  { 162027, true },
+  { 162042, true },
+  { 162057, true },
+  { 162077, true },
+  { 162090, true },
+  { 162103, true },
+  { 162112, true },
+  { 162126, true },
+  { 162149, true },
+  { 162171, true },
+  { 162197, true },
+  { 162212, true },
   { 162227, true },
+  { 162241, true },
   { 162253, true },
-  { 162268, true },
-  { 162283, true },
-  { 162297, true },
-  { 162309, true },
-  { 162332, true },
-  { 162342, true },
-  { 162350, true },
-  { 162366, true },
+  { 162276, true },
+  { 162286, true },
+  { 162294, true },
+  { 162310, true },
+  { 162324, true },
+  { 162336, true },
+  { 162349, false },
+  { 162367, true },
   { 162380, true },
-  { 162392, true },
-  { 162405, false },
-  { 162423, true },
-  { 162436, true },
-  { 162447, true },
-  { 162460, true },
-  { 162470, true },
-  { 162485, true },
-  { 162498, true },
-  { 162514, true },
-  { 162524, false },
-  { 162534, true },
-  { 162547, true },
-  { 162562, true },
-  { 162572, true },
-  { 162588, true },
-  { 162600, true },
-  { 162609, true },
-  { 162624, true },
-  { 162635, true },
-  { 162653, true },
+  { 162391, true },
+  { 162404, true },
+  { 162414, true },
+  { 162429, true },
+  { 162442, true },
+  { 162458, true },
+  { 162468, false },
+  { 162478, true },
+  { 162491, true },
+  { 162506, true },
+  { 162516, true },
+  { 162532, true },
+  { 162544, true },
+  { 162553, true },
+  { 162568, true },
+  { 162579, true },
+  { 162597, true },
+  { 162617, true },
+  { 162633, true },
+  { 162650, true },
+  { 162663, true },
   { 162673, true },
-  { 162689, true },
-  { 162706, true },
-  { 162719, true },
-  { 162729, true },
+  { 162683, true },
+  { 162697, true },
+  { 162709, true },
+  { 162722, true },
   { 162739, true },
-  { 162753, true },
-  { 162765, true },
-  { 162778, true },
-  { 162795, true },
-  { 162810, true },
-  { 162827, true },
-  { 162839, true },
-  { 162856, true },
+  { 162754, true },
+  { 162771, true },
+  { 162783, true },
+  { 162800, true },
+  { 162814, true },
+  { 162830, true },
+  { 162843, true },
+  { 162858, false },
   { 162870, true },
-  { 162886, true },
-  { 162899, true },
-  { 162914, false },
-  { 162926, true },
-  { 162936, true },
-  { 162945, true },
-  { 162957, true },
-  { 162965, true },
-  { 162973, true },
-  { 162981, true },
-  { 162987, true },
-  { 163002, true },
-  { 163015, true },
+  { 162880, true },
+  { 162889, true },
+  { 162901, true },
+  { 162909, true },
+  { 162917, true },
+  { 162925, true },
+  { 162931, true },
+  { 162946, true },
+  { 162959, true },
+  { 162974, true },
+  { 162993, true },
+  { 163017, true },
   { 163030, true },
-  { 163049, true },
-  { 163073, true },
-  { 163086, true },
-  { 163101, true },
-  { 163125, true },
-  { 163135, true },
-  { 163151, true },
-  { 163172, true },
-  { 163195, true },
-  { 163216, true },
-  { 163229, true },
+  { 163045, true },
+  { 163069, true },
+  { 163079, true },
+  { 163095, true },
+  { 163116, true },
+  { 163139, true },
+  { 163160, true },
+  { 163173, true },
+  { 163186, true },
+  { 163203, true },
+  { 163217, true },
+  { 163229, false },
   { 163242, true },
-  { 163259, true },
-  { 163273, true },
+  { 163261, true },
   { 163285, false },
-  { 163298, true },
-  { 163317, true },
-  { 163341, false },
-  { 163368, true },
-  { 163394, true },
-  { 163409, true },
-  { 163426, true },
-  { 163442, true },
+  { 163312, true },
+  { 163338, true },
+  { 163353, true },
+  { 163370, true },
+  { 163386, true },
+  { 163403, true },
+  { 163416, true },
+  { 163427, true },
+  { 163438, true },
+  { 163449, true },
   { 163459, true },
-  { 163472, true },
-  { 163483, true },
-  { 163494, true },
-  { 163505, true },
-  { 163515, true },
-  { 163524, true },
+  { 163468, true },
+  { 163481, true },
+  { 163499, true },
+  { 163512, true },
+  { 163526, true },
   { 163537, true },
-  { 163555, true },
-  { 163568, true },
-  { 163582, true },
+  { 163547, true },
+  { 163558, true },
+  { 163579, true },
   { 163593, true },
-  { 163603, true },
-  { 163614, true },
-  { 163635, true },
-  { 163649, true },
-  { 163658, true },
-  { 163665, true },
+  { 163602, true },
+  { 163609, true },
+  { 163617, true },
+  { 163640, true },
+  { 163655, true },
+  { 163664, true },
   { 163673, true },
-  { 163696, true },
-  { 163711, true },
+  { 163681, true },
+  { 163694, true },
+  { 163702, true },
   { 163720, true },
-  { 163729, true },
-  { 163737, true },
-  { 163750, true },
-  { 163758, true },
+  { 163731, false },
+  { 163747, true },
+  { 163763, true },
   { 163776, true },
-  { 163787, false },
-  { 163803, true },
-  { 163819, true },
-  { 163832, true },
-  { 163843, true },
-  { 163855, true },
-  { 163870, true },
-  { 163879, true },
-  { 163891, true },
-  { 163902, true },
-  { 163914, true },
-  { 163927, true },
-  { 163942, true },
+  { 163787, true },
+  { 163799, true },
+  { 163814, true },
+  { 163823, true },
+  { 163835, true },
+  { 163846, true },
+  { 163858, true },
+  { 163871, true },
+  { 163886, true },
+  { 163906, true },
+  { 163918, true },
+  { 163935, true },
+  { 163945, true },
+  { 163955, true },
   { 163962, true },
-  { 163974, true },
-  { 163991, true },
-  { 164001, true },
-  { 164011, true },
-  { 164018, true },
-  { 164028, true },
-  { 164042, true },
-  { 164054, true },
-  { 164070, true },
-  { 164085, true },
-  { 164094, true },
-  { 164108, true },
-  { 164128, true },
-  { 164140, true },
-  { 164153, true },
-  { 164171, true },
-  { 164178, true },
+  { 163972, true },
+  { 163986, true },
+  { 163998, true },
+  { 164014, true },
+  { 164029, true },
+  { 164038, true },
+  { 164052, true },
+  { 164072, true },
+  { 164084, true },
+  { 164097, true },
+  { 164115, true },
+  { 164122, true },
+  { 164139, true },
+  { 164156, true },
+  { 164176, true },
   { 164195, true },
-  { 164212, true },
-  { 164232, true },
-  { 164251, true },
-  { 164267, false },
-  { 164285, true },
-  { 164312, true },
-  { 164329, true },
-  { 164343, true },
-  { 164357, true },
-  { 164372, false },
-  { 164391, true },
-  { 164409, true },
+  { 164211, false },
+  { 164229, true },
+  { 164256, true },
+  { 164273, true },
+  { 164287, true },
+  { 164301, true },
+  { 164316, false },
+  { 164335, true },
+  { 164353, true },
+  { 164371, true },
+  { 164389, true },
+  { 164406, true },
   { 164427, true },
-  { 164445, true },
-  { 164462, true },
-  { 164483, true },
-  { 164502, true },
-  { 164516, true },
-  { 164527, true },
-  { 164535, true },
-  { 164545, true },
-  { 164560, true },
-  { 164575, true },
-  { 164586, true },
-  { 164608, true },
-  { 164621, true },
-  { 164640, true },
-  { 164666, true },
-  { 164682, true },
-  { 164700, true },
-  { 164718, true },
-  { 164733, true },
-  { 164741, true },
-  { 164754, true },
-  { 164762, true },
+  { 164446, true },
+  { 164460, true },
+  { 164471, true },
+  { 164479, true },
+  { 164489, true },
+  { 164504, true },
+  { 164519, true },
+  { 164530, true },
+  { 164552, true },
+  { 164565, true },
+  { 164584, true },
+  { 164610, true },
+  { 164626, true },
+  { 164644, true },
+  { 164662, true },
+  { 164677, true },
+  { 164685, true },
+  { 164698, true },
+  { 164706, true },
+  { 164717, true },
+  { 164731, true },
+  { 164747, true },
+  { 164756, true },
   { 164773, true },
-  { 164787, true },
-  { 164803, true },
-  { 164812, true },
-  { 164829, true },
-  { 164839, true },
-  { 164852, true },
-  { 164870, true },
-  { 164883, true },
-  { 164902, false },
+  { 164783, true },
+  { 164796, true },
+  { 164814, true },
+  { 164827, true },
+  { 164846, false },
+  { 164856, true },
+  { 164873, true },
+  { 164889, true },
   { 164912, true },
-  { 164929, true },
-  { 164945, true },
-  { 164968, true },
-  { 164993, true },
-  { 165007, true },
+  { 164937, true },
+  { 164951, true },
+  { 164964, true },
+  { 164975, true },
+  { 164990, true },
+  { 165002, true },
   { 165020, true },
-  { 165031, true },
-  { 165046, true },
-  { 165058, true },
-  { 165076, true },
-  { 165101, true },
-  { 165113, true },
-  { 165125, true },
-  { 165137, true },
-  { 165155, true },
-  { 165176, true },
-  { 165192, true },
-  { 165204, true },
-  { 165218, true },
-  { 165233, true },
-  { 165246, true },
-  { 165264, true },
-  { 165278, true },
-  { 165288, false },
-  { 165299, true },
-  { 165307, false },
+  { 165045, true },
+  { 165057, true },
+  { 165069, true },
+  { 165081, true },
+  { 165099, true },
+  { 165120, true },
+  { 165136, true },
+  { 165148, true },
+  { 165162, true },
+  { 165177, true },
+  { 165190, true },
+  { 165208, true },
+  { 165222, true },
+  { 165232, false },
+  { 165243, true },
+  { 165251, false },
+  { 165263, true },
+  { 165280, true },
+  { 165290, true },
+  { 165301, true },
+  { 165308, true },
   { 165319, true },
   { 165336, true },
-  { 165346, true },
-  { 165357, true },
-  { 165364, true },
-  { 165375, true },
-  { 165392, true },
-  { 165412, true },
-  { 165427, true },
-  { 165436, true },
-  { 165443, true },
-  { 165453, true },
-  { 165464, true },
-  { 165479, true },
-  { 165489, true },
-  { 165510, true },
-  { 165519, true },
-  { 165535, false },
-  { 165548, true },
-  { 165564, true },
-  { 165584, true },
-  { 165598, true },
-  { 165614, true },
-  { 165628, true },
-  { 165643, true },
-  { 165656, true },
-  { 165672, true },
-  { 165685, true },
-  { 165699, true },
-  { 165721, true },
-  { 165742, true },
-  { 165761, true },
-  { 165789, true },
-  { 165810, true },
-  { 165829, true },
-  { 165853, true },
-  { 165863, true },
-  { 165872, true },
-  { 165885, true },
-  { 165891, true },
-  { 165903, true },
-  { 165917, true },
-  { 165931, true },
-  { 165945, false },
-  { 165958, true },
-  { 165971, false },
-  { 165982, true },
-  { 165995, true },
-  { 166005, true },
-  { 166018, true },
+  { 165356, true },
+  { 165371, true },
+  { 165380, true },
+  { 165387, true },
+  { 165397, true },
+  { 165408, true },
+  { 165423, true },
+  { 165433, true },
+  { 165454, true },
+  { 165463, true },
+  { 165479, false },
+  { 165492, true },
+  { 165508, true },
+  { 165528, true },
+  { 165542, true },
+  { 165558, true },
+  { 165572, true },
+  { 165587, true },
+  { 165595, true },
+  { 165608, true },
+  { 165624, true },
+  { 165637, true },
+  { 165651, true },
+  { 165673, true },
+  { 165694, true },
+  { 165713, true },
+  { 165741, true },
+  { 165762, true },
+  { 165781, true },
+  { 165805, true },
+  { 165815, true },
+  { 165824, true },
+  { 165837, true },
+  { 165843, true },
+  { 165855, true },
+  { 165869, true },
+  { 165883, true },
+  { 165897, false },
+  { 165910, true },
+  { 165923, false },
+  { 165934, true },
+  { 165947, true },
+  { 165957, true },
+  { 165970, true },
+  { 165989, true },
+  { 166008, true },
+  { 166028, true },
   { 166037, true },
-  { 166056, true },
-  { 166076, true },
-  { 166085, true },
+  { 166048, true },
+  { 166067, false },
+  { 166083, false },
   { 166096, true },
-  { 166115, false },
-  { 166131, false },
-  { 166144, true },
+  { 166111, true },
+  { 166122, true },
+  { 166141, true },
   { 166154, true },
-  { 166169, true },
-  { 166180, true },
-  { 166199, true },
-  { 166212, true },
-  { 166224, true },
-  { 166237, true },
-  { 166252, true },
-  { 166261, true },
-  { 166274, true },
-  { 166289, true },
-  { 166305, true },
-  { 166322, true },
-  { 166331, true },
-  { 166345, true },
-  { 166359, true },
-  { 166383, true },
-  { 166398, true },
-  { 166414, true },
-  { 166429, true },
+  { 166166, true },
+  { 166179, true },
+  { 166194, true },
+  { 166203, true },
+  { 166216, true },
+  { 166231, true },
+  { 166247, true },
+  { 166264, true },
+  { 166273, true },
+  { 166287, true },
+  { 166301, true },
+  { 166325, true },
+  { 166340, true },
+  { 166356, true },
+  { 166371, true },
+  { 166389, true },
+  { 166402, true },
+  { 166425, true },
+  { 166438, true },
   { 166447, true },
   { 166460, true },
-  { 166483, true },
-  { 166496, true },
+  { 166480, true },
+  { 166491, true },
   { 166505, true },
-  { 166518, true },
-  { 166538, true },
-  { 166549, true },
-  { 166563, true },
-  { 166572, true },
-  { 166581, true },
-  { 166599, true },
-  { 166617, true },
-  { 166631, true },
-  { 166648, true },
-  { 166665, true },
-  { 166681, true },
-  { 166693, true },
-  { 166707, true },
+  { 166514, true },
+  { 166523, true },
+  { 166541, true },
+  { 166559, true },
+  { 166573, true },
+  { 166590, true },
+  { 166607, true },
+  { 166623, true },
+  { 166635, true },
+  { 166649, true },
+  { 166670, true },
+  { 166695, false },
+  { 166711, true },
   { 166728, true },
-  { 166753, false },
-  { 166769, true },
-  { 166786, true },
-  { 166805, true },
-  { 166820, true },
-  { 166830, true },
-  { 166854, true },
-  { 166866, true },
-  { 166879, true },
-  { 166893, true },
-  { 166902, true },
-  { 166931, true },
-  { 166956, true },
-  { 166981, true },
-  { 167010, true },
-  { 167022, true },
-  { 167038, true },
-  { 167047, true },
-  { 167059, true },
-  { 167073, true },
-  { 167087, true },
-  { 167101, true },
+  { 166747, true },
+  { 166762, true },
+  { 166772, true },
+  { 166796, true },
+  { 166808, true },
+  { 166821, true },
+  { 166835, true },
+  { 166844, true },
+  { 166873, true },
+  { 166898, true },
+  { 166923, true },
+  { 166952, true },
+  { 166964, true },
+  { 166980, true },
+  { 166989, true },
+  { 167001, true },
+  { 167015, true },
+  { 167029, true },
+  { 167043, true },
+  { 167056, true },
+  { 167075, true },
+  { 167088, true },
+  { 167105, true },
   { 167114, true },
-  { 167133, true },
-  { 167146, true },
-  { 167163, true },
-  { 167172, true },
+  { 167132, true },
+  { 167146, false },
+  { 167157, true },
+  { 167177, false },
   { 167190, true },
-  { 167204, false },
-  { 167215, true },
-  { 167235, false },
-  { 167248, true },
-  { 167258, true },
-  { 167277, true },
-  { 167299, true },
-  { 167310, true },
-  { 167321, true },
+  { 167200, true },
+  { 167219, true },
+  { 167241, true },
+  { 167252, true },
+  { 167263, true },
+  { 167274, true },
+  { 167284, true },
+  { 167293, true },
+  { 167301, true },
+  { 167307, false },
+  { 167315, true },
+  { 167324, true },
   { 167332, true },
   { 167342, true },
-  { 167351, true },
-  { 167359, true },
-  { 167365, false },
-  { 167373, true },
-  { 167382, true },
-  { 167390, true },
-  { 167400, true },
-  { 167408, true },
-  { 167427, true },
-  { 167452, true },
-  { 167459, true },
-  { 167472, true },
-  { 167486, true },
-  { 167496, true },
+  { 167350, true },
+  { 167369, true },
+  { 167394, true },
+  { 167401, true },
+  { 167414, true },
+  { 167428, true },
+  { 167438, true },
+  { 167448, true },
+  { 167467, true },
+  { 167479, true },
+  { 167494, true },
   { 167506, true },
-  { 167525, true },
-  { 167537, true },
-  { 167552, true },
-  { 167564, true },
-  { 167577, true },
-  { 167589, true },
-  { 167608, true },
-  { 167619, false },
-  { 167630, true },
-  { 167645, true },
-  { 167661, true },
-  { 167683, true },
-  { 167697, true },
-  { 167710, true },
-  { 167723, true },
-  { 167742, true },
-  { 167758, true },
-  { 167771, true },
-  { 167791, false },
-  { 167818, false },
-  { 167834, true },
-  { 167850, true },
-  { 167865, true },
-  { 167881, true },
+  { 167519, true },
+  { 167531, true },
+  { 167550, true },
+  { 167561, false },
+  { 167572, true },
+  { 167587, true },
+  { 167603, true },
+  { 167625, true },
+  { 167639, true },
+  { 167652, true },
+  { 167665, true },
+  { 167684, true },
+  { 167700, true },
+  { 167713, true },
+  { 167733, false },
+  { 167760, false },
+  { 167776, true },
+  { 167792, true },
+  { 167807, true },
+  { 167823, true },
+  { 167841, true },
+  { 167860, true },
+  { 167869, true },
+  { 167882, true },
   { 167899, true },
   { 167918, true },
-  { 167927, true },
-  { 167940, true },
-  { 167957, true },
-  { 167976, true },
-  { 167989, true },
-  { 168005, true },
-  { 168018, true },
-  { 168037, true },
-  { 168054, true },
-  { 168068, true },
-  { 168086, true },
-  { 168103, true },
-  { 168121, true },
-  { 168139, true },
-  { 168157, true },
-  { 168170, true },
-  { 168186, true },
-  { 168207, true },
-  { 168217, true },
-  { 168238, true },
-  { 168251, true },
-  { 168260, true },
-  { 168271, true },
-  { 168284, false },
-  { 168297, true },
+  { 167931, true },
+  { 167947, true },
+  { 167960, true },
+  { 167979, true },
+  { 167996, true },
+  { 168010, true },
+  { 168028, true },
+  { 168045, true },
+  { 168063, true },
+  { 168081, true },
+  { 168099, true },
+  { 168112, true },
+  { 168128, true },
+  { 168149, true },
+  { 168159, true },
+  { 168180, true },
+  { 168193, true },
+  { 168202, true },
+  { 168213, true },
+  { 168226, false },
+  { 168239, true },
+  { 168252, true },
+  { 168268, true },
+  { 168281, true },
+  { 168295, true },
   { 168310, true },
-  { 168326, true },
+  { 168324, true },
   { 168339, true },
-  { 168353, true },
-  { 168368, true },
-  { 168382, true },
-  { 168397, true },
-  { 168409, true },
-  { 168425, true },
-  { 168444, true },
-  { 168460, true },
-  { 168473, true },
-  { 168488, true },
-  { 168497, true },
-  { 168507, true },
-  { 168534, false },
-  { 168551, true },
-  { 168569, true },
-  { 168593, true },
-  { 168617, true },
-  { 168636, true },
-  { 168650, true },
-  { 168658, true },
-  { 168669, true },
-  { 168697, true },
-  { 168711, true },
-  { 168723, true },
-  { 168732, true },
-  { 168742, true },
-  { 168762, true },
-  { 168776, true },
-  { 168789, true },
-  { 168809, true },
+  { 168351, true },
+  { 168367, true },
+  { 168386, true },
+  { 168402, true },
+  { 168415, true },
+  { 168430, true },
+  { 168439, true },
+  { 168449, true },
+  { 168476, false },
+  { 168493, true },
+  { 168511, true },
+  { 168535, true },
+  { 168559, true },
+  { 168578, true },
+  { 168592, true },
+  { 168600, true },
+  { 168611, true },
+  { 168639, true },
+  { 168653, true },
+  { 168665, true },
+  { 168674, true },
+  { 168684, true },
+  { 168704, true },
+  { 168718, true },
+  { 168731, true },
+  { 168751, true },
+  { 168769, true },
+  { 168781, true },
+  { 168796, true },
+  { 168811, true },
   { 168827, true },
-  { 168839, true },
-  { 168854, true },
-  { 168869, true },
-  { 168885, true },
-  { 168896, true },
-  { 168911, false },
-  { 168928, true },
-  { 168940, false },
-  { 168963, true },
-  { 168980, true },
-  { 168993, true },
-  { 169004, true },
-  { 169027, true },
-  { 169045, true },
-  { 169066, true },
-  { 169088, true },
-  { 169109, true },
+  { 168838, true },
+  { 168853, false },
+  { 168870, true },
+  { 168882, false },
+  { 168905, true },
+  { 168922, true },
+  { 168935, true },
+  { 168946, true },
+  { 168969, true },
+  { 168987, true },
+  { 169008, true },
+  { 169030, true },
+  { 169051, true },
+  { 169072, true },
+  { 169082, false },
+  { 169096, true },
+  { 169113, true },
   { 169130, true },
-  { 169140, false },
-  { 169154, true },
-  { 169171, true },
-  { 169188, true },
-  { 169198, true },
-  { 169211, true },
-  { 169226, true },
-  { 169244, true },
-  { 169261, true },
-  { 169277, true },
-  { 169314, true },
-  { 169333, true },
-  { 169347, true },
-  { 169362, true },
-  { 169377, false },
-  { 169389, true },
-  { 169406, true },
-  { 169423, false },
-  { 169438, true },
-  { 169451, true },
-  { 169472, false },
-  { 169484, false },
-  { 169501, true },
-  { 169518, true },
+  { 169140, true },
+  { 169153, true },
+  { 169168, true },
+  { 169186, true },
+  { 169203, true },
+  { 169219, true },
+  { 169256, true },
+  { 169275, true },
+  { 169289, true },
+  { 169304, true },
+  { 169319, false },
+  { 169331, true },
+  { 169348, true },
+  { 169365, false },
+  { 169380, true },
+  { 169393, true },
+  { 169414, false },
+  { 169426, false },
+  { 169443, true },
+  { 169460, true },
+  { 169477, true },
+  { 169490, true },
+  { 169506, true },
+  { 169522, true },
   { 169535, true },
-  { 169548, true },
-  { 169564, true },
-  { 169580, true },
-  { 169593, true },
-  { 169611, true },
-  { 169621, true },
+  { 169553, true },
+  { 169563, true },
+  { 169574, true },
+  { 169590, true },
+  { 169600, true },
+  { 169619, true },
   { 169632, true },
-  { 169648, true },
-  { 169658, true },
-  { 169677, true },
-  { 169690, true },
-  { 169704, true },
-  { 169719, true },
+  { 169646, true },
+  { 169661, true },
+  { 169672, true },
+  { 169692, true },
+  { 169705, true },
+  { 169718, true },
   { 169730, true },
-  { 169750, true },
-  { 169763, true },
-  { 169776, true },
-  { 169788, true },
-  { 169807, true },
-  { 169820, true },
-  { 169831, true },
-  { 169842, true },
-  { 169862, true },
-  { 169872, true },
-  { 169882, true },
-  { 169904, true },
-  { 169924, true },
-  { 169942, true },
-  { 169955, true },
+  { 169749, true },
+  { 169762, true },
+  { 169773, true },
+  { 169784, true },
+  { 169804, true },
+  { 169814, true },
+  { 169824, true },
+  { 169846, true },
+  { 169866, true },
+  { 169884, true },
+  { 169897, true },
+  { 169906, true },
+  { 169917, true },
+  { 169932, true },
+  { 169948, true },
   { 169964, true },
-  { 169975, true },
-  { 169990, true },
-  { 170006, true },
-  { 170022, true },
-  { 170044, true },
-  { 170060, true },
-  { 170076, true },
-  { 170100, true },
-  { 170115, true },
-  { 170128, true },
-  { 170147, true },
-  { 170157, true },
+  { 169986, true },
+  { 170002, true },
+  { 170018, true },
+  { 170042, true },
+  { 170057, true },
+  { 170070, true },
+  { 170089, true },
+  { 170099, true },
+  { 170113, true },
+  { 170124, true },
+  { 170142, true },
+  { 170159, true },
   { 170171, true },
-  { 170182, true },
-  { 170200, true },
-  { 170217, true },
-  { 170229, true },
-  { 170242, true },
-  { 170259, true },
-  { 170271, true },
-  { 170288, true },
-  { 170297, true },
-  { 170317, false },
-  { 170337, true },
-  { 170354, true },
-  { 170364, true },
-  { 170381, true },
-  { 170393, true },
-  { 170410, true },
-  { 170425, true },
-  { 170444, true },
-  { 170461, true },
-  { 170478, true },
-  { 170495, true },
-  { 170506, true },
-  { 170518, true },
-  { 170530, true },
-  { 170540, true },
-  { 170549, true },
-  { 170562, true },
-  { 170577, true },
+  { 170184, true },
+  { 170201, true },
+  { 170213, true },
+  { 170230, true },
+  { 170239, true },
+  { 170259, false },
+  { 170279, true },
+  { 170296, true },
+  { 170306, true },
+  { 170323, true },
+  { 170335, true },
+  { 170352, true },
+  { 170367, true },
+  { 170386, true },
+  { 170403, true },
+  { 170420, true },
+  { 170437, true },
+  { 170448, true },
+  { 170460, true },
+  { 170472, true },
+  { 170482, true },
+  { 170491, true },
+  { 170504, true },
+  { 170519, true },
+  { 170529, true },
+  { 170541, true },
+  { 170555, false },
+  { 170564, true },
+  { 170576, true },
   { 170587, true },
-  { 170599, true },
-  { 170613, false },
-  { 170622, true },
-  { 170634, true },
-  { 170645, true },
-  { 170662, true },
-  { 170675, true },
-  { 170685, true },
-  { 170695, true },
-  { 170706, true },
-  { 170715, false },
-  { 170728, true },
-  { 170744, true },
+  { 170604, true },
+  { 170617, true },
+  { 170627, true },
+  { 170637, true },
+  { 170648, true },
+  { 170657, false },
+  { 170670, true },
+  { 170686, true },
+  { 170697, true },
+  { 170711, false },
+  { 170722, true },
+  { 170732, true },
   { 170755, true },
-  { 170769, false },
-  { 170780, true },
-  { 170790, true },
-  { 170813, true },
-  { 170821, true },
-  { 170831, true },
-  { 170843, true },
-  { 170856, true },
-  { 170864, true },
-  { 170872, true },
-  { 170887, true },
-  { 170897, true },
-  { 170910, true },
-  { 170919, true },
-  { 170934, true },
-  { 170943, true },
-  { 170952, true },
-  { 170971, true },
-  { 170986, true },
-  { 171008, true },
-  { 171024, true },
+  { 170763, true },
+  { 170773, true },
+  { 170785, true },
+  { 170798, true },
+  { 170806, true },
+  { 170814, true },
+  { 170829, true },
+  { 170839, true },
+  { 170852, true },
+  { 170861, true },
+  { 170876, true },
+  { 170885, true },
+  { 170894, true },
+  { 170913, true },
+  { 170928, true },
+  { 170950, true },
+  { 170966, true },
+  { 170982, true },
+  { 170995, true },
+  { 171006, true },
+  { 171018, true },
+  { 171026, true },
   { 171040, true },
-  { 171053, true },
-  { 171064, true },
-  { 171076, true },
-  { 171084, true },
-  { 171098, true },
-  { 171109, true },
-  { 171126, true },
-  { 171139, true },
-  { 171155, true },
-  { 171176, true },
-  { 171193, true },
-  { 171209, true },
-  { 171222, true },
-  { 171233, true },
-  { 171247, true },
-  { 171271, true },
-  { 171294, true },
-  { 171316, true },
-  { 171329, false },
-  { 171342, true },
-  { 171356, true },
-  { 171370, false },
-  { 171391, true },
-  { 171401, true },
-  { 171413, true },
-  { 171439, true },
-  { 171452, true },
-  { 171466, true },
-  { 171483, true },
-  { 171502, true },
-  { 171519, true },
-  { 171537, true },
-  { 171558, true },
-  { 171572, true },
-  { 171594, true },
-  { 171613, true },
-  { 171625, true },
-  { 171649, true },
-  { 171659, true },
-  { 171672, true },
-  { 171687, true },
-  { 171704, true },
-  { 171720, true },
-  { 171738, true },
+  { 171051, true },
+  { 171068, true },
+  { 171081, true },
+  { 171097, true },
+  { 171118, true },
+  { 171135, true },
+  { 171151, true },
+  { 171164, true },
+  { 171175, true },
+  { 171189, true },
+  { 171213, true },
+  { 171236, true },
+  { 171258, true },
+  { 171271, false },
+  { 171284, true },
+  { 171298, true },
+  { 171312, false },
+  { 171333, true },
+  { 171343, true },
+  { 171355, true },
+  { 171381, true },
+  { 171394, true },
+  { 171408, true },
+  { 171425, true },
+  { 171444, true },
+  { 171461, true },
+  { 171479, true },
+  { 171500, true },
+  { 171514, true },
+  { 171536, true },
+  { 171555, true },
+  { 171567, true },
+  { 171591, true },
+  { 171601, true },
+  { 171614, true },
+  { 171629, true },
+  { 171646, true },
+  { 171662, true },
+  { 171680, true },
+  { 171697, true },
+  { 171712, true },
+  { 171728, true },
   { 171755, true },
-  { 171770, true },
-  { 171786, true },
+  { 171769, true },
+  { 171785, true },
+  { 171800, true },
   { 171813, true },
-  { 171827, true },
-  { 171843, true },
-  { 171858, true },
-  { 171871, true },
-  { 171880, true },
-  { 171896, true },
-  { 171911, true },
-  { 171924, true },
-  { 171935, true },
-  { 171947, true },
+  { 171822, true },
+  { 171838, true },
+  { 171853, true },
+  { 171866, true },
+  { 171877, true },
+  { 171889, true },
+  { 171906, true },
+  { 171917, true },
+  { 171940, true },
+  { 171950, true },
   { 171964, true },
-  { 171975, true },
-  { 171998, true },
-  { 172008, true },
-  { 172022, true },
-  { 172031, true },
-  { 172038, true },
+  { 171973, true },
+  { 171980, true },
+  { 171994, false },
+  { 172014, true },
+  { 172025, true },
+  { 172039, true },
   { 172052, false },
-  { 172072, true },
-  { 172083, true },
-  { 172097, true },
-  { 172110, false },
-  { 172124, true },
-  { 172132, true },
-  { 172143, true },
-  { 172161, true },
-  { 172171, true },
-  { 172181, true },
-  { 172192, true },
-  { 172217, true },
-  { 172231, true },
-  { 172242, true },
-  { 172253, true },
-  { 172268, true },
-  { 172283, true },
-  { 172299, false },
-  { 172310, true },
-  { 172325, true },
-  { 172340, false },
+  { 172066, true },
+  { 172074, true },
+  { 172085, true },
+  { 172103, true },
+  { 172113, true },
+  { 172123, true },
+  { 172134, true },
+  { 172159, true },
+  { 172173, true },
+  { 172184, true },
+  { 172195, true },
+  { 172210, true },
+  { 172225, true },
+  { 172241, false },
+  { 172252, true },
+  { 172267, true },
+  { 172282, false },
+  { 172301, true },
+  { 172311, true },
+  { 172331, true },
+  { 172345, true },
   { 172359, true },
-  { 172369, true },
-  { 172389, true },
-  { 172403, true },
-  { 172417, true },
-  { 172428, true },
-  { 172435, true },
-  { 172448, true },
-  { 172461, false },
-  { 172471, true },
-  { 172480, true },
+  { 172370, true },
+  { 172377, true },
+  { 172390, true },
+  { 172403, false },
+  { 172413, true },
+  { 172422, true },
+  { 172432, true },
+  { 172443, true },
+  { 172455, true },
+  { 172463, true },
+  { 172473, true },
   { 172490, true },
-  { 172501, true },
-  { 172513, true },
-  { 172521, true },
-  { 172531, true },
-  { 172548, true },
-  { 172565, true },
-  { 172574, true },
+  { 172507, true },
+  { 172516, true },
+  { 172535, true },
+  { 172546, true },
+  { 172565, false },
+  { 172576, true },
   { 172593, true },
-  { 172604, true },
-  { 172623, false },
-  { 172634, true },
-  { 172651, true },
-  { 172668, true },
-  { 172681, true },
-  { 172697, true },
-  { 172708, true },
-  { 172719, true },
-  { 172736, true },
-  { 172753, false },
-  { 172762, false },
-  { 172770, true },
-  { 172779, false },
-  { 172792, true },
-  { 172803, true },
-  { 172810, true },
-  { 172824, true },
-  { 172838, true },
-  { 172858, false },
-  { 172870, true },
-  { 172886, true },
-  { 172898, true },
-  { 172917, true },
-  { 172941, true },
-  { 172949, true },
-  { 172966, true },
-  { 172982, true },
-  { 172998, true },
+  { 172610, true },
+  { 172623, true },
+  { 172639, true },
+  { 172650, true },
+  { 172661, true },
+  { 172678, true },
+  { 172695, false },
+  { 172704, false },
+  { 172712, true },
+  { 172721, false },
+  { 172734, true },
+  { 172745, true },
+  { 172752, true },
+  { 172766, true },
+  { 172780, true },
+  { 172800, false },
+  { 172812, true },
+  { 172828, true },
+  { 172840, true },
+  { 172859, true },
+  { 172883, true },
+  { 172891, true },
+  { 172908, true },
+  { 172924, true },
+  { 172940, true },
+  { 172952, true },
+  { 172965, true },
+  { 172979, true },
+  { 172995, false },
   { 173010, true },
-  { 173023, true },
-  { 173037, true },
-  { 173053, false },
-  { 173068, true },
-  { 173088, true },
+  { 173030, true },
+  { 173038, true },
+  { 173052, true },
+  { 173065, true },
+  { 173076, true },
+  { 173086, false },
   { 173096, true },
   { 173110, true },
-  { 173123, true },
-  { 173134, true },
-  { 173144, false },
-  { 173154, true },
-  { 173168, true },
-  { 173180, true },
-  { 173190, false },
-  { 173203, true },
-  { 173219, true },
-  { 173241, true },
-  { 173258, true },
+  { 173122, true },
+  { 173132, false },
+  { 173145, true },
+  { 173161, true },
+  { 173183, true },
+  { 173200, true },
+  { 173209, true },
+  { 173218, true },
+  { 173233, true },
+  { 173247, true },
+  { 173257, true },
   { 173267, true },
-  { 173276, true },
-  { 173291, true },
-  { 173305, true },
-  { 173315, true },
-  { 173325, true },
-  { 173346, true },
-  { 173361, true },
-  { 173381, true },
+  { 173288, true },
+  { 173303, true },
+  { 173323, true },
+  { 173339, true },
+  { 173351, false },
+  { 173367, true },
+  { 173382, true },
   { 173397, true },
-  { 173409, false },
-  { 173425, true },
-  { 173440, true },
-  { 173455, true },
-  { 173468, true },
-  { 173479, true },
-  { 173489, false },
-  { 173508, false },
-  { 173520, true },
-  { 173536, true },
-  { 173564, true },
-  { 173596, true },
-  { 173611, true },
-  { 173623, true },
-  { 173632, true },
-  { 173646, false },
-  { 173659, true },
-  { 173677, true },
-  { 173685, true },
-  { 173699, true },
-  { 173713, true },
-  { 173725, true },
-  { 173746, true },
-  { 173761, true },
-  { 173777, false },
-  { 173785, false },
-  { 173797, true },
-  { 173806, true },
-  { 173816, true },
-  { 173827, true },
-  { 173839, true },
-  { 173852, true },
-  { 173868, true },
-  { 173878, true },
-  { 173889, true },
-  { 173900, true },
-  { 173912, true },
-  { 173922, true },
-  { 173931, true },
-  { 173950, true },
-  { 173978, true },
-  { 173994, true },
-  { 174005, true },
-  { 174020, true },
-  { 174033, true },
-  { 174049, true },
-  { 174066, true },
-  { 174079, true },
-  { 174097, true },
-  { 174111, true },
-  { 174123, true },
-  { 174138, true },
-  { 174158, true },
-  { 174177, true },
-  { 174196, true },
-  { 174209, true },
-  { 174225, true },
-  { 174238, true },
-  { 174253, true },
-  { 174269, true },
-  { 174286, true },
-  { 174302, true },
-  { 174319, true },
-  { 174332, true },
-  { 174347, true },
-  { 174366, true },
-  { 174379, true },
-  { 174395, true },
-  { 174407, true },
-  { 174418, true },
-  { 174431, true },
-  { 174445, true },
-  { 174459, false },
-  { 174475, true },
+  { 173410, true },
+  { 173421, true },
+  { 173431, false },
+  { 173450, false },
+  { 173462, true },
+  { 173478, true },
+  { 173506, true },
+  { 173538, true },
+  { 173553, true },
+  { 173565, true },
+  { 173574, true },
+  { 173588, false },
+  { 173601, true },
+  { 173619, true },
+  { 173627, true },
+  { 173641, true },
+  { 173655, true },
+  { 173667, true },
+  { 173688, true },
+  { 173703, true },
+  { 173719, false },
+  { 173727, false },
+  { 173739, true },
+  { 173748, true },
+  { 173758, true },
+  { 173769, true },
+  { 173781, true },
+  { 173794, true },
+  { 173810, true },
+  { 173820, true },
+  { 173831, true },
+  { 173842, true },
+  { 173854, true },
+  { 173864, true },
+  { 173873, true },
+  { 173892, true },
+  { 173920, true },
+  { 173936, true },
+  { 173947, true },
+  { 173962, true },
+  { 173975, true },
+  { 173991, true },
+  { 174008, true },
+  { 174021, true },
+  { 174039, true },
+  { 174057, true },
+  { 174071, true },
+  { 174083, true },
+  { 174098, true },
+  { 174118, true },
+  { 174137, true },
+  { 174156, true },
+  { 174169, true },
+  { 174185, true },
+  { 174198, true },
+  { 174213, true },
+  { 174230, true },
+  { 174246, true },
+  { 174263, true },
+  { 174276, true },
+  { 174291, true },
+  { 174310, true },
+  { 174323, true },
+  { 174339, true },
+  { 174351, true },
+  { 174362, true },
+  { 174375, true },
+  { 174389, true },
+  { 174403, false },
+  { 174419, true },
+  { 174438, true },
+  { 174458, true },
+  { 174478, false },
   { 174494, true },
-  { 174514, true },
-  { 174534, false },
-  { 174550, true },
-  { 174566, true },
-  { 174582, true },
-  { 174597, true },
-  { 174612, true },
-  { 174633, true },
-  { 174651, false },
-  { 174670, true },
+  { 174510, true },
+  { 174526, true },
+  { 174541, true },
+  { 174556, true },
+  { 174577, true },
+  { 174595, false },
+  { 174614, true },
+  { 174625, true },
+  { 174641, true },
+  { 174655, true },
+  { 174668, true },
   { 174681, true },
   { 174697, true },
-  { 174711, true },
-  { 174724, true },
-  { 174737, true },
-  { 174753, true },
+  { 174708, true },
+  { 174717, true },
+  { 174727, true },
+  { 174738, true },
+  { 174750, true },
   { 174764, true },
   { 174773, true },
-  { 174783, true },
-  { 174794, true },
-  { 174806, true },
-  { 174820, true },
-  { 174829, true },
-  { 174842, true },
-  { 174861, true },
-  { 174878, false },
-  { 174893, false },
-  { 174905, true },
-  { 174925, true },
-  { 174938, true },
-  { 174958, true },
-  { 174980, true },
-  { 175003, true },
-  { 175021, true },
-  { 175037, true },
-  { 175050, true },
-  { 175062, true },
-  { 175076, true },
+  { 174786, true },
+  { 174805, true },
+  { 174822, false },
+  { 174837, true },
+  { 174853, false },
+  { 174865, true },
+  { 174885, true },
+  { 174898, true },
+  { 174918, true },
+  { 174940, true },
+  { 174963, true },
+  { 174981, true },
+  { 174997, true },
+  { 175010, true },
+  { 175022, true },
+  { 175036, true },
+  { 175045, true },
+  { 175059, true },
+  { 175067, true },
   { 175085, true },
-  { 175099, true },
-  { 175107, true },
-  { 175125, true },
-  { 175135, true },
-  { 175155, true },
-  { 175172, true },
-  { 175192, true },
+  { 175095, true },
+  { 175115, true },
+  { 175132, true },
+  { 175152, true },
+  { 175163, true },
+  { 175176, true },
+  { 175191, true },
   { 175203, true },
-  { 175216, true },
-  { 175231, true },
-  { 175243, true },
-  { 175259, true },
-  { 175272, true },
-  { 175289, true },
-  { 175310, true },
-  { 175318, true },
-  { 175328, true },
-  { 175351, true },
-  { 175360, true },
-  { 175370, true },
-  { 175382, true },
-  { 175395, true },
-  { 175405, true },
-  { 175418, true },
-  { 175439, true },
-  { 175449, true },
-  { 175463, true },
-  { 175483, true },
-  { 175496, true },
-  { 175516, false },
-  { 175539, true },
-  { 175552, true },
-  { 175563, true },
-  { 175574, true },
-  { 175584, true },
-  { 175609, true },
-  { 175619, true },
-  { 175633, true },
-  { 175647, false },
-  { 175662, true },
-  { 175676, true },
+  { 175219, true },
+  { 175232, true },
+  { 175249, true },
+  { 175270, true },
+  { 175278, true },
+  { 175288, true },
+  { 175311, true },
+  { 175320, true },
+  { 175330, true },
+  { 175342, true },
+  { 175355, true },
+  { 175365, true },
+  { 175378, true },
+  { 175399, true },
+  { 175409, true },
+  { 175423, true },
+  { 175443, true },
+  { 175456, true },
+  { 175476, false },
+  { 175499, true },
+  { 175512, true },
+  { 175523, true },
+  { 175534, true },
+  { 175544, true },
+  { 175569, true },
+  { 175579, true },
+  { 175593, true },
+  { 175607, false },
+  { 175622, true },
+  { 175636, true },
+  { 175661, true },
+  { 175675, true },
+  { 175687, true },
   { 175701, true },
-  { 175715, true },
-  { 175727, true },
-  { 175741, true },
-  { 175751, false },
-  { 175771, true },
-  { 175785, true },
-  { 175804, true },
-  { 175817, true },
-  { 175832, true },
-  { 175842, true },
-  { 175856, true },
-  { 175865, true },
-  { 175876, true },
-  { 175887, true },
-  { 175898, true },
-  { 175909, true },
-  { 175919, false },
-  { 175939, true },
-  { 175954, true },
-  { 175966, true },
-  { 175978, true },
-  { 175993, true },
-  { 176012, true },
-  { 176032, true },
-  { 176049, true },
-  { 176059, true },
+  { 175711, false },
+  { 175731, true },
+  { 175745, true },
+  { 175764, true },
+  { 175777, true },
+  { 175792, true },
+  { 175802, true },
+  { 175816, true },
+  { 175825, true },
+  { 175836, true },
+  { 175847, true },
+  { 175858, true },
+  { 175869, true },
+  { 175879, false },
+  { 175899, true },
+  { 175914, true },
+  { 175926, true },
+  { 175938, true },
+  { 175953, true },
+  { 175972, true },
+  { 175992, true },
+  { 176009, true },
+  { 176019, true },
+  { 176033, true },
+  { 176050, true },
+  { 176065, true },
   { 176073, true },
-  { 176090, true },
-  { 176105, true },
-  { 176113, true },
-  { 176131, true },
-  { 176152, false },
-  { 176170, true },
-  { 176182, true },
-  { 176198, true },
-  { 176213, true },
-  { 176224, true },
-  { 176249, true },
-  { 176271, true },
-  { 176286, true },
-  { 176300, true },
-  { 176321, true },
-  { 176335, true },
-  { 176352, true },
-  { 176371, true },
-  { 176390, true },
-  { 176403, true },
-  { 176423, true },
-  { 176439, true },
-  { 176465, true },
-  { 176486, true },
-  { 176504, true },
+  { 176091, true },
+  { 176112, false },
+  { 176130, true },
+  { 176142, true },
+  { 176158, true },
+  { 176173, true },
+  { 176184, true },
+  { 176209, true },
+  { 176231, true },
+  { 176246, true },
+  { 176260, true },
+  { 176281, true },
+  { 176295, true },
+  { 176312, true },
+  { 176331, true },
+  { 176350, true },
+  { 176363, true },
+  { 176383, true },
+  { 176399, true },
+  { 176425, true },
+  { 176446, true },
+  { 176464, true },
+  { 176483, true },
+  { 176507, true },
   { 176523, true },
-  { 176547, true },
-  { 176563, true },
-  { 176588, true },
-  { 176614, true },
-  { 176638, true },
-  { 176664, true },
-  { 176686, true },
-  { 176707, true },
-  { 176724, true },
-  { 176750, true },
-  { 176768, true },
-  { 176778, true },
-  { 176794, false },
-  { 176812, true },
-  { 176827, false },
-  { 176846, true },
-  { 176868, true },
-  { 176891, true },
-  { 176910, true },
-  { 176928, true },
-  { 176951, true },
-  { 176964, true },
-  { 176980, true },
-  { 176998, true },
-  { 177014, true },
-  { 177028, true },
-  { 177046, true },
-  { 177061, true },
-  { 177078, true },
-  { 177092, true },
-  { 177106, false },
-  { 177123, true },
-  { 177141, true },
-  { 177157, true },
-  { 177173, true },
-  { 177186, true },
-  { 177206, true },
-  { 177224, true },
-  { 177243, true },
-  { 177256, true },
-  { 177292, true },
-  { 177315, true },
-  { 177330, true },
-  { 177346, true },
-  { 177357, true },
-  { 177375, true },
-  { 177405, true },
-  { 177421, true },
+  { 176548, true },
+  { 176574, true },
+  { 176598, true },
+  { 176624, true },
+  { 176646, true },
+  { 176667, true },
+  { 176684, true },
+  { 176710, true },
+  { 176728, true },
+  { 176738, true },
+  { 176754, false },
+  { 176772, true },
+  { 176787, false },
+  { 176806, true },
+  { 176828, true },
+  { 176851, true },
+  { 176870, true },
+  { 176888, true },
+  { 176911, true },
+  { 176924, true },
+  { 176940, true },
+  { 176958, true },
+  { 176974, true },
+  { 176988, true },
+  { 177006, true },
+  { 177021, true },
+  { 177038, true },
+  { 177052, true },
+  { 177066, false },
+  { 177083, true },
+  { 177101, true },
+  { 177117, true },
+  { 177133, true },
+  { 177146, true },
+  { 177166, true },
+  { 177184, true },
+  { 177203, true },
+  { 177216, true },
+  { 177252, true },
+  { 177275, true },
+  { 177290, true },
+  { 177306, true },
+  { 177317, true },
+  { 177335, true },
+  { 177365, true },
+  { 177381, true },
+  { 177396, true },
+  { 177411, true },
+  { 177422, true },
   { 177436, true },
-  { 177451, true },
-  { 177462, true },
-  { 177476, true },
-  { 177498, true },
-  { 177511, true },
-  { 177534, true },
-  { 177543, true },
-  { 177565, true },
-  { 177584, true },
-  { 177608, true },
-  { 177634, true },
-  { 177645, true },
-  { 177662, true },
-  { 177676, true },
-  { 177689, true },
-  { 177705, true },
-  { 177724, true },
-  { 177748, true },
-  { 177761, true },
-  { 177778, true },
-  { 177789, true },
-  { 177804, true },
-  { 177826, true },
-  { 177845, true },
-  { 177862, false },
-  { 177877, true },
-  { 177895, true },
-  { 177917, true },
-  { 177933, true },
-  { 177945, true },
-  { 177957, true },
-  { 177969, true },
-  { 177985, true },
-  { 178004, true },
-  { 178020, true },
-  { 178039, true },
-  { 178069, false },
-  { 178083, true },
-  { 178100, true },
-  { 178121, true },
-  { 178141, true },
-  { 178155, true },
-  { 178173, true },
-  { 178189, true },
-  { 178199, true },
-  { 178210, true },
-  { 178222, true },
-  { 178241, true },
-  { 178257, true },
-  { 178277, true },
-  { 178291, true },
-  { 178304, true },
-  { 178320, true },
-  { 178331, true },
-  { 178352, true },
-  { 178380, true },
-  { 178396, true },
-  { 178409, true },
-  { 178426, true },
-  { 178444, false },
+  { 177458, true },
+  { 177473, true },
+  { 177486, true },
+  { 177509, true },
+  { 177518, true },
+  { 177540, true },
+  { 177559, true },
+  { 177583, true },
+  { 177609, true },
+  { 177620, true },
+  { 177637, true },
+  { 177651, true },
+  { 177664, true },
+  { 177680, true },
+  { 177699, true },
+  { 177723, true },
+  { 177736, true },
+  { 177753, true },
+  { 177764, true },
+  { 177779, true },
+  { 177801, true },
+  { 177820, true },
+  { 177837, false },
+  { 177852, true },
+  { 177870, true },
+  { 177892, true },
+  { 177908, true },
+  { 177920, true },
+  { 177932, true },
+  { 177944, true },
+  { 177960, true },
+  { 177979, true },
+  { 177995, true },
+  { 178014, true },
+  { 178044, false },
+  { 178058, true },
+  { 178075, true },
+  { 178096, true },
+  { 178116, true },
+  { 178130, true },
+  { 178148, true },
+  { 178164, true },
+  { 178174, true },
+  { 178185, true },
+  { 178197, true },
+  { 178216, true },
+  { 178232, true },
+  { 178252, true },
+  { 178266, true },
+  { 178279, true },
+  { 178295, true },
+  { 178306, true },
+  { 178327, true },
+  { 178355, true },
+  { 178371, true },
+  { 178384, true },
+  { 178401, true },
+  { 178419, false },
+  { 178434, true },
   { 178459, true },
-  { 178484, true },
-  { 178493, true },
-  { 178503, true },
-  { 178515, true },
-  { 178534, true },
-  { 178551, true },
-  { 178568, true },
-  { 178584, false },
-  { 178602, false },
-  { 178622, true },
-  { 178639, true },
-  { 178652, true },
-  { 178672, true },
-  { 178696, true },
-  { 178714, true },
-  { 178735, true },
-  { 178750, true },
-  { 178765, true },
+  { 178468, true },
+  { 178478, true },
+  { 178490, true },
+  { 178509, true },
+  { 178526, true },
+  { 178543, true },
+  { 178559, false },
+  { 178577, false },
+  { 178597, true },
+  { 178614, true },
+  { 178627, true },
+  { 178647, true },
+  { 178671, true },
+  { 178689, true },
+  { 178710, true },
+  { 178725, true },
+  { 178740, true },
+  { 178752, true },
   { 178777, true },
-  { 178802, true },
-  { 178815, true },
-  { 178837, true },
-  { 178847, true },
-  { 178864, true },
-  { 178877, true },
-  { 178891, true },
-  { 178924, true },
-  { 178939, true },
-  { 178953, true },
-  { 178962, true },
-  { 178976, true },
-  { 178986, true },
-  { 178997, true },
-  { 179006, true },
-  { 179017, true },
-  { 179028, true },
-  { 179046, true },
-  { 179061, true },
-  { 179071, true },
-  { 179086, true },
-  { 179099, true },
-  { 179118, true },
-  { 179138, true },
-  { 179153, true },
-  { 179160, true },
-  { 179176, true },
-  { 179194, true },
-  { 179215, true },
-  { 179227, true },
-  { 179257, true },
-  { 179270, true },
-  { 179280, true },
-  { 179292, true },
-  { 179306, true },
-  { 179320, true },
-  { 179331, true },
-  { 179350, true },
-  { 179369, true },
-  { 179384, true },
+  { 178790, true },
+  { 178812, true },
+  { 178822, true },
+  { 178839, true },
+  { 178852, true },
+  { 178866, true },
+  { 178899, true },
+  { 178914, true },
+  { 178928, true },
+  { 178937, true },
+  { 178946, true },
+  { 178960, true },
+  { 178970, true },
+  { 178981, false },
+  { 178995, true },
+  { 179004, true },
+  { 179015, true },
+  { 179026, true },
+  { 179044, true },
+  { 179059, true },
+  { 179069, true },
+  { 179084, true },
+  { 179097, true },
+  { 179116, true },
+  { 179136, true },
+  { 179151, true },
+  { 179158, true },
+  { 179174, true },
+  { 179192, true },
+  { 179213, true },
+  { 179225, true },
+  { 179255, true },
+  { 179268, true },
+  { 179278, true },
+  { 179290, true },
+  { 179304, true },
+  { 179318, true },
+  { 179329, true },
+  { 179343, true },
+  { 179362, true },
+  { 179381, true },
   { 179396, true },
-  { 179407, true },
-  { 179422, true },
+  { 179408, true },
+  { 179419, true },
   { 179434, true },
-  { 179450, true },
-  { 179465, true },
-  { 179481, true },
-  { 179490, true },
-  { 179504, true },
-  { 179515, false },
-  { 179530, true },
-  { 179544, true },
-  { 179560, true },
-  { 179573, true },
-  { 179593, true },
-  { 179606, false },
-  { 179626, true },
-  { 179640, true },
-  { 179651, true },
-  { 179668, true },
-  { 179682, true },
+  { 179446, true },
+  { 179462, true },
+  { 179477, true },
+  { 179493, true },
+  { 179502, true },
+  { 179516, true },
+  { 179527, false },
+  { 179542, true },
+  { 179556, true },
+  { 179572, true },
+  { 179585, true },
+  { 179605, true },
+  { 179618, false },
+  { 179638, true },
+  { 179652, true },
+  { 179663, true },
+  { 179680, true },
   { 179694, true },
-  { 179708, true },
+  { 179706, true },
   { 179720, true },
   { 179732, true },
   { 179744, true },
   { 179756, true },
-  { 179766, true },
-  { 179779, true },
-  { 179796, true },
-  { 179823, true },
-  { 179836, true },
-  { 179854, true },
-  { 179862, true },
+  { 179768, true },
+  { 179778, true },
+  { 179791, true },
+  { 179808, true },
+  { 179835, true },
+  { 179848, true },
+  { 179866, true },
   { 179874, true },
-  { 179887, true },
-  { 179914, true },
-  { 179932, true },
-  { 179939, true },
-  { 179947, true },
-  { 179957, true },
-  { 179966, true },
-  { 179975, true },
-  { 179983, true },
-  { 179996, true },
-  { 180005, true },
+  { 179886, true },
+  { 179899, true },
+  { 179926, true },
+  { 179944, true },
+  { 179951, true },
+  { 179959, true },
+  { 179969, true },
+  { 179978, true },
+  { 179987, true },
+  { 179995, true },
+  { 180008, true },
   { 180017, true },
-  { 180024, true },
-  { 180040, true },
-  { 180057, true },
-  { 180064, true },
-  { 180078, true },
-  { 180095, true },
+  { 180029, true },
+  { 180036, true },
+  { 180052, true },
+  { 180069, true },
+  { 180076, true },
+  { 180090, true },
   { 180107, true },
-  { 180115, true },
-  { 180122, true },
-  { 180131, true },
-  { 180140, true },
-  { 180154, true },
-  { 180170, true },
-  { 180186, true },
-  { 180205, true },
-  { 180223, true },
-  { 180238, true },
-  { 180256, true },
-  { 180266, true },
-  { 180278, true },
-  { 180297, true },
-  { 180312, true },
-  { 180327, true },
-  { 180339, true },
-  { 180347, false },
-  { 180372, true },
-  { 180382, true },
-  { 180397, true },
-  { 180409, true },
-  { 180423, true },
-  { 180432, false },
-  { 180444, true },
-  { 180457, true },
-  { 180490, true },
-  { 180505, true },
-  { 180528, true },
-  { 180541, true },
-  { 180552, true },
-  { 180566, true },
-  { 180586, true },
-  { 180599, true },
-  { 180613, true },
-  { 180623, true },
-  { 180641, true },
-  { 180655, true },
-  { 180667, true },
-  { 180682, true },
-  { 180704, true },
-  { 180714, true },
-  { 180726, true },
-  { 180742, true },
-  { 180754, true },
-  { 180764, true },
-  { 180777, true },
-  { 180785, false },
-  { 180793, true },
-  { 180804, true },
-  { 180820, true },
-  { 180831, true },
-  { 180844, true },
-  { 180856, false },
-  { 180870, true },
-  { 180883, true },
-  { 180894, true },
-  { 180904, true },
-  { 180918, true },
-  { 180937, true },
-  { 180948, true },
-  { 180962, true },
-  { 180973, true },
-  { 180984, true },
-  { 180995, true },
-  { 181006, true },
-  { 181017, true },
-  { 181031, true },
-  { 181043, true },
-  { 181058, true },
-  { 181072, true },
-  { 181087, true },
-  { 181100, true },
-  { 181116, true },
-  { 181125, true },
-  { 181134, true },
-  { 181148, true },
-  { 181159, true },
-  { 181170, false },
-  { 181186, true },
-  { 181197, true },
-  { 181208, true },
-  { 181224, false },
-  { 181238, true },
-  { 181247, true },
-  { 181260, true },
-  { 181270, true },
-  { 181284, true },
-  { 181294, true },
-  { 181307, true },
-  { 181321, true },
-  { 181335, true },
-  { 181356, true },
-  { 181370, true },
-  { 181382, true },
-  { 181397, true },
-  { 181416, true },
-  { 181426, true },
-  { 181445, true },
-  { 181454, false },
-  { 181469, true },
-  { 181485, false },
-  { 181497, true },
-  { 181523, true },
-  { 181534, true },
-  { 181555, true },
-  { 181570, true },
-  { 181588, true },
-  { 181605, true },
-  { 181620, true },
+  { 180119, true },
+  { 180127, true },
+  { 180134, true },
+  { 180143, true },
+  { 180152, true },
+  { 180168, true },
+  { 180184, true },
+  { 180203, true },
+  { 180221, true },
+  { 180236, true },
+  { 180254, true },
+  { 180264, true },
+  { 180276, true },
+  { 180295, true },
+  { 180310, true },
+  { 180325, true },
+  { 180337, true },
+  { 180345, false },
+  { 180370, true },
+  { 180380, true },
+  { 180395, true },
+  { 180407, true },
+  { 180421, true },
+  { 180430, false },
+  { 180442, true },
+  { 180455, true },
+  { 180488, true },
+  { 180503, true },
+  { 180526, true },
+  { 180539, true },
+  { 180550, true },
+  { 180564, true },
+  { 180584, true },
+  { 180597, true },
+  { 180611, true },
+  { 180621, true },
+  { 180639, true },
+  { 180653, true },
+  { 180665, true },
+  { 180680, true },
+  { 180702, true },
+  { 180712, true },
+  { 180724, true },
+  { 180740, true },
+  { 180752, true },
+  { 180762, true },
+  { 180775, true },
+  { 180784, true },
+  { 180792, true },
+  { 180805, false },
+  { 180813, true },
+  { 180824, true },
+  { 180840, true },
+  { 180851, true },
+  { 180864, true },
+  { 180876, false },
+  { 180890, true },
+  { 180903, true },
+  { 180914, true },
+  { 180924, true },
+  { 180938, true },
+  { 180957, true },
+  { 180968, true },
+  { 180982, true },
+  { 180993, true },
+  { 181004, true },
+  { 181015, true },
+  { 181026, true },
+  { 181037, true },
+  { 181051, true },
+  { 181063, true },
+  { 181078, true },
+  { 181092, true },
+  { 181107, true },
+  { 181120, true },
+  { 181136, true },
+  { 181145, true },
+  { 181154, true },
+  { 181168, true },
+  { 181179, true },
+  { 181190, false },
+  { 181206, true },
+  { 181217, true },
+  { 181228, true },
+  { 181244, false },
+  { 181258, true },
+  { 181267, true },
+  { 181280, true },
+  { 181290, true },
+  { 181304, true },
+  { 181314, true },
+  { 181327, true },
+  { 181341, true },
+  { 181355, true },
+  { 181376, true },
+  { 181390, true },
+  { 181402, true },
+  { 181417, true },
+  { 181436, true },
+  { 181446, true },
+  { 181465, true },
+  { 181474, false },
+  { 181489, true },
+  { 181505, false },
+  { 181517, true },
+  { 181543, true },
+  { 181554, true },
+  { 181575, true },
+  { 181590, true },
+  { 181608, true },
+  { 181625, true },
   { 181640, true },
-  { 181651, true },
-  { 181663, true },
-  { 181674, true },
-  { 181687, true },
-  { 181705, true },
+  { 181660, true },
+  { 181671, true },
+  { 181683, true },
+  { 181694, true },
+  { 181707, true },
   { 181725, true },
-  { 181744, true },
-  { 181763, true },
-  { 181784, true },
-  { 181793, true },
-  { 181817, false },
-  { 181836, true },
-  { 181850, true },
-  { 181868, true },
-  { 181885, true },
+  { 181745, true },
+  { 181764, true },
+  { 181783, true },
+  { 181804, true },
+  { 181813, true },
+  { 181837, false },
+  { 181856, true },
+  { 181870, true },
+  { 181888, true },
   { 181905, true },
-  { 181919, true },
-  { 181929, true },
-  { 181942, true },
-  { 181963, true },
-  { 181975, true },
-  { 181986, true },
-  { 182001, true },
-  { 182022, true },
-  { 182041, true },
-  { 182070, true },
-  { 182077, true },
-  { 182089, true },
-  { 182104, true },
-  { 182120, true },
-  { 182137, true },
-  { 182159, true },
-  { 182169, true },
-  { 182181, true },
-  { 182193, true },
-  { 182210, false },
-  { 182223, false },
-  { 182243, true },
-  { 182253, true },
-  { 182265, true },
-  { 182282, true },
-  { 182298, true },
-  { 182313, true },
-  { 182326, true },
-  { 182341, true },
-  { 182354, true },
-  { 182370, true },
-  { 182388, true },
-  { 182400, true },
-  { 182414, true },
-  { 182427, true },
-  { 182438, true },
-  { 182457, true },
-  { 182476, true },
-  { 182486, true },
-  { 182498, true },
+  { 181925, true },
+  { 181939, true },
+  { 181949, true },
+  { 181962, true },
+  { 181983, true },
+  { 181995, true },
+  { 182006, true },
+  { 182021, true },
+  { 182042, true },
+  { 182061, true },
+  { 182090, true },
+  { 182097, true },
+  { 182109, true },
+  { 182124, true },
+  { 182140, true },
+  { 182157, true },
+  { 182179, true },
+  { 182189, true },
+  { 182201, true },
+  { 182213, true },
+  { 182230, false },
+  { 182243, false },
+  { 182263, true },
+  { 182273, true },
+  { 182285, true },
+  { 182302, true },
+  { 182318, true },
+  { 182333, true },
+  { 182346, true },
+  { 182361, true },
+  { 182374, true },
+  { 182390, true },
+  { 182408, true },
+  { 182420, true },
+  { 182434, true },
+  { 182447, true },
+  { 182458, true },
+  { 182477, true },
+  { 182496, true },
+  { 182506, true },
   { 182518, true },
-  { 182531, true },
-  { 182544, true },
-  { 182557, true },
-  { 182570, true },
-  { 182583, true },
-  { 182595, true },
-  { 182610, true },
-  { 182620, true },
-  { 182633, true },
-  { 182651, true },
-  { 182669, true },
-  { 182688, true },
-  { 182701, true },
-  { 182719, true },
-  { 182741, true },
-  { 182754, true },
-  { 182771, true },
+  { 182538, true },
+  { 182551, true },
+  { 182564, true },
+  { 182577, true },
+  { 182590, true },
+  { 182603, true },
+  { 182615, true },
+  { 182630, true },
+  { 182640, true },
+  { 182653, true },
+  { 182671, true },
+  { 182689, true },
+  { 182708, true },
+  { 182721, true },
+  { 182739, true },
+  { 182761, true },
+  { 182774, true },
   { 182791, true },
-  { 182807, true },
-  { 182835, true },
-  { 182860, true },
-  { 182892, true },
-  { 182911, true },
-  { 182926, true },
+  { 182811, true },
+  { 182827, true },
+  { 182855, true },
+  { 182880, true },
+  { 182912, true },
+  { 182931, true },
   { 182946, true },
-  { 182959, true },
-  { 182975, true },
-  { 182992, true },
-  { 183009, true },
-  { 183021, true },
-  { 183034, true },
-  { 183047, true },
-  { 183069, true },
-  { 183087, true },
-  { 183101, true },
-  { 183122, true },
-  { 183134, true },
-  { 183149, true },
-  { 183166, true },
-  { 183178, true },
-  { 183193, true },
-  { 183204, true },
-  { 183218, true },
-  { 183237, true },
-  { 183254, true },
-  { 183264, true },
-  { 183276, true },
+  { 182966, true },
+  { 182979, true },
+  { 182995, true },
+  { 183012, true },
+  { 183029, true },
+  { 183041, true },
+  { 183054, true },
+  { 183067, true },
+  { 183089, true },
+  { 183107, true },
+  { 183121, true },
+  { 183142, true },
+  { 183154, true },
+  { 183169, true },
+  { 183186, true },
+  { 183198, true },
+  { 183213, true },
+  { 183224, true },
+  { 183238, true },
+  { 183257, true },
+  { 183274, true },
+  { 183284, true },
   { 183296, true },
-  { 183310, true },
-  { 183320, true },
-  { 183333, true },
-  { 183352, true },
-  { 183366, true },
-  { 183380, true },
-  { 183394, true },
-  { 183404, true },
-  { 183416, true },
-  { 183434, false },
-  { 183442, true },
-  { 183458, true },
-  { 183470, true },
-  { 183482, true },
-  { 183493, true },
-  { 183505, true },
-  { 183514, true },
-  { 183524, true },
-  { 183538, true },
-  { 183552, true },
-  { 183566, true },
-  { 183577, true },
-  { 183585, true },
-  { 183601, true },
-  { 183616, true },
-  { 183634, true },
+  { 183316, true },
+  { 183330, true },
+  { 183340, true },
+  { 183353, true },
+  { 183372, true },
+  { 183386, true },
+  { 183400, true },
+  { 183414, true },
+  { 183424, true },
+  { 183436, true },
+  { 183454, false },
+  { 183462, true },
+  { 183478, true },
+  { 183490, true },
+  { 183502, true },
+  { 183513, true },
+  { 183525, true },
+  { 183534, true },
+  { 183544, true },
+  { 183558, true },
+  { 183572, true },
+  { 183586, true },
+  { 183597, true },
+  { 183605, true },
+  { 183621, true },
+  { 183636, true },
   { 183654, true },
-  { 183675, true },
-  { 183686, true },
-  { 183701, false },
-  { 183719, false },
-  { 183740, true },
-  { 183749, true },
-  { 183772, true },
-  { 183795, true },
-  { 183812, true },
-  { 183824, true },
-  { 183845, true },
-  { 183862, true },
+  { 183674, true },
+  { 183695, true },
+  { 183706, true },
+  { 183721, false },
+  { 183739, false },
+  { 183760, true },
+  { 183769, true },
+  { 183792, true },
+  { 183815, true },
+  { 183832, true },
+  { 183844, true },
+  { 183865, true },
   { 183882, true },
-  { 183895, true },
-  { 183908, true },
-  { 183922, true },
-  { 183944, true },
-  { 183959, true },
-  { 183976, true },
-  { 183993, true },
+  { 183902, true },
+  { 183915, true },
+  { 183928, true },
+  { 183942, true },
+  { 183964, true },
+  { 183979, true },
+  { 183996, true },
   { 184013, true },
-  { 184038, true },
-  { 184063, true },
-  { 184089, true },
-  { 184102, true },
-  { 184118, true },
-  { 184129, true },
-  { 184144, true },
-  { 184153, true },
+  { 184033, true },
+  { 184058, true },
+  { 184083, true },
+  { 184109, true },
+  { 184122, true },
+  { 184138, true },
+  { 184149, true },
   { 184164, true },
-  { 184176, true },
-  { 184190, true },
-  { 184199, true },
-  { 184221, true },
-  { 184233, true },
+  { 184173, true },
+  { 184184, true },
+  { 184196, true },
+  { 184210, true },
+  { 184219, true },
   { 184241, true },
-  { 184255, true },
-  { 184263, true },
-  { 184273, true },
-  { 184280, true },
-  { 184290, true },
-  { 184297, true },
-  { 184314, true },
-  { 184326, true },
-  { 184337, true },
-  { 184347, true },
-  { 184360, true },
-  { 184370, true },
-  { 184381, true },
-  { 184392, true },
-  { 184400, true },
+  { 184253, true },
+  { 184261, true },
+  { 184275, true },
+  { 184283, true },
+  { 184293, true },
+  { 184300, true },
+  { 184310, true },
+  { 184317, true },
+  { 184334, true },
+  { 184346, true },
+  { 184357, true },
+  { 184367, true },
+  { 184380, true },
+  { 184390, true },
+  { 184401, true },
   { 184412, true },
-  { 184423, true },
-  { 184437, true },
-  { 184450, true },
-  { 184476, false },
-  { 184490, true },
-  { 184506, true },
-  { 184522, true },
-  { 184535, true },
-  { 184547, true },
-  { 184559, true },
-  { 184580, true },
-  { 184592, true },
-  { 184602, true },
-  { 184624, true },
-  { 184641, true },
-  { 184654, true },
-  { 184665, false },
-  { 184676, true },
-  { 184686, true },
-  { 184698, true },
-  { 184707, true },
-  { 184721, true },
-  { 184732, false },
-  { 184745, false },
-  { 184765, true },
-  { 184775, true },
-  { 184783, false },
-  { 184792, true },
-  { 184805, true },
-  { 184851, true },
-  { 184898, true },
-  { 184911, true },
-  { 184924, true },
-  { 184947, true },
-  { 184963, true },
-  { 184976, true },
-  { 184992, true },
-  { 185002, false },
-  { 185014, true },
-  { 185031, true },
-  { 185049, true },
-  { 185065, true },
-  { 185076, true },
-  { 185084, true },
-  { 185094, true },
-  { 185101, true },
-  { 185110, true },
-  { 185117, true },
-  { 185126, true },
-  { 185144, true },
-  { 185160, true },
-  { 185179, true },
-  { 185192, true },
-  { 185206, true },
-  { 185218, true },
-  { 185232, true },
-  { 185247, true },
-  { 185259, true },
-  { 185272, true },
-  { 185283, true },
-  { 185304, true },
-  { 185314, true },
-  { 185323, true },
-  { 185332, true },
-  { 185339, true },
-  { 185346, true },
-  { 185354, true },
-  { 185378, true },
-  { 185392, true },
-  { 185402, true },
-  { 185419, true },
+  { 184420, true },
+  { 184432, true },
+  { 184443, true },
+  { 184457, true },
+  { 184470, true },
+  { 184496, false },
+  { 184510, true },
+  { 184526, true },
+  { 184542, true },
+  { 184555, true },
+  { 184567, true },
+  { 184579, true },
+  { 184600, true },
+  { 184612, true },
+  { 184622, true },
+  { 184644, true },
+  { 184661, true },
+  { 184674, true },
+  { 184685, false },
+  { 184696, true },
+  { 184706, true },
+  { 184718, true },
+  { 184727, true },
+  { 184741, true },
+  { 184752, false },
+  { 184765, false },
+  { 184785, true },
+  { 184795, true },
+  { 184803, false },
+  { 184812, true },
+  { 184825, true },
+  { 184871, true },
+  { 184918, true },
+  { 184931, true },
+  { 184944, true },
+  { 184967, true },
+  { 184983, true },
+  { 184996, true },
+  { 185012, true },
+  { 185022, false },
+  { 185034, true },
+  { 185051, true },
+  { 185069, true },
+  { 185085, true },
+  { 185096, true },
+  { 185104, true },
+  { 185114, true },
+  { 185121, true },
+  { 185130, true },
+  { 185137, true },
+  { 185146, true },
+  { 185164, true },
+  { 185180, true },
+  { 185199, true },
+  { 185212, true },
+  { 185226, true },
+  { 185238, true },
+  { 185252, true },
+  { 185267, true },
+  { 185279, true },
+  { 185292, true },
+  { 185303, true },
+  { 185313, true },
+  { 185322, true },
+  { 185331, true },
+  { 185338, true },
+  { 185345, true },
+  { 185353, true },
+  { 185377, true },
+  { 185391, true },
+  { 185401, true },
+  { 185418, false },
   { 185433, true },
-  { 185445, true },
+  { 185447, true },
   { 185459, true },
-  { 185476, true },
-  { 185487, true },
-  { 185499, true },
-  { 185511, true },
-  { 185521, true },
-  { 185531, true },
-  { 185542, true },
-  { 185552, true },
-  { 185571, true },
-  { 185583, true },
-  { 185599, true },
-  { 185614, true },
-  { 185637, true },
-  { 185644, true },
-  { 185655, true },
-  { 185665, true },
-  { 185672, true },
+  { 185473, true },
+  { 185490, true },
+  { 185501, true },
+  { 185513, true },
+  { 185525, true },
+  { 185535, true },
+  { 185545, true },
+  { 185556, true },
+  { 185566, true },
+  { 185585, true },
+  { 185597, true },
+  { 185613, true },
+  { 185628, true },
+  { 185651, true },
+  { 185658, true },
+  { 185669, true },
   { 185679, true },
-  { 185691, true },
-  { 185702, true },
-  { 185712, false },
-  { 185732, true },
-  { 185755, true },
-  { 185779, true },
-  { 185789, false },
-  { 185796, true },
-  { 185809, true },
+  { 185686, true },
+  { 185693, true },
+  { 185705, true },
+  { 185716, true },
+  { 185726, false },
+  { 185746, true },
+  { 185769, true },
+  { 185793, true },
+  { 185803, false },
+  { 185810, true },
   { 185823, true },
   { 185837, true },
-  { 185850, true },
-  { 185861, true },
-  { 185872, true },
-  { 185882, true },
-  { 185898, true },
-  { 185919, true },
-  { 185929, true },
-  { 185940, true },
-  { 185955, true },
+  { 185851, true },
+  { 185864, true },
+  { 185875, true },
+  { 185886, true },
+  { 185896, true },
+  { 185912, true },
+  { 185933, true },
+  { 185943, true },
+  { 185954, true },
   { 185969, true },
-  { 185980, true },
+  { 185983, true },
   { 185994, true },
-  { 186014, true },
+  { 186008, true },
   { 186028, true },
-  { 186037, true },
-  { 186048, true },
-  { 186063, true },
-  { 186076, true },
-  { 186091, true },
-  { 186107, true },
-  { 186122, true },
+  { 186042, true },
+  { 186051, true },
+  { 186062, true },
+  { 186077, true },
+  { 186090, true },
+  { 186105, true },
+  { 186121, true },
   { 186136, true },
-  { 186152, true },
+  { 186150, true },
   { 186166, true },
   { 186180, true },
-  { 186198, true },
-  { 186216, true },
-  { 186236, true },
-  { 186255, true },
-  { 186271, true },
-  { 186286, true },
+  { 186194, true },
+  { 186212, true },
+  { 186230, true },
+  { 186250, true },
+  { 186269, true },
+  { 186285, true },
   { 186300, true },
-  { 186320, true },
-  { 186336, true },
-  { 186351, true },
+  { 186314, true },
+  { 186334, true },
+  { 186350, true },
   { 186365, true },
-  { 186396, true },
-  { 186412, true },
-  { 186423, true },
-  { 186433, false },
-  { 186457, true },
+  { 186379, true },
+  { 186410, true },
+  { 186426, true },
+  { 186437, true },
+  { 186447, false },
   { 186471, true },
   { 186485, true },
-  { 186495, true },
-  { 186512, true },
-  { 186525, true },
-  { 186538, true },
-  { 186555, true },
-  { 186572, false },
-  { 186589, true },
-  { 186602, true },
-  { 186619, true },
-  { 186640, true },
-  { 186653, true },
-  { 186666, true },
-  { 186686, true },
-  { 186704, true },
-  { 186714, true },
-  { 186727, true },
-  { 186746, true },
+  { 186499, true },
+  { 186509, true },
+  { 186526, true },
+  { 186539, true },
+  { 186552, true },
+  { 186569, true },
+  { 186586, false },
+  { 186603, true },
+  { 186616, true },
+  { 186633, true },
+  { 186654, true },
+  { 186667, true },
+  { 186680, true },
+  { 186700, true },
+  { 186718, true },
+  { 186728, true },
+  { 186741, true },
   { 186760, true },
-  { 186774, false },
-  { 186785, true },
-  { 186802, true },
-  { 186815, true },
-  { 186838, true },
-  { 186866, true },
-  { 186882, true },
-  { 186894, true },
-  { 186908, false },
-  { 186921, true },
-  { 186933, true },
-  { 186949, true },
-  { 186962, true },
-  { 186978, true },
-  { 186988, true },
-  { 187003, true },
-  { 187011, true },
-  { 187026, true },
-  { 187043, true },
-  { 187050, true },
-  { 187060, true },
-  { 187070, true },
-  { 187091, true },
-  { 187107, true },
-  { 187126, true },
-  { 187146, true },
-  { 187161, true },
-  { 187169, true },
-  { 187188, true },
-  { 187204, false },
-  { 187212, true },
-  { 187227, true },
-  { 187235, true },
-  { 187246, true },
-  { 187259, true },
-  { 187270, true },
-  { 187285, false },
-  { 187305, true },
-  { 187320, true },
-  { 187335, true },
-  { 187345, true },
-  { 187357, true },
-  { 187381, true },
-  { 187394, true },
-  { 187407, true },
-  { 187419, true },
-  { 187432, true },
+  { 186774, true },
+  { 186788, false },
+  { 186799, true },
+  { 186816, true },
+  { 186829, true },
+  { 186852, true },
+  { 186880, true },
+  { 186896, true },
+  { 186908, true },
+  { 186922, false },
+  { 186935, true },
+  { 186947, true },
+  { 186963, true },
+  { 186976, true },
+  { 186992, true },
+  { 187002, true },
+  { 187017, true },
+  { 187025, true },
+  { 187040, true },
+  { 187057, true },
+  { 187064, true },
+  { 187074, true },
+  { 187084, true },
+  { 187105, true },
+  { 187121, true },
+  { 187140, true },
+  { 187160, true },
+  { 187175, true },
+  { 187183, true },
+  { 187202, true },
+  { 187218, false },
+  { 187226, true },
+  { 187241, true },
+  { 187249, true },
+  { 187260, true },
+  { 187273, true },
+  { 187284, true },
+  { 187299, false },
+  { 187319, true },
+  { 187334, true },
+  { 187349, true },
+  { 187359, true },
+  { 187371, true },
+  { 187395, true },
+  { 187408, true },
+  { 187421, true },
+  { 187433, true },
   { 187446, true },
-  { 187462, true },
-  { 187481, true },
-  { 187501, true },
-  { 187512, true },
-  { 187522, true },
-  { 187533, true },
-  { 187541, true },
-  { 187554, true },
+  { 187460, true },
+  { 187476, true },
+  { 187495, true },
+  { 187515, true },
+  { 187526, true },
+  { 187536, true },
+  { 187547, true },
+  { 187555, true },
   { 187568, true },
-  { 187578, true },
-  { 187596, true },
-  { 187623, true },
-  { 187632, true },
-  { 187645, false },
-  { 187668, true },
-  { 187690, true },
-  { 187701, true },
-  { 187716, true },
-  { 187723, true },
+  { 187582, true },
+  { 187592, true },
+  { 187610, true },
+  { 187637, true },
+  { 187646, true },
+  { 187659, false },
+  { 187682, true },
+  { 187704, true },
+  { 187715, true },
   { 187730, true },
-  { 187741, true },
-  { 187757, true },
-  { 187770, true },
-  { 187782, true },
-  { 187792, true },
-  { 187809, true },
-  { 187824, true },
-  { 187833, true },
-  { 187844, true },
-  { 187862, true },
+  { 187737, true },
+  { 187744, true },
+  { 187755, true },
+  { 187771, true },
+  { 187784, true },
+  { 187796, true },
+  { 187806, true },
+  { 187823, true },
+  { 187838, true },
+  { 187847, true },
+  { 187858, true },
   { 187876, true },
-  { 187888, true },
-  { 187897, true },
-  { 187907, true },
-  { 187919, true },
-  { 187931, true },
-  { 187944, true },
-  { 187960, true },
-  { 187979, true },
-  { 187998, true },
-  { 188013, true },
-  { 188023, true },
-  { 188042, true },
-  { 188060, true },
-  { 188072, true },
-  { 188091, false },
-  { 188106, true },
+  { 187890, true },
+  { 187902, true },
+  { 187911, true },
+  { 187921, true },
+  { 187933, true },
+  { 187945, true },
+  { 187958, true },
+  { 187974, true },
+  { 187993, true },
+  { 188012, true },
+  { 188027, true },
+  { 188037, true },
+  { 188056, true },
+  { 188074, true },
+  { 188086, true },
+  { 188105, false },
   { 188120, true },
-  { 188131, false },
-  { 188141, true },
-  { 188147, true },
-  { 188156, true },
-  { 188164, true },
-  { 188183, true },
-  { 188192, true },
+  { 188134, true },
+  { 188145, false },
+  { 188155, true },
+  { 188161, true },
+  { 188170, true },
+  { 188178, true },
+  { 188197, true },
   { 188206, true },
-  { 188224, true },
-  { 188236, true },
-  { 188246, true },
-  { 188270, true },
-  { 188293, true },
-  { 188306, true },
-  { 188322, true },
-  { 188334, true },
-  { 188348, false },
-  { 188361, true },
-  { 188380, true },
-  { 188390, true },
-  { 188412, true },
-  { 188425, true },
-  { 188434, true },
-  { 188445, true },
-  { 188458, true },
-  { 188471, true },
-  { 188482, true },
+  { 188220, true },
+  { 188238, true },
+  { 188250, true },
+  { 188260, true },
+  { 188284, true },
+  { 188307, true },
+  { 188320, true },
+  { 188336, true },
+  { 188348, true },
+  { 188362, false },
+  { 188375, true },
+  { 188394, true },
+  { 188404, true },
+  { 188426, true },
+  { 188439, true },
+  { 188448, true },
+  { 188459, true },
+  { 188472, true },
+  { 188485, true },
   { 188496, true },
-  { 188511, true },
-  { 188526, true },
-  { 188549, false },
-  { 188562, false },
-  { 188576, true },
-  { 188591, true },
-  { 188603, true },
-  { 188613, true },
+  { 188510, true },
+  { 188525, true },
+  { 188540, true },
+  { 188563, false },
+  { 188576, false },
+  { 188590, true },
+  { 188605, true },
+  { 188617, true },
   { 188627, true },
-  { 188640, true },
-  { 188653, false },
-  { 188667, true },
-  { 188679, true },
-  { 188691, true },
-  { 188707, true },
-  { 188733, true },
-  { 188751, false },
-  { 188764, true },
-  { 188782, true },
-  { 188792, true },
-  { 188802, true },
-  { 188813, true },
-  { 188828, true },
-  { 188844, true },
-  { 188852, true },
-  { 188862, true },
-  { 188872, true },
-  { 188882, true },
-  { 188893, true },
-  { 188913, true },
-  { 188921, false },
-  { 188942, true },
-  { 188955, true },
-  { 188964, true },
+  { 188641, true },
+  { 188654, true },
+  { 188667, false },
+  { 188681, true },
+  { 188693, true },
+  { 188705, true },
+  { 188721, true },
+  { 188747, true },
+  { 188765, false },
+  { 188778, true },
+  { 188796, true },
+  { 188806, true },
+  { 188816, true },
+  { 188827, true },
+  { 188842, true },
+  { 188858, true },
+  { 188866, true },
+  { 188876, true },
+  { 188886, true },
+  { 188896, true },
+  { 188907, true },
+  { 188927, true },
+  { 188935, false },
+  { 188956, true },
+  { 188969, true },
   { 188978, true },
-  { 188988, true },
-  { 189001, true },
-  { 189010, true },
-  { 189026, true },
-  { 189037, false },
-  { 189057, true },
-  { 189067, true },
-  { 189077, true },
-  { 189092, true },
+  { 188992, true },
+  { 189002, true },
+  { 189015, true },
+  { 189024, true },
+  { 189040, true },
+  { 189051, false },
+  { 189071, true },
+  { 189081, true },
+  { 189091, true },
   { 189106, true },
-  { 189123, true },
-  { 189139, true },
-  { 189150, true },
-  { 189180, true },
-  { 189206, true },
-  { 189214, true },
-  { 189233, true },
+  { 189120, true },
+  { 189137, true },
+  { 189153, true },
+  { 189164, true },
+  { 189194, true },
+  { 189220, true },
+  { 189228, true },
   { 189247, true },
-  { 189256, true },
-  { 189275, true },
-  { 189285, true },
-  { 189300, true },
-  { 189316, true },
-  { 189333, true },
-  { 189344, true },
-  { 189361, true },
-  { 189377, true },
-  { 189397, true },
-  { 189419, true },
-  { 189432, true },
-  { 189442, true },
-  { 189464, true },
-  { 189485, true },
-  { 189506, true },
-  { 189519, true },
-  { 189543, true },
-  { 189554, true },
-  { 189566, true },
-  { 189578, true },
-  { 189588, true },
-  { 189606, true },
-  { 189618, false },
-  { 189635, true },
-  { 189667, true },
-  { 189678, true },
-  { 189688, true },
-  { 189701, true },
-  { 189710, true },
-  { 189723, true },
-  { 189734, true },
-  { 189745, true },
-  { 189755, true },
-  { 189762, true },
-  { 189774, true },
-  { 189787, false },
-  { 189799, true },
-  { 189819, true },
-  { 189829, true },
-  { 189850, true },
-  { 189867, true },
-  { 189884, true },
-  { 189902, true },
-  { 189920, false },
-  { 189938, false },
-  { 189956, false },
-  { 189973, true },
-  { 189995, true },
-  { 190008, true },
-  { 190021, false },
-  { 190036, false },
-  { 190046, false },
-  { 190060, true },
-  { 190075, true },
-  { 190087, true },
-  { 190105, true },
-  { 190120, true },
-  { 190138, true },
-  { 190154, true },
-  { 190164, true },
-  { 190174, true },
-  { 190202, true },
-  { 190217, true },
-  { 190228, true },
-  { 190238, false },
-  { 190256, true },
-  { 190271, true },
-  { 190283, true },
-  { 190296, true },
-  { 190313, true },
-  { 190323, true },
-  { 190334, false },
-  { 190349, true },
-  { 190367, true },
-  { 190382, true },
-  { 190400, true },
-  { 190412, true },
-  { 190435, true },
+  { 189261, true },
+  { 189270, true },
+  { 189289, true },
+  { 189299, true },
+  { 189314, true },
+  { 189330, true },
+  { 189347, true },
+  { 189358, true },
+  { 189375, true },
+  { 189391, true },
+  { 189411, true },
+  { 189433, true },
+  { 189446, true },
+  { 189456, true },
+  { 189478, true },
+  { 189499, true },
+  { 189520, true },
+  { 189533, true },
+  { 189557, true },
+  { 189568, true },
+  { 189580, true },
+  { 189592, true },
+  { 189602, true },
+  { 189620, true },
+  { 189632, false },
+  { 189649, true },
+  { 189681, true },
+  { 189692, true },
+  { 189702, true },
+  { 189715, true },
+  { 189724, true },
+  { 189737, true },
+  { 189748, true },
+  { 189759, true },
+  { 189769, true },
+  { 189776, true },
+  { 189788, true },
+  { 189801, false },
+  { 189813, true },
+  { 189833, true },
+  { 189843, true },
+  { 189864, true },
+  { 189881, true },
+  { 189898, true },
+  { 189916, true },
+  { 189934, false },
+  { 189952, false },
+  { 189970, false },
+  { 189987, true },
+  { 190009, true },
+  { 190022, true },
+  { 190035, false },
+  { 190050, false },
+  { 190060, false },
+  { 190074, true },
+  { 190089, true },
+  { 190101, true },
+  { 190119, true },
+  { 190134, true },
+  { 190152, true },
+  { 190168, true },
+  { 190178, true },
+  { 190188, true },
+  { 190216, true },
+  { 190231, true },
+  { 190242, true },
+  { 190252, false },
+  { 190270, true },
+  { 190285, true },
+  { 190297, true },
+  { 190310, true },
+  { 190327, true },
+  { 190337, true },
+  { 190348, false },
+  { 190363, true },
+  { 190381, true },
+  { 190396, true },
+  { 190414, true },
+  { 190426, true },
   { 190449, true },
-  { 190465, true },
+  { 190463, true },
   { 190479, true },
-  { 190497, true },
-  { 190521, true },
-  { 190554, false },
-  { 190577, true },
-  { 190597, true },
-  { 190614, true },
-  { 190632, true },
-  { 190642, true },
-  { 190655, true },
-  { 190668, true },
-  { 190685, true },
-  { 190696, true },
-  { 190718, true },
-  { 190736, false },
-  { 190750, true },
+  { 190493, true },
+  { 190511, true },
+  { 190535, true },
+  { 190568, false },
+  { 190591, true },
+  { 190611, true },
+  { 190628, true },
+  { 190646, true },
+  { 190656, true },
+  { 190669, true },
+  { 190682, true },
+  { 190699, true },
+  { 190710, true },
+  { 190732, true },
+  { 190750, false },
   { 190764, true },
-  { 190782, true },
-  { 190802, true },
+  { 190778, true },
+  { 190796, true },
   { 190816, true },
-  { 190825, true },
-  { 190838, true },
-  { 190856, true },
-  { 190868, true },
-  { 190883, true },
-  { 190896, true },
-  { 190908, true },
-  { 190920, true },
-  { 190931, true },
-  { 190942, true },
-  { 190951, true },
-  { 190964, true },
+  { 190830, true },
+  { 190839, true },
+  { 190852, true },
+  { 190870, true },
+  { 190882, true },
+  { 190897, true },
+  { 190910, true },
+  { 190922, true },
+  { 190934, true },
+  { 190945, true },
+  { 190956, true },
+  { 190965, true },
   { 190978, true },
-  { 190989, true },
-  { 191000, true },
-  { 191013, true },
-  { 191027, false },
-  { 191040, true },
-  { 191049, true },
-  { 191066, true },
-  { 191076, true },
-  { 191089, true },
-  { 191098, true },
-  { 191108, true },
-  { 191119, true },
-  { 191129, true },
-  { 191137, true },
-  { 191145, false },
+  { 190992, true },
+  { 191003, true },
+  { 191014, true },
+  { 191027, true },
+  { 191041, false },
+  { 191054, true },
+  { 191063, true },
+  { 191080, true },
+  { 191090, true },
+  { 191103, true },
+  { 191112, true },
+  { 191122, true },
+  { 191133, true },
+  { 191143, true },
+  { 191151, true },
   { 191159, false },
-  { 191179, true },
-  { 191189, true },
+  { 191173, false },
+  { 191193, true },
   { 191203, true },
-  { 191213, true },
-  { 191224, true },
-  { 191236, true },
-  { 191247, true },
-  { 191259, true },
-  { 191269, true },
-  { 191278, true },
-  { 191290, true },
-  { 191302, true },
-  { 191313, true },
-  { 191325, true },
-  { 191341, true },
-  { 191356, true },
-  { 191368, true },
-  { 191378, true },
-  { 191393, true },
-  { 191408, true },
-  { 191420, true },
-  { 191427, true },
-  { 191438, true },
-  { 191448, true },
-  { 191463, true },
-  { 191474, true },
-  { 191487, true },
+  { 191217, true },
+  { 191227, true },
+  { 191238, true },
+  { 191250, true },
+  { 191261, true },
+  { 191273, true },
+  { 191283, true },
+  { 191292, true },
+  { 191304, true },
+  { 191316, true },
+  { 191327, true },
+  { 191339, true },
+  { 191355, true },
+  { 191370, true },
+  { 191382, true },
+  { 191392, true },
+  { 191407, true },
+  { 191422, true },
+  { 191434, true },
+  { 191441, true },
+  { 191452, true },
+  { 191462, true },
+  { 191477, true },
+  { 191488, true },
   { 191501, true },
   { 191515, true },
-  { 191526, false },
-  { 191541, true },
-  { 191550, true },
-  { 191560, true },
-  { 191567, true },
-  { 191578, true },
-  { 191590, true },
-  { 191612, true },
+  { 191529, true },
+  { 191540, false },
+  { 191555, true },
+  { 191564, true },
+  { 191574, true },
+  { 191581, true },
+  { 191592, true },
+  { 191604, true },
   { 191626, true },
-  { 191649, true },
-  { 191684, true },
-  { 191727, false },
-  { 191738, true },
-  { 191751, true },
-  { 191761, true },
-  { 191771, true },
-  { 191798, true },
-  { 191807, true },
-  { 191816, true },
-  { 191833, true },
-  { 191845, true },
-  { 191858, true },
-  { 191885, true },
-  { 191892, true },
-  { 191903, true },
-  { 191920, true },
-  { 191936, true },
-  { 191947, true },
-  { 191960, true },
-  { 191984, true },
-  { 191991, true },
-  { 192001, true },
-  { 192008, true },
-  { 192028, true },
-  { 192040, true },
-  { 192061, true },
-  { 192072, true },
-  { 192084, true },
-  { 192094, true },
-  { 192103, true },
-  { 192111, true },
-  { 192120, true },
-  { 192129, true },
-  { 192148, true },
-  { 192168, true },
+  { 191640, true },
+  { 191663, true },
+  { 191698, true },
+  { 191741, false },
+  { 191752, true },
+  { 191765, true },
+  { 191775, true },
+  { 191785, true },
+  { 191812, true },
+  { 191821, true },
+  { 191830, true },
+  { 191847, true },
+  { 191859, true },
+  { 191872, true },
+  { 191899, true },
+  { 191906, true },
+  { 191917, true },
+  { 191934, true },
+  { 191950, true },
+  { 191961, true },
+  { 191974, true },
+  { 191998, true },
+  { 192005, true },
+  { 192015, true },
+  { 192022, true },
+  { 192042, true },
+  { 192054, true },
+  { 192075, true },
+  { 192086, true },
+  { 192098, true },
+  { 192108, true },
+  { 192117, true },
+  { 192125, true },
+  { 192134, true },
+  { 192143, true },
+  { 192162, true },
   { 192182, true },
-  { 192203, true },
-  { 192216, true },
-  { 192228, true },
-  { 192252, true },
-  { 192270, false },
-  { 192284, true },
-  { 192299, true },
-  { 192314, true },
-  { 192323, false },
-  { 192340, false },
-  { 192350, true },
-  { 192360, true },
+  { 192196, true },
+  { 192217, true },
+  { 192230, true },
+  { 192242, true },
+  { 192266, true },
+  { 192284, false },
+  { 192298, true },
+  { 192313, true },
+  { 192328, true },
+  { 192337, false },
+  { 192354, false },
+  { 192364, true },
   { 192374, true },
-  { 192389, true },
-  { 192405, true },
-  { 192421, true },
-  { 192444, true },
-  { 192454, true },
-  { 192465, true },
-  { 192475, true },
-  { 192491, true },
-  { 192502, true },
-  { 192513, true },
-  { 192525, true },
-  { 192537, true },
-  { 192548, true },
+  { 192388, true },
+  { 192403, true },
+  { 192419, true },
+  { 192435, true },
+  { 192458, true },
+  { 192468, true },
+  { 192479, true },
+  { 192489, true },
+  { 192505, true },
+  { 192516, true },
+  { 192527, true },
+  { 192539, true },
+  { 192551, true },
   { 192562, true },
   { 192576, true },
-  { 192593, true },
-  { 192609, true },
-  { 192621, false },
-  { 192640, true },
-  { 192650, true },
-  { 192668, true },
-  { 192691, true },
-  { 192702, true },
-  { 192722, true },
-  { 192739, true },
-  { 192755, true },
-  { 192774, true },
-  { 192789, true },
-  { 192805, true },
-  { 192822, true },
-  { 192842, true },
-  { 192854, true },
-  { 192869, true },
-  { 192888, true },
-  { 192897, true },
-  { 192914, true },
-  { 192926, true },
-  { 192938, true },
-  { 192950, true },
-  { 192959, true },
-  { 192969, true },
-  { 192986, true },
-  { 193004, true },
-  { 193015, true },
-  { 193025, true },
-  { 193040, true },
-  { 193050, true },
-  { 193060, false },
-  { 193067, true },
-  { 193077, true },
-  { 193098, true },
-  { 193118, true },
-  { 193141, true },
-  { 193161, true },
-  { 193176, true },
-  { 193194, true },
-  { 193205, false },
-  { 193229, true },
+  { 192590, true },
+  { 192607, true },
+  { 192623, true },
+  { 192635, false },
+  { 192654, true },
+  { 192664, true },
+  { 192682, true },
+  { 192705, true },
+  { 192716, true },
+  { 192736, true },
+  { 192753, true },
+  { 192769, true },
+  { 192788, true },
+  { 192803, true },
+  { 192819, true },
+  { 192836, true },
+  { 192856, true },
+  { 192868, true },
+  { 192887, true },
+  { 192896, true },
+  { 192913, true },
+  { 192925, true },
+  { 192937, true },
+  { 192946, true },
+  { 192956, true },
+  { 192973, true },
+  { 192991, true },
+  { 193002, true },
+  { 193012, true },
+  { 193027, true },
+  { 193037, true },
+  { 193047, false },
+  { 193054, true },
+  { 193064, true },
+  { 193085, true },
+  { 193105, true },
+  { 193128, true },
+  { 193148, true },
+  { 193163, true },
+  { 193181, true },
+  { 193192, false },
+  { 193216, true },
+  { 193235, true },
   { 193248, true },
-  { 193261, true },
-  { 193277, false },
-  { 193293, true },
-  { 193307, true },
-  { 193314, true },
-  { 193326, false },
-  { 193340, false },
-  { 193353, true },
-  { 193367, false },
-  { 193383, true },
-  { 193401, true },
+  { 193264, false },
+  { 193280, true },
+  { 193294, true },
+  { 193301, true },
+  { 193313, false },
+  { 193327, false },
+  { 193340, true },
+  { 193354, false },
+  { 193370, true },
+  { 193388, true },
+  { 193411, true },
   { 193424, true },
-  { 193437, true },
-  { 193449, true },
-  { 193460, true },
-  { 193471, true },
-  { 193486, true },
-  { 193500, true },
-  { 193525, true },
-  { 193558, true },
-  { 193584, true },
-  { 193618, true },
+  { 193436, true },
+  { 193447, true },
+  { 193458, true },
+  { 193473, true },
+  { 193487, true },
+  { 193512, true },
+  { 193545, true },
+  { 193571, true },
+  { 193605, true },
+  { 193628, true },
   { 193641, true },
-  { 193654, true },
-  { 193670, true },
-  { 193682, true },
-  { 193694, true },
-  { 193710, false },
-  { 193730, true },
-  { 193743, false },
-  { 193761, false },
-  { 193784, true },
-  { 193804, true },
-  { 193820, true },
-  { 193834, true },
-  { 193855, true },
-  { 193870, false },
-  { 193883, true },
-  { 193897, true },
-  { 193909, true },
-  { 193921, true },
-  { 193937, false },
-  { 193959, true },
-  { 193979, true },
-  { 193991, true },
-  { 194007, false },
+  { 193657, true },
+  { 193669, true },
+  { 193681, true },
+  { 193697, false },
+  { 193717, true },
+  { 193730, false },
+  { 193748, false },
+  { 193771, true },
+  { 193791, true },
+  { 193807, true },
+  { 193821, true },
+  { 193842, true },
+  { 193857, false },
+  { 193870, true },
+  { 193884, true },
+  { 193896, true },
+  { 193908, true },
+  { 193924, false },
+  { 193946, true },
+  { 193966, true },
+  { 193978, true },
+  { 193994, false },
+  { 194006, true },
   { 194019, true },
-  { 194032, true },
-  { 194048, true },
-  { 194066, true },
-  { 194078, true },
-  { 194092, true },
-  { 194112, true },
-  { 194126, true },
-  { 194143, true },
-  { 194160, true },
-  { 194174, true },
-  { 194184, false },
-  { 194198, true },
-  { 194208, true },
+  { 194035, true },
+  { 194053, true },
+  { 194065, true },
+  { 194079, true },
+  { 194099, true },
+  { 194113, true },
+  { 194130, true },
+  { 194147, true },
+  { 194161, true },
+  { 194171, false },
+  { 194185, true },
+  { 194195, true },
+  { 194216, true },
   { 194229, true },
   { 194242, true },
-  { 194255, true },
+  { 194253, true },
   { 194266, true },
-  { 194279, true },
-  { 194300, true },
-  { 194320, true },
-  { 194337, true },
-  { 194349, true },
-  { 194363, true },
-  { 194373, true },
-  { 194390, true },
-  { 194398, true },
-  { 194414, true },
-  { 194430, true },
-  { 194446, true },
-  { 194467, true },
-  { 194478, true },
+  { 194287, true },
+  { 194307, true },
+  { 194324, true },
+  { 194336, true },
+  { 194350, true },
+  { 194360, true },
+  { 194377, true },
+  { 194385, true },
+  { 194401, true },
+  { 194417, true },
+  { 194433, true },
+  { 194454, true },
+  { 194465, true },
+  { 194477, true },
   { 194490, true },
-  { 194503, true },
-  { 194528, true },
-  { 194543, true },
-  { 194563, true },
-  { 194577, true },
-  { 194591, true },
-  { 194606, true },
-  { 194628, true },
-  { 194648, true },
-  { 194663, true },
-  { 194673, true },
-  { 194691, true },
-  { 194706, true },
-  { 194722, true },
-  { 194738, true },
-  { 194747, false },
-  { 194757, true },
-  { 194769, true },
-  { 194786, true },
-  { 194798, true },
-  { 194814, true },
-  { 194830, true },
-  { 194851, true },
-  { 194863, true },
-  { 194882, false },
-  { 194894, true },
-  { 194904, true },
-  { 194919, true },
-  { 194931, true },
-  { 194945, true },
-  { 194969, true },
-  { 194981, true },
-  { 195002, true },
-  { 195033, true },
-  { 195058, true },
-  { 195081, true },
-  { 195092, true },
-  { 195104, true },
-  { 195119, true },
-  { 195132, true },
-  { 195145, true },
-  { 195174, true },
-  { 195197, true },
-  { 195221, true },
-  { 195248, true },
-  { 195262, true },
-  { 195285, true },
-  { 195311, true },
-  { 195339, true },
-  { 195370, true },
-  { 195395, true },
+  { 194515, true },
+  { 194530, true },
+  { 194550, true },
+  { 194564, true },
+  { 194578, true },
+  { 194593, true },
+  { 194615, true },
+  { 194635, true },
+  { 194650, true },
+  { 194660, true },
+  { 194678, true },
+  { 194693, true },
+  { 194709, true },
+  { 194730, true },
+  { 194746, true },
+  { 194755, false },
+  { 194765, true },
+  { 194777, true },
+  { 194794, true },
+  { 194806, true },
+  { 194822, true },
+  { 194838, true },
+  { 194859, true },
+  { 194871, true },
+  { 194890, false },
+  { 194902, true },
+  { 194912, true },
+  { 194927, true },
+  { 194939, true },
+  { 194953, true },
+  { 194977, true },
+  { 194989, true },
+  { 195010, true },
+  { 195041, true },
+  { 195066, true },
+  { 195089, true },
+  { 195100, true },
+  { 195112, true },
+  { 195127, true },
+  { 195140, true },
+  { 195153, true },
+  { 195182, true },
+  { 195205, true },
+  { 195229, true },
+  { 195256, true },
+  { 195270, true },
+  { 195293, true },
+  { 195319, true },
+  { 195347, true },
+  { 195378, true },
   { 195403, true },
-  { 195410, true },
-  { 195422, true },
+  { 195411, true },
+  { 195418, true },
   { 195430, true },
-  { 195442, true },
-  { 195455, true },
-  { 195476, true },
-  { 195489, true },
-  { 195510, true },
-  { 195529, true },
-  { 195548, true },
-  { 195559, true },
-  { 195572, true },
-  { 195588, false },
-  { 195604, true },
+  { 195438, true },
+  { 195450, true },
+  { 195463, true },
+  { 195484, true },
+  { 195497, true },
+  { 195518, true },
+  { 195537, true },
+  { 195556, true },
+  { 195567, true },
+  { 195580, true },
+  { 195596, false },
   { 195612, true },
-  { 195627, true },
-  { 195644, false },
-  { 195659, true },
-  { 195675, true },
-  { 195685, true },
-  { 195697, true },
-  { 195716, true },
-  { 195730, false },
-  { 195739, true },
-  { 195751, true },
-  { 195764, true },
-  { 195776, true },
-  { 195791, true },
-  { 195813, true },
-  { 195830, true },
-  { 195852, true },
-  { 195866, true },
-  { 195873, true },
-  { 195886, true },
-  { 195899, true },
-  { 195925, true },
-  { 195937, true },
-  { 195948, true },
-  { 195974, true },
-  { 195984, false },
-  { 196001, true },
-  { 196013, true },
-  { 196028, true },
-  { 196038, true },
-  { 196055, true },
-  { 196068, true },
-  { 196080, true },
-  { 196090, true },
-  { 196103, false },
-  { 196119, true },
-  { 196135, true },
-  { 196149, false },
-  { 196164, true },
-  { 196177, false },
-  { 196194, true },
-  { 196208, true },
-  { 196222, true },
-  { 196236, true },
-  { 196260, true },
-  { 196273, true },
-  { 196286, true },
-  { 196300, true },
-  { 196314, true },
-  { 196329, true },
-  { 196343, true },
-  { 196359, true },
-  { 196374, true },
-  { 196389, true },
-  { 196407, true },
-  { 196419, true },
-  { 196431, true },
-  { 196447, true },
-  { 196464, true },
-  { 196488, true },
-  { 196505, true },
-  { 196523, true },
-  { 196542, true },
-  { 196562, true },
-  { 196577, true },
-  { 196589, true },
-  { 196603, true },
-  { 196620, true },
-  { 196629, true },
-  { 196642, true },
-  { 196656, true },
-  { 196671, true },
-  { 196683, true },
-  { 196693, false },
-  { 196706, true },
-  { 196717, true },
-  { 196731, true },
-  { 196744, true },
-  { 196756, false },
-  { 196775, true },
-  { 196797, true },
-  { 196812, true },
-  { 196831, true },
-  { 196845, false },
-  { 196856, true },
-  { 196871, true },
-  { 196885, true },
-  { 196897, true },
-  { 196914, true },
-  { 196932, true },
-  { 196943, true },
-  { 196950, true },
-  { 196963, true },
-  { 196975, true },
+  { 195620, true },
+  { 195635, true },
+  { 195652, false },
+  { 195667, true },
+  { 195683, true },
+  { 195693, true },
+  { 195705, true },
+  { 195724, true },
+  { 195738, false },
+  { 195747, true },
+  { 195759, true },
+  { 195772, true },
+  { 195784, true },
+  { 195799, true },
+  { 195821, true },
+  { 195838, true },
+  { 195860, true },
+  { 195874, true },
+  { 195881, true },
+  { 195894, true },
+  { 195907, true },
+  { 195933, true },
+  { 195945, true },
+  { 195956, true },
+  { 195982, true },
+  { 195992, false },
+  { 196009, true },
+  { 196021, true },
+  { 196036, true },
+  { 196046, true },
+  { 196063, true },
+  { 196076, true },
+  { 196088, true },
+  { 196098, true },
+  { 196111, false },
+  { 196127, true },
+  { 196143, true },
+  { 196157, false },
+  { 196172, true },
+  { 196185, false },
+  { 196202, true },
+  { 196216, true },
+  { 196230, true },
+  { 196244, true },
+  { 196268, true },
+  { 196281, true },
+  { 196294, true },
+  { 196308, true },
+  { 196322, true },
+  { 196337, true },
+  { 196351, true },
+  { 196367, true },
+  { 196382, true },
+  { 196397, true },
+  { 196415, true },
+  { 196427, true },
+  { 196439, true },
+  { 196455, true },
+  { 196472, true },
+  { 196496, true },
+  { 196513, true },
+  { 196531, true },
+  { 196550, true },
+  { 196570, true },
+  { 196585, true },
+  { 196597, true },
+  { 196611, true },
+  { 196628, true },
+  { 196637, true },
+  { 196650, true },
+  { 196664, true },
+  { 196679, true },
+  { 196691, true },
+  { 196701, false },
+  { 196714, true },
+  { 196725, true },
+  { 196739, true },
+  { 196752, true },
+  { 196764, false },
+  { 196783, true },
+  { 196805, true },
+  { 196820, true },
+  { 196839, true },
+  { 196853, false },
+  { 196864, true },
+  { 196879, true },
+  { 196893, true },
+  { 196905, true },
+  { 196922, true },
+  { 196940, true },
+  { 196951, true },
+  { 196958, true },
+  { 196971, true },
   { 196983, true },
-  { 196993, true },
-  { 197003, true },
-  { 197018, true },
-  { 197037, true },
-  { 197049, true },
-  { 197065, false },
-  { 197080, false },
-  { 197090, false },
-  { 197102, true },
-  { 197111, true },
-  { 197125, true },
-  { 197137, true },
+  { 196991, true },
+  { 197001, true },
+  { 197011, true },
+  { 197026, true },
+  { 197045, true },
+  { 197057, true },
+  { 197073, false },
+  { 197088, false },
+  { 197098, false },
+  { 197110, true },
+  { 197119, true },
+  { 197133, true },
   { 197145, true },
-  { 197152, true },
-  { 197162, true },
-  { 197175, true },
-  { 197194, true },
-  { 197202, false },
-  { 197214, true },
-  { 197227, true },
-  { 197242, true },
-  { 197264, true },
-  { 197278, true },
-  { 197289, true },
-  { 197301, true },
-  { 197319, true },
-  { 197335, true },
-  { 197344, false },
-  { 197361, true },
-  { 197382, true },
-  { 197403, true },
-  { 197415, true },
-  { 197440, true },
-  { 197466, true },
-  { 197492, true },
-  { 197503, true },
-  { 197515, true },
-  { 197528, true },
-  { 197541, true },
-  { 197551, true },
-  { 197560, true },
-  { 197574, true },
-  { 197594, true },
-  { 197609, true },
-  { 197625, true },
-  { 197635, true },
-  { 197647, true },
-  { 197667, true },
-  { 197689, true },
-  { 197706, true },
-  { 197725, true },
-  { 197739, true },
-  { 197753, true },
-  { 197765, true },
-  { 197789, true },
-  { 197806, false },
-  { 197820, true },
-  { 197833, true },
-  { 197846, true },
-  { 197865, true },
-  { 197877, true },
-  { 197892, true },
-  { 197913, true },
-  { 197938, true },
-  { 197954, true },
-  { 197980, true },
-  { 198000, true },
-  { 198013, true },
-  { 198029, true },
-  { 198042, true },
-  { 198054, true },
+  { 197153, true },
+  { 197160, true },
+  { 197170, true },
+  { 197183, true },
+  { 197202, true },
+  { 197210, false },
+  { 197222, true },
+  { 197235, true },
+  { 197250, true },
+  { 197272, true },
+  { 197286, true },
+  { 197297, true },
+  { 197309, true },
+  { 197327, true },
+  { 197343, true },
+  { 197352, false },
+  { 197369, true },
+  { 197390, true },
+  { 197411, true },
+  { 197423, true },
+  { 197448, true },
+  { 197474, true },
+  { 197500, true },
+  { 197511, true },
+  { 197523, true },
+  { 197536, true },
+  { 197549, true },
+  { 197559, true },
+  { 197568, true },
+  { 197582, true },
+  { 197602, true },
+  { 197617, true },
+  { 197633, true },
+  { 197643, true },
+  { 197655, true },
+  { 197675, true },
+  { 197697, true },
+  { 197714, true },
+  { 197727, true },
+  { 197746, true },
+  { 197760, true },
+  { 197774, true },
+  { 197786, true },
+  { 197810, true },
+  { 197827, false },
+  { 197841, true },
+  { 197854, true },
+  { 197867, true },
+  { 197886, true },
+  { 197908, true },
+  { 197920, true },
+  { 197935, true },
+  { 197956, true },
+  { 197981, true },
+  { 197997, true },
+  { 198023, true },
+  { 198043, true },
+  { 198056, true },
   { 198072, true },
-  { 198086, true },
-  { 198105, true },
-  { 198116, true },
-  { 198128, true },
-  { 198138, true },
-  { 198147, true },
-  { 198161, true },
-  { 198172, true },
-  { 198183, true },
-  { 198191, true },
+  { 198085, true },
+  { 198097, true },
+  { 198115, true },
+  { 198129, true },
+  { 198148, true },
+  { 198159, true },
+  { 198171, true },
+  { 198181, true },
+  { 198190, true },
   { 198204, true },
-  { 198218, true },
-  { 198235, true },
-  { 198246, false },
-  { 198258, true },
-  { 198277, true },
-  { 198290, true },
+  { 198215, true },
+  { 198226, true },
+  { 198234, true },
+  { 198247, true },
+  { 198261, true },
+  { 198278, true },
+  { 198289, false },
   { 198301, true },
-  { 198312, true },
-  { 198325, true },
-  { 198337, true },
-  { 198347, true },
-  { 198357, true },
-  { 198377, true },
-  { 198387, true },
-  { 198410, true },
-  { 198422, true },
-  { 198441, true },
-  { 198449, true },
-  { 198463, true },
-  { 198475, true },
-  { 198490, false },
-  { 198503, true },
-  { 198516, true },
-  { 198527, true },
-  { 198538, true },
-  { 198554, true },
-  { 198564, true },
-  { 198578, true },
-  { 198585, true },
-  { 198598, true },
-  { 198615, true },
-  { 198625, true },
-  { 198633, true },
-  { 198645, true },
-  { 198661, true },
+  { 198320, true },
+  { 198333, true },
+  { 198344, true },
+  { 198355, true },
+  { 198368, true },
+  { 198380, true },
+  { 198390, true },
+  { 198400, true },
+  { 198420, true },
+  { 198430, true },
+  { 198453, true },
+  { 198465, true },
+  { 198484, true },
+  { 198492, true },
+  { 198506, true },
+  { 198518, true },
+  { 198533, false },
+  { 198546, true },
+  { 198559, true },
+  { 198570, true },
+  { 198581, true },
+  { 198597, true },
+  { 198607, true },
+  { 198621, true },
+  { 198628, true },
+  { 198641, true },
+  { 198658, true },
+  { 198668, true },
   { 198676, true },
-  { 198686, true },
-  { 198711, true },
+  { 198688, true },
+  { 198704, true },
   { 198719, true },
-  { 198731, false },
-  { 198742, false },
-  { 198760, false },
-  { 198773, true },
-  { 198788, true },
-  { 198802, true },
+  { 198729, true },
+  { 198754, true },
+  { 198762, true },
+  { 198774, false },
+  { 198785, false },
+  { 198803, false },
   { 198816, true },
-  { 198833, true },
-  { 198848, true },
-  { 198866, true },
-  { 198884, true },
-  { 198902, true },
-  { 198916, true },
-  { 198930, true },
+  { 198831, true },
+  { 198845, true },
+  { 198859, true },
+  { 198876, true },
+  { 198893, true },
+  { 198908, true },
+  { 198926, true },
   { 198944, true },
-  { 198958, true },
-  { 198972, false },
-  { 198990, false },
-  { 199013, false },
-  { 199034, false },
-  { 199053, true },
-  { 199069, false },
-  { 199085, false },
-  { 199101, true },
-  { 199123, true },
-  { 199136, false },
-  { 199153, false },
-  { 199170, true },
-  { 199187, false },
-  { 199204, false },
-  { 199218, false },
-  { 199237, false },
-  { 199248, false },
-  { 199260, false },
-  { 199272, false },
-  { 199291, true },
-  { 199309, false },
-  { 199323, true },
-  { 199339, false },
-  { 199356, false },
-  { 199373, false },
-  { 199388, false },
-  { 199404, true },
-  { 199425, false },
-  { 199444, false },
-  { 199462, false },
-  { 199482, true },
-  { 199498, false },
-  { 199513, true },
-  { 199528, true },
-  { 199552, true },
-  { 199559, true },
-  { 199578, false },
-  { 199596, false },
-  { 199611, true },
-  { 199632, false },
+  { 198962, true },
+  { 198976, true },
+  { 198990, true },
+  { 199004, true },
+  { 199018, true },
+  { 199032, false },
+  { 199050, false },
+  { 199073, false },
+  { 199094, false },
+  { 199113, true },
+  { 199129, false },
+  { 199145, false },
+  { 199161, true },
+  { 199183, true },
+  { 199196, false },
+  { 199213, false },
+  { 199230, true },
+  { 199247, false },
+  { 199264, false },
+  { 199278, false },
+  { 199297, false },
+  { 199308, false },
+  { 199320, false },
+  { 199332, false },
+  { 199351, true },
+  { 199369, false },
+  { 199383, true },
+  { 199399, false },
+  { 199416, false },
+  { 199433, false },
+  { 199448, false },
+  { 199464, true },
+  { 199485, false },
+  { 199504, false },
+  { 199522, false },
+  { 199542, true },
+  { 199558, false },
+  { 199573, true },
+  { 199588, true },
+  { 199612, true },
+  { 199619, true },
+  { 199638, false },
   { 199656, false },
-  { 199675, false },
-  { 199691, false },
-  { 199706, false },
-  { 199719, true },
+  { 199671, true },
+  { 199692, false },
+  { 199716, false },
   { 199735, false },
-  { 199750, false },
-  { 199764, false },
-  { 199782, true },
-  { 199793, true },
-  { 199804, true },
-  { 199812, true },
-  { 199827, true },
-  { 199837, true },
-  { 199850, true },
-  { 199867, true },
-  { 199879, true },
+  { 199751, false },
+  { 199766, false },
+  { 199779, true },
+  { 199795, false },
+  { 199810, false },
+  { 199824, false },
+  { 199842, true },
+  { 199853, true },
+  { 199864, true },
+  { 199872, true },
   { 199887, true },
-  { 199898, true },
-  { 199908, true },
-  { 199924, true },
-  { 199929, true },
-  { 199934, true },
-  { 199944, true },
-  { 199952, true },
-  { 199972, true },
-  { 199979, true },
-  { 199998, true },
-  { 200005, true },
+  { 199897, true },
+  { 199910, true },
+  { 199927, true },
+  { 199939, true },
+  { 199947, true },
+  { 199958, true },
+  { 199968, true },
+  { 199984, true },
+  { 199989, true },
+  { 199994, true },
+  { 200004, true },
   { 200012, true },
-  { 200019, true },
-  { 200028, true },
-  { 200049, true },
-  { 200069, true },
-  { 200093, true },
-  { 200100, true },
-  { 200110, true },
-  { 200127, true },
-  { 200147, true },
+  { 200032, true },
+  { 200039, true },
+  { 200058, true },
+  { 200065, true },
+  { 200072, true },
+  { 200079, true },
+  { 200088, true },
+  { 200109, true },
+  { 200129, true },
   { 200153, true },
   { 200160, true },
-  { 200172, true },
-  { 200185, true },
-  { 200200, false },
-  { 200211, true },
-  { 200222, true },
-  { 200230, false },
-  { 200249, true },
-  { 200260, true },
+  { 200170, true },
+  { 200187, true },
+  { 200207, true },
+  { 200213, true },
+  { 200220, true },
+  { 200232, true },
+  { 200245, true },
+  { 200260, false },
   { 200271, true },
-  { 200278, true },
-  { 200289, true },
-  { 200301, true },
+  { 200282, true },
+  { 200290, false },
+  { 200309, true },
   { 200320, true },
-  { 200336, true },
-  { 200348, true },
-  { 200359, true },
-  { 200372, true },
-  { 200387, true },
-  { 200402, true },
-  { 200412, true },
-  { 200422, true },
-  { 200433, false },
-  { 200443, true },
-  { 200454, true },
-  { 200464, true },
-  { 200473, false },
-  { 200487, true },
-  { 200497, true },
-  { 200505, true },
-  { 200517, true },
-  { 200528, true },
-  { 200539, true },
-  { 200551, true },
-  { 200559, true },
-  { 200573, true },
-  { 200580, true },
-  { 200587, true },
-  { 200605, true },
-  { 200631, true },
-  { 200657, true },
-  { 200680, true },
-  { 200711, true },
-  { 200722, true },
-  { 200738, true },
-  { 200750, true },
-  { 200769, true },
-  { 200802, true },
-  { 200826, true },
-  { 200852, true },
-  { 200877, true },
-  { 200902, true },
-  { 200926, true },
-  { 200956, true },
-  { 200967, true },
+  { 200331, true },
+  { 200338, true },
+  { 200349, true },
+  { 200361, true },
+  { 200380, true },
+  { 200396, true },
+  { 200408, true },
+  { 200419, true },
+  { 200432, true },
+  { 200447, true },
+  { 200462, true },
+  { 200472, true },
+  { 200482, true },
+  { 200493, false },
+  { 200503, true },
+  { 200514, true },
+  { 200524, true },
+  { 200533, false },
+  { 200547, true },
+  { 200557, true },
+  { 200565, true },
+  { 200577, true },
+  { 200588, true },
+  { 200599, true },
+  { 200611, true },
+  { 200619, true },
+  { 200633, true },
+  { 200640, true },
+  { 200647, true },
+  { 200665, true },
+  { 200691, true },
+  { 200717, true },
+  { 200740, true },
+  { 200771, true },
+  { 200782, true },
+  { 200798, true },
+  { 200810, true },
+  { 200829, true },
+  { 200862, true },
+  { 200886, true },
+  { 200912, true },
+  { 200937, true },
+  { 200962, true },
   { 200986, true },
-  { 201017, true },
-  { 201028, false },
-  { 201049, true },
-  { 201086, true },
+  { 201016, true },
+  { 201027, true },
+  { 201046, true },
+  { 201077, true },
+  { 201088, false },
   { 201109, true },
-  { 201137, true },
-  { 201152, true },
-  { 201166, true },
-  { 201188, true },
-  { 201230, true },
-  { 201253, true },
-  { 201269, true },
-  { 201295, true },
-  { 201329, true },
-  { 201353, true },
-  { 201380, true },
-  { 201386, true },
-  { 201395, false },
-  { 201405, true },
-  { 201416, true },
-  { 201426, true },
-  { 201436, true },
-  { 201443, true },
-  { 201450, true },
-  { 201463, true },
-  { 201470, true },
-  { 201484, true },
-  { 201493, true },
-  { 201507, true },
-  { 201517, true },
-  { 201527, true },
-  { 201534, true },
-  { 201541, true },
-  { 201552, true },
-  { 201561, true },
-  { 201577, true },
-  { 201586, true },
-  { 201599, true },
-  { 201606, true },
-  { 201616, true },
-  { 201624, true },
-  { 201635, true },
-  { 201644, true },
-  { 201654, true },
-  { 201669, true },
-  { 201679, true },
-  { 201688, true },
-  { 201708, true },
-  { 201719, true },
-  { 201730, true },
-  { 201744, true },
-  { 201760, true },
-  { 201767, true },
-  { 201779, true },
-  { 201789, true },
-  { 201796, true },
-  { 201807, true },
-  { 201819, false },
-  { 201831, true },
-  { 201845, true },
-  { 201858, true },
-  { 201874, true },
-  { 201884, true },
+  { 201146, true },
+  { 201169, true },
+  { 201184, true },
+  { 201198, true },
+  { 201220, true },
+  { 201262, true },
+  { 201285, true },
+  { 201301, true },
+  { 201327, true },
+  { 201361, true },
+  { 201385, true },
+  { 201412, true },
+  { 201418, true },
+  { 201427, false },
+  { 201437, true },
+  { 201448, true },
+  { 201458, true },
+  { 201468, true },
+  { 201475, true },
+  { 201482, true },
+  { 201495, true },
+  { 201502, true },
+  { 201516, true },
+  { 201525, true },
+  { 201539, true },
+  { 201549, true },
+  { 201559, true },
+  { 201566, true },
+  { 201573, true },
+  { 201584, true },
+  { 201593, true },
+  { 201609, true },
+  { 201618, true },
+  { 201631, true },
+  { 201638, true },
+  { 201648, true },
+  { 201656, true },
+  { 201667, true },
+  { 201676, true },
+  { 201686, true },
+  { 201701, true },
+  { 201711, true },
+  { 201720, true },
+  { 201727, true },
+  { 201747, true },
+  { 201758, true },
+  { 201769, true },
+  { 201783, true },
+  { 201799, true },
+  { 201806, true },
+  { 201818, true },
+  { 201828, true },
+  { 201835, true },
+  { 201846, true },
+  { 201858, false },
+  { 201870, true },
+  { 201883, true },
   { 201899, true },
-  { 201911, false },
-  { 201921, true },
-  { 201934, true },
+  { 201909, true },
+  { 201924, true },
+  { 201936, false },
   { 201946, true },
-  { 201954, true },
-  { 201963, true },
-  { 201975, true },
-  { 201985, true },
-  { 201993, true },
-  { 202003, true },
+  { 201959, true },
+  { 201971, true },
+  { 201979, true },
+  { 201988, true },
+  { 202000, true },
   { 202010, true },
-  { 202019, true },
-  { 202039, true },
-  { 202054, true },
-  { 202070, false },
-  { 202085, false },
-  { 202098, true },
-  { 202112, true },
-  { 202122, false },
-  { 202131, true },
-  { 202147, true },
-  { 202154, true },
-  { 202164, true },
-  { 202173, true },
-  { 202182, true },
-  { 202193, true },
-  { 202204, true },
-  { 202215, true },
-  { 202237, true },
-  { 202252, true },
-  { 202259, true },
-  { 202270, true },
-  { 202278, true },
-  { 202288, true },
-  { 202301, false },
-  { 202310, true },
-  { 202324, true },
-  { 202340, true },
-  { 202364, true },
-  { 202382, true },
-  { 202393, true },
-  { 202405, false },
-  { 202420, true },
-  { 202430, true },
-  { 202442, true },
-  { 202462, true },
-  { 202472, true },
-  { 202482, true },
-  { 202494, true },
-  { 202507, true },
-  { 202522, true },
-  { 202536, true },
-  { 202551, true },
-  { 202566, true },
-  { 202578, true },
-  { 202590, true },
-  { 202601, true },
-  { 202611, true },
-  { 202623, true },
-  { 202636, true },
-  { 202649, true },
-  { 202664, true },
-  { 202683, true },
-  { 202698, true },
-  { 202710, true },
-  { 202721, true },
-  { 202743, true },
-  { 202759, true },
-  { 202779, true },
-  { 202788, true },
-  { 202796, true },
-  { 202804, false },
-  { 202816, true },
-  { 202829, true },
-  { 202841, true },
-  { 202853, true },
-  { 202861, true },
-  { 202876, true },
-  { 202886, true },
-  { 202897, true },
-  { 202913, true },
-  { 202922, true },
-  { 202931, true },
-  { 202940, true },
-  { 202955, true },
-  { 202964, true },
-  { 202975, true },
-  { 202989, true },
-  { 203001, true },
-  { 203014, true },
-  { 203022, false },
-  { 203034, true },
-  { 203048, true },
-  { 203060, true },
-  { 203067, true },
-  { 203075, true },
-  { 203083, true },
-  { 203093, true },
-  { 203102, true },
-  { 203115, true },
-  { 203120, true },
-  { 203130, true },
-  { 203137, true },
-  { 203144, true },
-  { 203156, false },
-  { 203175, true },
-  { 203191, true },
-  { 203206, true },
-  { 203221, true },
-  { 203234, true },
-  { 203247, true },
-  { 203255, true },
-  { 203265, true },
-  { 203275, true },
-  { 203288, true },
-  { 203301, true },
-  { 203318, true },
-  { 203326, true },
-  { 203335, true },
-  { 203348, true },
-  { 203360, true },
-  { 203390, true },
-  { 203401, true },
-  { 203419, true },
-  { 203427, true },
-  { 203451, true },
-  { 203461, true },
-  { 203473, true },
-  { 203484, true },
-  { 203496, true },
-  { 203514, true },
-  { 203523, true },
-  { 203534, true },
-  { 203546, true },
-  { 203554, true },
-  { 203561, true },
-  { 203569, true },
-  { 203580, true },
-  { 203590, true },
-  { 203599, true },
-  { 203608, true },
-  { 203633, true },
-  { 203645, true },
-  { 203665, true },
-  { 203687, true },
-  { 203698, true },
-  { 203709, true },
-  { 203722, true },
-  { 203737, true },
-  { 203755, true },
-  { 203768, true },
-  { 203784, true },
-  { 203802, true },
-  { 203816, true },
-  { 203826, true },
-  { 203838, true },
-  { 203850, true },
-  { 203862, true },
-  { 203873, true },
-  { 203885, true },
-  { 203898, true },
-  { 203911, true },
-  { 203923, true },
-  { 203935, true },
-  { 203946, false },
-  { 203956, true },
-  { 203967, true },
-  { 203982, true },
-  { 203995, true },
-  { 204006, true },
-  { 204016, true },
-  { 204030, true },
-  { 204042, true },
-  { 204058, true },
-  { 204073, true },
-  { 204086, true },
-  { 204098, true },
-  { 204111, true },
-  { 204126, true },
-  { 204133, true },
-  { 204148, true },
+  { 202018, true },
+  { 202028, true },
+  { 202035, true },
+  { 202044, true },
+  { 202064, true },
+  { 202079, true },
+  { 202095, false },
+  { 202110, false },
+  { 202123, true },
+  { 202137, true },
+  { 202147, false },
+  { 202156, true },
+  { 202172, true },
+  { 202179, true },
+  { 202189, true },
+  { 202198, true },
+  { 202207, true },
+  { 202218, true },
+  { 202229, true },
+  { 202240, true },
+  { 202262, true },
+  { 202277, true },
+  { 202284, true },
+  { 202295, true },
+  { 202303, true },
+  { 202313, true },
+  { 202326, false },
+  { 202335, true },
+  { 202349, true },
+  { 202365, true },
+  { 202389, true },
+  { 202407, true },
+  { 202418, true },
+  { 202430, false },
+  { 202445, true },
+  { 202455, true },
+  { 202467, true },
+  { 202477, true },
+  { 202487, true },
+  { 202499, true },
+  { 202512, true },
+  { 202527, true },
+  { 202541, true },
+  { 202556, true },
+  { 202571, true },
+  { 202583, true },
+  { 202595, true },
+  { 202606, true },
+  { 202616, true },
+  { 202628, true },
+  { 202641, true },
+  { 202654, true },
+  { 202669, true },
+  { 202688, true },
+  { 202703, true },
+  { 202715, true },
+  { 202726, true },
+  { 202748, true },
+  { 202764, true },
+  { 202784, true },
+  { 202793, true },
+  { 202801, true },
+  { 202809, false },
+  { 202821, true },
+  { 202834, true },
+  { 202846, true },
+  { 202858, true },
+  { 202873, true },
+  { 202883, true },
+  { 202894, true },
+  { 202910, true },
+  { 202919, true },
+  { 202928, true },
+  { 202937, true },
+  { 202952, true },
+  { 202961, true },
+  { 202972, true },
+  { 202986, true },
+  { 202998, true },
+  { 203011, true },
+  { 203019, false },
+  { 203031, true },
+  { 203045, true },
+  { 203057, true },
+  { 203064, true },
+  { 203072, true },
+  { 203080, true },
+  { 203090, true },
+  { 203099, true },
+  { 203112, true },
+  { 203117, true },
+  { 203127, true },
+  { 203134, true },
+  { 203141, true },
+  { 203153, false },
+  { 203172, true },
+  { 203188, true },
+  { 203203, true },
+  { 203218, true },
+  { 203231, true },
+  { 203244, true },
+  { 203252, true },
+  { 203262, true },
+  { 203272, true },
+  { 203285, true },
+  { 203298, true },
+  { 203315, true },
+  { 203323, true },
+  { 203332, true },
+  { 203345, true },
+  { 203357, true },
+  { 203387, true },
+  { 203398, true },
+  { 203416, true },
+  { 203424, true },
+  { 203448, true },
+  { 203458, true },
+  { 203470, true },
+  { 203481, true },
+  { 203493, true },
+  { 203511, true },
+  { 203520, true },
+  { 203531, true },
+  { 203543, true },
+  { 203551, true },
+  { 203558, true },
+  { 203566, true },
+  { 203577, true },
+  { 203587, true },
+  { 203596, true },
+  { 203605, true },
+  { 203630, true },
+  { 203642, true },
+  { 203662, true },
+  { 203684, true },
+  { 203695, true },
+  { 203706, true },
+  { 203719, true },
+  { 203734, true },
+  { 203752, true },
+  { 203765, true },
+  { 203781, true },
+  { 203799, true },
+  { 203813, true },
+  { 203823, true },
+  { 203835, true },
+  { 203847, true },
+  { 203859, true },
+  { 203870, true },
+  { 203882, true },
+  { 203895, true },
+  { 203908, true },
+  { 203920, true },
+  { 203932, true },
+  { 203943, false },
+  { 203953, true },
+  { 203964, true },
+  { 203979, true },
+  { 203992, true },
+  { 204003, true },
+  { 204013, true },
+  { 204029, true },
+  { 204044, true },
+  { 204057, true },
+  { 204069, true },
+  { 204082, true },
+  { 204097, true },
+  { 204104, true },
+  { 204119, true },
+  { 204131, true },
+  { 204140, true },
+  { 204152, true },
   { 204160, true },
-  { 204169, true },
-  { 204181, true },
-  { 204189, true },
-  { 204198, false },
-  { 204206, true },
-  { 204217, true },
-  { 204225, true },
-  { 204236, true },
-  { 204247, true },
+  { 204169, false },
+  { 204177, true },
+  { 204188, true },
+  { 204196, true },
+  { 204207, true },
+  { 204218, true },
+  { 204233, true },
+  { 204250, false },
   { 204262, true },
-  { 204279, false },
-  { 204291, true },
-  { 204310, true },
-  { 204328, true },
+  { 204281, true },
+  { 204299, true },
+  { 204319, true },
+  { 204331, true },
+  { 204341, true },
   { 204348, true },
-  { 204360, true },
-  { 204370, true },
-  { 204377, true },
-  { 204388, true },
-  { 204398, true },
-  { 204404, true },
-  { 204419, true },
-  { 204429, true },
-  { 204444, true },
-  { 204456, true },
-  { 204463, true },
-  { 204474, true },
-  { 204487, true },
+  { 204359, true },
+  { 204369, true },
+  { 204375, true },
+  { 204390, true },
+  { 204400, true },
+  { 204415, true },
+  { 204427, true },
+  { 204434, true },
+  { 204445, true },
+  { 204458, true },
+  { 204482, true },
+  { 204489, true },
+  { 204500, true },
   { 204511, true },
-  { 204518, true },
   { 204529, true },
-  { 204540, true },
-  { 204558, true },
-  { 204571, true },
-  { 204586, true },
-  { 204602, true },
-  { 204613, true },
-  { 204629, true },
-  { 204653, true },
+  { 204542, true },
+  { 204557, true },
+  { 204573, true },
+  { 204584, true },
+  { 204600, true },
+  { 204624, true },
+  { 204639, true },
+  { 204649, true },
+  { 204657, true },
   { 204668, true },
   { 204678, true },
-  { 204686, true },
-  { 204697, true },
+  { 204688, true },
+  { 204699, true },
   { 204707, true },
-  { 204717, true },
-  { 204728, true },
-  { 204736, true },
-  { 204750, true },
-  { 204762, true },
-  { 204776, true },
-  { 204785, true },
-  { 204799, true },
-  { 204807, true },
-  { 204820, true },
-  { 204834, true },
-  { 204855, true },
-  { 204865, true },
-  { 204872, true },
-  { 204883, true },
-  { 204893, true },
-  { 204906, true },
-  { 204914, true },
-  { 204923, true },
-  { 204936, true },
-  { 204949, true },
+  { 204721, true },
+  { 204733, true },
+  { 204747, true },
+  { 204756, true },
+  { 204770, true },
+  { 204778, true },
+  { 204788, true },
+  { 204801, true },
+  { 204815, true },
+  { 204836, true },
+  { 204846, true },
+  { 204853, true },
+  { 204864, true },
+  { 204874, true },
+  { 204887, true },
+  { 204895, true },
+  { 204904, true },
+  { 204917, true },
+  { 204930, true },
+  { 204941, true },
+  { 204951, true },
   { 204960, true },
   { 204970, true },
-  { 204979, true },
-  { 204989, true },
 };

From 73257d54c0c585d27df13e2c93ff583a63b84a46 Mon Sep 17 00:00:00 2001
From: ffxbld 
Date: Tue, 20 Dec 2016 06:27:02 -0800
Subject: [PATCH 70/70] No bug, Automated HPKP preload list update from host
 bld-linux64-spot-386 - a=hpkp-update

---
 security/manager/ssl/StaticHPKPins.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/security/manager/ssl/StaticHPKPins.h b/security/manager/ssl/StaticHPKPins.h
index ba7b4d243e74..a50441762ed2 100644
--- a/security/manager/ssl/StaticHPKPins.h
+++ b/security/manager/ssl/StaticHPKPins.h
@@ -1149,4 +1149,4 @@ static const TransportSecurityPreload kPublicKeyPinningPreloadList[] = {
 
 static const int32_t kUnknownId = -1;
 
-static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1490624496399000);
+static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1490711032213000);