| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 #if defined(SUPPORT_MTP_DEVICE_FILESYSTEM) | 124 #if defined(SUPPORT_MTP_DEVICE_FILESYSTEM) |
| 125 if (url.type() == kFileSystemTypeDeviceMedia) { | 125 if (url.type() == kFileSystemTypeDeviceMedia) { |
| 126 MTPDeviceMapService* map_service = MTPDeviceMapService::GetInstance(); | 126 MTPDeviceMapService* map_service = MTPDeviceMapService::GetInstance(); |
| 127 MTPDeviceDelegate* device_delegate = | 127 MTPDeviceDelegate* device_delegate = |
| 128 map_service->GetMTPDeviceDelegate(url.filesystem_id()); | 128 map_service->GetMTPDeviceDelegate(url.filesystem_id()); |
| 129 if (!device_delegate) { | 129 if (!device_delegate) { |
| 130 if (error_code) | 130 if (error_code) |
| 131 *error_code = base::PLATFORM_FILE_ERROR_NOT_FOUND; | 131 *error_code = base::PLATFORM_FILE_ERROR_NOT_FOUND; |
| 132 return NULL; | 132 return NULL; |
| 133 } | 133 } |
| 134 operation_context->set_mtp_device_delegate(device_delegate); | 134 operation_context->set_mtp_device_delegate( |
| 135 device_delegate->GetAsWeakPtrOnIOThread()); |
| 135 operation_context->set_task_runner(device_delegate->GetMediaTaskRunner()); | 136 operation_context->set_task_runner(device_delegate->GetMediaTaskRunner()); |
| 136 operation_context->set_media_path_filter(media_path_filter_.get()); | 137 operation_context->set_media_path_filter(media_path_filter_.get()); |
| 137 } | 138 } |
| 138 #endif | 139 #endif |
| 139 | 140 |
| 140 return new LocalFileSystemOperation(context, operation_context.Pass()); | 141 return new LocalFileSystemOperation(context, operation_context.Pass()); |
| 141 } | 142 } |
| 142 | 143 |
| 143 webkit_blob::FileStreamReader* | 144 webkit_blob::FileStreamReader* |
| 144 IsolatedMountPointProvider::CreateFileStreamReader( | 145 IsolatedMountPointProvider::CreateFileStreamReader( |
| (...skipping 21 matching lines...) Expand all Loading... |
| 166 void IsolatedMountPointProvider::DeleteFileSystem( | 167 void IsolatedMountPointProvider::DeleteFileSystem( |
| 167 const GURL& origin_url, | 168 const GURL& origin_url, |
| 168 FileSystemType type, | 169 FileSystemType type, |
| 169 FileSystemContext* context, | 170 FileSystemContext* context, |
| 170 const DeleteFileSystemCallback& callback) { | 171 const DeleteFileSystemCallback& callback) { |
| 171 NOTREACHED(); | 172 NOTREACHED(); |
| 172 callback.Run(base::PLATFORM_FILE_ERROR_INVALID_OPERATION); | 173 callback.Run(base::PLATFORM_FILE_ERROR_INVALID_OPERATION); |
| 173 } | 174 } |
| 174 | 175 |
| 175 } // namespace fileapi | 176 } // namespace fileapi |
| OLD | NEW |