0
Commit Graph

88 Commits

Author SHA1 Message Date
Arthur Sonzogni
c686e8f4fd Rename {absl => std}::optional in //content/
Automated patch, intended to be effectively a no-op.

Context:
https://groups.google.com/a/chromium.org/g/cxx/c/nBD_1LaanTc/m/ghh-ZZhWAwAJ?utm_medium=email&utm_source=footer

As of https://crrev.com/1204351, absl::optional is now a type alias for
std::optional. We should migrate toward it.

Script:
```
function replace {
  echo "Replacing $1 by $2"
  git grep -l "$1" \
    | cut -f1 -d: \
    | grep \
      -e "^content" \
    | sort \
    | uniq \
    | grep \
      -e "\.h" \
      -e "\.cc" \
      -e "\.mm" \
      -e "\.py" \
    | xargs sed -i "s/$1/$2/g"
}
replace "absl::make_optional" "std::make_optional"
replace "absl::optional" "std::optional"
replace "absl::nullopt" "std::nullopt"
replace "absl::in_place" "std::in_place"
replace "absl::in_place_t" "std::in_place_t"
replace "\"third_party\/abseil-cpp\/absl\/types\/optional.h\"" "<optional>"
git cl format
```

# Skipping unrelated "check_network_annotation" errors.
NOTRY=True

Bug: chromium:1500249
Change-Id: Icfd31a71d8faf63a2e8d5401127e7ee74cc1c413
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5185537
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1245739}
2024-01-11 08:36:37 +00:00
Chris Fredrickson
2145062963 [SAA] Inherit the context's storage-access bit for WebSockets
This plumbs the has_storage_access bool from the WebSocket's
ExecutionContext to the network service machinery, so that a
Document's or Worker's Storage Access API opt-in is respected for
WebSocket connections. (Note that this bit is untrusted; a compromised
renderer cannot gain unauthorized access to unpartitioned cookies by
lying with this bit.)

This behavior is currently unspecified by the Storage Access API spec,
but we will engage there to specify it. In the meantime, web
developers expect the API to work this way (see
https://crbug.com/947413#c20).

I plan to add WPTs for this in a followup, but I'd like to land this
before branch cut if possible.

Bug: 1496832
Change-Id: I29e0e4b3a2fc6fb3faed8c80954aaee14499e449
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4982327
Reviewed-by: Johann Hofmann <johannhof@chromium.org>
Reviewed-by: Adam Rice <ricea@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Commit-Queue: Chris Fredrickson <cfredric@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Adam Langley <agl@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1218202}
2023-11-01 14:32:25 +00:00
Yutaka Hirano
8cee1cded4 Remove yhirano from OWNERS files
Bug: None
Change-Id: Id631b173b30b4f24b8973769786a3eabd1eab687
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3898650
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1051062}
2022-09-26 03:50:00 +00:00
Avi Drissman
4e1b7bc33d Update copyright headers in content/
The methodology used to generate this CL is documented in
https://crbug.com/1098010#c34.

No-Try: true
No-Presubmit: true
Bug: 1098010
Change-Id: I8c0f009d16350271f07d8e5e561085822cc9dd27
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3895935
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1047456}
2022-09-15 14:03:50 +00:00
Gabriel Charette
f385133b85 [base] IWYU for base::CommandLine::ForCurrentProcess()
Prereq for https://chromium-review.googlesource.com/c/chromium/src/+/3347944
which drops main_function_params.h from chrome_browser_main.h

Bug: 1175074
Change-Id: I90bb33ab816edd090ad8af755d645a96fd189bb9
AX-Relnotes: n/a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3615351
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#997468}
2022-04-28 23:39:18 +00:00
David Sanders
a23aa0abb5 Do IWYU for content_browser_client.h
Also adds some includes to other files which were getting them
transitively, to fix the build.

Bug: 242216
Change-Id: Id4f2ce030135e5ade9ec28d80053dd0a7726156e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3567882
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#988831}
2022-04-05 04:08:32 +00:00
David Sanders
2ee1f35087 Remove unused includes of render_process_host_impl.h
Also adds some includes which were getting brought in
transitively, to fix the build.

Bug: 242216
Change-Id: I9af67cc94ffb62dd4248109055f7bdc5db5dc346
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3528193
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#981516}
2022-03-16 07:21:19 +00:00
David Sanders
aad78202e5 Remove unused inclusions of //content/browser/renderer_host/render_frame_host_impl.h
Bug: 242216
Change-Id: Ib6882edc8e9474666de7eb7e634d4f3dad627349
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3410633
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Owners-Override: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#962288}
2022-01-23 02:13:29 +00:00
David Sanders
00384722cd Fix typos in trailing namespace comments
Change-Id: Iea171a5bfa3fb441e44e8b08f06a0936481e2e14
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3334121
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Gauthier Ambard <gambard@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Jordan Bayles <jophba@chromium.org>
Reviewed-by: Kevin McNee <mcnee@chromium.org>
Commit-Queue: Kevin McNee <mcnee@chromium.org>
Cr-Commit-Position: refs/heads/main@{#951969}
2021-12-15 16:37:17 +00:00
Peter Boström
1d6a095400 Remove unused "base/macros.h" in content/
Removes `#include "base/macros.h"` from files in content/ that do not
contain `ignore_result(`.

Bug: 1010217
No-Try: true
Change-Id: I887403408704241047e3bd66e953ff7df195368b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3274993
Commit-Queue: Peter Boström <pbos@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#940781}
2021-11-11 16:07:03 +00:00
Danil Somsikov
62ef8c9bc7 Also propagate devtools token in presence of extensions that can
intercept requests.

Bug: 423246
Change-Id: I712305d94ad5ded3966a7b2d117307f2e15c562c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3244405
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Danil Somsikov <dsv@chromium.org>
Cr-Commit-Position: refs/heads/main@{#935839}
2021-10-28 12:17:26 +00:00
Peter Boström
828b902994 Replace DISALLOW_COPY_AND_ASSIGN in content/
This replaces DISALLOW_COPY_AND_ASSIGN with explicit constructor deletes
where a local script is able to detect its insertion place (~Foo() is
public => insert before this line).

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

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

Bug: 1010217
Change-Id: Iea478401b7580682c7b9f195f7af9cbbdb6ce315
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3167292
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#923194}
2021-09-21 02:28:43 +00:00
Danil Somsikov
4c7ee57e51 Propagate throttling_profile_id all the way from renderer to
network::WebSocket

This CL contains only plumbing, throttling_profile_id is not yet used.

Bug: 423246
Change-Id: I67fb654ffbb9d9b9a3c316a1c595fb7cc523c219
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2983027
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Martin Kreichgauer <martinkr@google.com>
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
Commit-Queue: Kinuko Yasuda <kinuko@chromium.org>
Auto-Submit: Danil Somsikov <dsv@chromium.org>
Cr-Commit-Position: refs/heads/master@{#897734}
2021-07-01 12:02:04 +00:00
Yutaka Hirano
9b3755b041 [WebSocket] file:// origin should be treated as opaque
Similarly to the usual loading case, we should attach "null" instead of
"file://" as the origin header to WebSocket requests initiated by a file
origin (unless "-allow-file-access-from-files" is specified).

Bug: 1206736
Change-Id: Idb3a8c1ad56eb07ce5d897e2fb3fe246672a6be8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2903375
Reviewed-by: Ryan Hamilton <rch@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Auto-Submit: Yutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#884879}
2021-05-20 05:27:22 +00:00
Anton Bikineev
f62d1bf48e content: Replace base::Optional and friends with absl counterparts
This replaces:
- base::Optional -> absl::optional
- include "base/optional.h"
  ->
  include "third_party/abseil-cpp/absl/types/optional.h"
- base::nullopt -> absl::nullopt
- base::make_optional -> absl::make_optional

Bug: 1202909
Change-Id: Ie9f37bcbf6115632a19f4d063387d07b3723926f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2897246
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Owners-Override: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#883270}
2021-05-15 17:56:07 +00:00
Lei Zhang
02a0ad7f4a Fix header guards in content/.
Generated mechanically as follows:

git ls-files '*.h' | grep -E '^content/' | \
    xargs parallel cpplint.py --filter=-,+build/header_guard -- 2>&1 | \
    grep build/header_guard | tools/apply_cpplint_header_guard.py

Bug: 1200694
Change-Id: Iaf6b1c84150d617c3eecc69fb0751ad76dd7fe3a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2839364
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#874577}
2021-04-21 05:26:08 +00:00
Dave Tapuska
03d6f50573 Rename observer to URLLoaderNetworkServiceObserver
With the expanded scope of the interface became apparent the previous
name was incorrect. AuthenticationAndCertificateObserver becomes
URLLoaderNetworkServiceObserver. This rename was largely done by
3 sed commands.

BUG=1173710

Change-Id: I29206a9bd14af9bcad495ae729314bb23da65006
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2733070
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Owners-Override: Dave Tapuska <dtapuska@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#860409}
2021-03-05 23:06:28 +00:00
Dave Tapuska
cb5cbcb9f8 Move OnSSLCertificateError to a new interface.
Add a new AuthenticationAndCertificateObserver mojo interface as
detailed in [1]. This interface is created to be bound by a frame or
a navigation request. The interface is still implemented in the
StoragePartitionImpl.

Rename AuthenticationHandler to WebSocketAuthenticationHandler so that
it is clear that interface is only for WebSockets.

Change WebSocket interface to take a bound
AuthenticationAndCertificateObserver and remove the passed in frame id.

[1] https://tinyurl.com/yshosfw9

Bug: 1173710
Change-Id: I55b1261d9a9ae8e996395747a93b5f214968b037
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2668748
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#852278}
2021-02-09 19:10:45 +00:00
Josip Sokcevic
dffe4c6b9b [4/N] Add DIR_METADATA files to directories under //content
Generate DIR_METADATA files and remove metadata from OWNERS
files for directories under //content.

R=boliu@chromium.org, dtseng@chromium.org, kbr@chromium.org

Bug: 1113033
Change-Id: Id2c963398829473e034373d3dc7909d325c77c0b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2543695
Auto-Submit: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: David Tseng <dtseng@chromium.org>
Commit-Queue: David Tseng <dtseng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#828501}
2020-11-18 00:42:00 +00:00
danakj
30f5b7dd00 Point includes to content/browser/renderer_host instead of frame_host/ (6/x)
The code has moved, so update the includes.

R=avi@chromium.org

Bug: 1091083
Change-Id: I2c9a5c20b78756fc0b460a85f00d8560f1883979
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2412947
Commit-Queue: Avi Drissman <avi@chromium.org>
Auto-Submit: danakj <danakj@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807483}
2020-09-16 15:38:45 +00:00
Adam Langley
acbad24f87 websockets: plumb traffic-annotation tag via Mojo
This change allows the caller of |CreateWebSocket| to pass in the
traffic annotation tag. This follows the pattern of other interfaces in
network_context.mojom such as |CreateTCPConnectedSocket|.

Change-Id: I3a8654c5a290a69d5e627450efed61fb9d36ed53
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2357669
Reviewed-by: Martin Šrámek <msramek@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Adam Rice <ricea@chromium.org>
Commit-Queue: Adam Langley <agl@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799106}
2020-08-18 15:14:52 +00:00
Matt Menke
29a538d2bb Replace NetworkIsolationKey with IsolationInfo in CreateWebSockets API.
IsolationInfo merges NIK and SiteForCookies, to ensure they're
consistent, and conveniently also lets us distrust SiteForCookies
values provided by the renderer.

We do not yet use the SiteForCookies value in the IsolationInfo, as it
doesn't always match (yet). This CL will allow us to add DCHECKs to
make sure the values are always the same before we switch over.

This CL also fixes some net/ WebSocket unit tests that incorrectly
set up requests with NetworkIsolationKeys with different top frame and
frame origins, but a non-empty SiteForCookies values. This is exactly
the sort of inconsistency IsolationInfo is designed to catch.

Bug: 1060631
Change-Id: I1649493c267fb7d1c334daf8c9361c93a8721ecc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2163626
Reviewed-by: Shivani Sharma <shivanisha@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Adam Rice <ricea@chromium.org>
Commit-Queue: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#763844}
2020-04-29 16:12:17 +00:00
Maks Orlovich
ab27e24d32 Convert the rest of Network Service APIs to net::SiteForCookies
... And adjust computation and use of it to take advantage of the type;
with significant simplifications to Document::SiteForCookies,
RenderFrameHostImpl::ComputeSiteForCookiesInternal, and
RenderFrameMessageFilter::ValidateCookieAccessAt

A bunch of conversions still remain around settings and media/
things, for CL-side reasons (and also deps reasons for media/).

Bug: 577565

Change-Id: Ic294275b0d01cc8bc16cb815370992ecd9ccd99f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1935254
Commit-Queue: Maksim Orlovich <morlovich@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#728991}
2020-01-07 18:10:39 +00:00
Ehimare Okoyomon
4446d8c2e0 Populate NetworkIsolationKey for websockets
Populate NIK for websocket requests to provide a TopFrameOrigin
for cookie access checks.

Bug: 989067
Change-Id: Ic3bceee832a33abea84d2f0fc5ab0291c5f30336
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1859986
Reviewed-by: Greg Kerr <kerrnel@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Maksim Orlovich <morlovich@chromium.org>
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Commit-Queue: Ehimare Okoyomon <eokoyomon@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708586}
2019-10-23 12:47:32 +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
ac7f47a5bc Convert AuthenticationHandlerPtr to new Mojo types
This CL converts AuthenticationHandlerPtr to new Mojo types.
It updates CreateWebSocket from network_context.mojom and
methods and members with new Mojo types.

It also renames |binding_as_handshake_client_| to
|receiver_as_handshake_client_| from WebRequestProxyingWebSocket.

Bug: 955171, 978694
Change-Id: I211b7ed2f37fe18b4a60ba81839abf5f77548dba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1772901
Commit-Queue: Julie Kim <jkim@igalia.com>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#691538}
2019-08-29 08:52:26 +00:00
Julie Jeongeun Kim
147816a09d Convert TrustedHeaderClient to new Mojo types
This CL converts TrustedHeaderClientPtr and
TrustedHeaderClientRequest to new Mojo types.
It also updates OnLoaderCreated and CreateWebSocket
from network_context.mojom.

Bug: 955171, 978694
Change-Id: If288b38aa8efd7d2fd7f76f817ee2434e10e9edb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1767298
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Sam McNally <sammc@chromium.org>
Commit-Queue: Julie Kim <jkim@igalia.com>
Cr-Commit-Position: refs/heads/master@{#690957}
2019-08-28 00:43:47 +00:00
Julie Jeongeun Kim
3e973f964e Convert WebSocketHandshakeClientPtr to new Mojo types
This CL converts WebSocketHandshakeClientPtr to new Mojo types.
It updates CreateWebSocket from network_context.mojom
and Connect from websocket_connector.mojom and methods
and members which implements them.

Bug: 955171, 978694
Change-Id: I8b64aa95a38a4a50bcfd71de1a4f0a207db6f4a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1761885
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Julie Kim <jkim@igalia.com>
Cr-Commit-Position: refs/heads/master@{#689384}
2019-08-22 08:02:40 +00:00
Yutaka Hirano
26e73cfd90 Stop giving WebSocketClient to WebSocket creation function
Instead, give it as an argument  of
mojom.WebSocketHandshakeClient.OnConnectionEstablished.

This is a follow up CL for
https://chromium-review.googlesource.com/c/chromium/src/+/1728917.
Passing the mojo::InterfaceRequest<WebSocketClient> at
OnConnectionEstablished is less error prone because

 1) It is unable to bind the implementation before that, and
 2) It is now clear that we should detect connection errors on
    |handshake_client| until the connection is established, and
    |client| after that.

Bug: 989406, 967524
Change-Id: Id9a7f184b678303d5b0ef8ad3b8637056a495933
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1728534
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Adam Rice <ricea@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#684215}
2019-08-06 02:38:13 +00:00
John Abd-El-Malek
f4fe9d84e4 Remove StoragePartition methods to return URLRequestContextGetters.
Bug: 934009, 967698
Change-Id: I9cb7023ed6899cd035fda7424b07989c3fdb599c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1727521
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Kinuko Yasuda <kinuko@chromium.org>
Auto-Submit: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#682582}
2019-07-31 04:05:59 +00:00
Yutaka Hirano
a61f676180 Remove redundant PostTask in WebSocketConnectorImpl
Now the extensions module for websocket is running on the UI thread, and
we can assume
WebSocketConnectorImpl::ConnectCalledByContentBrowserClient is called on
the thread.

Bug: 985681
Change-Id: I1df31dc3c8d219afd4c0576f859b9e7345dece16
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1722793
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Kinuko Yasuda <kinuko@chromium.org>
Auto-Submit: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681713}
2019-07-29 06:10:56 +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
Yutaka Hirano
8e0b4d43ce Remove mojom::WebSocket::AddChannelRequest
...in order to remove the unnecessary overhead on the browser process
when downloading / uploading payloads. With this CL, both
mojom::WebSocket and mojom::WebSocketClient only pass though the proxy
interface implemented in extensions/browser/api/web_request.

With this CL,

1) NetworkContext::CreateWebSocket takes additional parameters. This
makes the state transition in network::WebSocket a bit simpler.

2) blink::mojom::WebSocketConnector is introduced.
mojom::WebSocketConnector::Connector corresponds to
mojom::WebSocket::AddChannelRequest.

3) mojom::WebSocket is passed as a parameter of
mojom::WebSocketHandshakeClient::OnConnectionEstablished.

4) Instead of mojom::WebSocket, the extensions module now receives
a function to initiate a WebSocket opening handshake.

5) ContentBrowserClient::WillCreateWebSocket is split into three:
WillInterceptWebSocket, GetWebSocketOptions and CreateWebSocket. This
incurs an additional thread hop, but it will be fixed once the
extensions module for WebSocket is moved to the UI thread.

This improves [1] in my environment.

Without the change: 318MB/s
With the change   : 389MB/s

1: third_party/blink/perf_tests/websocket/receive-arraybuffer-1MBx100.html

Bug: 865001, 967524, 942989
Change-Id: I3b7e4b9f478f7b41138c1de5ffd89f2d4d278bd7
Cq-Include-Trybots: luci.chromium.try:linux-chromeos-dbg
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1680459
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Adam Rice <ricea@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#674747}
2019-07-04 07:12:38 +00:00
Lucas Furukawa Gadani
d726e1e8a8 Remove const interfaces from content/public API.
Bug: 908139

Change-Id: I202059461f21fe87eee3d89ea8af45b8f0d009fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1595978
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Lucas Gadani <lfg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#657731}
2019-05-08 16:20:03 +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
Nate Fischer
5f755c67ec AW NS: correctly implement cookie blocking for HTTP
Although we previously implemented cookie blocking in
http://crrev.com/c/1507286, this design did not correctly handle the
case where the application has decided to block only third party cookies
and the request redirects (such that it changes first-party-ness).

After the previous CL landed, we realized the design to use load_flags
had a significant consequence: this can subtly affect HTTP
authentication, since the load_flags opt the request into "privacy
mode", and net layer may pool this into a socket with other requests in
privacy mode. This might lead to putting requests we don't trust with
credentials into an already-authenticated socket (which would have
security consequences).

This mostly reverts the previous CL (because of the aforementioned
problems with load_flags) and instead propagates WebView's cookie policy
into the NetworkService via URLLoader options (and, new
WebSocket options). The NetworkServiceNetworkDelegate checks these
settings and either blocks or allows cookies.

Design: http://go/wv-ns-cookie-apis#heading=h.2h285wvuvqal
Bug: 941337, 941260
Test: $ run_webview_instrumentation_test_apk \
Test: --enable-features=NetworkService,NetworkServiceInProcess \
Test: -f CookieManagerTest.*
Test: $ out/Default/services_unittests --gtest_filter=URLLoaderTest.* \
Test: :NetworkContextTest.*Cookies
Cq-Include-Trybots: luci.chromium.try:android_mojo
Change-Id: I533886347441ae369b925574f344dd65801509e5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1542726
Commit-Queue: Nate Fischer <ntfschr@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#646986}
2019-04-02 22:28:24 +00:00
John Abd-El-Malek
f8ee72281e Support sending all request and response headers to webRequest for websockets with network service.
Since this incurs a performance overhead of extra process hops, only do it if extraHeaders is
specified.

Bug: 937852
Change-Id: I5db329c5eaf8781bef418b64afc5f0ab1c0c18f5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1517144
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Karan Bhatia <karandeepb@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#641070}
2019-03-15 03:54:11 +00:00
Adam Rice
e86d2b8e69 WebSocket: Fix cookie permissions check
Convert the URL to be checked from a WebSocket URL to an HTTP URL before
checking if cookie data from this origin can be shared with the
renderer. This is necessary because a page will never have a WebSocket
URL as its origin, but they are considered equivalent for permission
checks.

Also add a test that the Set-Cookie header is exposed to the inspector
protocol when it should be, and not otherwise.

BUG=924972

Change-Id: Ic760bdec9caf1f1871ae64a57ea7fc0bf3c012ec
Reviewed-on: https://chromium-review.googlesource.com/c/1458401
Commit-Queue: Adam Rice <ricea@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#631638}
2019-02-13 11:27:23 +00:00
Adam Rice
38df166135 WebSocket: Toughen check for sending cookies to renderer
The browser includes cookie headers in those it sends to the renderer if
DevTools is open. Add a check that the renderer has access to cookie
data for that origin.

This CL only changes the non-network-service codepath. The network
service code path will changed in a followup CL.

BUG=924972

Change-Id: Iaa9cd66ab805fa59a61b9f4ae192b4ef94c79962
Reviewed-on: https://chromium-review.googlesource.com/c/1439461
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Adam Rice <ricea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#629154}
2019-02-05 15:28:02 +00:00
Sebastien Marchand
f8cbfab434 Include base/bind.h in the files that use it (in //content).
Gab, I've used your refactoring script for this, the rule is:
  matches = re.compile(r'(\n *[^/\n][^/\n]*base::Bind(Once|Repeating)?\b[^*])', re.DOTALL).findall(content)

  if not matches:
    return False

  updated_content = refactor_lib.AddInclude(file_path, content, "base/bind.h")

  if updated_content == content:
    return False

  # Write updated file
  refactor_lib.WriteFile(file_path, updated_content)

TBR=gab@chromium.org

Change-Id: I6cca9dff7fa4937fd7accdc57fe774674f6c147b
Reviewed-on: https://chromium-review.googlesource.com/c/1437100
Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626088}
2019-01-25 16:02:30 +00:00
Andrey Kosyakov
1608dec4b2 DevTools: do not expose raw headers for cross-origin requests
Same as https://chromium-review.googlesource.com/c/chromium/src/+/821410/,
but now for the network service.

Bug: 898306, 793692, 721408
Change-Id: I96a2a25e66f4ff528d84baf03d600e4f1c89dd30
Reviewed-on: https://chromium-review.googlesource.com/c/1313739
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612685}
2018-11-30 17:39:00 +00:00
Eric Seckler
8652dcd5d8 content: Replace uses of BrowserThread task posting with post_task.h API
This patch updates callsites of BrowserThread task posting methods to
use the post_task.h API instead.

Background: We're changing the way tasks are posted to a BrowserThread,
see PSA [1] and design doc [2]. This unifies the way tasks are posted
and paves the way for annotating tasks with task types and other
attributes that can be used to prioritize tasks in the future browser
UI thread scheduler (design doc [3]).

This CL changes callsites of the following forms:
(a) BrowserThread::Post*Task(BrowserThread::UI/IO, ..) to
    base::PostTaskWithTraits(FROM_HERE, {BrowserThread::UI/IO}, ..),
(b) BrowserThread::GetTaskRunnerForThread(BrowserThread::UI/IO) to
    base::CreateSingleThreadTaskRunnerWithTraits({BrowserThread::UI/IO}).

It also adds necessary includes. These mechanical changes were applied
by a script.

Tasks posted with the same BrowserThread::ID trait (via
PostTaskWithTraits or TaskRunners obtained from
Create*TaskRunnerWithTraits) will still execute in the order they
were posted, see [4].

[1] https://groups.google.com/a/chromium.org/d/topic/chromium-dev/A3_snMVXv8A/discussion
[2] https://docs.google.com/document/d/1SGy9VTXUwyXEX_yBZ0ukFAnS8B0hDeMUJD-1iALaE-Q/edit?usp=sharing
[3] https://docs.google.com/document/d/1z1BDq9vzcEpkhN9LSPF5XMnZ0kLJ8mWWkNAi4OI7cos/edit?usp=sharing
[4] https://cs.chromium.org/chromium/src/base/task/post_task.h?l=66

TBR=achuith@chromium.org, afakhry@chromium.org, agl@chromium.org, avi@chromium.org, bbudge@chromium.org, bengr@chromium.org, benwells@chromium.org, bnc@chromium.org, calamity@chromium.org, ccameron@chromium.org, chiniforooshan@chromium.org, cjgrant@chromium.org, cmumford@chromium.org, csharrison@chromium.org, dalecurtis@chromium.org, delphick@chromium.org, dgozman@chromium.org, dmazzoni@chromium.org, droger@chromium.org, dschuff@chromium.org, dullweber@chromium.org, erikchen@chromium.org, felt@chromium.org, fgorski@chromium.org, gogerald@chromium.org, groby@chromium.org, horo@chromium.org, imcheng@chromium.org, jcivelli@chromium.org, jianli@chromium.org, jinho.bang@samsung.com, jkarlin@chromium.org, jochen@chromium.org, kinuko@chromium.org, lazyboy@chromium.org, lpy@chromium.org, markusheintz@chromium.org, mattcary@chromium.org, maxmorin@chromium.org, miu@chromium.org, mkwst@chromium.org, mmenke@chromium.org, mpearson@chromium.org, msramek@chromium.org, nick@chromium.org, nparker@chromium.org, nyquist@chromium.org, peter@chromium.org, pwnall@chromium.org, qinmin@chromium.org, rbpotter@chromium.org, rdevlin.cronin@chromium.org, rouslan@chromium.org, scottmg@chromium.org, servolk@chromium.org, skuhne@chromium.org, sky@chromium.org, tapted@chromium.org, tbansal@chromium.org, thestig@chromium.org, tommi@chromium.org, tommycli@chromium.org, torne@chromium.org, tschumann@chromium.org, vabr@chromium.org, vakh@chromium.org, waffles@chromium.org, yfriedman@chromium.org, zmo@chromium.org, bartfab@chromium.org

Bug: 878356
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:linux_vr;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I37526c8e75630ee7bec29421276094a30e903894
Reviewed-on: https://chromium-review.googlesource.com/1186623
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Reviewed-by: Vaclav Brozek <vabr@chromium.org>
Reviewed-by: Alex Clarke <alexclarke@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Commit-Queue: Eric Seckler <eseckler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592750}
2018-09-20 10:42:28 +00:00
Yutaka Hirano
70fa259172 [Network Service] Support OnAuthRequired WebRequest API for WebSocket
This CL makes OnAuthRequired work with WebSocket when the network
service is enabled.

Design Doc: https://docs.google.com/document/d/1L85aXX-m5NaV-g223lH7kKB2HPg6kMi1cjrDVeEptE8/edit

Bug: 721400
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: I7587ea7937f3e283096a10a70d5d18b1a67d2650
Reviewed-on: https://chromium-review.googlesource.com/1009266
Reviewed-by: Ken Rockot <rockot@chromium.org>
Reviewed-by: Adam Rice <ricea@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#564795}
2018-06-06 05:26:54 +00:00
Yutaka Hirano
2f65eec401 [websocket] Use HttpRequestHeaders, not string, to represent headers
net::WebSocketChannel and various related classes use std::string to
represent request headers. This CL changes them to HttpRequestHeaders.

Bug: 721400
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: Id730779b36f3a319a61b44516bd3e8389ebdfc23
Reviewed-on: https://chromium-review.googlesource.com/1065713
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Adam Rice <ricea@chromium.org>
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560888}
2018-05-23 01:58:22 +00:00
Robert Sesek
f77782daf6 Finish converting mojo interface syntax from foo::mojom::Bar to foo.mojom.Bar.
This updates documentation and comments. It also fixes one instance of
code in media_router_bindings.js.

Tbr: markdown change
Bug: 835446
Change-Id: Iae247c318cf9547d4d536a1a04c0f7a9cf65eb14
Reviewed-on: https://chromium-review.googlesource.com/1062345
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#559600}
2018-05-17 17:57:33 +00:00
Hiroki Nakagawa
80b1671211 WebSocket: Teach parent frame's id to DedicatedWorkerHost
This is a preparation CL for the off-main-thread WebSocket.

After this CL, DedicatedWorkerHost is created from RenderFrameHostImpl, not from
RendererInterfaceBinders, so that DedicatedWorkerHost can get its parent frame's
id. This may not work for nested workers, but probably we can add an interface
for creating DedicatedWorkerHost to DedicatedWorkerHost for that case.

<Motivation>

DedicatedWorkerHost needs to know the parent frame id in order to share a user
decision on the SSL certificate warning interstitial among the parent document
and dedicated workers. When the off-main-thread WebSocket is disabled, the
decision is naturally shared among them because the dedicated workers depend on
their parent document's loader. Once the off-main-thread WebSocket is enabled,
the dedicated workers need to annotate requests as permitted using their parent
frame's id.

<Notes>

This CL renames private WebSocketManager::CreateWebSocket() overloaded by public
CreateWebSocket() to DoCreateWebSocketInternal() because the overload makes
base::BindRepeating() confused.

Bug: 825740
Change-Id: I9c2b07bea60cce315b94a4776b1d163e4330a208
Reviewed-on: https://chromium-review.googlesource.com/1025497
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554280}
2018-04-27 03:03:56 +00:00
Hiroki Nakagawa
ca3a0bee65 WebSocket: Clean up WebSocket creation
This is just a cleanup and doesn't change behavior.

Bug: 825740
Change-Id: I36c4002ca29bd3ad5af1a8f63ef2b33e6b977981
Reviewed-on: https://chromium-review.googlesource.com/1027370
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553485}
2018-04-25 08:30:02 +00:00
Jeremy Roman
8dfbfecd30 Remove unnecessary includes of base/memory/ptr_util.h in content/.
It no longer defines base::MakeUnique, so it should only be included
where base::WrapUnique is used.

Generated by:
  for x in `git grep -l '#include "base/memory/ptr_util.h"' content`; do \
    grep -q WrapUnique "$x" || sed -i -e \
    '/^#include "base\/memory\/ptr_util\.h"$/d' "$x"; done

Bug: 755727
Tbr: mkwst@chromium.org
Change-Id: Ie2a34ff8f0fe83491185cd9f1a0aa52aa21829bb
Reviewed-on: https://chromium-review.googlesource.com/1005834
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549918}
2018-04-11 17:35:53 +00:00
Yutaka Hirano
8e55d7a371 Have WebSocket throttling work with Network Service
This CL introduces WebSocket throttling on network::WebSocketFactory by
moving some logic from content/browser/websockets to services/network.

Bug: 721400
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: Ie007765411d95d1854fc0271652d599e5ccbcd0c
Reviewed-on: https://chromium-review.googlesource.com/979872
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Adam Rice <ricea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545766}
2018-03-26 12:28:42 +00:00
Adam Rice
e6cb368b2a Explicit WebSocket ownership in WebSocketManager
Previously network::WebSocket objects were stored as raw pointers
in a set and deleted manually. Use a set<unique_ptr<WebSocket>,
UniquePtrComparator> instead, making ownership explicit and reducing the
risk of leaking.

Change-Id: I0337551d8fd073341241723538cf9864eb206c87
Reviewed-on: https://chromium-review.googlesource.com/978282
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Adam Rice <ricea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545728}
2018-03-26 06:44:57 +00:00