Chromium Code Reviews
Help | Chromium Project | Gerrit Changes | Sign in
(2)

Issue 2809673002: Fix double close in MojoAudioOutputStream. (Closed)

Created:
3 years, 5 months ago by Max Morin
Modified:
3 years, 5 months ago
Reviewers:
Nico, DaleCurtis
CC:
Aaron Boodman, abarth-chromium, alokp+watch_chromium.org, audio-mojo-cl_google.com, chromium-reviews, danakj+watch_chromium.org, darin (slow to review), feature-media-reviews_chromium.org, o1ka, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, vmpstr+watch_chromium.org, yzshen+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix double close in MojoAudioOutputStream. Currently, the sync socket in MojoAudioOutputStream is closed by both Mojo and the SyncSocket destructor. This causes problems if a handle happens to be reused. BUG=709394 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Review-Url: https://codereview.chromium.org/2809673002 Cr-Commit-Position: refs/heads/master@{#464374} Committed: https://chromium.googlesource.com/chromium/src/+/d4bcb119316cfccf5c1ddcebe3b6d65a7fec09e4

Patch Set 1 #

Patch Set 2 : Fix typo #

Total comments: 4

Patch Set 3 #

Patch Set 4 : Null-check socket pointer #

Patch Set 5 : Fix Win complie. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+107 lines, -51 lines) Patch
M base/sync_socket.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M base/sync_socket_nacl.cc View 1 chunk +6 lines, -0 lines 0 comments Download
M base/sync_socket_posix.cc View 1 chunk +6 lines, -0 lines 0 comments Download
M base/sync_socket_win.cc View 1 chunk +6 lines, -0 lines 0 comments Download
M content/browser/renderer_host/media/audio_output_delegate_impl.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/media/audio_output_delegate_impl_unittest.cc View 1 2 3 4 13 chunks +22 lines, -26 lines 0 comments Download
M content/browser/renderer_host/media/audio_renderer_host.h View 1 2 1 chunk +4 lines, -3 lines 0 comments Download
M content/browser/renderer_host/media/audio_renderer_host.cc View 1 2 1 chunk +1 line, -1 line 2 comments Download
M content/browser/renderer_host/media/audio_sync_reader.h View 1 2 3 1 chunk +2 lines, -3 lines 0 comments Download
M content/browser/renderer_host/media/audio_sync_reader.cc View 1 2 3 2 chunks +7 lines, -0 lines 0 comments Download
M content/browser/renderer_host/media/render_frame_audio_output_stream_factory_unittest.cc View 1 2 1 chunk +5 lines, -3 lines 0 comments Download
M media/audio/audio_output_delegate.h View 1 2 1 chunk +4 lines, -3 lines 0 comments Download
M media/mojo/services/mojo_audio_output_stream.h View 1 2 1 chunk +4 lines, -3 lines 0 comments Download
M media/mojo/services/mojo_audio_output_stream.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M media/mojo/services/mojo_audio_output_stream_unittest.cc View 1 2 6 chunks +34 lines, -6 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 32 (19 generated)
Max Morin
Nico, Dale: PTAL.
3 years, 5 months ago (2017-04-10 15:00:55 UTC) #5
Nico
Is it possible to write a media unit test for the double release? base/ lgtm ...
3 years, 5 months ago (2017-04-10 15:29:35 UTC) #6
Max Morin
Thanks. I'll try to write a test for this tomorrow. https://codereview.chromium.org/2809673002/diff/20001/media/mojo/services/mojo_audio_output_stream.cc File media/mojo/services/mojo_audio_output_stream.cc (right): https://codereview.chromium.org/2809673002/diff/20001/media/mojo/services/mojo_audio_output_stream.cc#newcode74 ...
3 years, 5 months ago (2017-04-10 15:44:20 UTC) #7
Nico
https://codereview.chromium.org/2809673002/diff/20001/media/mojo/services/mojo_audio_output_stream.cc File media/mojo/services/mojo_audio_output_stream.cc (right): https://codereview.chromium.org/2809673002/diff/20001/media/mojo/services/mojo_audio_output_stream.cc#newcode74 media/mojo/services/mojo_audio_output_stream.cc:74: mojo::WrapPlatformFile(foreign_socket->Release()); On 2017/04/10 15:44:20, Max Morin wrote: > On ...
3 years, 5 months ago (2017-04-10 15:50:37 UTC) #8
DaleCurtis
This is a bit weird, you're ripping the handle out of the SyncSocket when you ...
3 years, 5 months ago (2017-04-10 19:24:48 UTC) #9
Max Morin
On 2017/04/10 19:24:48, DaleCurtis wrote: > This is a bit weird, you're ripping the handle ...
3 years, 5 months ago (2017-04-11 09:07:26 UTC) #13
Max Morin
https://codereview.chromium.org/2809673002/diff/20001/media/mojo/services/mojo_audio_output_stream.cc File media/mojo/services/mojo_audio_output_stream.cc (right): https://codereview.chromium.org/2809673002/diff/20001/media/mojo/services/mojo_audio_output_stream.cc#newcode74 media/mojo/services/mojo_audio_output_stream.cc:74: mojo::WrapPlatformFile(foreign_socket->Release()); On 2017/04/10 15:50:37, Nico wrote: > On 2017/04/10 ...
3 years, 5 months ago (2017-04-11 09:11:11 UTC) #14
DaleCurtis
https://codereview.chromium.org/2809673002/diff/80001/content/browser/renderer_host/media/audio_renderer_host.cc File content/browser/renderer_host/media/audio_renderer_host.cc (right): https://codereview.chromium.org/2809673002/diff/80001/content/browser/renderer_host/media/audio_renderer_host.cc#newcode110 content/browser/renderer_host/media/audio_renderer_host.cc:110: std::unique_ptr<base::CancelableSyncSocket> foreign_socket) { You need something to own this ...
3 years, 5 months ago (2017-04-11 18:22:44 UTC) #23
Max Morin
https://codereview.chromium.org/2809673002/diff/80001/content/browser/renderer_host/media/audio_renderer_host.cc File content/browser/renderer_host/media/audio_renderer_host.cc (right): https://codereview.chromium.org/2809673002/diff/80001/content/browser/renderer_host/media/audio_renderer_host.cc#newcode110 content/browser/renderer_host/media/audio_renderer_host.cc:110: std::unique_ptr<base::CancelableSyncSocket> foreign_socket) { On 2017/04/11 18:22:44, DaleCurtis wrote: > ...
3 years, 5 months ago (2017-04-12 08:16:06 UTC) #24
DaleCurtis
lgtm then, thanks!
3 years, 5 months ago (2017-04-12 18:28:54 UTC) #25
Max Morin
Thanks for the review!
3 years, 5 months ago (2017-04-13 10:08:18 UTC) #26
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/2809673002/80001
3 years, 5 months ago (2017-04-13 10:08:46 UTC) #29
commit-bot: I haz the power
3 years, 5 months ago (2017-04-13 11:44:07 UTC) #32
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://chromium.googlesource.com/chromium/src/+/d4bcb119316cfccf5c1ddcebe3b6...

Powered by Google App Engine
This is Rietveld 408576698