Add scoped_ptr-safe base::Value to Dictionary/List conversion functions.

This change adds two static From() functions to the DictionaryValue and
ListValue classes which take a scoped_ptr to a Value and either convert
it to a scoped_ptr to a DictionaryValue or ListValue, or return nullptr.
These are intended to replace the existing pattern,

  make_scoped_ptr(static_cast<base::DictionaryValue*>(value.release()))

with the shorter and safer alternative,

  base::DictionaryValue::From(value.Pass())

Instances of this pattern in //extensions have been converted as
examples.

Review URL: https://codereview.chromium.org/1308013005

Cr-Commit-Position: refs/heads/master@{#348294}


CrOS-Libchrome-Original-Commit: 259c0a3f44bdd8130c5d835e9f596624a079fbd1
2 files changed
tree: 6eb6cb4a160a5f5616ec8ddb5a491041f2ad476b
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/