| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 #include "content/renderer/media/audio_input_message_filter.h" | 72 #include "content/renderer/media/audio_input_message_filter.h" |
| 73 #include "content/renderer/media/audio_message_filter.h" | 73 #include "content/renderer/media/audio_message_filter.h" |
| 74 #include "content/renderer/media/audio_renderer_mixer_manager.h" | 74 #include "content/renderer/media/audio_renderer_mixer_manager.h" |
| 75 #include "content/renderer/media/media_stream_center.h" | 75 #include "content/renderer/media/media_stream_center.h" |
| 76 #include "content/renderer/media/media_stream_dependency_factory.h" | 76 #include "content/renderer/media/media_stream_dependency_factory.h" |
| 77 #include "content/renderer/media/midi_message_filter.h" | 77 #include "content/renderer/media/midi_message_filter.h" |
| 78 #include "content/renderer/media/peer_connection_tracker.h" | 78 #include "content/renderer/media/peer_connection_tracker.h" |
| 79 #include "content/renderer/media/video_capture_impl_manager.h" | 79 #include "content/renderer/media/video_capture_impl_manager.h" |
| 80 #include "content/renderer/media/video_capture_message_filter.h" | 80 #include "content/renderer/media/video_capture_message_filter.h" |
| 81 #include "content/renderer/media/webrtc_identity_service.h" | 81 #include "content/renderer/media/webrtc_identity_service.h" |
| 82 #include "content/renderer/memory_benchmarking_extension.h" | |
| 83 #include "content/renderer/p2p/socket_dispatcher.h" | 82 #include "content/renderer/p2p/socket_dispatcher.h" |
| 84 #include "content/renderer/render_process_impl.h" | 83 #include "content/renderer/render_process_impl.h" |
| 85 #include "content/renderer/render_view_impl.h" | 84 #include "content/renderer/render_view_impl.h" |
| 86 #include "content/renderer/renderer_webkitplatformsupport_impl.h" | 85 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
| 87 #include "content/renderer/service_worker/embedded_worker_context_message_filter
.h" | 86 #include "content/renderer/service_worker/embedded_worker_context_message_filter
.h" |
| 88 #include "content/renderer/service_worker/embedded_worker_dispatcher.h" | 87 #include "content/renderer/service_worker/embedded_worker_dispatcher.h" |
| 89 #include "grit/content_resources.h" | 88 #include "grit/content_resources.h" |
| 90 #include "ipc/ipc_channel_handle.h" | 89 #include "ipc/ipc_channel_handle.h" |
| 91 #include "ipc/ipc_forwarding_message_filter.h" | 90 #include "ipc/ipc_forwarding_message_filter.h" |
| 92 #include "ipc/ipc_platform_file.h" | 91 #include "ipc/ipc_platform_file.h" |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 AddFilter((new IndexedDBMessageFilter(thread_safe_sender()))->GetFilter()); | 381 AddFilter((new IndexedDBMessageFilter(thread_safe_sender()))->GetFilter()); |
| 383 | 382 |
| 384 AddFilter((new EmbeddedWorkerContextMessageFilter())->GetFilter()); | 383 AddFilter((new EmbeddedWorkerContextMessageFilter())->GetFilter()); |
| 385 | 384 |
| 386 GetContentClient()->renderer()->RenderThreadStarted(); | 385 GetContentClient()->renderer()->RenderThreadStarted(); |
| 387 | 386 |
| 388 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 387 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 389 if (command_line.HasSwitch(switches::kEnableGpuBenchmarking)) | 388 if (command_line.HasSwitch(switches::kEnableGpuBenchmarking)) |
| 390 RegisterExtension(GpuBenchmarkingExtension::Get()); | 389 RegisterExtension(GpuBenchmarkingExtension::Get()); |
| 391 | 390 |
| 392 #if defined(USE_TCMALLOC) && (defined(OS_LINUX) || defined(OS_ANDROID)) | |
| 393 if (command_line.HasSwitch(switches::kEnableMemoryBenchmarking)) | |
| 394 RegisterExtension(MemoryBenchmarkingExtension::Get()); | |
| 395 #endif // USE_TCMALLOC | |
| 396 | |
| 397 // Note that under Linux, the media library will normally already have | 391 // Note that under Linux, the media library will normally already have |
| 398 // been initialized by the Zygote before this instance became a Renderer. | 392 // been initialized by the Zygote before this instance became a Renderer. |
| 399 base::FilePath media_path; | 393 base::FilePath media_path; |
| 400 PathService::Get(DIR_MEDIA_LIBS, &media_path); | 394 PathService::Get(DIR_MEDIA_LIBS, &media_path); |
| 401 if (!media_path.empty()) | 395 if (!media_path.empty()) |
| 402 media::InitializeMediaLibrary(media_path); | 396 media::InitializeMediaLibrary(media_path); |
| 403 | 397 |
| 404 memory_pressure_listener_.reset(new base::MemoryPressureListener( | 398 memory_pressure_listener_.reset(new base::MemoryPressureListener( |
| 405 base::Bind(&RenderThreadImpl::OnMemoryPressure, base::Unretained(this)))); | 399 base::Bind(&RenderThreadImpl::OnMemoryPressure, base::Unretained(this)))); |
| 406 | 400 |
| (...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1415 hidden_widget_count_--; | 1409 hidden_widget_count_--; |
| 1416 | 1410 |
| 1417 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { | 1411 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { |
| 1418 return; | 1412 return; |
| 1419 } | 1413 } |
| 1420 | 1414 |
| 1421 ScheduleIdleHandler(kLongIdleHandlerDelayMs); | 1415 ScheduleIdleHandler(kLongIdleHandlerDelayMs); |
| 1422 } | 1416 } |
| 1423 | 1417 |
| 1424 } // namespace content | 1418 } // namespace content |
| OLD | NEW |