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 2756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2874 return new WebSharedWorkerProxy(RenderThread::current(), | 2875 return new WebSharedWorkerProxy(RenderThread::current(), |
2875 document_id, | 2876 document_id, |
2876 exists, | 2877 exists, |
2877 route_id, | 2878 route_id, |
2878 routing_id_); | 2879 routing_id_); |
2879 } | 2880 } |
2880 } | 2881 } |
2881 | 2882 |
2882 WebMediaPlayer* RenderView::createMediaPlayer( | 2883 WebMediaPlayer* RenderView::createMediaPlayer( |
2883 WebFrame* frame, WebMediaPlayerClient* client) { | 2884 WebFrame* frame, WebMediaPlayerClient* client) { |
| 2885 scoped_refptr<media::MessageLoopFactory> message_loop_factory( |
| 2886 new media::MessageLoopFactoryImpl()); |
2884 scoped_ptr<media::FilterCollection> collection( | 2887 scoped_ptr<media::FilterCollection> collection( |
2885 new media::FilterCollection()); | 2888 new media::FilterCollection()); |
2886 | 2889 |
2887 // Add in any custom filter factories first. | 2890 // Add in any custom filter factories first. |
2888 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 2891 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
2889 if (!cmd_line->HasSwitch(switches::kDisableAudio)) { | 2892 if (!cmd_line->HasSwitch(switches::kDisableAudio)) { |
2890 // Add the chrome specific audio renderer. | 2893 // Add the chrome specific audio renderer. |
2891 collection->AddAudioRenderer(new AudioRendererImpl(audio_message_filter())); | 2894 collection->AddAudioRenderer(new AudioRendererImpl(audio_message_filter())); |
2892 } | 2895 } |
2893 | 2896 |
(...skipping 15 matching lines...) Expand all Loading... |
2909 } | 2912 } |
2910 | 2913 |
2911 scoped_refptr<webkit_glue::WebVideoRenderer> video_renderer; | 2914 scoped_refptr<webkit_glue::WebVideoRenderer> video_renderer; |
2912 bool pts_logging = cmd_line->HasSwitch(switches::kEnableVideoLogging); | 2915 bool pts_logging = cmd_line->HasSwitch(switches::kEnableVideoLogging); |
2913 scoped_refptr<webkit_glue::VideoRendererImpl> renderer( | 2916 scoped_refptr<webkit_glue::VideoRendererImpl> renderer( |
2914 new webkit_glue::VideoRendererImpl(pts_logging)); | 2917 new webkit_glue::VideoRendererImpl(pts_logging)); |
2915 collection->AddVideoRenderer(renderer); | 2918 collection->AddVideoRenderer(renderer); |
2916 video_renderer = renderer; | 2919 video_renderer = renderer; |
2917 | 2920 |
2918 scoped_ptr<webkit_glue::WebMediaPlayerImpl> result( | 2921 scoped_ptr<webkit_glue::WebMediaPlayerImpl> result( |
2919 new webkit_glue::WebMediaPlayerImpl(client, collection.release())); | 2922 new webkit_glue::WebMediaPlayerImpl(client, collection.release(), |
| 2923 message_loop_factory)); |
2920 if (!result->Initialize(frame, | 2924 if (!result->Initialize(frame, |
2921 cmd_line->HasSwitch(switches::kSimpleDataSource), | 2925 cmd_line->HasSwitch(switches::kSimpleDataSource), |
2922 video_renderer)) { | 2926 video_renderer)) { |
2923 return NULL; | 2927 return NULL; |
2924 } | 2928 } |
2925 return result.release(); | 2929 return result.release(); |
2926 } | 2930 } |
2927 | 2931 |
2928 WebApplicationCacheHost* RenderView::createApplicationCacheHost( | 2932 WebApplicationCacheHost* RenderView::createApplicationCacheHost( |
2929 WebFrame* frame, WebApplicationCacheHostClient* client) { | 2933 WebFrame* frame, WebApplicationCacheHostClient* client) { |
(...skipping 2862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5792 } | 5796 } |
5793 #endif | 5797 #endif |
5794 | 5798 |
5795 void RenderView::OnJavaScriptStressTestControl(int cmd, int param) { | 5799 void RenderView::OnJavaScriptStressTestControl(int cmd, int param) { |
5796 if (cmd == kJavaScriptStressTestSetStressRunType) { | 5800 if (cmd == kJavaScriptStressTestSetStressRunType) { |
5797 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param)); | 5801 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param)); |
5798 } else if (cmd == kJavaScriptStressTestPrepareStressRun) { | 5802 } else if (cmd == kJavaScriptStressTestPrepareStressRun) { |
5799 v8::Testing::PrepareStressRun(param); | 5803 v8::Testing::PrepareStressRun(param); |
5800 } | 5804 } |
5801 } | 5805 } |
OLD | NEW |