Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8003)

Unified Diff: chrome/service/service_utility_process_host.cc

Issue 6042009: Added WARN_UNUSED_RESULT to ScopedTempDir methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: OSX build fix Created 9 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/service/service_utility_process_host.cc
diff --git a/chrome/service/service_utility_process_host.cc b/chrome/service/service_utility_process_host.cc
index 859e7259f2e404d2ed596e64a3d395da6837762b..d8befd1fc3877a80bb7d260088b59b49ad791fc4 100644
--- a/chrome/service/service_utility_process_host.cc
+++ b/chrome/service/service_utility_process_host.cc
@@ -194,7 +194,12 @@ void ServiceUtilityProcessHost::Client::MetafileAvailable(
// The metafile was created in a temp folder which needs to get deleted after
// we have processed it.
ScopedTempDir scratch_metafile_dir;
- scratch_metafile_dir.Set(metafile_path.DirName());
+ if (!scratch_metafile_dir.Set(metafile_path.DirName())) {
+ // This will happen if metafile_path is invalid. It could potentially
+ // be strengthened to a CHECK.
+ OnRenderPDFPagesToMetafileFailed();
+ return;
+ }
#if defined(OS_WIN)
printing::NativeMetafile metafile;
if (!metafile.CreateFromFile(metafile_path)) {

Powered by Google App Engine
This is Rietveld 408576698