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

Issue 2000113002: Delegate WebSocket message handlers to the loading task runner (Closed)

Created:
4 years, 7 months ago by hajimehoshi
Modified:
4 years, 6 months ago
Reviewers:
kinuko, Sami, yhirano
CC:
chromium-reviews, mkwst+moarreviews-renderer_chromium.org, darin-cc_chromium.org, jam, mlamouri+watch-content_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Delegate WebSocket message handlers to the loading task runner IPC messages including WebSocket messages are dispatched on the default task runner. We found WebSocket message handlers might call V8 functions. We plan to implement purge + suspend background tabs and need to suspend all V8 function calls when purge + suspend happens, but the default task runner can't be suspended since it'd be dangerous. Thus, this CL delegates WebSocket message handlers from the default task runner to the loading task runner. BUG=607077 TEST=n/a Committed: https://crrev.com/384b3b11a1afb71511dc15bc7324f69226ffe801 Cr-Commit-Position: refs/heads/master@{#397074}

Patch Set 1 #

Total comments: 1

Patch Set 2 : Introduce WebSocketMessageFilter (WIP) #

Patch Set 3 : Add comments #

Total comments: 8

Patch Set 4 : Address on reviews #

Total comments: 2

Patch Set 5 : Address on yhirano's review #

Total comments: 2

Patch Set 6 : Use WeakPtr #

Total comments: 2

Patch Set 7 : Add a comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+133 lines, -17 lines) Patch
M content/child/child_thread_impl.h View 1 2 3 4 3 chunks +7 lines, -0 lines 0 comments Download
M content/child/child_thread_impl.cc View 1 2 3 4 3 chunks +5 lines, -2 lines 0 comments Download
M content/child/websocket_dispatcher.h View 1 2 3 4 5 3 chunks +8 lines, -0 lines 0 comments Download
M content/child/websocket_dispatcher.cc View 1 2 3 4 5 2 chunks +21 lines, -15 lines 0 comments Download
A content/child/websocket_message_filter.h View 1 2 3 4 5 6 1 chunk +50 lines, -0 lines 0 comments Download
A content/child/websocket_message_filter.cc View 1 2 3 4 5 1 chunk +36 lines, -0 lines 0 comments Download
M content/content_child.gypi View 1 1 chunk +2 lines, -0 lines 0 comments Download
M content/renderer/render_thread_impl.cc View 1 2 3 4 2 chunks +4 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 30 (7 generated)
hajimehoshi
PTAL
4 years, 7 months ago (2016-05-23 08:21:38 UTC) #2
Sami
Added a suggestion. Let me know what you think. https://codereview.chromium.org/2000113002/diff/1/content/child/websocket_dispatcher.cc File content/child/websocket_dispatcher.cc (right): https://codereview.chromium.org/2000113002/diff/1/content/child/websocket_dispatcher.cc#newcode54 content/child/websocket_dispatcher.cc:54: ...
4 years, 7 months ago (2016-05-23 09:56:07 UTC) #4
hajimehoshi
On 2016/05/23 09:56:07, Sami wrote: > Added a suggestion. Let me know what you think. ...
4 years, 7 months ago (2016-05-23 12:04:28 UTC) #5
kinuko
On 2016/05/23 12:04:28, hajimehoshi wrote: > On 2016/05/23 09:56:07, Sami wrote: > > Added a ...
4 years, 7 months ago (2016-05-23 12:27:22 UTC) #6
hajimehoshi
PTAL
4 years, 7 months ago (2016-05-25 08:45:09 UTC) #7
kinuko
(+cc yhirano as websocket owner) https://codereview.chromium.org/2000113002/diff/40001/content/child/websocket_message_filter.cc File content/child/websocket_message_filter.cc (right): https://codereview.chromium.org/2000113002/diff/40001/content/child/websocket_message_filter.cc#newcode25 content/child/websocket_message_filter.cc:25: base::Unretained(websocket_dispatcher_), It's not obvious ...
4 years, 7 months ago (2016-05-25 09:30:53 UTC) #8
yhirano
As talked offline, I'm concerned about performance. Sami, is the loading task queue high prioritized? ...
4 years, 7 months ago (2016-05-25 10:39:52 UTC) #10
Sami
On 2016/05/25 10:39:52, yhirano wrote: > As talked offline, I'm concerned about performance. Sami, is ...
4 years, 7 months ago (2016-05-25 11:11:20 UTC) #11
yhirano
https://codereview.chromium.org/2000113002/diff/40001/content/child/websocket_message_filter.cc File content/child/websocket_message_filter.cc (right): https://codereview.chromium.org/2000113002/diff/40001/content/child/websocket_message_filter.cc#newcode20 content/child/websocket_message_filter.cc:20: bool WebSocketMessageFilter::OnMessageReceived(const IPC::Message& message) { On 2016/05/25 10:39:52, yhirano ...
4 years, 7 months ago (2016-05-25 11:34:52 UTC) #12
yhirano
On 2016/05/25 11:11:20, Sami wrote: > On 2016/05/25 10:39:52, yhirano wrote: > > As talked ...
4 years, 7 months ago (2016-05-25 11:36:04 UTC) #13
hajimehoshi
Thank you! PTAL https://codereview.chromium.org/2000113002/diff/40001/content/child/websocket_message_filter.cc File content/child/websocket_message_filter.cc (right): https://codereview.chromium.org/2000113002/diff/40001/content/child/websocket_message_filter.cc#newcode25 content/child/websocket_message_filter.cc:25: base::Unretained(websocket_dispatcher_), On 2016/05/25 09:30:53, kinuko wrote: ...
4 years, 7 months ago (2016-05-25 12:05:02 UTC) #14
yhirano
https://codereview.chromium.org/2000113002/diff/60001/content/child/websocket_dispatcher.h File content/child/websocket_dispatcher.h (right): https://codereview.chromium.org/2000113002/diff/60001/content/child/websocket_dispatcher.h#newcode37 content/child/websocket_dispatcher.h:37: bool CanHandleMessage(const IPC::Message& msg) const; Can you make this ...
4 years, 7 months ago (2016-05-26 04:39:16 UTC) #15
hajimehoshi
Thank you! https://codereview.chromium.org/2000113002/diff/60001/content/child/websocket_dispatcher.h File content/child/websocket_dispatcher.h (right): https://codereview.chromium.org/2000113002/diff/60001/content/child/websocket_dispatcher.h#newcode37 content/child/websocket_dispatcher.h:37: bool CanHandleMessage(const IPC::Message& msg) const; On 2016/05/26 ...
4 years, 7 months ago (2016-05-26 07:30:44 UTC) #16
yhirano
lgtm
4 years, 7 months ago (2016-05-26 07:37:46 UTC) #17
kinuko
looking good in general, though.. https://codereview.chromium.org/2000113002/diff/80001/content/child/websocket_message_filter.cc File content/child/websocket_message_filter.cc (right): https://codereview.chromium.org/2000113002/diff/80001/content/child/websocket_message_filter.cc#newcode27 content/child/websocket_message_filter.cc:27: base::Unretained(websocket_dispatcher_), I might be ...
4 years, 7 months ago (2016-05-26 08:15:35 UTC) #18
hajimehoshi
Thank you! hirano-san, can you take a look again since the design has been a ...
4 years, 7 months ago (2016-05-26 09:49:02 UTC) #19
kinuko
lgtm https://codereview.chromium.org/2000113002/diff/100001/content/child/websocket_message_filter.h File content/child/websocket_message_filter.h (right): https://codereview.chromium.org/2000113002/diff/100001/content/child/websocket_message_filter.h#newcode41 content/child/websocket_message_filter.h:41: base::WeakPtr<WebSocketDispatcher> websocket_dispatcher_; nit: add a comment to note ...
4 years, 7 months ago (2016-05-26 10:09:54 UTC) #20
hajimehoshi
Thank you! https://codereview.chromium.org/2000113002/diff/100001/content/child/websocket_message_filter.h File content/child/websocket_message_filter.h (right): https://codereview.chromium.org/2000113002/diff/100001/content/child/websocket_message_filter.h#newcode41 content/child/websocket_message_filter.h:41: base::WeakPtr<WebSocketDispatcher> websocket_dispatcher_; On 2016/05/26 10:09:54, kinuko wrote: ...
4 years, 7 months ago (2016-05-26 10:18:42 UTC) #21
yhirano
lgtm
4 years, 7 months ago (2016-05-27 01:51:07 UTC) #22
hajimehoshi
ping Sami
4 years, 6 months ago (2016-05-30 06:10:00 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2000113002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2000113002/120001
4 years, 6 months ago (2016-06-01 05:17:43 UTC) #26
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 6 months ago (2016-06-01 06:22:04 UTC) #28
commit-bot: I haz the power
4 years, 6 months ago (2016-06-01 06:23:37 UTC) #30
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/384b3b11a1afb71511dc15bc7324f69226ffe801
Cr-Commit-Position: refs/heads/master@{#397074}

Powered by Google App Engine
This is Rietveld 408576698