@@ -367,24 +367,24 @@ bool Package::ExtractPath() {
367367}
368368
369369bool Package::ExtractPackage (const FilePath& zip_file, FilePath* where) {
370- // Auto clean our temporary directory
371- static scoped_ptr<base::ScopedTempDir> scoped_temp_dir;
372370
371+ if (!scoped_temp_dir_.IsValid ()) {
373372#if defined(OS_WIN)
374- if (!file_util::CreateNewTempDirectory (L" nw" , where)) {
373+ if (!file_util::CreateNewTempDirectory (L" nw" , where)) {
375374#else
376- if (!file_util::CreateNewTempDirectory (" nw" , where)) {
375+ if (!file_util::CreateNewTempDirectory (" nw" , where)) {
377376#endif
378- ReportError (" Cannot extract package" ,
379- " Unable to create temporary directory." );
380- return false ;
381- }
382-
383- scoped_temp_dir.reset (new base::ScopedTempDir ());
384- if (!scoped_temp_dir->Set (*where)) {
385- ReportError (" Cannot extract package" ,
386- " Unable to set temporary directory." );
387- return false ;
377+ ReportError (" Cannot extract package" ,
378+ " Unable to create temporary directory." );
379+ return false ;
380+ }
381+ if (!scoped_temp_dir_.Set (*where)) {
382+ ReportError (" Cannot extract package" ,
383+ " Unable to set temporary directory." );
384+ return false ;
385+ }
386+ }else {
387+ *where = scoped_temp_dir_.path ();
388388 }
389389
390390 return zip::Unzip (zip_file, *where);
0 commit comments