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 #1).
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}
*** 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}
The histogram was never mapped in histograms.xml, so nothing useful
has been done with it.
Bug: 642629
Change-Id: I1ad0158929f3367e876ec7d74f536238c53db949
Reviewed-on: https://chromium-review.googlesource.com/1054072
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Bernhard Bauer <bauerb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#559030}
The number of callers is not many. Let's pass task runners explicitly
for code health.
This CL is a preparation to replace base::ThreadTaskRunnerHandle::Get
with more appropriate task runners.
Bug: 780785
Cq-Include-Trybots: 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
Change-Id: I998fb338228069f6c164b13144319c0810b1de2c
Reviewed-on: https://chromium-review.googlesource.com/784910
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Hajime Hoshi <hajimehoshi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519547}
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}
This is another pass of migration of includes for users of histogram
macros. This doesn't fully complete the migration, but gets us closer
to the end result.
A few files needed to include both headers as they use both
macros and the raw API.
BUG=416479
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel
TBR=jam@chromium.org
Review-Url: https://codereview.chromium.org/2293583002
Cr-Commit-Position: refs/heads/master@{#415067}
This pulls a lot of hairballs but that's pretty much everything left.
BUG=493212,123851,234591,238460
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation
Review URL: https://codereview.chromium.org/1862513003
Cr-Commit-Position: refs/heads/master@{#385358}
This eliminates the need for a lot of plumbing, at the expense of yet another
global.
BUG=493414
Review URL: https://codereview.chromium.org/1292263003
Cr-Commit-Position: refs/heads/master@{#348649}
This CL has no functional effect, although it stubs in necessary placeholders
for IPC attachment brokering.
The browser process now has access to a singleton AttachmentBroker* via
content::ChildProcessHost::GetAttachmentBroker().
Child processes now have access to an AttachmentBroker* via
content::ChildThread. Each instance of ChildThread creates an AttachmentBroker
during Init().
BUG=493414
Review URL: https://codereview.chromium.org/1187153003
Cr-Commit-Position: refs/heads/master@{#334958}
This patch was automatically generated by applying clang fixit hints
generated by the plugin to the source tree.
BUG=417463
TBR=sky@chromium.org
Review URL: https://codereview.chromium.org/667943003
Cr-Commit-Position: refs/heads/master@{#300469}
This step is a giant search and replace for OVERRIDE and FINAL to
replace them with their lowercase versions.
BUG=417463
Review URL: https://codereview.chromium.org/637183002
Cr-Commit-Position: refs/heads/master@{#298804}
This change introduces IPC::Channel::Create*() API to turn
IPC::Channel into a heap allocated object. This will allow us to
make Channel a polymorphic class.
This change also tries to hide Channel::Mode from public API
so that we can simplify channel creation code paths cleaner in
following changes. ChannelProxy has to follow same pattern to
finish this cleanup. Such changes will follow.
TEST=none
BUG=377980
R=darin@chromium.org,cpu@chromium.org
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=273575
Review URL: https://codereview.chromium.org/307653003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273713 0039d316-1c4b-4281-b951-d872f2087c98
Broke win compile.
> Introduce IPC::Channel::Create*() to ensure it being heap-allocated.
>
> This change introduces IPC::Channel::Create*() API to turn
> IPC::Channel into a heap allocated object. This will allow us to
> make Channel a polymorphic class.
>
> This change also tries to hide Channel::Mode from public API
> so that we can simplify channel creation code paths cleaner in
> following changes. ChannelProxy has to follow same pattern to
> finish this cleanup. Such changes will follow.
>
> TEST=none
> BUG=377980
> R=darin@chromium.org,cpu@chromium.org
>
> Review URL: https://codereview.chromium.org/307653003TBR=morrita@chromium.org
Review URL: https://codereview.chromium.org/304153005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273596 0039d316-1c4b-4281-b951-d872f2087c98
This change introduces IPC::Channel::Create*() API to turn
IPC::Channel into a heap allocated object. This will allow us to
make Channel a polymorphic class.
This change also tries to hide Channel::Mode from public API
so that we can simplify channel creation code paths cleaner in
following changes. ChannelProxy has to follow same pattern to
finish this cleanup. Such changes will follow.
TEST=none
BUG=377980
R=darin@chromium.org,cpu@chromium.org
Review URL: https://codereview.chromium.org/307653003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273575 0039d316-1c4b-4281-b951-d872f2087c98
-NPAPIPluginsSupported moves to PluginService
-no need to call it in PluginList methods anymore since PluginService is now the only place that calls these methods, and it can check first
-no need for the renderer to call this first since now the browser won't enumerate NPAPI plugins if it's disabled
-CreateVersionFromString moves to WebPluginInfo. I couldn't find a better place to put it.
-move the constants back to plugin_constants_win.h
-move PLUGIN_QUIRK_DIE_AFTER_UNLOAD handling to WebPluginDelegateStub and PluginThread instead of being a global
-GetDefaultWindowParent moves to plugin_constants_win.h. I couldn't find a better place.
-IsPluginWindow moves to PluginService
-GetPluginNameFromWindow and GetPluginVersionFromWindow are both replaced by GetPluginInfoFromWindow which is on PluginService
-IsDummyActivationWindow was called by one place so I moved the code there
BUG=237249
R=scottmg@chromium.org
Review URL: https://codereview.chromium.org/19844003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212672 0039d316-1c4b-4281-b951-d872f2087c98
This is the result of running the rewrite_scoped_ptr_ctor_null tool
across all files built on Linux in the content/ directory.
BUG=173286
Review URL: https://chromiumcodereview.appspot.com/16703020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206062 0039d316-1c4b-4281-b951-d872f2087c98
We need a place to put code that is shared between child processes of different
types but not used in the browser process. For instance, the NPObject bindings
code is used in the plugin and renderer processes but depends on WebBindings
which the browser shouldn't depend on. Some web platform features require shared
code between renderer and worker processe. The WebKit image decoders are used
by worker, renderer and utility processes.
This creates a content/common_child directory for code shared by more than one
child process type. content/common_child can depend on content/common and all
content/ subdirs except for content/browser and content/common can depend on it.
The java bridge code is (more than a) bit busted since it pulls the NPObject
bindings in to the browser, but since this code is only intended for use on
android single-process configurations I've just created DEPS exceptions for
this bit of code.
BUG=241606
Review URL: https://chromiumcodereview.appspot.com/15047014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201252 0039d316-1c4b-4281-b951-d872f2087c98
user has authorized it with a browser-mediated interaction.
BUG=172573
Review URL: https://codereview.chromium.org/12086077
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180103 0039d316-1c4b-4281-b951-d872f2087c98
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
This refactors PepperFlashFileHost and PepperBrokerHost to use MessageFilterHost. This removes the empty Host classes and moves the interface definition of the MessageFilter classes into the header files. This hopefully makes the code a lot cleaner/clearer.
TBR=brettw@chromium.org for gypi changes and trivial plugin_data_remover_impl changes.
Review URL: https://codereview.chromium.org/11617005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174323 0039d316-1c4b-4281-b951-d872f2087c98
The refactors PPB_Flash_File_ModuleLocal/FileRef to the new resource model. Calls for both these interfaces are now made directly to the browser. This removes the in-process implementation for these interfaces also (as they are flash-only). Tests are added for PPB_Flash_File_ModuleLocal.
Review URL: https://codereview.chromium.org/11359097
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171902 0039d316-1c4b-4281-b951-d872f2087c98
- Also exclude plugin_data_remover_impl from the build.
BUG=162667
Review URL: https://chromiumcodereview.appspot.com/11475007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171747 0039d316-1c4b-4281-b951-d872f2087c98
> The refactors PPB_Flash_File_ModuleLocal/FileRef to the new resource model. Calls for both these interfaces are now made directly to the browser. This removes the in-process implementation for these interfaces also (as they are flash-only). Tests are added for PPB_Flash_File_ModuleLocal.
>
> Review URL: https://codereview.chromium.org/11359097TBR=raymes@chromium.org
Review URL: https://codereview.chromium.org/11437038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171562 0039d316-1c4b-4281-b951-d872f2087c98