OLD | NEW |
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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/location.h" | 6 #include "base/location.h" |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "base/task_runner.h" | 8 #include "base/task_runner.h" |
9 #include "content/browser/indexed_db/indexed_db_active_blob_registry.h" | 9 #include "content/browser/indexed_db/indexed_db_active_blob_registry.h" |
10 #include "content/browser/indexed_db/indexed_db_backing_store.h" | 10 #include "content/browser/indexed_db/indexed_db_backing_store.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 int64 database_id, | 111 int64 database_id, |
112 int64 blob_key, | 112 int64 blob_key, |
113 const base::FilePath& unused) { | 113 const base::FilePath& unused) { |
114 task_runner->PostTask(FROM_HERE, | 114 task_runner->PostTask(FROM_HERE, |
115 base::Bind(&IndexedDBActiveBlobRegistry::ReleaseBlobRef, | 115 base::Bind(&IndexedDBActiveBlobRegistry::ReleaseBlobRef, |
116 weak_ptr, | 116 weak_ptr, |
117 database_id, | 117 database_id, |
118 blob_key)); | 118 blob_key)); |
119 } | 119 } |
120 | 120 |
121 webkit_blob::ShareableFileReference::FinalReleaseCallback | 121 storage::ShareableFileReference::FinalReleaseCallback |
122 IndexedDBActiveBlobRegistry::GetFinalReleaseCallback(int64 database_id, | 122 IndexedDBActiveBlobRegistry::GetFinalReleaseCallback(int64 database_id, |
123 int64 blob_key) { | 123 int64 blob_key) { |
124 return base::Bind( | 124 return base::Bind( |
125 &IndexedDBActiveBlobRegistry::ReleaseBlobRefThreadSafe, | 125 &IndexedDBActiveBlobRegistry::ReleaseBlobRefThreadSafe, |
126 scoped_refptr<base::TaskRunner>(backing_store_->task_runner()), | 126 scoped_refptr<base::TaskRunner>(backing_store_->task_runner()), |
127 weak_factory_.GetWeakPtr(), | 127 weak_factory_.GetWeakPtr(), |
128 database_id, | 128 database_id, |
129 blob_key); | 129 blob_key); |
130 } | 130 } |
131 | 131 |
132 base::Closure IndexedDBActiveBlobRegistry::GetAddBlobRefCallback( | 132 base::Closure IndexedDBActiveBlobRegistry::GetAddBlobRefCallback( |
133 int64 database_id, | 133 int64 database_id, |
134 int64 blob_key) { | 134 int64 blob_key) { |
135 return base::Bind(&IndexedDBActiveBlobRegistry::AddBlobRef, | 135 return base::Bind(&IndexedDBActiveBlobRegistry::AddBlobRef, |
136 weak_factory_.GetWeakPtr(), | 136 weak_factory_.GetWeakPtr(), |
137 database_id, | 137 database_id, |
138 blob_key); | 138 blob_key); |
139 } | 139 } |
140 | 140 |
141 void IndexedDBActiveBlobRegistry::ForceShutdown() { | 141 void IndexedDBActiveBlobRegistry::ForceShutdown() { |
142 weak_factory_.InvalidateWeakPtrs(); | 142 weak_factory_.InvalidateWeakPtrs(); |
143 use_tracker_.clear(); | 143 use_tracker_.clear(); |
144 backing_store_ = NULL; | 144 backing_store_ = NULL; |
145 } | 145 } |
146 | 146 |
147 } // namespace content | 147 } // namespace content |
OLD | NEW |