| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/memory/scoped_callback_factory.h" | 8 #include "base/memory/scoped_callback_factory.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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 // The FileSystem temp directory was not initialized successfully. | 148 // The FileSystem temp directory was not initialized successfully. |
| 149 callbacks->didFail(WebKit::WebFileErrorSecurity); | 149 callbacks->didFail(WebKit::WebFileErrorSecurity); |
| 150 return; | 150 return; |
| 151 } | 151 } |
| 152 | 152 |
| 153 fileapi::FileSystemType type; | 153 fileapi::FileSystemType type; |
| 154 if (web_filesystem_type == WebFileSystem::TypeTemporary) | 154 if (web_filesystem_type == WebFileSystem::TypeTemporary) |
| 155 type = fileapi::kFileSystemTypeTemporary; | 155 type = fileapi::kFileSystemTypeTemporary; |
| 156 else if (web_filesystem_type == WebFileSystem::TypePersistent) | 156 else if (web_filesystem_type == WebFileSystem::TypePersistent) |
| 157 type = fileapi::kFileSystemTypePersistent; | 157 type = fileapi::kFileSystemTypePersistent; |
| 158 else if (web_filesystem_type == WebFileSystem::TypeExternal) |
| 159 type = fileapi::kFileSystemTypeExternal; |
| 158 else { | 160 else { |
| 159 // Unknown type filesystem is requested. | 161 // Unknown type filesystem is requested. |
| 160 callbacks->didFail(WebKit::WebFileErrorSecurity); | 162 callbacks->didFail(WebKit::WebFileErrorSecurity); |
| 161 return; | 163 return; |
| 162 } | 164 } |
| 163 | 165 |
| 164 GURL origin_url(frame->securityOrigin().toString()); | 166 GURL origin_url(frame->securityOrigin().toString()); |
| 165 GetNewOperation(callbacks)->OpenFileSystem(origin_url, type, create); | 167 GetNewOperation(callbacks)->OpenFileSystem(origin_url, type, create); |
| 166 } | 168 } |
| 167 | 169 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 | 226 |
| 225 FileSystemOperation* SimpleFileSystem::GetNewOperation( | 227 FileSystemOperation* SimpleFileSystem::GetNewOperation( |
| 226 WebFileSystemCallbacks* callbacks) { | 228 WebFileSystemCallbacks* callbacks) { |
| 227 SimpleFileSystemCallbackDispatcher* dispatcher = | 229 SimpleFileSystemCallbackDispatcher* dispatcher = |
| 228 new SimpleFileSystemCallbackDispatcher(AsWeakPtr(), callbacks); | 230 new SimpleFileSystemCallbackDispatcher(AsWeakPtr(), callbacks); |
| 229 FileSystemOperation* operation = new FileSystemOperation( | 231 FileSystemOperation* operation = new FileSystemOperation( |
| 230 dispatcher, base::MessageLoopProxy::CreateForCurrentThread(), | 232 dispatcher, base::MessageLoopProxy::CreateForCurrentThread(), |
| 231 file_system_context_.get(), NULL); | 233 file_system_context_.get(), NULL); |
| 232 return operation; | 234 return operation; |
| 233 } | 235 } |
| OLD | NEW |