OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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" |
12 | 12 |
13 namespace fileapi { | 13 namespace fileapi { |
14 | 14 |
15 SandboxedFileSystemOperation::SandboxedFileSystemOperation( | 15 SandboxedFileSystemOperation::SandboxedFileSystemOperation( |
16 FileSystemCallbackDispatcher* dispatcher, | 16 FileSystemCallbackDispatcher* dispatcher, |
17 scoped_refptr<base::MessageLoopProxy> proxy, | 17 scoped_refptr<base::MessageLoopProxy> proxy, |
18 SandboxedFileSystemContext* file_system_context) | 18 scoped_refptr<SandboxedFileSystemContext> file_system_context) |
19 : FileSystemOperation(dispatcher, proxy), | 19 : FileSystemOperation(dispatcher, proxy), |
20 file_system_context_(file_system_context), | 20 file_system_context_(file_system_context), |
21 callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { | 21 callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { |
22 DCHECK(file_system_context_); | 22 DCHECK(file_system_context_); |
23 } | 23 } |
24 | 24 |
25 SandboxedFileSystemOperation::~SandboxedFileSystemOperation() {} | 25 SandboxedFileSystemOperation::~SandboxedFileSystemOperation() {} |
26 | 26 |
27 void SandboxedFileSystemOperation::OpenFileSystem( | 27 void SandboxedFileSystemOperation::OpenFileSystem( |
28 const GURL& origin_url, fileapi::FileSystemType type, bool create) { | 28 const GURL& origin_url, fileapi::FileSystemType type, bool create) { |
(...skipping 164 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 |