Chromium Code Reviews| 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 2644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2655 return NULL; | 2655 return NULL; |
| 2656 | 2656 |
| 2657 // Add the hardware video decoder factory. | 2657 // Add the hardware video decoder factory. |
| 2658 // TODO(hclam): This will cause the renderer process to crash on context | 2658 // TODO(hclam): This will cause the renderer process to crash on context |
| 2659 // lost. | 2659 // lost. |
| 2660 bool ret = context->makeContextCurrent(); | 2660 bool ret = context->makeContextCurrent(); |
| 2661 CHECK(ret) << "Failed to switch context"; | 2661 CHECK(ret) << "Failed to switch context"; |
| 2662 collection->AddVideoDecoder(new IpcVideoDecoder( | 2662 collection->AddVideoDecoder(new IpcVideoDecoder( |
| 2663 MessageLoop::current(), context->context())); | 2663 MessageLoop::current(), context->context())); |
| 2664 } | 2664 } |
| 2665 | 2665 /* |
| 2666 WebApplicationCacheHostImpl* appcache_host = | 2666 WebApplicationCacheHostImpl* appcache_host = |
|
scherkus (not reviewing)
2010/11/30 20:05:39
has this been addressed yet?
I'd ping michaeln ov
annacc
2010/11/30 21:51:45
Will do.
| |
| 2667 WebApplicationCacheHostImpl::FromFrame(frame); | 2667 WebApplicationCacheHostImpl::FromFrame(frame); |
| 2668 | 2668 */ |
| 2669 // TODO(hclam): obtain the following parameters from |client|. | |
| 2670 // Create two bridge factory for two data sources. | |
| 2671 webkit_glue::MediaResourceLoaderBridgeFactory* bridge_factory_simple = | |
| 2672 new webkit_glue::MediaResourceLoaderBridgeFactory( | |
| 2673 GURL(frame->url()), // referrer | |
| 2674 "null", // frame origin | |
| 2675 "null", // main_frame_origin | |
| 2676 base::GetCurrentProcId(), | |
| 2677 appcache_host ? appcache_host->host_id() : appcache::kNoHostId, | |
| 2678 routing_id()); | |
| 2679 | |
| 2680 webkit_glue::MediaResourceLoaderBridgeFactory* bridge_factory_buffered = | |
| 2681 new webkit_glue::MediaResourceLoaderBridgeFactory( | |
| 2682 GURL(frame->url()), // referrer | |
| 2683 "null", // frame origin | |
| 2684 "null", // main_frame_origin | |
| 2685 base::GetCurrentProcId(), | |
| 2686 appcache_host ? appcache_host->host_id() : appcache::kNoHostId, | |
| 2687 routing_id()); | |
| 2688 | |
| 2689 scoped_refptr<webkit_glue::WebVideoRenderer> video_renderer; | 2669 scoped_refptr<webkit_glue::WebVideoRenderer> video_renderer; |
| 2690 bool pts_logging = cmd_line->HasSwitch(switches::kEnableVideoLogging); | 2670 bool pts_logging = cmd_line->HasSwitch(switches::kEnableVideoLogging); |
| 2691 scoped_refptr<webkit_glue::VideoRendererImpl> renderer( | 2671 scoped_refptr<webkit_glue::VideoRendererImpl> renderer( |
| 2692 new webkit_glue::VideoRendererImpl(pts_logging)); | 2672 new webkit_glue::VideoRendererImpl(pts_logging)); |
| 2693 collection->AddVideoRenderer(renderer); | 2673 collection->AddVideoRenderer(renderer); |
| 2694 video_renderer = renderer; | 2674 video_renderer = renderer; |
| 2695 | 2675 |
| 2696 return new webkit_glue::WebMediaPlayerImpl( | 2676 return new webkit_glue::WebMediaPlayerImpl( |
| 2697 client, collection.release(), bridge_factory_simple, | 2677 client, collection.release(), frame, |
| 2698 bridge_factory_buffered, | 2678 cmd_line->HasSwitch(switches::kSimpleDataSource), |
| 2699 cmd_line->HasSwitch(switches::kSimpleDataSource),video_renderer); | 2679 video_renderer); |
| 2700 } | 2680 } |
| 2701 | 2681 |
| 2702 WebApplicationCacheHost* RenderView::createApplicationCacheHost( | 2682 WebApplicationCacheHost* RenderView::createApplicationCacheHost( |
| 2703 WebFrame* frame, WebApplicationCacheHostClient* client) { | 2683 WebFrame* frame, WebApplicationCacheHostClient* client) { |
| 2704 return new RendererWebApplicationCacheHostImpl( | 2684 return new RendererWebApplicationCacheHostImpl( |
| 2705 FromWebView(frame->view()), client, | 2685 FromWebView(frame->view()), client, |
| 2706 RenderThread::current()->appcache_dispatcher()->backend_proxy()); | 2686 RenderThread::current()->appcache_dispatcher()->backend_proxy()); |
| 2707 } | 2687 } |
| 2708 | 2688 |
| 2709 WebCookieJar* RenderView::cookieJar() { | 2689 WebCookieJar* RenderView::cookieJar() { |
| (...skipping 2791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5501 IPC::PlatformFileForTransitToPlatformFile(file_for_transit), | 5481 IPC::PlatformFileForTransitToPlatformFile(file_for_transit), |
| 5502 message_id); | 5482 message_id); |
| 5503 } | 5483 } |
| 5504 | 5484 |
| 5505 #if defined(OS_MACOSX) | 5485 #if defined(OS_MACOSX) |
| 5506 void RenderView::OnSelectPopupMenuItem(int selected_index) { | 5486 void RenderView::OnSelectPopupMenuItem(int selected_index) { |
| 5507 external_popup_menu_->DidSelectItem(selected_index); | 5487 external_popup_menu_->DidSelectItem(selected_index); |
| 5508 external_popup_menu_.reset(); | 5488 external_popup_menu_.reset(); |
| 5509 } | 5489 } |
| 5510 #endif | 5490 #endif |
| OLD | NEW |