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" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/threading/sequenced_worker_pool.h" | 12 #include "base/threading/sequenced_worker_pool.h" |
Lei Zhang
2013/06/06 22:31:12
remove
kinuko
2013/06/07 07:19:24
Done.
| |
13 #include "content/browser/child_process_security_policy_impl.h" | 13 #include "content/browser/child_process_security_policy_impl.h" |
14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
15 #include "content/public/browser/content_browser_client.h" | 15 #include "content/public/browser/content_browser_client.h" |
16 #include "content/public/common/content_client.h" | 16 #include "content/public/common/content_client.h" |
17 #include "content/public/common/content_switches.h" | 17 #include "content/public/common/content_switches.h" |
18 #include "content/public/common/url_constants.h" | 18 #include "content/public/common/url_constants.h" |
19 #include "webkit/browser/fileapi/external_mount_points.h" | 19 #include "webkit/browser/fileapi/external_mount_points.h" |
20 #include "webkit/browser/fileapi/file_permission_policy.h" | 20 #include "webkit/browser/fileapi/file_permission_policy.h" |
21 #include "webkit/browser/fileapi/file_system_options.h" | 21 #include "webkit/browser/fileapi/file_system_options.h" |
22 #include "webkit/browser/fileapi/file_system_task_runners.h" | 22 #include "webkit/browser/fileapi/file_system_task_runners.h" |
(...skipping 22 matching lines...) Expand all Loading... | |
45 } | 45 } |
46 | 46 |
47 } // namespace | 47 } // namespace |
48 | 48 |
49 scoped_refptr<fileapi::FileSystemContext> CreateFileSystemContext( | 49 scoped_refptr<fileapi::FileSystemContext> CreateFileSystemContext( |
50 const base::FilePath& profile_path, | 50 const base::FilePath& profile_path, |
51 bool is_incognito, | 51 bool is_incognito, |
52 fileapi::ExternalMountPoints* external_mount_points, | 52 fileapi::ExternalMountPoints* external_mount_points, |
53 quota::SpecialStoragePolicy* special_storage_policy, | 53 quota::SpecialStoragePolicy* special_storage_policy, |
54 quota::QuotaManagerProxy* quota_manager_proxy) { | 54 quota::QuotaManagerProxy* quota_manager_proxy) { |
55 base::SequencedWorkerPool* pool = BrowserThread::GetBlockingPool(); | |
56 base::SequencedWorkerPool::SequenceToken media_sequence_token = | |
57 pool->GetNamedSequenceToken(fileapi::kMediaTaskRunnerName); | |
58 | |
59 scoped_ptr<fileapi::FileSystemTaskRunners> task_runners( | 55 scoped_ptr<fileapi::FileSystemTaskRunners> task_runners( |
60 new fileapi::FileSystemTaskRunners( | 56 new fileapi::FileSystemTaskRunners( |
61 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), | 57 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), |
62 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), | 58 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE))); |
63 pool->GetSequencedTaskRunner(media_sequence_token))); | |
64 | 59 |
65 // Setting up additional mount point providers. | 60 // Setting up additional mount point providers. |
66 ScopedVector<fileapi::FileSystemMountPointProvider> additional_providers; | 61 ScopedVector<fileapi::FileSystemMountPointProvider> additional_providers; |
67 GetContentClient()->browser()->GetAdditionalFileSystemMountPointProviders( | 62 GetContentClient()->browser()->GetAdditionalFileSystemMountPointProviders( |
68 profile_path, &additional_providers); | 63 profile_path, &additional_providers); |
69 | 64 |
70 return new fileapi::FileSystemContext( | 65 return new fileapi::FileSystemContext( |
71 task_runners.Pass(), | 66 task_runners.Pass(), |
72 external_mount_points, | 67 external_mount_points, |
73 special_storage_policy, | 68 special_storage_policy, |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
164 // for the file. (We first need to check if it can already be read not to | 159 // for the file. (We first need to check if it can already be read not to |
165 // overwrite existing permissions) | 160 // overwrite existing permissions) |
166 if (!ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile( | 161 if (!ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile( |
167 process_id, *platform_path)) { | 162 process_id, *platform_path)) { |
168 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFile( | 163 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFile( |
169 process_id, *platform_path); | 164 process_id, *platform_path); |
170 } | 165 } |
171 } | 166 } |
172 | 167 |
173 } // namespace content | 168 } // namespace content |
OLD | NEW |