OLD | NEW |
1 // Copyright (c) 2012 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 "content/browser/fileapi/browser_file_system_helper.h" | 5 #include "content/browser/fileapi/browser_file_system_helper.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 return true; | 101 return true; |
102 case fileapi::FILE_PERMISSION_USE_FILE_PERMISSION: { | 102 case fileapi::FILE_PERMISSION_USE_FILE_PERMISSION: { |
103 const bool success = policy->HasPermissionsForFile( | 103 const bool success = policy->HasPermissionsForFile( |
104 process_id, url.path(), permissions); | 104 process_id, url.path(), permissions); |
105 if (!success) | 105 if (!success) |
106 *error = base::PLATFORM_FILE_ERROR_SECURITY; | 106 *error = base::PLATFORM_FILE_ERROR_SECURITY; |
107 return success; | 107 return success; |
108 } | 108 } |
109 case fileapi::FILE_PERMISSION_USE_FILESYSTEM_PERMISSION: { | 109 case fileapi::FILE_PERMISSION_USE_FILESYSTEM_PERMISSION: { |
110 const bool success = policy->HasPermissionsForFileSystem( | 110 const bool success = policy->HasPermissionsForFileSystem( |
111 process_id, url.filesystem_id(), permissions); | 111 process_id, url.mount_filesystem_id(), permissions); |
112 if (!success) | 112 if (!success) |
113 *error = base::PLATFORM_FILE_ERROR_SECURITY; | 113 *error = base::PLATFORM_FILE_ERROR_SECURITY; |
114 return success; | 114 return success; |
115 } | 115 } |
116 } | 116 } |
117 NOTREACHED(); | 117 NOTREACHED(); |
118 *error = base::PLATFORM_FILE_ERROR_SECURITY; | 118 *error = base::PLATFORM_FILE_ERROR_SECURITY; |
119 return false; | 119 return false; |
120 } | 120 } |
121 | 121 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 // for the file. (We first need to check if it can already be read not to | 156 // for the file. (We first need to check if it can already be read not to |
157 // overwrite existing permissions) | 157 // overwrite existing permissions) |
158 if (!ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile( | 158 if (!ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile( |
159 process_id, *platform_path)) { | 159 process_id, *platform_path)) { |
160 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFile( | 160 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFile( |
161 process_id, *platform_path); | 161 process_id, *platform_path); |
162 } | 162 } |
163 } | 163 } |
164 | 164 |
165 } // namespace content | 165 } // namespace content |
OLD | NEW |