| Index: content/browser/in_process_webkit/indexed_db_quota_client_unittest.cc
|
| diff --git a/content/browser/in_process_webkit/indexed_db_quota_client_unittest.cc b/content/browser/in_process_webkit/indexed_db_quota_client_unittest.cc
|
| index 72fdc49d1bba8da088669f3b401a7fa87cc4fb9f..19a7bed04e534bf4d345997e5f45e1849f89cf93 100644
|
| --- a/content/browser/in_process_webkit/indexed_db_quota_client_unittest.cc
|
| +++ b/content/browser/in_process_webkit/indexed_db_quota_client_unittest.cc
|
| @@ -4,6 +4,7 @@
|
|
|
| #include <map>
|
|
|
| +#include "base/bind.h"
|
| #include "base/file_path.h"
|
| #include "base/file_util.h"
|
| #include "base/memory/scoped_callback_factory.h"
|
| @@ -34,7 +35,7 @@ class IndexedDBQuotaClientTest : public testing::Test {
|
| kOriginB("http://host:8000"),
|
| kOriginOther("http://other"),
|
| usage_(0),
|
| - callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
|
| + weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
|
| message_loop_(MessageLoop::TYPE_IO),
|
| webkit_thread_(BrowserThread::WEBKIT, &message_loop_),
|
| io_thread_(BrowserThread::IO, &message_loop_) {
|
| @@ -63,9 +64,10 @@ class IndexedDBQuotaClientTest : public testing::Test {
|
| const GURL& origin,
|
| quota::StorageType type) {
|
| usage_ = -1;
|
| - client->GetOriginUsage(origin, type,
|
| - callback_factory_.NewCallback(
|
| - &IndexedDBQuotaClientTest::OnGetOriginUsageComplete));
|
| + client->GetOriginUsage(
|
| + origin, type,
|
| + base::Bind(&IndexedDBQuotaClientTest::OnGetOriginUsageComplete,
|
| + weak_factory_.GetWeakPtr()));
|
| MessageLoop::current()->RunAllPending();
|
| EXPECT_GT(usage_, -1);
|
| return usage_;
|
| @@ -76,9 +78,10 @@ class IndexedDBQuotaClientTest : public testing::Test {
|
| quota::StorageType type) {
|
| origins_.clear();
|
| type_ = quota::kStorageTypeTemporary;
|
| - client->GetOriginsForType(type,
|
| - callback_factory_.NewCallback(
|
| - &IndexedDBQuotaClientTest::OnGetOriginsComplete));
|
| + client->GetOriginsForType(
|
| + type,
|
| + base::Bind(&IndexedDBQuotaClientTest::OnGetOriginsComplete,
|
| + weak_factory_.GetWeakPtr()));
|
| MessageLoop::current()->RunAllPending();
|
| return origins_;
|
| }
|
| @@ -89,9 +92,10 @@ class IndexedDBQuotaClientTest : public testing::Test {
|
| const std::string& host) {
|
| origins_.clear();
|
| type_ = quota::kStorageTypeTemporary;
|
| - client->GetOriginsForHost(type, host,
|
| - callback_factory_.NewCallback(
|
| - &IndexedDBQuotaClientTest::OnGetOriginsComplete));
|
| + client->GetOriginsForHost(
|
| + type, host,
|
| + base::Bind(&IndexedDBQuotaClientTest::OnGetOriginsComplete,
|
| + weak_factory_.GetWeakPtr()));
|
| MessageLoop::current()->RunAllPending();
|
| return origins_;
|
| }
|
| @@ -99,8 +103,10 @@ class IndexedDBQuotaClientTest : public testing::Test {
|
| quota::QuotaStatusCode DeleteOrigin(quota::QuotaClient* client,
|
| const GURL& origin_url) {
|
| delete_status_ = quota::kQuotaStatusUnknown;
|
| - client->DeleteOriginData(origin_url, kTemp, callback_factory_.NewCallback(
|
| - &IndexedDBQuotaClientTest::OnDeleteOriginComplete));
|
| + client->DeleteOriginData(
|
| + origin_url, kTemp,
|
| + base::Bind(&IndexedDBQuotaClientTest::OnDeleteOriginComplete,
|
| + weak_factory_.GetWeakPtr()));
|
| MessageLoop::current()->RunAllPending();
|
| return delete_status_;
|
| }
|
| @@ -144,7 +150,7 @@ class IndexedDBQuotaClientTest : public testing::Test {
|
| std::set<GURL> origins_;
|
| quota::StorageType type_;
|
| scoped_refptr<IndexedDBContext> idb_context_;
|
| - base::ScopedCallbackFactory<IndexedDBQuotaClientTest> callback_factory_;
|
| + base::WeakPtrFactory<IndexedDBQuotaClientTest> weak_factory_;
|
| MessageLoop message_loop_;
|
| BrowserThread webkit_thread_;
|
| BrowserThread io_thread_;
|
|
|