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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 begin_process_message_ = base::TimeTicks::Now(); | 192 begin_process_message_ = base::TimeTicks::Now(); |
193 } | 193 } |
194 | 194 |
195 virtual void DidProcessTask(const Task* task) { | 195 virtual void DidProcessTask(const Task* task) { |
196 if (begin_process_message_ != base::TimeTicks()) | 196 if (begin_process_message_ != base::TimeTicks()) |
197 process_times_->AddTime(base::TimeTicks::Now() - begin_process_message_); | 197 process_times_->AddTime(base::TimeTicks::Now() - begin_process_message_); |
198 } | 198 } |
199 | 199 |
200 private: | 200 private: |
201 base::TimeTicks begin_process_message_; | 201 base::TimeTicks begin_process_message_; |
202 scoped_refptr<base::Histogram> process_times_; | 202 base::Histogram* const process_times_; |
203 DISALLOW_COPY_AND_ASSIGN(RendererMessageLoopObserver); | 203 DISALLOW_COPY_AND_ASSIGN(RendererMessageLoopObserver); |
204 }; | 204 }; |
205 | 205 |
206 // mainline routine for running as the Renderer process | 206 // mainline routine for running as the Renderer process |
207 int RendererMain(const MainFunctionParams& parameters) { | 207 int RendererMain(const MainFunctionParams& parameters) { |
208 TRACE_EVENT_BEGIN("RendererMain", 0, ""); | 208 TRACE_EVENT_BEGIN("RendererMain", 0, ""); |
209 | 209 |
210 const CommandLine& parsed_command_line = parameters.command_line_; | 210 const CommandLine& parsed_command_line = parameters.command_line_; |
211 base::mac::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool_; | 211 base::mac::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool_; |
212 | 212 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 pool->Recycle(); | 332 pool->Recycle(); |
333 TRACE_EVENT_BEGIN("RendererMain.START_MSG_LOOP", 0, 0); | 333 TRACE_EVENT_BEGIN("RendererMain.START_MSG_LOOP", 0, 0); |
334 MessageLoop::current()->Run(); | 334 MessageLoop::current()->Run(); |
335 TRACE_EVENT_END("RendererMain.START_MSG_LOOP", 0, 0); | 335 TRACE_EVENT_END("RendererMain.START_MSG_LOOP", 0, 0); |
336 } | 336 } |
337 } | 337 } |
338 platform.PlatformUninitialize(); | 338 platform.PlatformUninitialize(); |
339 TRACE_EVENT_END("RendererMain", 0, ""); | 339 TRACE_EVENT_END("RendererMain", 0, ""); |
340 return 0; | 340 return 0; |
341 } | 341 } |
OLD | NEW |