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 "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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 #include "gfx/color_utils.h" | 98 #include "gfx/color_utils.h" |
99 #include "gfx/favicon_size.h" | 99 #include "gfx/favicon_size.h" |
100 #include "gfx/native_widget_types.h" | 100 #include "gfx/native_widget_types.h" |
101 #include "gfx/point.h" | 101 #include "gfx/point.h" |
102 #include "gfx/rect.h" | 102 #include "gfx/rect.h" |
103 #include "gfx/skbitmap_operations.h" | 103 #include "gfx/skbitmap_operations.h" |
104 #include "grit/generated_resources.h" | 104 #include "grit/generated_resources.h" |
105 #include "grit/renderer_resources.h" | 105 #include "grit/renderer_resources.h" |
106 #include "media/base/filter_collection.h" | 106 #include "media/base/filter_collection.h" |
107 #include "media/base/media_switches.h" | 107 #include "media/base/media_switches.h" |
| 108 #include "media/base/message_loop_factory_impl.h" |
108 #include "net/base/data_url.h" | 109 #include "net/base/data_url.h" |
109 #include "net/base/escape.h" | 110 #include "net/base/escape.h" |
110 #include "net/base/net_errors.h" | 111 #include "net/base/net_errors.h" |
111 #include "net/http/http_util.h" | 112 #include "net/http/http_util.h" |
112 #include "ppapi/c/private/ppb_flash.h" | 113 #include "ppapi/c/private/ppb_flash.h" |
113 #include "skia/ext/bitmap_platform_device.h" | 114 #include "skia/ext/bitmap_platform_device.h" |
114 #include "skia/ext/image_operations.h" | 115 #include "skia/ext/image_operations.h" |
115 #include "third_party/WebKit/WebKit/chromium/public/WebAccessibilityCache.h" | 116 #include "third_party/WebKit/WebKit/chromium/public/WebAccessibilityCache.h" |
116 #include "third_party/WebKit/WebKit/chromium/public/WebAccessibilityObject.h" | 117 #include "third_party/WebKit/WebKit/chromium/public/WebAccessibilityObject.h" |
117 #include "third_party/WebKit/WebKit/chromium/public/WebCString.h" | 118 #include "third_party/WebKit/WebKit/chromium/public/WebCString.h" |
(...skipping 2751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2869 return new WebSharedWorkerProxy(RenderThread::current(), | 2870 return new WebSharedWorkerProxy(RenderThread::current(), |
2870 document_id, | 2871 document_id, |
2871 exists, | 2872 exists, |
2872 route_id, | 2873 route_id, |
2873 routing_id_); | 2874 routing_id_); |
2874 } | 2875 } |
2875 } | 2876 } |
2876 | 2877 |
2877 WebMediaPlayer* RenderView::createMediaPlayer( | 2878 WebMediaPlayer* RenderView::createMediaPlayer( |
2878 WebFrame* frame, WebMediaPlayerClient* client) { | 2879 WebFrame* frame, WebMediaPlayerClient* client) { |
| 2880 scoped_ptr<media::MessageLoopFactory> message_loop_factory( |
| 2881 new media::MessageLoopFactoryImpl()); |
2879 scoped_ptr<media::FilterCollection> collection( | 2882 scoped_ptr<media::FilterCollection> collection( |
2880 new media::FilterCollection()); | 2883 new media::FilterCollection()); |
2881 | 2884 |
2882 // Add in any custom filter factories first. | 2885 // Add in any custom filter factories first. |
2883 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 2886 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
2884 if (!cmd_line->HasSwitch(switches::kDisableAudio)) { | 2887 if (!cmd_line->HasSwitch(switches::kDisableAudio)) { |
2885 // Add the chrome specific audio renderer. | 2888 // Add the chrome specific audio renderer. |
2886 collection->AddAudioRenderer(new AudioRendererImpl(audio_message_filter())); | 2889 collection->AddAudioRenderer(new AudioRendererImpl(audio_message_filter())); |
2887 } | 2890 } |
2888 | 2891 |
(...skipping 15 matching lines...) Expand all Loading... |
2904 } | 2907 } |
2905 | 2908 |
2906 scoped_refptr<webkit_glue::WebVideoRenderer> video_renderer; | 2909 scoped_refptr<webkit_glue::WebVideoRenderer> video_renderer; |
2907 bool pts_logging = cmd_line->HasSwitch(switches::kEnableVideoLogging); | 2910 bool pts_logging = cmd_line->HasSwitch(switches::kEnableVideoLogging); |
2908 scoped_refptr<webkit_glue::VideoRendererImpl> renderer( | 2911 scoped_refptr<webkit_glue::VideoRendererImpl> renderer( |
2909 new webkit_glue::VideoRendererImpl(pts_logging)); | 2912 new webkit_glue::VideoRendererImpl(pts_logging)); |
2910 collection->AddVideoRenderer(renderer); | 2913 collection->AddVideoRenderer(renderer); |
2911 video_renderer = renderer; | 2914 video_renderer = renderer; |
2912 | 2915 |
2913 scoped_ptr<webkit_glue::WebMediaPlayerImpl> result( | 2916 scoped_ptr<webkit_glue::WebMediaPlayerImpl> result( |
2914 new webkit_glue::WebMediaPlayerImpl(client, collection.release())); | 2917 new webkit_glue::WebMediaPlayerImpl(client, |
| 2918 collection.release(), |
| 2919 message_loop_factory.release())); |
2915 if (!result->Initialize(frame, | 2920 if (!result->Initialize(frame, |
2916 cmd_line->HasSwitch(switches::kSimpleDataSource), | 2921 cmd_line->HasSwitch(switches::kSimpleDataSource), |
2917 video_renderer)) { | 2922 video_renderer)) { |
2918 return NULL; | 2923 return NULL; |
2919 } | 2924 } |
2920 return result.release(); | 2925 return result.release(); |
2921 } | 2926 } |
2922 | 2927 |
2923 WebApplicationCacheHost* RenderView::createApplicationCacheHost( | 2928 WebApplicationCacheHost* RenderView::createApplicationCacheHost( |
2924 WebFrame* frame, WebApplicationCacheHostClient* client) { | 2929 WebFrame* frame, WebApplicationCacheHostClient* client) { |
(...skipping 2862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5787 } | 5792 } |
5788 #endif | 5793 #endif |
5789 | 5794 |
5790 void RenderView::OnJavaScriptStressTestControl(int cmd, int param) { | 5795 void RenderView::OnJavaScriptStressTestControl(int cmd, int param) { |
5791 if (cmd == kJavaScriptStressTestSetStressRunType) { | 5796 if (cmd == kJavaScriptStressTestSetStressRunType) { |
5792 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param)); | 5797 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param)); |
5793 } else if (cmd == kJavaScriptStressTestPrepareStressRun) { | 5798 } else if (cmd == kJavaScriptStressTestPrepareStressRun) { |
5794 v8::Testing::PrepareStressRun(param); | 5799 v8::Testing::PrepareStressRun(param); |
5795 } | 5800 } |
5796 } | 5801 } |
OLD | NEW |