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

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

Issue 2931393003: [Content] Update V8ValueConverter::create to return a std::unique_ptr (Closed)
Patch Set: rebase 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
« no previous file with comments | « content/public/child/v8_value_converter.h ('k') | content/renderer/java/gin_java_bridge_value_converter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c1b2c31ff10a625014298a721839287158029ff0..f15bd60e3a39e08f726c688563cbd7567e5ab537 100644
--- a/content/renderer/gpu/gpu_benchmarking_extension.cc
+++ b/content/renderer/gpu/gpu_benchmarking_extension.cc
@@ -311,9 +311,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(),
@@ -1025,11 +1024,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.
@@ -1081,11 +1079,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),
@@ -1100,12 +1096,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));
« no previous file with comments | « content/public/child/v8_value_converter.h ('k') | content/renderer/java/gin_java_bridge_value_converter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698