0
Commit Graph

68 Commits

Author SHA1 Message Date
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
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
Gabriel Charette
494bf1e595 [base] Undo erroneous IWYU of time.h in presence of base::Thread
@QA: This CL is a no-op.

Caused by incorrectly covering base::Thread when using regex
"base::(Time|Thread)(Ticks|Delta)?\b"

This script removed base/time/time.h if:
 1) "base::Thread" is present
 2) There is no (Time|ThreadTicks|Days|Hours|Minutes|Seconds|
                 Milliseconds|Microseconds|Nanoseconds|Hertz)
    string in the file (no base:: prefix required to skip removal)

Bug: 1026641
Change-Id: I9df5e8beccc74054bf9bfff12320a1d4e0295b62
AX-Relnotes: n/a.
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3563202
Commit-Queue: Gabriel Charette <gab@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#988045}
2022-04-01 18:58:52 +00:00
Gabriel Charette
d87f10f467 [base] IWYU for base::Time
This CL is a no-op.

Only fixing instances where base::Time (and Ticks/Delta) is used in
a statement (i.e. not as a parameter to avoid adding includes in mere
overrides). Skipping pointer and reference qualified instances.

i.e. matches this regex:
'(\n *[^/\n][^/\n][^/\n]*base::(Time|Thread)(Ticks|Delta)?\b[^*&][^)]*;)'

and skipping files that have any existing fwd-decl for any of the
variants.

This is a prereq to remove unused base/task/post_task.h includes in
https://chromium-review.googlesource.com/c/chromium/src/+/3555247

Bug: 1026641
Change-Id: I87b43a8dc92bdceb67f4bd59b327b54813aa72a6
AX-Relnotes: n/a.
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3557354
Commit-Queue: Gabriel Charette <gab@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#987283}
2022-03-31 00:44:22 +00:00
Peter Boström
5666ff4f50 Remove most remaining unused "base/macros.h"
Removes `#include "base/macros.h"` from remaining .cc, .h and .mm files
that do not contain `ignore_result(` and do not trigger pre-commit or
pre-upload errors.

Bug: 1010217
No-Try: true
Change-Id: I4cc5207b3deafa7901764d2e633bbb1ad43cfb73
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3276692
Commit-Queue: Peter Boström <pbos@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#941054}
2021-11-12 03:40:24 +00:00
Peter Boström
3d5b3cbc71 Replace DISALLOW_COPY_AND_ASSIGN in ppapi/
This replaces DISALLOW_COPY_AND_ASSIGN with explicit constructor deletes
where a local script is able to detect its insertion place (~Foo() is
public => insert before this line).

This is incomplete as not all classes have a public ~Foo() declared, so
not all DISALLOW_COPY_AND_ASSIGN occurrences are replaced.

IWYU cleanup is left as a separate pass that is easier when these macros
go away.

Bug: 1010217
Change-Id: Iab44b67c7ca86cf5cfb1f6b27de5c18769d36632
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3177680
Auto-Submit: Peter Boström <pbos@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#924479}
2021-09-23 21:35:45 +00:00
Ayu Ishii
54b61875a2 CodeHealth: Convert ppapi/proxy/* from base::Bind/base::Callback
This changes convert uses of base::Bind and base::Callback to
Once/Repeating. Refer to (https://crbug.com/714018) for details.

Bug: 1007816
Change-Id: I1398e4fabc3abecc36bd7de385397d46579ec554
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2669454
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Commit-Queue: Ayu Ishii <ayui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#851774}
2021-02-08 17:54:26 +00:00
Dominik Röttsches
10bdd19f59 Remove PreCacheFontForFlash
As part of Flash API removal, remove instances of
PreCacheFontForFlash. Generally, cache priming for GDI fonts
on Windows still seems to be needed for printing and PDF processes
but the flash reference can be deleted.

Bug: 1139287
Change-Id: Iebaac7c48b5fddbb81219b0fcc08b091597dee2f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2478990
Commit-Queue: Dominik Röttsches <drott@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#818851}
2020-10-20 10:48:28 +00:00
Gabriel Charette
e926fc1eb8 [base] Move TaskRunner::RunsTasksInCurrentSequence() to SequencedTaskRunner
The vast majority of this CL is about changing code that used
base::TaskRunner and invoked RunsTasksInCurrentSequence() on it.

For the most part this CL is a logical no-op and a semantical
improvement as almost all APIs who loosely took a TaskRunner in fact
required a SequencedTaskRunner (e.g. were accessing unsynchronized
state) but it "worked" because their callers already happened to provide
task runners that were Sequenced/SingleThreadTaskRunners.

Some impls even used single-threaded APIs such as MessageLoopCurrent or
declaring methods invoked from that TaskRunner as "must run on the UI
thread". Those were changed to use SingleThreadTaskRunner (again, all
callers already were providing one but the API was too loose).

In a few cases where a parallel TaskRunner was actually intended, some
DCHECK(task_runner->RunsTasksInCurrentSequence()) were simply removed as
they were mere impl details, already obvious by the context. There was a
single case where it made sense to assert "doesn't run on a core thread"
in wallpaper_resizer.cc; that was migrated to
base::AssertLongCPUWorkAllowed().

Implementations of base::TaskRunner were either promoted to
Sequenced/SingleThreadTaskRunner when that's what it was actually used
as or the RunsTasksInCurrentSequence() override was removed.

The few actual logic changes:
 - ash/.../wallpaper_resizer.cc : base::AssertLongCPUWorkAllowed()
 - base/android/.../task_runner_android.h : TODO to make the same change
       on the Java side, for now things seem happy when always returning
       false from parallel TaskRunnerImpl.

Removed dead code:
 - base::debug::ActivityTracker::SetBackgroundTaskRunner()
 - AfterStartupTaskUtils::Runner
 - net/url_request/test_url_request_interceptor.(h|cc)

Includes were mostly kept as-is (fwd-decls as fwd-decls and
includes-as-includes) except where it was outright wrong or necessary to
make callers happy (remember that foo.h is required in order to have
scoped_refptr<Foo> be fully defined -- and hence required by IWYU if you
have such a member and arguably if taking/returning one by value as part
of your core API).

Pointer semantics are also intentionally unchanged unless 100% incorrect
and easy to update in place (e.g. in some cases raw pointers are used to
return refcounted objects; that should probably be fixed, but not in this
CL).

Bug: 1026641
Change-Id: I1b33744d3a30a05fdb091d3f976270cd59917873
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1957211
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: Miguel Casas <mcasas@chromium.org>
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
Reviewed-by: Brian White <bcwhite@chromium.org>
Reviewed-by: Brad Nelson <bradnelson@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Achuith Bhandarkar <achuith@chromium.org>
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Reviewed-by: Maksim Orlovich <morlovich@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Sorin Jianu <sorin@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#725203}
2019-12-16 19:00:02 +00:00
Alex Ilin
778f23abef Remove unused code for sharing shared memory handles with plugins
This CL removes code that shares base::SharedMemoryHandle with remote.
This code is no longer used because base::SharedMemoryHandle is
deprecated and replaced with base::*SharedMemoryRegion.

Bug: 795291
Change-Id: I5974bd77b6e40bee662dc2fb4092b7a61f725afb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1916827
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Auto-Submit: Alex Ilin <alexilin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715867}
2019-11-15 21:48:32 +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
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
Alexander Timin
4f9c35c363 [message_loop] Remove message_loop_forward.h
As a final step, replace all includes back:
- mv message_loop_current.h message_loop.h
- s/message_loop_forward.h/message_loop.h/ in all includes.
- s/message_loop_forward.h/message_loop.h/ in base/BUILD.gn
- Remove message_loop_forward.h from third_party/DEPS.

TBR=gab@chromium.org
R=gab@chromium.org
BUG=891670

Change-Id: I623077025701459ddb7045cbcfdad138aa90a9e4
Reviewed-on: https://chromium-review.googlesource.com/c/1313110
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604690}
2018-11-01 20:15:20 +00:00
Alexander Timin
c643d0e146 [message_loop] Temporary introduce message_loop_forward.h.
To facilitate splitting MessageLoop into MessageLoop and MessageLoopImpl
introduce message_loop_forward.h and use it everywhere.

- s/message_loop.h/message_loop_forward.h/ in all includes.
- Add message_loop_forward.h to base/BUILD.gn.
- Add message_loop_forward.h to third_party/DEPS.

TBR=gab@chromium.org
BUG=891670

Change-Id: Ibac3a24f5bd4291c9d57dd32c627477e4e6ef324
Reviewed-on: https://chromium-review.googlesource.com/c/1313108
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604672}
2018-11-01 19:43:28 +00:00
Alexandr Ilin
c7d975fa69 ppapi: Add methods for sharing new shared memory classes with remote
This CL adds two new methods, ShareUnsafeSharedMemoryRegionWithRemote() and
ShareReadOnlySharedMemoryRegionWithRemote() to
ppapi::proxy::ProxyChannel::Delegate and to content::RendererPpapiHost classes
and all implementation classes.

These new methods are similar to the SharedSharedMemoryHandleWithRemote()
method in those classes but are supposed to work with the new shared memory
API.

Bug: 845985
Change-Id: I8ccd92a1c81dca9495c85119e9a4e40fd6b69abf
Reviewed-on: https://chromium-review.googlesource.com/1078847
Commit-Queue: Alexandr Ilin <alexilin@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#563571}
2018-06-01 09:25:41 +00:00
gab
f64a25e32a Add missing IWYU message_loop.h includes.
This is a pre-req to removing the dependency from RunLoop->MessageLoop
as many files only include run_loop.h but instantiate a MessageLoop.

The following fix script was applied to each file in the codebase
(plus a few hand fixes for DEPS and for //base):

def Fix(file_path):
  content = refactor_lib.ReadFile(file_path)

  # Assume fwd-decls are correct in first pass.
  if 'class MessageLoop;' in content:
    return False
  if 'class MessageLoopForUI;' in content:
    return False
  if 'class MessageLoopForIO;' in content:
    return False

  # Using base:: prefix ensures we don't match fwd-decls and other things.
  # Will require a few fixups for missing includes in //base proper.
  # Complex prefix in regex attempts to skip comments.
  matches = re.compile(r'(\n *[^/\n][^/\n][^/\n]*base::MessageLoop(ForUI|ForIO)?\b[^*])', re.DOTALL).findall(content)

  if not matches:
    return False

  # Ignore unique pointers in headers in first pass...
  if os.path.splitext(file_path)[1] == '.h':
    found = False
    for match in matches:
      if not 'std::unique_ptr<base::MessageLoop' in match[0]:
        found = True
        break
    if not found:
      return False

  updated_content = refactor_lib.AddInclude(file_path, content, "base/message_loop/message_loop.h")

  if updated_content == content:
    return False

  # Write updated file
  refactor_lib.WriteFile(file_path, updated_content)

  return True

TBR=gab@chromium.org
BUG=703346
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_cronet_tester;master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2876013002
Cr-Commit-Position: refs/heads/master@{#471412}
2017-05-12 19:43:18 +00:00
dcheng
ced9224fbb Convert //ppapi to use std::unique_ptr
BUG=554298
R=bbudge@chromium.org

Review URL: https://codereview.chromium.org/1864293002

Cr-Commit-Position: refs/heads/master@{#385591}
2016-04-07 00:01:36 +00:00
avi
e029c4134f Switch to standard integer types in ppapi/.
BUG=138542
TBR=bbudge@chromium.org
NOPRESUBMIT=true

Review URL: https://codereview.chromium.org/1548813002

Cr-Commit-Position: refs/heads/master@{#366718}
2015-12-23 06:46:20 +00:00
mgiuca
8ca5918882 Fixed all overloaded virtual methods on Windows.
This fixes the 'overloaded-virtual' Clang warning on Windows (currently
disabled; will be enabled in a follow-up CL).

- PpapiThread::PreCacheFont: Renamed to PreCacheFontForFlash to avoid
  conflict with PreCacheFont method in base class ChildThreadImpl. (This
  method is only called by another method called PreCacheFontForFlash so
  the new name is appropriate.)
- PrintingContextSytemDialogWin::InitializeSettings: Renamed to
  InitializeSettingsWithRanges to avoid conflict with InitializeSettings
  in base class PrintingContextWin. (These two methods are called on
  different code paths and the former is not meant to override the
  latter, so they should have different names.)
- Removed PrintingContextWin::ShowPrintDialog. This method was totally
  unused and its name was conflicting with a method in a subclass.

BUG=505301

Review URL: https://codereview.chromium.org/1216013005

Cr-Commit-Position: refs/heads/master@{#337735}
2015-07-08 02:11:59 +00:00
skyostil
23490d4463 ppapi: Remove use of MessageLoopProxy and deprecated MessageLoop APIs
This patch was mostly autogenerated with https://codereview.chromium.org/1010073002/.

BUG=465354
TBR=sievers@chromium.org

Review URL: https://codereview.chromium.org/1174543002

Cr-Commit-Position: refs/heads/master@{#334148}
2015-06-12 12:55:14 +00:00
erikchen
4fc32d5dd3 Update pepper to not assume that SharedMemoryHandle is an int.
This CL is a refactor. This CL contains no intended behavior changes.

Pepper code assumes that SharedMemoryHandle is backed by a PlatformFile, and
that the relevant HANDLE or fd can be cast to an int. These assumptions will no
longer be true once SharedMemory is backed by Mach primitives on Mac.

This CL adds the method ShareSharedMemoryHandleWithRemote() to
ProxyChannel::Delegate. This method is used in place of ShareHandleWithRemote()
when a SharedMemory object is being shared between processes. This CL updates
the type of all SharedMemory handles to be SharedMemoryHandle.

BUG=466437

Review URL: https://codereview.chromium.org/1154613006

Cr-Commit-Position: refs/heads/master@{#332325}
2015-06-02 02:16:59 +00:00
skyostil
12262cfcdb content/child: Remove use of MessageLoopProxy and deprecated MessageLoop APIs
This patch was mostly autogenerated with
https://codereview.chromium.org/1010073002/.

BUG=465354
TBR=jochen@chromium.org,raymes@chromium.org

Review URL: https://codereview.chromium.org/1142063003

Cr-Commit-Position: refs/heads/master@{#330939}
2015-05-21 14:50:03 +00:00
nick
b05b81d761 Update {virtual,override} to follow C++11 style in ppapi.
[Sending this chunk by itself since it's slightly less rote than the others]

The Google style guide states that only one of {virtual,override,final} should be used for each declaration, since override implies virtual and final implies both virtual and override.

This patch was manually generated using a regex and a text editor.

BUG=417463

Review URL: https://codereview.chromium.org/1100733003

Cr-Commit-Position: refs/heads/master@{#326504}
2015-04-23 14:01:06 +00:00
dmichael
b11ca7b7da Don't lock ProxyLock on the IO thread
Introduce ResourceMessageFilter and UDPSocketFilter to receive messages on the IO thread. This allows us to queue messages up when there's no callback, and dispatch them directly to the appropriate thread when there is a callback pending. (This depends on TrackedCallback being Run()-able without the ProxyLock; see https://codereview.chromium.org/923263003/)

BUG=439588

Review URL: https://codereview.chromium.org/869883003

Cr-Commit-Position: refs/heads/master@{#323517}
2015-04-02 16:59:59 +00:00
dmichael
bd96c1e0f3 PPAPI: Make tests that disable the proxy lock re-enable it
Rather than force all unit tests that rely on the ProxyLock to enable it,
let's make sure that all tests that _disable_ it re-enable it on exit.

BUG=
R=teravest@chromium.org

Committed: https://crrev.com/25ea5b2087b4c31fa42dea9b0de759d4895d0612
Cr-Commit-Position: refs/heads/master@{#315666}

Review URL: https://codereview.chromium.org/908363002

Cr-Commit-Position: refs/heads/master@{#315895}
2015-02-12 00:58:54 +00:00
kareng
1c62eeb196 Revert of PPAPI: Make GetProxiedInterface not re-enter the plugin (patchset id:20001 of https://codereview.chromium.org/704913002/)
Reason for revert:
reverted due to 431529

Original issue's description:
> PPAPI: Make GetProxiedInterface not re-enter the plugin
>
> It's important that we never re-enter the plugin when it is blocked on
> synchronous calls to the renderer (unless they are scripting messages, which
> have to be re-entrant). This especially breaks assumptions in OpenGL usage.
>
> This required making the plugin side of the PPB_VideoDecoder_Dev proxy check
> for the interface prior to sending its synchronous Create message. I audited
> all the other uses of GetProxiedInterface from the renderer, and none of the
> others happen as a result of a sync plugin->renderer message.
>
> I also renamed the existing "SupportsInterface" message to "IsInterfaceSupported" to make the intent more obvious, and because I liked the SupportsInterface name better for the new usage: Telling the renderer that an interface is supported.
>
> BUG=418651
>
> Committed: https://crrev.com/a17de8faa97ca33d1e58e08392dbdc3e316d6cbe
> Cr-Commit-Position: refs/heads/master@{#303247}

TBR=teravest@chromium.org,tsepez@chromium.org,piman@chromium.org,dmichael@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=418651

Review URL: https://codereview.chromium.org/714483002

Cr-Commit-Position: refs/heads/master@{#303388}
2014-11-08 16:35:30 +00:00
dmichael
a17de8faa9 PPAPI: Make GetProxiedInterface not re-enter the plugin
It's important that we never re-enter the plugin when it is blocked on
synchronous calls to the renderer (unless they are scripting messages, which
have to be re-entrant). This especially breaks assumptions in OpenGL usage.

This required making the plugin side of the PPB_VideoDecoder_Dev proxy check
for the interface prior to sending its synchronous Create message. I audited
all the other uses of GetProxiedInterface from the renderer, and none of the
others happen as a result of a sync plugin->renderer message.

I also renamed the existing "SupportsInterface" message to "IsInterfaceSupported" to make the intent more obvious, and because I liked the SupportsInterface name better for the new usage: Telling the renderer that an interface is supported.

BUG=418651

Review URL: https://codereview.chromium.org/704913002

Cr-Commit-Position: refs/heads/master@{#303247}
2014-11-07 17:18:14 +00:00
mostynb
699af3cc7b replace OVERRIDE and FINAL with override and final in ppapi/
R=dmichael@chromium.org,dcheng@chromium.org
BUG=417463

Review URL: https://codereview.chromium.org/630883002

Cr-Commit-Position: refs/heads/master@{#298269}
2014-10-06 18:03:57 +00:00
dmichael
6b328f3db4 PPAPI: Never re-enter JavaScript for PostMessage.
Blocking renderer->plugin messages can be interrupted by any message
from the plugin->renderer (even async ones). So while handline a blocking
message, such as HandleInputEvent or HandleBlockingMessage, it's currently
possible to re-enter JavaScript. This patch makes that impossible by
queueing up Plugin->Renderer messages sent via PPB_Messaging::PostMessage
while any renderer->plugin sync message is on the stack.

BUG=384528

Committed: https://crrev.com/f73075c99b5ba30e8d62dc5f13fdfb210d0fc506
Cr-Commit-Position: refs/heads/master@{#296311}

Committed: https://crrev.com/3fe4ceee750b2cd130bd402de3d371d8518c3eba
Cr-Commit-Position: refs/heads/master@{#296807}

Review URL: https://codereview.chromium.org/589213003

Cr-Commit-Position: refs/heads/master@{#297308}
2014-09-29 23:50:28 +00:00
dmichael
1ea0de3d15 Revert of PPAPI: Never re-enter JavaScript for PostMessage. (patchset id:80001 of https://codereview.chromium.org/589213003/)
Reason for revert:
Still causing a crash in Canary

Original issue's description:
> PPAPI: Never re-enter JavaScript for PostMessage.
>
> Blocking renderer->plugin messages can be interrupted by any message
> from the plugin->renderer (even async ones). So while handline a blocking
> message, such as HandleInputEvent or HandleBlockingMessage, it's currently
> possible to re-enter JavaScript. This patch makes that impossible by
> queueing up Plugin->Renderer messages sent via PPB_Messaging::PostMessage
> while any renderer->plugin sync message is on the stack.
>
> BUG=384528
>
> Committed: https://crrev.com/f73075c99b5ba30e8d62dc5f13fdfb210d0fc506
> Cr-Commit-Position: refs/heads/master@{#296311}
>
> Committed: https://crrev.com/3fe4ceee750b2cd130bd402de3d371d8518c3eba
> Cr-Commit-Position: refs/heads/master@{#296807}

TBR=raymes@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=384528

Review URL: https://codereview.chromium.org/605393002

Cr-Commit-Position: refs/heads/master@{#297030}
2014-09-26 21:10:28 +00:00
dmichael
3fe4ceee75 PPAPI: Never re-enter JavaScript for PostMessage.
Blocking renderer->plugin messages can be interrupted by any message
from the plugin->renderer (even async ones). So while handline a blocking
message, such as HandleInputEvent or HandleBlockingMessage, it's currently
possible to re-enter JavaScript. This patch makes that impossible by
queueing up Plugin->Renderer messages sent via PPB_Messaging::PostMessage
while any renderer->plugin sync message is on the stack.

BUG=384528

Committed: https://crrev.com/f73075c99b5ba30e8d62dc5f13fdfb210d0fc506
Cr-Commit-Position: refs/heads/master@{#296311}

Review URL: https://codereview.chromium.org/589213003

Cr-Commit-Position: refs/heads/master@{#296807}
2014-09-25 22:26:48 +00:00
bbudge
50c6f1a0cf Revert of PPAPI: Never re-enter JavaScript for PostMessage. (patchset id:60001 of https://codereview.chromium.org/589213003/)
Reason for revert:
May be crashing Chrome:
https://code.google.com/p/chromium/issues/detail?id=417511

Original issue's description:
> PPAPI: Never re-enter JavaScript for PostMessage.
>
> Blocking renderer->plugin messages can be interrupted by any message
> from the plugin->renderer (even async ones). So while handline a blocking
> message, such as HandleInputEvent or HandleBlockingMessage, it's currently
> possible to re-enter JavaScript. This patch makes that impossible by
> queueing up Plugin->Renderer messages sent via PPB_Messaging::PostMessage
> while any renderer->plugin sync message is on the stack.
>
> BUG=384528
>
> Committed: https://crrev.com/f73075c99b5ba30e8d62dc5f13fdfb210d0fc506
> Cr-Commit-Position: refs/heads/master@{#296311}

TBR=raymes@chromium.org,dmichael@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=384528

Review URL: https://codereview.chromium.org/601923003

Cr-Commit-Position: refs/heads/master@{#296571}
2014-09-24 23:46:28 +00:00
dmichael
f73075c99b PPAPI: Never re-enter JavaScript for PostMessage.
Blocking renderer->plugin messages can be interrupted by any message
from the plugin->renderer (even async ones). So while handline a blocking
message, such as HandleInputEvent or HandleBlockingMessage, it's currently
possible to re-enter JavaScript. This patch makes that impossible by
queueing up Plugin->Renderer messages sent via PPB_Messaging::PostMessage
while any renderer->plugin sync message is on the stack.

BUG=384528

Review URL: https://codereview.chromium.org/589213003

Cr-Commit-Position: refs/heads/master@{#296311}
2014-09-24 00:12:12 +00:00
scottmg@chromium.org
1d14806658 move BrowserFontResource_Trusted to content/child
Needed to break dependency of ppapi_proxy on webkit code.

resource_creation_proxy now creates BrowserFontResource_Trusted
by going through PluginGlobals -> PluginProxyDelegate implemented
in content by PpapiThread.

R=jam@chromium.org, yzshen@chromium.org
BUG=237249

Review URL: https://codereview.chromium.org/20214004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213684 0039d316-1c4b-4281-b951-d872f2087c98
2013-07-25 20:25:45 +00:00
avi@chromium.org
a7629597f5 Use a direct include of the message_loop header in ppapi/, printing/, rlz/, sync/.
BUG=260807
TEST=none
TBR=ben@chromium.org

Review URL: https://chromiumcodereview.appspot.com/19627002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212193 0039d316-1c4b-4281-b951-d872f2087c98
2013-07-18 00:42:32 +00:00
xhwang@chromium.org
d2881d8adc ppapi: Use base::MessageLoop.
BUG=236029

Review URL: https://chromiumcodereview.appspot.com/14273043

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198504 0039d316-1c4b-4281-b951-d872f2087c98
2013-05-06 19:23:08 +00:00
yzshen@chromium.org
7ef6b79bd4 Pepper: Introduce ThreadAwareCallback.
Some PPB interfaces have methods that set a custom callback. Usually, the callback has to be called on the same thread as the one it was set on. ThreadAwareCallback keeps track of the target thread, and posts a task to run on it if requested from a different thread.

BUG=None
TEST=newly added unittests.


Review URL: https://chromiumcodereview.appspot.com/11859015

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177319 0039d316-1c4b-4281-b951-d872f2087c98
2013-01-17 02:38:24 +00:00
brettw@chromium.org
108fd342d9 Use an explicit PID for duplicating Pepper handles rather than the Channel's.
When the browser process launches the plugin, it explicitly tells each side the PID of the other side, and we now use this PID for sharing handles. Previously we'd use the PID from the IPC channel.

Using the PID from the IPC channel creates a race condition because the PID isn't set until the "hello" message from the opposite side is processed, which isn't guaranteed at any particular time.

BUG=168222

Review URL: https://codereview.chromium.org/11722017

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175190 0039d316-1c4b-4281-b951-d872f2087c98
2013-01-04 20:46:54 +00:00
yzshen@chromium.org
e34e809c70 Pepper proxy: make the browser sender handle the proxy lock properly.
- unlock the pepper proxy lock when sending sync messages to the browser;
- remove the SendToBrowser() method from the PluginProxyDelegate;

TEST=None
BUG=161286


Review URL: https://chromiumcodereview.appspot.com/11299147

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169781 0039d316-1c4b-4281-b951-d872f2087c98
2012-11-27 23:01:26 +00:00
raymes@chromium.org
d57fd38fb4 Various fixes to make ppapi_unittests pass again.
The following fixes are contained in this patch:
-Construction/destruction of ppapi globals has been moved to the thread
on which those globals are used (to prevent thread-safety CHECKs firing).
-Some tests for the state of the var tracker in the plugin have been moved
onto the plugin thread (to prevent thread-safety CHECKs firing).
-Fixed a crash in ppp_instance_private_proxy_unittest.cc which was due
to not passing a |PPP_Class_Deprecated| to |PPB_Var_Deprecated->CreateObject|
which is required when deleting a var on the plugin side.
-Set up a |PluginProxyDelegate| in |PluginGlobals| so that a channel to the
browser can be correctly obtained for unittests.

BUG=none
TEST=Ran ppapi_unittests


Review URL: https://chromiumcodereview.appspot.com/10913258

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157469 0039d316-1c4b-4281-b951-d872f2087c98
2012-09-19 00:55:42 +00:00
brettw@chromium.org
93df81ea49 Bluetooth API: improve discovery
This CL:
- eliminates unnecessary dispatches
- correctly handles devices that are discovered before interest is
registered

TEST=ran api test
BUG=133179

Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=150898

Review URL: https://chromiumcodereview.appspot.com/10815072

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151138 0039d316-1c4b-4281-b951-d872f2087c98
2012-08-10 22:22:46 +00:00
brettw@chromium.org
eccf8031b3 This implements the PPB_FileChooser resource as a new-style IPC-only resource.
Note that the new file name is file_chooser_resource in the proxy. I decided to drop the ppb_ prefix for the "new-style" files to help differentiate them, and also because it's technically wrong. PPB is an interface, and a resource "object" may support multiple interfaces. I think FooResource is easier to type and read.

Review URL: https://chromiumcodereview.appspot.com/10544089

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146737 0039d316-1c4b-4281-b951-d872f2087c98
2012-07-14 15:43:42 +00:00
raymes@chromium.org
72a1072525 This adds an interface for setting crash data from a plugin. It also provides an implementation for setting crash URLs.
BUG=134176
TEST=Added test case to sanity check API call. Also hooked up to flash and produced a crash and checked that the report included the document url (http://crash/reportdetail?reportid=1719cae3a745f633)


Review URL: https://chromiumcodereview.appspot.com/10681006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144516 0039d316-1c4b-4281-b951-d872f2087c98
2012-06-27 19:30:58 +00:00
brettw@chromium.org
2306303ade Propogate the UI language on the command line and expose to Flash.
This is just like the NPAPI plugin process and many of the other child
processes we have. I wire the command line parameter up to a new Flash setting.

TEST=manual
BUG=none

Review URL: https://chromiumcodereview.appspot.com/10541088

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141434 0039d316-1c4b-4281-b951-d872f2087c98
2012-06-11 18:10:37 +00:00
jschuh@chromium.org
f0ecb55024 Broker out PPAPI handle duplication
BUG=127449
Review URL: https://chromiumcodereview.appspot.com/10378057

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136686 0039d316-1c4b-4281-b951-d872f2087c98
2012-05-11 22:09:11 +00:00
brettw@chromium.org
8be45847f7 This adds a hang monitor for Pepper plugins. It monitors sync messages on the I/O thread of the renderer and sends a message to the browser if it's blocked for too long.
The browser will show an infobar allowing you to terminate the plugin.

BUG=122795

Review URL: https://chromiumcodereview.appspot.com/10014013

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132245 0039d316-1c4b-4281-b951-d872f2087c98
2012-04-13 19:49:29 +00:00