OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1925 route_id, | 1925 route_id, |
1926 routing_id_); | 1926 routing_id_); |
1927 } | 1927 } |
1928 } | 1928 } |
1929 | 1929 |
1930 WebMediaPlayer* RenderViewImpl::createMediaPlayer( | 1930 WebMediaPlayer* RenderViewImpl::createMediaPlayer( |
1931 WebFrame* frame, WebMediaPlayerClient* client) { | 1931 WebFrame* frame, WebMediaPlayerClient* client) { |
1932 FOR_EACH_OBSERVER( | 1932 FOR_EACH_OBSERVER( |
1933 RenderViewObserver, observers_, WillCreateMediaPlayer(frame, client)); | 1933 RenderViewObserver, observers_, WillCreateMediaPlayer(frame, client)); |
1934 | 1934 |
1935 scoped_ptr<media::MessageLoopFactory> message_loop_factory( | 1935 media::MessageLoopFactory* message_loop_factory = |
1936 new media::MessageLoopFactoryImpl()); | 1936 new media::MessageLoopFactoryImpl(); |
1937 scoped_ptr<media::FilterCollection> collection( | 1937 media::FilterCollection* collection = new media::FilterCollection(); |
1938 new media::FilterCollection()); | 1938 RenderMediaLog* render_media_log = new RenderMediaLog(); |
1939 | 1939 |
1940 // Add in any custom filter factories first. | 1940 // Add in any custom filter factories first. |
1941 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 1941 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
1942 if (!cmd_line->HasSwitch(switches::kDisableAudio)) { | 1942 if (!cmd_line->HasSwitch(switches::kDisableAudio)) { |
1943 // Add the chrome specific audio renderer. | 1943 // Add the chrome specific audio renderer. |
1944 collection->AddAudioRenderer(new AudioRendererImpl()); | 1944 collection->AddAudioRenderer(new AudioRendererImpl()); |
1945 } | 1945 } |
1946 | 1946 |
1947 scoped_ptr<webkit_media::WebMediaPlayerImpl> result( | 1947 webkit_media::WebMediaPlayerImpl* result_ptr; |
1948 new webkit_media::WebMediaPlayerImpl(client, | 1948 if (!content::GetContentClient()->renderer()->OverrideCreateWebMediaPlayer( |
1949 AsWeakPtr(), | 1949 this, client, AsWeakPtr(), collection, message_loop_factory, |
1950 collection.release(), | 1950 media_stream_impl_.get(), render_media_log, &result_ptr)) { |
1951 message_loop_factory.release(), | 1951 result_ptr = new webkit_media::WebMediaPlayerImpl( |
1952 media_stream_impl_.get(), | 1952 client, AsWeakPtr(), collection, message_loop_factory, |
1953 new RenderMediaLog())); | 1953 media_stream_impl_.get(), render_media_log); |
| 1954 } |
| 1955 |
| 1956 DCHECK(result_ptr); |
| 1957 scoped_ptr<webkit_media::WebMediaPlayerImpl> result; |
| 1958 result.reset(result_ptr); |
| 1959 |
1954 if (!result->Initialize(frame, | 1960 if (!result->Initialize(frame, |
1955 cmd_line->HasSwitch(switches::kSimpleDataSource))) { | 1961 cmd_line->HasSwitch(switches::kSimpleDataSource))) { |
1956 return NULL; | 1962 return NULL; |
1957 } | 1963 } |
1958 return result.release(); | 1964 return result.release(); |
1959 } | 1965 } |
1960 | 1966 |
1961 WebApplicationCacheHost* RenderViewImpl::createApplicationCacheHost( | 1967 WebApplicationCacheHost* RenderViewImpl::createApplicationCacheHost( |
1962 WebFrame* frame, WebApplicationCacheHostClient* client) { | 1968 WebFrame* frame, WebApplicationCacheHostClient* client) { |
1963 return new RendererWebApplicationCacheHostImpl( | 1969 return new RendererWebApplicationCacheHostImpl( |
(...skipping 2824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4788 return !!RenderThreadImpl::current()->compositor_thread(); | 4794 return !!RenderThreadImpl::current()->compositor_thread(); |
4789 } | 4795 } |
4790 | 4796 |
4791 void RenderViewImpl::OnJavaBridgeInit( | 4797 void RenderViewImpl::OnJavaBridgeInit( |
4792 const IPC::ChannelHandle& channel_handle) { | 4798 const IPC::ChannelHandle& channel_handle) { |
4793 DCHECK(!java_bridge_dispatcher_.get()); | 4799 DCHECK(!java_bridge_dispatcher_.get()); |
4794 #if defined(ENABLE_JAVA_BRIDGE) | 4800 #if defined(ENABLE_JAVA_BRIDGE) |
4795 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this, channel_handle)); | 4801 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this, channel_handle)); |
4796 #endif | 4802 #endif |
4797 } | 4803 } |
OLD | NEW |