| 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 "webkit/fileapi/isolated_mount_point_provider.h" | 5 #include "webkit/fileapi/isolated_mount_point_provider.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 FilePath path; | 103 FilePath path; |
| 104 if (!isolated_context()->CrackIsolatedPath(virtual_path, &fsid, NULL, &path)) | 104 if (!isolated_context()->CrackIsolatedPath(virtual_path, &fsid, NULL, &path)) |
| 105 return FilePath(); | 105 return FilePath(); |
| 106 return path; | 106 return path; |
| 107 } | 107 } |
| 108 | 108 |
| 109 FileSystemOperationInterface* | 109 FileSystemOperationInterface* |
| 110 IsolatedMountPointProvider::CreateFileSystemOperation( | 110 IsolatedMountPointProvider::CreateFileSystemOperation( |
| 111 const FileSystemURL& url, | 111 const FileSystemURL& url, |
| 112 FileSystemContext* context) const { | 112 FileSystemContext* context) const { |
| 113 return new LocalFileSystemOperation(context); | 113 scoped_ptr<FileSystemOperationContext> operation_context( |
| 114 new FileSystemOperationContext(context)); |
| 115 return new LocalFileSystemOperation(context, operation_context.Pass()); |
| 114 } | 116 } |
| 115 | 117 |
| 116 webkit_blob::FileStreamReader* | 118 webkit_blob::FileStreamReader* |
| 117 IsolatedMountPointProvider::CreateFileStreamReader( | 119 IsolatedMountPointProvider::CreateFileStreamReader( |
| 118 const FileSystemURL& url, | 120 const FileSystemURL& url, |
| 119 int64 offset, | 121 int64 offset, |
| 120 FileSystemContext* context) const { | 122 FileSystemContext* context) const { |
| 121 FilePath path = GetPathFromURL(url); | 123 FilePath path = GetPathFromURL(url); |
| 122 return path.empty() ? NULL : new webkit_blob::LocalFileStreamReader( | 124 return path.empty() ? NULL : new webkit_blob::LocalFileStreamReader( |
| 123 context->file_task_runner(), path, offset, base::Time()); | 125 context->file_task_runner(), path, offset, base::Time()); |
| 124 } | 126 } |
| 125 | 127 |
| 126 FileStreamWriter* IsolatedMountPointProvider::CreateFileStreamWriter( | 128 FileStreamWriter* IsolatedMountPointProvider::CreateFileStreamWriter( |
| 127 const FileSystemURL& url, | 129 const FileSystemURL& url, |
| 128 int64 offset, | 130 int64 offset, |
| 129 FileSystemContext* context) const { | 131 FileSystemContext* context) const { |
| 130 FilePath path = GetPathFromURL(url); | 132 FilePath path = GetPathFromURL(url); |
| 131 return path.empty() ? NULL : new LocalFileStreamWriter(path, offset); | 133 return path.empty() ? NULL : new LocalFileStreamWriter(path, offset); |
| 132 } | 134 } |
| 133 | 135 |
| 134 FileSystemQuotaUtil* IsolatedMountPointProvider::GetQuotaUtil() { | 136 FileSystemQuotaUtil* IsolatedMountPointProvider::GetQuotaUtil() { |
| 135 // No quota support. | 137 // No quota support. |
| 136 return NULL; | 138 return NULL; |
| 137 } | 139 } |
| 138 | 140 |
| 139 } // namespace fileapi | 141 } // namespace fileapi |
| OLD | NEW |