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

Unified Diff: extensions/renderer/event_bindings.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
Index: extensions/renderer/event_bindings.cc
diff --git a/extensions/renderer/event_bindings.cc b/extensions/renderer/event_bindings.cc
index 96762d8c5a790943fc5945420fa7c607d42b82c2..1e14d56d90a28cb880c4978349cdd1d248fd0bbf 100644
--- a/extensions/renderer/event_bindings.cc
+++ b/extensions/renderer/event_bindings.cc
@@ -218,11 +218,11 @@ void EventBindings::DispatchEventInContext(
else
listener_ids = v8::Array::New(context->isolate());
- std::unique_ptr<content::V8ValueConverter> converter(
- content::V8ValueConverter::create());
v8::Local<v8::Value> v8_args[] = {
gin::StringToSymbol(context->isolate(), event_name),
- converter->ToV8Value(event_args, context->v8_context()), listener_ids,
+ content::V8ValueConverter::Create()->ToV8Value(event_args,
+ context->v8_context()),
+ listener_ids,
};
context->module_system()->CallModuleMethodSafe(
@@ -322,10 +322,9 @@ void EventBindings::AttachFilteredEvent(
std::unique_ptr<base::DictionaryValue> filter;
{
- std::unique_ptr<content::V8ValueConverter> converter(
- content::V8ValueConverter::create());
- std::unique_ptr<base::Value> filter_value(converter->FromV8Value(
- v8::Local<v8::Object>::Cast(args[1]), context()->v8_context()));
+ std::unique_ptr<base::Value> filter_value =
+ content::V8ValueConverter::Create()->FromV8Value(
+ v8::Local<v8::Object>::Cast(args[1]), context()->v8_context());
if (!filter_value || !filter_value->IsType(base::Value::Type::DICTIONARY)) {
args.GetReturnValue().Set(static_cast<int32_t>(-1));
return;
« no previous file with comments | « extensions/renderer/dom_activity_logger.cc ('k') | extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698