0
Commit Graph

60 Commits

Author SHA1 Message Date
OlivierLi
69f885bc45 Introduce experiment params for EnableHangWatcher trial.
This allows selective activation of hang watching on the different
supported threads.

Bug: 1034046
Change-Id: Iac18db82d162cc88b4ca78134b74cfec96340e33
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2288196
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Commit-Queue: Oliver Li <olivierli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#792386}
2020-07-28 19:59:14 +00:00
Matt Menke
5eac055995 Remove unnecessary net/url_request/ includes from content/.
With the advent of the network service, a lot fewer files use
net::URLRequest than before, but there are still a lot of left over
includes. This CL removes many such unused includes in content/.

This CL also removes a pair of "using" directives for classes that
are no longer in use (ProtocolHandlerMap,
URLRequestInterceptorScopedVector)

TBR=caseq@chromium.org

Bug: 1103784, 1104380
Change-Id: Id3e4c56f820e0b905c933fb1ca7f82b393180117
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2292817
Commit-Queue: Matt Menke <mmenke@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#788636}
2020-07-15 15:24:31 +00:00
Robert Sesek
7d0b49b0aa Move //services/service_manager/sandbox to //sandbox/policy.
Originally the sandbox policies lived in //content, but with
servicification this would create unwanted dependencies between
//services and //content. Instead, create a new //sandbox/policy
library to hold the sandbox integration code. This library can depend
on the low-level //sandbox routines, but not nice versa.

Tbr: ajgo@chromium.org (mechanical change rule)
Bug: 1097376
Change-Id: I1ca9ac0015a625197f2d3aae104e8f7aa78dcfd9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2272609
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Alex Gough <ajgo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#786385}
2020-07-08 18:31:27 +00:00
Olivier Li
19d8925bef Clarify calls to base::debug::Alias.
Also document the different possible uses of the function.

Bug:1078987

Change-Id: I42a8bbce598a2383b7779b4e4b3c54baf450173c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2185414
Commit-Queue: Oliver Li <olivierli@google.com>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#768351}
2020-05-13 17:57:55 +00:00
Sebastien Marchand
bd02bc29ef Reland "Make the coverage config reusable for generic profiling."
This reverts commit 212853047a.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Revert "Make the coverage config reusable for generic profiling."
>
> This reverts commit c7695f6312.
>
> Reason for revert: Possible reason for win10_chromium_x64_rel_ng failing builds with error:
>
> lld-link: error: undefined symbol: __llvm_profile_dump
> >>> referenced by .\..\..\base\test\clang_profiling.cc:23
> >>>               obj/base\base/clang_profiling.obj:(void __cdecl base::WriteClangProfilingProfile(void))
>
> Original change's description:
> > Make the coverage config reusable for generic profiling.
> >
> > Most of the coverage configuration can be re-used for general
> > Clang-based profiling (e.g. the profiling step of a PGO build).
> > This changes most of the |use_clang_coverage| checks to
> > |use_clang_profiling|.
> >
> > The toolchain opt-out option is still limited to the coverage
> > builds (grep for "toolchain_use_clang_coverage" in CodeSearch).
> > I.e. targets built simply with |use_clang_profiling=true| won't
> > be opted out by the clang_code_coverage_wrapper.py script.
> >
> > This CL is a pure refactoring with no functional change.
> > Getting profiling information from the sandboxed renderers work
> > this way:
> > - After creating a new child process the browser will open a
> >   profiling file for this process and pass the handle to the
> >   child via the SetProfilingProfile Mojo call (see change in
> >   content/browser/renderer_host/render_process_host_impl.cc).
> > - This process will used by the LLVM instrumentation to record
> >   profiling information.
> > - When terminating, child processes will call
> >   WriteClangProfilingProfile to write the data to the profiling
> >   data file.
> > - Once all the raw profile data files have been collected,
> >   they'll be merged (via the "llvm-profdata" tool) and used.
> >
> > Note that this isn't meant to be enabled into any build that
> > will be shipped to users (a profiling build is usually 10x
> > bigger than a normal build anyway, not really shippable).
> >
> > The goal of this refactoring is to make it possible to reuse
> > this mechanism for the instrumentation step of PGO builds.
> >
> > Bug: 1058979
> > Change-Id: If8321234f6b6f86befd81f6e9e068a342728d605
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2090493
> > Reviewed-by: Will Harris <wfh@chromium.org>
> > Reviewed-by: Nico Weber <thakis@chromium.org>
> > Reviewed-by: Scott Violet <sky@chromium.org>
> > Reviewed-by: Yuke Liao <liaoyuke@chromium.org>
> > Reviewed-by: Sajjad Mirza <sajjadm@chromium.org>
> > Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#749015}
>
> TBR=sky@chromium.org,thakis@chromium.org,wfh@chromium.org,sebmarchand@chromium.org,liaoyuke@chromium.org,sajjadm@chromium.org
>
> Change-Id: I6aaf638f6385afe35c488575aac84e3e952b76a3
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 1058979
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2096332
> Reviewed-by: Jeevan Shikaram <jshikaram@chromium.org>
> Commit-Queue: Jeevan Shikaram <jshikaram@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#749040}

TBR=sky@chromium.org,thakis@chromium.org,wfh@chromium.org,sebmarchand@chromium.org,liaoyuke@chromium.org,sajjadm@chromium.org,jshikaram@chromium.org

No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1058979
Change-Id: I5492c81b707e5741bd7c494893e3bc7953221263
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2097305
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Will Harris <wfh@chromium.org>
Reviewed-by: Yuke Liao <liaoyuke@chromium.org>
Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org>
Cr-Commit-Position: refs/heads/master@{#749185}
2020-03-11 15:53:36 +00:00
Jeevan Shikaram
212853047a Revert "Make the coverage config reusable for generic profiling."
This reverts commit c7695f6312.

Reason for revert: Possible reason for win10_chromium_x64_rel_ng failing builds with error:

lld-link: error: undefined symbol: __llvm_profile_dump
>>> referenced by .\..\..\base\test\clang_profiling.cc:23
>>>               obj/base\base/clang_profiling.obj:(void __cdecl base::WriteClangProfilingProfile(void))

Original change's description:
> Make the coverage config reusable for generic profiling.
> 
> Most of the coverage configuration can be re-used for general
> Clang-based profiling (e.g. the profiling step of a PGO build).
> This changes most of the |use_clang_coverage| checks to
> |use_clang_profiling|.
> 
> The toolchain opt-out option is still limited to the coverage
> builds (grep for "toolchain_use_clang_coverage" in CodeSearch).
> I.e. targets built simply with |use_clang_profiling=true| won't
> be opted out by the clang_code_coverage_wrapper.py script.
> 
> This CL is a pure refactoring with no functional change.
> Getting profiling information from the sandboxed renderers work
> this way:
> - After creating a new child process the browser will open a
>   profiling file for this process and pass the handle to the
>   child via the SetProfilingProfile Mojo call (see change in
>   content/browser/renderer_host/render_process_host_impl.cc).
> - This process will used by the LLVM instrumentation to record
>   profiling information.
> - When terminating, child processes will call
>   WriteClangProfilingProfile to write the data to the profiling
>   data file.
> - Once all the raw profile data files have been collected,
>   they'll be merged (via the "llvm-profdata" tool) and used.
> 
> Note that this isn't meant to be enabled into any build that
> will be shipped to users (a profiling build is usually 10x
> bigger than a normal build anyway, not really shippable).
> 
> The goal of this refactoring is to make it possible to reuse
> this mechanism for the instrumentation step of PGO builds.
> 
> Bug: 1058979
> Change-Id: If8321234f6b6f86befd81f6e9e068a342728d605
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2090493
> Reviewed-by: Will Harris <wfh@chromium.org>
> Reviewed-by: Nico Weber <thakis@chromium.org>
> Reviewed-by: Scott Violet <sky@chromium.org>
> Reviewed-by: Yuke Liao <liaoyuke@chromium.org>
> Reviewed-by: Sajjad Mirza <sajjadm@chromium.org>
> Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#749015}

TBR=sky@chromium.org,thakis@chromium.org,wfh@chromium.org,sebmarchand@chromium.org,liaoyuke@chromium.org,sajjadm@chromium.org

Change-Id: I6aaf638f6385afe35c488575aac84e3e952b76a3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1058979
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2096332
Reviewed-by: Jeevan Shikaram <jshikaram@chromium.org>
Commit-Queue: Jeevan Shikaram <jshikaram@chromium.org>
Cr-Commit-Position: refs/heads/master@{#749040}
2020-03-11 04:00:46 +00:00
Sebastien Marchand
c7695f6312 Make the coverage config reusable for generic profiling.
Most of the coverage configuration can be re-used for general
Clang-based profiling (e.g. the profiling step of a PGO build).
This changes most of the |use_clang_coverage| checks to
|use_clang_profiling|.

The toolchain opt-out option is still limited to the coverage
builds (grep for "toolchain_use_clang_coverage" in CodeSearch).
I.e. targets built simply with |use_clang_profiling=true| won't
be opted out by the clang_code_coverage_wrapper.py script.

This CL is a pure refactoring with no functional change.
Getting profiling information from the sandboxed renderers work
this way:
- After creating a new child process the browser will open a
  profiling file for this process and pass the handle to the
  child via the SetProfilingProfile Mojo call (see change in
  content/browser/renderer_host/render_process_host_impl.cc).
- This process will used by the LLVM instrumentation to record
  profiling information.
- When terminating, child processes will call
  WriteClangProfilingProfile to write the data to the profiling
  data file.
- Once all the raw profile data files have been collected,
  they'll be merged (via the "llvm-profdata" tool) and used.

Note that this isn't meant to be enabled into any build that
will be shipped to users (a profiling build is usually 10x
bigger than a normal build anyway, not really shippable).

The goal of this refactoring is to make it possible to reuse
this mechanism for the instrumentation step of PGO builds.

Bug: 1058979
Change-Id: If8321234f6b6f86befd81f6e9e068a342728d605
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2090493
Reviewed-by: Will Harris <wfh@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Yuke Liao <liaoyuke@chromium.org>
Reviewed-by: Sajjad Mirza <sajjadm@chromium.org>
Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org>
Cr-Commit-Position: refs/heads/master@{#749015}
2020-03-11 01:43:35 +00:00
Olivier Li
26dede5075 Create trial for HangWatcher.
When the feature is activated HangWatcher will monitor the IOThread
instead of ThreadWatcher. The individual MessageLoop implementations are
instrumented to cover all platforms for the handling of events and
ThreadControllerWithMessagePumpImpl is instrumented to cover the task
execution.

Shutdown hang watching is still covered by ShutdownWatcherHelper.

Bug: 1034046
Change-Id: Ie797a1d1c4ce3b438878ad18e91347ccd02daccf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2046404
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Commit-Queue: Oliver Li <olivierli@google.com>
Cr-Commit-Position: refs/heads/master@{#745143}
2020-02-27 19:33:59 +00:00
Alex Gough
9ab468a6c3 Use enum class for service_manager::SandboxType.
Removes unused kNaClLoader (was PROCESS_TYPE_NACL_LOADER)
from Windows as these are in fact Ppapi (PPAPI) sandbox types.

Removes unused values from SandboxType enum and replaces default cases.

SandboxType is not used for iteration so these boundary values are removed
from the SandboxType enum.

The kInvalid SandboxType is retained as it is used as an error case in
a couple of places. It might be possible to remove this in the future.

This removes default cases from switch statements where it might make
sense to have a notification in future when new sandbox types are added.
In these cases the default case is replaced with all otherwise
unchecked cases, so retaining the existing behavior.

Change-Id: I76ffc8ae617f3f8fa9aa68236551ebcfa4cce32f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1938076
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Will Harris <wfh@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Alex Gough <ajgo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#723425}
2019-12-10 19:10:22 +00:00
Gabriel Charette
70e0e65927 [BrowserThread] Remove unused SetIOThreadDelegate method
The last caller was removed in crrev.com/669295.


Bug: 934009
Change-Id: I3cabd207d231c95787ad4511abbf296fa39feebb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1902271
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713581}
2019-11-07 20:56:30 +00:00
Kevin McNee
59127ab8b1 Use DVLOG for logging shutdown time for the network service
A LOG(ERROR) was introduced in
https://chromium-review.googlesource.com/c/chromium/src/+/1069668/
for logging the shutdown time for the network service. This appears
to be for debugging/informational purposes, so we convert this to a
DVLOG.

Bug: 820996
Change-Id: I33d37b3e104763b3132b13cfb04c451607c84ad0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1709952
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Kevin McNee <mcnee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#679258}
2019-07-19 21:06:36 +00:00
Carlos Caballero
e840fc3ea0 Add multiple task queues for the IO thread
This will enable the same scheduling capabilities as we already have on
the UI thread.

Bug: 863341
Change-Id: Ice34f614d78321caabf0fac3c6b1d6a621abb712
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1598813
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Alex Clarke <alexclarke@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Carlos Caballero <carlscab@google.com>
Cr-Commit-Position: refs/heads/master@{#663539}
2019-05-27 14:16:37 +00:00
Robbie McElrath
e52a555111 Change kMaxSecondsToWaitForNetworkProcess to 1 second on ChromeOS.
This should reduce the number of shutdown hangs we're seeing with the
network service enabled. According to UMA, ~99.9% of all shutdowns
complete within 1s on ChromeOS.

Bug: 963512
Change-Id: Iec10ca59349be9d6fbbe2d1294f4aaf585711d3c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1613121
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Robbie McElrath <rmcelrath@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659980}
2019-05-15 17:07:25 +00:00
Yuke Liao
354a8059e1 [code coverage] Increase timeouts of browser_tests for coverage build
The coverage build is about 10x slower than regular build when running
browser_tests, and this CL increases the timeouts accordingly.

Bug: 937521
Change-Id: I5939648142f29fbd9fe36625d661cc70ff6019e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1504153
Commit-Queue: Yuke Liao <liaoyuke@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Max Moroz <mmoroz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638433}
2019-03-07 05:33:36 +00:00
Michael Spang
df1aafa964 Opt into base::ThreadPriority::DISPLAY for all ozone builds
Some ozone builds (e.g. Chromecast) are not prioritizing latency
sensitive graphics work properly due to narrowly scoped #ifdefs.
Expand them to apply to all ozone builds.

This changes the portion of wall time the UI thread spends waiting
to run from ~19% to ~7% in a simple fling benchmark on Google Home Hub.

Bug: 937462

Change-Id: I59555bcad610e6b95d916f129dbd6db497d55970
Reviewed-on: https://chromium-review.googlesource.com/c/1497297
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Alex Sakhartchouk <alexst@chromium.org>
Commit-Queue: Michael Spang <spang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#637131}
2019-03-02 16:09:43 +00:00
Sebastien Marchand
f8cbfab434 Include base/bind.h in the files that use it (in //content).
Gab, 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=gab@chromium.org

Change-Id: I6cca9dff7fa4937fd7accdc57fe774674f6c147b
Reviewed-on: https://chromium-review.googlesource.com/c/1437100
Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626088}
2019-01-25 16:02:30 +00:00
Etienne Pierre-Doray
5b5cddb4d2 [TaskScheduler]: Implement AssertLongCPUWorkAllowed.
Use case: An expensive function wants to make sure it's not running on the UI
thread so the expensive operations don't block that thread.
This assertion fails on threads other than scheduler workers.

Bug: 879181
Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs
Change-Id: I2a7ec2442c2020da4d68605c2476a01d25a45a33
Reviewed-on: https://chromium-review.googlesource.com/1221787
Reviewed-by: François Doray <fdoray@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Reviewed-by: Eugene But <eugenebut@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593191}
2018-09-21 15:28:07 +00:00
David Bienvenu
1bd0f30631 Update no-inlining for a clang-cl world
With VC++ marking a function as non-optimized with MSVC_DISABLE_OPTIMIZE would
prevent it from being inlined, however with clang-cl that does not work,
leading to confusing crash stacks.

The fix is to remove MSVC_DISABLE_OPTIMIZE; these functions were already marked
as NOINLINE.

Bug: 873359
Change-Id: I00995a17463572545933956cdec0e7e13825abe7
Reviewed-on: https://chromium-review.googlesource.com/1182302
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: David Bienvenu <davidbienvenu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584607}
2018-08-21 02:46:26 +00:00
Mohsen Izadi
8b9d29e9d3 Use HostGpuMemoryBufferManager in content
This change replaces usage of content::BrowserGpuMemoryBufferManager
with viz::HostGpuMemoryBufferManager.

With this change BrowserGpuMemoryBufferManager is not needed anymore and
code to handle buffer allocation in GpuProcessHost is also removed.

BUG=733482

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I6a9387e2e33a5d98d4ed7559618f4995256bafa4
Reviewed-on: https://chromium-review.googlesource.com/1095815
Commit-Queue: Mohsen Izadi <mohsen@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: kylechar <kylechar@chromium.org>
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584455}
2018-08-20 15:34:26 +00:00
John Abd-El-Malek
1efb28fb17 Launch unsandboxed network service in a job object to avoid the process outliving the browser.
Currently many layout test runs are flaking because swarming is not expecting child processes to outlive the browser. This is happening because TerminateProcess fails sometimes because there's pending I/O.

Bug: 820996
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: I7595c131faccae03c268cde1139394c0ad48a7b4
Reviewed-on: https://chromium-review.googlesource.com/1071100
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Penny MacNeil <pennymac@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#562058}
2018-05-25 23:27:39 +00:00
John Abd-El-Malek
9edd464609 Fix waiting for network process at browser shutdown.
The previous fix in r560368 didn't work, as the BrowserChildProcessHostImpl::TerminateAll removed all the UtilityProcessHost objects first.

Bug: 820996, 820969
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: I88ba647e911c8f7e8d9458b60021aa6d915ccfa0
Reviewed-on: https://chromium-review.googlesource.com/1069668
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560938}
2018-05-23 04:24:28 +00:00
Xi Han
6740d6248c Reland "Create BrowserThread::IO thread before browser main loop to start"
This is a reland of I23ef57eb52bfb1eb363682dadf98c571c12afcd1.

It was reverted in Ia548067acbf640010f4c8fbed29a0012a274af05. Reason for revert:
Findit (https://goo.gl/kROfz5) identified this CL at revision 557680 as the culprit
for introducing flakiness in the tests as shown on:
https://findit-for-me.appspot.com/waterfall/flake/flake-culprit?key=ag9zfmZpbmRpdC1mb3ItbWVyQwsSDEZsYWtlQ3VscHJpdCIxY2hyb21pdW0vZmM5NTUwMWZiMjllM2U3NDg3ZmZmOThjMTdlNmFhYmExMDQ2YjMzMAw

The data race has been fixed in:
https://chromium-review.googlesource.com/c/chromium/src/+/1064450.

Original change's description:
> Create BrowserThread::IO thread before browser main loop to start
> ServiceManager.
>
> We need a thread to post/execute tasks when starting the
> ServiceManager. This thread needs to be created before the browser
> main loop is initialized, and will be registered as the
> BrowserThread::IO thread which is currently used by ServiceManager
> connections.
>
> The creation of such a thread is moved to service_manager::main via
> MainDelegate::CreateIOThreadAndGetTaskRunner(). Since it requires no
> thread created before calling fork() on posix, we also move the setup
> of sandbox before creating the IO thread.
>
> Bug: 740677, 729596
> Change-Id: I23ef57eb52bfb1eb363682dadf98c571c12afcd1
> Reviewed-on: https://chromium-review.googlesource.com/969098
> Commit-Queue: Xi Han <hanxi@chromium.org>
> Reviewed-by: John Abd-El-Malek <jam@chromium.org>
> Reviewed-by: Gabriel Charette <gab@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#557680}


Bug: 740677, 729596
Change-Id: I9afb0cdc0f11a1d437c2e9bd09c374503c3d5a4b
Reviewed-on: https://chromium-review.googlesource.com/1059949
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Xi Han <hanxi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560724}
2018-05-22 19:21:07 +00:00
John Abd-El-Malek
c840aa8d5e Wait on the network process at shutdown.
This gives the child process time to flush I/O. This can help avoid the OS restarting in the middle
of flushing data. It's also needed because swarming jobs fail when the browser quits with child
processes still alive.

An example flake is
https://chromium-swarm.appspot.com/task?id=3d8cd8e056a4b310&refresh=10&show_raw=1. Roughly half of
the layout test runs on Win Mojo are flaking as a result.

Bug: 820996
Change-Id: I9c3b13f83c716f020f555cbe2aa14e20c8825ed3
Reviewed-on: https://chromium-review.googlesource.com/1066622
Reviewed-by: Steven Holte <holte@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560368}
2018-05-21 22:00:38 +00:00
Chris Pickel
5d76e33d69 Revert "Create BrowserThread::IO thread before browser main loop to start"
This reverts commit fc95501fb2.

Reason for revert:
Findit (https://goo.gl/kROfz5) identified this CL at revision 557680 as the culprit
for introducing flakiness in the tests as shown on:
https://findit-for-me.appspot.com/waterfall/flake/flake-culprit?key=ag9zfmZpbmRpdC1mb3ItbWVyQwsSDEZsYWtlQ3VscHJpdCIxY2hyb21pdW0vZmM5NTUwMWZiMjllM2U3NDg3ZmZmOThjMTdlNmFhYmExMDQ2YjMzMAw

Original change's description:
> Create BrowserThread::IO thread before browser main loop to start
> ServiceManager.
> 
> We need a thread to post/execute tasks when starting the
> ServiceManager. This thread needs to be created before the browser
> main loop is initialized, and will be registered as the
> BrowserThread::IO thread which is currently used by ServiceManager
> connections.
> 
> The creation of such a thread is moved to service_manager::main via
> MainDelegate::CreateIOThreadAndGetTaskRunner(). Since it requires no
> thread created before calling fork() on posix, we also move the setup
> of sandbox before creating the IO thread.
> 
> Bug: 740677, 729596
> Change-Id: I23ef57eb52bfb1eb363682dadf98c571c12afcd1
> Reviewed-on: https://chromium-review.googlesource.com/969098
> Commit-Queue: Xi Han <hanxi@chromium.org>
> Reviewed-by: John Abd-El-Malek <jam@chromium.org>
> Reviewed-by: Gabriel Charette <gab@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#557680}

TBR=gab@chromium.org,jam@chromium.org,hanxi@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 740677, 729596
Change-Id: Ia548067acbf640010f4c8fbed29a0012a274af05
Reviewed-on: https://chromium-review.googlesource.com/1059167
Reviewed-by: Chris Pickel <sfiera@chromium.org>
Commit-Queue: Chris Pickel <sfiera@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558668}
2018-05-15 12:18:57 +00:00
Xi Han
fc95501fb2 Create BrowserThread::IO thread before browser main loop to start
ServiceManager.

We need a thread to post/execute tasks when starting the
ServiceManager. This thread needs to be created before the browser
main loop is initialized, and will be registered as the
BrowserThread::IO thread which is currently used by ServiceManager
connections.

The creation of such a thread is moved to service_manager::main via
MainDelegate::CreateIOThreadAndGetTaskRunner(). Since it requires no
thread created before calling fork() on posix, we also move the setup
of sandbox before creating the IO thread.

Bug: 740677, 729596
Change-Id: I23ef57eb52bfb1eb363682dadf98c571c12afcd1
Reviewed-on: https://chromium-review.googlesource.com/969098
Commit-Queue: Xi Han <hanxi@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557680}
2018-05-10 21:24:41 +00:00
Gabriel Charette
c20a9e88cf Re-add accidently removed NOINLINE attribute on UI/IOThreadRun methods
Accidently removed in https://chromium-review.googlesource.com/c/chromium/src/+/969104
when I moved the methods over from BrowserThreadImpl.

Not having it is likely the cause of the symbol vanishing in optimized
builds which causes crbug.com/824716.

TBR=jam@chromium.org

Bug: 824716
Change-Id: Ia53ec332140a7b21013b16765c8f9f0813930604
Reviewed-on: https://chromium-review.googlesource.com/986476
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#546854}
2018-03-29 18:26:04 +00:00
Gabriel Charette
9ed29db5e8 Make BrowserThreadImpl lock-less
Sampling profiler highlights high contention on this lock:
crbug.com/821034.

Initializing/tear down was already single-threaded (tear down had to be moved
from BrowserProcessSubThread::Cleanup() to ~BrowserProcessSubThread() to
enforce this with a ThreadChecker however). Add dchecks to confirm/enforce
this and remove the lock which is usuless on data structures that are now (as
of series of changes over the last year) read-only after startup.

Use atomics to protect reads across the RUNNING=>SHUTDOWN boundary.

Bug: 821034
Change-Id: I7800048bff51ad79cb10ee89fd3a0a31534c393e
Reviewed-on: https://chromium-review.googlesource.com/973556
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#546212}
2018-03-27 19:48:00 +00:00
Gabriel Charette
8eb4dff991 Reland "Refactor BrowserThreadImpl, BrowserProcessSubThread, and BrowserMainLoop"
This is a reland of d260e9cf66

It was reverted because of crbug.com/824716, these weren't new crashes
but known crashes mislabeled as a fallout of this change.
http://cl/190471699 fixes the crash backend to not rely on
"content::BrowserThreadImpl::IOThreadRun" being in the signature.

Only diff in this CL is to use base::debug::Alias() in methods that we
don't want optimized (i.e. IOThreadRun) out as CHECK_GT was seen as
optimized out in some of the reported crashes (even though the same
pattern as before was used by this CL..?)

Original change's description:
> Refactor BrowserThreadImpl, BrowserProcessSubThread, and BrowserMainLoop
>
> This brings back the invariant that BrowserThread::IO isn't available
> before BrowserMainLoop::CreateThreads(). This was broken to fix issue
> 729596 to bring up the thread earlier for ServiceManager but it is
> important that code that posts to BrowserThread::IO statically have an
> happens-after relationship to BrowserMainLoop::CreateThreads(). Exposing
> it statically earlier put that invariant at risk.
>
> Thankfully fixing issue 815225 resulted in finally reaching the long
> sought goal of only having BrowserThread::UI/IO. Now that the IO thread
> is also kicked off before it's named statically, BrowserThreadImpl no
> longer needs to be a base::Thread, hence this refactoring.
>
> Before this CL:
>  * BrowserThreadImpl was a base::Thread
>    (could be a fake thread if SetMessageLoop was used)
>  * BrowserProcessSubThread was a BrowserThreadImpl
>    (performed a bit more initialization)
>  * BrowserProcessSubThread was only used in production (in
>    BrowserMainLoop)
>  * BrowserThreadImpl was used for fake threads (BrowserMainLoop for
>    BrowserThread::UI) and for testing (TestBrowserThread(Impl)).
>  * BrowserThreadImpl overrode Init/Run/CleanUp() from base::Thread to
>    perform some sanity checks as well as drive IOThread's Delegate (ref.
>    BrowserThread::SetIOThreadDelegate())
>  * BrowserProcessSubThread re-overrode Init/Run/CleanUp() to perform
>    per-thread //content initialization (tests missed out on that per
>    TestBrowserThread bypassing BrowserProcessSubThread by directly
>    subclassing BrowserThreadImpl).
>
> With this CL:
>  * BrowserThreadImpl is merely a scoped object that binds a provided
>    SingleThreadTaskRunner to a BrowserThread::ID.
>  * BrowserProcessSubThread is a base::Thread and performs all of the
>    initialization and cleanup specific to //content (this means it now
>    also manages BrowserThread::SetIOThreadDelegate())
>  * BrowserProcessSubThread can be brought up early before being bound to
>    a BrowserThread::ID (BrowserMainLoop handles that through
>    BrowserProcessSubThread ::RegisterAsBrowserThread())
>
> Unfortunate exceptions required for this CL:
>  * IOThread::Init() (invoked through BrowserThreadDelegate) perfoms
>    blocking operations this was previously performed before installed
>    the ThreadRestrictions on BrowserThread::IO. But now that //content
>    is initialized after bringing up the thread, a
>    base::ScopedAllowBlocking is required in scope of IOThread::Init().
>  * TestBrowserThread previously bypassing BrowserProcessSubThread by
>    directly subclassing BrowserThreadImpl meant it wasn't subject to
>    ThreadRestrictions (unfortunate becomes it denies allowance
>    verification to product code running in unit tests). Adding it back
>    causes DCHECKs, as such
>    BrowserProcessSubThread::AllowBlockingForTesting was added to allow
>    this CL to pass CQ.
>
> Of note:
>  * BrowserProcessSubThread is still written as though it supports many
>    BrowserThread::IDs but in practice it's mostly always
>    BrowserThread::IO (except in ThreadWatcherTest I think). This change
>    was big enough that I didn't bother also breaking that
>    generalization.
>  * BrowserThreadImpl's constructor was made private to ensure only
>    BrowserProcessSubThread and a few select callers get to drive it (to
>    avoid previous missed initialization issues)
>  * Atomics to manage BrowserThread::SetIOThreadDelegate were removed.
>    Restriction was instead added that this only be called before
>    initialization and after shutdown (this was already the case).
>
> Follow-ups to this CL:
>  * //ios duplicates this logic and will need to undergo the same change
>    as a follow-up
>  * Fixing ios will allow removal of base::Thread::SetMessageLoop hack :)
>  * Removing BrowserThreadGlobals::lock_ to address crbug.com/821034 will
>    be much easier
>  * BrowserThread post APIs should DCHECK rather than no-op if using a
>    BrowserThread::ID before it's registered.
>
> Bug: 815225, 821034, 729596
> Change-Id: If1038f23079df72203b1e95c7d26647f8824a726
> Reviewed-on: https://chromium-review.googlesource.com/969104
> Reviewed-by: John Abd-El-Malek <jam@chromium.org>
> Commit-Queue: Gabriel Charette <gab@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#544440}

TBR=jam@chromium.org

Bug: 815225, 821034, 729596, 824716
Change-Id: I9a180975c69a008f8519d1d3d44663aa58a74a92
Reviewed-on: https://chromium-review.googlesource.com/980793
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#546104}
2018-03-27 14:22:54 +00:00
Matt Falkenhagen
fa239c8c41 Revert "Refactor BrowserThreadImpl, BrowserProcessSubThread, and BrowserMainLoop"
This reverts commit d260e9cf66.

Reason for revert: In Windows Canary versions since 67.0.3377.0, where this commit landed, IO thread hang reports have spiked dramatically. It is now the  browser crash report on Windows Canary at 33% of reports. I'm speculatively reverting this to see if the crash rate heals.

Original change's description:
> Refactor BrowserThreadImpl, BrowserProcessSubThread, and BrowserMainLoop
>
> This brings back the invariant that BrowserThread::IO isn't available
> before BrowserMainLoop::CreateThreads(). This was broken to fix issue
> 729596 to bring up the thread earlier for ServiceManager but it is
> important that code that posts to BrowserThread::IO statically have an
> happens-after relationship to BrowserMainLoop::CreateThreads(). Exposing
> it statically earlier put that invariant at risk.
>
> Thankfully fixing issue 815225 resulted in finally reaching the long
> sought goal of only having BrowserThread::UI/IO. Now that the IO thread
> is also kicked off before it's named statically, BrowserThreadImpl no
> longer needs to be a base::Thread, hence this refactoring.
>
> Before this CL:
>  * BrowserThreadImpl was a base::Thread
>    (could be a fake thread if SetMessageLoop was used)
>  * BrowserProcessSubThread was a BrowserThreadImpl
>    (performed a bit more initialization)
>  * BrowserProcessSubThread was only used in production (in
>    BrowserMainLoop)
>  * BrowserThreadImpl was used for fake threads (BrowserMainLoop for
>    BrowserThread::UI) and for testing (TestBrowserThread(Impl)).
>  * BrowserThreadImpl overrode Init/Run/CleanUp() from base::Thread to
>    perform some sanity checks as well as drive IOThread's Delegate (ref.
>    BrowserThread::SetIOThreadDelegate())
>  * BrowserProcessSubThread re-overrode Init/Run/CleanUp() to perform
>    per-thread //content initialization (tests missed out on that per
>    TestBrowserThread bypassing BrowserProcessSubThread by directly
>    subclassing BrowserThreadImpl).
>
> With this CL:
>  * BrowserThreadImpl is merely a scoped object that binds a provided
>    SingleThreadTaskRunner to a BrowserThread::ID.
>  * BrowserProcessSubThread is a base::Thread and performs all of the
>    initialization and cleanup specific to //content (this means it now
>    also manages BrowserThread::SetIOThreadDelegate())
>  * BrowserProcessSubThread can be brought up early before being bound to
>    a BrowserThread::ID (BrowserMainLoop handles that through
>    BrowserProcessSubThread ::RegisterAsBrowserThread())
>
> Unfortunate exceptions required for this CL:
>  * IOThread::Init() (invoked through BrowserThreadDelegate) perfoms
>    blocking operations this was previously performed before installed
>    the ThreadRestrictions on BrowserThread::IO. But now that //content
>    is initialized after bringing up the thread, a
>    base::ScopedAllowBlocking is required in scope of IOThread::Init().
>  * TestBrowserThread previously bypassing BrowserProcessSubThread by
>    directly subclassing BrowserThreadImpl meant it wasn't subject to
>    ThreadRestrictions (unfortunate becomes it denies allowance
>    verification to product code running in unit tests). Adding it back
>    causes DCHECKs, as such
>    BrowserProcessSubThread::AllowBlockingForTesting was added to allow
>    this CL to pass CQ.
>
> Of note:
>  * BrowserProcessSubThread is still written as though it supports many
>    BrowserThread::IDs but in practice it's mostly always
>    BrowserThread::IO (except in ThreadWatcherTest I think). This change
>    was big enough that I didn't bother also breaking that
>    generalization.
>  * BrowserThreadImpl's constructor was made private to ensure only
>    BrowserProcessSubThread and a few select callers get to drive it (to
>    avoid previous missed initialization issues)
>  * Atomics to manage BrowserThread::SetIOThreadDelegate were removed.
>    Restriction was instead added that this only be called before
>    initialization and after shutdown (this was already the case).
>
> Follow-ups to this CL:
>  * //ios duplicates this logic and will need to undergo the same change
>    as a follow-up
>  * Fixing ios will allow removal of base::Thread::SetMessageLoop hack :)
>  * Removing BrowserThreadGlobals::lock_ to address crbug.com/821034 will
>    be much easier
>  * BrowserThread post APIs should DCHECK rather than no-op if using a
>    BrowserThread::ID before it's registered.
>
> Bug: 815225, 821034, 729596
> Change-Id: If1038f23079df72203b1e95c7d26647f8824a726
> Reviewed-on: https://chromium-review.googlesource.com/969104
> Reviewed-by: John Abd-El-Malek <jam@chromium.org>
> Commit-Queue: Gabriel Charette <gab@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#544440}

TBR=gab@chromium.org,jam@chromium.org
NOPRESUBMIT=true

# Not skipping CQ checks because original CL landed > 1 day ago.
# falken: Skipping presubmit to use deprecated ThreadResrictions::DisallowWaiting().

Bug: 815225, 821034, 729596
Change-Id: I2be97c5d8183497c005ab397c871f625b034d850
Reviewed-on: https://chromium-review.googlesource.com/979752
Commit-Queue: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545725}
2018-03-26 04:21:19 +00:00
Gabriel Charette
d260e9cf66 Refactor BrowserThreadImpl, BrowserProcessSubThread, and BrowserMainLoop
This brings back the invariant that BrowserThread::IO isn't available
before BrowserMainLoop::CreateThreads(). This was broken to fix issue
729596 to bring up the thread earlier for ServiceManager but it is
important that code that posts to BrowserThread::IO statically have an
happens-after relationship to BrowserMainLoop::CreateThreads(). Exposing
it statically earlier put that invariant at risk.

Thankfully fixing issue 815225 resulted in finally reaching the long
sought goal of only having BrowserThread::UI/IO. Now that the IO thread
is also kicked off before it's named statically, BrowserThreadImpl no
longer needs to be a base::Thread, hence this refactoring.

Before this CL:
 * BrowserThreadImpl was a base::Thread
   (could be a fake thread if SetMessageLoop was used)
 * BrowserProcessSubThread was a BrowserThreadImpl
   (performed a bit more initialization)
 * BrowserProcessSubThread was only used in production (in
   BrowserMainLoop)
 * BrowserThreadImpl was used for fake threads (BrowserMainLoop for
   BrowserThread::UI) and for testing (TestBrowserThread(Impl)).
 * BrowserThreadImpl overrode Init/Run/CleanUp() from base::Thread to
   perform some sanity checks as well as drive IOThread's Delegate (ref.
   BrowserThread::SetIOThreadDelegate())
 * BrowserProcessSubThread re-overrode Init/Run/CleanUp() to perform
   per-thread //content initialization (tests missed out on that per
   TestBrowserThread bypassing BrowserProcessSubThread by directly
   subclassing BrowserThreadImpl).

With this CL:
 * BrowserThreadImpl is merely a scoped object that binds a provided
   SingleThreadTaskRunner to a BrowserThread::ID.
 * BrowserProcessSubThread is a base::Thread and performs all of the
   initialization and cleanup specific to //content (this means it now
   also manages BrowserThread::SetIOThreadDelegate())
 * BrowserProcessSubThread can be brought up early before being bound to
   a BrowserThread::ID (BrowserMainLoop handles that through
   BrowserProcessSubThread ::RegisterAsBrowserThread())

Unfortunate exceptions required for this CL:
 * IOThread::Init() (invoked through BrowserThreadDelegate) perfoms
   blocking operations this was previously performed before installed
   the ThreadRestrictions on BrowserThread::IO. But now that //content
   is initialized after bringing up the thread, a
   base::ScopedAllowBlocking is required in scope of IOThread::Init().
 * TestBrowserThread previously bypassing BrowserProcessSubThread by
   directly subclassing BrowserThreadImpl meant it wasn't subject to
   ThreadRestrictions (unfortunate becomes it denies allowance
   verification to product code running in unit tests). Adding it back
   causes DCHECKs, as such
   BrowserProcessSubThread::AllowBlockingForTesting was added to allow
   this CL to pass CQ.

Of note:
 * BrowserProcessSubThread is still written as though it supports many
   BrowserThread::IDs but in practice it's mostly always
   BrowserThread::IO (except in ThreadWatcherTest I think). This change
   was big enough that I didn't bother also breaking that
   generalization.
 * BrowserThreadImpl's constructor was made private to ensure only
   BrowserProcessSubThread and a few select callers get to drive it (to
   avoid previous missed initialization issues)
 * Atomics to manage BrowserThread::SetIOThreadDelegate were removed.
   Restriction was instead added that this only be called before
   initialization and after shutdown (this was already the case).

Follow-ups to this CL:
 * //ios duplicates this logic and will need to undergo the same change
   as a follow-up
 * Fixing ios will allow removal of base::Thread::SetMessageLoop hack :)
 * Removing BrowserThreadGlobals::lock_ to address crbug.com/821034 will
   be much easier
 * BrowserThread post APIs should DCHECK rather than no-op if using a
   BrowserThread::ID before it's registered.

Bug: 815225, 821034, 729596
Change-Id: If1038f23079df72203b1e95c7d26647f8824a726
Reviewed-on: https://chromium-review.googlesource.com/969104
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544440}
2018-03-20 18:10:45 +00:00
boliu
61687ec5b7 android: Java-based launcher thread
A major part of android's ChildProcessLauncher is implemented in Java
so having an easy access to the launcher thread is important.

Refactor JavaHandlerThread in base so that that java part can be created
first, and then connected with native peer after consutrction. This is
needed because the launcher thread can be used before native library is
loaded.

Add LauncherThread in content which is a simple wrapper around
JavaHandlerThread. Then for android, override the launcher thread
message loop. Note this means the launcher thread will no longer be
joined on shutdown, but this is not a problem in practice since android
never does clean shutdowns.

Convert two cases of random background threads in ChildProcessLauncher
to use LauncherThread. There are more in the future.

BUG=701442

Review-Url: https://codereview.chromium.org/2774363003
Cr-Commit-Position: refs/heads/master@{#460509}
2017-03-29 20:09:34 +00:00
falken
eb3de882fc Revert of Check that all shared workers are terminated. (patchset id:170001 of https://c… (patchset id:1 of https://codereview.chromium.org/2364113003/ )
Reason for revert:
These temporary CHECKs can be removed because they are passing on Canary.

Original issue's description:
> Reland of Check that all shared workers are terminated. (patchset  id:170001 of https://c… (patchset  id:1 of https://codereview.chromium.org/2338113002/ )
>
> Reason for revert:
> Relanding after the attempted fix in https://crrev.com/04a6912a1a2b77faf61e4b2514b9ecff74ee1f21
>

TBR=horo@chromium.org,jam@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=636377

Review-Url: https://codereview.chromium.org/2385053002
Cr-Commit-Position: refs/heads/master@{#422359}
2016-10-03 02:14:24 +00:00
falken
7142fe697d Reland of Check that all shared workers are terminated. (patchset id:170001 of https://c… (patchset id:1 of https://codereview.chromium.org/2338113002/ )
Reason for revert:
Relanding after the attempted fix in https://crrev.com/04a6912a1a2b77faf61e4b2514b9ecff74ee1f21

Original issue's description:
> Revert "Reland of Check that all shared workers are terminated. (patchset  id:170001 of https://codereview.chromium.org/2254963002/ )"
>
> This reverts commit d1109b15f8.
>
> The crash rate is too high and polluting crash report data.
> I'll reland it when the fix lands.
>
> BUG=636377
> TBR=jam
>
> Committed: https://crrev.com/2639679013cd3c2bbf7603cd805a0ba3641f7055
> Cr-Commit-Position: refs/heads/master@{#418462}

TBR=horo@chromium.org,jam@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=636377

Review-Url: https://codereview.chromium.org/2364113003
Cr-Commit-Position: refs/heads/master@{#420848}
2016-09-24 17:06:12 +00:00
falken
2639679013 Revert "Reland of Check that all shared workers are terminated. (patchset id:170001 of https://codereview.chromium.org/2254963002/ )"
This reverts commit d1109b15f8.

The crash rate is too high and polluting crash report data.
I'll reland it when the fix lands.

BUG=636377
TBR=jam

Review-Url: https://codereview.chromium.org/2338113002
Cr-Commit-Position: refs/heads/master@{#418462}
2016-09-14 02:52:15 +00:00
horo
d1109b15f8 Reland of Check that all shared workers are terminated. (patchset id:170001 of https://codereview.chromium.org/2254963002/ )
Reason for revert:
Shared Worker bug fix patch landed.
https://codereview.chromium.org/2249173003/

BUG=639193

Original issue's description:
> Revert of Check that all shared workers are terminated. (patchset  id:1 of https://codereview.chromium.org/2222063002/ )
>
> Reason for revert:
> Reverting temporary instrumentation following investigation
>
> We want to get this in prior to dev branch.
>
> BUG=636377
>
> Original issue's description:
> > Check that all shared workers are terminated.
> >
> > Adds temporary checks to determine whether shared workers
> > prevent RenderProcessHost(s) from cleaning up due to
> > RenderProcessHostImpl::worker_ref_count_ > 0.
> >
> > BUG=608049
> >
> > Committed: https://crrev.com/529173d1bbeb53b3f9438648fad264b4db042721
> > Cr-Commit-Position: refs/heads/master@{#410730}
>
> TBR=atwilson@chromium.org,jam@chromium.org,horo@chromium.org,alokp@chromium.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=608049
>
> Committed: https://crrev.com/463ac7e96bf55b106225481811b0db752284bbed
> Cr-Commit-Position: refs/heads/master@{#412660}

TBR=atwilson@chromium.org,jam@chromium.org,alokp@chromium.org,erikchen@chromium.org,manzagop@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=636377

Review-Url: https://codereview.chromium.org/2286003002
Cr-Commit-Position: refs/heads/master@{#414952}
2016-08-28 02:45:32 +00:00
manzagop
463ac7e96b Revert of Check that all shared workers are terminated. (patchset id:1 of https://codereview.chromium.org/2222063002/ )
Reason for revert:
Reverting temporary instrumentation following investigation

We want to get this in prior to dev branch.

BUG=636377

Original issue's description:
> Check that all shared workers are terminated.
>
> Adds temporary checks to determine whether shared workers
> prevent RenderProcessHost(s) from cleaning up due to
> RenderProcessHostImpl::worker_ref_count_ > 0.
>
> BUG=608049
>
> Committed: https://crrev.com/529173d1bbeb53b3f9438648fad264b4db042721
> Cr-Commit-Position: refs/heads/master@{#410730}

TBR=atwilson@chromium.org,jam@chromium.org,horo@chromium.org,alokp@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=608049

Review-Url: https://codereview.chromium.org/2254963002
Cr-Commit-Position: refs/heads/master@{#412660}
2016-08-17 22:14:26 +00:00
alokp
529173d1bb Check that all shared workers are terminated.
Adds temporary checks to determine whether shared workers
prevent RenderProcessHost(s) from cleaning up due to
RenderProcessHostImpl::worker_ref_count_ > 0.

BUG=608049

Review-Url: https://codereview.chromium.org/2222063002
Cr-Commit-Position: refs/heads/master@{#410730}
2016-08-09 17:43:10 +00:00
jam
e1f453c803 Remove iOS ifdefs in src/content.
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation

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

Cr-Commit-Position: refs/heads/master@{#382296}
2016-03-21 15:52:47 +00:00
reveman
84c4caf913 content: Add GpuMemoryBuffer MemoryDumpProvider implementation.
Includes a minor GpuMemoryBufferImpl refactor to provide the
manager with an estimated buffer size.

BUG=481203

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

Cr-Commit-Position: refs/heads/master@{#327968}
2015-05-01 20:11:00 +00:00
msarda@chromium.org
ef7557ba6d Build browser_process_sub_thread.cc on iOS.
Adds browser_process_sub_thread.cc to the build on iOS and ifdefs out
BrowserChildProcessHostImpl::TerminateAll() as Chrome on iOS is
single-process.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161091 0039d316-1c4b-4281-b951-d872f2087c98
2012-10-10 12:28:22 +00:00
pkasting@chromium.org
451fd90d92 Use ScopedCOMInitializer in more places. While this doesn't always simplify code, it does mean we do consistent logging and error-checking at all these sites.
BUG=none
TEST=none
Review URL: https://codereview.chromium.org/11050009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159908 0039d316-1c4b-4281-b951-d872f2087c98
2012-10-03 17:14:48 +00:00
pkasting@chromium.org
435756b898 Just because we want to destroy a pointer somewhere other than a destructor doesn't mean we can't use a scoped_ptr for it. This saves an explicit initializer and makes the code parallel to the ScopedCOMInitializers I'll be adding next.
BUG=none
TEST=none
Review URL: https://codereview.chromium.org/10993056

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159556 0039d316-1c4b-4281-b951-d872f2087c98
2012-10-01 21:19:36 +00:00
alecflett@chromium.org
5c085eda07 Remove all the indexeddb-related utility process code
BUG=129471


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

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153336 0039d316-1c4b-4281-b951-d872f2087c98
2012-08-24 22:57:29 +00:00
ricow@chromium.org
f6c57d4e73 Revert 152873 - Remove all the indexeddb-related utility process code
BUG=129471


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

This seems to be causing test failure on Linux Tests (dbg)(1), first hit here:
http://build.chromium.org/p/chromium/builders/Linux%20Tests%20%28dbg%29%281%29/builds/20655/steps/browser_tests/logs/stdio

TBR=alecflett@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10873028

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152980 0039d316-1c4b-4281-b951-d872f2087c98
2012-08-23 10:47:07 +00:00
alecflett@chromium.org
8374250ef7 Remove all the indexeddb-related utility process code
BUG=129471


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152873 0039d316-1c4b-4281-b951-d872f2087c98
2012-08-22 23:48:57 +00:00
akalin@chromium.org
3dc1bc4dd6 Move content::URLFetcher static functions to net::URLFetcher
Remove content::URLFetcher.

Update all references.

Add explicit dependency on content_common from browser, since template_url_fetcher.cc calls AssociateURLFetcherWithRenderView
(there are probably other direct uses of content_common).

BUG=118220
TEST=
TBR=satorux@chromium.org,mnissler@chromium.org,mal@chromium.org,jhawkins@chromium.org,sky@chromium.org,rlp@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142926 0039d316-1c4b-4281-b951-d872f2087c98
2012-06-19 08:20:53 +00:00
willchan@chromium.org
ef2bf421b0 Stop refcounting URLRequestContext.
While doing so, fix a few issues with the code like ordering of URLRequestContext to ensure correct destruction order. Also fix const correctness in some places.

BUG=58859
TEST=none
TBR=willchan

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136497 0039d316-1c4b-4281-b951-d872f2087c98
2012-05-11 03:27:09 +00:00
jam@chromium.org
3a7b66d5ef Disallow UI/IO thread blocking on any other thread.
By design, there's no ScopedAllowWait that is reachable by all code. From experience with ScopedAllowIO, it will be abused. So instead the existing callers (which should all be fixed other than two) are friends with ThreadRestrictions.
Review URL: https://chromiumcodereview.appspot.com/10151009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134114 0039d316-1c4b-4281-b951-d872f2087c98
2012-04-26 16:34:16 +00:00
jam@chromium.org
4c01d49992 Rename BrowserChildProcessHost implementation class to BrowserChildProcessHostImpl.
BUG=98716
Review URL: https://chromiumcodereview.appspot.com/9117006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118758 0039d316-1c4b-4281-b951-d872f2087c98
2012-01-23 23:33:01 +00:00
jam@chromium.org
4967f79293 Add a Content API around BrowserChildProcessHost, similar to what was done with ChildProcessHost. Now classes like PluginProcessHost don't derive from it, but instead use composition.
I've also moved the iterator class into its own file in the public directory. Since classes don't derive from BrowserChildProcessHost and so can't static_cast from it, I added a template helper that does this.

BUG=98716
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=118415
Review URL: https://chromiumcodereview.appspot.com/9150017

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118516 0039d316-1c4b-4281-b951-d872f2087c98
2012-01-20 22:14:40 +00:00