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

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

Issue 2852803002: Remove base::SharedMemory::ShareToProcess. (Closed)
Patch Set: Compile error. Created 3 years, 7 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_input_renderer_host.h" 5 #include "content/browser/renderer_host/media/audio_input_renderer_host.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 void AudioInputRendererHost::DoCompleteCreation( 169 void AudioInputRendererHost::DoCompleteCreation(
170 media::AudioInputController* controller) { 170 media::AudioInputController* controller) {
171 DCHECK_CURRENTLY_ON(BrowserThread::IO); 171 DCHECK_CURRENTLY_ON(BrowserThread::IO);
172 172
173 AudioEntry* entry = LookupByController(controller); 173 AudioEntry* entry = LookupByController(controller);
174 DCHECK(entry); 174 DCHECK(entry);
175 DCHECK(PeerHandle()); 175 DCHECK(PeerHandle());
176 176
177 // Once the audio stream is created then complete the creation process by 177 // Once the audio stream is created then complete the creation process by
178 // mapping shared memory and sharing with the renderer process. 178 // mapping shared memory and sharing with the renderer process.
179 base::SharedMemoryHandle foreign_memory_handle; 179 base::SharedMemoryHandle foreign_memory_handle =
180 if (!entry->shared_memory.ShareToProcess(PeerHandle(), 180 entry->shared_memory.handle().Duplicate();
181 &foreign_memory_handle)) { 181 if (!foreign_memory_handle.IsValid()) {
182 // If we failed to map and share the shared memory then close the audio 182 // If we failed to map and share the shared memory then close the audio
183 // stream and send an error message. 183 // stream and send an error message.
184 DeleteEntryOnError(entry, MEMORY_SHARING_FAILED); 184 DeleteEntryOnError(entry, MEMORY_SHARING_FAILED);
185 return; 185 return;
186 } 186 }
187 187
188 AudioInputSyncWriter* writer = entry->writer.get(); 188 AudioInputSyncWriter* writer = entry->writer.get();
189 189
190 base::SyncSocket::TransitDescriptor socket_transit_descriptor; 190 base::SyncSocket::TransitDescriptor socket_transit_descriptor;
191 191
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 const base::FilePath& file, 596 const base::FilePath& file,
597 int stream_id) { 597 int stream_id) {
598 DCHECK_CURRENTLY_ON(BrowserThread::IO); 598 DCHECK_CURRENTLY_ON(BrowserThread::IO);
599 EnableDebugRecordingForId(GetDebugRecordingFilePathWithExtensions(file), 599 EnableDebugRecordingForId(GetDebugRecordingFilePathWithExtensions(file),
600 stream_id); 600 stream_id);
601 } 601 }
602 602
603 #endif // BUILDFLAG(ENABLE_WEBRTC) 603 #endif // BUILDFLAG(ENABLE_WEBRTC)
604 604
605 } // namespace content 605 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/browser_child_process_host_impl.cc ('k') | content/browser/renderer_host/media/audio_renderer_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698