Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1825)

Unified Diff: content/renderer/gpu/gpu_benchmarking_extension.cc

Issue 2931393003: [Content] Update V8ValueConverter::create to return a std::unique_ptr (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 e05aab5161ce22276c8e69a28879a7086d751d99..bc15d62ef3969aef27a5c177a6040463975455e4 100644
--- a/content/renderer/gpu/gpu_benchmarking_extension.cc
+++ b/content/renderer/gpu/gpu_benchmarking_extension.cc
@@ -309,9 +309,8 @@ void OnMicroBenchmarkCompleted(CallbackAndContext* callback_and_context,
v8::Context::Scope context_scope(context);
WebLocalFrame* frame = WebLocalFrame::FrameForContext(context);
if (frame) {
- std::unique_ptr<V8ValueConverter> converter =
- base::WrapUnique(V8ValueConverter::create());
- v8::Local<v8::Value> value = converter->ToV8Value(result.get(), context);
+ v8::Local<v8::Value> value =
+ V8ValueConverter::Create()->ToV8Value(result.get(), context);
v8::Local<v8::Value> argv[] = { value };
frame->CallFunctionEvenIfScriptDisabled(callback_and_context->GetCallback(),
@@ -1023,11 +1022,10 @@ bool GpuBenchmarking::PointerActionSequence(gin::Arguments* args) {
return false;
}
- std::unique_ptr<V8ValueConverter> converter =
- base::WrapUnique(V8ValueConverter::create());
v8::Local<v8::Context> v8_context =
context.web_frame()->MainWorldScriptContext();
- std::unique_ptr<base::Value> value = converter->FromV8Value(obj, v8_context);
+ std::unique_ptr<base::Value> value =
+ V8ValueConverter::Create()->FromV8Value(obj, v8_context);
// Get all the pointer actions from the user input and wrap them into a
// SyntheticPointerActionListParams object.
@@ -1079,11 +1077,9 @@ int GpuBenchmarking::RunMicroBenchmark(gin::Arguments* args) {
new CallbackAndContext(args->isolate(), callback,
context.web_frame()->MainWorldScriptContext());
- std::unique_ptr<V8ValueConverter> converter =
- base::WrapUnique(V8ValueConverter::create());
v8::Local<v8::Context> v8_context = callback_and_context->GetContext();
std::unique_ptr<base::Value> value =
- converter->FromV8Value(arguments, v8_context);
+ V8ValueConverter::Create()->FromV8Value(arguments, v8_context);
return context.compositor()->ScheduleMicroBenchmark(
name, std::move(value),
@@ -1098,12 +1094,10 @@ bool GpuBenchmarking::SendMessageToMicroBenchmark(
if (!context.Init(true))
return false;
- std::unique_ptr<V8ValueConverter> converter =
- base::WrapUnique(V8ValueConverter::create());
v8::Local<v8::Context> v8_context =
context.web_frame()->MainWorldScriptContext();
std::unique_ptr<base::Value> value =
- converter->FromV8Value(message, v8_context);
+ V8ValueConverter::Create()->FromV8Value(message, v8_context);
return context.compositor()->SendMessageToMicroBenchmark(id,
std::move(value));

Powered by Google App Engine
This is Rietveld 408576698