| 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 #ifndef STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_CONTEXT_H_ | 5 #ifndef STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_CONTEXT_H_ |
| 6 #define STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_CONTEXT_H_ | 6 #define STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/callback.h" | 15 #include "base/callback.h" |
| 16 #include "base/files/file.h" | 16 #include "base/files/file.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
| 19 #include "base/memory/scoped_vector.h" | |
| 20 #include "base/sequenced_task_runner_helpers.h" | 19 #include "base/sequenced_task_runner_helpers.h" |
| 21 #include "storage/browser/fileapi/file_system_url.h" | 20 #include "storage/browser/fileapi/file_system_url.h" |
| 22 #include "storage/browser/fileapi/open_file_system_mode.h" | 21 #include "storage/browser/fileapi/open_file_system_mode.h" |
| 23 #include "storage/browser/fileapi/plugin_private_file_system_backend.h" | 22 #include "storage/browser/fileapi/plugin_private_file_system_backend.h" |
| 24 #include "storage/browser/fileapi/sandbox_file_system_backend_delegate.h" | 23 #include "storage/browser/fileapi/sandbox_file_system_backend_delegate.h" |
| 25 #include "storage/browser/fileapi/task_runner_bound_observer_list.h" | 24 #include "storage/browser/fileapi/task_runner_bound_observer_list.h" |
| 26 #include "storage/browser/storage_browser_export.h" | 25 #include "storage/browser/storage_browser_export.h" |
| 27 #include "storage/common/fileapi/file_system_types.h" | 26 #include "storage/common/fileapi/file_system_types.h" |
| 28 | 27 |
| 29 namespace base { | 28 namespace base { |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // | 110 // |
| 112 // |auto_mount_handlers| are used to resolve calls to | 111 // |auto_mount_handlers| are used to resolve calls to |
| 113 // AttemptAutoMountForURLRequest. Only external filesystems are auto mounted | 112 // AttemptAutoMountForURLRequest. Only external filesystems are auto mounted |
| 114 // when a filesystem: URL request is made. | 113 // when a filesystem: URL request is made. |
| 115 FileSystemContext( | 114 FileSystemContext( |
| 116 base::SingleThreadTaskRunner* io_task_runner, | 115 base::SingleThreadTaskRunner* io_task_runner, |
| 117 base::SequencedTaskRunner* file_task_runner, | 116 base::SequencedTaskRunner* file_task_runner, |
| 118 ExternalMountPoints* external_mount_points, | 117 ExternalMountPoints* external_mount_points, |
| 119 storage::SpecialStoragePolicy* special_storage_policy, | 118 storage::SpecialStoragePolicy* special_storage_policy, |
| 120 storage::QuotaManagerProxy* quota_manager_proxy, | 119 storage::QuotaManagerProxy* quota_manager_proxy, |
| 121 ScopedVector<FileSystemBackend> additional_backends, | 120 std::vector<std::unique_ptr<FileSystemBackend>> additional_backends, |
| 122 const std::vector<URLRequestAutoMountHandler>& auto_mount_handlers, | 121 const std::vector<URLRequestAutoMountHandler>& auto_mount_handlers, |
| 123 const base::FilePath& partition_path, | 122 const base::FilePath& partition_path, |
| 124 const FileSystemOptions& options); | 123 const FileSystemOptions& options); |
| 125 | 124 |
| 126 bool DeleteDataForOriginOnFileTaskRunner(const GURL& origin_url); | 125 bool DeleteDataForOriginOnFileTaskRunner(const GURL& origin_url); |
| 127 | 126 |
| 128 // Creates a new QuotaReservation for the given |origin_url| and |type|. | 127 // Creates a new QuotaReservation for the given |origin_url| and |type|. |
| 129 // Returns NULL if |type| does not support quota or reservation fails. | 128 // Returns NULL if |type| does not support quota or reservation fails. |
| 130 // This should be run on |default_file_task_runner_| and the returned value | 129 // This should be run on |default_file_task_runner_| and the returned value |
| 131 // should be destroyed on the runner. | 130 // should be destroyed on the runner. |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy_; | 370 scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy_; |
| 372 | 371 |
| 373 std::unique_ptr<SandboxFileSystemBackendDelegate> sandbox_delegate_; | 372 std::unique_ptr<SandboxFileSystemBackendDelegate> sandbox_delegate_; |
| 374 | 373 |
| 375 // Regular file system backends. | 374 // Regular file system backends. |
| 376 std::unique_ptr<SandboxFileSystemBackend> sandbox_backend_; | 375 std::unique_ptr<SandboxFileSystemBackend> sandbox_backend_; |
| 377 std::unique_ptr<IsolatedFileSystemBackend> isolated_backend_; | 376 std::unique_ptr<IsolatedFileSystemBackend> isolated_backend_; |
| 378 | 377 |
| 379 // Additional file system backends. | 378 // Additional file system backends. |
| 380 std::unique_ptr<PluginPrivateFileSystemBackend> plugin_private_backend_; | 379 std::unique_ptr<PluginPrivateFileSystemBackend> plugin_private_backend_; |
| 381 ScopedVector<FileSystemBackend> additional_backends_; | 380 std::vector<std::unique_ptr<FileSystemBackend>> additional_backends_; |
| 382 | 381 |
| 383 std::vector<URLRequestAutoMountHandler> auto_mount_handlers_; | 382 std::vector<URLRequestAutoMountHandler> auto_mount_handlers_; |
| 384 | 383 |
| 385 // Registered file system backends. | 384 // Registered file system backends. |
| 386 // The map must be constructed in the constructor since it can be accessed | 385 // The map must be constructed in the constructor since it can be accessed |
| 387 // on multiple threads. | 386 // on multiple threads. |
| 388 // This map itself doesn't retain each backend's ownership; ownerships | 387 // This map itself doesn't retain each backend's ownership; ownerships |
| 389 // of the backends are held by additional_backends_ or other scoped_ptr | 388 // of the backends are held by additional_backends_ or other scoped_ptr |
| 390 // backend fields. | 389 // backend fields. |
| 391 FileSystemBackendMap backend_map_; | 390 FileSystemBackendMap backend_map_; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 410 | 409 |
| 411 struct DefaultContextDeleter { | 410 struct DefaultContextDeleter { |
| 412 static void Destruct(const FileSystemContext* context) { | 411 static void Destruct(const FileSystemContext* context) { |
| 413 context->DeleteOnCorrectThread(); | 412 context->DeleteOnCorrectThread(); |
| 414 } | 413 } |
| 415 }; | 414 }; |
| 416 | 415 |
| 417 } // namespace storage | 416 } // namespace storage |
| 418 | 417 |
| 419 #endif // STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_CONTEXT_H_ | 418 #endif // STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_CONTEXT_H_ |
| OLD | NEW |