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 "base/base_switches.h" | 5 #include "base/base_switches.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/debug/debugger.h" | 7 #include "base/debug/debugger.h" |
8 #include "base/debug/stack_trace.h" | 8 #include "base/debug/stack_trace.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 } | 73 } |
74 | 74 |
75 // This is a simplified version of the browser Jankometer, which measures | 75 // This is a simplified version of the browser Jankometer, which measures |
76 // the processing time of tasks on the render thread. | 76 // the processing time of tasks on the render thread. |
77 class RendererMessageLoopObserver : public base::MessageLoop::TaskObserver { | 77 class RendererMessageLoopObserver : public base::MessageLoop::TaskObserver { |
78 public: | 78 public: |
79 RendererMessageLoopObserver() | 79 RendererMessageLoopObserver() |
80 : process_times_(base::Histogram::FactoryGet( | 80 : process_times_(base::Histogram::FactoryGet( |
81 "Chrome.ProcMsgL RenderThread", | 81 "Chrome.ProcMsgL RenderThread", |
82 1, 3600000, 50, base::Histogram::kUmaTargetedHistogramFlag)) {} | 82 1, 3600000, 50, base::Histogram::kUmaTargetedHistogramFlag)) {} |
83 virtual ~RendererMessageLoopObserver() {} | 83 ~RendererMessageLoopObserver() override {} |
84 | 84 |
85 virtual void WillProcessTask(const base::PendingTask& pending_task) override { | 85 void WillProcessTask(const base::PendingTask& pending_task) override { |
86 begin_process_message_ = base::TimeTicks::Now(); | 86 begin_process_message_ = base::TimeTicks::Now(); |
87 } | 87 } |
88 | 88 |
89 virtual void DidProcessTask(const base::PendingTask& pending_task) override { | 89 void DidProcessTask(const base::PendingTask& pending_task) override { |
90 if (!begin_process_message_.is_null()) | 90 if (!begin_process_message_.is_null()) |
91 process_times_->AddTime(base::TimeTicks::Now() - begin_process_message_); | 91 process_times_->AddTime(base::TimeTicks::Now() - begin_process_message_); |
92 } | 92 } |
93 | 93 |
94 private: | 94 private: |
95 base::TimeTicks begin_process_message_; | 95 base::TimeTicks begin_process_message_; |
96 base::HistogramBase* const process_times_; | 96 base::HistogramBase* const process_times_; |
97 DISALLOW_COPY_AND_ASSIGN(RendererMessageLoopObserver); | 97 DISALLOW_COPY_AND_ASSIGN(RendererMessageLoopObserver); |
98 }; | 98 }; |
99 | 99 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 base::MessageLoop::current()->Run(); | 235 base::MessageLoop::current()->Run(); |
236 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 236 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
237 } | 237 } |
238 } | 238 } |
239 platform.PlatformUninitialize(); | 239 platform.PlatformUninitialize(); |
240 TRACE_EVENT_END_ETW("RendererMain", 0, ""); | 240 TRACE_EVENT_END_ETW("RendererMain", 0, ""); |
241 return 0; | 241 return 0; |
242 } | 242 } |
243 | 243 |
244 } // namespace content | 244 } // namespace content |
OLD | NEW |