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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 if (rv == net::ERR_IO_PENDING) | 185 if (rv == net::ERR_IO_PENDING) |
186 return false; // we wait for the callback | 186 return false; // we wait for the callback |
187 OnCompletionCallback(rv); | 187 OnCompletionCallback(rv); |
188 return false; | 188 return false; |
189 } | 189 } |
190 | 190 |
191 private: | 191 private: |
192 void OnCompletionCallback(int rv) { | 192 void OnCompletionCallback(int rv) { |
193 if (rv == net::OK) | 193 if (rv == net::OK) |
194 result_ = quota::kQuotaStatusOk; | 194 result_ = quota::kQuotaStatusOk; |
195 original_message_loop()->PostTask( | 195 original_task_runner()->PostTask( |
196 FROM_HERE, base::Bind(&DeleteOriginTask::CallCompleted, this)); | 196 FROM_HERE, base::Bind(&DeleteOriginTask::CallCompleted, this)); |
197 Release(); // balanced in RunOnTargetThreadAsync | 197 Release(); // balanced in RunOnTargetThreadAsync |
198 } | 198 } |
199 | 199 |
200 const GURL origin_url_; | 200 const GURL origin_url_; |
201 quota::QuotaStatusCode result_; | 201 quota::QuotaStatusCode result_; |
202 DeletionCallback caller_callback_; | 202 DeletionCallback caller_callback_; |
203 net::CompletionCallback completion_callback_; | 203 net::CompletionCallback completion_callback_; |
204 }; | 204 }; |
205 | 205 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 } | 312 } |
313 | 313 |
314 void DatabaseQuotaClient::DidGetOriginsForHost( | 314 void DatabaseQuotaClient::DidGetOriginsForHost( |
315 const std::string& host, const std::set<GURL>& origins, | 315 const std::string& host, const std::set<GURL>& origins, |
316 quota::StorageType type) { | 316 quota::StorageType type) { |
317 DCHECK(origins_for_host_callbacks_.HasCallbacks(host)); | 317 DCHECK(origins_for_host_callbacks_.HasCallbacks(host)); |
318 origins_for_host_callbacks_.Run(host, origins, type); | 318 origins_for_host_callbacks_.Run(host, origins, type); |
319 } | 319 } |
320 | 320 |
321 } // namespace webkit_database | 321 } // namespace webkit_database |
OLD | NEW |