Chromium Code Reviews| Index: content/renderer/gpu/gpu_benchmarking_extension.cc | 
| diff --git a/content/renderer/gpu/gpu_benchmarking_extension.cc b/content/renderer/gpu/gpu_benchmarking_extension.cc | 
| index 742481a8cb6167f73d0724290c458e22fb7c1e9b..b54ac25725600f7d2b401cc57e2680b9b9f30766 100644 | 
| --- a/content/renderer/gpu/gpu_benchmarking_extension.cc | 
| +++ b/content/renderer/gpu/gpu_benchmarking_extension.cc | 
| @@ -32,6 +32,7 @@ | 
| #include "gin/arguments.h" | 
| #include "gin/handle.h" | 
| #include "gin/object_template_builder.h" | 
| +#include "gpu/ipc/common/gpu_messages.h" | 
| #include "third_party/WebKit/public/web/WebImageCache.h" | 
| #include "third_party/WebKit/public/web/WebKit.h" | 
| #include "third_party/WebKit/public/web/WebLocalFrame.h" | 
| @@ -503,7 +504,9 @@ gin::ObjectTemplateBuilder GpuBenchmarking::GetObjectTemplateBuilder( | 
| .SetMethod("sendMessageToMicroBenchmark", | 
| &GpuBenchmarking::SendMessageToMicroBenchmark) | 
| .SetMethod("hasGpuChannel", &GpuBenchmarking::HasGpuChannel) | 
| - .SetMethod("hasGpuProcess", &GpuBenchmarking::HasGpuProcess); | 
| + .SetMethod("hasGpuProcess", &GpuBenchmarking::HasGpuProcess) | 
| + .SetMethod("getGpuDriverBugWorkarounds", | 
| + &GpuBenchmarking::GetGpuDriverBugWorkarounds); | 
| } | 
| void GpuBenchmarking::SetNeedsDisplayOnAllLayers() { | 
| @@ -922,4 +925,22 @@ bool GpuBenchmarking::HasGpuProcess() { | 
| return has_gpu_process; | 
| } | 
| +void GpuBenchmarking::GetGpuDriverBugWorkarounds(gin::Arguments* args) { | 
| + std::vector<std::string> gpu_driver_bug_workarounds; | 
| + GpuChannelHost* gpu_channel = RenderThreadImpl::current()->GetGpuChannel(); | 
| + if (!gpu_channel->Send(new GpuChannelMsg_GetDriverBugWorkArounds( | 
| + &gpu_driver_bug_workarounds))) { | 
| + return; | 
| + } | 
| + | 
| + v8::Isolate* isolate = args->isolate(); | 
| 
 
dcheng
2016/03/30 23:45:25
Does Converter::ToV8() work? https://code.google.c
 
Julien Isorce Samsung
2016/03/31 15:20:09
gin::TryConvertToV8 works so I'll use it, thx.
 
 | 
| + v8::Local<v8::Array> result = | 
| + v8::Array::New(isolate, gpu_driver_bug_workarounds.size()); | 
| + for (size_t i = 0; i < gpu_driver_bug_workarounds.size(); ++i) | 
| + result->Set(i, v8::String::NewFromUtf8( | 
| + isolate, gpu_driver_bug_workarounds[i].c_str())); | 
| + | 
| + args->Return(v8::Local<v8::Object>::Cast(result)); | 
| +} | 
| + | 
| } // namespace content |