summaryrefslogtreecommitdiffstats
path: root/chrome/browser/printing
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-04 19:24:42 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-04 19:24:42 +0000
commitd22d873921f2f657b483a01a398ddce3001747a1 (patch)
tree4190718501c4cae47302ea1a8be8ee7b6f4c41cd /chrome/browser/printing
parent30cf2bf9a44e5f97ddd497113bce74feb6b4b517 (diff)
downloadchromium_src-d22d873921f2f657b483a01a398ddce3001747a1.zip
chromium_src-d22d873921f2f657b483a01a398ddce3001747a1.tar.gz
chromium_src-d22d873921f2f657b483a01a398ddce3001747a1.tar.bz2
Fix various uses of release() that did not check its value
BUG=42904 TEST=compile, unit tests Review URL: http://codereview.chromium.org/1730024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46376 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/printing')
-rw-r--r--chrome/browser/printing/cloud_print/cloud_print_helpers.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/chrome/browser/printing/cloud_print/cloud_print_helpers.cc b/chrome/browser/printing/cloud_print/cloud_print_helpers.cc
index 336a203..3fe81c5 100644
--- a/chrome/browser/printing/cloud_print/cloud_print_helpers.cc
+++ b/chrome/browser/printing/cloud_print/cloud_print_helpers.cc
@@ -84,23 +84,20 @@ bool CloudPrintHelpers::ParseResponseJSON(
const std::string& response_data, bool* succeeded,
DictionaryValue** response_dict) {
scoped_ptr<Value> message_value(base::JSONReader::Read(response_data, false));
- DCHECK(message_value.get());
if (!message_value.get()) {
+ NOTREACHED();
return false;
}
if (!message_value->IsType(Value::TYPE_DICTIONARY)) {
NOTREACHED();
return false;
}
- DictionaryValue* response_dict_local =
- static_cast<DictionaryValue*>(message_value.get());
- if (succeeded) {
+ scoped_ptr<DictionaryValue> response_dict_local(
+ static_cast<DictionaryValue*>(message_value.release()));
+ if (succeeded)
response_dict_local->GetBoolean(kSuccessValue, succeeded);
- }
- if (response_dict) {
- *response_dict = response_dict_local;
- message_value.release();
- }
+ if (response_dict)
+ *response_dict = response_dict_local.release();
return true;
}