| OLD | NEW |
| 1 // Copyright (c) 2011 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" |
| 11 #include "base/location.h" | 11 #include "base/location.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 base::Unretained(this))); | 166 base::Unretained(this))); |
| 167 if (rv == net::ERR_IO_PENDING) | 167 if (rv == net::ERR_IO_PENDING) |
| 168 return false; // we wait for the callback | 168 return false; // we wait for the callback |
| 169 OnCompletionCallback(rv); | 169 OnCompletionCallback(rv); |
| 170 return false; | 170 return false; |
| 171 } | 171 } |
| 172 | 172 |
| 173 void OnCompletionCallback(int rv) { | 173 void OnCompletionCallback(int rv) { |
| 174 if (rv == net::OK) | 174 if (rv == net::OK) |
| 175 result_ = quota::kQuotaStatusOk; | 175 result_ = quota::kQuotaStatusOk; |
| 176 original_message_loop()->PostTask( | 176 original_task_runner()->PostTask( |
| 177 FROM_HERE, base::Bind(&DeleteOriginTask::CallCompleted, this)); | 177 FROM_HERE, base::Bind(&DeleteOriginTask::CallCompleted, this)); |
| 178 Release(); // balanced in RunOnTargetThreadAsync | 178 Release(); // balanced in RunOnTargetThreadAsync |
| 179 } | 179 } |
| 180 | 180 |
| 181 const GURL origin_url_; | 181 const GURL origin_url_; |
| 182 quota::QuotaStatusCode result_; | 182 quota::QuotaStatusCode result_; |
| 183 DeletionCallback caller_callback_; | 183 DeletionCallback caller_callback_; |
| 184 net::CompletionCallback completion_callback_; | 184 net::CompletionCallback completion_callback_; |
| 185 }; | 185 }; |
| 186 | 186 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 } | 293 } |
| 294 | 294 |
| 295 void DatabaseQuotaClient::DidGetOriginsForHost( | 295 void DatabaseQuotaClient::DidGetOriginsForHost( |
| 296 const std::string& host, const std::set<GURL>& origins, | 296 const std::string& host, const std::set<GURL>& origins, |
| 297 quota::StorageType type) { | 297 quota::StorageType type) { |
| 298 DCHECK(origins_for_host_callbacks_.HasCallbacks(host)); | 298 DCHECK(origins_for_host_callbacks_.HasCallbacks(host)); |
| 299 origins_for_host_callbacks_.Run(host, origins, type); | 299 origins_for_host_callbacks_.Run(host, origins, type); |
| 300 } | 300 } |
| 301 | 301 |
| 302 } // namespace webkit_database | 302 } // namespace webkit_database |
| OLD | NEW |