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 |
257 v8::Handle<v8::Value> argv[] = { value }; | 260 v8::Handle<v8::Value> argv[] = { value }; |
258 | 261 #endif |
259 frame->callFunctionEvenIfScriptDisabled( | 262 frame->callFunctionEvenIfScriptDisabled( |
260 callback_and_context->GetCallback(), | 263 callback_and_context->GetCallback(), |
261 v8::Object::New(isolate), | 264 v8::Object::New(isolate), |
262 1, | 265 1, |
263 argv); | 266 argv); |
264 } | 267 } |
265 } | 268 } |
266 | 269 |
267 void OnSyntheticGestureCompleted(CallbackAndContext* callback_and_context) { | 270 void OnSyntheticGestureCompleted(CallbackAndContext* callback_and_context) { |
268 v8::Isolate* isolate = callback_and_context->isolate(); | 271 v8::Isolate* isolate = callback_and_context->isolate(); |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 | 837 |
835 return context.compositor()->SendMessageToMicroBenchmark(id, value.Pass()); | 838 return context.compositor()->SendMessageToMicroBenchmark(id, value.Pass()); |
836 } | 839 } |
837 | 840 |
838 bool GpuBenchmarking::HasGpuProcess() { | 841 bool GpuBenchmarking::HasGpuProcess() { |
839 GpuChannelHost* gpu_channel = RenderThreadImpl::current()->GetGpuChannel(); | 842 GpuChannelHost* gpu_channel = RenderThreadImpl::current()->GetGpuChannel(); |
840 return !!gpu_channel; | 843 return !!gpu_channel; |
841 } | 844 } |
842 | 845 |
843 } // namespace content | 846 } // namespace content |
OLD | NEW |