OLD | NEW |
1 // Copyright (c) 2011 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/file_system_context.h" | 5 #include "webkit/fileapi/file_system_context.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/message_loop_proxy.h" | 8 #include "base/message_loop_proxy.h" |
9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
10 #include "webkit/fileapi/file_system_path_manager.h" | 10 #include "webkit/fileapi/file_system_path_manager.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 } | 55 } |
56 | 56 |
57 FileSystemContext::~FileSystemContext() { | 57 FileSystemContext::~FileSystemContext() { |
58 } | 58 } |
59 | 59 |
60 bool FileSystemContext::IsStorageUnlimited(const GURL& origin) { | 60 bool FileSystemContext::IsStorageUnlimited(const GURL& origin) { |
61 // If allow-file-access-from-files flag is explicitly given and the scheme | 61 // If allow-file-access-from-files flag is explicitly given and the scheme |
62 // is file, or if unlimited quota for this process was explicitly requested, | 62 // is file, or if unlimited quota for this process was explicitly requested, |
63 // return true. | 63 // return true. |
64 return unlimited_quota_ || | 64 return unlimited_quota_ || |
65 (allow_file_access_from_files_ && origin.SchemeIsFile()) || | |
66 (special_storage_policy_.get() && | 65 (special_storage_policy_.get() && |
67 special_storage_policy_->IsStorageUnlimited(origin)); | 66 special_storage_policy_->IsStorageUnlimited(origin)); |
68 } | 67 } |
69 | 68 |
70 bool FileSystemContext::DeleteDataForOriginOnFileThread( | 69 bool FileSystemContext::DeleteDataForOriginOnFileThread( |
71 const GURL& origin_url) { | 70 const GURL& origin_url) { |
72 DCHECK(file_message_loop_->BelongsToCurrentThread()); | 71 DCHECK(file_message_loop_->BelongsToCurrentThread()); |
73 DCHECK(sandbox_provider()); | 72 DCHECK(sandbox_provider()); |
74 | 73 |
75 // Delete temporary and persistent data. | 74 // Delete temporary and persistent data. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 return; | 107 return; |
109 } | 108 } |
110 delete this; | 109 delete this; |
111 } | 110 } |
112 | 111 |
113 SandboxMountPointProvider* FileSystemContext::sandbox_provider() const { | 112 SandboxMountPointProvider* FileSystemContext::sandbox_provider() const { |
114 return path_manager_->sandbox_provider(); | 113 return path_manager_->sandbox_provider(); |
115 } | 114 } |
116 | 115 |
117 } // namespace fileapi | 116 } // namespace fileapi |
OLD | NEW |