| 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/hi_res_timer_manager.h" | 10 #include "base/hi_res_timer_manager.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 private: | 82 private: |
| 83 base::TimeTicks begin_process_message_; | 83 base::TimeTicks begin_process_message_; |
| 84 base::Histogram* const process_times_; | 84 base::Histogram* const process_times_; |
| 85 DISALLOW_COPY_AND_ASSIGN(RendererMessageLoopObserver); | 85 DISALLOW_COPY_AND_ASSIGN(RendererMessageLoopObserver); |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 // For measuring memory usage after each task. Behind a command line flag. | 88 // For measuring memory usage after each task. Behind a command line flag. |
| 89 class MemoryObserver : public MessageLoop::TaskObserver { | 89 class MemoryObserver : public MessageLoop::TaskObserver { |
| 90 public: | 90 public: |
| 91 MemoryObserver() {} | 91 MemoryObserver() {} |
| 92 virtual ~MemoryObserver() {} |
| 92 | 93 |
| 93 virtual void WillProcessTask(base::TimeTicks time_posted) OVERRIDE {} | 94 virtual void WillProcessTask(base::TimeTicks time_posted) OVERRIDE {} |
| 94 | 95 |
| 95 virtual void DidProcessTask(base::TimeTicks time_posted) OVERRIDE { | 96 virtual void DidProcessTask(base::TimeTicks time_posted) OVERRIDE { |
| 96 HISTOGRAM_MEMORY_KB("Memory.RendererUsed", webkit_glue::MemoryUsageKB()); | 97 HISTOGRAM_MEMORY_KB("Memory.RendererUsed", webkit_glue::MemoryUsageKB()); |
| 97 } | 98 } |
| 98 private: | 99 private: |
| 99 DISALLOW_COPY_AND_ASSIGN(MemoryObserver); | 100 DISALLOW_COPY_AND_ASSIGN(MemoryObserver); |
| 100 }; | 101 }; |
| 101 | 102 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 MessageLoop::current()->Run(); | 224 MessageLoop::current()->Run(); |
| 224 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 225 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
| 225 } | 226 } |
| 226 } | 227 } |
| 227 platform.PlatformUninitialize(); | 228 platform.PlatformUninitialize(); |
| 228 TRACE_EVENT_END_ETW("RendererMain", 0, ""); | 229 TRACE_EVENT_END_ETW("RendererMain", 0, ""); |
| 229 return 0; | 230 return 0; |
| 230 } | 231 } |
| 231 | 232 |
| 232 } // namespace content | 233 } // namespace content |
| OLD | NEW |