| 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 } | 192 } |
| 193 | 193 |
| 194 // static | 194 // static |
| 195 void SimpleFileSystem::CleanupOnIOThread() { | 195 void SimpleFileSystem::CleanupOnIOThread() { |
| 196 g_io_thread = NULL; | 196 g_io_thread = NULL; |
| 197 g_blob_storage_controller = NULL; | 197 g_blob_storage_controller = NULL; |
| 198 } | 198 } |
| 199 | 199 |
| 200 FileSystemOperationInterface* SimpleFileSystem::GetNewOperation( | 200 FileSystemOperationInterface* SimpleFileSystem::GetNewOperation( |
| 201 const WebURL& url) { | 201 const WebURL& url) { |
| 202 return file_system_context_->CreateFileSystemOperation( | 202 return file_system_context_->CreateFileSystemOperation(GURL(url)); |
| 203 GURL(url), | |
| 204 base::MessageLoopProxy::current()); | |
| 205 } | 203 } |
| 206 | 204 |
| 207 FileSystemOperationInterface::StatusCallback | 205 FileSystemOperationInterface::StatusCallback |
| 208 SimpleFileSystem::FinishHandler(WebFileSystemCallbacks* callbacks) { | 206 SimpleFileSystem::FinishHandler(WebFileSystemCallbacks* callbacks) { |
| 209 return base::Bind(&SimpleFileSystem::DidFinish, | 207 return base::Bind(&SimpleFileSystem::DidFinish, |
| 210 AsWeakPtr(), base::Unretained(callbacks)); | 208 AsWeakPtr(), base::Unretained(callbacks)); |
| 211 } | 209 } |
| 212 | 210 |
| 213 FileSystemOperationInterface::ReadDirectoryCallback | 211 FileSystemOperationInterface::ReadDirectoryCallback |
| 214 SimpleFileSystem::ReadDirectoryHandler(WebFileSystemCallbacks* callbacks) { | 212 SimpleFileSystem::ReadDirectoryHandler(WebFileSystemCallbacks* callbacks) { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 const FilePath& platform_path, | 302 const FilePath& platform_path, |
| 305 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) { | 303 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) { |
| 306 DCHECK(g_io_thread); | 304 DCHECK(g_io_thread); |
| 307 if (result == base::PLATFORM_FILE_OK) { | 305 if (result == base::PLATFORM_FILE_OK) { |
| 308 g_io_thread->PostTask( | 306 g_io_thread->PostTask( |
| 309 FROM_HERE, | 307 FROM_HERE, |
| 310 base::Bind(&RegisterBlob, blob_url, platform_path)); | 308 base::Bind(&RegisterBlob, blob_url, platform_path)); |
| 311 } | 309 } |
| 312 DidGetMetadata(callbacks, result, info, platform_path); | 310 DidGetMetadata(callbacks, result, info, platform_path); |
| 313 } | 311 } |
| OLD | NEW |