0
Commit Graph

20 Commits

Author SHA1 Message Date
Colin Blundell
1c7c45672b [Histograms] Remove expired Startup.StartupTaskRunner.AsyncTaskQueueTime
Bug: 1370598
Change-Id: If3496338f16e21c0f32b1fd397ef250eaaf49dcd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4679173
Reviewed-by: Caitlin Fischer <caitlinfischer@google.com>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1170038}
2023-07-13 17:52:37 +00:00
Avi Drissman
adac219925 Update header includes for /base/functional in /content
bind.h, callback.h, callback_forward.h, and callback_helpers.h
moved into /base/functional/. Update the include paths to
directly include them in their new location.

Bug: 1364441
Change-Id: I32ec425b9c0e52ec4b50047bf3290fecc5c905ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4148554
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1091567}
2023-01-11 23:46:39 +00:00
Sean Maher
e672a665ff task posting v3: remove includes of runner handles and IWYU task runners
Turns out there's a lot of includes, so these will have to be removed
before deleting the implementation of the task runner handles.

To allow the deletion of the task runner handle headers, add
the sequenced/thread task runner handles where they are used in
the codebase with scripts.

This was done with an automated change, with a few touchups afterwards.
The code for the mass-refactor changes are here:
python:
https://paste.googleplex.com/5534570878337024
shell:
https://paste.googleplex.com/6466750748033024

In terms of touchups:
- add sequenced/thread task runner handles to
  the third_party/blink/public/DEPS, because multiple files were using
  it transitively anyways.
- rewrite certain parts of the codebase which used
  ThreadTaskRunnerHandles instead of CurrentDefaultHandles.
- fix a compile issue with forward-declaration in
  extensions/browser/extension_file_task_runner.h.

AX-Relnotes: n/a.
Bug: 1026641
Change-Id: I737ef32aee4e77c21eaa3a2bdc403a28322cf1b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4133323
Owners-Override: Gabriel Charette <gab@chromium.org>
Commit-Queue: Sean Maher <spvw@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1090532}
2023-01-09 21:42:28 +00:00
Avi Drissman
4e1b7bc33d Update copyright headers in content/
The methodology used to generate this CL is documented in
https://crbug.com/1098010#c34.

No-Try: true
No-Presubmit: true
Bug: 1098010
Change-Id: I8c0f009d16350271f07d8e5e561085822cc9dd27
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3895935
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1047456}
2022-09-15 14:03:50 +00:00
David Sanders
2799ee2fbb Use forward declaration of TimeDelta in //base/task/task_runner.h
Bug: 242216
Change-Id: I0069e265b7af660e65765ee66cae3a41877d80e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3423170
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#966594}
2022-02-03 05:01:48 +00:00
Lei Zhang
7ab31375dd Do IWYU for content_export.h
Headers that use CONTENT_EXPORT should include content_export.h.

Change-Id: I66b65c9c3a963d1f4677172b12ef0966448e1609
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3282640
Commit-Queue: Lei Zhang <thestig@chromium.org>
Auto-Submit: Lei Zhang <thestig@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#942394}
2021-11-17 01:26:00 +00:00
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
Colin Blundell
3e5680b4e2 [Metrics] Fix recording of async startup task queue time
This metric was not showing up as having any samples. On inspection,
this turned out to be because the startup tasks being executed don't
have a queue_time recorded. What causes that field to be recorded is
somewhat opaque; rather than going down that rathole, this CL changes
the way this metric is obtained to just track the queue time of these
tasks explicitly in StartupTaskRunner. I verified locally that the
queue times now get calculated and look reasonable (in the 0-10 ms
range locally).

Bug: 1258621
Change-Id: If06bcd5d10e17d55dcd5552d389e7761674021bc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3250677
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#937264}
2021-11-02 10:49:50 +00:00
Patrick Monette
643cdf6190 Replace base/task/ temporary forward headers with their final locations
Note to QA: This merely changes includes and should not be blamed
for files it touched.

Bug: 1255932
Change-Id: I1ce4e31efd5792ebf2080812e665cae838a54972
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3226943
Reviewed-by: Gabriel Charette <gab@chromium.org>
Owners-Override: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#932153}
2021-10-15 19:13:42 +00:00
Patrick Monette
3d7d70920a Replace task-related headers to their equivalent in base/task/
This CL was generated by using tools/git/move_source_file.py to change
the includes for those files:
base/bind_post_task.h
base/deferred_sequenced_task_runner.h
base/post_task_and_reply_with_result_internal.h
base/sequenced_task_runner.h
base/sequenced_task_runner_helpers.h
base/single_thread_task_runner.h
base/task_runner.h
base/task_runner_util.h
base/updateable_sequenced_task_runner.h

Then formatted using "git cl format". DEPS files were fixed with a
simple search and replace script.

Bug: 1255932
Change-Id: I0d9b5ddd9260fde5e4581e6c6e0080bdb0ed2c44
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3209175
Reviewed-by: Gabriel Charette <gab@chromium.org>
Owners-Override: Gabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#929867}
2021-10-08 20:27:23 +00:00
Peter Boström
828b902994 Replace DISALLOW_COPY_AND_ASSIGN in content/
This replaces DISALLOW_COPY_AND_ASSIGN with explicit constructor deletes
where a local script is able to detect its insertion place (~Foo() is
public => insert before this line).

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

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

Bug: 1010217
Change-Id: Iea478401b7580682c7b9f195f7af9cbbdb6ce315
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3167292
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#923194}
2021-09-21 02:28:43 +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
Makoto Shimazu
51176e6cdf Convert base::Bind to base::Bind{Once,Repeating} in content/browser
This CL converts base::Bind to BindOnce or BindRepeating, and also changes
relevant base::Callbacks or base::Closures to appropriate types.

This CL is split from https://crrev.com/c/1831621.

This CL was uploaded by git cl split.

R=boliu@chromium.org

Bug: 1007760
Change-Id: I235ac01f30acce3df1ce9f8a59d6d0a9da73449e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1849476
Reviewed-by: Bo <boliu@chromium.org>
Commit-Queue: Bo <boliu@chromium.org>
Auto-Submit: Makoto Shimazu <shimazu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#704626}
2019-10-10 14:43:17 +00:00
Mark Pilgrim
b9350ee95f Migrate startup_complete_callback to OnceCallback
Bug: 714018
Change-Id: I9ecc53ebb303b1c08ca4f21f9b948fdbfa02598c
Reviewed-on: https://chromium-review.googlesource.com/1104387
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Mark Pilgrim <pilgrim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568198}
2018-06-18 22:25:22 +00:00
Tommy Nyquist
4b749d0e31 Reland "Add std::move() to local base::Callback instances in //content"
This reverts commit 9b4af06d02.

Reason for revert: This does not seem like the root cause.

Original change's description:
> Revert "Add std::move() to local base::Callback instances in //content"
> 
> This reverts commit c55a5a47ee.
> 
> Reason for revert: Speculative revert because of renderer crashes across
> the board on Android with:
> [FATAL:weak_ptr.cc(26)] Check failed: sequence_checker_.CalledOnValidSequence(). WeakPtrs must be checked on the same sequenced thread
> 
> Original change's description:
> > Add std::move() to local base::Callback instances in //content
> > 
> > This adds std::move() around base::Callback instances where it looks
> > relevant, by applying `base_bind_rewriters -rewriter=add_std_move`.
> > https://crrev.com/c/970143, plus manual fixes.
> > 
> > Example:
> >   // Before:
> >   void set_callback(base::Closure cb) { g_cb = cb; }
> >   void RunCallback(base::Callback<void(int)> cb) { cb.Run(42); }
> >   void Post() {
> >     base::Closure task = base::Bind(&Foo);
> >     PostTask(FROM_HERE, task);
> >   }
> > 
> >   // After:
> >   void set_callback(base::Closure cb) { g_cb = std::move(cb); }
> >   void RunCallback(base::Callback<void(int)> cb) { std::move(cb).Run(42); }
> >   void Post() {
> >     base::Closure task = base::Bind(&Foo);
> >     PostTask(FROM_HERE, std::move(task));
> >   }
> > 
> > Specifically, it inserts std::move() if:
> >  - it's a pass-by-value parameter or non-const local variable.
> >  - the occurrence is the latest in its control flow.
> >  - no pointer is taken for the variable.
> >  - no capturing lambda exists for the variable.
> > 
> > Change-Id: I53853f9b9c8604994e2065af66ed4607af9c12ed
> > Reviewed-on: https://chromium-review.googlesource.com/970056
> > Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
> > Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#544356}
> 
> TBR=kinuko@chromium.org,tzik@chromium.org
> 
> Change-Id: Ie7392a2229e1ef0f740d8958f8fe43d99b0460e9
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/972321
> Reviewed-by: Tommy Nyquist <nyquist@chromium.org>
> Commit-Queue: Tommy Nyquist <nyquist@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#544527}

TBR=kinuko@chromium.org,nyquist@chromium.org,tzik@chromium.org

Change-Id: I0aabd6032a070a28d0e5a4f796f37fe18f1e5cd4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/972302
Reviewed-by: Tommy Nyquist <nyquist@chromium.org>
Commit-Queue: Tommy Nyquist <nyquist@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544536}
2018-03-20 21:46:29 +00:00
Tommy Nyquist
9b4af06d02 Revert "Add std::move() to local base::Callback instances in //content"
This reverts commit c55a5a47ee.

Reason for revert: Speculative revert because of renderer crashes across
the board on Android with:
[FATAL:weak_ptr.cc(26)] Check failed: sequence_checker_.CalledOnValidSequence(). WeakPtrs must be checked on the same sequenced thread

Original change's description:
> Add std::move() to local base::Callback instances in //content
> 
> This adds std::move() around base::Callback instances where it looks
> relevant, by applying `base_bind_rewriters -rewriter=add_std_move`.
> https://crrev.com/c/970143, plus manual fixes.
> 
> Example:
>   // Before:
>   void set_callback(base::Closure cb) { g_cb = cb; }
>   void RunCallback(base::Callback<void(int)> cb) { cb.Run(42); }
>   void Post() {
>     base::Closure task = base::Bind(&Foo);
>     PostTask(FROM_HERE, task);
>   }
> 
>   // After:
>   void set_callback(base::Closure cb) { g_cb = std::move(cb); }
>   void RunCallback(base::Callback<void(int)> cb) { std::move(cb).Run(42); }
>   void Post() {
>     base::Closure task = base::Bind(&Foo);
>     PostTask(FROM_HERE, std::move(task));
>   }
> 
> Specifically, it inserts std::move() if:
>  - it's a pass-by-value parameter or non-const local variable.
>  - the occurrence is the latest in its control flow.
>  - no pointer is taken for the variable.
>  - no capturing lambda exists for the variable.
> 
> Change-Id: I53853f9b9c8604994e2065af66ed4607af9c12ed
> Reviewed-on: https://chromium-review.googlesource.com/970056
> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
> Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#544356}

TBR=kinuko@chromium.org,tzik@chromium.org

Change-Id: Ie7392a2229e1ef0f740d8958f8fe43d99b0460e9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/972321
Reviewed-by: Tommy Nyquist <nyquist@chromium.org>
Commit-Queue: Tommy Nyquist <nyquist@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544527}
2018-03-20 21:37:17 +00:00
tzik
c55a5a47ee Add std::move() to local base::Callback instances in //content
This adds std::move() around base::Callback instances where it looks
relevant, by applying `base_bind_rewriters -rewriter=add_std_move`.
https://crrev.com/c/970143, plus manual fixes.

Example:
  // Before:
  void set_callback(base::Closure cb) { g_cb = cb; }
  void RunCallback(base::Callback<void(int)> cb) { cb.Run(42); }
  void Post() {
    base::Closure task = base::Bind(&Foo);
    PostTask(FROM_HERE, task);
  }

  // After:
  void set_callback(base::Closure cb) { g_cb = std::move(cb); }
  void RunCallback(base::Callback<void(int)> cb) { std::move(cb).Run(42); }
  void Post() {
    base::Closure task = base::Bind(&Foo);
    PostTask(FROM_HERE, std::move(task));
  }

Specifically, it inserts std::move() if:
 - it's a pass-by-value parameter or non-const local variable.
 - the occurrence is the latest in its control flow.
 - no pointer is taken for the variable.
 - no capturing lambda exists for the variable.

Change-Id: I53853f9b9c8604994e2065af66ed4607af9c12ed
Reviewed-on: https://chromium-review.googlesource.com/970056
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544356}
2018-03-20 14:35:44 +00:00
avi
b7348940d3 Switch to standard integer types in content/browser/.
BUG=138542
TBR=jam@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#366868}
2015-12-25 20:58:00 +00:00
aberent@chromium.org
232e09d18f Allow overlapping sync and async startup requests
On Android we can get a second request to start the browser while
the an asynchronous request is in progress. Since the second
request may be synchronous, we may have switch to completing
initialization synchronously. This patch handles this by tracking
which initialization tasks have been run, and running the remaining
initialization tasks.

BUG=260574

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@219795 0039d316-1c4b-4281-b951-d872f2087c98
2013-08-27 15:29:56 +00:00
aberent@chromium.org
57624abcbe Run the later parts of startup as UI thread tasks
This CL splits the later parts of startup, from thread creation onwards,
into multiple UI thread tasks. Depending on the StartupTaskRunner passed
to CreateThreads the tasks are all run immediately, or are queued one at
a time on the UI thread. This, on platforms where the UI is
already running, allows the UI to remain interactive while Chrome is
initialized.

BUG=231856

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215042 0039d316-1c4b-4281-b951-d872f2087c98
2013-08-01 16:01:51 +00:00