commit | ea68b644b4299a6a2ef24a18e4d18e541f3e4e8e | [log] [tgz] |
---|---|---|
author | Hiroki Nakagawa <nhiroki@chromium.org> | Fri Apr 13 06:24:42 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Fri Apr 13 06:24:42 2018 |
tree | 51730aedb744f0b43526395a7c09d5969d89e617 | |
parent | 7d1e5217993afdc181ec94dcd9db687f523780c0 [diff] |
WebSocket: Enable to run safe browsing checks for WebSocket from worker threads This is a preparation CL for enabling to establish WebSocket connections off the main thread. Before this CL, WebSocketSafeBrowsingThrottle is created by ChromeContentRendererClient::CreateWebSocketHandshakeThrottle(). This prevents the off-main-thread WebSocket because the function is bound with the main thread (render thread) and the throttle cannot be created from both the main thread and worker threads. To avoid it, this CL makes a new path to create the throttle in a thread-safe way. Specifically, this introduces WebSocketSafeBrowsingThrottleProvider that is created on the main thread, passed to a worker thread, and then provides the throttle on the thread. DocumentWebSocketChannel[*] accesses the throttle provider via FrameFetchContext/WorkerFetchContext. After this CL, WebSocket for Document and DedicatedWorker go through the new path by default. However, WebSocket for SharedWorker and ServiceWorker still go through the old path via WorkerShadowPage. This will be switched to the new path when the runtime flag is enabled. In addition, to test the new path, this CL makes safe_browsing_service_browsertest run with the off-main-thread WebSocket flag. [*] Although it's prefixed with "Document", DocumentWebSocketChannel is used for workers when the off-main-thread WebSocket is enabled. It'll be renamed to WebSocketChannel etc after the new architecture is enabled by default. Change-Id: If9e64e3291ab86ee4c836a66afede1fde9b24789 Bug: 825740 Reviewed-on: https://chromium-review.googlesource.com/985334 Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Reviewed-by: Jialiu Lin <jialiul@chromium.org> Reviewed-by: Bo <boliu@chromium.org> Reviewed-by: Yutaka Hirano <yhirano@chromium.org> Reviewed-by: Adam Rice <ricea@chromium.org> Cr-Commit-Position: refs/heads/master@{#550530}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .