| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/extensions/sandboxed_unpacker.h" | 5 #include "chrome/browser/extensions/sandboxed_unpacker.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 | 239 |
| 240 // Extract the public key and validate the package. | 240 // Extract the public key and validate the package. |
| 241 if (!ValidateSignature()) | 241 if (!ValidateSignature()) |
| 242 return; // ValidateSignature() already reported the error. | 242 return; // ValidateSignature() already reported the error. |
| 243 | 243 |
| 244 // Copy the crx file into our working directory. | 244 // Copy the crx file into our working directory. |
| 245 base::FilePath temp_crx_path = temp_dir_.path().Append(crx_path_.BaseName()); | 245 base::FilePath temp_crx_path = temp_dir_.path().Append(crx_path_.BaseName()); |
| 246 PATH_LENGTH_HISTOGRAM("Extensions.SandboxUnpackTempCrxPathLength", | 246 PATH_LENGTH_HISTOGRAM("Extensions.SandboxUnpackTempCrxPathLength", |
| 247 temp_crx_path); | 247 temp_crx_path); |
| 248 | 248 |
| 249 if (!file_util::CopyFile(crx_path_, temp_crx_path)) { | 249 if (!base::CopyFile(crx_path_, temp_crx_path)) { |
| 250 // Failed to copy extension file to temporary directory. | 250 // Failed to copy extension file to temporary directory. |
| 251 ReportFailure( | 251 ReportFailure( |
| 252 FAILED_TO_COPY_EXTENSION_FILE_TO_TEMP_DIRECTORY, | 252 FAILED_TO_COPY_EXTENSION_FILE_TO_TEMP_DIRECTORY, |
| 253 l10n_util::GetStringFUTF16( | 253 l10n_util::GetStringFUTF16( |
| 254 IDS_EXTENSION_PACKAGE_INSTALL_ERROR, | 254 IDS_EXTENSION_PACKAGE_INSTALL_ERROR, |
| 255 ASCIIToUTF16("FAILED_TO_COPY_EXTENSION_FILE_TO_TEMP_DIRECTORY"))); | 255 ASCIIToUTF16("FAILED_TO_COPY_EXTENSION_FILE_TO_TEMP_DIRECTORY"))); |
| 256 return; | 256 return; |
| 257 } | 257 } |
| 258 | 258 |
| 259 // If we are supposed to use a subprocess, kick off the subprocess. | 259 // If we are supposed to use a subprocess, kick off the subprocess. |
| (...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 792 | 792 |
| 793 void SandboxedUnpacker::Cleanup() { | 793 void SandboxedUnpacker::Cleanup() { |
| 794 DCHECK(unpacker_io_task_runner_->RunsTasksOnCurrentThread()); | 794 DCHECK(unpacker_io_task_runner_->RunsTasksOnCurrentThread()); |
| 795 if (!temp_dir_.Delete()) { | 795 if (!temp_dir_.Delete()) { |
| 796 LOG(WARNING) << "Can not delete temp directory at " | 796 LOG(WARNING) << "Can not delete temp directory at " |
| 797 << temp_dir_.path().value(); | 797 << temp_dir_.path().value(); |
| 798 } | 798 } |
| 799 } | 799 } |
| 800 | 800 |
| 801 } // namespace extensions | 801 } // namespace extensions |
| OLD | NEW |