| 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_thread_impl.h" | 5 #include "content/renderer/render_thread_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #include "content/child/worker_task_runner.h" | 44 #include "content/child/worker_task_runner.h" |
| 45 #include "content/common/child_process_messages.h" | 45 #include "content/common/child_process_messages.h" |
| 46 #include "content/common/content_constants_internal.h" | 46 #include "content/common/content_constants_internal.h" |
| 47 #include "content/common/database_messages.h" | 47 #include "content/common/database_messages.h" |
| 48 #include "content/common/dom_storage/dom_storage_messages.h" | 48 #include "content/common/dom_storage/dom_storage_messages.h" |
| 49 #include "content/common/gpu/client/context_provider_command_buffer.h" | 49 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 50 #include "content/common/gpu/client/gpu_channel_host.h" | 50 #include "content/common/gpu/client/gpu_channel_host.h" |
| 51 #include "content/common/gpu/client/gpu_memory_buffer_impl.h" | 51 #include "content/common/gpu/client/gpu_memory_buffer_impl.h" |
| 52 #include "content/common/gpu/gpu_messages.h" | 52 #include "content/common/gpu/gpu_messages.h" |
| 53 #include "content/common/gpu/gpu_process_launch_causes.h" | 53 #include "content/common/gpu/gpu_process_launch_causes.h" |
| 54 #include "content/common/mojo/mojo_service_names.h" |
| 54 #include "content/common/resource_messages.h" | 55 #include "content/common/resource_messages.h" |
| 55 #include "content/common/view_messages.h" | 56 #include "content/common/view_messages.h" |
| 56 #include "content/common/worker_messages.h" | 57 #include "content/common/worker_messages.h" |
| 57 #include "content/public/common/content_constants.h" | 58 #include "content/public/common/content_constants.h" |
| 58 #include "content/public/common/content_paths.h" | 59 #include "content/public/common/content_paths.h" |
| 59 #include "content/public/common/content_switches.h" | 60 #include "content/public/common/content_switches.h" |
| 60 #include "content/public/common/renderer_preferences.h" | 61 #include "content/public/common/renderer_preferences.h" |
| 61 #include "content/public/common/url_constants.h" | 62 #include "content/public/common/url_constants.h" |
| 62 #include "content/public/renderer/content_renderer_client.h" | 63 #include "content/public/renderer/content_renderer_client.h" |
| 63 #include "content/public/renderer/render_process_observer.h" | 64 #include "content/public/renderer/render_process_observer.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 75 #include "content/renderer/media/audio_message_filter.h" | 76 #include "content/renderer/media/audio_message_filter.h" |
| 76 #include "content/renderer/media/audio_renderer_mixer_manager.h" | 77 #include "content/renderer/media/audio_renderer_mixer_manager.h" |
| 77 #include "content/renderer/media/media_stream_center.h" | 78 #include "content/renderer/media/media_stream_center.h" |
| 78 #include "content/renderer/media/media_stream_dependency_factory.h" | 79 #include "content/renderer/media/media_stream_dependency_factory.h" |
| 79 #include "content/renderer/media/midi_message_filter.h" | 80 #include "content/renderer/media/midi_message_filter.h" |
| 80 #include "content/renderer/media/peer_connection_tracker.h" | 81 #include "content/renderer/media/peer_connection_tracker.h" |
| 81 #include "content/renderer/media/renderer_gpu_video_accelerator_factories.h" | 82 #include "content/renderer/media/renderer_gpu_video_accelerator_factories.h" |
| 82 #include "content/renderer/media/video_capture_impl_manager.h" | 83 #include "content/renderer/media/video_capture_impl_manager.h" |
| 83 #include "content/renderer/media/video_capture_message_filter.h" | 84 #include "content/renderer/media/video_capture_message_filter.h" |
| 84 #include "content/renderer/media/webrtc_identity_service.h" | 85 #include "content/renderer/media/webrtc_identity_service.h" |
| 85 #include "content/renderer/mojo/mojo_render_process_observer.h" | |
| 86 #include "content/renderer/p2p/socket_dispatcher.h" | 86 #include "content/renderer/p2p/socket_dispatcher.h" |
| 87 #include "content/renderer/render_process_impl.h" | 87 #include "content/renderer/render_process_impl.h" |
| 88 #include "content/renderer/render_view_impl.h" | 88 #include "content/renderer/render_view_impl.h" |
| 89 #include "content/renderer/renderer_webkitplatformsupport_impl.h" | 89 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
| 90 #include "content/renderer/service_worker/embedded_worker_context_message_filter
.h" | 90 #include "content/renderer/service_worker/embedded_worker_context_message_filter
.h" |
| 91 #include "content/renderer/service_worker/embedded_worker_dispatcher.h" | 91 #include "content/renderer/service_worker/embedded_worker_dispatcher.h" |
| 92 #include "content/renderer/shared_worker/embedded_shared_worker_stub.h" | 92 #include "content/renderer/shared_worker/embedded_shared_worker_stub.h" |
| 93 #include "content/renderer/web_ui_setup_impl.h" |
| 93 #include "grit/content_resources.h" | 94 #include "grit/content_resources.h" |
| 94 #include "ipc/ipc_channel_handle.h" | 95 #include "ipc/ipc_channel_handle.h" |
| 95 #include "ipc/ipc_forwarding_message_filter.h" | 96 #include "ipc/ipc_forwarding_message_filter.h" |
| 96 #include "ipc/ipc_platform_file.h" | 97 #include "ipc/ipc_platform_file.h" |
| 97 #include "media/base/audio_hardware_config.h" | 98 #include "media/base/audio_hardware_config.h" |
| 98 #include "media/base/media.h" | 99 #include "media/base/media.h" |
| 99 #include "media/filters/gpu_video_accelerator_factories.h" | 100 #include "media/filters/gpu_video_accelerator_factories.h" |
| 101 #include "mojo/common/common_type_converters.h" |
| 100 #include "net/base/net_errors.h" | 102 #include "net/base/net_errors.h" |
| 101 #include "net/base/net_util.h" | 103 #include "net/base/net_util.h" |
| 102 #include "skia/ext/event_tracer_impl.h" | 104 #include "skia/ext/event_tracer_impl.h" |
| 103 #include "third_party/WebKit/public/platform/WebString.h" | 105 #include "third_party/WebKit/public/platform/WebString.h" |
| 104 #include "third_party/WebKit/public/web/WebColorName.h" | 106 #include "third_party/WebKit/public/web/WebColorName.h" |
| 105 #include "third_party/WebKit/public/web/WebDatabase.h" | 107 #include "third_party/WebKit/public/web/WebDatabase.h" |
| 106 #include "third_party/WebKit/public/web/WebDocument.h" | 108 #include "third_party/WebKit/public/web/WebDocument.h" |
| 107 #include "third_party/WebKit/public/web/WebFrame.h" | 109 #include "third_party/WebKit/public/web/WebFrame.h" |
| 108 #include "third_party/WebKit/public/web/WebImageCache.h" | 110 #include "third_party/WebKit/public/web/WebImageCache.h" |
| 109 #include "third_party/WebKit/public/web/WebKit.h" | 111 #include "third_party/WebKit/public/web/WebKit.h" |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 audio_message_filter_ = new AudioMessageFilter(GetIOMessageLoopProxy()); | 389 audio_message_filter_ = new AudioMessageFilter(GetIOMessageLoopProxy()); |
| 388 AddFilter(audio_message_filter_.get()); | 390 AddFilter(audio_message_filter_.get()); |
| 389 | 391 |
| 390 midi_message_filter_ = new MidiMessageFilter(GetIOMessageLoopProxy()); | 392 midi_message_filter_ = new MidiMessageFilter(GetIOMessageLoopProxy()); |
| 391 AddFilter(midi_message_filter_.get()); | 393 AddFilter(midi_message_filter_.get()); |
| 392 | 394 |
| 393 AddFilter((new IndexedDBMessageFilter(thread_safe_sender()))->GetFilter()); | 395 AddFilter((new IndexedDBMessageFilter(thread_safe_sender()))->GetFilter()); |
| 394 | 396 |
| 395 AddFilter((new EmbeddedWorkerContextMessageFilter())->GetFilter()); | 397 AddFilter((new EmbeddedWorkerContextMessageFilter())->GetFilter()); |
| 396 | 398 |
| 397 // MojoRenderProcessObserver deletes itself as necessary. | |
| 398 new MojoRenderProcessObserver(this); | |
| 399 | |
| 400 GetContentClient()->renderer()->RenderThreadStarted(); | 399 GetContentClient()->renderer()->RenderThreadStarted(); |
| 401 | 400 |
| 402 InitSkiaEventTracer(); | 401 InitSkiaEventTracer(); |
| 403 | 402 |
| 404 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 403 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 405 if (command_line.HasSwitch(cc::switches::kEnableGpuBenchmarking)) | 404 if (command_line.HasSwitch(cc::switches::kEnableGpuBenchmarking)) |
| 406 RegisterExtension(GpuBenchmarkingExtension::Get()); | 405 RegisterExtension(GpuBenchmarkingExtension::Get()); |
| 407 | 406 |
| 408 is_impl_side_painting_enabled_ = | 407 is_impl_side_painting_enabled_ = |
| 409 command_line.HasSwitch(switches::kEnableImplSidePainting); | 408 command_line.HasSwitch(switches::kEnableImplSidePainting); |
| (...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1195 | 1194 |
| 1196 if (!success) | 1195 if (!success) |
| 1197 return scoped_ptr<gfx::GpuMemoryBuffer>(); | 1196 return scoped_ptr<gfx::GpuMemoryBuffer>(); |
| 1198 | 1197 |
| 1199 return GpuMemoryBufferImpl::Create( | 1198 return GpuMemoryBufferImpl::Create( |
| 1200 handle, | 1199 handle, |
| 1201 gfx::Size(width, height), | 1200 gfx::Size(width, height), |
| 1202 internalformat).PassAs<gfx::GpuMemoryBuffer>(); | 1201 internalformat).PassAs<gfx::GpuMemoryBuffer>(); |
| 1203 } | 1202 } |
| 1204 | 1203 |
| 1204 void RenderThreadImpl::AcceptConnection( |
| 1205 const mojo::String& service_name, |
| 1206 mojo::ScopedMessagePipeHandle message_pipe) { |
| 1207 // TODO(darin): Invent some kind of registration system to use here. |
| 1208 if (service_name.To<base::StringPiece>() == kRendererService_WebUISetup) { |
| 1209 WebUISetupImpl::Bind(message_pipe.Pass()); |
| 1210 } else { |
| 1211 NOTREACHED() << "Unknown service name"; |
| 1212 } |
| 1213 } |
| 1214 |
| 1205 void RenderThreadImpl::DoNotSuspendWebKitSharedTimer() { | 1215 void RenderThreadImpl::DoNotSuspendWebKitSharedTimer() { |
| 1206 suspend_webkit_shared_timer_ = false; | 1216 suspend_webkit_shared_timer_ = false; |
| 1207 } | 1217 } |
| 1208 | 1218 |
| 1209 void RenderThreadImpl::DoNotNotifyWebKitOfModalLoop() { | 1219 void RenderThreadImpl::DoNotNotifyWebKitOfModalLoop() { |
| 1210 notify_webkit_of_modal_loop_ = false; | 1220 notify_webkit_of_modal_loop_ = false; |
| 1211 } | 1221 } |
| 1212 | 1222 |
| 1213 void RenderThreadImpl::OnSetZoomLevelForCurrentURL(const std::string& scheme, | 1223 void RenderThreadImpl::OnSetZoomLevelForCurrentURL(const std::string& scheme, |
| 1214 const std::string& host, | 1224 const std::string& host, |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1519 hidden_widget_count_--; | 1529 hidden_widget_count_--; |
| 1520 | 1530 |
| 1521 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { | 1531 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { |
| 1522 return; | 1532 return; |
| 1523 } | 1533 } |
| 1524 | 1534 |
| 1525 ScheduleIdleHandler(kLongIdleHandlerDelayMs); | 1535 ScheduleIdleHandler(kLongIdleHandlerDelayMs); |
| 1526 } | 1536 } |
| 1527 | 1537 |
| 1528 } // namespace content | 1538 } // namespace content |
| OLD | NEW |