| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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" | 82 #include "content/renderer/memory_benchmarking_extension.h" |
| 83 #include "content/renderer/p2p/socket_dispatcher.h" | 83 #include "content/renderer/p2p/socket_dispatcher.h" |
| 84 #include "content/renderer/render_process_impl.h" | 84 #include "content/renderer/render_process_impl.h" |
| 85 #include "content/renderer/render_view_impl.h" | 85 #include "content/renderer/render_view_impl.h" |
| 86 #include "content/renderer/renderer_webkitplatformsupport_impl.h" | 86 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
| 87 #include "content/renderer/service_worker/embedded_worker_context_message_filter
.h" | 87 #include "content/renderer/service_worker/embedded_worker_context_message_filter
.h" |
| 88 #include "content/renderer/service_worker/embedded_worker_dispatcher.h" | 88 #include "content/renderer/service_worker/embedded_worker_dispatcher.h" |
| 89 #include "content/renderer/skia_benchmarking_extension.h" | |
| 90 #include "grit/content_resources.h" | 89 #include "grit/content_resources.h" |
| 91 #include "ipc/ipc_channel_handle.h" | 90 #include "ipc/ipc_channel_handle.h" |
| 92 #include "ipc/ipc_forwarding_message_filter.h" | 91 #include "ipc/ipc_forwarding_message_filter.h" |
| 93 #include "ipc/ipc_platform_file.h" | 92 #include "ipc/ipc_platform_file.h" |
| 94 #include "media/base/audio_hardware_config.h" | 93 #include "media/base/audio_hardware_config.h" |
| 95 #include "media/base/media.h" | 94 #include "media/base/media.h" |
| 96 #include "media/filters/gpu_video_accelerator_factories.h" | 95 #include "media/filters/gpu_video_accelerator_factories.h" |
| 97 #include "net/base/net_errors.h" | 96 #include "net/base/net_errors.h" |
| 98 #include "net/base/net_util.h" | 97 #include "net/base/net_util.h" |
| 99 #include "third_party/WebKit/public/platform/WebString.h" | 98 #include "third_party/WebKit/public/platform/WebString.h" |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 | 387 |
| 389 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 388 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 390 if (command_line.HasSwitch(switches::kEnableGpuBenchmarking)) | 389 if (command_line.HasSwitch(switches::kEnableGpuBenchmarking)) |
| 391 RegisterExtension(GpuBenchmarkingExtension::Get()); | 390 RegisterExtension(GpuBenchmarkingExtension::Get()); |
| 392 | 391 |
| 393 #if defined(USE_TCMALLOC) && (defined(OS_LINUX) || defined(OS_ANDROID)) | 392 #if defined(USE_TCMALLOC) && (defined(OS_LINUX) || defined(OS_ANDROID)) |
| 394 if (command_line.HasSwitch(switches::kEnableMemoryBenchmarking)) | 393 if (command_line.HasSwitch(switches::kEnableMemoryBenchmarking)) |
| 395 RegisterExtension(MemoryBenchmarkingExtension::Get()); | 394 RegisterExtension(MemoryBenchmarkingExtension::Get()); |
| 396 #endif // USE_TCMALLOC | 395 #endif // USE_TCMALLOC |
| 397 | 396 |
| 398 if (command_line.HasSwitch(switches::kEnableSkiaBenchmarking)) { | |
| 399 LOG(WARNING) << "Enabling unsafe Skia benchmarking extension."; | |
| 400 RegisterExtension(SkiaBenchmarkingExtension::Get()); | |
| 401 } | |
| 402 | |
| 403 // Note that under Linux, the media library will normally already have | 397 // Note that under Linux, the media library will normally already have |
| 404 // been initialized by the Zygote before this instance became a Renderer. | 398 // been initialized by the Zygote before this instance became a Renderer. |
| 405 base::FilePath media_path; | 399 base::FilePath media_path; |
| 406 PathService::Get(DIR_MEDIA_LIBS, &media_path); | 400 PathService::Get(DIR_MEDIA_LIBS, &media_path); |
| 407 if (!media_path.empty()) | 401 if (!media_path.empty()) |
| 408 media::InitializeMediaLibrary(media_path); | 402 media::InitializeMediaLibrary(media_path); |
| 409 | 403 |
| 410 memory_pressure_listener_.reset(new base::MemoryPressureListener( | 404 memory_pressure_listener_.reset(new base::MemoryPressureListener( |
| 411 base::Bind(&RenderThreadImpl::OnMemoryPressure, base::Unretained(this)))); | 405 base::Bind(&RenderThreadImpl::OnMemoryPressure, base::Unretained(this)))); |
| 412 | 406 |
| (...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1421 hidden_widget_count_--; | 1415 hidden_widget_count_--; |
| 1422 | 1416 |
| 1423 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { | 1417 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { |
| 1424 return; | 1418 return; |
| 1425 } | 1419 } |
| 1426 | 1420 |
| 1427 ScheduleIdleHandler(kLongIdleHandlerDelayMs); | 1421 ScheduleIdleHandler(kLongIdleHandlerDelayMs); |
| 1428 } | 1422 } |
| 1429 | 1423 |
| 1430 } // namespace content | 1424 } // namespace content |
| OLD | NEW |