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

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

Issue 12537014: Make SharedMemory track the size that was actually mapped (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 9 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 | Annotate | Revision Log
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/process.h" 9 #include "base/process.h"
10 #include "base/shared_memory.h" 10 #include "base/shared_memory.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 if (!reader->PrepareForeignSocketHandle(peer_handle(), 175 if (!reader->PrepareForeignSocketHandle(peer_handle(),
176 &foreign_socket_handle)) { 176 &foreign_socket_handle)) {
177 DeleteEntryOnError(entry); 177 DeleteEntryOnError(entry);
178 return; 178 return;
179 } 179 }
180 180
181 Send(new AudioMsg_NotifyStreamCreated( 181 Send(new AudioMsg_NotifyStreamCreated(
182 entry->stream_id, 182 entry->stream_id,
183 foreign_memory_handle, 183 foreign_memory_handle,
184 foreign_socket_handle, 184 foreign_socket_handle,
185 media::PacketSizeInBytes(entry->shared_memory.created_size()))); 185 media::PacketSizeInBytes(entry->shared_memory.requested_size())));
186 } 186 }
187 187
188 void AudioRendererHost::DoSendPlayingMessage( 188 void AudioRendererHost::DoSendPlayingMessage(
189 media::AudioOutputController* controller) { 189 media::AudioOutputController* controller) {
190 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 190 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
191 191
192 AudioEntry* entry = LookupByController(controller); 192 AudioEntry* entry = LookupByController(controller);
193 if (!entry) 193 if (!entry)
194 return; 194 return;
195 195
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 return NULL; 526 return NULL;
527 } 527 }
528 528
529 media::AudioOutputController* AudioRendererHost::LookupControllerByIdForTesting( 529 media::AudioOutputController* AudioRendererHost::LookupControllerByIdForTesting(
530 int stream_id) { 530 int stream_id) {
531 AudioEntry* const entry = LookupById(stream_id); 531 AudioEntry* const entry = LookupById(stream_id);
532 return entry ? entry->controller : NULL; 532 return entry ? entry->controller : NULL;
533 } 533 }
534 534
535 } // namespace content 535 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698