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

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

Issue 11468033: Vanquish the remnants of media::MessageLoopFactory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 #include "content/renderer/speech_recognition_dispatcher.h" 107 #include "content/renderer/speech_recognition_dispatcher.h"
108 #include "content/renderer/text_input_client_observer.h" 108 #include "content/renderer/text_input_client_observer.h"
109 #include "content/renderer/v8_value_converter_impl.h" 109 #include "content/renderer/v8_value_converter_impl.h"
110 #include "content/renderer/web_intents_host.h" 110 #include "content/renderer/web_intents_host.h"
111 #include "content/renderer/web_ui_extension.h" 111 #include "content/renderer/web_ui_extension.h"
112 #include "content/renderer/web_ui_extension_data.h" 112 #include "content/renderer/web_ui_extension_data.h"
113 #include "content/renderer/webplugin_delegate_proxy.h" 113 #include "content/renderer/webplugin_delegate_proxy.h"
114 #include "content/renderer/websharedworker_proxy.h" 114 #include "content/renderer/websharedworker_proxy.h"
115 #include "media/base/filter_collection.h" 115 #include "media/base/filter_collection.h"
116 #include "media/base/media_switches.h" 116 #include "media/base/media_switches.h"
117 #include "media/base/message_loop_factory.h"
118 #include "media/filters/audio_renderer_impl.h" 117 #include "media/filters/audio_renderer_impl.h"
119 #include "media/filters/gpu_video_decoder.h" 118 #include "media/filters/gpu_video_decoder.h"
120 #include "net/base/data_url.h" 119 #include "net/base/data_url.h"
121 #include "net/base/escape.h" 120 #include "net/base/escape.h"
122 #include "net/base/net_errors.h" 121 #include "net/base/net_errors.h"
123 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" 122 #include "net/base/registry_controlled_domains/registry_controlled_domain.h"
124 #include "net/http/http_util.h" 123 #include "net/http/http_util.h"
125 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObjec t.h" 124 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObjec t.h"
126 #include "third_party/WebKit/Source/WebKit/chromium/public/WebColorName.h" 125 #include "third_party/WebKit/Source/WebKit/chromium/public/WebColorName.h"
127 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMEvent.h" 126 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMEvent.h"
(...skipping 2445 matching lines...) Expand 10 before | Expand all | Expand 10 after
2573 } 2572 }
2574 return new webkit_media::WebMediaPlayerImplAndroid( 2573 return new webkit_media::WebMediaPlayerImplAndroid(
2575 frame, 2574 frame,
2576 client, 2575 client,
2577 media_player_manager_.get(), 2576 media_player_manager_.get(),
2578 media_player_proxy_, 2577 media_player_proxy_,
2579 new StreamTextureFactoryImpl( 2578 new StreamTextureFactoryImpl(
2580 resource_context, gpu_channel_host, routing_id_)); 2579 resource_context, gpu_channel_host, routing_id_));
2581 #endif 2580 #endif
2582 2581
2583 media::MessageLoopFactory* message_loop_factory =
2584 new media::MessageLoopFactory();
2585 media::FilterCollection* collection = new media::FilterCollection();
2586 RenderMediaLog* render_media_log = new RenderMediaLog(); 2582 RenderMediaLog* render_media_log = new RenderMediaLog();
2587 2583
2588 RenderAudioSourceProvider* audio_source_provider = NULL; 2584 RenderAudioSourceProvider* audio_source_provider = NULL;
2589 2585
2590 // Add in any custom filter factories first. 2586 // |audio_source_provider| "provides" audio to WebKit and is a sink from the
2587 // perspective of the audio renderer.
2591 if (!cmd_line->HasSwitch(switches::kDisableAudio)) { 2588 if (!cmd_line->HasSwitch(switches::kDisableAudio)) {
2592 // audio_source_provider is a "provider" to WebKit, and a sink
2593 // from the perspective of the audio renderer.
2594 audio_source_provider = new RenderAudioSourceProvider(routing_id_); 2589 audio_source_provider = new RenderAudioSourceProvider(routing_id_);
2595
2596 // Add the chrome specific audio renderer, using audio_source_provider
2597 // as the sink.
2598 media::AudioRendererImpl* audio_renderer =
acolwell GONE FROM CHROMIUM 2012/12/10 18:12:16 Why is this change here? It appears unrelated to t
scherkus (not reviewing) 2012/12/21 22:41:39 This snuck in -- xhwang@ ended up landing this in
2599 new media::AudioRendererImpl(audio_source_provider);
2600 collection->AddAudioRenderer(audio_renderer);
2601 } 2590 }
2602 2591
2592 scoped_refptr<media::GpuVideoDecoder::Factories> gpu_factories;
2603 WebGraphicsContext3DCommandBufferImpl* context3d = NULL; 2593 WebGraphicsContext3DCommandBufferImpl* context3d = NULL;
2604 if (!cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) 2594 if (!cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode))
2605 context3d = RenderThreadImpl::current()->GetGpuVDAContext3D(); 2595 context3d = RenderThreadImpl::current()->GetGpuVDAContext3D();
2606 if (context3d) { 2596 if (context3d) {
2607 scoped_refptr<base::MessageLoopProxy> factories_loop = 2597 scoped_refptr<base::MessageLoopProxy> factories_loop =
2608 RenderThreadImpl::current()->compositor_thread() ? 2598 RenderThreadImpl::current()->compositor_thread() ?
2609 RenderThreadImpl::current()->compositor_thread()->GetWebThread() 2599 RenderThreadImpl::current()->compositor_thread()->GetWebThread()
2610 ->message_loop()->message_loop_proxy() : 2600 ->message_loop()->message_loop_proxy() :
2611 base::MessageLoopProxy::current(); 2601 base::MessageLoopProxy::current();
2612 GpuChannelHost* gpu_channel_host = 2602 GpuChannelHost* gpu_channel_host =
2613 RenderThreadImpl::current()->EstablishGpuChannelSync( 2603 RenderThreadImpl::current()->EstablishGpuChannelSync(
2614 CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); 2604 CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE);
2615 collection->GetVideoDecoders()->push_back(new media::GpuVideoDecoder( 2605 gpu_factories = new RendererGpuVideoDecoderFactories(
2616 message_loop_factory->GetMessageLoop( 2606 gpu_channel_host, factories_loop, context3d);
2617 media::MessageLoopFactory::kPipeline),
2618 factories_loop,
2619 new RendererGpuVideoDecoderFactories(
2620 gpu_channel_host, factories_loop, context3d)));
2621 } 2607 }
2622 2608
2623 WebMediaPlayer* media_player = 2609 WebMediaPlayer* media_player =
2624 GetContentClient()->renderer()->OverrideCreateWebMediaPlayer( 2610 GetContentClient()->renderer()->OverrideCreateWebMediaPlayer(
2625 this, frame, client, AsWeakPtr(), collection, audio_source_provider, 2611 this, frame, client, AsWeakPtr(), audio_source_provider,
2626 audio_source_provider, message_loop_factory, media_stream_impl_, 2612 audio_source_provider, gpu_factories, media_stream_impl_,
2627 render_media_log); 2613 render_media_log);
2628 if (!media_player) { 2614 if (!media_player) {
2629 media_player = new webkit_media::WebMediaPlayerImpl( 2615 media_player = new webkit_media::WebMediaPlayerImpl(
2630 frame, client, AsWeakPtr(), collection, audio_source_provider, 2616 frame, client, AsWeakPtr(), audio_source_provider,
2631 audio_source_provider, message_loop_factory, media_stream_impl_, 2617 audio_source_provider, gpu_factories, media_stream_impl_,
2632 render_media_log); 2618 render_media_log);
2633 } 2619 }
2634 return media_player; 2620 return media_player;
2635 } 2621 }
2636 2622
2637 WebApplicationCacheHost* RenderViewImpl::createApplicationCacheHost( 2623 WebApplicationCacheHost* RenderViewImpl::createApplicationCacheHost(
2638 WebFrame* frame, WebApplicationCacheHostClient* client) { 2624 WebFrame* frame, WebApplicationCacheHostClient* client) {
2639 if (!frame || !frame->view()) 2625 if (!frame || !frame->view())
2640 return NULL; 2626 return NULL;
2641 return new RendererWebApplicationCacheHostImpl( 2627 return new RendererWebApplicationCacheHostImpl(
(...skipping 3839 matching lines...) Expand 10 before | Expand all | Expand 10 after
6481 } 6467 }
6482 #endif 6468 #endif
6483 6469
6484 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( 6470 void RenderViewImpl::OnReleaseDisambiguationPopupDIB(
6485 TransportDIB::Handle dib_handle) { 6471 TransportDIB::Handle dib_handle) {
6486 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); 6472 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle);
6487 RenderProcess::current()->ReleaseTransportDIB(dib); 6473 RenderProcess::current()->ReleaseTransportDIB(dib);
6488 } 6474 }
6489 6475
6490 } // namespace content 6476 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698