OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "webkit/database/database_quota_client.h" | 5 #include "webkit/database/database_quota_client.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 DCHECK(!callback.is_null()); | 118 DCHECK(!callback.is_null()); |
119 DCHECK(db_tracker_.get()); | 119 DCHECK(db_tracker_.get()); |
120 | 120 |
121 // All databases are in the temp namespace for now. | 121 // All databases are in the temp namespace for now. |
122 if (type != quota::kStorageTypeTemporary) { | 122 if (type != quota::kStorageTypeTemporary) { |
123 callback.Run(0); | 123 callback.Run(0); |
124 return; | 124 return; |
125 } | 125 } |
126 | 126 |
127 base::PostTaskAndReplyWithResult( | 127 base::PostTaskAndReplyWithResult( |
128 db_tracker_thread_, | 128 db_tracker_thread_.get(), |
129 FROM_HERE, | 129 FROM_HERE, |
130 base::Bind(&GetOriginUsageOnDBThread, | 130 base::Bind(&GetOriginUsageOnDBThread, |
131 db_tracker_, | 131 db_tracker_, |
132 origin_url), | 132 origin_url), |
133 callback); | 133 callback); |
134 } | 134 } |
135 | 135 |
136 void DatabaseQuotaClient::GetOriginsForType( | 136 void DatabaseQuotaClient::GetOriginsForType( |
137 quota::StorageType type, | 137 quota::StorageType type, |
138 const GetOriginsCallback& callback) { | 138 const GetOriginsCallback& callback) { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 callback.Run(quota::kQuotaStatusOk); | 195 callback.Run(quota::kQuotaStatusOk); |
196 return; | 196 return; |
197 } | 197 } |
198 | 198 |
199 base::Callback<void(int)> delete_callback = | 199 base::Callback<void(int)> delete_callback = |
200 base::Bind(&DidDeleteOriginData, | 200 base::Bind(&DidDeleteOriginData, |
201 base::MessageLoopProxy::current(), | 201 base::MessageLoopProxy::current(), |
202 callback); | 202 callback); |
203 | 203 |
204 PostTaskAndReplyWithResult( | 204 PostTaskAndReplyWithResult( |
205 db_tracker_thread_, | 205 db_tracker_thread_.get(), |
206 FROM_HERE, | 206 FROM_HERE, |
207 base::Bind(&DatabaseTracker::DeleteDataForOrigin, | 207 base::Bind(&DatabaseTracker::DeleteDataForOrigin, |
208 db_tracker_, | 208 db_tracker_, |
209 DatabaseUtil::GetOriginIdentifier(origin), | 209 DatabaseUtil::GetOriginIdentifier(origin), |
210 delete_callback), | 210 delete_callback), |
211 delete_callback); | 211 delete_callback); |
212 } | 212 } |
213 | 213 |
214 } // namespace webkit_database | 214 } // namespace webkit_database |
OLD | NEW |