| 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/sequenced_task_runner.h" | 12 #include "base/sequenced_task_runner.h" |
| 13 #include "base/threading/sequenced_worker_pool.h" | 13 #include "base/threading/sequenced_worker_pool.h" |
| 14 #include "content/browser/child_process_security_policy_impl.h" | 14 #include "content/browser/child_process_security_policy_impl.h" |
| 15 #include "content/public/browser/browser_context.h" | 15 #include "content/public/browser/browser_context.h" |
| 16 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
| 17 #include "content/public/browser/content_browser_client.h" | 17 #include "content/public/browser/content_browser_client.h" |
| 18 #include "content/public/common/content_client.h" | 18 #include "content/public/common/content_client.h" |
| 19 #include "content/public/common/content_switches.h" | 19 #include "content/public/common/content_switches.h" |
| 20 #include "storage/browser/fileapi/external_mount_points.h" |
| 21 #include "storage/browser/fileapi/file_permission_policy.h" |
| 22 #include "storage/browser/fileapi/file_system_backend.h" |
| 23 #include "storage/browser/fileapi/file_system_context.h" |
| 24 #include "storage/browser/fileapi/file_system_operation_runner.h" |
| 25 #include "storage/browser/fileapi/file_system_options.h" |
| 26 #include "storage/browser/quota/quota_manager.h" |
| 20 #include "url/url_constants.h" | 27 #include "url/url_constants.h" |
| 21 #include "webkit/browser/fileapi/external_mount_points.h" | |
| 22 #include "webkit/browser/fileapi/file_permission_policy.h" | |
| 23 #include "webkit/browser/fileapi/file_system_backend.h" | |
| 24 #include "webkit/browser/fileapi/file_system_context.h" | |
| 25 #include "webkit/browser/fileapi/file_system_operation_runner.h" | |
| 26 #include "webkit/browser/fileapi/file_system_options.h" | |
| 27 #include "webkit/browser/quota/quota_manager.h" | |
| 28 | 28 |
| 29 namespace content { | 29 namespace content { |
| 30 | 30 |
| 31 namespace { | 31 namespace { |
| 32 | 32 |
| 33 using storage::FileSystemOptions; | 33 using storage::FileSystemOptions; |
| 34 | 34 |
| 35 FileSystemOptions CreateBrowserFileSystemOptions(bool is_incognito) { | 35 FileSystemOptions CreateBrowserFileSystemOptions(bool is_incognito) { |
| 36 FileSystemOptions::ProfileMode profile_mode = | 36 FileSystemOptions::ProfileMode profile_mode = |
| 37 is_incognito ? FileSystemOptions::PROFILE_MODE_INCOGNITO | 37 is_incognito ? FileSystemOptions::PROFILE_MODE_INCOGNITO |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 context->operation_runner()->SyncGetPlatformPath(url, platform_path); | 127 context->operation_runner()->SyncGetPlatformPath(url, platform_path); |
| 128 | 128 |
| 129 // The path is to be attached to URLLoader so we grant read permission | 129 // The path is to be attached to URLLoader so we grant read permission |
| 130 // for the file. (We need to check first because a parent directory may | 130 // for the file. (We need to check first because a parent directory may |
| 131 // already have the permissions and we don't need to grant it to the file.) | 131 // already have the permissions and we don't need to grant it to the file.) |
| 132 if (!policy->CanReadFile(process_id, *platform_path)) | 132 if (!policy->CanReadFile(process_id, *platform_path)) |
| 133 policy->GrantReadFile(process_id, *platform_path); | 133 policy->GrantReadFile(process_id, *platform_path); |
| 134 } | 134 } |
| 135 | 135 |
| 136 } // namespace content | 136 } // namespace content |
| OLD | NEW |