This CL does code refactoring to make the intent of PdfAccessibilityTree
.zoom variable clear. It stores the product of pdf zoom and system dpi.
This change renames it to zoom_device_scale_factor.
This change also refactors the zoom variable name in
PP_PrivateAccessibilityViewportInfo to zoom_device_scale_factor.
Corresponding change is also made in OutOfProcessInstance to reflect
the variable name change.
Bug: 1007169
Change-Id: I0a9c22f386fb4859afc80d9f281f41a15935bb09
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1823337
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Ian Prest <iapres@microsoft.com>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Virender Singh <virens@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#705947}
This is a preparatory change for adding accessibility support for PDF
annotations. Currently, text, links and images within a PDF page are
supported in an accessibility context. These are passed as separate
parameters in Set/GetAccessibilityPageInfo methods exposed through the
Pepper API. When annotation support comes in, the number of parameters
would increase to 6 making those function calls unwieldy and requiring
additional extensions to the templated DispatchResourceCall function.
This change groups links and images into a new *PageObjects struct which
will also be the home for the upcoming representation of PDF
annotations.
Bug: 1008775
Change-Id: Icee1b9b17290614265be8c65c5b594d3a99fe767
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1831957
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Reviewed-by: Ian Prest <iapres@microsoft.com>
Commit-Queue: Kalpak Tapas <katapas@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#705481}
In CL:1730426 support for click action handling was added. In the struct
PP_PdfAccessibilityActionData two more members were added but the
members were not added in IPC_STRUCT in ppapi_messages.h file. Due to
this, the values were not being sent from the mimehandler process to the
plugin process. The default values for the members were being utilized
by the plugin process instead of the values in the mimehandler process.
Invoke on any link would always navigate to the first link of the page.
This CL adds the members in the IPC_STRUCT.
A test has been modified to invoke the second link instead of the first.
Bug: 981448, 1006729
Change-Id: I7b40753887916cd08a338c9d4c3c63f3dd432480
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1826743
Commit-Queue: Ankit Kumar 🌪️ <ankk@microsoft.com>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Ian Prest <iapres@microsoft.com>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701529}
Use C++ structs for the data structures instead of C structs. This way,
the caller can just pass in C++ data as is, and not worry about the C++
to C data conversion. PPAPI will do the conversion internally.
Bug: 981448
Change-Id: Ief9c97e4e50c9f70413da80db5a9131c1fdcc123
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1794247
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697125}
When converting PP_PrivateAccessibilityLink/ImageInfo to
PdfAccessibilityLink/ImageInfo, we used to first store it in a variable
and then emplace_back it. This caused the struct to be created twice.
Instead, we directly pass the C struct to emplace_back and it will
automatically call the appropriate constructor to create the C++ object
in place.
This way, the C++ object is only created once.
Bug: 981448
Change-Id: I1da00c47ac7dbab7057389d6850bcfcffa433cd5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1778596
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ian Prest <iapres@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#696867}
These tests were previously migrated from single-threaded MessageLoop to
a multi-threaded TaskEnvironment (then named ScopedTaskEnvironment) as
part of crbug.com/891670.
//base OWNERS decided in retrospect that it was better to keep a
single-threaded option for TaskEnvironment and introduced
SingleThreadTaskEnvironment. This CL retrofits that decision for
/ppapi.
This CL is a no-op if it passes CQ.
This CL was uploaded by git cl split.
R=raymes@chromium.org
Bug: 891670
Change-Id: If34abed08d559545ffa762cc495eb511e43eb435
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1786944
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Commit-Queue: Raymes Khoury <raymes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#693534}
This is a reland of 18947083c7
The move_source_file.py script's formatting rules incorrectly
formatted services/device/generic_sensor/platform_sensor_and_provider_unittest_win.cc
after all. But we also can't rely 100% on git cl format (crbug.com/997063)
so I ended up performing a git cl format && git add -up
(+interactive addition of missing blank line after foo.h when included
from top of foo.cc)
Also added
$ tools/git/move_source_file.py net/test/test_with_scoped_task_environment.h net/test/test_with_task_environment.h
Original change's description:
> [TaskEnvironment] Complete migration with header rename
>
> This is merely:
>
> $ tools/git/move_source_file.py base/test/scoped_task_environment.h base/test/task_environment.h
> $ tools/git/move_source_file.py base/test/scoped_task_environment.cc base/test/task_environment.cc
> $ tools/git/move_source_file.py base/test/scoped_task_environment_unittest.cc base/test/task_environment_unittest.cc
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.h content/public/test/browser_task_environment.h
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.cc content/public/test/browser_task_environment.cc
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle_unittest.cc content/public/test/browser_task_environment_unittest.cc
> $ tools/git/move_source_file.py ios/web/public/test/test_web_thread_bundle.h ios/web/public/test/web_task_environment.h
> $ tools/git/move_source_file.py ios/web/test/test_web_thread_bundle.cc ios/web/test/web_task_environment.cc
>
> and a few manual renames in DEPS files missed by the script
>
> This CL uses --bypass-hooks to avoid having to git cl format because
> many headers are being reordered by git cl format and it's too many to
> figure out in a no-op CL which ones are okay with it.
> windows.h for one should typically be first and another one of the
> reorderings in PS3 even caused a compile failure:
> https://chromium-review.googlesource.com/c/chromium/src/+/1764962/3/components/services/font/font_loader_unittest.cc
>
> TBR=dcheng@chromium.org
>
> Bug: 992483
> Change-Id: I32a4afd43ef779393c95d9873c157be2d3da1dd1
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764962
> Reviewed-by: Gabriel Charette <gab@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Commit-Queue: Gabriel Charette <gab@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#689778}
TBR=dcheng@chromium.org
Bug: 992483
Change-Id: I6179dd1329a4d30bf5c65450ea893537f31e6f85
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1767658
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689794}
This reverts commit 18947083c7.
Reason for revert: broke Win
Original change's description:
> [TaskEnvironment] Complete migration with header rename
>
> This is merely:
>
> $ tools/git/move_source_file.py base/test/scoped_task_environment.h base/test/task_environment.h
> $ tools/git/move_source_file.py base/test/scoped_task_environment.cc base/test/task_environment.cc
> $ tools/git/move_source_file.py base/test/scoped_task_environment_unittest.cc base/test/task_environment_unittest.cc
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.h content/public/test/browser_task_environment.h
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.cc content/public/test/browser_task_environment.cc
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle_unittest.cc content/public/test/browser_task_environment_unittest.cc
> $ tools/git/move_source_file.py ios/web/public/test/test_web_thread_bundle.h ios/web/public/test/web_task_environment.h
> $ tools/git/move_source_file.py ios/web/test/test_web_thread_bundle.cc ios/web/test/web_task_environment.cc
>
> and a few manual renames in DEPS files missed by the script
>
> This CL uses --bypass-hooks to avoid having to git cl format because
> many headers are being reordered by git cl format and it's too many to
> figure out in a no-op CL which ones are okay with it.
> windows.h for one should typically be first and another one of the
> reorderings in PS3 even caused a compile failure:
> https://chromium-review.googlesource.com/c/chromium/src/+/1764962/3/components/services/font/font_loader_unittest.cc
>
> TBR=dcheng@chromium.org
>
> Bug: 992483
> Change-Id: I32a4afd43ef779393c95d9873c157be2d3da1dd1
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764962
> Reviewed-by: Gabriel Charette <gab@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Commit-Queue: Gabriel Charette <gab@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#689778}
TBR=dcheng@chromium.org,gab@chromium.org
Change-Id: I9aa8ff558d1ff78cebe0c25e559c017578ad4f53
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 992483
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1767657
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689780}
This is merely:
$ tools/git/move_source_file.py base/test/scoped_task_environment.h base/test/task_environment.h
$ tools/git/move_source_file.py base/test/scoped_task_environment.cc base/test/task_environment.cc
$ tools/git/move_source_file.py base/test/scoped_task_environment_unittest.cc base/test/task_environment_unittest.cc
$ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.h content/public/test/browser_task_environment.h
$ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.cc content/public/test/browser_task_environment.cc
$ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle_unittest.cc content/public/test/browser_task_environment_unittest.cc
$ tools/git/move_source_file.py ios/web/public/test/test_web_thread_bundle.h ios/web/public/test/web_task_environment.h
$ tools/git/move_source_file.py ios/web/test/test_web_thread_bundle.cc ios/web/test/web_task_environment.cc
and a few manual renames in DEPS files missed by the script
This CL uses --bypass-hooks to avoid having to git cl format because
many headers are being reordered by git cl format and it's too many to
figure out in a no-op CL which ones are okay with it.
windows.h for one should typically be first and another one of the
reorderings in PS3 even caused a compile failure:
https://chromium-review.googlesource.com/c/chromium/src/+/1764962/3/components/services/font/font_loader_unittest.ccTBR=dcheng@chromium.org
Bug: 992483
Change-Id: I32a4afd43ef779393c95d9873c157be2d3da1dd1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764962
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689778}
Accessibility actions like scroll and click are not forwarded to plugin.
In this CL we create a pipeline between mimehandler and plugin process
to pass accessibility actions. This will enable plugins to receive
and handle actions. This CL focuses on enabling just kScrollToMakeVisible
for PDF. This pipeline can be extended to handle other Accessibility
actions.
Note: RenderAccessibilityImpl::ScrollPlugin method is removed because of
three reasons
- It was not used by anyone at this moment.
- It does not give correct scroll behavior because it is only able to
scroll an embed tag in view port. However, we require scrolling
within the Plugin content.
- The action handling pipeline being introduced here is different from
the HTML path ScrollPlugin uses to scroll.
Bug: 769940
Change-Id: I6f04467e2798c4a60ae08329b271480134427f6d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1692574
Commit-Queue: Virender Singh <virens@microsoft.com>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Nektarios Paisios <nektar@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Reviewed-by: Kevin Babbitt <kbabbitt@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#686149}
This change modifies the existing PDF interfaces to send data for links
and images. This extends the existing pipeline to accommodate links and
images which is part of the larger effort to make links and images
accessible in PDF. This extends the messaging pipeline between plugin
process and mimehandler process to send links and images.
This doesn't have any changes pertaining to actual data being populated
in the structures. In future CL's the data will be populated in the
structures for links and images.
Bug: 981448
Change-Id: Iee0b1ffae36df57772a739937c240aec5e01dd02
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1703627
Commit-Queue: Kevin Babbitt <kbabbitt@microsoft.com>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Kevin Babbitt <kbabbitt@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#682921}
This change the PPB_Buffer_Impl and associated buffer alloc to use
base::UnsafeSharedMemoryRegion instead of the legacy SharedMemoryHandle.
The affected IPCs are PpapiHostMsg_PPBBuffer_Create and
PpapiPluginMsg_VideoCapture_OnDeviceInfo.
Bug: 795291
Change-Id: Ia07e2d2e8c0eea43b898de6f8b33e706226c87b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1724084
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Matthew Cary (CET) <mattcary@chromium.org>
Cr-Commit-Position: refs/heads/master@{#682467}
It is currently just an alias to MessagePump::Type. This patch changes
a bunch of references to use MessagePump::Type as MessageLoop will eventually
disappear.
Also rename base::Thread::Options::message_loop_type to message_pump_type
It is weird to see things like
message_loop_type = MessagePump::Type::UI
Also change some other instances that I happened to see in the form
loop_type = MessagePump::Type::UI
to
pump_type = MessagePump::Type::UI
This is a mechanical change that will be reviewed according to
https://chromium.googlesource.com/chromium/src/+/master/docs/code_reviews.md#mechanical-changes
BUG=891670
TBR=gab@chromium.org
Change-Id: Ib41ccc6547b8c9fa0bdba5d23c4767ae03f2a97d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1718331
Commit-Queue: Carlos Caballero <carlscab@google.com>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#682254}
Uses base::UnsafeSharedMemoryRegion instead of the
legacy base::SharedMemory in the buffer manager and
associated uses. No functional change. Note this CL
clarifies the use of the readonly flag used when
passing buffer cross-process: it does not set the
permission of the shared region (which is sent
writable/unsafe), but is only used for the mapping.
Bug: 849207
Change-Id: I6592aff747dd8c975b6491b8c04abb5ad1846f97
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1697641
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Matthew Cary (CET) <mattcary@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681487}
Upgrades content::PepperVpnProviderMessageFilter (chromeos only)
and the ppapi:: side VpnProviderSharedBuffer and
VpnProviderResource to the new shared memory api.
In the current implementation, both send and receive buffers are
mapped writable, so uses of SharedMemory are replaced with
UnsafeSharedMemoryRegions. There is no functional change.
Bug: 795291
Change-Id: I19153a6d59d0ad6385423a495d736a92b4642c78
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1649325
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Reviewed-by: Alex Ilin <alexilin@chromium.org>
Commit-Queue: Matthew Cary (CET) <mattcary@chromium.org>
Cr-Commit-Position: refs/heads/master@{#668333}
MessageLoop will go away, eventually.
ScopedTaskEnvironment will per default start a ThreadPool, which should
be fine in most of the cases. If you belive your test needs to make sure
that no ThreadPool runs let me know and I will update the patch.
BUG=891670
This CL was uploaded by git cl split.
R=piman@chromium.org
Change-Id: Ida93c455e32bf058063b6bf48800b289c972823b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1649326
Auto-Submit: Carlos Caballero <carlscab@google.com>
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Antoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#667191}
This change replaces usages of base::ContainsKey() and base::ContainsValue()
with base::Contains() in //ppapi.
Reproduction:
- sed -i 's/\bbase::ContainsKey\b/base::Contains/g'
- sed -i 's/\bbase::ContainsValue\b/base::Contains/g'
- git cl format
This CL was uploaded by git cl split.
R=piman@chromium.org
Bug: 970209
Change-Id: I24a62e59fe4426117b9134fa2f00f8f7625d04fb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1648228
Auto-Submit: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Antoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#666835}
Use an UnsafeSharedMemoryRegion instead of the existing handle. The
shared memory on the host side is used read-only, but because a
writable region needs to be shipped to the other side of the proxy, an
unsafe region needs to be used.
Host | Other side of proxy
-----------------------------+---------------------------------
| Request SHM
Create SHM <-----------------------/
Reply with SHM Handle |
| \-------------------------> Receive SHM
Save SHM by ID |
|
| Fill SHM with video to decode
| (write to SHM)
| Send SHM ID to Host
Receive decode request <-----------/
Look up buffer by ID |
Decode what's in the SHM |
(read-only SHM access)
The host-side could use a read-only region only by adding an additional
round-trip, with the other side of the proxy either converting to
read-only after mapping writable, and shipping back to the host,
or the other side of the proxy mapping, shipping back a writable
handle, and then the host converting to read-only. This has not been
done in this CL.
Bug: 849207
Change-Id: I3e50f9ff9c65e51c21c7e4d72b3aed2402c03196
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1615021
Commit-Queue: Matthew Cary (CET) <mattcary@chromium.org>
Reviewed-by: Chris Palmer <palmer@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#666194}
A large but mostly trivial patch in preparation for removing
base::MessageLoop. We introduce SingleThreadTaskExecutor a simple FIFO
scheduler, which is intended for non-test code that needs a simple
single threaded task environment. Tests should use ScopedTaskEnvironment
or TestBrowserThreadBundle instead.
This patch also moves MessageLoop::Type to MessagePump::Type and
moves the factory method to MessagePump::Create.
TBR=gab@chromium.org
Change-Id: I9850c4657bb90b62490f4313c420cae025101371
BUG: 891670
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1632216
Reviewed-by: Alex Clarke <alexclarke@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664709}
If the display is rotated, the app is required to apply this rotation at
render time to produce buffers sized to the display's default
orientation if they will be used at scanout. Failing to do so forces
that layer to go through GPU composition in SurfaceFlinger on Android.
This change forwards the current screen rotation to the viz::Display in
the GPU process so it can be applied to the aggregated CompositorFrame
at draw time. If the root render pass has any copy requests, an
additional render pass is added to ensure that the display transform is
not applied to the result of those requests.
In addition, since SurfaceControl requires the display and damage rects
to be in the pre display transform screen space, the OutputSurface
implementation takes care of this on the client side itself.
TBR=asvitkine@chromium.orgR=dcastagna@chromium.org, enne@chromium.org, piman@chromium.org
Bug: 957485
Change-Id: I6f5927b0a95b764abcc63e0f4f44d56e8f6543ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1594313
Reviewed-by: Khushal <khushalsagar@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Daniele Castagna <dcastagna@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: enne <enne@chromium.org>
Commit-Queue: Khushal <khushalsagar@chromium.org>
Auto-Submit: Khushal <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#660266}
The goal is to eliminate usage of deprecated base::SharedMemory.
The shared memory region backing this 'canvas' is writable by
the plugin process (PPB_ImageData_Proxy) and its hosting renderer
(PPB_ImageData_Impl). Both processes must keep writable shared
memory handles because PPB_ImageData_API interface exposes
GetSharedMemory() method.
Hence move the usage of base::SharedMemory into
base::UnsafeSharedMemoryRegion.
Bug: 795291
Change-Id: I4766061db7f0a1e2bedfcb9459490acee6c8b2ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1586039
Commit-Queue: Alex Ilin <alexilin@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Auto-Submit: Alex Ilin <alexilin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659109}
This CL replaces the deprecated base::SharedMemoryHandle and
base::SharedMemory in Pepper to allocate shared memory for plugin process
with the new shared memory API
The shared memory is used in ppapi::ArrayBufferVar in the following way:
A plugin process asks its host (renderer) to allocate shared memory.
The plugin process writes into this memory, and the host only reads from it.
The host tracks all shared memory it allocates in a table via HostVarTracker::TrackSharedMemoryHandle().
A shared memory handle can be later extracted from this table by calling
HostVarTracker::StopTrackingSharedMemoryHandle().
Even though the host never reads from the shared memory, ReadOnlySharedMemoryRegion
cannot be used because the plugin should keep its writable shared memory region
to be used in ArrayBufferRawVarData::Init() later. The new shared memory API
doesn't allow to have read-only and writable handles to the same region at the same time.
Moreover, this region is stored inside in ppapi::proxy::ArrayBufferRawVarData::plugin_shm_handle_
as a ppapi::proxy::SerializedHandle that doesn't support WritableSharedMemoryRegion, and adding
this support would be cumbersome.
Notice that the shared memory used here was never actually read-only, because it wasn't
constructed from a handle obtained from base::SharedMemory::GetReadOnlyHandle().
See a comment to the base::SharedMemory constructor.
Bug: 795291
Change-Id: I437f8d124916615fb25e840431b83cc9586b0773
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1574801
Commit-Queue: Tanmoy Mollik <triploblastic@google.com>
Reviewed-by: Alex Ilin <alexilin@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#655176}
Make pp:{TCP,UDP}Socket APIs require the new permission.
Grant it to all existing clients that need it for compatibility,
but do not grant it to the PDF plugin, which does not need this.
- Kill an else-after-return.
- Use make_unique<> in one place.
- Suppress include guard lint noise.
- Check CanCreateSocket() for TCP sockets, too.
- Prevent clang-format from moving indented includes to margin.
Bug: 948172
Change-Id: I9dbb9e06ec1f5e713250dfcc9414830a5aa8fc38
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1548593
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Mark Seaborn <mseaborn@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: Chris Palmer <palmer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#647891}
TaskRunner::PostTask() takes a OnceCallback. Replace usage of
base::Bind(), which produces a RepeatingCallback, with base::BindOnce()
when the callback is created as a temporary inside of PostTask(). The
following regex was used to find instances that could be replaced:
(Post(?:Delayed)?Task)\((?:\n\s*)?FROM_HERE,(?:\n)?\s*base::Bind\(
Also replace any usage of base::Passed(&var) with std::move(var) for
variables passed to base::BindOnce(). base::Passed() isn't needed for
move-only types with OnceCallbacks.
This CL was uploaded by git cl split.
R=bbudge@chromium.org
Bug: 714018
Change-Id: I3dfbf9194abf30d0f9c36363ef00033eb04b102e
Reviewed-on: https://chromium-review.googlesource.com/c/1475645
Auto-Submit: kylechar <kylechar@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#633569}
Implement the plumbing from the PDF plugin out to MimeHandlerViewGuest,
so the plugin can let the browser know whether it is able to handle PDF
saving internally.
On the browser side, add WebContentsDelegate::GuestSaveFrame(). When the
user asks the browser to save a PDF, the request reaches
WebContentsImpl::SaveFrameWithHeaders(). Here, the embedder WebContents
can check for the existance of a guest WebContents and use
GuestSaveFrame() to ask the guest to perform the save. GuestSaveFrame()
calls into MimeHandlerViewGuest, which knows whether the plugin can or
not.
When the plugin can save, MimeHandlerViewGuest will dispatch an event to
the PDF Viewer to trigger the same code as when the user presses the
Save button in the PDF Viewer. The PDF Viewer already knows how to talk
to the plugin to save PDFs via its own Save button.
BUG=61248
Change-Id: I11fc00dec99445faaeb1771ea071dbffc99b6c14
Reviewed-on: https://chromium-review.googlesource.com/c/1447264
Reviewed-by: Ehsan Karamad <ekaramad@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#633448}
The former non-overloaded variants are deprecated.
Removed casts where they are now unnecessary.
This is a mechanical change; there is no intended behavior change.
Bug: 929827
Change-Id: I43577068160b171779166b1795b22dd69137b4a6
Reviewed-on: https://chromium-review.googlesource.com/c/1461376
Commit-Queue: Raul Tambre <raul@tambre.ee>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Auto-Submit: Raul Tambre <raul@tambre.ee>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630513}
This also adds it to the whitelist used in
third_party/blink/renderer/DEPS
Gab/Francois, I've used your refactoring script for this, the rule is:
matches = re.compile(r'(\n *[^/\n][^/\n]*base::Bind(Once|Repeating)?\b[^*])', re.DOTALL).findall(content)
if not matches:
return False
updated_content = refactor_lib.AddInclude(file_path, content, "base/bind.h")
if updated_content == content:
return False
# Write updated file
refactor_lib.WriteFile(file_path, updated_content)
TBR=fdoray@chromium.org
Change-Id: I7a9a991255a560c6ebedaade47cffe1ac1c7baff
Reviewed-on: https://chromium-review.googlesource.com/c/1437069
Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626098}
Windows defines a MemoryBarrier macro which clashes with a MemoryBarrier
construct in base/atomicops.h. Depending on the order of includes,
various code can be affected. Currently the Windows jumbo builder is broken
in ppapi/proxy because of a sequence of
1. include base/atomicops.h (undefs Memorybarrier which does nothing)
2. include ppapi_messages.h -> base/sync_socket.h -> windows.h
(Now MemoryBarrier is a macro)
3. include gpu/command_buffer/common/command_buffer_shared.h ->
3a -> include base/atomicops.h (does nothing because include guards)
3b -> uses base::subtle::MemoryBarrier which is a macro and poof.
Normally the undef MemoryBarrier is near the Windows.h include but
it's tricky to put in base since there is also code that needs the
macro so undeffing it in too generic code can make things worse.
Technically this was triggered by the removal of the PPB_compositor
APIs but only because the jumbo chunks changed when files were deleted.
Change-Id: I06940cadd2ad30d8698199a72cc91e36e8346b50
Reviewed-on: https://chromium-review.googlesource.com/c/1409520
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#622812}