Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Issue 2119973002: Port WebSockets to Mojo IPC (Closed)

Created:
4 years, 5 months ago by darin (slow to review)
Modified:
4 years, 2 months ago
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, creis+watch_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, nasko+codewatch_chromium.org, jam, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin-cc_chromium.org, mkwst+moarreviews-renderer_chromium.org, ben+mojo_chromium.org, kinuko+watch
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Port WebSockets to Mojo IPC Key changes: - WebSocket support moved from content/child/ to content/renderer/ as that covers all of Blink's needs. - Drop Blob sending code for now as it wasn't yet hooked up, and it will need to be designed differently to work with Mojo IPC. - WebSocketBridge renamed to WebSocketHandleImpl, and prepped for moving to Blink. - Avoid explicitly passing render_frame_id by using the InterfaceProvider of the RenderFrame. - For SharedWorkers, which have no corresponding RenderFrame, fallback to getting the WebSocket interface from Platform::interfaceProvider(). - WebSocketHost renamed to WebSocketImpl. - WebSocketDispatcherHost renamed to WebSocketManager. - The WebSocketManager is registered with both the RenderProcessHostImpl and RenderFrameImpl. - Unittests are modified substantially since they were based on Chrome IPC injection and recording. Some tests did not translate. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Committed: https://crrev.com/2b78d9ee821f4d5c8c31a05028360610f5d0069f Cr-Commit-Position: refs/heads/master@{#410061}

Patch Set 1 #

Total comments: 12

Patch Set 2 : Updates #

Patch Set 3 : Remove unused blob infrastructure #

Patch Set 4 : Eliminate WebSocketManager::IOThreadState #

Patch Set 5 : Remove unused code #

Total comments: 5

Patch Set 6 : Minor cleanups #

Patch Set 7 : Port unittests (mostly) #

Patch Set 8 : fix whitespace #

Patch Set 9 : Tweaks #

Patch Set 10 : Rebase #

Patch Set 11 : fix content_browsertests #

Patch Set 12 : Make it pass tests #

Patch Set 13 : Rebase #

Patch Set 14 : New manager lifecycle #

Patch Set 15 : Cleanup #

Patch Set 16 : Simplify renderer code #

Patch Set 17 : Add back scheduler integration #

Patch Set 18 : Plumb render_frame_id #

Patch Set 19 : Plumb render_frame_id #

Patch Set 20 : Fix linker issue on windows #

Patch Set 21 : Fix build #

Patch Set 22 : Fix GYP build #

Patch Set 23 : Cleanup #

Total comments: 4

Patch Set 24 : Back to using frame-level ServiceRegistry in place of render_frame_id plumbing #

Patch Set 25 : Rebase #

Patch Set 26 : Fix shared worker support #

Total comments: 2

Patch Set 27 : Rebase and address review feedback #

Patch Set 28 : Fix compile error #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+1751 lines, -3553 lines) Patch
M content/browser/bad_message.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 3 chunks +6 lines, -3 lines 2 comments Download
M content/browser/bad_message.cc View 1 3 chunks +21 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_frame_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 2 chunks +9 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 4 chunks +7 lines, -10 lines 0 comments Download
D content/browser/renderer_host/websocket_blob_sender.h View 1 chunk +0 lines, -140 lines 0 comments Download
D content/browser/renderer_host/websocket_blob_sender.cc View 1 chunk +0 lines, -284 lines 0 comments Download
D content/browser/renderer_host/websocket_blob_sender_unittest.cc View 1 2 3 4 5 6 7 1 chunk +0 lines, -450 lines 0 comments Download
D content/browser/renderer_host/websocket_dispatcher_host.h View 1 chunk +0 lines, -212 lines 0 comments Download
D content/browser/renderer_host/websocket_dispatcher_host.cc View 1 chunk +0 lines, -310 lines 0 comments Download
D content/browser/renderer_host/websocket_dispatcher_host_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -468 lines 0 comments Download
D content/browser/renderer_host/websocket_host.h View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -126 lines 0 comments Download
D content/browser/renderer_host/websocket_host.cc View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -606 lines 0 comments Download
A content/browser/websockets/websocket_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +112 lines, -0 lines 0 comments Download
A content/browser/websockets/websocket_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +536 lines, -0 lines 0 comments Download
A content/browser/websockets/websocket_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +86 lines, -0 lines 0 comments Download
A content/browser/websockets/websocket_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +176 lines, -0 lines 0 comments Download
A content/browser/websockets/websocket_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +242 lines, -0 lines 0 comments Download
M content/child/OWNERS View 1 2 1 chunk +0 lines, -5 lines 0 comments Download
M content/child/blink_platform_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +0 lines, -1 line 0 comments Download
M content/child/blink_platform_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +0 lines, -5 lines 0 comments Download
M content/child/child_thread_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 5 chunks +0 lines, -14 lines 0 comments Download
M content/child/child_thread_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 3 chunks +0 lines, -7 lines 0 comments Download
D content/child/websocket_bridge.h View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -77 lines 0 comments Download
D content/child/websocket_bridge.cc View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -304 lines 0 comments Download
D content/child/websocket_dispatcher.h View 1 chunk +0 lines, -56 lines 0 comments Download
D content/child/websocket_dispatcher.cc View 1 chunk +0 lines, -74 lines 0 comments Download
D content/child/websocket_message_filter.h View 1 chunk +0 lines, -50 lines 0 comments Download
D content/child/websocket_message_filter.cc View 1 chunk +0 lines, -36 lines 0 comments Download
M content/common/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +1 line, -0 lines 0 comments Download
M content/common/content_message_generator.h View 1 1 chunk +0 lines, -1 line 0 comments Download
D content/common/websocket.h View 1 chunk +0 lines, -64 lines 0 comments Download
D content/common/websocket.cc View 1 chunk +0 lines, -18 lines 0 comments Download
A content/common/websocket.mojom View 1 2 3 4 5 6 7 8 9 18 19 20 21 22 23 1 chunk +138 lines, -0 lines 0 comments Download
D content/common/websocket_messages.h View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -201 lines 0 comments Download
M content/content_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 2 chunks +4 lines, -6 lines 0 comments Download
M content/content_child.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +0 lines, -6 lines 0 comments Download
M content/content_common.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 chunk +0 lines, -3 lines 0 comments Download
M content/content_common_mojo_bindings.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 chunk +1 line, -0 lines 0 comments Download
M content/content_renderer.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +2 lines, -0 lines 0 comments Download
M content/content_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 2 chunks +1 line, -2 lines 0 comments Download
M content/renderer/OWNERS View 1 2 1 chunk +6 lines, -1 line 0 comments Download
M content/renderer/render_frame_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 4 chunks +10 lines, -6 lines 0 comments Download
M content/renderer/render_thread_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 2 chunks +0 lines, -4 lines 0 comments Download
M content/renderer/render_thread_impl_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 2 chunks +0 lines, -2 lines 0 comments Download
M content/renderer/renderer_blink_platform_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/renderer_blink_platform_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 2 chunks +5 lines, -0 lines 0 comments Download
A content/renderer/websockethandle_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 chunk +84 lines, -0 lines 0 comments Download
A content/renderer/websockethandle_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 1 chunk +302 lines, -0 lines 0 comments Download

Messages

Total messages: 119 (87 generated)
Ben Goodger (Google)
https://codereview.chromium.org/2119973002/diff/1/content/browser/frame_host/render_frame_host_impl.cc File content/browser/frame_host/render_frame_host_impl.cc (right): https://codereview.chromium.org/2119973002/diff/1/content/browser/frame_host/render_frame_host_impl.cc#newcode2036 content/browser/frame_host/render_frame_host_impl.cc:2036: GetServiceRegistry()->AddService( When you rebase, you'll find that this is ...
4 years, 5 months ago (2016-07-01 21:19:51 UTC) #3
darin (slow to review)
Thanks for the feedback https://codereview.chromium.org/2119973002/diff/1/content/browser/frame_host/render_frame_host_impl.cc File content/browser/frame_host/render_frame_host_impl.cc (right): https://codereview.chromium.org/2119973002/diff/1/content/browser/frame_host/render_frame_host_impl.cc#newcode2036 content/browser/frame_host/render_frame_host_impl.cc:2036: GetServiceRegistry()->AddService( On 2016/07/01 21:19:51, Ben ...
4 years, 5 months ago (2016-07-06 16:57:21 UTC) #4
darin (slow to review)
On 2016/07/06 16:57:21, darin (slow to review) wrote: ... > https://codereview.chromium.org/2119973002/diff/1/content/browser/frame_host/render_frame_host_impl.cc#newcode2038 > content/browser/frame_host/render_frame_host_impl.cc:2038: > base::Unretained(this))); ...
4 years, 5 months ago (2016-07-07 20:00:47 UTC) #5
Ben Goodger (Google)
From a Mojo perspective this lgtm... probably want someone more familiar with WS to review ...
4 years, 5 months ago (2016-07-07 20:49:19 UTC) #6
Adam Rice
https://codereview.chromium.org/2119973002/diff/80001/content/browser/websockets/websocket_impl.cc File content/browser/websockets/websocket_impl.cc (right): https://codereview.chromium.org/2119973002/diff/80001/content/browser/websockets/websocket_impl.cc#newcode47 content/browser/websockets/websocket_impl.cc:47: // Convert a content::WebSocketMessageType to a s/content/mojom/ https://codereview.chromium.org/2119973002/diff/80001/content/common/websocket.mojom File ...
4 years, 5 months ago (2016-07-08 04:03:11 UTC) #8
darin (slow to review)
On 2016/07/07 20:49:19, Ben Goodger (Google) wrote: > From a Mojo perspective this lgtm... probably ...
4 years, 5 months ago (2016-07-13 15:49:45 UTC) #9
darin (slow to review)
On 2016/07/08 04:03:11, Adam Rice wrote: > https://codereview.chromium.org/2119973002/diff/80001/content/browser/websockets/websocket_impl.cc > File content/browser/websockets/websocket_impl.cc (right): > > https://codereview.chromium.org/2119973002/diff/80001/content/browser/websockets/websocket_impl.cc#newcode47 ...
4 years, 5 months ago (2016-07-13 15:51:11 UTC) #10
Adam Rice
On 2016/07/13 15:51:11, darin (slow to review) wrote: > Should we just nuke all of ...
4 years, 5 months ago (2016-07-14 02:46:02 UTC) #11
darin (slow to review)
On 2016/07/14 02:46:02, Adam Rice wrote: > On 2016/07/13 15:51:11, darin (slow to review) wrote: ...
4 years, 5 months ago (2016-07-15 18:52:24 UTC) #12
commit-bot: I haz the power
Your CL relies on deprecated CQ feature(s): * Specifying master names in CQ_INCLUDE_TRYBOTS part of ...
4 years, 5 months ago (2016-07-16 03:44:31 UTC) #15
commit-bot: I haz the power
Your CL relies on deprecated CQ feature(s): * Specifying master names in CQ_INCLUDE_TRYBOTS part of ...
4 years, 5 months ago (2016-07-16 15:33:57 UTC) #20
Adam Rice
On 2016/07/15 18:52:24, darin (slow to review) wrote: > It seems like we can do ...
4 years, 5 months ago (2016-07-19 02:54:12 UTC) #24
darin (slow to review)
On 2016/07/19 02:54:12, Adam Rice wrote: > On 2016/07/15 18:52:24, darin (slow to review) wrote: ...
4 years, 5 months ago (2016-07-20 20:59:39 UTC) #28
Adam Rice
On 2016/07/20 20:59:39, darin (slow to review) wrote: > OK, I see. But, at least ...
4 years, 5 months ago (2016-07-20 23:57:00 UTC) #35
darin (slow to review)
On 2016/07/20 23:57:00, Adam Rice wrote: > On 2016/07/20 20:59:39, darin (slow to review) wrote: ...
4 years, 5 months ago (2016-07-22 00:02:35 UTC) #50
Adam Rice
lgtm with nits https://codereview.chromium.org/2119973002/diff/440001/content/browser/websockets/websocket_impl.h File content/browser/websockets/websocket_impl.h (right): https://codereview.chromium.org/2119973002/diff/440001/content/browser/websockets/websocket_impl.h#newcode100 content/browser/websockets/websocket_impl.h:100: // handshake_succeeded_ is set and used ...
4 years, 4 months ago (2016-07-27 02:38:54 UTC) #75
darin (slow to review)
On 2016/07/27 02:38:54, Adam Rice wrote: > lgtm with nits > > https://codereview.chromium.org/2119973002/diff/440001/content/browser/websockets/websocket_impl.h > File ...
4 years, 4 months ago (2016-07-27 23:27:35 UTC) #77
Adam Rice
On 2016/07/27 23:27:35, darin (slow to review) wrote: > Done. Oops, yes. Hopefully you agree ...
4 years, 4 months ago (2016-07-28 01:22:54 UTC) #78
darin (slow to review)
On 2016/07/28 01:22:54, Adam Rice wrote: > On 2016/07/27 23:27:35, darin (slow to review) wrote: ...
4 years, 4 months ago (2016-07-29 19:47:53 UTC) #79
darin (slow to review)
+jam for //content review +tsepez for IPC security review
4 years, 4 months ago (2016-08-04 13:35:37 UTC) #96
Tom Sepez
mojom lgtm
4 years, 4 months ago (2016-08-04 17:01:30 UTC) #97
jam
On 2016/08/04 13:35:37, darin (slow to review) wrote: > +jam for //content review Not sure ...
4 years, 4 months ago (2016-08-04 18:10:44 UTC) #98
darin (slow to review)
On 2016/08/04 18:10:44, jam wrote: > On 2016/08/04 13:35:37, darin (slow to review) wrote: > ...
4 years, 4 months ago (2016-08-05 03:30:45 UTC) #99
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2119973002/520001
4 years, 4 months ago (2016-08-05 04:26:45 UTC) #102
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_ozone_rel_ng/builds/213143)
4 years, 4 months ago (2016-08-05 04:44:12 UTC) #104
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2119973002/540001
4 years, 4 months ago (2016-08-05 05:47:32 UTC) #107
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/255883)
4 years, 4 months ago (2016-08-05 06:57:30 UTC) #109
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2119973002/540001
4 years, 4 months ago (2016-08-05 14:47:06 UTC) #111
commit-bot: I haz the power
Committed patchset #28 (id:540001)
4 years, 4 months ago (2016-08-05 15:18:45 UTC) #113
commit-bot: I haz the power
Patchset 28 (id:??) landed as https://crrev.com/2b78d9ee821f4d5c8c31a05028360610f5d0069f Cr-Commit-Position: refs/heads/master@{#410061}
4 years, 4 months ago (2016-08-05 15:21:19 UTC) #115
Ilya Sherman
https://codereview.chromium.org/2119973002/diff/540001/content/browser/bad_message.h File content/browser/bad_message.h (right): https://codereview.chromium.org/2119973002/diff/540001/content/browser/bad_message.h#newcode136 content/browser/bad_message.h:136: WSI_UNEXPECTED_SEND_FRAME = 111, Hi, just wanted to check: Are ...
4 years, 4 months ago (2016-08-18 01:11:18 UTC) #117
Alexei Svitkine (slow)
4 years, 2 months ago (2016-10-04 20:42:07 UTC) #119
Message was sent while issue was closed.
https://codereview.chromium.org/2119973002/diff/540001/content/browser/bad_me...
File content/browser/bad_message.h (right):

https://codereview.chromium.org/2119973002/diff/540001/content/browser/bad_me...
content/browser/bad_message.h:136: WSI_UNEXPECTED_SEND_FRAME = 111,
On 2016/08/18 01:11:18, Ilya Sherman wrote:
> Hi, just wanted to check: Are the changes in this file semantically
meaningful,
> or simply clearer labels for identical events?  If they are semantically
> meaningful, then these constants should not have been modified; instead, these
> values should have been deprecated, and new values should have been added to
the
> tail end of the enum (since it backs an UMA histogram).

Agree with Ilya on this general advise. However, I just checked the data and it
seems like the old values were never logged in practice - I don't see data for
them at all for last year. So I guess in this instance we can live with the
change without needing to retroactively try to renumber the new values.

But just a heads up for reviewers to watch out for cases where an enum that's
logged in UMA is being renumbered or re-used - as this will confuse the data
since a given value may mean different things depending on Chrome version.

Powered by Google App Engine
This is Rietveld 408576698