Chromium Code Reviews| Index: webkit/fileapi/sandbox_quota_client.cc |
| diff --git a/webkit/fileapi/sandbox_quota_client.cc b/webkit/fileapi/sandbox_quota_client.cc |
| index b35e7ba23c7e3c874b268dd6bf7faf21a3dea115..b596d7b5224be21931f751a10ab9516f9f35b2aa 100644 |
| --- a/webkit/fileapi/sandbox_quota_client.cc |
| +++ b/webkit/fileapi/sandbox_quota_client.cc |
| @@ -289,4 +289,53 @@ void SandboxQuotaClient::DidGetOriginsForHost( |
| pending_origins_for_host_callbacks_.Run(type_and_host, origins); |
| } |
| +class SandboxQuotaClient::DeleteOriginTask |
|
michaeln
2011/05/13 07:28:02
probably better to move this class definition up i
tzik (google)
2011/05/13 14:22:24
Done.
|
| + : public QuotaThreadTask { |
| + public: |
| + DeleteOriginTask( |
| + SandboxQuotaClient* quota_client, |
| + scoped_refptr<MessageLoopProxy> file_message_loop, |
| + const GURL& origin, |
| + FileSystemType type, |
| + DeletionCallback* callback) |
| + : QuotaThreadTask(quota_client, file_message_loop), |
| + file_system_context_(quota_client->file_system_context_), |
| + origin_(origin), |
| + type_(type), |
| + status_(quota::kQuotaStatusUnknown), |
| + callback_(callback) { |
| + } |
| + |
| + virtual ~DeleteOriginTask() {} |
| + |
| + virtual void RunOnTargetThread() OVERRIDE { |
| + if (file_system_context_-> |
| + DeleteDataForOriginAndTypeOnFileThread(origin_, type_)) |
|
kinuko
2011/05/13 07:26:00
style-nit: weird indentation
file_system_context_
tzik (google)
2011/05/13 14:22:24
Done.
|
| + status_ = quota::kQuotaStatusOk; |
| + else |
| + status_ = quota::kQuotaErrorInvalidModification; |
| + } |
| + |
| + virtual void Completed() OVERRIDE { |
| + callback_->Run(status_); |
|
michaeln
2011/05/13 07:28:02
i'm not sure if the callbacks are expected to be r
tzik (google)
2011/05/13 14:22:24
We believe, that's no problem. It's same to others
|
| + } |
| + private: |
| + FileSystemContext* file_system_context_; |
| + GURL origin_; |
| + FileSystemType type_; |
| + quota::QuotaStatusCode status_; |
| + scoped_ptr<DeletionCallback> callback_; |
| +}; |
| + |
| +void SandboxQuotaClient::DeleteOriginData(const GURL& origin, |
|
michaeln
2011/05/13 07:28:02
please move this method up in the .cc file to matc
tzik (google)
2011/05/13 14:22:24
Done.
|
| + StorageType type, |
| + DeletionCallback* callback) { |
| + FileSystemType fs_type = QuotaStorageTypeToFileSystemType(type); |
| + DCHECK(fs_type != kFileSystemTypeUnknown); |
| + scoped_refptr<DeleteOriginTask> task( |
| + new DeleteOriginTask(this, file_message_loop_, |
| + origin, fs_type, callback)); |
| + task->Start(); |
| +} |
| + |
| } // namespace fileapi |