Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 196103006: Add V8 heap statistics in a time-line manner in tracing. (Closed) Base URL: /home/dmikurube/repos/chromium@work-sai-json
Patch Set: addressed Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/render_thread_impl.h ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/content_child_helpers.h" 36 #include "content/child/content_child_helpers.h"
36 #include "content/child/db_message_filter.h" 37 #include "content/child/db_message_filter.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" 90 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h"
90 #include "content/renderer/media/webrtc_identity_service.h" 91 #include "content/renderer/media/webrtc_identity_service.h"
91 #include "content/renderer/net_info_helper.h" 92 #include "content/renderer/net_info_helper.h"
92 #include "content/renderer/p2p/socket_dispatcher.h" 93 #include "content/renderer/p2p/socket_dispatcher.h"
93 #include "content/renderer/render_process_impl.h" 94 #include "content/renderer/render_process_impl.h"
94 #include "content/renderer/render_view_impl.h" 95 #include "content/renderer/render_view_impl.h"
95 #include "content/renderer/renderer_webkitplatformsupport_impl.h" 96 #include "content/renderer/renderer_webkitplatformsupport_impl.h"
96 #include "content/renderer/service_worker/embedded_worker_context_message_filter .h" 97 #include "content/renderer/service_worker/embedded_worker_context_message_filter .h"
97 #include "content/renderer/service_worker/embedded_worker_dispatcher.h" 98 #include "content/renderer/service_worker/embedded_worker_dispatcher.h"
98 #include "content/renderer/shared_worker/embedded_shared_worker_stub.h" 99 #include "content/renderer/shared_worker/embedded_shared_worker_stub.h"
100 #include "content/renderer/v8_heap_statistics_monitor.h"
99 #include "grit/content_resources.h" 101 #include "grit/content_resources.h"
100 #include "ipc/ipc_channel_handle.h" 102 #include "ipc/ipc_channel_handle.h"
101 #include "ipc/ipc_forwarding_message_filter.h" 103 #include "ipc/ipc_forwarding_message_filter.h"
102 #include "ipc/ipc_platform_file.h" 104 #include "ipc/ipc_platform_file.h"
103 #include "media/base/audio_hardware_config.h" 105 #include "media/base/audio_hardware_config.h"
104 #include "media/base/media.h" 106 #include "media/base/media.h"
105 #include "media/filters/gpu_video_accelerator_factories.h" 107 #include "media/filters/gpu_video_accelerator_factories.h"
106 #include "mojo/common/common_type_converters.h" 108 #include "mojo/common/common_type_converters.h"
107 #include "net/base/net_errors.h" 109 #include "net/base/net_errors.h"
108 #include "net/base/net_util.h" 110 #include "net/base/net_util.h"
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 Init(); 370 Init();
369 } 371 }
370 372
371 void RenderThreadImpl::Init() { 373 void RenderThreadImpl::Init() {
372 TRACE_EVENT_BEGIN_ETW("RenderThreadImpl::Init", 0, ""); 374 TRACE_EVENT_BEGIN_ETW("RenderThreadImpl::Init", 0, "");
373 375
374 base::debug::TraceLog::GetInstance()->SetThreadSortIndex( 376 base::debug::TraceLog::GetInstance()->SetThreadSortIndex(
375 base::PlatformThread::CurrentId(), 377 base::PlatformThread::CurrentId(),
376 kTraceEventRendererMainThreadSortIndex); 378 kTraceEventRendererMainThreadSortIndex);
377 379
380 v8_heap_statistics_monitor_.reset(
381 new V8HeapStatisticsMonitor(base::ThreadTaskRunnerHandle::Get()));
382
378 #if defined(OS_MACOSX) || defined(OS_ANDROID) 383 #if defined(OS_MACOSX) || defined(OS_ANDROID)
379 // On Mac and Android, the select popups are rendered by the browser. 384 // On Mac and Android, the select popups are rendered by the browser.
380 blink::WebView::setUseExternalPopupMenus(true); 385 blink::WebView::setUseExternalPopupMenus(true);
381 #endif 386 #endif
382 387
383 lazy_tls.Pointer()->Set(this); 388 lazy_tls.Pointer()->Set(this);
384 389
385 // Register this object as the main thread. 390 // Register this object as the main thread.
386 ChildProcess::current()->set_main_thread(this); 391 ChildProcess::current()->set_main_thread(this);
387 392
(...skipping 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after
1608 hidden_widget_count_--; 1613 hidden_widget_count_--;
1609 1614
1610 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { 1615 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) {
1611 return; 1616 return;
1612 } 1617 }
1613 1618
1614 ScheduleIdleHandler(kLongIdleHandlerDelayMs); 1619 ScheduleIdleHandler(kLongIdleHandlerDelayMs);
1615 } 1620 }
1616 1621
1617 } // namespace content 1622 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_thread_impl.h ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698