| 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 #include "chrome/renderer/benchmarking_extension.h" | 5 #include "chrome/renderer/benchmarking_extension.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/stats_table.h" | 8 #include "base/metrics/stats_table.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "content/public/common/content_switches.h" | 10 #include "content/public/common/content_switches.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 args.GetReturnValue().Set(static_cast<int32_t>(counter)); | 112 args.GetReturnValue().Set(static_cast<int32_t>(counter)); |
| 113 } | 113 } |
| 114 | 114 |
| 115 static void IsSingleProcess(const v8::FunctionCallbackInfo<v8::Value>& args) { | 115 static void IsSingleProcess(const v8::FunctionCallbackInfo<v8::Value>& args) { |
| 116 args.GetReturnValue().Set(base::CommandLine::ForCurrentProcess()->HasSwitch( | 116 args.GetReturnValue().Set(base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 117 switches::kSingleProcess)); | 117 switches::kSingleProcess)); |
| 118 } | 118 } |
| 119 | 119 |
| 120 static void HiResTime(const v8::FunctionCallbackInfo<v8::Value>& args) { | 120 static void HiResTime(const v8::FunctionCallbackInfo<v8::Value>& args) { |
| 121 args.GetReturnValue().Set( | 121 args.GetReturnValue().Set( |
| 122 static_cast<double>(base::TimeTicks::HighResNow().ToInternalValue())); | 122 static_cast<double>(base::TimeTicks::Now().ToInternalValue())); |
| 123 } | 123 } |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 v8::Extension* BenchmarkingExtension::Get() { | 126 v8::Extension* BenchmarkingExtension::Get() { |
| 127 return new BenchmarkingWrapper(); | 127 return new BenchmarkingWrapper(); |
| 128 } | 128 } |
| 129 | 129 |
| 130 } // namespace extensions_v8 | 130 } // namespace extensions_v8 |
| OLD | NEW |