| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #if defined(OS_MACOSX) | 5 #if defined(OS_MACOSX) |
| 6 #include <signal.h> | 6 #include <signal.h> |
| 7 #include <unistd.h> | 7 #include <unistd.h> |
| 8 #endif // OS_MACOSX | 8 #endif // OS_MACOSX |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 begin_process_message_ = base::TimeTicks::Now(); | 190 begin_process_message_ = base::TimeTicks::Now(); |
| 191 } | 191 } |
| 192 | 192 |
| 193 virtual void DidProcessTask(const Task* task) { | 193 virtual void DidProcessTask(const Task* task) { |
| 194 if (begin_process_message_ != base::TimeTicks()) | 194 if (begin_process_message_ != base::TimeTicks()) |
| 195 process_times_->AddTime(base::TimeTicks::Now() - begin_process_message_); | 195 process_times_->AddTime(base::TimeTicks::Now() - begin_process_message_); |
| 196 } | 196 } |
| 197 | 197 |
| 198 private: | 198 private: |
| 199 base::TimeTicks begin_process_message_; | 199 base::TimeTicks begin_process_message_; |
| 200 scoped_refptr<base::Histogram> process_times_; | 200 base::Histogram* const process_times_; |
| 201 DISALLOW_COPY_AND_ASSIGN(RendererMessageLoopObserver); | 201 DISALLOW_COPY_AND_ASSIGN(RendererMessageLoopObserver); |
| 202 }; | 202 }; |
| 203 | 203 |
| 204 // mainline routine for running as the Renderer process | 204 // mainline routine for running as the Renderer process |
| 205 int RendererMain(const MainFunctionParams& parameters) { | 205 int RendererMain(const MainFunctionParams& parameters) { |
| 206 TRACE_EVENT_BEGIN("RendererMain", 0, ""); | 206 TRACE_EVENT_BEGIN("RendererMain", 0, ""); |
| 207 | 207 |
| 208 const CommandLine& parsed_command_line = parameters.command_line_; | 208 const CommandLine& parsed_command_line = parameters.command_line_; |
| 209 base::mac::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool_; | 209 base::mac::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool_; |
| 210 | 210 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 pool->Recycle(); | 329 pool->Recycle(); |
| 330 TRACE_EVENT_BEGIN("RendererMain.START_MSG_LOOP", 0, 0); | 330 TRACE_EVENT_BEGIN("RendererMain.START_MSG_LOOP", 0, 0); |
| 331 MessageLoop::current()->Run(); | 331 MessageLoop::current()->Run(); |
| 332 TRACE_EVENT_END("RendererMain.START_MSG_LOOP", 0, 0); | 332 TRACE_EVENT_END("RendererMain.START_MSG_LOOP", 0, 0); |
| 333 } | 333 } |
| 334 } | 334 } |
| 335 platform.PlatformUninitialize(); | 335 platform.PlatformUninitialize(); |
| 336 TRACE_EVENT_END("RendererMain", 0, ""); | 336 TRACE_EVENT_END("RendererMain", 0, ""); |
| 337 return 0; | 337 return 0; |
| 338 } | 338 } |
| OLD | NEW |