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

Side by Side Diff: content/browser/renderer_host/media/audio_renderer_host.cc

Issue 2809673002: Fix double close in MojoAudioOutputStream. (Closed)
Patch Set: Fix Win complie. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/media/audio_renderer_host.h" 5 #include "content/browser/renderer_host/media/audio_renderer_host.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 authorizations_.clear(); 100 authorizations_.clear();
101 } 101 }
102 102
103 void AudioRendererHost::OnDestruct() const { 103 void AudioRendererHost::OnDestruct() const {
104 BrowserThread::DeleteOnIOThread::Destruct(this); 104 BrowserThread::DeleteOnIOThread::Destruct(this);
105 } 105 }
106 106
107 void AudioRendererHost::OnStreamCreated( 107 void AudioRendererHost::OnStreamCreated(
108 int stream_id, 108 int stream_id,
109 base::SharedMemory* shared_memory, 109 base::SharedMemory* shared_memory,
110 base::CancelableSyncSocket* foreign_socket) { 110 std::unique_ptr<base::CancelableSyncSocket> foreign_socket) {
DaleCurtis 2017/04/11 18:22:44 You need something to own this here now or the soc
Max Morin 2017/04/12 08:16:06 It's fine to close the socket handle on this end,
111 DCHECK_CURRENTLY_ON(BrowserThread::IO); 111 DCHECK_CURRENTLY_ON(BrowserThread::IO);
112 112
113 if (!PeerHandle()) { 113 if (!PeerHandle()) {
114 DLOG(WARNING) << "Renderer process handle is invalid."; 114 DLOG(WARNING) << "Renderer process handle is invalid.";
115 OnStreamError(stream_id); 115 OnStreamError(stream_id);
116 return; 116 return;
117 } 117 }
118 118
119 if (!LookupById(stream_id)) { 119 if (!LookupById(stream_id)) {
120 OnStreamError(stream_id); 120 OnStreamError(stream_id);
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 395
396 bool AudioRendererHost::IsAuthorizationStarted(int stream_id) { 396 bool AudioRendererHost::IsAuthorizationStarted(int stream_id) {
397 DCHECK_CURRENTLY_ON(BrowserThread::IO); 397 DCHECK_CURRENTLY_ON(BrowserThread::IO);
398 return authorizations_.find(stream_id) != authorizations_.end(); 398 return authorizations_.find(stream_id) != authorizations_.end();
399 } 399 }
400 400
401 void AudioRendererHost::OverrideDevicePermissionsForTesting(bool has_access) { 401 void AudioRendererHost::OverrideDevicePermissionsForTesting(bool has_access) {
402 authorization_handler_.OverridePermissionsForTesting(has_access); 402 authorization_handler_.OverridePermissionsForTesting(has_access);
403 } 403 }
404 } // namespace content 404 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/media/audio_renderer_host.h ('k') | content/browser/renderer_host/media/audio_sync_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698