Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(760)

Side by Side Diff: content/browser/indexed_db/indexed_db_active_blob_registry_unittest.cc

Issue 417573004: indexeddb: Removed use of dangling ptr in writeBlobToFileOnIOThread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Also scoped LocalWriteClosure::task_runner_ Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/indexed_db/indexed_db_backing_store.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <set> 5 #include <set>
6 6
7 #include "base/test/test_simple_task_runner.h" 7 #include "base/test/test_simple_task_runner.h"
8 #include "content/browser/indexed_db/indexed_db_active_blob_registry.h" 8 #include "content/browser/indexed_db/indexed_db_active_blob_registry.h"
9 #include "content/browser/indexed_db/indexed_db_backing_store.h" 9 #include "content/browser/indexed_db/indexed_db_backing_store.h"
10 #include "content/browser/indexed_db/indexed_db_factory_impl.h" 10 #include "content/browser/indexed_db/indexed_db_factory_impl.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 private: 49 private:
50 std::set<GURL> origins_; 50 std::set<GURL> origins_;
51 bool duplicate_calls_; 51 bool duplicate_calls_;
52 52
53 DISALLOW_COPY_AND_ASSIGN(MockIDBFactory); 53 DISALLOW_COPY_AND_ASSIGN(MockIDBFactory);
54 }; 54 };
55 55
56 class MockIDBBackingStore : public IndexedDBFakeBackingStore { 56 class MockIDBBackingStore : public IndexedDBFakeBackingStore {
57 public: 57 public:
58 MockIDBBackingStore(IndexedDBFactory* factory, base::TaskRunner* task_runner) 58 MockIDBBackingStore(IndexedDBFactory* factory,
59 base::SequencedTaskRunner* task_runner)
59 : IndexedDBFakeBackingStore(factory, task_runner), 60 : IndexedDBFakeBackingStore(factory, task_runner),
60 duplicate_calls_(false) {} 61 duplicate_calls_(false) {}
61 62
62 virtual void ReportBlobUnused(int64 database_id, int64 blob_key) OVERRIDE { 63 virtual void ReportBlobUnused(int64 database_id, int64 blob_key) OVERRIDE {
63 unused_blobs_.insert(std::make_pair(database_id, blob_key)); 64 unused_blobs_.insert(std::make_pair(database_id, blob_key));
64 } 65 }
65 66
66 typedef std::pair<int64, int64> KeyPair; 67 typedef std::pair<int64, int64> KeyPair;
67 typedef std::set<KeyPair> KeyPairSet; 68 typedef std::set<KeyPair> KeyPairSet;
68 bool CheckUnusedBlobsEmpty() const { 69 bool CheckUnusedBlobsEmpty() const {
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 RunUntilIdle(); 266 RunUntilIdle();
266 267
267 // Nothing changes. 268 // Nothing changes.
268 EXPECT_TRUE(factory()->CheckSingleOriginInUse(backing_store()->origin_url())); 269 EXPECT_TRUE(factory()->CheckSingleOriginInUse(backing_store()->origin_url()));
269 EXPECT_TRUE(backing_store()->CheckUnusedBlobsEmpty()); 270 EXPECT_TRUE(backing_store()->CheckUnusedBlobsEmpty());
270 } 271 }
271 272
272 } // namespace 273 } // namespace
273 274
274 } // namespace content 275 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/indexed_db/indexed_db_backing_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698