Move SandboxedExtensionUnpacker and SandboxedExtensionUnpackerClient into extensions namespace; rename them to SandboxedUnpacker and SandboxedUnpackerClient.
BUG=134011, 117261
Review URL: https://chromiumcodereview.appspot.com/10637004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145161 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.cc b/chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.cc
index 36273d4..8c393ca 100644
--- a/chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.cc
+++ b/chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.cc
@@ -13,7 +13,7 @@
#include "chrome/browser/chromeos/login/existing_user_controller.h"
#include "chrome/browser/chromeos/login/user_manager.h"
#include "chrome/browser/extensions/extension_service.h"
-#include "chrome/browser/extensions/sandboxed_extension_unpacker.h"
+#include "chrome/browser/extensions/sandboxed_unpacker.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_file_util.h"
@@ -22,6 +22,7 @@
#include "content/public/browser/notification_service.h"
using extensions::Extension;
+using extensions::SandboxedUnpacker;
namespace chromeos {
@@ -30,7 +31,8 @@
Profile*,
const FilePath&)> UnpackCallback;
-class ScreensaverUnpackerClient : public SandboxedExtensionUnpackerClient {
+class ScreensaverUnpackerClient
+ : public extensions::SandboxedUnpackerClient {
public:
explicit ScreensaverUnpackerClient(const UnpackCallback& unpacker_callback)
: unpack_callback_(unpacker_callback) {}
@@ -141,8 +143,8 @@
if (screensaver_crx.empty())
return;
- scoped_refptr<SandboxedExtensionUnpacker> screensaver_unpacker(
- new SandboxedExtensionUnpacker(
+ scoped_refptr<SandboxedUnpacker> screensaver_unpacker(
+ new SandboxedUnpacker(
screensaver_crx,
true,
Extension::COMPONENT,
@@ -156,7 +158,7 @@
content::BrowserThread::FILE,
FROM_HERE,
base::Bind(
- &SandboxedExtensionUnpacker::Start, screensaver_unpacker.get()));
+ &SandboxedUnpacker::Start, screensaver_unpacker.get()));
}
void KioskModeScreensaver::SetupScreensaver(
diff --git a/chrome/browser/component_updater/component_unpacker.h b/chrome/browser/component_updater/component_unpacker.h
index 60fc385e..773baa7 100644
--- a/chrome/browser/component_updater/component_unpacker.h
+++ b/chrome/browser/component_updater/component_unpacker.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -18,7 +18,7 @@
// the component installation or update.
//
// This class should be used only by the component updater. It is inspired
-// and overlaps with code in the extension's SandboxedExtensionUnpacker.
+// and overlaps with code in the extension's SandboxedUnpacker.
// The main differences are:
// - The public key hash is full SHA256.
// - Does not use a sandboxed unpacker. A valid component is fully trusted.
diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc
index 239e693d..e4e7d4a 100644
--- a/chrome/browser/extensions/crx_installer.cc
+++ b/chrome/browser/extensions/crx_installer.cc
@@ -141,8 +141,8 @@
void CrxInstaller::InstallCrx(const FilePath& source_file) {
source_file_ = source_file;
- scoped_refptr<SandboxedExtensionUnpacker> unpacker(
- new SandboxedExtensionUnpacker(
+ scoped_refptr<extensions::SandboxedUnpacker> unpacker(
+ new extensions::SandboxedUnpacker(
source_file,
content::ResourceDispatcherHost::Get() != NULL,
install_source_,
@@ -152,7 +152,7 @@
if (!BrowserThread::PostTask(
BrowserThread::FILE, FROM_HERE,
base::Bind(
- &SandboxedExtensionUnpacker::Start, unpacker.get())))
+ &extensions::SandboxedUnpacker::Start, unpacker.get())))
NOTREACHED();
}
@@ -237,7 +237,7 @@
// The checks below are skipped for themes and external installs.
// TODO(pamg): After ManagementPolicy refactoring is complete, remove this
// and other uses of install_source_ that are no longer needed now that the
- // SandboxedExtensionUnpacker sets extension->location.
+ // SandboxedUnpacker sets extension->location.
if (extension->is_theme() || Extension::IsExternalLocation(install_source_))
return CrxInstallerError();
diff --git a/chrome/browser/extensions/crx_installer.h b/chrome/browser/extensions/crx_installer.h
index 8901b78..524c776 100644
--- a/chrome/browser/extensions/crx_installer.h
+++ b/chrome/browser/extensions/crx_installer.h
@@ -15,7 +15,7 @@
#include "base/version.h"
#include "chrome/browser/extensions/crx_installer_error.h"
#include "chrome/browser/extensions/extension_install_prompt.h"
-#include "chrome/browser/extensions/sandboxed_extension_unpacker.h"
+#include "chrome/browser/extensions/sandboxed_unpacker.h"
#include "chrome/browser/extensions/webstore_installer.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/string_ordinal.h"
@@ -52,7 +52,7 @@
// installer->set_bar();
// installer->InstallCrx(...);
class CrxInstaller
- : public SandboxedExtensionUnpackerClient,
+ : public extensions::SandboxedUnpackerClient,
public ExtensionInstallPrompt::Delegate {
public:
// Used in histograms; do not change order.
@@ -189,7 +189,7 @@
// should complete.
CrxInstallerError AllowInstall(const extensions::Extension* extension);
- // SandboxedExtensionUnpackerClient
+ // SandboxedUnpackerClient
virtual void OnUnpackFailure(const string16& error_message) OVERRIDE;
virtual void OnUnpackSuccess(const FilePath& temp_dir,
const FilePath& extension_dir,
diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h
index eb23402..c2b0089 100644
--- a/chrome/browser/extensions/extension_service.h
+++ b/chrome/browser/extensions/extension_service.h
@@ -38,7 +38,6 @@
#include "chrome/browser/extensions/external_extension_provider_interface.h"
#include "chrome/browser/extensions/pending_extension_manager.h"
#include "chrome/browser/extensions/process_map.h"
-#include "chrome/browser/extensions/sandboxed_extension_unpacker.h"
#include "chrome/browser/prefs/pref_change_registrar.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_constants.h"
diff --git a/chrome/browser/extensions/sandboxed_extension_unpacker.cc b/chrome/browser/extensions/sandboxed_unpacker.cc
similarity index 94%
rename from chrome/browser/extensions/sandboxed_extension_unpacker.cc
rename to chrome/browser/extensions/sandboxed_unpacker.cc
index b7345d2..80520ea 100644
--- a/chrome/browser/extensions/sandboxed_extension_unpacker.cc
+++ b/chrome/browser/extensions/sandboxed_unpacker.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/extensions/sandboxed_extension_unpacker.h"
+#include "chrome/browser/extensions/sandboxed_unpacker.h"
#include <set>
@@ -162,12 +162,14 @@
} // namespace
-SandboxedExtensionUnpacker::SandboxedExtensionUnpacker(
+namespace extensions {
+
+SandboxedUnpacker::SandboxedUnpacker(
const FilePath& crx_path,
bool run_out_of_process,
Extension::Location location,
int creation_flags,
- SandboxedExtensionUnpackerClient* client)
+ SandboxedUnpackerClient* client)
: crx_path_(crx_path),
thread_identifier_(BrowserThread::ID_COUNT),
run_out_of_process_(run_out_of_process),
@@ -177,7 +179,7 @@
creation_flags_(creation_flags) {
}
-bool SandboxedExtensionUnpacker::CreateTempDirectory() {
+bool SandboxedUnpacker::CreateTempDirectory() {
CHECK(BrowserThread::GetCurrentThreadIdentifier(&thread_identifier_));
FilePath temp_dir;
@@ -202,7 +204,7 @@
return true;
}
-void SandboxedExtensionUnpacker::Start() {
+void SandboxedUnpacker::Start() {
// We assume that we are started on the thread that the client wants us to do
// file IO on.
CHECK(BrowserThread::GetCurrentThreadIdentifier(&thread_identifier_));
@@ -247,10 +249,10 @@
!CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess);
if (use_utility_process) {
// The utility process will have access to the directory passed to
- // SandboxedExtensionUnpacker. That directory should not contain a
- // symlink or NTFS reparse point. When the path is used, following
- // the link/reparse point will cause file system access outside the
- // sandbox path, and the sandbox will deny the operation.
+ // SandboxedUnpacker. That directory should not contain a symlink or NTFS
+ // reparse point. When the path is used, following the link/reparse point
+ // will cause file system access outside the sandbox path, and the sandbox
+ // will deny the operation.
FilePath link_free_crx_path;
if (!file_util::NormalizeFilePath(temp_crx_path, &link_free_crx_path)) {
LOG(ERROR) << "Could not get the normalized path of "
@@ -266,7 +268,7 @@
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::Bind(
- &SandboxedExtensionUnpacker::StartProcessOnIOThread,
+ &SandboxedUnpacker::StartProcessOnIOThread,
this,
link_free_crx_path));
} else {
@@ -282,16 +284,15 @@
}
}
-SandboxedExtensionUnpacker::~SandboxedExtensionUnpacker() {
+SandboxedUnpacker::~SandboxedUnpacker() {
base::FileUtilProxy::Delete(
BrowserThread::GetMessageLoopProxyForThread(thread_identifier_),
temp_dir_.Take(), true, base::FileUtilProxy::StatusCallback());
}
-bool SandboxedExtensionUnpacker::OnMessageReceived(
- const IPC::Message& message) {
+bool SandboxedUnpacker::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(SandboxedExtensionUnpacker, message)
+ IPC_BEGIN_MESSAGE_MAP(SandboxedUnpacker, message)
IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_UnpackExtension_Succeeded,
OnUnpackExtensionSucceeded)
IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_UnpackExtension_Failed,
@@ -301,7 +302,7 @@
return handled;
}
-void SandboxedExtensionUnpacker::OnProcessCrashed(int exit_code) {
+void SandboxedUnpacker::OnProcessCrashed(int exit_code) {
// Don't report crashes if they happen after we got a response.
if (got_response_)
return;
@@ -314,8 +315,7 @@
ASCIIToUTF16("UTILITY_PROCESS_CRASHED_WHILE_TRYING_TO_INSTALL")));
}
-void SandboxedExtensionUnpacker::StartProcessOnIOThread(
- const FilePath& temp_crx_path) {
+void SandboxedUnpacker::StartProcessOnIOThread(const FilePath& temp_crx_path) {
UtilityProcessHost* host = UtilityProcessHost::Create(
this, thread_identifier_);
// Grant the subprocess access to the entire subdir the extension file is
@@ -326,7 +326,7 @@
temp_crx_path, extension_id_, location_, creation_flags_));
}
-void SandboxedExtensionUnpacker::OnUnpackExtensionSucceeded(
+void SandboxedUnpacker::OnUnpackExtensionSucceeded(
const DictionaryValue& manifest) {
// Skip check for unittests.
if (thread_identifier_ != BrowserThread::ID_COUNT)
@@ -382,8 +382,7 @@
ReportSuccess(manifest);
}
-void SandboxedExtensionUnpacker::OnUnpackExtensionFailed(
- const string16& error) {
+void SandboxedUnpacker::OnUnpackExtensionFailed(const string16& error) {
CHECK(BrowserThread::CurrentlyOn(thread_identifier_));
got_response_ = true;
ReportFailure(
@@ -393,7 +392,7 @@
error));
}
-bool SandboxedExtensionUnpacker::ValidateSignature() {
+bool SandboxedUnpacker::ValidateSignature() {
ScopedStdioHandle file(file_util::OpenFile(crx_path_, "rb"));
if (!file.get()) {
@@ -556,8 +555,8 @@
return true;
}
-void SandboxedExtensionUnpacker::ReportFailure(FailureReason reason,
- const string16& error) {
+void SandboxedUnpacker::ReportFailure(FailureReason reason,
+ const string16& error) {
UMA_HISTOGRAM_ENUMERATION("Extensions.SandboxUnpackFailureReason",
reason, NUM_FAILURE_REASONS);
UMA_HISTOGRAM_TIMES("Extensions.SandboxUnpackFailureTime",
@@ -566,7 +565,7 @@
client_->OnUnpackFailure(error);
}
-void SandboxedExtensionUnpacker::ReportSuccess(
+void SandboxedUnpacker::ReportSuccess(
const DictionaryValue& original_manifest) {
UMA_HISTOGRAM_COUNTS("Extensions.SandboxUnpackSuccess", 1);
@@ -581,7 +580,7 @@
extension_ = NULL;
}
-DictionaryValue* SandboxedExtensionUnpacker::RewriteManifestFile(
+DictionaryValue* SandboxedUnpacker::RewriteManifestFile(
const DictionaryValue& manifest) {
// Add the public key extracted earlier to the parsed manifest and overwrite
// the original manifest. We do this to ensure the manifest doesn't contain an
@@ -618,7 +617,7 @@
return final_manifest.release();
}
-bool SandboxedExtensionUnpacker::RewriteImageFiles() {
+bool SandboxedUnpacker::RewriteImageFiles() {
ExtensionUnpacker::DecodedImages images;
if (!ExtensionUnpacker::ReadImagesFromFile(temp_dir_.path(), &images)) {
// Couldn't read image data from disk.
@@ -713,7 +712,7 @@
return true;
}
-bool SandboxedExtensionUnpacker::RewriteCatalogFiles() {
+bool SandboxedUnpacker::RewriteCatalogFiles() {
DictionaryValue catalogs;
if (!ExtensionUnpacker::ReadMessageCatalogsFromFile(temp_dir_.path(),
&catalogs)) {
@@ -785,3 +784,5 @@
return true;
}
+
+} // namespace extensions
diff --git a/chrome/browser/extensions/sandboxed_extension_unpacker.h b/chrome/browser/extensions/sandboxed_unpacker.h
similarity index 83%
rename from chrome/browser/extensions/sandboxed_extension_unpacker.h
rename to chrome/browser/extensions/sandboxed_unpacker.h
index e53b908..62f1ee5 100644
--- a/chrome/browser/extensions/sandboxed_extension_unpacker.h
+++ b/chrome/browser/extensions/sandboxed_unpacker.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_EXTENSIONS_SANDBOXED_EXTENSION_UNPACKER_H_
-#define CHROME_BROWSER_EXTENSIONS_SANDBOXED_EXTENSION_UNPACKER_H_
+#ifndef CHROME_BROWSER_EXTENSIONS_SANDBOXED_UNPACKER_H_
+#define CHROME_BROWSER_EXTENSIONS_SANDBOXED_UNPACKER_H_
#pragma once
#include <string>
@@ -19,8 +19,10 @@
class DictionaryValue;
}
-class SandboxedExtensionUnpackerClient
- : public base::RefCountedThreadSafe<SandboxedExtensionUnpackerClient> {
+namespace extensions {
+
+class SandboxedUnpackerClient
+ : public base::RefCountedThreadSafe<SandboxedUnpackerClient> {
public:
// temp_dir - A temporary directory containing the results of the extension
// unpacking. The client is responsible for deleting this directory.
@@ -39,12 +41,12 @@
virtual void OnUnpackFailure(const string16& error) = 0;
protected:
- friend class base::RefCountedThreadSafe<SandboxedExtensionUnpackerClient>;
+ friend class base::RefCountedThreadSafe<SandboxedUnpackerClient>;
- virtual ~SandboxedExtensionUnpackerClient() {}
+ virtual ~SandboxedUnpackerClient() {}
};
-// SandboxedExtensionUnpacker unpacks extensions from the CRX format into a
+// SandboxedUnpacker unpacks extensions from the CRX format into a
// directory. This is done in a sandboxed subprocess to protect the browser
// process from parsing complex formats like JPEG or JSON from untrusted
// sources.
@@ -65,17 +67,17 @@
//
//
// NOTE: This class should only be used on the file thread.
-class SandboxedExtensionUnpacker : public content::UtilityProcessHostClient {
+class SandboxedUnpacker : public content::UtilityProcessHostClient {
public:
// Unpacks the extension in |crx_path| into a temporary directory and calls
// |client| with the result. If |run_out_of_process| is provided, unpacking
// is done in a sandboxed subprocess. Otherwise, it is done in-process.
- SandboxedExtensionUnpacker(const FilePath& crx_path,
+ SandboxedUnpacker(const FilePath& crx_path,
bool run_out_of_process,
extensions::Extension::Location location,
int creation_flags,
- SandboxedExtensionUnpackerClient* client);
+ SandboxedUnpackerClient* client);
// Start unpacking the extension. The client is called with the results.
void Start();
@@ -87,25 +89,25 @@
// take a failure reason as an argument, and put it in histogram
// Extensions.SandboxUnpackFailureReason.
enum FailureReason {
- // SandboxedExtensionUnpacker::CreateTempDirectory()
+ // SandboxedUnpacker::CreateTempDirectory()
COULD_NOT_GET_TEMP_DIRECTORY,
COULD_NOT_CREATE_TEMP_DIRECTORY,
- // SandboxedExtensionUnpacker::Start()
+ // SandboxedUnpacker::Start()
FAILED_TO_COPY_EXTENSION_FILE_TO_TEMP_DIRECTORY,
COULD_NOT_GET_SANDBOX_FRIENDLY_PATH,
- // SandboxedExtensionUnpacker::OnUnpackExtensionSucceeded()
+ // SandboxedUnpacker::OnUnpackExtensionSucceeded()
COULD_NOT_LOCALIZE_EXTENSION,
INVALID_MANIFEST,
- // SandboxedExtensionUnpacker::OnUnpackExtensionFailed()
+ // SandboxedUnpacker::OnUnpackExtensionFailed()
UNPACKER_CLIENT_FAILED,
- // SandboxedExtensionUnpacker::OnProcessCrashed()
+ // SandboxedUnpacker::OnProcessCrashed()
UTILITY_PROCESS_CRASHED_WHILE_TRYING_TO_INSTALL,
- // SandboxedExtensionUnpacker::ValidateSignature()
+ // SandboxedUnpacker::ValidateSignature()
CRX_FILE_NOT_READABLE,
CRX_HEADER_INVALID,
CRX_MAGIC_NUMBER_INVALID,
@@ -118,11 +120,11 @@
CRX_SIGNATURE_VERIFICATION_INITIALIZATION_FAILED,
CRX_SIGNATURE_VERIFICATION_FAILED,
- // SandboxedExtensionUnpacker::RewriteManifestFile()
+ // SandboxedUnpacker::RewriteManifestFile()
ERROR_SERIALIZING_MANIFEST_JSON,
ERROR_SAVING_MANIFEST_JSON,
- // SandboxedExtensionUnpacker::RewriteImageFiles()
+ // SandboxedUnpacker::RewriteImageFiles()
COULD_NOT_READ_IMAGE_DATA_FROM_DISK,
DECODED_IMAGES_DO_NOT_MATCH_THE_MANIFEST,
INVALID_PATH_FOR_BROWSER_IMAGE,
@@ -131,7 +133,7 @@
ERROR_RE_ENCODING_THEME_IMAGE,
ERROR_SAVING_THEME_IMAGE,
- // SandboxedExtensionUnpacker::RewriteCatalogFiles()
+ // SandboxedUnpacker::RewriteCatalogFiles()
COULD_NOT_READ_CATALOG_DATA_FROM_DISK,
INVALID_CATALOG_DATA,
INVALID_PATH_FOR_CATALOG,
@@ -142,9 +144,9 @@
};
friend class ProcessHostClient;
- friend class SandboxedExtensionUnpackerTest;
+ friend class SandboxedUnpackerTest;
- virtual ~SandboxedExtensionUnpacker();
+ virtual ~SandboxedUnpacker();
// Set |temp_dir_| as a temporary directory to unpack the extension in.
// Return true on success.
@@ -195,7 +197,7 @@
bool run_out_of_process_;
// Our client.
- scoped_refptr<SandboxedExtensionUnpackerClient> client_;
+ scoped_refptr<SandboxedUnpackerClient> client_;
// A temporary directory to use for unpacking.
ScopedTempDir temp_dir_;
@@ -227,4 +229,6 @@
int creation_flags_;
};
-#endif // CHROME_BROWSER_EXTENSIONS_SANDBOXED_EXTENSION_UNPACKER_H_
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_SANDBOXED_UNPACKER_H_
diff --git a/chrome/browser/extensions/sandboxed_extension_unpacker_unittest.cc b/chrome/browser/extensions/sandboxed_unpacker_unittest.cc
similarity index 86%
rename from chrome/browser/extensions/sandboxed_extension_unpacker_unittest.cc
rename to chrome/browser/extensions/sandboxed_unpacker_unittest.cc
index 84188c95..01c396ad 100644
--- a/chrome/browser/extensions/sandboxed_extension_unpacker_unittest.cc
+++ b/chrome/browser/extensions/sandboxed_unpacker_unittest.cc
@@ -10,7 +10,7 @@
#include "base/scoped_temp_dir.h"
#include "base/string_util.h"
#include "base/values.h"
-#include "chrome/browser/extensions/sandboxed_extension_unpacker.h"
+#include "chrome/browser/extensions/sandboxed_unpacker.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_manifest_constants.h"
@@ -24,7 +24,6 @@
namespace keys = extension_manifest_keys;
using content::BrowserThread;
-using extensions::Extension;
using testing::_;
using testing::Invoke;
@@ -33,14 +32,15 @@
void OnUnpackSuccess(const FilePath& temp_dir,
const FilePath& extension_root,
const DictionaryValue* original_manifest,
- const Extension* extension) {
+ const extensions::Extension* extension) {
// Don't delete temp_dir here, we need to do some post op checking.
}
} // namespace
-class MockSandboxedExtensionUnpackerClient
- : public SandboxedExtensionUnpackerClient {
+namespace extensions {
+
+class MockSandboxedUnpackerClient : public SandboxedUnpackerClient {
public:
MOCK_METHOD4(OnUnpackSuccess,
void(const FilePath& temp_dir,
@@ -57,22 +57,22 @@
}
protected:
- virtual ~MockSandboxedExtensionUnpackerClient() {}
+ virtual ~MockSandboxedUnpackerClient() {}
};
-class SandboxedExtensionUnpackerTest : public testing::Test {
+class SandboxedUnpackerTest : public testing::Test {
public:
virtual void SetUp() {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
file_thread_.reset(new content::TestBrowserThread(BrowserThread::FILE,
&loop_));
// It will delete itself.
- client_ = new MockSandboxedExtensionUnpackerClient;
+ client_ = new MockSandboxedUnpackerClient;
client_->DelegateToFake();
}
virtual void TearDown() {
- // Need to destruct SandboxedExtensionUnpacker before the message loop since
+ // Need to destruct SandboxedUnpacker before the message loop since
// it posts a task to it.
sandboxed_unpacker_ = NULL;
loop_.RunAllPending();
@@ -99,14 +99,14 @@
// Build a temp area where the extension will be unpacked.
temp_path_ =
- temp_dir_.path().AppendASCII("sandboxed_extension_unpacker_test_Temp");
+ temp_dir_.path().AppendASCII("sandboxed_unpacker_test_Temp");
ASSERT_TRUE(file_util::CreateDirectory(temp_path_));
sandboxed_unpacker_ =
- new SandboxedExtensionUnpacker(crx_path, false, Extension::INTERNAL,
- Extension::NO_FLAGS, client_);
+ new SandboxedUnpacker(crx_path, false, Extension::INTERNAL,
+ Extension::NO_FLAGS, client_);
- // Hack since SandboxedExtensionUnpacker gets its background thread id from
+ // Hack since SandboxedUnpacker gets its background thread id from
// the Start call, but we don't call it here.
sandboxed_unpacker_->thread_identifier_ = BrowserThread::FILE;
EXPECT_TRUE(PrepareUnpackerEnv());
@@ -160,14 +160,14 @@
protected:
ScopedTempDir temp_dir_;
FilePath temp_path_;
- MockSandboxedExtensionUnpackerClient* client_;
+ MockSandboxedUnpackerClient* client_;
scoped_ptr<ExtensionUnpacker> unpacker_;
- scoped_refptr<SandboxedExtensionUnpacker> sandboxed_unpacker_;
+ scoped_refptr<SandboxedUnpacker> sandboxed_unpacker_;
MessageLoop loop_;
scoped_ptr<content::TestBrowserThread> file_thread_;
};
-TEST_F(SandboxedExtensionUnpackerTest, NoCatalogsSuccess) {
+TEST_F(SandboxedUnpackerTest, NoCatalogsSuccess) {
EXPECT_CALL(*client_, OnUnpackSuccess(_, _, _, _));
EXPECT_CALL(*client_, OnUnpackFailure(_)).Times(0);
@@ -189,7 +189,7 @@
ASSERT_TRUE(TempFilesRemoved());
}
-TEST_F(SandboxedExtensionUnpackerTest, WithCatalogsSuccess) {
+TEST_F(SandboxedUnpackerTest, WithCatalogsSuccess) {
EXPECT_CALL(*client_, OnUnpackSuccess(_, _, _, _));
EXPECT_CALL(*client_, OnUnpackFailure(_)).Times(0);
@@ -221,3 +221,5 @@
ASSERT_TRUE(TempFilesRemoved());
}
+
+} // namespace extensions