0
Commit Graph

4804 Commits

Author SHA1 Message Date
Austin Sullivan
00d34c8c94 Revert "Add memory alignment parameter to gpu::Buffer"
This reverts commit 2b034ff051.

Reason for revert: broke MSAN bots. See https://crbug.com/1434472

Original change's description:
> Add memory alignment parameter to gpu::Buffer
>
> Bug: 1426766
> Change-Id: I0902bf42975ca0a1bb967208fa51e42f4a74392e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4377798
> Commit-Queue: Sergey Pashaev <bioh@yandex-team.ru>
> Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1131990}

Bug: 1426766
Change-Id: I80d49b1f5712cd50e63f041feac79e9415349aad
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4443370
Reviewed-by: Meredith Lane <meredithl@chromium.org>
Auto-Submit: Austin Sullivan <asully@chromium.org>
Owners-Override: Austin Sullivan <asully@chromium.org>
Commit-Queue: Meredith Lane <meredithl@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1132321}
2023-04-19 04:40:11 +00:00
Sergey Pashaev
2b034ff051 Add memory alignment parameter to gpu::Buffer
Bug: 1426766
Change-Id: I0902bf42975ca0a1bb967208fa51e42f4a74392e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4377798
Commit-Queue: Sergey Pashaev <bioh@yandex-team.ru>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1131990}
2023-04-18 16:53:37 +00:00
Tom Sepez
55354070d4 Convert PendingSyncMessage::deserializer to std::unique_ptr<>
Follow-on from https://crrev.com/c/4397638, clarifies ownership
of the deserializer.

Change-Id: I2af0a2c42bbc3fe3091254a3d3a72d81756350f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4400765
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1127251}
2023-04-06 16:58:46 +00:00
Fabian Sommer
dea7878c24 Buganizer components for NaCl
Update dir_metadata to use Buganizer component IDs instead of the
(deprecated) Monorail ones.

Bug: none
Change-Id: I15e77da8b3a49c4f640617fb779cd36ddcdb652c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4065984
Reviewed-by: Mark Seaborn <mseaborn@chromium.org>
Commit-Queue: Fabian Sommer <fabiansommer@chromium.org>
Reviewed-by: Sam Clegg <sbc@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1126485}
2023-04-05 11:57:52 +00:00
Will Harris
e505cd2eb7 Remove duplicate entry in ppapi/BUILD.gn
tests/test_utils.h ended up being specified twice by accident.

BUG=None

Change-Id: I165aa3185a8783bd2ce167e419c751a8d05e7676
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4328529
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Commit-Queue: Will Harris <wfh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1115887}
2023-03-10 20:39:57 +00:00
Peter Kasting
2bc4262b86 Use thread_local: ppapi/
Bug: 1416710
Change-Id: I360427556821a60848dccf45f1610032e979e017
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4317179
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Derek Schuff <dschuff@chromium.org>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1114342}
2023-03-08 02:02:31 +00:00
Avi Drissman
d2a736f985 Remove base::Value::Type::DICTIONARY
It is deprecated in favor of base::Value::Type::DICT, so change uses
of it to the new name and remove the enum value.

Fixed: 1291670
Change-Id: I26136fcb723e7dff1f5ffe3990d7011b18c16a43
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4198081
Auto-Submit: Avi Drissman <avi@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1098238}
2023-01-28 02:31:26 +00:00
Avi Drissman
821ca309ed Update header includes for /base/functional in /p*
bind.h, callback.h, callback_forward.h, and callback_helpers.h
moved into /base/functional/. Update the include paths to
directly include them in their new location.

Bug: 1364441
Change-Id: I36784c7cc322001d0b0ec2590c3847f4298033ad
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4157596
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1091526}
2023-01-11 22:42:15 +00:00
Jean-Philippe Gravel
8a1cee6395 Add missing ostream include.
This file has a transitive dependency on ostream via
base/numerics/safe_conversions.h. The ostream include in
safe_conversions.h is however unused and should be removed.

The <ostream> include is needed by the `CHECK*(...) << "..."`
statements. base/check.h only forward declares <ostream> by
including <iosfwd>. The documentation in base/check.h mentions:

// Additional information can be streamed to these macros and will be included
// in the log output if the condition doesn't hold (you may need to include
// <ostream>):
//
//   CHECK(condition) << "Additional info.";

Change-Id: Id5f31c2ca010936bbae2aa512527940247cc787c
Bug: 1270812, 1372522
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4152491
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Commit-Queue: Jean-Philippe Gravel <jpgravel@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1091466}
2023-01-11 20:19:36 +00:00
Sean Maher
e672a665ff task posting v3: remove includes of runner handles and IWYU task runners
Turns out there's a lot of includes, so these will have to be removed
before deleting the implementation of the task runner handles.

To allow the deletion of the task runner handle headers, add
the sequenced/thread task runner handles where they are used in
the codebase with scripts.

This was done with an automated change, with a few touchups afterwards.
The code for the mass-refactor changes are here:
python:
https://paste.googleplex.com/5534570878337024
shell:
https://paste.googleplex.com/6466750748033024

In terms of touchups:
- add sequenced/thread task runner handles to
  the third_party/blink/public/DEPS, because multiple files were using
  it transitively anyways.
- rewrite certain parts of the codebase which used
  ThreadTaskRunnerHandles instead of CurrentDefaultHandles.
- fix a compile issue with forward-declaration in
  extensions/browser/extension_file_task_runner.h.

AX-Relnotes: n/a.
Bug: 1026641
Change-Id: I737ef32aee4e77c21eaa3a2bdc403a28322cf1b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4133323
Owners-Override: Gabriel Charette <gab@chromium.org>
Commit-Queue: Sean Maher <spvw@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1090532}
2023-01-09 21:42:28 +00:00
Vasiliy Telezhnikov
ca6b035ed7 Plumb PPAPISharedImagesSwapChainAllowed policy to nacl
This CL changes flow how all relevant parts decide to use new feature:
Before this CL every part would be querying
kDisablePPAPISharedImagesSwapChain command line flag and
PPAPISharedImagesSwapChain feature flag independently.

It's very complicated and error prone to apply this with enterprise
policy which is available only in browser process and needs to be
communicated via command line flags.

To simplify this now we query flag/feature only in the renderer
process. The value is communicated to nacl process during
initialization of Graphics3D via gpu::Capabilities. GPU process is now
ready to handle both flows.

Bug: 1342033
Change-Id: I5f0fd2ef5f63d4429c9ca273c8777d63ee462597
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4108070
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Reviewed-by: ccameron chromium <ccameron@chromium.org>
Reviewed-by: Joe Mason <joenotcharles@google.com>
Commit-Queue: Vasiliy Telezhnikov <vasilyt@chromium.org>
Reviewed-by: Jonathan Ross <jonross@chromium.org>
Reviewed-by: Dominic Farolino <dom@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1084280}
2022-12-16 13:42:04 +00:00
Garrett Beaty
5d93ada07b Remove references to /opt/chromium/chrome_sandbox.
Based on https://crbug.com/312380, it is no longer necessary to
provide a setuid sandbox, but the testing code is still setting it to
/opt/chromium/chrome_sandbox. This is a non-hermetic binary that is
installed to the test machines via puppet. If the setuid sandbox
environment variable is set, it causes fatal error if it is set to a
non-existent file, which can happen if setup on an Android machine fails
since this results in it reporting itself as a Linux machine and it does not contain the sandbox binary. Since the binary is not actually
necessary, this removes an unnecessary failure mode from the automated
testing.

Bug: 1334743
Change-Id: I1155d8e77e2417b34bf1a03afbb6e821bb4ecb85
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4077067
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Commit-Queue: Garrett Beaty <gbeaty@google.com>
Reviewed-by: Mark Seaborn <mseaborn@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1079418}
2022-12-05 21:32:24 +00:00
Vasiliy Telezhnikov
2e6fab1284 Use shared images for NaCl SwapChain
This CL implements SetDefaultFramebufferSharedImage IPC on the command
buffer that allows callers to set SharedImage and associated params
like need of depth/stencil buffer and samples count to the default
framebuffer (fbo 0).

NaCL host side maintains pool of SharedImages that it uses with new
IPC to draw to the framebuffer.

Both sides are guarded by feature flag (kPPAPISharedImagesSwapChain) and
command line flag  (kDisablePPAPISharedImagesSwapChain) that can veto
the feature flag. Extra command line is needed for enterprise policy.

Bug: 1342033
Change-Id: Iccf800d1bbe8dcd1f168272651ae32c27833c2ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4006326
Reviewed-by: Sunny Sachanandani <sunnyps@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Commit-Queue: Vasiliy Telezhnikov <vasilyt@chromium.org>
Reviewed-by: Joe Mason <joenotcharles@google.com>
Reviewed-by: Kyle Charbonneau <kylechar@chromium.org>
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1078120}
2022-12-01 17:08:04 +00:00
Bruce Dawson
ab3294e286 Add zero back to ppapi/PRESUBMIT.py
While looking at the presubmit --all bot's output for easy fixes I
noticed a huge number of errors of this form - 689 in total as it turns
out:

  PPAPI Interface modified without updating NaCl SDK.
  (note that some dev interfaces should not be added the NaCl SDK; when in doubt, ask a ppapi OWNER.
  To ignore a file, add it to IGNORED_FILES in native_client_sdk/src/build_tools/verify_ppapi.py)

  usage: verify_ppapi.py [-h] sources [sources ...]
  verify_ppapi.py: error: the following arguments are required: sources

I focused on the first paragraph, which was unfortunate because the
second paragraph was trying to give me a hint. I couldn't reproduce the
errors on Windows so I switched to Linux, and eventually it all made
sense.

Change crrev.com/c/3810377 (which I reviewed) deleted the zero from
this line:
  range(0, len(nacl_sdk_files), files_per_command):
This changed it to:
  range(len(nacl_sdk_files), files_per_command):

Unfortunately that causes the checks to be skipped on Windows, and to
run as NOPs on Linux, roughly ~700 times, because nacl_sdk_files has
about 300 entries, and files_per_command is 25 on Windows and 1,000
elsewhere.

Easy fix. Put the zero back.

Bug: 1222512
Change-Id: Ie2aad6f4130089547e6cde0f9c6291e44bc106c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4065121
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Auto-Submit: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Derek Schuff <dschuff@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1077236}
2022-11-30 02:46:52 +00:00
Sean Maher
a539a158cb Task posting v3: refactor base::PostTaskAndReplyWithResult
Change all instances of base::PostTaskAndReplyWithResult(task_runner
to task_runner->PostTaskAndReplyWithResult(.

This also removes includes of base/task/task_runner_util.h, but only
in the files with 'base::PostTaskAndReplyWithResult' which don't refer
to PostTaskAndReplyWithResult in other places.

Code was refactored with the following scripts:
python script:
https://paste.googleplex.com/5117849478627328
shell script:
https://paste.googleplex.com/4961540519231488

Bug: 1026641
Change-Id: Ifb34b3b9078440dda5902b0d694cb8d3f315dfe7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3892903
Commit-Queue: Sean Maher <spvw@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Owners-Override: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1076288}
2022-11-28 18:13:41 +00:00
Matt Menke
a59180fff2 Update base::Value usage in ppapi/shared_impl/private
In particular, use base::Value::List to access lists, instead of
deprecated accessors on base::Value. Also pass Values by value instead
of using unique_ptrs.

Bug: 1338341
Change-Id: Ic162ddd5d9caec454a725d66e3352c5a30167090
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4060546
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Commit-Queue: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1076236}
2022-11-28 16:29:01 +00:00
Sean Maher
5b9af51fdd task posting v3: moving away from ThreadTaskRunnerHandle
To continue the migration away from TaskRunnerHandles, the codebase
was refactored using the following scripts:
shell script:
https://paste.googleplex.com/4673967729147904
python:
https://paste.googleplex.com/5824001174667264

This will do a few sed-like modifications, changing calls to methods of
ThreadTaskRunnerHandle to calls to methods of
SingleThreadTaskRunner::CurrentDefaultHandle, and swapping includes.

Bug: 1026641
AX-Relnotes: n/a.
Change-Id: Ia33b6dfebb15937481c619f5c838720ce7bb2676
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4031817
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Owners-Override: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1074085}
2022-11-21 15:32:47 +00:00
Lei Zhang
a3ba1210f7 Swap ref_counted.h for scoped_refptr.h when appropriate in //ppapi.
At some point, scoped_refptr got split off into its own header. Use it
in //ppapi headers when appropriate.

Bug: 1381627
Change-Id: Ie5b6b3cb2800e73b7bb801bc1e8218aa6848cb40
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4011499
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1071907}
2022-11-15 23:41:31 +00:00
Lei Zhang
cc67230216 Remove unnecessary base/memory/ref_counted.h includes from headers.
Header files that do not contain "RefCounted" and do not contain
scoped_refptr do not need to include base/memory/ref_counted.h. Remove
it and do IWYU to fix the build.

Bug: 242216
Change-Id: Ie70e43b0c926b8ef610419c99f43eea991ac8d81
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4005763
Reviewed-by: Kyle Charbonneau <kylechar@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Owners-Override: Kyle Charbonneau <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1067592}
2022-11-04 18:28:16 +00:00
Avi Drissman
db497b3200 Update copyright headers in pdf/, ppapi/, printing/
The methodology used to generate this CL is documented in
https://crbug.com/1098010#c95.

No-Try: true
Bug: 1098010
Change-Id: I6ae92e5d7ccbf73b176588124b2f8b4067f805b3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3900575
Reviewed-by: Mark Mentovai <mark@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1047628}
2022-09-15 19:47:28 +00:00
Avi Drissman
05dfbc82b0 Update copyright headers in gpu/ (and generated ppapi/ files)
The methodology used to generate this CL is documented in
https://crbug.com/1098010#c34.

No-Try: true
Bug: 1098010
Change-Id: I30614b78d270d4fc3e347b925efa26033eacd472
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3891044
Auto-Submit: Avi Drissman <avi@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1046576}
2022-09-13 21:25:34 +00:00
Christian Flach
a79ba474e1 Use SequenceChecker macros: /ppapi/proxy
Using the macros instead of directly using `SequenceChecker` results in
smaller binaries and decreased memory usage. Most code already uses the
macros. This CL is part of a series of CLs that fixes remaining usages.

This CL was uploaded by git cl split.

R=dschuff@chromium.org

Bug: none
Change-Id: I2b77c5d704b39d087529c3e3b002188c1915baf3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3883904
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Commit-Queue: Derek Schuff <dschuff@chromium.org>
Auto-Submit: Christian Flach <cmfcmf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1045215}
2022-09-09 17:57:32 +00:00
Mikhail Khokhlov
7dad5b2091 Fix PPAPI tracing test in Perfetto SDK build
Chrome is being migrated to the Perfetto tracing library, which
requires all categories to be statically declared. So we have to use
an existing category for test trace events.

Bug: b/214976389
Change-Id: I84390138a7c2b407d7749a26f3bf8eb79f1fd558
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3864557
Commit-Queue: Mikhail Khokhlov <khokhlov@google.com>
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1043130}
2022-09-05 09:21:25 +00:00
K. Moon
0aa91ecd41 [fuchsia] Fully enable PDF support
Enables working PDF support on Fuchsia by setting enable_plugins=true
(but enable_ppapi=false); enable_pdf is already true for Fuchsia.

As a workaround, this change uses plugins_linux.json for the
IDR_PLUGIN_DB_JSON resource required by PluginFinder. This should be
harmless, since this file only has entries for Flash (which is
deprecated) and the PDF viewer (which we want). PluginFinder eventually
should be removed completely (see crbug.com/1064647).

Fixed: 1273277
Fuchsia-Binary-Size: Unavoidable //content increase due to plugins.
Change-Id: I4dd4680261fdca934780589dea745aceeec48949
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3827815
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: David Dorwin <ddorwin@chromium.org>
Commit-Queue: K. Moon <kmoon@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1038382}
2022-08-23 19:25:25 +00:00
Fabian Sommer
295fb5d0b8 NaCl on ARM64: Remove dependencies on //skia
NaCl cannot depend on //skia when building for ARM64, as in that build
some libraries are not present in the 32-bit version that NaCl needs.

Therefore, build some (parts of) files only in builds that are not for
nacl_helper.

Introduce a new buildflag IS_MINIMAL_TOOLCHAIN. This is to limit
dependencies in .h/.cc files if we build nacl_helper for ARM64.
Use nogncheck for such conditional includes as gn does not run the
preprocessor.

Test: Build nacl_helper for Linux ARM64
Bug: 1339021
Change-Id: Id95147bc134e34fbae91af3d540ed30a4e96b512
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3829145
Reviewed-by: Mustafa Emre Acer <meacer@chromium.org>
Commit-Queue: Fabian Sommer <fabiansommer@chromium.org>
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Reviewed-by: Mark Seaborn <mseaborn@chromium.org>
Reviewed-by: vikas soni <vikassoni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1037644}
2022-08-22 10:25:04 +00:00
Fabian Sommer
4156662c71 NaCl on ARM64: Remove dependencies on //net
NaCl cannot depend on //net when building for ARM64, as in that build
some libraries are not present in the 32-bit version that NaCl needs.

Introduce is_minimal_toolchain build variable to distinguish our special
nacl_helper build.

Bug: 1339021
Change-Id: Ic1d37002e16c2a7a8e2479a39463454f805633c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3819701
Reviewed-by: Mark Seaborn <mseaborn@chromium.org>
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Commit-Queue: Fabian Sommer <fabiansommer@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1036017}
2022-08-17 13:00:13 +00:00
William Liu
9a67ce37ef [CodeHealth] Migrate PPAPI/PRESUBMIT.py to Python3.
This CL represents some minimal effort to un-block the codebase wide
migration of PRESUBMIT.py to Python3. It does not migrate the full suite
of PPAPI to Python3.

Tested with `git cl presubmit --force --file "ppapi/*" --verbose` and no
Python related warnings/errors.

Bug: 1222512
Change-Id: Ic121d5ea10284f13c78e517cd49f631ccb70744c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3810377
Commit-Queue: William Liu <liuwilliam@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1032529}
2022-08-08 13:47:44 +00:00
Lei Zhang
2b75f48f84 Fix typos for the word "propagated".
Fix this typo across the code base to quell Tricium SpellChecker
warnings.

Change-Id: I8d1faee3117d121a0b16e857843fb1cbe8252858
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3810768
Owners-Override: Erik Staab <estaab@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Erik Staab <estaab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1032172}
2022-08-05 23:44:08 +00:00
K. Moon
f17e216ac7 Switch //ppapi to use enable_ppapi
Switches //ppapi to the PPAPI-specific enable_ppapi arg, rather than the
more general enable_plugins arg.

Bug: 1306610
Change-Id: Id3b1723d41f9c381f9a567325d7ad830d60c4599
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3750107
Commit-Queue: Derek Schuff <dschuff@chromium.org>
Auto-Submit: K. Moon <kmoon@chromium.org>
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1025398}
2022-07-18 20:59:42 +00:00
K. Moon
fd77c49719 Add enable_ppapi GN arg
Adds an "enable_ppapi" GN arg distinct from the "enable_plugins" GN arg.
This allows separating plugin support (required by the PDF viewer) from
Pepper API support (which is not supported on platforms like Fuchsia).

Bug: 1306610
Change-Id: I574e391d06e56167949bb991d42c7c314fc166fc
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3733394
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Commit-Queue: K. Moon <kmoon@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1019785}
2022-06-30 19:58:53 +00:00
Peter Kasting
28b51cf40e Reland: Prevent unsafe narrowing: base/
This relands
https://chromium-review.googlesource.com/c/chromium/src/+/3717404 .

Bug: 1292951
Change-Id: I79a1d884d297903886cf3d8819f8962ba250ccb9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3727447
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Owners-Override: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1018684}
2022-06-28 15:02:43 +00:00
Jeroen Dhollander
d13a4eaa16 Revert "Prevent unsafe narrowing: base/"
This reverts commit 5d4fcae17b.

Reason for revert: Breaks MSAN build. See crbug/1339749

Original change's description:
> Prevent unsafe narrowing: base/
>
> Bug: 1292951
> Change-Id: I17b223cfd5bd63752a20b36ffb446d4dc63a2733
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3717404
> Reviewed-by: danakj <danakj@chromium.org>
> Commit-Queue: Peter Kasting <pkasting@chromium.org>
> Reviewed-by: Tom Sepez <tsepez@chromium.org>
> Auto-Submit: Peter Kasting <pkasting@chromium.org>
> Owners-Override: danakj <danakj@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1017830}

Bug: 1292951
Bug: 1339749
Change-Id: I210221bb692ae43bc9d2aaa31ff8117bea8405d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3726010
Commit-Queue: Jeroen Dhollander <jeroendh@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Jeroen Dhollander <jeroendh@google.com>
Cr-Commit-Position: refs/heads/main@{#1018171}
2022-06-27 11:03:47 +00:00
Nico Weber
9f1ced58b8 Remove more sprintf calls
Bug: 1334739
Change-Id: Idb165eacfcb07d7e5e272f3cf478ee078cf4da21
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3721605
Owners-Override: Nico Weber <thakis@chromium.org>
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1017979}
2022-06-25 18:04:49 +00:00
Peter Kasting
5d4fcae17b Prevent unsafe narrowing: base/
Bug: 1292951
Change-Id: I17b223cfd5bd63752a20b36ffb446d4dc63a2733
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3717404
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Owners-Override: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1017830}
2022-06-24 21:14:38 +00:00
Frédéric Wang
2929547904 Fix some compilation errors with deprecated sprintf function
This commit modifies sprintf calls to fix the following compilation
errors using XCode 14.0 beta on MacOS:

> 'sprintf' is deprecated: This function is provided for compatibility
> reasons only.  Due to security concerns inherent in the design of
> sprintf(3), it is highly recommended that you use snprintf(3) instead.

Bug: 1334739
Change-Id: Id4df7e320860ed0b5ecc3efd6b6647dcc8200a33
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3716608
Owners-Override: Nico Weber <thakis@chromium.org>
Commit-Queue: Frédéric Wang <fwang@igalia.com>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1016704}
2022-06-22 14:20:03 +00:00
Ryan Keane
bb021506e3 [Cast Convergence] Remove is_chromecast from missed places
This CL updates code previously missed when either filing
crbug.com/1293594 or in a past Cast Convergence CL
(https://chromium-review.googlesource.com/q/hashtag:cast-convergence)
to remove is_chromecast and replace it with new `is_castos`,
`is_cast_android` and `enable_cast_receiver` flags as appropriate,
which signify either "a nest chromecast-hardware device", "an android
cast receiving hardware device", or "a platform which can act as a cast
receiver" (such as ATV, Fuchsia, etc) respectively.

Bug: 1219802, 1293594
Change-Id: I50b2ba171fb3ece00e09f278073ac2591c584816
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3700681
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Mark Foltz <mfoltz@chromium.org>
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Ryan Keane <rwkeane@google.com>
Reviewed-by: David Dorwin <ddorwin@chromium.org>
Reviewed-by: Sunny Sachanandani <sunnyps@chromium.org>
Reviewed-by: Gary Kacmarcik <garykac@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1014940}
2022-06-16 16:15:17 +00:00
Kenneth Russell
042ad65fa4 Guard against too-large arrays passed to uniform*v.
Catch situations where computing the byte size of the incoming array
would overflow.

Beyond this, detect failures to allocate space in CommandBufferHelper.
In this situation, persistently lose the context client-side. Remove
DCHECKs preventing these guards from being reached.

Add new feature to disable ArrayBuffer size restrictions for testing.
Use it in the new test; it is required for it to pass.

Bug: 1316368
Bug: 1201109
Change-Id: Ic345aed296e2d9a3f44e33c4c207e12b64c4f312
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3688833
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Gregg Tavares <gman@chromium.org>
Reviewed-by: Victor Miura <vmiura@chromium.org>
Reviewed-by: Martin Kreichgauer <martinkr@google.com>
Cr-Commit-Position: refs/heads/main@{#1014267}
2022-06-15 02:45:05 +00:00
Peter Kasting
2d40b0f239 Prevent unsafe narrowing: base/files
Bug: 1292951
Change-Id: Ie7489503b41003ec3f4ec97991b39e4d82009c58
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3691384
Reviewed-by: danakj <danakj@chromium.org>
Owners-Override: danakj <danakj@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1011590}
2022-06-07 18:55:25 +00:00
kylechar
009417ac0a Remove GLRenderer related GL extensions
Delete CHROMIUM GL extensions that were added for swap, presentation and
overlay control from GLRenderer. These extensions are no longer needed
now that GLRenderer has been deleted.

Bug: 1247756
Change-Id: I9df77e118cd4798713dc2684566f0f5eba06006b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3669573
Reviewed-by: Sunny Sachanandani <sunnyps@chromium.org>
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Commit-Queue: Kyle Charbonneau <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1009927}
2022-06-02 03:28:25 +00:00
Peter Kasting
cc7469c57a Uncomment prevent_unsafe_narrowing and change from opt-out to opt-in.
This config will take extreme effort to apply, so it makes sense to
start by opting in individual targets.

Bug: 1292951
Change-Id: Ida311bdc17fde8b8adf2c6a231a676d253cf5d8f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3669207
Reviewed-by: danakj <danakj@chromium.org>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Owners-Override: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1007928}
2022-05-26 18:59:10 +00:00
Bruce Dawson
a466dc2ea8 Run verify_ppapi.py under Python 3
verify_ppapi.py was already Python 3 compatible but was still being run
under Python 2 because python_executable was specified instead of
python3_executable. This changes that.

Bug: 1313804
Change-Id: Ia353fd8133dc786a49c90fd4ce4983fe356b146c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3648886
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Auto-Submit: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Derek Schuff <dschuff@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1003791}
2022-05-16 16:36:01 +00:00
Peter Kasting
13fea73ef8 Fix for C++20 support.
Math between enums and floats is deprecated.  Insert an explicit cast.

Bug: 1284275
Change-Id: I62208d70fb9d997896e496f7610861c945630a7e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3630977
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Commit-Queue: Derek Schuff <dschuff@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1000544}
2022-05-06 20:35:13 +00:00
kylechar
56c239dea5 Delete CHROMIUM_image extension
CreateImageCHROMIUM() is no longer used. Delete the extension and all
GLES2Interface functions related to it. Also delete plumbing through
various layers of GPU and IPC code related to it.

Remove references to the extension from other extensions as well.

Bug: 1216120
Change-Id: Ia55ad5d2f85f27c9d337ac928daf5fc614dc9b75
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3582497
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Commit-Queue: Kyle Charbonneau <kylechar@chromium.org>
Reviewed-by: Sunny Sachanandani <sunnyps@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#999958}
2022-05-05 17:35:49 +00:00
Bruce Dawson
3fef963819 Change PPAPI TODO error to a warning
Three PPAPI header files TODOs that have been there for a while. In
order to allow "git cl presubmit --all" to run without errors the error
regarding these needs to be downgraded to a warning. This error/warning
can most easily be reproduced with this command:

    git cl presubmit --files=ppapi\cpp\graphics_2d.h;ppapi\cpp\input_event.h;ppapi\cpp\module.h

If the TODOs get removed then this could be upgraded back to an error,
but a warning is probably fine even then.

Bug: 1309977
Change-Id: I561dc9660dd9eb41a6357632b698b15af3ffd605
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3606316
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#996439}
2022-04-26 23:56:16 +00:00
David Dorwin
fb712813be [ppapi] Assert plugins are enabled in PPAPI GN files.
Only //ppapi/buildflags should ever be reached when !enable_plugins.

This required moving some deps to `if (enable_plugins)` blocks.

Bug: 1306610, 1311822
Test: gn check out/fuchsia && gn check out/linux
Change-Id: I51fe19c4d1582fa4e572424e33eff1edcf14b2b3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3561898
Commit-Queue: David Dorwin <ddorwin@chromium.org>
Auto-Submit: David Dorwin <ddorwin@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Commit-Queue: Derek Schuff <dschuff@chromium.org>
Cr-Commit-Position: refs/heads/main@{#995895}
2022-04-26 01:36:51 +00:00
kylechar
9bf308380b Convert command buffer autogen to python3
The python scripts to generate GLES2/raster/WebGPU command buffer was
still running with vpython which is 2.7. Update the PRESUBMIT to run
with python3 and fix python3 compatibility issues.

Bug: none
Change-Id: Ibe11208afb11bfe9870dc261865a7c909f76bde2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3577186
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Commit-Queue: Kyle Charbonneau <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#991501}
2022-04-12 13:59:44 +00:00
Bruce Dawson
3bea29fa4b Avoid command-length limits in ppapi presubmit
When running "git cl presubmit --all" command-line length limit errors
were found in CheckUpdatedNaClSDK - the command line exceeded the
cmd.exe limit of 8191 characters. This can most easily be seen by
running this command:

    git cl presubmit --files=ppapi\* --force -v

See crrev.com/c/3554633 for another example of fixing this issue.

Bug: 1309977
Change-Id: I08d5bb6cc8ba14739a12b26e0b2a756362e0c50f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3579096
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#991281}
2022-04-12 00:03:20 +00:00
Mark Seaborn
0040a61bca NaCl on ARM64: Fix crash caused by the IRT being built with the wrong flags
In some cases, the IRT was getting built with is_nacl_irt set to
false.  In those cases, the compiler flags set by
build/config/nacl/BUILD.gn (by :compiler_codegen and :irt_optimize)
were not being applied.

This fixes two cases where the IRT architecture is different from the
chrome executable's architecture:

1) ARM32 NaCl in ARM64 Chromium (on Linux or Chrome OS).  The problem
causes "-fasynchronous-unwind-tables" to be omitted, which creates an
IRT that leads to a crash when running the test
PPAPINaClNewlibTest.PostMessage.  The output I got from the test was:

...
[1,4142801984:00:05:39.834116] NaClSysThreadCreate: Bad function pointer
[1,4142801984:00:05:39.834221] NaClSysThreadCreate: Bad function pointer
[1,4142801984:00:05:39.834255] NaClSysThreadCreate: Bad function pointer
[1,4142801984:00:05:39.834285] NaClSysThreadCreate: Bad function pointer
** Signal 11 from untrusted code: pc=1d3474
[1903:1903:0405/000539.939548:ERROR:nacl_process_host.cc(265)] NaCl process exited with status 62720 (0xf500)

I am not sure why that happens, but it looks like an ARM-specific
problem, maybe a miscompile.

2) x86-64 NaCl in Windows x86-32 Chromium.  There don't seem to be any
correctness problems in this case, but having is_nacl_irt==false
causes the IRT to be built with "-O2" instead of "-Os", which makes it
larger than necessary.  The lack of "-fasynchronous-unwind-tables"
shouldn't make a difference because "-fasynchronous-unwind-tables" is
the default on x86-64.

Fix by using current_cpu instead of target_cpu.

Remove an unnecessary assignment to is_nacl_cpu.

Add an assertion as a consistency check to catch the problem of
is_nacl_irt being false.

Bug: 1299021
Test: I ran the test above on ARM64 Ubuntu on a Raspberry Pi
Change-Id: I4f4966bd8fa5359527ab8b91152048e584ed0340
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3575687
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Mark Seaborn <mseaborn@chromium.org>
Cr-Commit-Position: refs/heads/main@{#990482}
2022-04-08 17:42:50 +00:00
Mark Seaborn
cf606efaaa NaCl: Implement building nacl_helper as ARM32 in ARM64 builds of Chromium
Also build nacl_helper_bootstrap the same way.

This uses the same pattern as in other BUILD.gn files: Change
loader/BUILD.gn so that when it's built for ARM64, it redirects to
itself to build with the ARM32 toolchain.  Its ARM64 invocation copies
the files from the ARM32 invocation.  This pattern is also used for
building the IRT and for building nacl64.exe on Windows.

Update pnacl_support_extension to use the right target CPU in ARM64
builds.

Bug: 1299021
Change-Id: I76b6d5635402ff06cbf2ca2e06ad64a7affad42b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3570399
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Commit-Queue: Mark Seaborn <mseaborn@chromium.org>
Cr-Commit-Position: refs/heads/main@{#989460}
2022-04-06 16:29:27 +00:00
David Sanders
685ead8607 Do IWYU for //base/observer_list.h
AX-Relnotes: n/a.
Bug: 242216
Change-Id: If1a448bd5e5c19ae0286052187d16e6670441a5d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3563940
Reviewed-by: Nico Weber <thakis@chromium.org>
Owners-Override: Nico Weber <thakis@chromium.org>
Commit-Queue: David Sanders <dsanders11@ucsbalum.com>
Cr-Commit-Position: refs/heads/main@{#988818}
2022-04-05 02:47:31 +00:00