OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/renderer/render_view.h" | 5 #include "chrome/renderer/render_view.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 2798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2809 return NULL; | 2809 return NULL; |
2810 | 2810 |
2811 // Add the hardware video decoder factory. | 2811 // Add the hardware video decoder factory. |
2812 // TODO(hclam): This will cause the renderer process to crash on context | 2812 // TODO(hclam): This will cause the renderer process to crash on context |
2813 // lost. | 2813 // lost. |
2814 bool ret = context->makeContextCurrent(); | 2814 bool ret = context->makeContextCurrent(); |
2815 CHECK(ret) << "Failed to switch context"; | 2815 CHECK(ret) << "Failed to switch context"; |
2816 collection->AddVideoDecoder(new IpcVideoDecoder( | 2816 collection->AddVideoDecoder(new IpcVideoDecoder( |
2817 MessageLoop::current(), context->context())); | 2817 MessageLoop::current(), context->context())); |
2818 } | 2818 } |
2819 | 2819 /* |
2820 WebApplicationCacheHostImpl* appcache_host = | 2820 WebApplicationCacheHostImpl* appcache_host = |
2821 WebApplicationCacheHostImpl::FromFrame(frame); | 2821 WebApplicationCacheHostImpl::FromFrame(frame); |
2822 | 2822 */ |
2823 // TODO(hclam): obtain the following parameters from |client|. | |
2824 // Create two bridge factory for two data sources. | |
2825 webkit_glue::MediaResourceLoaderBridgeFactory* bridge_factory_simple = | |
2826 new webkit_glue::MediaResourceLoaderBridgeFactory( | |
2827 GURL(frame->url()), // referrer | |
2828 "null", // frame origin | |
2829 "null", // main_frame_origin | |
2830 base::GetCurrentProcId(), | |
2831 appcache_host ? appcache_host->host_id() : appcache::kNoHostId, | |
2832 routing_id()); | |
2833 | |
2834 webkit_glue::MediaResourceLoaderBridgeFactory* bridge_factory_buffered = | |
2835 new webkit_glue::MediaResourceLoaderBridgeFactory( | |
2836 GURL(frame->url()), // referrer | |
2837 "null", // frame origin | |
2838 "null", // main_frame_origin | |
2839 base::GetCurrentProcId(), | |
2840 appcache_host ? appcache_host->host_id() : appcache::kNoHostId, | |
2841 routing_id()); | |
2842 | |
2843 scoped_refptr<webkit_glue::WebVideoRenderer> video_renderer; | 2823 scoped_refptr<webkit_glue::WebVideoRenderer> video_renderer; |
2844 bool pts_logging = cmd_line->HasSwitch(switches::kEnableVideoLogging); | 2824 bool pts_logging = cmd_line->HasSwitch(switches::kEnableVideoLogging); |
2845 scoped_refptr<webkit_glue::VideoRendererImpl> renderer( | 2825 scoped_refptr<webkit_glue::VideoRendererImpl> renderer( |
2846 new webkit_glue::VideoRendererImpl(pts_logging)); | 2826 new webkit_glue::VideoRendererImpl(pts_logging)); |
2847 collection->AddVideoRenderer(renderer); | 2827 collection->AddVideoRenderer(renderer); |
2848 video_renderer = renderer; | 2828 video_renderer = renderer; |
2849 | 2829 |
2850 return new webkit_glue::WebMediaPlayerImpl( | 2830 return new webkit_glue::WebMediaPlayerImpl( |
2851 client, collection.release(), bridge_factory_simple, | 2831 client, collection.release(), frame, |
2852 bridge_factory_buffered, | 2832 cmd_line->HasSwitch(switches::kSimpleDataSource), |
2853 cmd_line->HasSwitch(switches::kSimpleDataSource),video_renderer); | 2833 video_renderer); |
2854 } | 2834 } |
2855 | 2835 |
2856 WebApplicationCacheHost* RenderView::createApplicationCacheHost( | 2836 WebApplicationCacheHost* RenderView::createApplicationCacheHost( |
2857 WebFrame* frame, WebApplicationCacheHostClient* client) { | 2837 WebFrame* frame, WebApplicationCacheHostClient* client) { |
2858 return new RendererWebApplicationCacheHostImpl( | 2838 return new RendererWebApplicationCacheHostImpl( |
2859 FromWebView(frame->view()), client, | 2839 FromWebView(frame->view()), client, |
2860 RenderThread::current()->appcache_dispatcher()->backend_proxy()); | 2840 RenderThread::current()->appcache_dispatcher()->backend_proxy()); |
2861 } | 2841 } |
2862 | 2842 |
2863 // TODO(jochen): remove after roll. | 2843 // TODO(jochen): remove after roll. |
(...skipping 2821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5685 external_popup_menu_.reset(); | 5665 external_popup_menu_.reset(); |
5686 } | 5666 } |
5687 #endif | 5667 #endif |
5688 | 5668 |
5689 void RenderView::AddErrorToRootConsole(const string16& message) { | 5669 void RenderView::AddErrorToRootConsole(const string16& message) { |
5690 if (webview() && webview()->mainFrame()) { | 5670 if (webview() && webview()->mainFrame()) { |
5691 webview()->mainFrame()->addMessageToConsole( | 5671 webview()->mainFrame()->addMessageToConsole( |
5692 WebConsoleMessage(WebConsoleMessage::LevelError, message)); | 5672 WebConsoleMessage(WebConsoleMessage::LevelError, message)); |
5693 } | 5673 } |
5694 } | 5674 } |
OLD | NEW |