| OLD | NEW | 
|     1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |     1 // Copyright (c) 2012 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 "content/renderer/render_view_impl.h" |     5 #include "content/renderer/render_view_impl.h" | 
|     6  |     6  | 
|     7 #include <algorithm> |     7 #include <algorithm> | 
|     8 #include <cmath> |     8 #include <cmath> | 
|     9  |     9  | 
|    10 #include "base/bind.h" |    10 #include "base/bind.h" | 
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   108 #include "content/renderer/speech_recognition_dispatcher.h" |   108 #include "content/renderer/speech_recognition_dispatcher.h" | 
|   109 #include "content/renderer/text_input_client_observer.h" |   109 #include "content/renderer/text_input_client_observer.h" | 
|   110 #include "content/renderer/v8_value_converter_impl.h" |   110 #include "content/renderer/v8_value_converter_impl.h" | 
|   111 #include "content/renderer/web_intents_host.h" |   111 #include "content/renderer/web_intents_host.h" | 
|   112 #include "content/renderer/web_ui_extension.h" |   112 #include "content/renderer/web_ui_extension.h" | 
|   113 #include "content/renderer/web_ui_extension_data.h" |   113 #include "content/renderer/web_ui_extension_data.h" | 
|   114 #include "content/renderer/webplugin_delegate_proxy.h" |   114 #include "content/renderer/webplugin_delegate_proxy.h" | 
|   115 #include "content/renderer/websharedworker_proxy.h" |   115 #include "content/renderer/websharedworker_proxy.h" | 
|   116 #include "media/base/filter_collection.h" |   116 #include "media/base/filter_collection.h" | 
|   117 #include "media/base/media_switches.h" |   117 #include "media/base/media_switches.h" | 
|   118 #include "media/base/message_loop_factory.h" |  | 
|   119 #include "media/filters/audio_renderer_impl.h" |   118 #include "media/filters/audio_renderer_impl.h" | 
|   120 #include "media/filters/gpu_video_decoder.h" |   119 #include "media/filters/gpu_video_decoder.h" | 
|   121 #include "net/base/data_url.h" |   120 #include "net/base/data_url.h" | 
|   122 #include "net/base/escape.h" |   121 #include "net/base/escape.h" | 
|   123 #include "net/base/net_errors.h" |   122 #include "net/base/net_errors.h" | 
|   124 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |   123 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 
|   125 #include "net/http/http_util.h" |   124 #include "net/http/http_util.h" | 
|   126 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObjec
      t.h" |   125 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObjec
      t.h" | 
|   127 #include "third_party/WebKit/Source/WebKit/chromium/public/WebColorName.h" |   126 #include "third_party/WebKit/Source/WebKit/chromium/public/WebColorName.h" | 
|   128 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMEvent.h" |   127 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMEvent.h" | 
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   195 #include "webkit/glue/dom_operations.h" |   194 #include "webkit/glue/dom_operations.h" | 
|   196 #include "webkit/glue/glue_serialize.h" |   195 #include "webkit/glue/glue_serialize.h" | 
|   197 #include "webkit/glue/web_intent_service_data.h" |   196 #include "webkit/glue/web_intent_service_data.h" | 
|   198 #include "webkit/glue/webdropdata.h" |   197 #include "webkit/glue/webdropdata.h" | 
|   199 #include "webkit/glue/webkit_constants.h" |   198 #include "webkit/glue/webkit_constants.h" | 
|   200 #include "webkit/glue/webkit_glue.h" |   199 #include "webkit/glue/webkit_glue.h" | 
|   201 #include "webkit/glue/weburlresponse_extradata_impl.h" |   200 #include "webkit/glue/weburlresponse_extradata_impl.h" | 
|   202 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" |   201 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" | 
|   203 #include "webkit/media/webmediaplayer_impl.h" |   202 #include "webkit/media/webmediaplayer_impl.h" | 
|   204 #include "webkit/media/webmediaplayer_ms.h" |   203 #include "webkit/media/webmediaplayer_ms.h" | 
 |   204 #include "webkit/media/webmediaplayer_params.h" | 
|   205 #include "webkit/plugins/npapi/plugin_list.h" |   205 #include "webkit/plugins/npapi/plugin_list.h" | 
|   206 #include "webkit/plugins/npapi/plugin_utils.h" |   206 #include "webkit/plugins/npapi/plugin_utils.h" | 
|   207 #include "webkit/plugins/npapi/webplugin_delegate.h" |   207 #include "webkit/plugins/npapi/webplugin_delegate.h" | 
|   208 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" |   208 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" | 
|   209 #include "webkit/plugins/npapi/webplugin_impl.h" |   209 #include "webkit/plugins/npapi/webplugin_impl.h" | 
|   210  |   210  | 
|   211 #if defined(OS_ANDROID) |   211 #if defined(OS_ANDROID) | 
|   212 #include "content/common/android/device_info.h" |   212 #include "content/common/android/device_info.h" | 
|   213 #include "content/renderer/android/address_detector.h" |   213 #include "content/renderer/android/address_detector.h" | 
|   214 #include "content/renderer/android/content_detector.h" |   214 #include "content/renderer/android/content_detector.h" | 
| (...skipping 2393 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  2608   } |  2608   } | 
|  2609   return new webkit_media::WebMediaPlayerImplAndroid( |  2609   return new webkit_media::WebMediaPlayerImplAndroid( | 
|  2610       frame, |  2610       frame, | 
|  2611       client, |  2611       client, | 
|  2612       media_player_manager_.get(), |  2612       media_player_manager_.get(), | 
|  2613       media_player_proxy_, |  2613       media_player_proxy_, | 
|  2614       new StreamTextureFactoryImpl( |  2614       new StreamTextureFactoryImpl( | 
|  2615           resource_context, gpu_channel_host, routing_id_)); |  2615           resource_context, gpu_channel_host, routing_id_)); | 
|  2616 #endif |  2616 #endif | 
|  2617  |  2617  | 
|  2618   media::MessageLoopFactory* message_loop_factory = |  | 
|  2619       new media::MessageLoopFactory(); |  | 
|  2620   media::FilterCollection* collection = new media::FilterCollection(); |  | 
|  2621   RenderMediaLog* render_media_log = new RenderMediaLog(); |  2618   RenderMediaLog* render_media_log = new RenderMediaLog(); | 
|  2622  |  2619  | 
|  2623   RenderAudioSourceProvider* audio_source_provider = NULL; |  2620   RenderAudioSourceProvider* audio_source_provider = NULL; | 
|  2624  |  2621  | 
|  2625   // |audio_source_provider| "provides" audio to WebKit and is a sink from the |  2622   // |audio_source_provider| "provides" audio to WebKit and is a sink from the | 
|  2626   // perspective of the audio renderer. |  2623   // perspective of the audio renderer. | 
|  2627   if (!cmd_line->HasSwitch(switches::kDisableAudio)) { |  2624   if (!cmd_line->HasSwitch(switches::kDisableAudio)) { | 
|  2628     audio_source_provider = new RenderAudioSourceProvider(routing_id_); |  2625     audio_source_provider = new RenderAudioSourceProvider(routing_id_); | 
|  2629   } |  2626   } | 
|  2630  |  2627  | 
 |  2628   scoped_refptr<media::GpuVideoDecoder::Factories> gpu_factories; | 
|  2631   WebGraphicsContext3DCommandBufferImpl* context3d = NULL; |  2629   WebGraphicsContext3DCommandBufferImpl* context3d = NULL; | 
|  2632   if (!cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) |  2630   if (!cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) | 
|  2633     context3d = RenderThreadImpl::current()->GetGpuVDAContext3D(); |  2631     context3d = RenderThreadImpl::current()->GetGpuVDAContext3D(); | 
|  2634   if (context3d) { |  2632   if (context3d) { | 
|  2635     scoped_refptr<base::MessageLoopProxy> factories_loop = |  2633     scoped_refptr<base::MessageLoopProxy> factories_loop = | 
|  2636         RenderThreadImpl::current()->compositor_thread() ? |  2634         RenderThreadImpl::current()->compositor_thread() ? | 
|  2637         RenderThreadImpl::current()->compositor_thread()->GetWebThread() |  2635         RenderThreadImpl::current()->compositor_thread()->GetWebThread() | 
|  2638             ->message_loop()->message_loop_proxy() : |  2636             ->message_loop()->message_loop_proxy() : | 
|  2639         base::MessageLoopProxy::current(); |  2637         base::MessageLoopProxy::current(); | 
|  2640     GpuChannelHost* gpu_channel_host = |  2638     GpuChannelHost* gpu_channel_host = | 
|  2641         RenderThreadImpl::current()->EstablishGpuChannelSync( |  2639         RenderThreadImpl::current()->EstablishGpuChannelSync( | 
|  2642             CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); |  2640             CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); | 
|  2643     collection->GetVideoDecoders()->push_back(new media::GpuVideoDecoder( |  2641     gpu_factories = new RendererGpuVideoDecoderFactories( | 
|  2644         message_loop_factory->GetMessageLoop( |  2642         gpu_channel_host, factories_loop, context3d); | 
|  2645             media::MessageLoopFactory::kPipeline), |  | 
|  2646         factories_loop, |  | 
|  2647         new RendererGpuVideoDecoderFactories( |  | 
|  2648             gpu_channel_host, factories_loop, context3d))); |  | 
|  2649   } |  2643   } | 
|  2650  |  2644  | 
 |  2645   webkit_media::WebMediaPlayerParams params( | 
 |  2646       audio_source_provider, audio_source_provider, gpu_factories, | 
 |  2647       media_stream_impl_, render_media_log); | 
|  2651   WebMediaPlayer* media_player = |  2648   WebMediaPlayer* media_player = | 
|  2652       GetContentClient()->renderer()->OverrideCreateWebMediaPlayer( |  2649       GetContentClient()->renderer()->OverrideCreateWebMediaPlayer( | 
|  2653           this, frame, client, AsWeakPtr(), collection, audio_source_provider, |  2650           this, frame, client, AsWeakPtr(), params); | 
|  2654           audio_source_provider, message_loop_factory, media_stream_impl_, |  | 
|  2655           render_media_log); |  | 
|  2656   if (!media_player) { |  2651   if (!media_player) { | 
|  2657     media_player = new webkit_media::WebMediaPlayerImpl( |  2652     media_player = new webkit_media::WebMediaPlayerImpl( | 
|  2658         frame, client, AsWeakPtr(), collection, audio_source_provider, |  2653         frame, client, AsWeakPtr(), params); | 
|  2659         audio_source_provider, message_loop_factory, media_stream_impl_, |  | 
|  2660         render_media_log); |  | 
|  2661   } |  2654   } | 
|  2662   return media_player; |  2655   return media_player; | 
|  2663 } |  2656 } | 
|  2664  |  2657  | 
|  2665 WebApplicationCacheHost* RenderViewImpl::createApplicationCacheHost( |  2658 WebApplicationCacheHost* RenderViewImpl::createApplicationCacheHost( | 
|  2666     WebFrame* frame, WebApplicationCacheHostClient* client) { |  2659     WebFrame* frame, WebApplicationCacheHostClient* client) { | 
|  2667   if (!frame || !frame->view()) |  2660   if (!frame || !frame->view()) | 
|  2668     return NULL; |  2661     return NULL; | 
|  2669   return new RendererWebApplicationCacheHostImpl( |  2662   return new RendererWebApplicationCacheHostImpl( | 
|  2670       FromWebView(frame->view()), client, |  2663       FromWebView(frame->view()), client, | 
| (...skipping 3842 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  6513 } |  6506 } | 
|  6514 #endif |  6507 #endif | 
|  6515  |  6508  | 
|  6516 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( |  6509 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( | 
|  6517     TransportDIB::Handle dib_handle) { |  6510     TransportDIB::Handle dib_handle) { | 
|  6518   TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); |  6511   TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); | 
|  6519   RenderProcess::current()->ReleaseTransportDIB(dib); |  6512   RenderProcess::current()->ReleaseTransportDIB(dib); | 
|  6520 } |  6513 } | 
|  6521  |  6514  | 
|  6522 }  // namespace content |  6515 }  // namespace content | 
| OLD | NEW |