| 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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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)) | 391 #if defined(USE_TCMALLOC) && (defined(OS_LINUX) || defined(OS_ANDROID)) |
| 393 if (command_line.HasSwitch(switches::kEnableMemoryBenchmarking)) | 392 if (command_line.HasSwitch(switches::kEnableMemoryBenchmarking)) |
| 394 RegisterExtension(MemoryBenchmarkingExtension::Get()); | 393 RegisterExtension(MemoryBenchmarkingExtension::Get()); |
| 395 #endif // USE_TCMALLOC | 394 #endif // USE_TCMALLOC |
| 396 | 395 |
| 397 if (command_line.HasSwitch(switches::kEnableSkiaBenchmarking)) { | |
| 398 LOG(WARNING) << "Enabling unsafe Skia benchmarking extension."; | |
| 399 RegisterExtension(SkiaBenchmarkingExtension::Get()); | |
| 400 } | |
| 401 | |
| 402 // Note that under Linux, the media library will normally already have | 396 // Note that under Linux, the media library will normally already have |
| 403 // been initialized by the Zygote before this instance became a Renderer. | 397 // been initialized by the Zygote before this instance became a Renderer. |
| 404 base::FilePath media_path; | 398 base::FilePath media_path; |
| 405 PathService::Get(DIR_MEDIA_LIBS, &media_path); | 399 PathService::Get(DIR_MEDIA_LIBS, &media_path); |
| 406 if (!media_path.empty()) | 400 if (!media_path.empty()) |
| 407 media::InitializeMediaLibrary(media_path); | 401 media::InitializeMediaLibrary(media_path); |
| 408 | 402 |
| 409 memory_pressure_listener_.reset(new base::MemoryPressureListener( | 403 memory_pressure_listener_.reset(new base::MemoryPressureListener( |
| 410 base::Bind(&RenderThreadImpl::OnMemoryPressure, base::Unretained(this)))); | 404 base::Bind(&RenderThreadImpl::OnMemoryPressure, base::Unretained(this)))); |
| 411 | 405 |
| (...skipping 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1419 hidden_widget_count_--; | 1413 hidden_widget_count_--; |
| 1420 | 1414 |
| 1421 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { | 1415 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { |
| 1422 return; | 1416 return; |
| 1423 } | 1417 } |
| 1424 | 1418 |
| 1425 ScheduleIdleHandler(kLongIdleHandlerDelayMs); | 1419 ScheduleIdleHandler(kLongIdleHandlerDelayMs); |
| 1426 } | 1420 } |
| 1427 | 1421 |
| 1428 } // namespace content | 1422 } // namespace content |
| OLD | NEW |