| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 865 return false; | 865 return false; |
| 866 } | 866 } |
| 867 gesture_params->gesture_source_type = | 867 gesture_params->gesture_source_type = |
| 868 static_cast<SyntheticGestureParams::GestureSourceType>( | 868 static_cast<SyntheticGestureParams::GestureSourceType>( |
| 869 gesture_source_type); | 869 gesture_source_type); |
| 870 | 870 |
| 871 scoped_refptr<CallbackAndContext> callback_and_context = | 871 scoped_refptr<CallbackAndContext> callback_and_context = |
| 872 new CallbackAndContext(args->isolate(), | 872 new CallbackAndContext(args->isolate(), |
| 873 callback, | 873 callback, |
| 874 context.web_frame()->mainWorldScriptContext()); | 874 context.web_frame()->mainWorldScriptContext()); |
| 875 | 875 VLOG(0) << "GpuBenchmarking::Tap: " << gesture_source_type; |
| 876 // TODO(nduca): If the render_view_impl is destroyed while the gesture is in | 876 // TODO(nduca): If the render_view_impl is destroyed while the gesture is in |
| 877 // progress, we will leak the callback and context. This needs to be fixed, | 877 // progress, we will leak the callback and context. This needs to be fixed, |
| 878 // somehow. | 878 // somehow. |
| 879 context.render_view_impl()->GetWidget()->QueueSyntheticGesture( | 879 context.render_view_impl()->GetWidget()->QueueSyntheticGesture( |
| 880 std::move(gesture_params), | 880 std::move(gesture_params), |
| 881 base::Bind(&OnSyntheticGestureCompleted, | 881 base::Bind(&OnSyntheticGestureCompleted, |
| 882 base::RetainedRef(callback_and_context))); | 882 base::RetainedRef(callback_and_context))); |
| 883 | 883 VLOG(0) << "GpuBenchmarking::Tap Finish."; |
| 884 return true; | 884 return true; |
| 885 } | 885 } |
| 886 | 886 |
| 887 void GpuBenchmarking::ClearImageCache() { | 887 void GpuBenchmarking::ClearImageCache() { |
| 888 WebImageCache::clear(); | 888 WebImageCache::clear(); |
| 889 } | 889 } |
| 890 | 890 |
| 891 int GpuBenchmarking::RunMicroBenchmark(gin::Arguments* args) { | 891 int GpuBenchmarking::RunMicroBenchmark(gin::Arguments* args) { |
| 892 GpuBenchmarkingContext context; | 892 GpuBenchmarkingContext context; |
| 893 if (!context.Init(true)) | 893 if (!context.Init(true)) |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 961 &gpu_driver_bug_workarounds))) { | 961 &gpu_driver_bug_workarounds))) { |
| 962 return; | 962 return; |
| 963 } | 963 } |
| 964 | 964 |
| 965 v8::Local<v8::Value> result; | 965 v8::Local<v8::Value> result; |
| 966 if (gin::TryConvertToV8(args->isolate(), gpu_driver_bug_workarounds, &result)) | 966 if (gin::TryConvertToV8(args->isolate(), gpu_driver_bug_workarounds, &result)) |
| 967 args->Return(result); | 967 args->Return(result); |
| 968 } | 968 } |
| 969 | 969 |
| 970 } // namespace content | 970 } // namespace content |
| OLD | NEW |