Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: content/browser/fileapi/browser_file_system_helper.cc

Issue 18668003: SyncFS: Introduce SyncFileSystemBackend (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fix Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 CreateBrowserFileSystemOptions(is_incognito),
72 &additional_backends);
72 73
73 scoped_refptr<fileapi::FileSystemContext> file_system_context = 74 scoped_refptr<fileapi::FileSystemContext> file_system_context =
74 new fileapi::FileSystemContext( 75 new fileapi::FileSystemContext(
75 task_runners.Pass(), 76 task_runners.Pass(),
76 BrowserContext::GetMountPoints(browser_context), 77 BrowserContext::GetMountPoints(browser_context),
77 browser_context->GetSpecialStoragePolicy(), 78 browser_context->GetSpecialStoragePolicy(),
78 quota_manager_proxy, 79 quota_manager_proxy,
79 additional_providers.Pass(), 80 additional_backends.Pass(),
80 profile_path, 81 profile_path,
81 CreateBrowserFileSystemOptions(is_incognito)); 82 CreateBrowserFileSystemOptions(is_incognito));
82 83
83 std::vector<fileapi::FileSystemType> types; 84 std::vector<fileapi::FileSystemType> types;
84 file_system_context->GetFileSystemTypes(&types); 85 file_system_context->GetFileSystemTypes(&types);
85 for (size_t i = 0; i < types.size(); ++i) { 86 for (size_t i = 0; i < types.size(); ++i) {
86 ChildProcessSecurityPolicyImpl::GetInstance()-> 87 ChildProcessSecurityPolicyImpl::GetInstance()->
87 RegisterFileSystemPermissionPolicy( 88 RegisterFileSystemPermissionPolicy(
88 types[i], 89 types[i],
89 fileapi::FileSystemContext::GetPermissionPolicy(types[i])); 90 fileapi::FileSystemContext::GetPermissionPolicy(types[i]));
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 // for the file. (We first need to check if it can already be read not to 149 // for the file. (We first need to check if it can already be read not to
149 // overwrite existing permissions) 150 // overwrite existing permissions)
150 if (!ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile( 151 if (!ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile(
151 process_id, *platform_path)) { 152 process_id, *platform_path)) {
152 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFile( 153 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFile(
153 process_id, *platform_path); 154 process_id, *platform_path);
154 } 155 }
155 } 156 }
156 157
157 } // namespace content 158 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698