| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 56 |
| 57 base::SequencedWorkerPool* pool = content::BrowserThread::GetBlockingPool(); | 57 base::SequencedWorkerPool* pool = content::BrowserThread::GetBlockingPool(); |
| 58 scoped_refptr<base::SequencedTaskRunner> file_task_runner = | 58 scoped_refptr<base::SequencedTaskRunner> file_task_runner = |
| 59 pool->GetSequencedTaskRunner(pool->GetNamedSequenceToken("FileAPI")); | 59 pool->GetSequencedTaskRunner(pool->GetNamedSequenceToken("FileAPI")); |
| 60 | 60 |
| 61 scoped_ptr<fileapi::FileSystemTaskRunners> task_runners( | 61 scoped_ptr<fileapi::FileSystemTaskRunners> task_runners( |
| 62 new fileapi::FileSystemTaskRunners( | 62 new fileapi::FileSystemTaskRunners( |
| 63 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get(), | 63 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get(), |
| 64 file_task_runner.get())); | 64 file_task_runner.get())); |
| 65 | 65 |
| 66 // Setting up additional mount point providers. | 66 // Setting up additional filesystem backends. |
| 67 ScopedVector<fileapi::FileSystemBackend> additional_providers; | 67 ScopedVector<fileapi::FileSystemBackend> additional_backends; |
| 68 GetContentClient()->browser()->GetAdditionalFileSystemBackends( | 68 GetContentClient()->browser()->GetAdditionalFileSystemBackends( |
| 69 browser_context, | 69 browser_context, |
| 70 profile_path, | 70 profile_path, |
| 71 &additional_providers); | 71 task_runners.get(), |
| 72 CreateBrowserFileSystemOptions(is_incognito), |
| 73 &additional_backends); |
| 72 | 74 |
| 73 scoped_refptr<fileapi::FileSystemContext> file_system_context = | 75 scoped_refptr<fileapi::FileSystemContext> file_system_context = |
| 74 new fileapi::FileSystemContext( | 76 new fileapi::FileSystemContext( |
| 75 task_runners.Pass(), | 77 task_runners.Pass(), |
| 76 BrowserContext::GetMountPoints(browser_context), | 78 BrowserContext::GetMountPoints(browser_context), |
| 77 browser_context->GetSpecialStoragePolicy(), | 79 browser_context->GetSpecialStoragePolicy(), |
| 78 quota_manager_proxy, | 80 quota_manager_proxy, |
| 79 additional_providers.Pass(), | 81 additional_backends.Pass(), |
| 80 profile_path, | 82 profile_path, |
| 81 CreateBrowserFileSystemOptions(is_incognito)); | 83 CreateBrowserFileSystemOptions(is_incognito)); |
| 82 | 84 |
| 83 std::vector<fileapi::FileSystemType> types; | 85 std::vector<fileapi::FileSystemType> types; |
| 84 file_system_context->GetFileSystemTypes(&types); | 86 file_system_context->GetFileSystemTypes(&types); |
| 85 for (size_t i = 0; i < types.size(); ++i) { | 87 for (size_t i = 0; i < types.size(); ++i) { |
| 86 ChildProcessSecurityPolicyImpl::GetInstance()-> | 88 ChildProcessSecurityPolicyImpl::GetInstance()-> |
| 87 RegisterFileSystemPermissionPolicy( | 89 RegisterFileSystemPermissionPolicy( |
| 88 types[i], | 90 types[i], |
| 89 fileapi::FileSystemContext::GetPermissionPolicy(types[i])); | 91 fileapi::FileSystemContext::GetPermissionPolicy(types[i])); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 // for the file. (We first need to check if it can already be read not to | 150 // for the file. (We first need to check if it can already be read not to |
| 149 // overwrite existing permissions) | 151 // overwrite existing permissions) |
| 150 if (!ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile( | 152 if (!ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile( |
| 151 process_id, *platform_path)) { | 153 process_id, *platform_path)) { |
| 152 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFile( | 154 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFile( |
| 153 process_id, *platform_path); | 155 process_id, *platform_path); |
| 154 } | 156 } |
| 155 } | 157 } |
| 156 | 158 |
| 157 } // namespace content | 159 } // namespace content |
| OLD | NEW |