| 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/tools/test_shell/simple_file_system.h" | 5 #include "webkit/tools/test_shell/simple_file_system.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 } | 257 } |
| 258 | 258 |
| 259 // static | 259 // static |
| 260 void SimpleFileSystem::CleanupOnIOThread() { | 260 void SimpleFileSystem::CleanupOnIOThread() { |
| 261 g_io_thread = NULL; | 261 g_io_thread = NULL; |
| 262 g_blob_storage_controller = NULL; | 262 g_blob_storage_controller = NULL; |
| 263 } | 263 } |
| 264 | 264 |
| 265 bool SimpleFileSystem::HasFilePermission( | 265 bool SimpleFileSystem::HasFilePermission( |
| 266 const fileapi::FileSystemURL& url, FilePermission permission) { | 266 const fileapi::FileSystemURL& url, FilePermission permission) { |
| 267 // Disallow writing on isolated file system, otherwise return ok. | 267 // Disallow writing on dragged file system, otherwise return ok. |
| 268 return (url.type() != fileapi::kFileSystemTypeIsolated || | 268 return (url.type() != fileapi::kFileSystemTypeDragged || |
| 269 permission == FILE_PERMISSION_READ); | 269 permission == FILE_PERMISSION_READ); |
| 270 } | 270 } |
| 271 | 271 |
| 272 FileSystemOperationInterface* SimpleFileSystem::GetNewOperation( | 272 FileSystemOperationInterface* SimpleFileSystem::GetNewOperation( |
| 273 const fileapi::FileSystemURL& url) { | 273 const fileapi::FileSystemURL& url) { |
| 274 return file_system_context_->CreateFileSystemOperation(url); | 274 return file_system_context_->CreateFileSystemOperation(url); |
| 275 } | 275 } |
| 276 | 276 |
| 277 FileSystemOperationInterface::StatusCallback | 277 FileSystemOperationInterface::StatusCallback |
| 278 SimpleFileSystem::FinishHandler(WebFileSystemCallbacks* callbacks) { | 278 SimpleFileSystem::FinishHandler(WebFileSystemCallbacks* callbacks) { |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 const FilePath& platform_path, | 389 const FilePath& platform_path, |
| 390 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) { | 390 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) { |
| 391 DCHECK(g_io_thread); | 391 DCHECK(g_io_thread); |
| 392 if (result == base::PLATFORM_FILE_OK) { | 392 if (result == base::PLATFORM_FILE_OK) { |
| 393 g_io_thread->PostTask( | 393 g_io_thread->PostTask( |
| 394 FROM_HERE, | 394 FROM_HERE, |
| 395 base::Bind(&RegisterBlob, blob_url, platform_path)); | 395 base::Bind(&RegisterBlob, blob_url, platform_path)); |
| 396 } | 396 } |
| 397 DidGetMetadata(callbacks, result, info, platform_path); | 397 DidGetMetadata(callbacks, result, info, platform_path); |
| 398 } | 398 } |
| OLD | NEW |