diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-18 19:04:21 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-18 19:04:21 +0000 |
commit | 03cf96e71f1855f80a4b9214aab7c7fae60ec87c (patch) | |
tree | af118309b7e143c83f20456858c68b3ac62e0da1 /cloud_print | |
parent | 89d1a8b163dc905efeea6d391f4d02deafccf59c (diff) | |
download | chromium_src-03cf96e71f1855f80a4b9214aab7c7fae60ec87c.zip chromium_src-03cf96e71f1855f80a4b9214aab7c7fae60ec87c.tar.gz chromium_src-03cf96e71f1855f80a4b9214aab7c7fae60ec87c.tar.bz2 |
Fix "unreachable code" warnings (MSVC warning 4702), misc. edition.
This CL covers top-level directories that only had one or two modified files.
BUG=346399
TEST=none
R=darin@chromium.org
Review URL: https://codereview.chromium.org/203043002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257705 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cloud_print')
-rw-r--r-- | cloud_print/service/win/chrome_launcher.cc | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/cloud_print/service/win/chrome_launcher.cc b/cloud_print/service/win/chrome_launcher.cc index f0cac5e..231ae84 100644 --- a/cloud_print/service/win/chrome_launcher.cc +++ b/cloud_print/service/win/chrome_launcher.cc @@ -271,19 +271,16 @@ void ChromeLauncher::Run() { std::string ChromeLauncher::CreateServiceStateFile( const std::string& proxy_id, const std::vector<std::string>& printers) { - std::string result; - base::ScopedTempDir temp_user_data; if (!temp_user_data.CreateUniqueTempDir()) { LOG(ERROR) << "Can't create temp dir."; - return result; + return std::string(); } base::FilePath chrome_path = chrome_launcher_support::GetAnyChromePath(); - if (chrome_path.empty()) { LOG(ERROR) << "Can't find Chrome."; - return result; + return std::string(); } base::FilePath printers_file = temp_user_data.path().Append(L"printers.json"); @@ -297,7 +294,7 @@ std::string ChromeLauncher::CreateServiceStateFile( printers_json.size()); if (written != printers_json.size()) { LOG(ERROR) << "Can't write file."; - return result; + return std::string(); } CommandLine cmd(chrome_path); @@ -320,7 +317,7 @@ std::string ChromeLauncher::CreateServiceStateFile( DWORD thread_id = 0; if (!LaunchProcess(cmd, &chrome_handle, &thread_id)) { LOG(ERROR) << "Unable to launch Chrome."; - return result; + return std::string(); } for (;;) { @@ -330,18 +327,16 @@ std::string ChromeLauncher::CreateServiceStateFile( if (wait_result == WAIT_OBJECT_0) { // Return what we have because browser is closed. return json; - } else if (wait_result == WAIT_TIMEOUT) { - if (!json.empty()) { - // Close chrome because Service State is ready. - CloseChrome(chrome_handle, thread_id); - return json; - } - } else { + } + if (wait_result != WAIT_TIMEOUT) { LOG(ERROR) << "Chrome launch failed."; - return result; + return std::string(); + } + if (!json.empty()) { + // Close chrome because Service State is ready. + CloseChrome(chrome_handle, thread_id); + return json; } } - NOTREACHED(); - return std::string(); } |