diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-18 21:54:27 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-18 21:54:27 +0000 |
commit | 65db239dbd6315e1e66f696579627c388360b367 (patch) | |
tree | bd89ca255fa8a60ddc5ee29bdf32a60e436440c0 /webkit/fileapi/sandbox_mount_point_provider_unittest.cc | |
parent | fb76114572fbb128d2d8c4806d6f71e0da4f2835 (diff) | |
download | chromium_src-65db239dbd6315e1e66f696579627c388360b367.zip chromium_src-65db239dbd6315e1e66f696579627c388360b367.tar.gz chromium_src-65db239dbd6315e1e66f696579627c388360b367.tar.bz2 |
base::Bind: Convert FileSystemPathManager::GetRootPathCallback.
BUG=none
TEST=none
R=csilv@chromium.org
Review URL: http://codereview.chromium.org/8342008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106139 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi/sandbox_mount_point_provider_unittest.cc')
-rw-r--r-- | webkit/fileapi/sandbox_mount_point_provider_unittest.cc | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/webkit/fileapi/sandbox_mount_point_provider_unittest.cc b/webkit/fileapi/sandbox_mount_point_provider_unittest.cc index 77f9d24..60ad07e 100644 --- a/webkit/fileapi/sandbox_mount_point_provider_unittest.cc +++ b/webkit/fileapi/sandbox_mount_point_provider_unittest.cc @@ -8,10 +8,11 @@ #include <string> #include "base/basictypes.h" +#include "base/bind.h" #include "base/file_util.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_callback_factory.h" #include "base/memory/scoped_ptr.h" +#include "base/memory/weak_ptr.h" #include "base/message_loop.h" #include "base/message_loop_proxy.h" #include "base/platform_file.h" @@ -133,7 +134,7 @@ const MigrationTestCaseRecord kMigrationTestRecords[] = { class SandboxMountPointProviderMigrationTest : public testing::Test { public: SandboxMountPointProviderMigrationTest() : - ALLOW_THIS_IN_INITIALIZER_LIST(callback_factory_(this)) { + ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { } void SetUp() { @@ -171,9 +172,9 @@ class SandboxMountPointProviderMigrationTest : public testing::Test { EXPECT_FALSE(success); // We told it not to create. } - FileSystemPathManager::GetRootPathCallback* GetRootPathCallback() { - return callback_factory_.NewCallback( - &SandboxMountPointProviderMigrationTest::OnGetRootPath); + FileSystemPathManager::GetRootPathCallback GetRootPathCallback() { + return base::Bind(&SandboxMountPointProviderMigrationTest::OnGetRootPath, + weak_factory_.GetWeakPtr()); } void EnsureFileExists(const FilePath& path) { @@ -286,16 +287,14 @@ class SandboxMountPointProviderMigrationTest : public testing::Test { std::set<GURL> origins; std::string host = "the host with the most"; int64 delta = 0; - scoped_ptr<FileSystemPathManager::GetRootPathCallback> callback; // We want to make sure that all the public methods of // SandboxMountPointProvider which might access the filesystem will cause a // migration if one is needed. switch (method) { case 0: - callback.reset(GetRootPathCallback()); sandbox_provider()->ValidateFileSystemRootAndGetURL( - origin_url, type, create, callback.release()); + origin_url, type, create, GetRootPathCallback()); MessageLoop::current()->RunAllPending(); break; case 1: @@ -360,8 +359,7 @@ class SandboxMountPointProviderMigrationTest : public testing::Test { ScopedTempDir data_dir_; FileSystemPathManager* path_manager_; scoped_refptr<FileSystemContext> file_system_context_; - base::ScopedCallbackFactory<SandboxMountPointProviderMigrationTest> - callback_factory_; + base::WeakPtrFactory<SandboxMountPointProviderMigrationTest> weak_factory_; }; TEST_F(SandboxMountPointProviderMigrationTest, TestMigrateViaMethod0) { |