| 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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 CHECK(unpacker_io_task_runner_->RunsTasksOnCurrentThread()); | 408 CHECK(unpacker_io_task_runner_->RunsTasksOnCurrentThread()); |
| 409 got_response_ = true; | 409 got_response_ = true; |
| 410 ReportFailure( | 410 ReportFailure( |
| 411 UNPACKER_CLIENT_FAILED, | 411 UNPACKER_CLIENT_FAILED, |
| 412 l10n_util::GetStringFUTF16( | 412 l10n_util::GetStringFUTF16( |
| 413 IDS_EXTENSION_PACKAGE_ERROR_MESSAGE, | 413 IDS_EXTENSION_PACKAGE_ERROR_MESSAGE, |
| 414 error)); | 414 error)); |
| 415 } | 415 } |
| 416 | 416 |
| 417 bool SandboxedUnpacker::ValidateSignature() { | 417 bool SandboxedUnpacker::ValidateSignature() { |
| 418 ScopedStdioHandle file(base::OpenFile(crx_path_, "rb")); | 418 ScopedStdioHandle file(file_util::OpenFile(crx_path_, "rb")); |
| 419 | 419 |
| 420 if (!file.get()) { | 420 if (!file.get()) { |
| 421 // Could not open crx file for reading. | 421 // Could not open crx file for reading. |
| 422 #if defined (OS_WIN) | 422 #if defined (OS_WIN) |
| 423 // On windows, get the error code. | 423 // On windows, get the error code. |
| 424 uint32 error_code = ::GetLastError(); | 424 uint32 error_code = ::GetLastError(); |
| 425 // TODO(skerner): Use this histogram to understand why so many | 425 // TODO(skerner): Use this histogram to understand why so many |
| 426 // windows users hit this error. crbug.com/69693 | 426 // windows users hit this error. crbug.com/69693 |
| 427 | 427 |
| 428 // Windows errors are unit32s, but all of likely errors are in | 428 // Windows errors are unit32s, but all of likely errors are in |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 | 822 |
| 823 void SandboxedUnpacker::Cleanup() { | 823 void SandboxedUnpacker::Cleanup() { |
| 824 DCHECK(unpacker_io_task_runner_->RunsTasksOnCurrentThread()); | 824 DCHECK(unpacker_io_task_runner_->RunsTasksOnCurrentThread()); |
| 825 if (!temp_dir_.Delete()) { | 825 if (!temp_dir_.Delete()) { |
| 826 LOG(WARNING) << "Can not delete temp directory at " | 826 LOG(WARNING) << "Can not delete temp directory at " |
| 827 << temp_dir_.path().value(); | 827 << temp_dir_.path().value(); |
| 828 } | 828 } |
| 829 } | 829 } |
| 830 | 830 |
| 831 } // namespace extensions | 831 } // namespace extensions |
| OLD | NEW |