0
Commit Graph

104 Commits

Author SHA1 Message Date
Lukasz Anforowicz
1feeba18e6 UKM metrics for CorbAllowlistAlsoAppliesToOorCors breakage.
This CL logs UKM events that hopefully will aid in proactively
identifying extensions that might be impacted by the changes behind
the CorbAllowlistAlsoAppliesToOorCors feature.

New UKM collection review (Google-internal):
https://docs.google.com/document/d/1RyAO8Con16my4lPkIVe2d1V89HMAISp9uO9h8tHfcNs

Bug: 1057232
Change-Id: I6c35c26ec418e1876c088e08d36a1aeeb12ffa47
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2097020
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Martin Barbella <mbarbella@chromium.org>
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Steven Holte <holte@chromium.org>
Auto-Submit: Łukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Martin Barbella <mbarbella@chromium.org>
Cr-Commit-Position: refs/heads/master@{#750700}
2020-03-16 20:32:02 +00:00
Lukasz Anforowicz
b691453204 Rappor metrics for CorbAllowlistAlsoAppliesToOorCors breakage.
This CL logs Rappor samples that hopefully will aid in proactively
identifying extensions that might be impacted by the changes behind
the CorbAllowlistAlsoAppliesToOorCors feature.

Bug: 920638
Change-Id: I40dec28c99673b8096170e1f1fce92c417ca0c16
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2076425
Reviewed-by: Steven Holte <holte@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#746508}
2020-03-03 20:50:25 +00:00
Tsuyoshi Horo
3ca54b1752 Show CORS preflight request in DevTools
Currently CORS preflight OPTIONS requests are not shown in DevTools.
When OutOfBlinkCORS is not enabled, Blink’s ThreadableLoader fetches
the CORS preflight requests, and  the preflight request information is
sent to DevTools from ThreadableLoader
(http://trac.webkit.org/changeset/90340).
But when OutOfBlinkCORS is enabled, the CORS preflight requests are
fetched from the network process. And the preflight request
information is not sent to DevTools.

To fix this problem, this CL introduces 3 methods
(OnCorsPreflightRequest/Response/RequestCompleted) to
NetworkServiceClient mojo interface. PreflightLoader in the network
process calls these methods to pass the preflight request information
to the browser process. NetworkServiceClient in the browser process
receives the information and passes it to DevTools.

Bug: 941297
Change-Id: I56c1b5acd06ba06380986f054ea60473ab80ff52
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2054468
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745781}
2020-03-01 04:49:23 +00:00
Minggang Wang
ee5af39bb4 [OnionSoup] Move resource_load_info.mojom into Blink
The current mojom struct ResourceLoadInfo defined in //content is used
to notify the status of a resource loading, which is unavailable
inside Blink.

Along with the implementation of OnionSoup of loaders, we are going to
notify the loading status from Blink directly. So we have to move this
mojom struct into Blink in order to leverage it there.

This CL makes the changes below:
- Remove the ResourceType in //content and its typemap and replace with
  the mojom one.
- Move the resource_load_info.mojom into Blink.

Change-Id: I11ab3b7107bd4e06ee3ec737f825202c533a466c
Bug: 860403
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1986640
Commit-Queue: Minggang Wang <minggang.wang@intel.com>
Reviewed-by: Charlie Reis <creis@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738417}
2020-02-05 02:55:28 +00:00
Julie Jeongeun Kim
f962da30c9 Clean up old Mojo types for network::mojom::NetworkChangeManager
This CL cleans up old Mojo types for
network::mojom::NetworkChangeManager from WebRtcVideoCaptureBrowserTest
using Remote and updates comments
with new Mojo types.

Bug: 955171
Change-Id: I7c9fb2e49cbf1307c994533e8480a207e9162a94
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1939528
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720247}
2019-11-29 17:43:25 +00:00
Guido Urdaneta
f837294862 Remove AudioServiceAudioStreams flag and old audio codepaths
The audio service is enabled by default on all platforms since M75.
There is no need to keep the old codepaths anymore.

Several parameterized tests running with and without service/process
have been deparameterized so that they run with the default process
configuration.

Bug: 1019245
Change-Id: Icf02a989f4579a39d15dcd33094a94f422231e15
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1887810
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Sean Topping <seantopping@chromium.org>
Reviewed-by: Yuri Wiitala <miu@chromium.org>
Reviewed-by: mark a. foltz <mfoltz@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Olga Sharonova <olka@chromium.org>
Commit-Queue: Guido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715629}
2019-11-15 09:47:21 +00:00
Min Qin
0454521fb8 Fix a crash when calling GetNetworkService() on Android
On Android, NetworkChangeNotifier can be created in 2 situations:
1. In BrowserMainLoop::PostMainMessageLoopStart(),
   NetworkChangeNotifierAndroid will be created on UI thread.
2. Triggered by the GetNetworkService() call when network service is running
   in-process, NetworkChangeNotifierPosix will be created on IO thread

Because 1 and 2 happens on 2 different threads, there is a race condition
that both creation calls could take place.

This CL fixes the issue by:
1. Combining NetworkChangeNotifier::HasNetworkChangeNotifier()
   and NetworkChangeNotifier::Create() into a single method
   CreateIfNeeded(), so that race condition won't be introduced
   between Has() and Create().
2. Use a lock to protect CreateIfNeeded(), so that only one global
   instance will be created if multiple threads are competing with
   each other. The original logic of not using a lock is introduce 9
   years ago: http://codereview.chromium.org/2802015, but with network
   service, the situation is more complicated. As a result, the lock
   usage will provide a safer and more simple approach to solve the
   issue.
3. Calling SetNetworkChangeNotifierFactory early for Android code.

BUG=1009981

Change-Id: I88dd50ca23d08f110f7ac7ffe08d50da65a05fac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1872414
Reviewed-by: Clark DuVall <cduvall@chromium.org>
Reviewed-by: Mike Dougherty <michaeldo@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Paul Jensen <pauljensen@chromium.org>
Reviewed-by: Gary Kacmarcik <garykac@chromium.org>
Reviewed-by: Changwan Ryu <changwan@chromium.org>
Reviewed-by: Xi Han <hanxi@chromium.org>
Commit-Queue: Min Qin <qinmin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712848}
2019-11-06 01:10:49 +00:00
Eric Orth
07b7e20ca0 Cleanup DNS config initial notification
Nothing differentiates anymore between initial and subsequent
DNS config notifications from NetworkChangeNotifier, so merge them into
a single notification.


Fixed: 1001157
Change-Id: I1d67a7d7299d4a15307d2a68ca06d27caf3bef37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1788241
Commit-Queue: Eric Orth <ericorth@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Auto-Submit: Eric Orth <ericorth@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711382}
2019-10-31 19:02:50 +00:00
Hans Wennborg
5ffd1393b3 Include bloat: reduce number of includes in content_browser_client.h
This reduces the number of preprocessor tokens in
content_browser_client.h from 1,335,281 to 754,474. Since this is a
widely included file, reducing build times a fair bit (see bug).

TBR=tsepez for content/browser/child_process_security_policy_*

Bug: 1014009
Change-Id: Id3c2de29f5b08cab80820d01aff722afeb1618e6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1857126
Commit-Queue: Hans Wennborg <hans@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706388}
2019-10-16 11:00:02 +00:00
Julie Jeongeun Kim
d28b36f5bc Convert NetworkServiceClient to new Mojo types
This CL converts NetworkServiceClient from network_service.mojom
to new Mojo types using PendingRemote, PendingReceiver, Remote,
and Receiver.

Bug: 955171
Change-Id: If04d706c02e97a4ddd647a61647865dc35dc4563
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1847469
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Naoki Fukino <fukino@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Julie Kim <jkim@igalia.com>
Cr-Commit-Position: refs/heads/master@{#704987}
2019-10-11 04:43:43 +00:00
John Abd-El-Malek
c9a9f7f76b Move NetworkServiceClient::OnFileUploadRequested to NetworkContextClient.
The latter didn't originally exist. This does mean that a NetworkContextClient is needed for
uploads to work. NetworkContextClientBase is a base class provided in content/public for code
which creates NetworkContexts to use (e.g. safe browsing, system network context).

Change-Id: Idd6d4396c5a9c5a6503494fcd45aa87dae2a9221
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1777056
Reviewed-by: Clark DuVall <cduvall@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Auto-Submit: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#692241}
2019-08-30 21:56:15 +00:00
John Abd-El-Malek
fd91af1bdd Move Android SPNEGO token generation callback from NetworkServiceClient to NetworkContextClient.
Now that we have NetworkContextClient we could move this method to the per-NetworkContext delegate method.

Bug: 743251
Change-Id: Ibcfbf13aa232e90b3108b770884847d2ebd5fa54
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1762866
Auto-Submit: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688867}
2019-08-21 04:26:21 +00:00
John Abd-El-Malek
35bfaa578f Move methods from NetworkServiceClient to NetworkContextClient.
The latter didn't originally exist, but most of these methods have a NetworkContext associated with them so we should route it there.

Change-Id: I7d1bfbea4a36cc1b851725531c841ddd799797dd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1759297
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Clark DuVall <cduvall@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Auto-Submit: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688559}
2019-08-20 16:22:07 +00:00
Matt Falkenhagen
29144d2756 service worker: Prepare navigation for UI thread core.
The thread ServiceWorkerContextCore lives on (the "core thread")
will move from the IO thread to the UI thread.

This makes some code used in navigation be core thread-aware instead
of assuming the IO thread. This allows many content_browsertests
for ServiceWorker to pass when ServiceWorkerOnUI is enabled.

Bug: 824858
Change-Id: I3e70cf88f615e77a8f45370eea002b6b344e1511
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1760829
Commit-Queue: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688284}
2019-08-19 21:55:37 +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
92bf360296 Move ResourceRequestInfo::WebContentsGetter to WebContents::Getter.
This is in preparation of removing ResourceRequestInfo which isn't needed anymore.

Bug: 934009
Change-Id: I1f799afa6ddf2dc926898d6e18c92849f722ad12
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1726766
Reviewed-by: Robbie McElrath <rmcelrath@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Auto-Submit: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#682562}
2019-07-31 02:25:48 +00:00
John Abd-El-Malek
9635d3fe7e Get rid of a dependency on ResourceDispatcherHostImpl reloaded to LoadInfo.
This is in preparation of deleting RDH.

Bug: 934009
Change-Id: I148a4cf6935a33ba97faa4ce4c0fbec71f55f1e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1724819
Reviewed-by: Clark DuVall <cduvall@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681914}
2019-07-29 19:07:48 +00:00
John Abd-El-Malek
0e82fe7f42 Stop using ResourceDispatcherHost outside of content/ and remove a bunch of usage inside content/.
It's about to be deleted.

Bug: 934009
Change-Id: I20fc1e1b716ac9fafcc7574db5464e8000d27655
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1719835
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Clark DuVall <cduvall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681545}
2019-07-27 00:06:29 +00:00
Asanka Herath
310ef9226d [net/auth] Add NetLog support to Posix GSSAPI implementation.
This change uses the plumbing introduced in prior CLs to perform
detailed logging of GSSAPI library invocations.

R=eroman@chromium.org

Bug: 884313
Change-Id: Id010fda54f32691a092edd97385470502d18d15f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1698942
Commit-Queue: Asanka Herath <asanka@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: Eric Roman <eroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#680116}
2019-07-23 19:56:39 +00:00
Aaron Tagliaboschi
25f5b306bf Send raw headers and flagged cookies to DevTools via NetworkServiceClient
Bug: 856777, 849483, 868407
Change-Id: I694eeab0d4041b4e521b9d2c47ded5a8d7df6ba3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1643748
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Aaron Tagliaboschi <aarontag@chromium.org>
Cr-Commit-Position: refs/heads/master@{#680083}
2019-07-23 18:41:09 +00:00
Jeremy Roman
3bca4bf820 Use in-class initializers for base::WeakPtrFactory in content/.
Generated by: https://chromium-review.googlesource.com/c/chromium/src/+/1689216

Bug: 981415
Change-Id: I363f81e8c17cabfb6031666ca0846bcfcbf97b78
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1693602
Commit-Queue: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#676281}
2019-07-11 03:41:25 +00:00
Maks Orlovich
2fd169e67b Consolidate NetworkService -> Browser cookie reporting paths.
Right now we have NetworkServiceClient::OnFlagged{Request,Response}Cookies
and NetworkContextClient::{OnCookieChange, OnCookiesRead}, which get different
slices of cookie activity, and work entirely different ways. Further,
OnCookieChange can be called multiple times per response, which is kind of
wasteful.

Consolidate on a single pair of methods in NetworkContextClient, but using
the types and methodology from the OnFlagged* methods. Since the types there
have the inclusion status, it's easy to pack in INCLUDED and EXCLUDE_USER_PREFERENCES
cookies in the same list, and not doing it in NetworkServiceNetworkDelegate
feels cleaner.

This consolidation will also make it easy to retain the samesite unspecified warning
when migrating document.cookie to RestrictedCookieManager, as that can talk to
NetworkContextClient already.

Change-Id: Ic6fea41d0bfd6a864d8d8f0a9dcd4da41f74c5a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1643651
Commit-Queue: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#671347}
2019-06-21 17:10:38 +00:00
Lily Chen
fd40a019a6 Partially deduplicate cookie SameSite deprecation messages in browser
This CL adds partial deduplication of cookie SameSite deprecation
messages in the browser (RenderFrameHostImpl) before the IPC message
to the renderer to add the message to the console. It is hoped that this
pre-deduplication step will reduce the perf impact by decreasing the
volume of IPC messages caused by the cookie deprecation messages.

Bug: 971698
Change-Id: I50c5d6a3c2b96ae4d09b941f05e90351ee2ebcea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1658888
Commit-Queue: Lily Chen <chlily@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#670780}
2019-06-20 03:25:30 +00:00
Tarun Bansal
f153d683b6 Expose WebRTC connection count to network process
Declare a new WebRTC connection observer. This observer is
implemented by WebRTC connection tracker in chrome/browser/loader.
The observer listens to the changes in WebRTC connection counts
and sends them to the network process using mojom.
Within the network process, these notifications are sent
to the Network Quality Estimator (NQE).

This needs to be a observer-type interface since we want
Resource Scheduler (or whichever class does pausing of browser
traffic in the network process) to be notified when the WebRTC calls
end. This way the scheduler in the network process can
pause/resume the browser traffic without periodically
probing WebRTC internals class.

Change-Id: Ieb2513bbf75b534ef8295bbbfa5d8b6b5ed575c4
Bug: 913424
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1640717
Commit-Queue: Tarun Bansal <tbansal@chromium.org>
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Auto-Submit: Tarun Bansal <tbansal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#669736}
2019-06-17 18:18:05 +00:00
Lily Chen
ee28094c16 Partially deduplicate SameSite cookie deprecation messages
This adds the ability to request deduplication of console messages
in blink by adding a "discard_duplicates" parameter that specifies
whether duplicate messages should be discarded when adding a message
to ConsoleMessageStorage.

This is for the purpose of partially deduplicating SameSite cookie
deprecation messages to reduce console spam.

Bug: 971698
Change-Id: I2d056d7ed90f920e52cda1d98eb6a84ea55ceaec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1646545
Reviewed-by: Nate Chapin <japhet@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lily Chen <chlily@chromium.org>
Cr-Commit-Position: refs/heads/master@{#669406}
2019-06-14 22:31:11 +00:00
Aaron Tagliaboschi
0485879974 Add null check to main frame check in samesite deprecation messages
There seems to be a race condition where cookies are called to be
stored or sent on a page that somehow navigates to a interstitial page,
causing WebContents::FromRenderFrameHost to return a null pointer that
is then dereferenced. Because we definitely don't need messages from
interstitial pages (and console messages shouldn't be sent after the
page has navigated away anyways), simply returning early would be
expected behaviour anyways.

Bug: 973574
Change-Id: I4777e36baf7737bcd4d73d36840fa671e34a2ed5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1658688
Commit-Queue: Aaron Tagliaboschi <aarontag@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#669331}
2019-06-14 19:48:18 +00:00
John Abd-El-Malek
89a5f3ab57 Remove IOThread class as it's not needed anymore.
Bug: 934009
Change-Id: I193c14948f34ca632ae60ea2834b226c0cb7a1f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1659012
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Eric Roman <eroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#669295}
2019-06-14 18:21:53 +00:00
Hayato Ito
4c5254229b Fix a crash on basic authentication via ServiceWorker
Fixes a crash caused by the wrong assumption on FrameTreeNodeIdRegistry.
FrameTreeNode id may already be removed from the registry so we have to do
a null-check for IsMainFrameGetter callback.

Bug: 971719
Change-Id: I370cfc83c3e72327824b6f76e81031a961839709
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1646683
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Hayato Ito <hayato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#667034}
2019-06-07 06:50:33 +00:00
Lily Chen
b22952e4c1 Make cookie deprecation console messages default disabled behind a flag
This CL adds a chrome://flags option to show console messages for
SameSite cookie deprecation messages. This option is disabled by
default.

This also modifies the messages to not specify a specific milestone for
the deprecations, in order to more accurately reflect the status of
the feature.

Bug: 971698
Change-Id: I7f90da9cd6eb5d2a2525e6a380247692b6bcd20b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1646669
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Commit-Queue: Lily Chen <chlily@chromium.org>
Cr-Commit-Position: refs/heads/master@{#666805}
2019-06-06 18:56:23 +00:00
Hayato Ito
ee6ca197af Support basic access authentication through serviceworkers
Authentication dialog is not shown when ServiceWorker returns 401 response.

This CL addresses that in a similar manner as https://crrev.com/c/1290435 did,
adding |window_id| on OnAuthRequired requests, however, unlike the client
certificate case, we'll need even more plumbing for this bit because
LoginHandlerDelegate needs to know whether a request is for the main frame or a
subframe.

This CL is effective only when Network Service is enabled. No behavior change
on platforms where Network Service is disabled.

Regarding the behavior of basic access auth login prompt, the prompt is always
shown, regardless of any combination of mainframe/subframe and mainresource
/subresource.

In summary, the behavior of login prompt became as follows:

|                        | TOT    | TOT (via SW) | With CL | With CL (via SW) |
| mainframe-mainresource | prompt | no prompt    | prompt  | prompt           |
| mainframe-subresource  | prompt | no prompt    | prompt  | prompt           |
| subframe-mainresource  | prompt | no prompt    | prompt  | prompt           |
| subframe-subresource   | prompt | no prompt    | prompt  | prompt           |

Regarding tests, I confirmed that basic access authentication dialog is surely
shown for main resources (and sub resources), using the repro case reported in
the bug, manually, as well as adding a new browsertest for basic auth.

This CL added new browsertest to service_worker_basic_tls_browsertest.cc,
however, which is not renamed yet for easier reviewing. We'll rename in a
follow-up CL.

Bug: 623464,963748

Change-Id: I01284b73b7af5de1e8a25112f2b06d50efe8dcc8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1614723
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Commit-Queue: Hayato Ito <hayato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#665791}
2019-06-04 03:06:36 +00:00
Maks Orlovich
0eeaa86c1a Reland "RestrictedCookieManager: report activity to ContentBrowserClient"
This reverts commit e102db8ba6.

Reason for reland: Test fixed w/o NetworkService
Also incorporates a follow up fix to dealing with network service reconnect.

Original change's description:
> Revert "RestrictedCookieManager: report activity to ContentBrowserClient"
>
> This reverts commit b128ac8eb8.
>
> Reason for revert: Some cookie tests failing on linux-chromeos-dbg
>
> The following tests are failing consistently when the network service is disabled (aka the non_network_service_browser_tests task)"
> CookieSettingsTest.AllowCookiesUsingExceptions/1
> CookieSettingsTest.AllowCookiesUsingExceptions/3
> CookieSettingsTest.BlockCookiesUsingExceptions/1
> CookieSettingsTest.BlockCookiesUsingExceptions/3
>
> Failure output:
> ../../chrome/browser/content_settings/content_settings_browsertest.cc:390: Failure
> Expected equality of these values:
>   1u
>     Which is: 1
>   blocked->GetCookieCount()
>     Which is: 0
>
> Failing build: https://ci.chromium.org/p/chromium/builders/ci/linux-chromeos-dbg/12530
>
> Original change's description:
> > RestrictedCookieManager: report activity to ContentBrowserClient
> >
> > ...So that things done via async cookie-store API show up in used/blocked
> > cookies GUI.
> >
> > This is done via NetworkContextClient, with some existing reporting via
> > NetworkServiceClient converted to it, as in case of service worker it's
> > not associated with process + routing ID pair.
> >
> > This now invokes ContentBrowserClient::OnCookie{sRead,Change} on IO,
> > not UI, thread.
> >
> > Bug:958923
> >
> > Change-Id: I7d1832ad30f57c67ea292481444a5e6ca07657df
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1577493
> > Reviewed-by: Tom Sepez <tsepez@chromium.org>
> > Reviewed-by: Matt Falkenhagen <falken@chromium.org>
> > Reviewed-by: John Abd-El-Malek <jam@chromium.org>
> > Reviewed-by: Martin Šrámek <msramek@chromium.org>
> > Commit-Queue: Maks Orlovich <morlovich@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#662253}
>
> TBR=falken@chromium.org,jam@chromium.org,tsepez@chromium.org,msramek@chromium.org,pwnall@chromium.org,mkwst@chromium.org,morlovich@chromium.org
>
> Change-Id: I4e587a04252b135a48f5e0d09414f62df65f9278
> Bug: 958923
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1626207
> Commit-Queue: Timothy Loh <timloh@chromium.org>
> Reviewed-by: Timothy Loh <timloh@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#662541}


Change-Id: Id6a4b2923f61f033b2ee9867fcbb7f741431438f
Bug: 958923
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1625906
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Maks Orlovich <morlovich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#665144}
2019-05-31 16:20:34 +00:00
Aaron Tagliaboschi
e59c564f61 Send excluded/flagged cookies to DevTools for deprecation warnings
These methods will (eventually) be used to pass raw header information
(both request and response) from the network service directly to the
browser process, bypassing the render process. Currently sends
information about cookies that were excluded or flagged before being
sent in a request or stored in a response.

In NetworkServiceClient, a deprecation warning is fired if a cookie
runs afoul of the new samesite cookie rules (described in
draft-west-cookie-incrementalism) and then fires a verbose message for
each cookie. These messages will fire if the feature is on and the cookies
are truly blocked and also when the feature is turned off and the feature is
flagged by the code in <crrev.com/c/1625841>

Also adds use counters for the deprecation messages to measure compat risk.

Bug: 856777,966576

Change-Id: Ibf49035bdaf4b20cf0d82e1c1b00e54d4050c0c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1600541
Commit-Queue: Aaron Tagliaboschi <aarontag@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664949}
2019-05-30 23:22:34 +00:00
Daniel McArdle
8b30dd498a Refactor client cert flow with ClientCertificateResponder mojo interface
The problem this CL addresses is that several semantically-different
messages are currently jammed into the response from
OnCertificateRequested. For example, using nullptr for certificate and
private key to signify that no certificate was selected.

This CL eliminates the response from OnCertificateRequested and moves
it into several different messages within the new
ClientCertificateResponder interface.

Bug: 946742
Change-Id: I49c63bdc0732a438336a02e558d4cca4d1202ff6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1589995
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: David Benjamin <davidben@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664537}
2019-05-29 23:38:13 +00:00
Hayato Ito
ce707c917e Don't expose FrameTreeNodeIdRegistry::Get()
This is a follow-up CL for https://crrev.com/c/1623611/7, addressing the comment [1].

[1] https://crrev.com/c/1623611/7/content/browser/frame_host/frame_tree_node_id_registry.h#31

Bug: 623464

Change-Id: I38bf8f5b0b22577bc278797151b20e9700700879
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1628495
Commit-Queue: Hayato Ito <hayato@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#663471}
2019-05-27 03:26:33 +00:00
Hayato Ito
fa35d94777 Move frame_tree_node_id.{cc,h} for a nice diff
This is a preparation CL for https://crrev.com/c/1628495 so that
it has a nice diff.

Bug: 623464

Change-Id: I3adcb0796ea619804f61a7cc2a69821300b2bf60
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1628627
Commit-Queue: Hayato Ito <hayato@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#663000}
2019-05-24 08:18:58 +00:00
Hayato Ito
b898e2fe1b Use FrameTreeNode id, instead of WebContentsGetter, in WebContentsGetterRegistry
This is a preparation CL for https://crrev.com/c/1614723.

As per the review comment [1], we can use FrameTreeNode id, instead of
WebContentsGetter, in WebContentsGetterRegistry because we can get
WebContentsGetter from FrameTreeNode id, as well as to know whether the frame
is mainframe or not from the id.

WebContentsGetterRegistry is now renamed to FrameTreeNodeIdRegistry.

[1] https://crrev.com/c/chromium/src/+/1614723/12/content/browser/web_contents/web_contents_getter_registry.h#16

Bug: 623464
Change-Id: Ifab7727f6a6b74408f815e5b853d75d39c515f9b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1623611
Commit-Queue: Hayato Ito <hayato@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#662992}
2019-05-24 07:45:12 +00:00
Timothy Loh
e102db8ba6 Revert "RestrictedCookieManager: report activity to ContentBrowserClient"
This reverts commit b128ac8eb8.

Reason for revert: Some cookie tests failing on linux-chromeos-dbg

The following tests are failing consistently when the network service is disabled (aka the non_network_service_browser_tests task)"
CookieSettingsTest.AllowCookiesUsingExceptions/1
CookieSettingsTest.AllowCookiesUsingExceptions/3
CookieSettingsTest.BlockCookiesUsingExceptions/1
CookieSettingsTest.BlockCookiesUsingExceptions/3

Failure output:
../../chrome/browser/content_settings/content_settings_browsertest.cc:390: Failure
Expected equality of these values:
  1u
    Which is: 1
  blocked->GetCookieCount()
    Which is: 0

Failing build: https://ci.chromium.org/p/chromium/builders/ci/linux-chromeos-dbg/12530

Original change's description:
> RestrictedCookieManager: report activity to ContentBrowserClient
>
> ...So that things done via async cookie-store API show up in used/blocked
> cookies GUI.
>
> This is done via NetworkContextClient, with some existing reporting via
> NetworkServiceClient converted to it, as in case of service worker it's
> not associated with process + routing ID pair.
>
> This now invokes ContentBrowserClient::OnCookie{sRead,Change} on IO,
> not UI, thread.
>
> Bug:958923
>
> Change-Id: I7d1832ad30f57c67ea292481444a5e6ca07657df
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1577493
> Reviewed-by: Tom Sepez <tsepez@chromium.org>
> Reviewed-by: Matt Falkenhagen <falken@chromium.org>
> Reviewed-by: John Abd-El-Malek <jam@chromium.org>
> Reviewed-by: Martin Šrámek <msramek@chromium.org>
> Commit-Queue: Maks Orlovich <morlovich@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#662253}

TBR=falken@chromium.org,jam@chromium.org,tsepez@chromium.org,msramek@chromium.org,pwnall@chromium.org,mkwst@chromium.org,morlovich@chromium.org

Change-Id: I4e587a04252b135a48f5e0d09414f62df65f9278
Bug: 958923
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1626207
Commit-Queue: Timothy Loh <timloh@chromium.org>
Reviewed-by: Timothy Loh <timloh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#662541}
2019-05-23 09:01:04 +00:00
Maks Orlovich
b128ac8eb8 RestrictedCookieManager: report activity to ContentBrowserClient
...So that things done via async cookie-store API show up in used/blocked
cookies GUI.

This is done via NetworkContextClient, with some existing reporting via
NetworkServiceClient converted to it, as in case of service worker it's
not associated with process + routing ID pair.

This now invokes ContentBrowserClient::OnCookie{sRead,Change} on IO,
not UI, thread.

Bug:958923

Change-Id: I7d1832ad30f57c67ea292481444a5e6ca07657df
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1577493
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Martin Šrámek <msramek@chromium.org>
Commit-Queue: Maks Orlovich <morlovich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#662253}
2019-05-22 17:43:02 +00:00
Ting Shao
c9ab034523 Clear site data through NetworkContextClient
When Clear-Site-Data header is received, call the OnClearSiteData()
method of NetworkContextClient instead of NetworkServiceClient because
NetworkContextClient always has a BrowserContext associated.

Bug: 952723
Change-Id: I8aff6bbd8eb9486379694d30c731974f24f86d50
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1604469
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Ting Shao <ting.shao@intel.com>
Cr-Commit-Position: refs/heads/master@{#661162}
2019-05-18 06:35:48 +00:00
John Abd-El-Malek
7d032b378c Remove ResourceType parameter from NetworkServiceClient::OnAuthRequired.
The browser needed two things:
-if it was for the main frame's navigation request: it can deduce this already from the process/frame ID
-if it's a cross-origin image request which depending on policy can bring up a login dialog: plumbed the policy to the renderer in RendererPreferences and reused ResourceRequest::do_not_prompt_for_login for this use case

This is a step towards the TODO to remove this from network::ResourceRequest, since network service
shouldn't know about this enum.

Bug: 960143

Change-Id: I32b09fc11bd00a054f7069388af457fd5ffe1a39
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1595563
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#657328}
2019-05-07 18:01:31 +00:00
John Abd-El-Malek
c5b8df91d1 Remove ResourceType usage in NetworkServiceClient::OnSSLCertificateError.
The browser only needed to know if the request is for a main frame navigation or not. It can already
deduce this by looking at the requesting factory and request's IDs.

This is a step towards the TODO to remove this from network::ResourceRequest, since network service
shouldn't know about this enum.

Bug: 960143

Change-Id: Id01b2f654b9af8d2b42c2e861eead1675c6fe7ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1597198
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#657304}
2019-05-07 17:02:23 +00:00
Emily Stark
d9df3d3b39 Plumb net error to SSLErrorHandler
A previous CL
(https://chromium-review.googlesource.com/c/chromium/src/+/1570471)
plumbed a net error out of net/ when an SSL error occurs. This CL
plumbs the net error up to SSLErrorHandler, so that a net error
doesn't have to be reconstructed out of a cert status. The end goal is
to make it so that MapCertStatusToNetError is used to synthesize a net
error code when the net stack didn't treat the cert error as an error,
rather than to convert a cert status to an error code even when there
was an actual error.

Bug: 937529
Change-Id: I553061794e4efa7d40e62e0931ed0e7b908ecfd6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1574627
Commit-Queue: Emily Stark <estark@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Ryan Sleevi <rsleevi@chromium.org>
Reviewed-by: Carlos IL <carlosil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#654918}
2019-04-29 17:54:57 +00:00
Daniel Cheng
aee5c031a6 Make content::ResourceType an enum class.
This allows us to be more explicit when content::ResourceType needs to
be smuggled in an untyped int. It has the effect of introducing more
static_cast<int>, but this makes the conversion sites explicit.

This also allows several other incidental fixes:
- the Mojo version of the enum no longer defines a sentinel value (which
  violates best practices in the security guidelines)
- the C++ version of the enum can now define a compiler-enforced
  kMaxValue enumerator.
- Since kMaxValue is no longer a distinct value, dummy handling for this
  value can be removed. This revealed a quirk in
  chrome/browser/predictors/loading_data_collector.cc

Tbr: avi@chromium.org
Tbr: blundell@chromium.org
Tbr: droger@chromium.org
Tbr: rdevlin.cronin@chromium.org
Change-Id: I7203a029b1fcb06426c957d208e9278a25d4a45b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1569345
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#652395}
2019-04-18 23:49:05 +00:00
Emily Stark
f2c9bbd601 Unrefcount AuthChallengeInfo
This class is not ref-counted for any particular reason and the shared
ownership is confusing/unnecessary. This CL removes its refcounting;
it is now passed around mostly as a const ref, and copied where
necessary, as described in detail below.

The AuthChallengeInfo for a request is created and populated by
HttpAuthController, and ownership is then handed off to HttpResponseInfo.
HttpResponseInfo stores the AuthChallengeInfo inside a base::Optional
rather than a unique_ptr so that HttpResponseInfo remains copyable (and
rather than as a member field directly because consumers need to tell when
the auth_challenge has been set or not).

The AuthChallengeInfo is then passed to delegates as a const ref so it
is clear that delegates don't own it and can't modify it. It is copied on
the UI thread when we get to the point of creating the LoginDelegate/
LoginHandler.

Bug: 949197
Change-Id: I8b91fd80d20b4771c38cf4785ea0ca33ddb25ab5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1550631
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Asanka Herath <asanka@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: Eugene But <eugenebut@chromium.org>
Reviewed-by: Luke Halliwell <halliwell@chromium.org>
Commit-Queue: Emily Stark <estark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#649143}
2019-04-09 17:08:58 +00:00
David Benjamin
ed0034e960 Avoid a refcount bump.
This doesn't matter at all, but I noticed it while I was looking at this
code.

Bug: none
Change-Id: Ie887758830d0b493e2c144358acad2a45bcd006b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1552400
Auto-Submit: David Benjamin <davidben@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: David Benjamin <davidben@chromium.org>
Cr-Commit-Position: refs/heads/master@{#647791}
2019-04-04 16:53:46 +00:00
John Abd-El-Malek
d1e2a1cf94 Ensure that NetworkChangeNotifier on Android starts with the correct values in the network process.
Bug: 929909
Change-Id: Ic951d24c55a433b569031cf51d0907be840e9f86
Reviewed-on: https://chromium-review.googlesource.com/c/1492353
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Robbie McElrath <rmcelrath@chromium.org>
Reviewed-by: Paul Jensen <pauljensen@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#636518}
2019-02-28 20:01:03 +00:00
David Benjamin
eced01fc95 Make content::LoginDelegate single-thread and uniquely-owned
This is a reland of https://chromium-review.googlesource.com/c/1388164
with a fix + hardening for a callback reentrancy bug. Diff patchset 1
to patchset 3 for the changes. Patchset 3 to 5 are rebase/commit message
changes.

This pushes the IO/UI hop to inside //content, which simplifies the
callers. (Every caller is actually a UI thread object with an ad hoc IO
thread proxy.) LoginDelegate itself is now uniquely-owned and the proxy
is moved to inside ResourceDispatcherHost on the ResourceLoader path. On
the network service path, we don't need a thread hop at all, so this
simplifies things and saves a UI/IO round-trip.

Bug: 908926
Change-Id: I2a38890f95b967f8739423d520e95a264289d267
Reviewed-on: https://chromium-review.googlesource.com/c/1457001
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Carlos IL <carlosil@chromium.org>
Commit-Queue: David Benjamin <davidben@chromium.org>
Cr-Commit-Position: refs/heads/master@{#636092}
2019-02-27 18:29:02 +00:00
Clark DuVall
fe37e8e0b6 Create NetworkChangeNotifier in network process on Android
Previously, we were not creating a NetworkChangeNotifier in the network
process on Android. This change syncs the events from the browser
process to the network process using a similar mechanism to what ChromeOS
uses.

It is difficult to detect network changes directly in the network
process because some of the java side code depends on being in the
browser process. This includes dependencies on ApplicationStatus
(which only works in browser process), and requiring a thread with
a Looper, which would need to be created in the network process before
initializing the NetworkChangeNotifier, which makes startup of the
network process more complicated.

Bug: 929909
Change-Id: I67923318b7a2f911d325584711a370305826d4a3
Reviewed-on: https://chromium-review.googlesource.com/c/1469063
Commit-Queue: Clark DuVall <cduvall@chromium.org>
Reviewed-by: Matt Mueller <mattm@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Robbie McElrath <rmcelrath@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#632454}
2019-02-15 02:00:28 +00:00
Yuki Shiino
737537aca4 Revert "Make content::LoginDelegate single-threaded and uniquely-owned"
This reverts commit 350d5c9fba.

Reason for revert: This patch is suspicious to have caused failure at PrerenderBrowserTest.PrerenderHttpAuthentication in network_service_browser_tests on Linux.  Not 100% sure, but allow me to try to revert this patch.

https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Linux%20Tests%20%28dbg%29%281%29%2832%29/56211

https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8922409938287938432/+/steps/network_service_browser_tests/0/logs/PrerenderBrowserTest.PrerenderHttpAuthentication__status_CRASH_/0

Original change's description:
> Make content::LoginDelegate single-threaded and uniquely-owned
> 
> After all the preceding cleanup, every LoginDelegate is now a
> straightforwardly-owned UI-only loader with an ad-hoc IO/UI proxy
> in front. Shift the //content interface to just the former and drop
> all the ad-hoc proxy bits. Within //content...
> 
> In the ResourceLoader path, this pushes the IO/UI hop to RDH. It's
> the same thread hops, but only written once.
> 
> In the network service path, we don't need a thread hop at all, so
> this simplifies things and saves a UI/IO round-trip.
> 
> Bug: 908926
> Change-Id: Ica47c94f1e20cf071687b5ac413e79328ccf4fc8
> Reviewed-on: https://chromium-review.googlesource.com/c/1388164
> Reviewed-by: John Abd-El-Malek <jam@chromium.org>
> Reviewed-by: Richard Coles <torne@chromium.org>
> Reviewed-by: Carlos IL <carlosil@chromium.org>
> Reviewed-by: Matt Menke <mmenke@chromium.org>
> Commit-Queue: David Benjamin <davidben@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#628925}

TBR=davidben@chromium.org,jam@chromium.org,torne@chromium.org,mmenke@chromium.org,carlosil@chromium.org

Change-Id: I3cfbbc126490dfb0d156725c4cab59b3eb36b3a8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 908926
Reviewed-on: https://chromium-review.googlesource.com/c/1454167
Reviewed-by: Yuki Shiino <yukishiino@chromium.org>
Commit-Queue: Yuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#629081}
2019-02-05 09:28:49 +00:00
David Benjamin
350d5c9fba Make content::LoginDelegate single-threaded and uniquely-owned
After all the preceding cleanup, every LoginDelegate is now a
straightforwardly-owned UI-only loader with an ad-hoc IO/UI proxy
in front. Shift the //content interface to just the former and drop
all the ad-hoc proxy bits. Within //content...

In the ResourceLoader path, this pushes the IO/UI hop to RDH. It's
the same thread hops, but only written once.

In the network service path, we don't need a thread hop at all, so
this simplifies things and saves a UI/IO round-trip.

Bug: 908926
Change-Id: Ica47c94f1e20cf071687b5ac413e79328ccf4fc8
Reviewed-on: https://chromium-review.googlesource.com/c/1388164
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Reviewed-by: Carlos IL <carlosil@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Commit-Queue: David Benjamin <davidben@chromium.org>
Cr-Commit-Position: refs/heads/master@{#628925}
2019-02-04 23:12:56 +00:00