| 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 "content/renderer/gpu/gpu_benchmarking_extension.h" | 5 #include "content/renderer/gpu/gpu_benchmarking_extension.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 v8::Number::New(isolate, value)); | 115 v8::Number::New(isolate, value)); |
| 116 } | 116 } |
| 117 | 117 |
| 118 virtual void AddDouble(const char* name, double value) OVERRIDE { | 118 virtual void AddDouble(const char* name, double value) OVERRIDE { |
| 119 stats_object->Set(v8::String::NewFromUtf8(isolate, name), | 119 stats_object->Set(v8::String::NewFromUtf8(isolate, name), |
| 120 v8::Number::New(isolate, value)); | 120 v8::Number::New(isolate, value)); |
| 121 } | 121 } |
| 122 | 122 |
| 123 virtual void AddInt(const char* name, int value) OVERRIDE { | 123 virtual void AddInt(const char* name, int value) OVERRIDE { |
| 124 stats_object->Set(v8::String::NewFromUtf8(isolate, name), | 124 stats_object->Set(v8::String::NewFromUtf8(isolate, name), |
| 125 v8::Integer::New(value)); | 125 v8::Integer::New(isolate, value)); |
| 126 } | 126 } |
| 127 | 127 |
| 128 virtual void AddTimeDeltaInSecondsF(const char* name, | 128 virtual void AddTimeDeltaInSecondsF(const char* name, |
| 129 const base::TimeDelta& value) OVERRIDE { | 129 const base::TimeDelta& value) OVERRIDE { |
| 130 stats_object->Set(v8::String::NewFromUtf8(isolate, name), | 130 stats_object->Set(v8::String::NewFromUtf8(isolate, name), |
| 131 v8::Number::New(isolate, value.InSecondsF())); | 131 v8::Number::New(isolate, value.InSecondsF())); |
| 132 } | 132 } |
| 133 | 133 |
| 134 private: | 134 private: |
| 135 v8::Isolate* isolate; | 135 v8::Isolate* isolate; |
| (...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 GpuChannelHost* gpu_channel = RenderThreadImpl::current()->GetGpuChannel(); | 845 GpuChannelHost* gpu_channel = RenderThreadImpl::current()->GetGpuChannel(); |
| 846 args.GetReturnValue().Set(!!gpu_channel); | 846 args.GetReturnValue().Set(!!gpu_channel); |
| 847 } | 847 } |
| 848 }; | 848 }; |
| 849 | 849 |
| 850 v8::Extension* GpuBenchmarkingExtension::Get() { | 850 v8::Extension* GpuBenchmarkingExtension::Get() { |
| 851 return new GpuBenchmarkingWrapper(); | 851 return new GpuBenchmarkingWrapper(); |
| 852 } | 852 } |
| 853 | 853 |
| 854 } // namespace content | 854 } // namespace content |
| OLD | NEW |