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 2600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2611 } | 2611 } |
2612 | 2612 |
2613 WebMediaPlayer* RenderView::createMediaPlayer( | 2613 WebMediaPlayer* RenderView::createMediaPlayer( |
2614 WebFrame* frame, WebMediaPlayerClient* client) { | 2614 WebFrame* frame, WebMediaPlayerClient* client) { |
2615 media::MediaFilterCollection collection; | 2615 media::MediaFilterCollection collection; |
2616 | 2616 |
2617 // Add in any custom filter factories first. | 2617 // Add in any custom filter factories first. |
2618 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 2618 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
2619 if (!cmd_line->HasSwitch(switches::kDisableAudio)) { | 2619 if (!cmd_line->HasSwitch(switches::kDisableAudio)) { |
2620 // Add the chrome specific audio renderer. | 2620 // Add the chrome specific audio renderer. |
2621 collection.push_back(new AudioRendererImpl(audio_message_filter())); | 2621 collection.push_back(make_scoped_refptr( |
| 2622 new AudioRendererImpl(audio_message_filter()))); |
2622 } | 2623 } |
2623 | 2624 |
2624 if (cmd_line->HasSwitch(switches::kEnableAcceleratedDecoding) && | 2625 if (cmd_line->HasSwitch(switches::kEnableAcceleratedDecoding) && |
2625 !cmd_line->HasSwitch(switches::kDisableAcceleratedCompositing)) { | 2626 !cmd_line->HasSwitch(switches::kDisableAcceleratedCompositing)) { |
2626 // Add the hardware video decoder factory. | 2627 // Add the hardware video decoder factory. |
2627 // TODO(hclam): This assumes that ggl::Context is set to current | 2628 // TODO(hclam): This assumes that ggl::Context is set to current |
2628 // internally. I need to make it more explicit to get the context. | 2629 // internally. I need to make it more explicit to get the context. |
2629 bool ret = frame->view()->graphicsContext3D()->makeContextCurrent(); | 2630 bool ret = frame->view()->graphicsContext3D()->makeContextCurrent(); |
2630 CHECK(ret) << "Failed to switch context"; | 2631 CHECK(ret) << "Failed to switch context"; |
2631 | 2632 |
2632 collection.push_back(new IpcVideoDecoder( | 2633 collection.push_back(make_scoped_refptr(new IpcVideoDecoder( |
2633 MessageLoop::current(), ggl::GetCurrentContext())); | 2634 MessageLoop::current(), ggl::GetCurrentContext()))); |
2634 } | 2635 } |
2635 | 2636 |
2636 WebApplicationCacheHostImpl* appcache_host = | 2637 WebApplicationCacheHostImpl* appcache_host = |
2637 WebApplicationCacheHostImpl::FromFrame(frame); | 2638 WebApplicationCacheHostImpl::FromFrame(frame); |
2638 | 2639 |
2639 // TODO(hclam): obtain the following parameters from |client|. | 2640 // TODO(hclam): obtain the following parameters from |client|. |
2640 // Create two bridge factory for two data sources. | 2641 // Create two bridge factory for two data sources. |
2641 webkit_glue::MediaResourceLoaderBridgeFactory* bridge_factory_simple = | 2642 webkit_glue::MediaResourceLoaderBridgeFactory* bridge_factory_simple = |
2642 new webkit_glue::MediaResourceLoaderBridgeFactory( | 2643 new webkit_glue::MediaResourceLoaderBridgeFactory( |
2643 GURL(frame->url()), // referrer | 2644 GURL(frame->url()), // referrer |
(...skipping 3485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6129 IPC::PlatformFileForTransitToPlatformFile(file_for_transit), | 6130 IPC::PlatformFileForTransitToPlatformFile(file_for_transit), |
6130 message_id); | 6131 message_id); |
6131 } | 6132 } |
6132 | 6133 |
6133 #if defined(OS_MACOSX) | 6134 #if defined(OS_MACOSX) |
6134 void RenderView::OnSelectPopupMenuItem(int selected_index) { | 6135 void RenderView::OnSelectPopupMenuItem(int selected_index) { |
6135 external_popup_menu_->DidSelectItem(selected_index); | 6136 external_popup_menu_->DidSelectItem(selected_index); |
6136 external_popup_menu_.reset(); | 6137 external_popup_menu_.reset(); |
6137 } | 6138 } |
6138 #endif | 6139 #endif |
OLD | NEW |