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

Side by Side Diff: content/renderer/pepper_plugin_delegate_impl.cc

Issue 9121062: Remove "high"-latency audio code path (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more to delete! Created 8 years, 10 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/renderer/pepper_plugin_delegate_impl.h" 5 #include "content/renderer/pepper_plugin_delegate_impl.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <queue> 8 #include <queue>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 // Called on the main thread to stop all audio callbacks. We must only change 277 // Called on the main thread to stop all audio callbacks. We must only change
278 // the client on the main thread, and the delegates from the I/O thread. 278 // the client on the main thread, and the delegates from the I/O thread.
279 client_ = NULL; 279 client_ = NULL;
280 ChildProcess::current()->io_message_loop()->PostTask( 280 ChildProcess::current()->io_message_loop()->PostTask(
281 FROM_HERE, 281 FROM_HERE,
282 base::Bind(&PlatformAudioImpl::ShutDownOnIOThread, this)); 282 base::Bind(&PlatformAudioImpl::ShutDownOnIOThread, this));
283 } 283 }
284 284
285 void PlatformAudioImpl::InitializeOnIOThread(const AudioParameters& params) { 285 void PlatformAudioImpl::InitializeOnIOThread(const AudioParameters& params) {
286 stream_id_ = filter_->AddDelegate(this); 286 stream_id_ = filter_->AddDelegate(this);
287 filter_->Send(new AudioHostMsg_CreateStream(stream_id_, params, true)); 287 filter_->Send(new AudioHostMsg_CreateStream(stream_id_, params));
288 } 288 }
289 289
290 void PlatformAudioImpl::StartPlaybackOnIOThread() { 290 void PlatformAudioImpl::StartPlaybackOnIOThread() {
291 if (stream_id_) 291 if (stream_id_)
292 filter_->Send(new AudioHostMsg_PlayStream(stream_id_)); 292 filter_->Send(new AudioHostMsg_PlayStream(stream_id_));
293 } 293 }
294 294
295 void PlatformAudioImpl::StopPlaybackOnIOThread() { 295 void PlatformAudioImpl::StopPlaybackOnIOThread() {
296 if (stream_id_) 296 if (stream_id_)
297 filter_->Send(new AudioHostMsg_PauseStream(stream_id_)); 297 filter_->Send(new AudioHostMsg_PauseStream(stream_id_));
(...skipping 1865 matching lines...) Expand 10 before | Expand all | Expand 10 after
2163 2163
2164 bool PepperPluginDelegateImpl::CanUseSocketAPIs() { 2164 bool PepperPluginDelegateImpl::CanUseSocketAPIs() {
2165 WebView* webview = render_view_->webview(); 2165 WebView* webview = render_view_->webview();
2166 WebFrame* main_frame = webview ? webview->mainFrame() : NULL; 2166 WebFrame* main_frame = webview ? webview->mainFrame() : NULL;
2167 GURL url(main_frame ? GURL(main_frame->document().url()) : GURL()); 2167 GURL url(main_frame ? GURL(main_frame->document().url()) : GURL());
2168 if (!url.is_valid()) 2168 if (!url.is_valid())
2169 return false; 2169 return false;
2170 2170
2171 return content::GetContentClient()->renderer()->AllowSocketAPI(url); 2171 return content::GetContentClient()->renderer()->AllowSocketAPI(url);
2172 } 2172 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698