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

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

Issue 2566043004: Add renderer memory metrics (Closed)
Patch Set: Added RendererMemoryAllocator suffix Created 3 years, 11 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 3937 matching lines...) Expand 10 before | Expand all | Expand 10 after
3948 TRACE_EVENT_SCOPE_PROCESS); 3948 TRACE_EVENT_SCOPE_PROCESS);
3949 } 3949 }
3950 3950
3951 for (auto& observer : render_view_->observers()) 3951 for (auto& observer : render_view_->observers())
3952 observer.DidFinishLoad(frame); 3952 observer.DidFinishLoad(frame);
3953 for (auto& observer : observers_) 3953 for (auto& observer : observers_)
3954 observer.DidFinishLoad(); 3954 observer.DidFinishLoad();
3955 3955
3956 WebDataSource* ds = frame->dataSource(); 3956 WebDataSource* ds = frame->dataSource();
3957 Send(new FrameHostMsg_DidFinishLoad(routing_id_, ds->getRequest().url())); 3957 Send(new FrameHostMsg_DidFinishLoad(routing_id_, ds->getRequest().url()));
3958
3959 {
3960 RenderThreadImpl::RendererMemoryMetrics memory_metrics;
3961 RenderThreadImpl::current()->GetRendererMemoryMetrics(&memory_metrics);
3962 UMA_HISTOGRAM_MEMORY_MB(
3963 "Memory.Experimental.Renderer.PartitionAlloc_DidFinishLoad",
3964 memory_metrics.partition_alloc_kb / 1024);
3965 UMA_HISTOGRAM_MEMORY_MB(
3966 "Memory.Experimental.Renderer.BlinkGC_DidFinishLoad",
3967 memory_metrics.blink_gc_kb / 1024);
3968 UMA_HISTOGRAM_MEMORY_MB(
3969 "Memory.Experimental.Renderer.Malloc_DidFinishLoad",
3970 memory_metrics.malloc_mb);
3971 UMA_HISTOGRAM_MEMORY_MB(
3972 "Memory.Experimental.Renderer.Discardable_DidFinishLoad",
3973 memory_metrics.discardable_kb / 1024);
3974 UMA_HISTOGRAM_MEMORY_MB(
3975 "Memory.Experimental.Renderer.V8MainThreadIsolate_DidFinishLoad",
3976 memory_metrics.v8_main_thread_isolate_mb);
3977 UMA_HISTOGRAM_MEMORY_MB(
3978 "Memory.Experimental.Renderer.TotalAllocated_DidFinishLoad",
3979 memory_metrics.total_allocated_mb);
3980 UMA_HISTOGRAM_MEMORY_MB(
3981 "Memory.Experimental.Renderer.NonDiscardableTotalAllocated_"
3982 "DidFinishLoad",
3983 memory_metrics.non_discardable_total_allocated_mb);
3984 UMA_HISTOGRAM_MEMORY_MB(
3985 "Memory.Experimental.Renderer.TotalAllocatedPerRenderView_"
3986 "DidFinishLoad",
3987 memory_metrics.total_allocated_per_render_view_mb);
3988 if (IsMainFrame()) {
3989 UMA_HISTOGRAM_MEMORY_MB(
3990 "Memory.Experimental.Renderer.PartitionAlloc_"
3991 "MainFrameDidFinishLoad",
3992 memory_metrics.partition_alloc_kb / 1024);
3993 UMA_HISTOGRAM_MEMORY_MB(
3994 "Memory.Experimental.Renderer.BlinkGC_MainFrameDidFinishLoad",
3995 memory_metrics.blink_gc_kb / 1024);
3996 UMA_HISTOGRAM_MEMORY_MB(
3997 "Memory.Experimental.Renderer.Malloc_MainFrameDidFinishLoad",
3998 memory_metrics.malloc_mb);
3999 UMA_HISTOGRAM_MEMORY_MB(
4000 "Memory.Experimental.Renderer.Discardable_MainFrameDidFinishLoad",
4001 memory_metrics.discardable_kb / 1024);
4002 UMA_HISTOGRAM_MEMORY_MB(
4003 "Memory.Experimental.Renderer.V8MainThreadIsolate_"
4004 "MainFrameDidFinishLoad",
4005 memory_metrics.v8_main_thread_isolate_mb);
4006 UMA_HISTOGRAM_MEMORY_MB(
4007 "Memory.Experimental.Renderer.TotalAllocated_"
4008 "MainFrameDidFinishLoad",
4009 memory_metrics.total_allocated_mb);
4010 UMA_HISTOGRAM_MEMORY_MB(
4011 "Memory.Experimental.Renderer.NonDiscardableTotalAllocated_"
4012 "MainFrameDidFinishLoad",
4013 memory_metrics.non_discardable_total_allocated_mb);
4014 UMA_HISTOGRAM_MEMORY_MB(
4015 "Memory.Experimental.Renderer.TotalAllocatedPerRenderView_"
4016 "MainFrameDidFinishLoad",
4017 memory_metrics.total_allocated_per_render_view_mb);
4018 }
4019 }
3958 } 4020 }
3959 4021
3960 void RenderFrameImpl::didNavigateWithinPage( 4022 void RenderFrameImpl::didNavigateWithinPage(
3961 blink::WebLocalFrame* frame, 4023 blink::WebLocalFrame* frame,
3962 const blink::WebHistoryItem& item, 4024 const blink::WebHistoryItem& item,
3963 blink::WebHistoryCommitType commit_type, 4025 blink::WebHistoryCommitType commit_type,
3964 bool content_initiated) { 4026 bool content_initiated) {
3965 TRACE_EVENT1("navigation,rail", "RenderFrameImpl::didNavigateWithinPage", 4027 TRACE_EVENT1("navigation,rail", "RenderFrameImpl::didNavigateWithinPage",
3966 "id", routing_id_); 4028 "id", routing_id_);
3967 DCHECK_EQ(frame_, frame); 4029 DCHECK_EQ(frame_, frame);
(...skipping 2827 matching lines...) Expand 10 before | Expand all | Expand 10 after
6795 // event target. Potentially a Pepper plugin will receive the event. 6857 // event target. Potentially a Pepper plugin will receive the event.
6796 // In order to tell whether a plugin gets the last mouse event and which it 6858 // In order to tell whether a plugin gets the last mouse event and which it
6797 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6859 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6798 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6860 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6799 // |pepper_last_mouse_event_target_|. 6861 // |pepper_last_mouse_event_target_|.
6800 pepper_last_mouse_event_target_ = nullptr; 6862 pepper_last_mouse_event_target_ = nullptr;
6801 #endif 6863 #endif
6802 } 6864 }
6803 6865
6804 } // namespace content 6866 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/render_thread_impl.h » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698