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

Issue 23379002: Web MIDI: fix multi-threading problem around message buffer handling (Closed)

Created:
7 years, 4 months ago by Takashi Toyoshima
Modified:
7 years, 3 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam, feature-media-reviews_chromium.org
Visibility:
Public.

Description

Web MIDI: fix multi-threading problem around message buffer handling Passing message buffer to another thread as const uint8* doesn't work since it might be invalid before another thread reads it. Keep on handling it as vector<uint8> from IPC to passing it to the OS. TEST=manual BUG=276810 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=219796

Patch Set 1 #

Patch Set 2 : s/CHECK/DCHECK/ #

Total comments: 13

Patch Set 3 : review #2 #

Total comments: 6

Patch Set 4 : review #4 and #5 #

Total comments: 4

Patch Set 5 : (rebase) #

Patch Set 6 : review #7 and #8 #

Total comments: 18

Patch Set 7 : review #12 (for submmit) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+66 lines, -62 lines) Patch
M content/browser/renderer_host/media/midi_host.h View 1 2 3 4 5 6 3 chunks +4 lines, -2 lines 0 comments Download
M content/browser/renderer_host/media/midi_host.cc View 1 2 3 4 5 6 3 chunks +5 lines, -6 lines 0 comments Download
M content/common/media/midi_messages.h View 1 2 3 4 5 6 2 chunks +3 lines, -3 lines 0 comments Download
M content/renderer/media/midi_message_filter.h View 1 2 3 4 5 6 4 chunks +4 lines, -5 lines 0 comments Download
M content/renderer/media/midi_message_filter.cc View 1 2 3 4 5 6 4 chunks +4 lines, -4 lines 0 comments Download
M media/midi/midi_manager.h View 1 2 3 4 5 6 4 chunks +14 lines, -12 lines 0 comments Download
M media/midi/midi_manager.cc View 1 2 3 4 5 6 4 chunks +9 lines, -5 lines 0 comments Download
M media/midi/midi_manager_mac.h View 1 2 3 4 5 6 3 chunks +6 lines, -6 lines 0 comments Download
M media/midi/midi_manager_mac.cc View 1 2 3 4 5 6 8 chunks +17 lines, -19 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
Takashi Toyoshima
Hi, can you take a look? This bug caused message drop problem. https://codereview.chromium.org/23379002/diff/3001/media/midi/midi_manager.cc File media/midi/midi_manager.cc ...
7 years, 4 months ago (2013-08-21 13:48:22 UTC) #1
scherkus (not reviewing)
palmer: can you sanity check my understanding of the types rules? https://codereview.chromium.org/23379002/diff/3001/content/common/media/midi_messages.h File content/common/media/midi_messages.h (right): ...
7 years, 4 months ago (2013-08-21 17:46:29 UTC) #2
Takashi Toyoshima
https://codereview.chromium.org/23379002/diff/3001/content/common/media/midi_messages.h File content/common/media/midi_messages.h (right): https://codereview.chromium.org/23379002/diff/3001/content/common/media/midi_messages.h#newcode46 content/common/media/midi_messages.h:46: unsigned int /* port */, On 2013/08/21 17:46:29, scherkus ...
7 years, 4 months ago (2013-08-22 05:47:45 UTC) #3
palmer
https://codereview.chromium.org/23379002/diff/3001/content/common/media/midi_messages.h File content/common/media/midi_messages.h (right): https://codereview.chromium.org/23379002/diff/3001/content/common/media/midi_messages.h#newcode64 content/common/media/midi_messages.h:64: size_t /* bytes sent */) On 2013/08/22 05:47:45, Takashi ...
7 years, 4 months ago (2013-08-22 18:25:40 UTC) #4
palmer
https://codereview.chromium.org/23379002/diff/16001/content/renderer/media/midi_message_filter.cc File content/renderer/media/midi_message_filter.cc (right): https://codereview.chromium.org/23379002/diff/16001/content/renderer/media/midi_message_filter.cc#newcode190 content/renderer/media/midi_message_filter.cc:190: void MIDIMessageFilter::SendMIDIData(unsigned int port, Yeah, harmonize these types. What ...
7 years, 4 months ago (2013-08-22 18:31:26 UTC) #5
Takashi Toyoshima
https://codereview.chromium.org/23379002/diff/16001/content/renderer/media/midi_message_filter.cc File content/renderer/media/midi_message_filter.cc (right): https://codereview.chromium.org/23379002/diff/16001/content/renderer/media/midi_message_filter.cc#newcode190 content/renderer/media/midi_message_filter.cc:190: void MIDIMessageFilter::SendMIDIData(unsigned int port, This parameter doesn't depend on ...
7 years, 4 months ago (2013-08-23 02:39:15 UTC) #6
scherkus (not reviewing)
lgtm w/ nit deferring to palmer@ on matters of size_t / uint32 ... other than ...
7 years, 4 months ago (2013-08-23 19:15:05 UTC) #7
palmer
I think you'll be able to achieve a safe solution more cleanly by just deciding ...
7 years, 4 months ago (2013-08-23 21:04:08 UTC) #8
scherkus (not reviewing)
On 2013/08/23 21:04:08, Chromium Palmer wrote: > I think you'll be able to achieve a ...
7 years, 4 months ago (2013-08-23 21:06:13 UTC) #9
palmer
By the way, this CL will probably L G to M very soon. I feel ...
7 years, 4 months ago (2013-08-23 21:07:10 UTC) #10
Takashi Toyoshima
https://codereview.chromium.org/23379002/diff/18001/content/browser/renderer_host/media/midi_host.cc File content/browser/renderer_host/media/midi_host.cc (right): https://codereview.chromium.org/23379002/diff/18001/content/browser/renderer_host/media/midi_host.cc#newcode114 content/browser/renderer_host/media/midi_host.cc:114: return; On 2013/08/23 19:15:06, scherkus wrote: > nit: this ...
7 years, 3 months ago (2013-08-26 08:31:42 UTC) #11
palmer
LGTM after you complete the change to uint32_t. https://codereview.chromium.org/23379002/diff/45001/content/browser/renderer_host/media/midi_host.cc File content/browser/renderer_host/media/midi_host.cc (right): https://codereview.chromium.org/23379002/diff/45001/content/browser/renderer_host/media/midi_host.cc#newcode118 content/browser/renderer_host/media/midi_host.cc:118: static_cast<size_t>(port), ...
7 years, 3 months ago (2013-08-26 17:43:24 UTC) #12
scherkus (not reviewing)
On 2013/08/26 17:43:24, Chromium Palmer wrote: > LGTM after you complete the change to uint32_t. ...
7 years, 3 months ago (2013-08-26 18:07:41 UTC) #13
palmer
> palmer: why the _t suffixed version versus the uint8/16/32 typedefs from > base/basictypes.h? Oh, ...
7 years, 3 months ago (2013-08-26 18:30:50 UTC) #14
Takashi Toyoshima
Thanks https://codereview.chromium.org/23379002/diff/45001/content/browser/renderer_host/media/midi_host.cc File content/browser/renderer_host/media/midi_host.cc (right): https://codereview.chromium.org/23379002/diff/45001/content/browser/renderer_host/media/midi_host.cc#newcode118 content/browser/renderer_host/media/midi_host.cc:118: static_cast<size_t>(port), On 2013/08/26 17:43:25, Chromium Palmer wrote: > ...
7 years, 3 months ago (2013-08-27 07:14:32 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/toyoshim@chromium.org/23379002/62001
7 years, 3 months ago (2013-08-27 07:23:08 UTC) #16
commit-bot: I haz the power
7 years, 3 months ago (2013-08-27 15:30:27 UTC) #17
Message was sent while issue was closed.
Change committed as 219796

Powered by Google App Engine
This is Rietveld 408576698