Chromium Code Reviews| Index: net/disk_cache/entry_unittest.cc |
| diff --git a/net/disk_cache/entry_unittest.cc b/net/disk_cache/entry_unittest.cc |
| index f54cec0f770e72379dd6f366b8deca703fa76b83..bbf1e433bf3c4804b89e214a4a10bed3167737db 100644 |
| --- a/net/disk_cache/entry_unittest.cc |
| +++ b/net/disk_cache/entry_unittest.cc |
| @@ -2025,17 +2025,17 @@ TEST_F(DiskCacheEntryTest, MemoryOnlyDoomSparseEntry) { |
| // way to simulate a race is to execute what we want on the callback. |
| class SparseTestCompletionCallback: public net::TestCompletionCallback { |
| public: |
| - explicit SparseTestCompletionCallback(disk_cache::Backend* cache) |
| + explicit SparseTestCompletionCallback(scoped_ptr<disk_cache::Backend>* cache) |
|
rvargas (doing something else)
2013/07/26 21:05:01
nit: this is kind of ugly :(. The argument suggest
qsr
2013/07/29 08:26:28
Given that this is a pointer to the scoped_ptr, an
|
| : cache_(cache) { |
| } |
| private: |
| virtual void SetResult(int result) OVERRIDE { |
| - delete cache_; |
| + cache_->reset(); |
| TestCompletionCallback::SetResult(result); |
| } |
| - disk_cache::Backend* cache_; |
| + scoped_ptr<disk_cache::Backend>* cache_; |
| DISALLOW_COPY_AND_ASSIGN(SparseTestCompletionCallback); |
| }; |
| @@ -2063,13 +2063,10 @@ TEST_F(DiskCacheEntryTest, DoomSparseEntry2) { |
| EXPECT_EQ(9, cache_->GetEntryCount()); |
| entry->Close(); |
| - SparseTestCompletionCallback cb(cache_); |
| + SparseTestCompletionCallback cb(&cache_); |
| int rv = cache_->DoomEntry(key, cb.callback()); |
| EXPECT_EQ(net::ERR_IO_PENDING, rv); |
| EXPECT_EQ(net::OK, cb.WaitForResult()); |
| - |
| - // TearDown will attempt to delete the cache_. |
| - cache_ = NULL; |
| } |
| void DiskCacheEntryTest::PartialSparseEntry() { |