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}
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}
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}
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}
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}
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}
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}
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}
*** 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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
...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}
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}
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}
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}
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}
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}
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}
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}
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}
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}