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/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 scoped_ptr<base::Value> result) { | 247 scoped_ptr<base::Value> result) { |
248 v8::Isolate* isolate = callback_and_context->isolate(); | 248 v8::Isolate* isolate = callback_and_context->isolate(); |
249 v8::HandleScope scope(isolate); | 249 v8::HandleScope scope(isolate); |
250 v8::Handle<v8::Context> context = callback_and_context->GetContext(); | 250 v8::Handle<v8::Context> context = callback_and_context->GetContext(); |
251 v8::Context::Scope context_scope(context); | 251 v8::Context::Scope context_scope(context); |
252 WebLocalFrame* frame = WebLocalFrame::frameForContext(context); | 252 WebLocalFrame* frame = WebLocalFrame::frameForContext(context); |
253 if (frame) { | 253 if (frame) { |
254 scoped_ptr<V8ValueConverter> converter = | 254 scoped_ptr<V8ValueConverter> converter = |
255 make_scoped_ptr(V8ValueConverter::create()); | 255 make_scoped_ptr(V8ValueConverter::create()); |
256 v8::Handle<v8::Value> value = converter->ToV8Value(result.get(), context); | 256 v8::Handle<v8::Value> value = converter->ToV8Value(result.get(), context); |
257 #ifdef WEB_FRAME_USES_V8_LOCAL | |
258 v8::Local<v8::Value> argv[] = {value}; | |
259 #else | |
260 v8::Handle<v8::Value> argv[] = { value }; | 257 v8::Handle<v8::Value> argv[] = { value }; |
261 #endif | 258 |
262 frame->callFunctionEvenIfScriptDisabled( | 259 frame->callFunctionEvenIfScriptDisabled( |
263 callback_and_context->GetCallback(), | 260 callback_and_context->GetCallback(), |
264 v8::Object::New(isolate), | 261 v8::Object::New(isolate), |
265 1, | 262 1, |
266 argv); | 263 argv); |
267 } | 264 } |
268 } | 265 } |
269 | 266 |
270 void OnSyntheticGestureCompleted(CallbackAndContext* callback_and_context) { | 267 void OnSyntheticGestureCompleted(CallbackAndContext* callback_and_context) { |
271 v8::Isolate* isolate = callback_and_context->isolate(); | 268 v8::Isolate* isolate = callback_and_context->isolate(); |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 | 834 |
838 return context.compositor()->SendMessageToMicroBenchmark(id, value.Pass()); | 835 return context.compositor()->SendMessageToMicroBenchmark(id, value.Pass()); |
839 } | 836 } |
840 | 837 |
841 bool GpuBenchmarking::HasGpuProcess() { | 838 bool GpuBenchmarking::HasGpuProcess() { |
842 GpuChannelHost* gpu_channel = RenderThreadImpl::current()->GetGpuChannel(); | 839 GpuChannelHost* gpu_channel = RenderThreadImpl::current()->GetGpuChannel(); |
843 return !!gpu_channel; | 840 return !!gpu_channel; |
844 } | 841 } |
845 | 842 |
846 } // namespace content | 843 } // namespace content |
OLD | NEW |