diff options
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/browser/api/printer_provider/printer_provider_api.cc | 2 | ||||
-rw-r--r-- | extensions/browser/extension_icon_image_unittest.cc | 5 | ||||
-rw-r--r-- | extensions/browser/image_loader_unittest.cc | 5 | ||||
-rw-r--r-- | extensions/common/extension_l10n_util.cc | 5 | ||||
-rw-r--r-- | extensions/common/file_util_unittest.cc | 2 | ||||
-rw-r--r-- | extensions/common/manifest_test.cc | 2 | ||||
-rw-r--r-- | extensions/utility/unpacker.cc | 6 |
7 files changed, 13 insertions, 14 deletions
diff --git a/extensions/browser/api/printer_provider/printer_provider_api.cc b/extensions/browser/api/printer_provider/printer_provider_api.cc index 8b02814d..b5d16a8 100644 --- a/extensions/browser/api/printer_provider/printer_provider_api.cc +++ b/extensions/browser/api/printer_provider/printer_provider_api.cc @@ -594,7 +594,7 @@ void PrinterProviderAPIImpl::DispatchPrintRequested( print_job.printer_id = internal_printer_id; JSONStringValueDeserializer deserializer(job.ticket_json); - scoped_ptr<base::Value> ticket_value(deserializer.Deserialize(NULL, NULL)); + scoped_ptr<base::Value> ticket_value = deserializer.Deserialize(NULL, NULL); if (!ticket_value || !api::printer_provider::PrintJob::Ticket::Populate(*ticket_value, &print_job.ticket)) { diff --git a/extensions/browser/extension_icon_image_unittest.cc b/extensions/browser/extension_icon_image_unittest.cc index 88c2fe4..35a8b5c 100644 --- a/extensions/browser/extension_icon_image_unittest.cc +++ b/extensions/browser/extension_icon_image_unittest.cc @@ -104,9 +104,8 @@ class ExtensionIconImageTest : public ExtensionsTest, std::string error; JSONFileValueDeserializer deserializer( test_file.AppendASCII("manifest.json")); - scoped_ptr<base::DictionaryValue> valid_value( - static_cast<base::DictionaryValue*>( - deserializer.Deserialize(&error_code, &error))); + scoped_ptr<base::DictionaryValue> valid_value = base::DictionaryValue::From( + deserializer.Deserialize(&error_code, &error)); EXPECT_EQ(0, error_code) << error; if (error_code != 0) return NULL; diff --git a/extensions/browser/image_loader_unittest.cc b/extensions/browser/image_loader_unittest.cc index 530a006b..4039b57 100644 --- a/extensions/browser/image_loader_unittest.cc +++ b/extensions/browser/image_loader_unittest.cc @@ -83,9 +83,8 @@ class ImageLoaderTest : public ExtensionsTest { std::string error; JSONFileValueDeserializer deserializer( extension_dir.AppendASCII("manifest.json")); - scoped_ptr<base::DictionaryValue> valid_value( - static_cast<base::DictionaryValue*>( - deserializer.Deserialize(&error_code, &error))); + scoped_ptr<base::DictionaryValue> valid_value = base::DictionaryValue::From( + deserializer.Deserialize(&error_code, &error)); EXPECT_EQ(0, error_code) << error; if (error_code != 0) return NULL; diff --git a/extensions/common/extension_l10n_util.cc b/extensions/common/extension_l10n_util.cc index dd96b07..c4ebbe9 100644 --- a/extensions/common/extension_l10n_util.cc +++ b/extensions/common/extension_l10n_util.cc @@ -39,7 +39,8 @@ base::DictionaryValue* LoadMessageFile(const base::FilePath& locale_path, base::FilePath file = locale_path.AppendASCII(locale).Append(extensions::kMessagesFilename); JSONFileValueDeserializer messages_deserializer(file); - base::Value* dictionary = messages_deserializer.Deserialize(NULL, error); + scoped_ptr<base::DictionaryValue> dictionary = base::DictionaryValue::From( + messages_deserializer.Deserialize(NULL, error)); if (!dictionary) { if (error->empty()) { // JSONFileValueSerializer just returns NULL if file cannot be found. It @@ -54,7 +55,7 @@ base::DictionaryValue* LoadMessageFile(const base::FilePath& locale_path, } } - return static_cast<base::DictionaryValue*>(dictionary); + return dictionary.release(); } // Localizes manifest value of string type for a given key. diff --git a/extensions/common/file_util_unittest.cc b/extensions/common/file_util_unittest.cc index df82b82..0814334 100644 --- a/extensions/common/file_util_unittest.cc +++ b/extensions/common/file_util_unittest.cc @@ -44,7 +44,7 @@ scoped_refptr<Extension> LoadExtensionManifest( int extra_flags, std::string* error) { JSONStringValueDeserializer deserializer(manifest_value); - scoped_ptr<base::Value> result(deserializer.Deserialize(NULL, error)); + scoped_ptr<base::Value> result = deserializer.Deserialize(NULL, error); if (!result.get()) return NULL; CHECK_EQ(base::Value::TYPE_DICTIONARY, result->GetType()); diff --git a/extensions/common/manifest_test.cc b/extensions/common/manifest_test.cc index 048e183..37034b5 100644 --- a/extensions/common/manifest_test.cc +++ b/extensions/common/manifest_test.cc @@ -29,7 +29,7 @@ base::DictionaryValue* LoadManifestFile(const base::FilePath& manifest_path, JSONFileValueDeserializer deserializer(manifest_path); base::DictionaryValue* manifest = static_cast<base::DictionaryValue*>( - deserializer.Deserialize(NULL, error)); + deserializer.Deserialize(NULL, error).release()); // Most unit tests don't need localization, and they'll fail if we try to // localize them, since their manifests don't have a default_locale key. diff --git a/extensions/utility/unpacker.cc b/extensions/utility/unpacker.cc index 6e28a49b..f499808 100644 --- a/extensions/utility/unpacker.cc +++ b/extensions/utility/unpacker.cc @@ -121,7 +121,7 @@ scoped_ptr<base::DictionaryValue> Unpacker::ReadManifest() { JSONFileValueDeserializer deserializer(manifest_path); std::string error; - scoped_ptr<base::Value> root(deserializer.Deserialize(NULL, &error)); + scoped_ptr<base::Value> root = deserializer.Deserialize(NULL, &error); if (!root.get()) { SetError(error); return NULL; @@ -253,8 +253,8 @@ bool Unpacker::AddDecodedImage(const base::FilePath& path) { bool Unpacker::ReadMessageCatalog(const base::FilePath& message_path) { std::string error; JSONFileValueDeserializer deserializer(message_path); - scoped_ptr<base::DictionaryValue> root = base::DictionaryValue::From( - make_scoped_ptr(deserializer.Deserialize(NULL, &error))); + scoped_ptr<base::DictionaryValue> root = + base::DictionaryValue::From(deserializer.Deserialize(NULL, &error)); if (!root.get()) { base::string16 messages_file = message_path.LossyDisplayName(); if (error.empty()) { |