| 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> |
| 11 | 11 |
| 12 #include "base/allocator/allocator_extension.h" | 12 #include "base/allocator/allocator_extension.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/debug/trace_event.h" | 14 #include "base/debug/trace_event.h" |
| 15 #include "base/lazy_instance.h" | 15 #include "base/lazy_instance.h" |
| 16 #include "base/logging.h" | 16 #include "base/logging.h" |
| 17 #include "base/memory/discardable_memory.h" | 17 #include "base/memory/discardable_memory.h" |
| 18 #include "base/memory/shared_memory.h" | 18 #include "base/memory/shared_memory.h" |
| 19 #include "base/metrics/field_trial.h" | 19 #include "base/metrics/field_trial.h" |
| 20 #include "base/metrics/histogram.h" | 20 #include "base/metrics/histogram.h" |
| 21 #include "base/metrics/stats_table.h" | 21 #include "base/metrics/stats_table.h" |
| 22 #include "base/path_service.h" | 22 #include "base/path_service.h" |
| 23 #include "base/strings/string16.h" | 23 #include "base/strings/string16.h" |
| 24 #include "base/strings/string_number_conversions.h" | 24 #include "base/strings/string_number_conversions.h" |
| 25 #include "base/strings/string_tokenizer.h" | 25 #include "base/strings/string_tokenizer.h" |
| 26 #include "base/strings/utf_string_conversions.h" | 26 #include "base/strings/utf_string_conversions.h" |
| 27 #include "base/thread_task_runner_handle.h" |
| 27 #include "base/threading/thread_local.h" | 28 #include "base/threading/thread_local.h" |
| 28 #include "base/threading/thread_restrictions.h" | 29 #include "base/threading/thread_restrictions.h" |
| 29 #include "base/values.h" | 30 #include "base/values.h" |
| 30 #include "cc/base/switches.h" | 31 #include "cc/base/switches.h" |
| 31 #include "cc/resources/raster_worker_pool.h" | 32 #include "cc/resources/raster_worker_pool.h" |
| 32 #include "content/child/appcache/appcache_dispatcher.h" | 33 #include "content/child/appcache/appcache_dispatcher.h" |
| 33 #include "content/child/appcache/appcache_frontend_impl.h" | 34 #include "content/child/appcache/appcache_frontend_impl.h" |
| 34 #include "content/child/child_histogram_message_filter.h" | 35 #include "content/child/child_histogram_message_filter.h" |
| 35 #include "content/child/db_message_filter.h" | 36 #include "content/child/db_message_filter.h" |
| 36 #include "content/child/indexed_db/indexed_db_dispatcher.h" | 37 #include "content/child/indexed_db/indexed_db_dispatcher.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" | 89 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" |
| 89 #include "content/renderer/media/webrtc_identity_service.h" | 90 #include "content/renderer/media/webrtc_identity_service.h" |
| 90 #include "content/renderer/net_info_helper.h" | 91 #include "content/renderer/net_info_helper.h" |
| 91 #include "content/renderer/p2p/socket_dispatcher.h" | 92 #include "content/renderer/p2p/socket_dispatcher.h" |
| 92 #include "content/renderer/render_process_impl.h" | 93 #include "content/renderer/render_process_impl.h" |
| 93 #include "content/renderer/render_view_impl.h" | 94 #include "content/renderer/render_view_impl.h" |
| 94 #include "content/renderer/renderer_webkitplatformsupport_impl.h" | 95 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
| 95 #include "content/renderer/service_worker/embedded_worker_context_message_filter
.h" | 96 #include "content/renderer/service_worker/embedded_worker_context_message_filter
.h" |
| 96 #include "content/renderer/service_worker/embedded_worker_dispatcher.h" | 97 #include "content/renderer/service_worker/embedded_worker_dispatcher.h" |
| 97 #include "content/renderer/shared_worker/embedded_shared_worker_stub.h" | 98 #include "content/renderer/shared_worker/embedded_shared_worker_stub.h" |
| 99 #include "content/renderer/v8_heap_statistics_monitor.h" |
| 98 #include "grit/content_resources.h" | 100 #include "grit/content_resources.h" |
| 99 #include "ipc/ipc_channel_handle.h" | 101 #include "ipc/ipc_channel_handle.h" |
| 100 #include "ipc/ipc_forwarding_message_filter.h" | 102 #include "ipc/ipc_forwarding_message_filter.h" |
| 101 #include "ipc/ipc_platform_file.h" | 103 #include "ipc/ipc_platform_file.h" |
| 102 #include "media/base/audio_hardware_config.h" | 104 #include "media/base/audio_hardware_config.h" |
| 103 #include "media/base/media.h" | 105 #include "media/base/media.h" |
| 104 #include "media/filters/gpu_video_accelerator_factories.h" | 106 #include "media/filters/gpu_video_accelerator_factories.h" |
| 105 #include "mojo/common/common_type_converters.h" | 107 #include "mojo/common/common_type_converters.h" |
| 106 #include "net/base/net_errors.h" | 108 #include "net/base/net_errors.h" |
| 107 #include "net/base/net_util.h" | 109 #include "net/base/net_util.h" |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 void RenderThreadImpl::Init() { | 355 void RenderThreadImpl::Init() { |
| 354 TRACE_EVENT_BEGIN_ETW("RenderThreadImpl::Init", 0, ""); | 356 TRACE_EVENT_BEGIN_ETW("RenderThreadImpl::Init", 0, ""); |
| 355 | 357 |
| 356 base::debug::TraceLog::GetInstance()->SetThreadSortIndex( | 358 base::debug::TraceLog::GetInstance()->SetThreadSortIndex( |
| 357 base::PlatformThread::CurrentId(), | 359 base::PlatformThread::CurrentId(), |
| 358 kTraceEventRendererMainThreadSortIndex); | 360 kTraceEventRendererMainThreadSortIndex); |
| 359 | 361 |
| 360 v8::V8::SetCounterFunction(base::StatsTable::FindLocation); | 362 v8::V8::SetCounterFunction(base::StatsTable::FindLocation); |
| 361 v8::V8::SetCreateHistogramFunction(CreateHistogram); | 363 v8::V8::SetCreateHistogramFunction(CreateHistogram); |
| 362 v8::V8::SetAddHistogramSampleFunction(AddHistogramSample); | 364 v8::V8::SetAddHistogramSampleFunction(AddHistogramSample); |
| 365 v8_heap_statistics_monitor_.reset( |
| 366 new V8HeapStatisticsMonitor(base::ThreadTaskRunnerHandle::Get())); |
| 363 | 367 |
| 364 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 368 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
| 365 // On Mac and Android, the select popups are rendered by the browser. | 369 // On Mac and Android, the select popups are rendered by the browser. |
| 366 blink::WebView::setUseExternalPopupMenus(true); | 370 blink::WebView::setUseExternalPopupMenus(true); |
| 367 #endif | 371 #endif |
| 368 | 372 |
| 369 lazy_tls.Pointer()->Set(this); | 373 lazy_tls.Pointer()->Set(this); |
| 370 | 374 |
| 371 // Register this object as the main thread. | 375 // Register this object as the main thread. |
| 372 ChildProcess::current()->set_main_thread(this); | 376 ChildProcess::current()->set_main_thread(this); |
| (...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1565 hidden_widget_count_--; | 1569 hidden_widget_count_--; |
| 1566 | 1570 |
| 1567 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { | 1571 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { |
| 1568 return; | 1572 return; |
| 1569 } | 1573 } |
| 1570 | 1574 |
| 1571 ScheduleIdleHandler(kLongIdleHandlerDelayMs); | 1575 ScheduleIdleHandler(kLongIdleHandlerDelayMs); |
| 1572 } | 1576 } |
| 1573 | 1577 |
| 1574 } // namespace content | 1578 } // namespace content |
| OLD | NEW |