OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/fileapi/sandboxed_file_system_operation.h" | 5 #include "webkit/fileapi/sandboxed_file_system_operation.h" |
6 | 6 |
7 #include "net/url_request/url_request_context.h" | 7 #include "net/url_request/url_request_context.h" |
8 #include "webkit/fileapi/file_system_callback_dispatcher.h" | 8 #include "webkit/fileapi/file_system_callback_dispatcher.h" |
9 #include "webkit/fileapi/file_system_path_manager.h" | 9 #include "webkit/fileapi/file_system_path_manager.h" |
10 #include "webkit/fileapi/file_system_quota_manager.h" | 10 #include "webkit/fileapi/file_system_quota_manager.h" |
11 #include "webkit/fileapi/sandboxed_file_system_context.h" | 11 #include "webkit/fileapi/sandboxed_file_system_context.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 void SandboxedFileSystemOperation::Remove( | 113 void SandboxedFileSystemOperation::Remove( |
114 const FilePath& path, bool recursive) { | 114 const FilePath& path, bool recursive) { |
115 if (!VerifyFileSystemPathForWrite(path, false /* create */, 0)) { | 115 if (!VerifyFileSystemPathForWrite(path, false /* create */, 0)) { |
116 delete this; | 116 delete this; |
117 return; | 117 return; |
118 } | 118 } |
119 FileSystemOperation::Remove(path, recursive); | 119 FileSystemOperation::Remove(path, recursive); |
120 } | 120 } |
121 | 121 |
122 void SandboxedFileSystemOperation::Write( | 122 void SandboxedFileSystemOperation::Write( |
123 scoped_refptr<URLRequestContext> url_request_context, | 123 scoped_refptr<net::URLRequestContext> url_request_context, |
124 const FilePath& path, const GURL& blob_url, int64 offset) { | 124 const FilePath& path, const GURL& blob_url, int64 offset) { |
125 if (!VerifyFileSystemPathForWrite(path, true /* create */, | 125 if (!VerifyFileSystemPathForWrite(path, true /* create */, |
126 FileSystemQuotaManager::kUnknownSize)) { | 126 FileSystemQuotaManager::kUnknownSize)) { |
127 delete this; | 127 delete this; |
128 return; | 128 return; |
129 } | 129 } |
130 FileSystemOperation::Write(url_request_context, path, blob_url, offset); | 130 FileSystemOperation::Write(url_request_context, path, blob_url, offset); |
131 } | 131 } |
132 | 132 |
133 void SandboxedFileSystemOperation::Truncate( | 133 void SandboxedFileSystemOperation::Truncate( |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 // need to resolve what amount of size it's going to write. | 193 // need to resolve what amount of size it's going to write. |
194 if (!file_system_context_->quota_manager()->CheckOriginQuota( | 194 if (!file_system_context_->quota_manager()->CheckOriginQuota( |
195 origin_url, growth)) { | 195 origin_url, growth)) { |
196 dispatcher()->DidFail(base::PLATFORM_FILE_ERROR_NO_SPACE); | 196 dispatcher()->DidFail(base::PLATFORM_FILE_ERROR_NO_SPACE); |
197 return false; | 197 return false; |
198 } | 198 } |
199 return true; | 199 return true; |
200 } | 200 } |
201 | 201 |
202 } // namespace fileapi | 202 } // namespace fileapi |
OLD | NEW |