diff options
author | kmadhusu@chromium.org <kmadhusu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-22 17:32:12 +0000 |
---|---|---|
committer | kmadhusu@chromium.org <kmadhusu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-22 17:32:12 +0000 |
commit | e675f7b8eed8528ad29fd2c77e7562a8369319ea (patch) | |
tree | 6a99cbb3a7da207281265825054c453b4bd79c71 | |
parent | 723474eba2e68aa6c6d5a864ff1e6dcb9b014a77 (diff) | |
download | chromium_src-e675f7b8eed8528ad29fd2c77e7562a8369319ea.zip chromium_src-e675f7b8eed8528ad29fd2c77e7562a8369319ea.tar.gz chromium_src-e675f7b8eed8528ad29fd2c77e7562a8369319ea.tar.bz2 |
Coverity: Fix unchecked returns.
CID = 17626, 17123, 15395, 15394
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/7206049
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90046 0039d316-1c4b-4281-b951-d872f2087c98
4 files changed, 8 insertions, 6 deletions
diff --git a/chrome/browser/printing/cloud_print/cloud_print_setup_message_handler.cc b/chrome/browser/printing/cloud_print/cloud_print_setup_message_handler.cc index b6d4087..ad6b5d7 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_setup_message_handler.cc +++ b/chrome/browser/printing/cloud_print/cloud_print_setup_message_handler.cc @@ -26,9 +26,9 @@ void CloudPrintSetupMessageHandler::RegisterMessages() { void CloudPrintSetupMessageHandler::HandleSubmitAuth(const ListValue* args) { std::string json; - args->GetString(0, &json); + bool ret = args->GetString(0, &json); std::string username, password, captcha, access_code; - if (json.empty()) { + if (!ret || json.empty()) { NOTREACHED() << "Empty json string"; return; } diff --git a/chrome/browser/printing/print_dialog_cloud.cc b/chrome/browser/printing/print_dialog_cloud.cc index 4729ae3..56a4a4f 100644 --- a/chrome/browser/printing/print_dialog_cloud.cc +++ b/chrome/browser/printing/print_dialog_cloud.cc @@ -348,8 +348,8 @@ void CloudPrintFlowHandler::HandleSendPrintData(const ListValue* args) { void CloudPrintFlowHandler::HandleSetPageParameters(const ListValue* args) { std::string json; - args->GetString(0, &json); - if (json.empty()) { + bool ret = args->GetString(0, &json); + if (!ret || json.empty()) { NOTREACHED() << "Empty json string"; return; } diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc index 725f476..179ec61 100644 --- a/chrome/browser/profiles/profile_impl.cc +++ b/chrome/browser/profiles/profile_impl.cc @@ -340,7 +340,8 @@ void ProfileImpl::DoFinalInit() { // to PathService. chrome::GetUserCacheDirectory(path_, &base_cache_path_); if (!delegate_) { - file_util::CreateDirectory(base_cache_path_); + if (!file_util::CreateDirectory(base_cache_path_)) + LOG(FATAL) << "Failed to create " << base_cache_path_.value(); } else { // Async profile loading is used, so call this on the FILE thread instead. // It is safe since all other file operations should also be done there. diff --git a/chrome/renderer/print_web_view_helper.cc b/chrome/renderer/print_web_view_helper.cc index 18ddb05..6f40d54 100644 --- a/chrome/renderer/print_web_view_helper.cc +++ b/chrome/renderer/print_web_view_helper.cc @@ -350,7 +350,8 @@ void PrintWebViewHelper::PrintPreview(WebKit::WebFrame* frame, } bool draft; - settings.GetBoolean(printing::kSettingDraftDocument, &draft); + if (!settings.GetBoolean(printing::kSettingDraftDocument, &draft)) + draft = false; // Render Pages for printing. if (!RenderPagesForPreview(frame, node, draft)) |