0
Commit Graph

32 Commits

Author SHA1 Message Date
Peter Boström
1d6a095400 Remove unused "base/macros.h" in content/
Removes `#include "base/macros.h"` from files in content/ that do not
contain `ignore_result(`.

Bug: 1010217
No-Try: true
Change-Id: I887403408704241047e3bd66e953ff7df195368b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3274993
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@{#940781}
2021-11-11 16:07:03 +00:00
Peter Boström
9b036533b6 Remove DISALLOW_* macros from content/
This inlines all remaining DISALLOW_* macros in content/. This is done
manually (vim regex + manually finding insertion position).

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

Bug: 1010217
Change-Id: I8b5ea6dd9f8a3f584cf3eef82634017a38b15be8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3193883
Commit-Queue: Peter Boström <pbos@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Auto-Submit: 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@{#936160}
2021-10-28 23:37:28 +00:00
Alex Gough
eb6a38f6fa Replace sandbox::policy::SandboxType with mojom Sandbox enum
sandbox.mojom.Sandbox can now be used as the sandbox type so we
replace it everywhere.

The guts of the change are in //sandbox/policy/sandbox_type.h where
SandboxType is now deleted, and //sandbox/policy/mojom/sandbox.mojom
where sandbox types that are not already used in mojom ServiceSandbox
attributes are added.

Some cascading changes:-

 - kService wasn't implemented on Mac (as it is equivalent to kUtility).
 As we cannot alias enum fields in mojo like we can in C++ I have added
 kService for Mac. The alternative is to define platform specific
 ServiceSandbox attributes for all kService interfaces which seems to
 put this complexity in the wrong place.
 - sandbox_type.h included a number of buildflag headers that other files
 then relied on. As sandbox_type.h is no longer needed in many places
 and no longer needs these defines, they have been introduced where
 required.
 - sandbox::mojom::Sandbox is forward declared in a couple of headers
 that are widely imported, hopefully reducing the number of times the
 mojom.h is included but not used.
 - some build deps must be modified.
 - LibAssistantService needs a sandbox to be defined even when hosted
 in process, so has kNoSandbox now when enable_cros_libassistant is
 false.

Bug: 1210301
Change-Id: I13fa4fa8cbbb3090a38806fe5532787bbdf1e2fb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3213677
Reviewed-by: Charlie Reis <creis@chromium.org>
Reviewed-by: Sean Topping <seantopping@chromium.org>
Reviewed-by: Filip Gorski <fgorski@chromium.org>
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Tao Wu <wutao@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Will Harris <wfh@chromium.org>
Reviewed-by: Matthew Denton <mpdenton@chromium.org>
Reviewed-by: David Dorwin <ddorwin@chromium.org>
Commit-Queue: Alex Gough <ajgo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#934126}
2021-10-22 01:55:13 +00:00
John Abd-El-Malek
b09daeecd3 More simplifications in content now that ProcessHostOnUI is the only path.
Bug: 904556
Change-Id: I811629156a2cc24d55e7f859d8881639dc8e4431
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3176490
Auto-Submit: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#924315}
2021-09-23 15:29:34 +00:00
Anton Bikineev
f62d1bf48e content: Replace base::Optional and friends with absl counterparts
This replaces:
- base::Optional -> absl::optional
- include "base/optional.h"
  ->
  include "third_party/abseil-cpp/absl/types/optional.h"
- base::nullopt -> absl::nullopt
- base::make_optional -> absl::make_optional

Bug: 1202909
Change-Id: Ie9f37bcbf6115632a19f4d063387d07b3723926f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2897246
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Owners-Override: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#883270}
2021-05-15 17:56:07 +00:00
John Abd-El-Malek
a1c30bc2ab Fix various browser_tests and content_browsertests to work when ProcessHost objects live on UI thread.
Bug: 904556
Change-Id: Id9dd20c6bc3d787119408be874411a254dc5d8e3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2828695
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Calder Kitagawa <ckitagawa@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#873077}
2021-04-15 22:31:19 +00:00
Peter Boström
dd7e40ec31 Apply modernize-make-unique to content/
This is a large-scale change: go/chromium-modernize-make-unique

Bug: 1194272
Change-Id: Id035e6a5058ab109a4333f1b8f8225da1c6989e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2803034
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/master@{#869261}
2021-04-05 20:40:10 +00:00
Guido Urdaneta
ef4e919472 Reland "Move base/test/bind_test_util.h to base/test/bind.h"
This reverts commit 8bd07a6cf9.

Reason for revert: This revert was incorrect and breaks the build.

Original change's description:
> Revert "Move base/test/bind_test_util.h to base/test/bind.h"
>
> This reverts commit a4493a6f80.
>
> Reason for revert: This CL breaks internal builds (e.g. /chrome/browser/media/kaleidoscope/internal/kaleidoscope_browsertest.cc).
>
> Original change's description:
> > Move base/test/bind_test_util.h to base/test/bind.h
> >
> > Stop relying on us to remember arcane file names when writing tests,
> > and repeating the directory hierarchy into the file name.
> >
> > R=​dcheng@chromium.org
> > TBR=
> > NOPRESUBMIT=true
> >
> > Change-Id: I49c951162939c7dcef44883bee740f94b2f49e09
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2523099
> > Commit-Queue: danakj <danakj@chromium.org>
> > Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#825145}
>
> TBR=danakj@chromium.org,dcheng@chromium.org
>
> # Not skipping CQ checks because original CL landed > 1 day ago.
>
> Change-Id: If165b8443662baa564895e994ea0d772348e6da6
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2526102
> Reviewed-by: Denis Kuznetsov [CET] <antrim@chromium.org>
> Commit-Queue: Denis Kuznetsov [CET] <antrim@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#825328}

TBR=danakj@chromium.org,dcheng@chromium.org,antrim@chromium.org

# Not skipping CQ checks because this is a reland.
NOPRESUBMIT=true
NOTREECHECK=true

No-Try: True
Change-Id: I6a8c0c8bbb1c8f87cc7f2df7a8b3388971292975
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2526683
Commit-Queue: Guido Urdaneta <guidou@chromium.org>
Reviewed-by: Guido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825329}
2020-11-09 15:06:24 +00:00
Denis Kuznetsov [CET]
8bd07a6cf9 Revert "Move base/test/bind_test_util.h to base/test/bind.h"
This reverts commit a4493a6f80.

Reason for revert: This CL breaks internal builds (e.g. /chrome/browser/media/kaleidoscope/internal/kaleidoscope_browsertest.cc).

Original change's description:
> Move base/test/bind_test_util.h to base/test/bind.h
>
> Stop relying on us to remember arcane file names when writing tests,
> and repeating the directory hierarchy into the file name.
>
> R=​dcheng@chromium.org
> TBR=
> NOPRESUBMIT=true
>
> Change-Id: I49c951162939c7dcef44883bee740f94b2f49e09
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2523099
> Commit-Queue: danakj <danakj@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#825145}

TBR=danakj@chromium.org,dcheng@chromium.org

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

Change-Id: If165b8443662baa564895e994ea0d772348e6da6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2526102
Reviewed-by: Denis Kuznetsov [CET] <antrim@chromium.org>
Commit-Queue: Denis Kuznetsov [CET] <antrim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825328}
2020-11-09 14:21:28 +00:00
danakj
a4493a6f80 Move base/test/bind_test_util.h to base/test/bind.h
Stop relying on us to remember arcane file names when writing tests,
and repeating the directory hierarchy into the file name.

R=dcheng@chromium.org
TBR=
NOPRESUBMIT=true

Change-Id: I49c951162939c7dcef44883bee740f94b2f49e09
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2523099
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825145}
2020-11-07 01:53:08 +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
Gabriel Charette
e7cdc5cd07 [BrowserThread] Migration callers without full content:: namespace
Note to QA: This CL is purely mechanical and shouldn't be blamed
for future regressions on touched files.

This is a follow-up to https://chromium-review.googlesource.com/c/chromium/src/+/2211138
which already removed all usage using content::BrowserThread.

Hence this script now matches unqualified BrowserThread:: without
risking having "content::" be selected as "traits_before" by the regex
(ran on same revision as step ).

content:: is now always added if outside namespace content {}
(deleting unused using content::BrowserThread; decls)

Script @ https://crbug.com/1026641#c92

(will TBR fdoray@ post-review for mechanical change)
TBR=fdoray@hchromium.org

AX-Relnotes: n/a.
Bug: 1026641
Change-Id: I51ae2f83eb17d19b54563fd9b4fc040d2aa0c948
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2212469
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772458}
2020-05-27 23:35:05 +00:00
Peter Kasting
919ce657e4 Add missing #includes of browser_test.h.
This is a step towards doing full IWYU of browser_test.h, which will
have other benefits.

Completely mechanical and already R+ed as part of r765923.

Tbr: sky
Bug: none
Change-Id: Icb7ab728098a6cf29c0920da4b524e96a7c024c2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2186411
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#766361}
2020-05-07 10:22:36 +00:00
Balazs Engedy
683d2c7a8f Revert "IWYU for browser_test.h."
This reverts commit 66a53c909a.

Reason for revert: Breaks compile on official branded builders.

Original change's description:
> IWYU for browser_test.h.
> 
> Include this directly in relevant test files.  This lets us convert the
> HAS_OUT_OF_PROC_TEST_RUNNER checks in this file and
> view_event_test_base.h into #errors, and force people to not even
> include this file in files that can't use it.
> 
> Bug: none
> Tbr: sky
> Change-Id: I86626099eb047eb53e8b3611de38ba6bebc01a0b
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2136117
> Commit-Queue: Peter Kasting <pkasting@chromium.org>
> Reviewed-by: Scott Violet <sky@chromium.org>
> Reviewed-by: Lei Zhang <thestig@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#765923}

TBR=sky@chromium.org,pkasting@chromium.org,thestig@chromium.org

Change-Id: I4583916602404c310a93f571dd2c78645c6bd567
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: none
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2184132
Reviewed-by: Balazs Engedy <engedy@chromium.org>
Commit-Queue: Balazs Engedy <engedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#765931}
2020-05-06 10:36:40 +00:00
Peter Kasting
66a53c909a IWYU for browser_test.h.
Include this directly in relevant test files.  This lets us convert the
HAS_OUT_OF_PROC_TEST_RUNNER checks in this file and
view_event_test_base.h into #errors, and force people to not even
include this file in files that can't use it.

Bug: none
Tbr: sky
Change-Id: I86626099eb047eb53e8b3611de38ba6bebc01a0b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2136117
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#765923}
2020-05-06 09:38:56 +00:00
Robert Sesek
db87a74b74 Add service_manager::Sandbox::IsProcessSandboxed()
This is a very basic check that can be used to verify that the current
process is running under any kind of sandbox.

Change-Id: Iaee3f2a97c4dae72714297dcdf23b37ff7c6fdf4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2147677
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Alex Gough <ajgo@chromium.org>
Reviewed-by: Matthew Denton <mpdenton@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#759667}
2020-04-16 14:46:12 +00:00
Daniel Cheng
6866631a54 Reland "Use base hooks to broker shared memory creation in sandboxed processes."
This is a reland of f5fbaedd6f

Original change's description:
> Use base hooks to broker shared memory creation in sandboxed processes.
>
> Bug: 876525
>
> Change-Id: Iaf48cc3a00390a72eff0730d0945e0a5838f01bd
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2081573
> Reviewed-by: Scott Violet <sky@chromium.org>
> Reviewed-by: Ken Rockot <rockot@google.com>
> Commit-Queue: Daniel Cheng <dcheng@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#748826}

Bug: 876525
Tbr: sky@chromium.org
Change-Id: I8f59cea33ff6a513eb4f105aa0c50b0791d7d6f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2101829
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#750156}
2020-03-13 14:35:33 +00:00
Daniel Cheng
2ad4298c83 Revert "Use base hooks to broker shared memory creation in sandboxed processes."
This reverts commit f5fbaedd6f.

Reason for revert: causes infinite recursion in cloud print service

Original change's description:
> Use base hooks to broker shared memory creation in sandboxed processes.
>
> Bug: 876525
>
> Change-Id: Iaf48cc3a00390a72eff0730d0945e0a5838f01bd
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2081573
> Reviewed-by: Scott Violet <sky@chromium.org>
> Reviewed-by: Ken Rockot <rockot@google.com>
> Commit-Queue: Daniel Cheng <dcheng@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#748826}

TBR=sky@chromium.org,dcheng@chromium.org,rockot@google.com,rsesek@chromium.org

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

Bug: 876525, 1061138
Change-Id: I366fc111c443c0c721248a15248c838cdd623ad5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2101977
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#750037}
2020-03-13 04:03:35 +00:00
Daniel Cheng
f5fbaedd6f Use base hooks to broker shared memory creation in sandboxed processes.
Bug: 876525

Change-Id: Iaf48cc3a00390a72eff0730d0945e0a5838f01bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2081573
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748826}
2020-03-10 19:22:57 +00:00
danakj
f416ce9d3b Convert content/browser/ Callbacks to {Once,Repeating}Callback
Use OnceCallback where possible because the callback is only used once
and RepeatingCallback and BindRepeating otherwise.

R=avi@chromium.org

Bug: 1007760
Change-Id: I3d02fded4b40cdc843ac89e057a34bdf3766b1bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1962545
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#723954}
2019-12-11 20:45:45 +00:00
Ken Rockot
b7201ce944 Move Utility process interfaces off Service Manager
These are now exposed to the ChildProcess BindReceiver API on the
UtilityProcessHost, via ChildThreadImpl::ExposeInterfacesToBrowser.

Bug: 977637
Change-Id: Ib214f80d9ec3ae1e54fb63a04f06be77fa6fb7c0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1903594
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#715367}
2019-11-14 19:56:46 +00:00
Julie Jeongeun Kim
29cb9cb731 Convert TestService to new Mojo types
This CL converts TestServicePtr and TestServiceRequest
to new Mojo types.

It uses Remote, PendingReceiver and Receiver instead of
QueryableDataStorePtr, QueryableDataStoreRequest and Binding.

Bug: 955171
Change-Id: I61f3d6b66ac6f5faffe533800bbe482a2db772ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1803948
Commit-Queue: Julie Kim <jkim@igalia.com>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Oksana Zhuravlova <oksamyt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697068}
2019-09-17 02:58:35 +00:00
Sami Kyostila
8e4d5a915e content/browser: Always specify thread affinity when posting tasks
*** Note: There is no behavior change from this patch. ***

The PostTask APIs will shortly be changed to require all tasks to explicitly
specify their thread affinity, i.e., whether the task should run on the thread
pool or a specific named thread such as a BrowserThread. This patch updates all
call sites with thread affinity annotation. We also remove the "WithTraits"
suffix to make the call sites more readable.

Before:

    // Thread pool task.
    base::PostTaskWithTraits(FROM_HERE, {...}, ...);

    // UI thread task.
    base::PostTaskWithTraits(FROM_HERE, {BrowserThread::UI, ...}, ...);

After:

    // Thread pool task.
    base::PostTask(FROM_HERE, {base::ThreadPool(), ...}, ...);

    // UI thread task.
    base::PostTask(FROM_HERE, {BrowserThread::UI, ...}, ...);

This patch was semi-automatically prepared with these steps:

    1. Patch in https://chromium-review.googlesource.com/c/chromium/src/+/1635827
       to make thread affinity a build-time requirement.
    2. Run an initial pass with a clang rewriter:
       https://chromium-review.googlesource.com/c/chromium/src/+/1635623
    3. ninja -C out/Debug | grep 'requested here' | cut -d: -f1-3 | sort | \
           uniq > errors.txt
    4. while read line; do
         f=$(echo $line | cut -d: -f 1)
         r=$(echo $line | cut -d: -f 2)
         c=$(echo $line | cut -d: -f 3)
         sed -i "${r}s/./&base::ThreadPool(),/$c" $f
       done < errors.txt
    5. GOTO 3 until build succeeds.
    6. Remove the "WithTraits" suffix from task API call sites:

       $ tools/git/mffr.py -i <(cat <<EOF
       [
         ["PostTaskWithTraits",                            "PostTask"],
         ["PostDelayedTaskWithTraits",                     "PostDelayedTask"],
         ["PostTaskWithTraitsAndReply",                    "PostTaskAndReply"],
         ["CreateTaskRunnerWithTraits",                    "CreateTaskRunner"],
         ["CreateSequencedTaskRunnerWithTraits",           "CreateSequencedTaskRunner"],
         ["CreateUpdateableSequencedTaskRunnerWithTraits", "CreateUpdateableSequencedTaskRunner"],
         ["CreateSingleThreadTaskRunnerWithTraits",        "CreateSingleThreadTaskRunner"],
         ["CreateCOMSTATaskRunnerWithTraits",              "CreateCOMSTATaskRunner"]
       ]
       EOF
       )

This CL was uploaded by git cl split.

R=boliu@chromium.org, tsepez@chromium.org

Bug: 968047
Change-Id: I346372d16a3856186ea74d14e0dd8a12f7cacae5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1729589
Commit-Queue: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Auto-Submit: Sami Kyöstilä <skyostil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683554}
2019-08-02 12:45:05 +00:00
Clark DuVall
a6a3233f72 Remove unused UtilityProcessHostClient
Nobody has used this for years, so it should be safe to remove.

Change-Id: I59d361640801e2677a16f0b80be21b41296d2c91
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1655979
Auto-Submit: Clark DuVall <cduvall@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Clark DuVall <cduvall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#668507}
2019-06-12 18:56:02 +00:00
Eric Seckler
8652dcd5d8 content: Replace uses of BrowserThread task posting with post_task.h API
This patch updates callsites of BrowserThread task posting methods to
use the post_task.h API instead.

Background: We're changing the way tasks are posted to a BrowserThread,
see PSA [1] and design doc [2]. This unifies the way tasks are posted
and paves the way for annotating tasks with task types and other
attributes that can be used to prioritize tasks in the future browser
UI thread scheduler (design doc [3]).

This CL changes callsites of the following forms:
(a) BrowserThread::Post*Task(BrowserThread::UI/IO, ..) to
    base::PostTaskWithTraits(FROM_HERE, {BrowserThread::UI/IO}, ..),
(b) BrowserThread::GetTaskRunnerForThread(BrowserThread::UI/IO) to
    base::CreateSingleThreadTaskRunnerWithTraits({BrowserThread::UI/IO}).

It also adds necessary includes. These mechanical changes were applied
by a script.

Tasks posted with the same BrowserThread::ID trait (via
PostTaskWithTraits or TaskRunners obtained from
Create*TaskRunnerWithTraits) will still execute in the order they
were posted, see [4].

[1] https://groups.google.com/a/chromium.org/d/topic/chromium-dev/A3_snMVXv8A/discussion
[2] https://docs.google.com/document/d/1SGy9VTXUwyXEX_yBZ0ukFAnS8B0hDeMUJD-1iALaE-Q/edit?usp=sharing
[3] https://docs.google.com/document/d/1z1BDq9vzcEpkhN9LSPF5XMnZ0kLJ8mWWkNAi4OI7cos/edit?usp=sharing
[4] https://cs.chromium.org/chromium/src/base/task/post_task.h?l=66

TBR=achuith@chromium.org, afakhry@chromium.org, agl@chromium.org, avi@chromium.org, bbudge@chromium.org, bengr@chromium.org, benwells@chromium.org, bnc@chromium.org, calamity@chromium.org, ccameron@chromium.org, chiniforooshan@chromium.org, cjgrant@chromium.org, cmumford@chromium.org, csharrison@chromium.org, dalecurtis@chromium.org, delphick@chromium.org, dgozman@chromium.org, dmazzoni@chromium.org, droger@chromium.org, dschuff@chromium.org, dullweber@chromium.org, erikchen@chromium.org, felt@chromium.org, fgorski@chromium.org, gogerald@chromium.org, groby@chromium.org, horo@chromium.org, imcheng@chromium.org, jcivelli@chromium.org, jianli@chromium.org, jinho.bang@samsung.com, jkarlin@chromium.org, jochen@chromium.org, kinuko@chromium.org, lazyboy@chromium.org, lpy@chromium.org, markusheintz@chromium.org, mattcary@chromium.org, maxmorin@chromium.org, miu@chromium.org, mkwst@chromium.org, mmenke@chromium.org, mpearson@chromium.org, msramek@chromium.org, nick@chromium.org, nparker@chromium.org, nyquist@chromium.org, peter@chromium.org, pwnall@chromium.org, qinmin@chromium.org, rbpotter@chromium.org, rdevlin.cronin@chromium.org, rouslan@chromium.org, scottmg@chromium.org, servolk@chromium.org, skuhne@chromium.org, sky@chromium.org, tapted@chromium.org, tbansal@chromium.org, thestig@chromium.org, tommi@chromium.org, tommycli@chromium.org, torne@chromium.org, tschumann@chromium.org, vabr@chromium.org, vakh@chromium.org, waffles@chromium.org, yfriedman@chromium.org, zmo@chromium.org, bartfab@chromium.org

Bug: 878356
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:linux_vr;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I37526c8e75630ee7bec29421276094a30e903894
Reviewed-on: https://chromium-review.googlesource.com/1186623
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Reviewed-by: Vaclav Brozek <vabr@chromium.org>
Reviewed-by: Alex Clarke <alexclarke@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Commit-Queue: Eric Seckler <eseckler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592750}
2018-09-20 10:42:28 +00:00
Will Harris
edb011f9c5 Set a consistent browser child process name for metrics.
Add new "metrics name" which is non-localized and will be used for
recording metrics for child processes. The name is taken from the
mojo service name for mojo processes, or can be custom set.

BUG=767906

Change-Id: Ibcfa314fe4c475256f76a4369d17e63e32050195
Reviewed-on: https://chromium-review.googlesource.com/1072789
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Will Harris <wfh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#563777}
2018-06-01 20:28:44 +00:00
Jay Civelli
14aced2aea Make UtilityProcessHost non public
Removes UtilityProcessHost from content/public and renames
UtilityprocessHostImpl to UtilityProcessHost.
Now that all use cases of UtilityProcessHost have been replaced by
using services (but for the PowerMonitor browser tests), this will
prevent further forking of process bypassing the service manager.

Bug: 775677
Change-Id: I2107271a54e4ab3141102a5c4fbcce4ea21915dd
Reviewed-on: https://chromium-review.googlesource.com/961496
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Jay Civelli <jcivelli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543238}
2018-03-14 23:44:33 +00:00
tzik
e2aca9904e Apply base_bind_rewriters to //content/browser
This CL applies //tools/clang/base_bind_rewriters to //content/browser.
It rewrites base::Bind to base::BindOnce where the resulting base::Callback
is immediately converted to base::OnceCallback, which is considered safe
to use base::BindOnce.

E.g.:
  base::PostTask(FROM_HERE, base::Bind([]{}));
  base::OnceClosure cb = base::Bind([]{});
are converted to:
  base::PostTask(FROM_HERE, base::BindOnce([]{}));
  base::OnceClosure cb = base::BindOnce([]{});

Bug: 
Change-Id: I601295ba4640f73bcbed14e93359227a8fb6eeb6
Reviewed-on: https://chromium-review.googlesource.com/644657
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#499585}
2017-09-05 08:50:54 +00:00
ben
a06f7d6c58 Convert content ConnectionFilter to OnBindInterface.
- This was a pretty viral change, sorry about the size.
  - Specifically, had to make all the *Host classes use
    BindInterface() to request interfaces from their children, thus
    replacing their GetRemoteInterfaces() accessor with a
    BindInterface() call.
- This also has to eliminate any use of service_manager::Connection
  as an indicator of the lifetime of the connection, hence the
  introduction of child.mojom as a means of monitoring the lifetime
  of the renderer connection.
- I had to tweak the expectations of the EmbeddedWorkerInstance test
  as queuing order changed slightly with the new BindInterface mocking.

CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/2766263009
Cr-Commit-Position: refs/heads/master@{#461826}
2017-04-04 20:48:52 +00:00
rockot
734fb6640d Move services/shell to services/service_manager
Moving the symbols to the service_manager namespace will
happen in a follow-up CL.

Copied from https://codereview.chromium.org/2419723002 because
rietveld is choking on that one.

BUG=None
NOPRESUBMIT=true
TBR=ben@chromium.org
TBR=dcheng@chromium.org
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2419063003
Cr-Commit-Position: refs/heads/master@{#425565}
2016-10-15 16:43:09 +00:00
ben
ff4616342b Rename MojoShellContext -> ServiceManagerContext.
R=rockot@chromium.org,tsepez@chromium.org

Review-Url: https://codereview.chromium.org/2387263002
Cr-Commit-Position: refs/heads/master@{#423522}
2016-10-06 14:29:36 +00:00
rockot
b214d02f96 Adds sync brokering to Windows EDK
We use a sync channel on other platforms to facilitate synchronous
shared buffer creation from within a sandbox. We need to do this
on Windows too.

This implements that, and adds a test for sandboxed shared buffer
creation.

BUG=594883

Review-Url: https://codereview.chromium.org/2264543003
Cr-Commit-Position: refs/heads/master@{#418679}
2016-09-14 21:31:52 +00:00