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

Unified Diff: extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc

Issue 1308013005: Add scoped_ptr-safe base::Value to Dictionary/List conversion functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made conversions static members. Created 5 years, 3 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 | « extensions/renderer/event_bindings.cc ('k') | extensions/utility/unpacker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc
diff --git a/extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc b/extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc
index 3b5ce79ceed558c74c124e2596df5756984b6c3b..7eb129236551ca24185357a5af7054915f95d7a7 100644
--- a/extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc
+++ b/extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc
@@ -151,9 +151,8 @@ void GuestViewInternalCustomBindings::AttachGuest(
scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create());
scoped_ptr<base::Value> params_as_value(
converter->FromV8Value(args[2], context()->v8_context()));
- CHECK(params_as_value->IsType(base::Value::TYPE_DICTIONARY));
- params.reset(
- static_cast<base::DictionaryValue*>(params_as_value.release()));
+ params = base::DictionaryValue::From(params_as_value.Pass());
+ CHECK(params);
}
// Add flag to |params| to indicate that the element size is specified in
@@ -226,9 +225,8 @@ void GuestViewInternalCustomBindings::AttachIframeGuest(
scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create());
scoped_ptr<base::Value> params_as_value(
converter->FromV8Value(args[2], context()->v8_context()));
- CHECK(params_as_value->IsType(base::Value::TYPE_DICTIONARY));
- params.reset(
- static_cast<base::DictionaryValue*>(params_as_value.release()));
+ params = base::DictionaryValue::From(params_as_value.Pass());
+ CHECK(params);
}
// Add flag to |params| to indicate that the element size is specified in
« no previous file with comments | « extensions/renderer/event_bindings.cc ('k') | extensions/utility/unpacker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698