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

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

Issue 655133002: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/shared_memory.h" 10 #include "base/memory/shared_memory.h"
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 if (!reader->Init()) { 354 if (!reader->Init()) {
355 SendErrorMessage(stream_id); 355 SendErrorMessage(stream_id);
356 return; 356 return;
357 } 357 }
358 358
359 MediaObserver* const media_observer = 359 MediaObserver* const media_observer =
360 GetContentClient()->browser()->GetMediaObserver(); 360 GetContentClient()->browser()->GetMediaObserver();
361 if (media_observer) 361 if (media_observer)
362 media_observer->OnCreatingAudioStream(render_process_id_, render_frame_id); 362 media_observer->OnCreatingAudioStream(render_process_id_, render_frame_id);
363 363
364 scoped_ptr<AudioEntry> entry(new AudioEntry( 364 scoped_ptr<AudioEntry> entry(new AudioEntry(this,
365 this, 365 stream_id,
366 stream_id, 366 render_view_id,
367 render_view_id, 367 render_frame_id,
368 render_frame_id, 368 params,
369 params, 369 output_device_id,
370 output_device_id, 370 shared_memory.Pass(),
371 shared_memory.Pass(), 371 reader.Pass()));
372 reader.PassAs<media::AudioOutputController::SyncReader>()));
373 if (mirroring_manager_) { 372 if (mirroring_manager_) {
374 mirroring_manager_->AddDiverter( 373 mirroring_manager_->AddDiverter(
375 render_process_id_, entry->render_frame_id(), entry->controller()); 374 render_process_id_, entry->render_frame_id(), entry->controller());
376 } 375 }
377 audio_entries_.insert(std::make_pair(stream_id, entry.release())); 376 audio_entries_.insert(std::make_pair(stream_id, entry.release()));
378 audio_log_->OnCreated(stream_id, params, output_device_id); 377 audio_log_->OnCreated(stream_id, params, output_device_id);
379 } 378 }
380 379
381 void AudioRendererHost::OnPlayStream(int stream_id) { 380 void AudioRendererHost::OnPlayStream(int stream_id) {
382 DCHECK_CURRENTLY_ON(BrowserThread::IO); 381 DCHECK_CURRENTLY_ON(BrowserThread::IO);
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 it != audio_entries_.end(); 506 it != audio_entries_.end();
508 ++it) { 507 ++it) {
509 AudioEntry* entry = it->second; 508 AudioEntry* entry = it->second;
510 if (entry->render_view_id() == render_view_id && entry->playing()) 509 if (entry->render_view_id() == render_view_id && entry->playing())
511 return true; 510 return true;
512 } 511 }
513 return false; 512 return false;
514 } 513 }
515 514
516 } // namespace content 515 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698