0
Commit Graph

1909 Commits

Author SHA1 Message Date
Virender Singh
161c31a9f0 Code refactor in PdfAccessibilityTree
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}
2019-10-15 14:21:42 +00:00
Kalpak Tapas
b4500f84c4 Group PDF page accessibility objects into new struct
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}
2019-10-14 08:19:50 +00:00
Ankit Kumar 🌪️
264c3081a2 PDF Accessibility: Fix invoke on link
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}
2019-10-01 12:58:23 +00:00
Lei Zhang
b5cdb38747 ppapi: Fix nits in some PDF API code.
- Mark parameters const for SetAccessibilityViewportInfo() and
  SetAccessibilityDocInfo().
- Fix lint errors.

Change-Id: I2d54ac4e4b04acb20b7b86767534b30bfba8541e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1794502
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697217}
2019-09-17 14:55:54 +00:00
Lei Zhang
366ca01bbf Change pp::PDF::SetAccessibilityPageInfo() to use C++ structs.
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}
2019-09-17 07:45:23 +00:00
Benjamin Beaudry
c510e0c3e1 Improve performance of plugin/mimehandler messaging
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}
2019-09-16 18:24:41 +00:00
Gabriel Charette
38bbb0c5ce Backport some tests in /ppapi to SingleThreadTaskEnvironment
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}
2019-09-05 07:12:12 +00:00
Gabriel Charette
c710874894 Reland "[TaskEnvironment] Complete migration with header rename"
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}
2019-08-23 03:31:40 +00:00
Gabriel Charette
b69fcd4f6e Revert "[TaskEnvironment] Complete migration with header rename"
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}
2019-08-23 02:13:29 +00:00
Gabriel Charette
18947083c7 [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}
2019-08-23 02:05:33 +00:00
Gabriel Charette
dfa3604eca [TaskEnvironment] Mass-migrate away from ScopedTaskEnvironment
(second half of
 https://chromium-review.googlesource.com/c/chromium/src/+/1756247)

This is step  of the mass migration. Some of these will be
backported to SingleThreadTaskEnvironment in a later phase.

scoped_task_environment.h will also only move in a follow-up CL.

TBR=dcheng@chromium.org

Bug: 992483
Change-Id: Ie80f083eeeb209180ab3c2884f1b566f73549cc6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1756248
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@{#688142}
2019-08-19 17:30:11 +00:00
Virender Singh
b2090049ba Accessibility action handling pipeline for plugins
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}
2019-08-12 20:13:24 +00:00
Jeremy Roman
7c5cfabd6b Use in-class initializers for base::WeakPtrFactory (all remaining uses on Linux desktop).
Changed NULL to nullptr where the presubmit complained (due to new line wrapping).

Generated by: https://chromium-review.googlesource.com/c/chromium/src/+/1689216

Bug: 981415
Tbr: johannes@chromium.org,mathp@chromium.org,satorux@chromium.org
Change-Id: Icd574b69f75ead6dc6f34e7b4edcd52a53830640
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1702744
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Mihai Sardarescu <msarda@chromium.org>
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Yuwei Huang <yuweih@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Marc Treib <treib@chromium.org>
Reviewed-by: Rayan Kanso <rayankans@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Reviewed-by: Ryo Hashimoto <hashimoto@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#686003}
2019-08-12 15:45:27 +00:00
Matthew Cary
36e2ec8625 Pepper: remove the SHARED_MEMORY SerializedHandle type.
With the migration of the rest of PPAPI away from the legacy shared
memory API, the SHARED_MEMORY kind of SerializedHandle is no longer
needed and is removed.

Bug: 795291
Change-Id: I547b3b88825da0311ea4b684150d049a1f52768d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1724512
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Commit-Queue: Matthew Cary (CET) <mattcary@chromium.org>
Cr-Commit-Position: refs/heads/master@{#685022}
2019-08-07 23:58:56 +00:00
Ankit Kumar 🌪️
17662bdc9b Modify PDF accessibility interfaces to send data for links and images
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}
2019-07-31 21:11:50 +00:00
Matthew Cary
fc3757f9c0 Pepper: remove use of legacy SharedMemory in IPC.
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}
2019-07-30 21:32:46 +00:00
Carlos Caballero
dd8bf7b04a Deprecate MessageLoop::Type
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}
2019-07-30 14:14:15 +00:00
Antoine Labour
398dfff301 Remove piman from OWNERS files
👋

Change-Id: Idc9b82f97846f1b38bb4dfd7006ceb635a45e8df
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1721455
Commit-Queue: Bill Budge <bbudge@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Auto-Submit: Antoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681490}
2019-07-26 22:32:49 +00:00
Matthew Cary
411a519bad Pepper: upgrade media stream buffer manager
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}
2019-07-26 22:17:29 +00:00
Matthew Cary
d490a5ac84 Pepper: Upgrade VpnProvider* to new shared memory api.
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}
2019-06-12 09:08:25 +00:00
Carlos Caballero
87cbd6e884 Use ScopedTaskEnvironment instead of MessageLoop in /ppapi/proxy
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}
2019-06-07 17:14:51 +00:00
Jan Wilken Dörrie
5e4490ffb7 [base] Replace Contains{Key,Value} with Contains in //ppapi
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}
2019-06-06 19:56:59 +00:00
Alex Clarke
f7fb8a8048 Migrate more base::MessageLoops to base::SingleThreadTaskExecutor
A large but trivial migration.

TBR=fdoray@chromium.org

Bug: 891670
Change-Id: I1d3a7575703de8ba17238cb1c9e64d1d825c08d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1637460
Reviewed-by: Alex Clarke <alexclarke@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#666718}
2019-06-06 15:41:53 +00:00
Matthew Cary
66e4f70d12 PPAPI: Upgrade video decoder host shared memory API.
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}
2019-06-05 08:47:52 +00:00
Alex Clarke
636e705be4 Introduce SingleThreadTaskExecutor the replacement for base::MessageLoop
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}
2019-05-30 10:49:37 +00:00
Zhenyao Mo
dd6173b081 Change force_discrete/integrated_gpu semantic to force_high_performance/low_power_gpu
This aligns with WebGL's powerPreference semantic.

More importantly, discrete/integrated GPUs might be a good description of Mac
dual GPU situation, but it's incorrect on Windows.

BUG=966251
TEST=bots
R=kbr@chromium.org

Change-Id: I2c7f073f06be3c2b2444bf0a81f56f71e656a713
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1626458
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#662876}
2019-05-23 23:04:27 +00:00
danakj
9d03ab685a Convert Callback to OnceCallback or RepeatingCallback in content pepper
This converts all Callback and Closures in content/renderer/pepper to
be Once or Repeating Callbacks as appropriate. It also converts most
uses of Bind() to BindOnce() or BindRepeating().

R=liberato@chromium.org, raymes@chromium.org

Bug: 953861
Change-Id: I6ce9ca521198c45fcdce366e817ab680e24a3983
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1618143
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Reviewed-by: Frank Liberato <liberato@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#661765}
2019-05-21 16:34:12 +00:00
Khushal
af4ff97bf8 viz: Apply screen rotation to Display rendering for SurfaceControl.
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.org
R=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}
2019-05-16 02:50:08 +00:00
Alex Ilin
66ee45dc87 Use new shmem API in PPB_ImageData_Impl
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}
2019-05-13 18:02:06 +00:00
Tanmoy Mollik
2faf9f9931 Convert Pepper shared memory allocation to the new shared memory API
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}
2019-04-30 10:10:37 +00:00
Bill Budge
d850caad93 Revert "[ppapi] Remove PPB_TrueTypeFont resource."
This reverts commit a10bfe5123.

Reason for revert: Breaks deterministic build product check (expectations need to be adjusted.)

https://ci.chromium.org/p/chromium/builders/ci/Deterministic%20Linux/22416

Original change's description:
> [ppapi] Remove PPB_TrueTypeFont resource.
> 
> - UMA shows this interface has no usage.
> 
> Change-Id: Ifcb68620aceab0d8a857b4a3a0c768990bf47905
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1546762
> Commit-Queue: Bill Budge <bbudge@chromium.org>
> Reviewed-by: Raymes Khoury <raymes@chromium.org>
> Reviewed-by: Tom Sepez <tsepez@chromium.org>
> Reviewed-by: Scott Violet <sky@chromium.org>
> Reviewed-by: Sam Clegg <sbc@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#652404}

TBR=raymes@chromium.org,sky@chromium.org,bbudge@chromium.org,sbc@chromium.org,binji@chromium.org,tsepez@chromium.org

Change-Id: Iec735dd2220b443b0e8fddc93c7795e46dc7c0f3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1574294
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#652554}
2019-04-19 17:04:14 +00:00
Bill Budge
a10bfe5123 [ppapi] Remove PPB_TrueTypeFont resource.
- UMA shows this interface has no usage.

Change-Id: Ifcb68620aceab0d8a857b4a3a0c768990bf47905
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1546762
Commit-Queue: Bill Budge <bbudge@chromium.org>
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Sam Clegg <sbc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#652404}
2019-04-18 23:55:54 +00:00
Raul Tambre
b1da244d48 Reland "Reland "AudioBus: Convert deprecated uses of FromInterleaved(Partial)/ToInterleaved, remove deprecated ToInterleavedPartial""
This is a reland of e06207dd03

Original change's description:
> Reland "AudioBus: Convert deprecated uses of FromInterleaved(Partial)/ToInterleaved, remove deprecated ToInterleavedPartial"
>
> This is a reland of e8e3eced76
>
> Original change's description:
> > AudioBus: Convert deprecated uses of FromInterleaved(Partial)/ToInterleaved, remove deprecated ToInterleavedPartial
> >
> > There is no intended behaviour change.
> >
> > Bug: 619623
> > Change-Id: I38a3b3b11d81fcec1278855592cde0c355c6e69a
> > Reviewed-on: https://chromium-review.googlesource.com/c/1461388
> > Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
> > Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
> > Reviewed-by: Yuri Wiitala <miu@chromium.org>
> > Reviewed-by: Bill Budge <bbudge@chromium.org>
> > Reviewed-by: Kenneth MacKay <kmackay@chromium.org>
> > Reviewed-by: Tao Wu <wutao@chromium.org>
> > Reviewed-by: Max Morin <maxmorin@chromium.org>
> > Commit-Queue: Raul Tambre <raul@tambre.ee>
> > Cr-Commit-Position: refs/heads/master@{#631900}
>
> Bug: 619623
> Change-Id: I042f271c63f591d26f8aa887781dbc51b0849a16
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1472677
> Reviewed-by: Bill Budge <bbudge@chromium.org>
> Reviewed-by: Xiaohui Chen <xiaohuic@chromium.org>
> Reviewed-by: Lambros Lambrou <lambroslambrou@chromium.org>
> Reviewed-by: Max Morin <maxmorin@chromium.org>
> Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
> Reviewed-by: Yuri Wiitala <miu@chromium.org>
> Reviewed-by: Kenneth MacKay <kmackay@chromium.org>
> Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
> Commit-Queue: Raul Tambre <raul@tambre.ee>
> Cr-Commit-Position: refs/heads/master@{#646812}

TBR=maxmorin@chromium.org,miu@chromium.org,bbudge@chromium.org,xiaohuic@chromium.org,kmackay@chromium.org
CQ_INCLUDE_TRYBOTS=luci.chrome.try:linux-chromeos-chrome

Bug: 619623
Change-Id: I0d1d1ff00fc4d7fa690980819a5918f5782a8980
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1549417
Commit-Queue: Raul Tambre <raul@tambre.ee>
Reviewed-by: Lambros Lambrou <lambroslambrou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#648546}
2019-04-07 18:18:03 +00:00
Tom Sepez
d23993a158 Introduce new ppapi::PERMISSION_SOCKET.
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}
2019-04-04 20:27:31 +00:00
Pedro Amaral
7b498101db Revert "Reland "AudioBus: Convert deprecated uses of FromInterleaved(Partial)/ToInterleaved, remove deprecated ToInterleavedPartial""
This reverts commit e06207dd03.

Reason for revert: This is breaking linux-chromeos-chrome: https://ci.chromium.org/p/chrome/builders/try/linux-chromeos-chrome

Original change's description:
> Reland "AudioBus: Convert deprecated uses of FromInterleaved(Partial)/ToInterleaved, remove deprecated ToInterleavedPartial"
> 
> This is a reland of e8e3eced76
> 
> Original change's description:
> > AudioBus: Convert deprecated uses of FromInterleaved(Partial)/ToInterleaved, remove deprecated ToInterleavedPartial
> > 
> > There is no intended behaviour change.
> > 
> > Bug: 619623
> > Change-Id: I38a3b3b11d81fcec1278855592cde0c355c6e69a
> > Reviewed-on: https://chromium-review.googlesource.com/c/1461388
> > Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
> > Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
> > Reviewed-by: Yuri Wiitala <miu@chromium.org>
> > Reviewed-by: Bill Budge <bbudge@chromium.org>
> > Reviewed-by: Kenneth MacKay <kmackay@chromium.org>
> > Reviewed-by: Tao Wu <wutao@chromium.org>
> > Reviewed-by: Max Morin <maxmorin@chromium.org>
> > Commit-Queue: Raul Tambre <raul@tambre.ee>
> > Cr-Commit-Position: refs/heads/master@{#631900}
> 
> Bug: 619623
> Change-Id: I042f271c63f591d26f8aa887781dbc51b0849a16
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1472677
> Reviewed-by: Bill Budge <bbudge@chromium.org>
> Reviewed-by: Xiaohui Chen <xiaohuic@chromium.org>
> Reviewed-by: Lambros Lambrou <lambroslambrou@chromium.org>
> Reviewed-by: Max Morin <maxmorin@chromium.org>
> Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
> Reviewed-by: Yuri Wiitala <miu@chromium.org>
> Reviewed-by: Kenneth MacKay <kmackay@chromium.org>
> Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
> Commit-Queue: Raul Tambre <raul@tambre.ee>
> Cr-Commit-Position: refs/heads/master@{#646812}

TBR=lambroslambrou@chromium.org,bbudge@chromium.org,dalecurtis@chromium.org,miu@chromium.org,sergeyu@chromium.org,xiaohuic@chromium.org,maxmorin@chromium.org,kmackay@chromium.org,wutao@chromium.org,raul@tambre.ee

Change-Id: I43bab7186e55ae39972e4ed63f3e7f8ffa917809
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 619623
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1549685
Reviewed-by: Pedro Amaral <amaralp@chromium.org>
Commit-Queue: Pedro Amaral <amaralp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#646942}
2019-04-02 20:42:07 +00:00
Raul Tambre
e06207dd03 Reland "AudioBus: Convert deprecated uses of FromInterleaved(Partial)/ToInterleaved, remove deprecated ToInterleavedPartial"
This is a reland of e8e3eced76

Original change's description:
> AudioBus: Convert deprecated uses of FromInterleaved(Partial)/ToInterleaved, remove deprecated ToInterleavedPartial
> 
> There is no intended behaviour change.
> 
> Bug: 619623
> Change-Id: I38a3b3b11d81fcec1278855592cde0c355c6e69a
> Reviewed-on: https://chromium-review.googlesource.com/c/1461388
> Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
> Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
> Reviewed-by: Yuri Wiitala <miu@chromium.org>
> Reviewed-by: Bill Budge <bbudge@chromium.org>
> Reviewed-by: Kenneth MacKay <kmackay@chromium.org>
> Reviewed-by: Tao Wu <wutao@chromium.org>
> Reviewed-by: Max Morin <maxmorin@chromium.org>
> Commit-Queue: Raul Tambre <raul@tambre.ee>
> Cr-Commit-Position: refs/heads/master@{#631900}

Bug: 619623
Change-Id: I042f271c63f591d26f8aa887781dbc51b0849a16
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1472677
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: Xiaohui Chen <xiaohuic@chromium.org>
Reviewed-by: Lambros Lambrou <lambroslambrou@chromium.org>
Reviewed-by: Max Morin <maxmorin@chromium.org>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: Yuri Wiitala <miu@chromium.org>
Reviewed-by: Kenneth MacKay <kmackay@chromium.org>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Raul Tambre <raul@tambre.ee>
Cr-Commit-Position: refs/heads/master@{#646812}
2019-04-02 15:19:39 +00:00
Daniel Cheng
c058199b2c Update include paths for //base/hash/hash.h
Bug: 902789
Tbr: blundell@chromium.org
Tbr: boliu@chromium.org
Tbr: eroman@chromium.org
Tbr: eugenebut@chromium.org
Tbr: inferno@chromium.org
Tbr: jamiewalch@chromium.org
Tbr: liberato@chromium.org
Tbr: mek@chromoium.org
Tbr: piman@chromium.org
Tbr: raymes@chromium.org
Tbr: rockot@google.com
Tbr: sadrul@chromium.org
Change-Id: I11994865e5a38c0d0ff1bd32d6e605bffa24ac41
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1544630
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Frank Liberato <liberato@chromium.org>
Reviewed-by: Eugene But <eugenebut@chromium.org>
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#645668}
2019-03-29 04:52:56 +00:00
David Benjamin
1ad71d5814 Release ppp_class_data in mocked V8ObjectVar.
The CreateObject implementation should release the ppp_class_data when
it goes out of scope.

Bug: 258113
Change-Id: I563c6b5234f5ac94fed4fd43ce69c448e54866de
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1539692
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: David Benjamin <davidben@chromium.org>
Cr-Commit-Position: refs/heads/master@{#644512}
2019-03-26 21:06:42 +00:00
Miyoung Shin
7caefcaeb6 Change unsigned long to uint64_t in third_party/blink/public/web/web_pepper_socket_client.h
- unsigned long -> uint64_t for buffer amount to make a consistence with //blink & //ppapi
- unsigned short -> uint16_t, size_t -> unsigned
- Reference: https://google.github.io/styleguide/cppguide.html#Integer_Types

Bug: 930252
Change-Id: Ia5cc8df0fc109ccfc86c208474bb36f3f7e95aa2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1530212
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Commit-Queue: Miyoung Shin <myid.shin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#642264}
2019-03-19 23:44:56 +00:00
kylechar
444859b4be Use base::BindOnce for PostTask callbacks.
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}
2019-02-20 04:32:19 +00:00
Lei Zhang
13a42e4826 Hook up IDC_SAVEPAGE to the PDF plugin.
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}
2019-02-19 23:28:11 +00:00
Devlin
5b3ccb8677 Revert "AudioBus: Convert deprecated uses of FromInterleaved(Partial)/ToInterleaved, remove deprecated ToInterleavedPartial"
This reverts commit e8e3eced76.

Reason for revert: Breaks Google ChromeOS compile

https://logs.chromium.org/logs/chromium/bb/chromium.chrome/Google_Chrome_ChromeOS/61651/+/recipes/steps/compile/0/logs/raw_io.output_failure_summary_/0

../../chromeos/services/assistant/audio_decoder/assistant_audio_decoder.cc:139:30: error: unknown type name 'SignedInt16SampleTypeTraits'; did you mean 'media::SignedInt16SampleTypeTraits'?
audio_bus->ToInterleaved<SignedInt16SampleTypeTraits>(audio_bus->frames(),
^~~~~~~~~~~~~~~~~~~~~~~~~~~
media::SignedInt16SampleTypeTraits
../../media/base/audio_sample_types.h:213:7: note: 'media::SignedInt16SampleTypeTraits' declared here
using SignedInt16SampleTypeTraits = FixedSampleTypeTraits<int16_t>;
^
../../chromeos/services/assistant/audio_decoder/assistant_audio_decoder.cc:139:16: error: no matching member function for call to 'ToInterleaved'
audio_bus->ToInterleaved<SignedInt16SampleTypeTraits>(audio_bus->frames(),
~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../media/base/audio_bus.h:265:16: note: candidate function template not viable: no known conversion from 'std::__1::vector<unsigned char, std::__1::allocator<unsigned char> >::value_type *' (aka 'unsigned char *') to 'typename FixedSampleTypeTraits<short>::ValueType *' (aka 'short *') for 2nd argument
void AudioBus::ToInterleaved(
^
2 errors generated.

Original change's description:
> AudioBus: Convert deprecated uses of FromInterleaved(Partial)/ToInterleaved, remove deprecated ToInterleavedPartial
> 
> There is no intended behaviour change.
> 
> Bug: 619623
> Change-Id: I38a3b3b11d81fcec1278855592cde0c355c6e69a
> Reviewed-on: https://chromium-review.googlesource.com/c/1461388
> Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
> Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
> Reviewed-by: Yuri Wiitala <miu@chromium.org>
> Reviewed-by: Bill Budge <bbudge@chromium.org>
> Reviewed-by: Kenneth MacKay <kmackay@chromium.org>
> Reviewed-by: Tao Wu <wutao@chromium.org>
> Reviewed-by: Max Morin <maxmorin@chromium.org>
> Commit-Queue: Raul Tambre <raul@tambre.ee>
> Cr-Commit-Position: refs/heads/master@{#631900}

TBR=bbudge@chromium.org,dalecurtis@chromium.org,miu@chromium.org,sergeyu@chromium.org,maxmorin@chromium.org,kmackay@chromium.org,wutao@chromium.org,raul@tambre.ee

Change-Id: I4a9a09e8e1e8e5a316144a636dff204b9db74888
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 619623
Reviewed-on: https://chromium-review.googlesource.com/c/1471304
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#631930}
2019-02-13 22:44:19 +00:00
Raul Tambre
e8e3eced76 AudioBus: Convert deprecated uses of FromInterleaved(Partial)/ToInterleaved, remove deprecated ToInterleavedPartial
There is no intended behaviour change.

Bug: 619623
Change-Id: I38a3b3b11d81fcec1278855592cde0c355c6e69a
Reviewed-on: https://chromium-review.googlesource.com/c/1461388
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Yuri Wiitala <miu@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: Kenneth MacKay <kmackay@chromium.org>
Reviewed-by: Tao Wu <wutao@chromium.org>
Reviewed-by: Max Morin <maxmorin@chromium.org>
Commit-Queue: Raul Tambre <raul@tambre.ee>
Cr-Commit-Position: refs/heads/master@{#631900}
2019-02-13 21:54:47 +00:00
Nico Weber
e779c82592 Remove a few unnecessary semicolons.
This CL was uploaded by git cl split.

R=piman@chromium.org

Bug: 926235
Change-Id: I6a9a04c161bc60bbd603e8d5607e48ec41de0aec
Reviewed-on: https://chromium-review.googlesource.com/c/1463460
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Antoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#631359}
2019-02-12 20:19:08 +00:00
Raul Tambre
498b0f7626 //ppapi: Convert base::(U)Int(64)ToString(16) to NumberToString(16)
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}
2019-02-08 23:02:07 +00:00
Nico Weber
199cd029e4 Remove a few semicolons.
No behavior change.

Bug: 926235
Change-Id: I731ae4f33079088d62b0748c99663fb9c5667fff
Reviewed-on: https://chromium-review.googlesource.com/c/1458680
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630025}
2019-02-07 19:07:54 +00:00
Sebastien Marchand
6d0558fd10 Include base/bind.h in the files that use it.
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}
2019-01-25 16:49:37 +00:00
Daniel Bratell
8345d33ad5 Resolve another collision between Win32 and atomicops MemoryBarrier
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}
2019-01-15 11:16:03 +00:00
Antoine Labour
c0c56e43d0 Remove PPB_Compositor
It's incompatible with shared images / Vulkan, and it usage is extremely
low (not available on stable except for ARC, which doesn't use it any
more).

Bug: 918951
Change-Id: Ia01d2b276456536394fecffb39d5ea6c90cfe0de
Reviewed-on: https://chromium-review.googlesource.com/c/1396611
Commit-Queue: Antoine Labour <piman@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Ben Smith <binji@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#621778}
2019-01-10 22:26:07 +00:00
Hajime Hoshi
5959c54fa9 Use per-frame task runners instead of per-thread task runners at pepper module
This CL is based on Alexander's CL: https://chromium-review.googlesource.com/c/chromium/src/+/1367329

Bug: 870606
Change-Id: I2ca696efeb203d7cb48c9f33034163c2d9c6277d
Reviewed-on: https://chromium-review.googlesource.com/c/1379607
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Hajime Hoshi <hajimehoshi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#620986}
2019-01-09 01:42:12 +00:00