0
Commit Graph

17 Commits

Author SHA1 Message Date
Nico Weber
78ccb94ce9 Revert "base: Remove temporary "WithTraits" task API wrappers"
This reverts commit 0bf621ef56.

Reason for revert: This breaks the iOS build, see e.g.
https://ci.chromium.org/p/chrome/builders/try/ipad-device/113

Original change's description:
> base: Remove temporary "WithTraits" task API wrappers
> 
> Now that everyone has been migrated to the renamed
> PostTask/CreateTaskRunner APIs, we can remove these temporary wrappers.
> 
> TBR=gab@chromium.org
> (to apply side-effects of mechanical change in //base)
> 
> Bug: 968047
> Change-Id: I69c53abd899f37586f23ec295ffcc9bf12042c4a
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1752787
> Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
> Reviewed-by: Gabriel Charette <gab@chromium.org>
> Commit-Queue: Sami Kyöstilä <skyostil@chromium.org>
> Auto-Submit: Sami Kyöstilä <skyostil@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#693695}

TBR=gab@chromium.org,skyostil@chromium.org

Change-Id: If1229c8390dc657b7525e58994a94b51f598e880
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 968047
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1786836
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#693725}
2019-09-05 15:00:42 +00:00
Sami Kyostila
0bf621ef56 base: Remove temporary "WithTraits" task API wrappers
Now that everyone has been migrated to the renamed
PostTask/CreateTaskRunner APIs, we can remove these temporary wrappers.

TBR=gab@chromium.org
(to apply side-effects of mechanical change in //base)

Bug: 968047
Change-Id: I69c53abd899f37586f23ec295ffcc9bf12042c4a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1752787
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Sami Kyöstilä <skyostil@chromium.org>
Auto-Submit: Sami Kyöstilä <skyostil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#693695}
2019-09-05 13:47:58 +00:00
Clark DuVall
afabb7e282 Log events leading up to commit timeout to debug renderer hangs
Bug: 934317
Change-Id: I1060e5d8ae3ab5c4d5decf8ada12cd4b6c424a86
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764564
Commit-Queue: Clark DuVall <cduvall@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689752}
2019-08-23 00:41:47 +00:00
Christopher Thompson
2a4c69e9f8 Add metrics for SSLKEYLOGFILE use
We're removing the dangerous flag infobar for this for now in
https://crrev.com/c/1760866. This change adds basic metrics for how
common the use of SSLKeyLogger is.

Bug: 991290
Change-Id: I74e932eef872c59f5b4c8b5de055a2197ac93f43
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1761288
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Christopher Thompson <cthomp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689025}
2019-08-21 16:29:11 +00:00
Clark DuVall
1f94e9f455 Log network service ping time on navigation commit timeouts
This will be useful in telling if the network service is responding or
not when a commit timeout happens.

Bug: 934317
Change-Id: I6ea88147bb2ad4e0d393aa8354004b7bdc53fd77
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1761340
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Steven Holte <holte@chromium.org>
Commit-Queue: Clark DuVall <cduvall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688864}
2019-08-21 04:09:36 +00:00
Robbie McElrath
8dc3acc94c Fix race during NetworkChangeNotifier construction in unit tests.
See crbug.com/989225#c25 for more details.

Bug: 989225
Change-Id: Ib2b9ef82ea881cdc59d2940dfe54d197d53f67bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1742381
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Commit-Queue: Robbie McElrath <rmcelrath@chromium.org>
Cr-Commit-Position: refs/heads/master@{#687410}
2019-08-15 20:43:04 +00:00
Clark DuVall
984239a833 Record more histograms to debug renderer hang increase
Bug: 934317
Change-Id: I054b539a39752582d6e44f1ac416bbc24be7c470
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1742371
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Steven Holte <holte@chromium.org>
Commit-Queue: Clark DuVall <cduvall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#685399}
2019-08-08 23:38:33 +00:00
David Benjamin
887153854c Make SetSSLKeyLogFile sandbox-friendly.
This feature is the worst, but at least it can be sandbox-friendly!

Bug: 841001
Change-Id: Icb30dee0c68d8034ea3cbce0a8ecfc331d80942c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1738643
Auto-Submit: David Benjamin <davidben@chromium.org>
Commit-Queue: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#685002}
2019-08-07 23:19:55 +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
John Abd-El-Malek
c134dd8ab3 Remove some dead code that's not used with network service path.
Bug: 934009
Change-Id: I03a76ea596efb01600c8ad622933c5bec911fac2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1729059
Reviewed-by: Clark DuVall <cduvall@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#682909}
2019-07-31 20:51:44 +00:00
Clark DuVall
b026e58650 Record UMAs on navigation commit timeout
This should help debug the Clank renderer hangs with network service.

Bug: 934317
Change-Id: I78f69d5fafd05e4b8984601bc652b1d086d0ca49
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1726911
Commit-Queue: Clark DuVall <cduvall@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Steven Holte <holte@chromium.org>
Cr-Commit-Position: refs/heads/master@{#682873}
2019-07-31 19:50:38 +00:00
Eric Roman
3124cde5bc Make NetLogCaptureMode an enum.
Historically the capture mode had aspirations for more complex parameterization, but in practice it just an enum.
Refactored the code to reflect this, and also simplified the symbolic names.

This is strictly a code refactor, except for one user-visible change:
The command line switch --net-log-capture-mode now accepts both the old and new names.

TBR: peter@chromium.org,seantopping@chromium.org,garykac@chromium.org,torne@chromium.org,scottmg@chromium.org
Change-Id: I9bce3f7425bf47e8b24063dc922c534c2aa1f21f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1685684
Reviewed-by: Sean Topping <seantopping@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: David Benjamin <davidben@chromium.org>
Commit-Queue: Eric Roman <eroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#676139}
2019-07-10 22:26:15 +00:00
Eric Roman
c03b626221 Move parsing of NetLog command line flag to Network Service.
The parsing of --net-log-capture-mode had previously been extracted to //net to
facilitate sharing between NS (Network Service) and non-NS code paths, however
is now exclusively used by NS.

Bug: 934009
Change-Id: I5d18354fb5eac727f2aaf61e91785f6e3bcab462
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1674635
Reviewed-by: Robbie McElrath <rmcelrath@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Kinuko Yasuda <kinuko@chromium.org>
Auto-Submit: Eric Roman <eroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#671926}
2019-06-25 02:13:22 +00:00
Eric Roman
b67de83b37 Remove ChromeNetLog.
The NetLog is now an internal detail of the Network Service.

In particular this CL:

* Removes ChromeNetLog class
* Removes ContentBrowserClient::GetNetLog()
* Removes BrowserProcess::net_log()
* Removes support for writing to a NetLog when Network Service is disabled.

And exception is made for Android WebView, which preserves support for NetLog when Network Service is not enabled.

Bug: 934009,767450
Change-Id: I95e2a6aae85ec9c7b90bce08c57e23cb688e5d02
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1663846
Reviewed-by: Richard Coles <torne@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Robbie McElrath <rmcelrath@chromium.org>
Commit-Queue: Eric Roman <eroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#671472}
2019-06-22 00:12:32 +00:00
Ken Rockot
fd03e68b00 Remove ServiceManagerConnection use from //content
ServiceManagerConnection is slated for imminent deletion. This
replaces most usage around //content/browser with the simpler
GetSystemConnector(). Split out from a much larger CL.

Bug: 904240
Change-Id: Ia88322f607cb6fbf3c5fdf3fd4b6762c8074c0c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1666778
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Becca Hughes <beccahughes@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#671047}
2019-06-20 21:13:54 +00:00
Etienne Pierre-doray
75dbb325f6 [Scheduler]: Revamp SequenceLocalStorage.
This CL fixes a few issues with SequenceLocalStorage:
- Supports holding T with disabled copy/move constructor
  by adding emplace().
- Prevents auto default construction with GetValuePointer.
- Query if SequenceLocalStorageSlot currently holds a value
  with operator bool().
- Update doc to use NoDestructor.

This makes it possible to replace in many cases:
SequenceLocalStorageSlot<unique_ptr<T>> with
SequenceLocalStorageSlot<T>

and
auto ptr = sls.Get();
if (!ptr) {
  ptr = make_unique<T>();
  sls.Set(ptr);
}
return *ptr;

with
return sls.GetOrCreateValue();

TBR=fdoray@chromium.org

Change-Id: I0473fbb4eded35177aa32fabb5377b0cad648c16
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1634876
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664708}
2019-05-30 10:46:41 +00:00
John Abd-El-Malek
984dc00b95 Fix network service setup/teardown code in unit tests.
There are three fixes:
1) The main fix is that network::NetworkService needs to be torn down between tests. One reason is that so a test don't leave it misconfigured for other tests. The pressing reason is that if network::NetworkService is bound to a pipe in one test it'll also be bound to that test's BrowserThreadTestBundle's sequence; that means for other tests no mojo messages will be dispatched. Fix this by resetting the interface pointer at the end of each test.

2) We need to delete the network::NetworkService object to avoid leaks; depending on connection error dispatching again might not be delivered. This is fixed by storing the pointer in SequenceLocalStorageSlot.

3) We create network::NetworkService directly instead of trying to use the global ServiceManager. For most tests this happens because there's no global Connector. However some tests would instantiate a test service manager objects, so we need to force the direct instantiation through a test only method.

Bug: 966633
Change-Id: I1c181733af692e7a6742a45c10a16c863e2642a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1632494
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#664068}
2019-05-29 01:26:59 +00:00