| 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 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 INVALID_CATALOG_DATA, | 742 INVALID_CATALOG_DATA, |
| 743 l10n_util::GetStringFUTF16( | 743 l10n_util::GetStringFUTF16( |
| 744 IDS_EXTENSION_PACKAGE_INSTALL_ERROR, | 744 IDS_EXTENSION_PACKAGE_INSTALL_ERROR, |
| 745 ASCIIToUTF16("INVALID_CATALOG_DATA"))); | 745 ASCIIToUTF16("INVALID_CATALOG_DATA"))); |
| 746 return false; | 746 return false; |
| 747 } | 747 } |
| 748 | 748 |
| 749 // TODO(viettrungluu): Fix the |FilePath::FromWStringHack(UTF8ToWide())| | 749 // TODO(viettrungluu): Fix the |FilePath::FromWStringHack(UTF8ToWide())| |
| 750 // hack and remove the corresponding #include. | 750 // hack and remove the corresponding #include. |
| 751 base::FilePath relative_path = | 751 base::FilePath relative_path = |
| 752 base::FilePath::FromWStringHack(UTF8ToWide(*key_it)); | 752 base::FilePath::FromWStringHack(base::UTF8ToWide(*key_it)); |
| 753 relative_path = relative_path.Append(Extension::kMessagesFilename); | 753 relative_path = relative_path.Append(Extension::kMessagesFilename); |
| 754 if (relative_path.IsAbsolute() || relative_path.ReferencesParent()) { | 754 if (relative_path.IsAbsolute() || relative_path.ReferencesParent()) { |
| 755 // Invalid path for catalog. | 755 // Invalid path for catalog. |
| 756 ReportFailure( | 756 ReportFailure( |
| 757 INVALID_PATH_FOR_CATALOG, | 757 INVALID_PATH_FOR_CATALOG, |
| 758 l10n_util::GetStringFUTF16( | 758 l10n_util::GetStringFUTF16( |
| 759 IDS_EXTENSION_PACKAGE_INSTALL_ERROR, | 759 IDS_EXTENSION_PACKAGE_INSTALL_ERROR, |
| 760 ASCIIToUTF16("INVALID_PATH_FOR_CATALOG"))); | 760 ASCIIToUTF16("INVALID_PATH_FOR_CATALOG"))); |
| 761 return false; | 761 return false; |
| 762 } | 762 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 | 795 |
| 796 void SandboxedUnpacker::Cleanup() { | 796 void SandboxedUnpacker::Cleanup() { |
| 797 DCHECK(unpacker_io_task_runner_->RunsTasksOnCurrentThread()); | 797 DCHECK(unpacker_io_task_runner_->RunsTasksOnCurrentThread()); |
| 798 if (!temp_dir_.Delete()) { | 798 if (!temp_dir_.Delete()) { |
| 799 LOG(WARNING) << "Can not delete temp directory at " | 799 LOG(WARNING) << "Can not delete temp directory at " |
| 800 << temp_dir_.path().value(); | 800 << temp_dir_.path().value(); |
| 801 } | 801 } |
| 802 } | 802 } |
| 803 | 803 |
| 804 } // namespace extensions | 804 } // namespace extensions |
| OLD | NEW |