| 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/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| 11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
| 12 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
| 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
| 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileInfo.h" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileInfo.h" |
| 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemCallback
s.h" | 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemCallback
s.h" |
| 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemEntry.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemEntry.h" |
| 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" | 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" |
| 19 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" | 19 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" |
| 20 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" | 20 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" |
| 21 #include "webkit/fileapi/file_system_callback_dispatcher.h" | 21 #include "webkit/fileapi/file_system_callback_dispatcher.h" |
| 22 #include "webkit/fileapi/file_system_context.h" | 22 #include "webkit/fileapi/file_system_context.h" |
| 23 #include "webkit/fileapi/file_system_operation.h" | 23 #include "webkit/fileapi/file_system_operation.h" |
| 24 #include "webkit/fileapi/file_system_path_manager.h" | |
| 25 #include "webkit/fileapi/file_system_types.h" | 24 #include "webkit/fileapi/file_system_types.h" |
| 25 #include "webkit/fileapi/mock_file_system_options.h" |
| 26 #include "webkit/glue/webkit_glue.h" | 26 #include "webkit/glue/webkit_glue.h" |
| 27 #include "webkit/tools/test_shell/simple_file_writer.h" | 27 #include "webkit/tools/test_shell/simple_file_writer.h" |
| 28 | 28 |
| 29 using base::WeakPtr; | 29 using base::WeakPtr; |
| 30 | 30 |
| 31 using WebKit::WebFileInfo; | 31 using WebKit::WebFileInfo; |
| 32 using WebKit::WebFileSystem; | 32 using WebKit::WebFileSystem; |
| 33 using WebKit::WebFileSystemCallbacks; | 33 using WebKit::WebFileSystemCallbacks; |
| 34 using WebKit::WebFileSystemEntry; | 34 using WebKit::WebFileSystemEntry; |
| 35 using WebKit::WebFileWriter; | 35 using WebKit::WebFileWriter; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 } // namespace | 121 } // namespace |
| 122 | 122 |
| 123 SimpleFileSystem::SimpleFileSystem() { | 123 SimpleFileSystem::SimpleFileSystem() { |
| 124 if (file_system_dir_.CreateUniqueTempDir()) { | 124 if (file_system_dir_.CreateUniqueTempDir()) { |
| 125 file_system_context_ = new FileSystemContext( | 125 file_system_context_ = new FileSystemContext( |
| 126 base::MessageLoopProxy::current(), | 126 base::MessageLoopProxy::current(), |
| 127 base::MessageLoopProxy::current(), | 127 base::MessageLoopProxy::current(), |
| 128 NULL /* special storage policy */, | 128 NULL /* special storage policy */, |
| 129 NULL /* quota manager */, | 129 NULL /* quota manager */, |
| 130 file_system_dir_.path(), | 130 file_system_dir_.path(), |
| 131 false /* incognito */, | 131 fileapi::CreateAllowFileAccessOptions()); |
| 132 true /* allow_file_access */, | |
| 133 NULL); | |
| 134 } else { | 132 } else { |
| 135 LOG(WARNING) << "Failed to create a temp dir for the filesystem." | 133 LOG(WARNING) << "Failed to create a temp dir for the filesystem." |
| 136 "FileSystem feature will be disabled."; | 134 "FileSystem feature will be disabled."; |
| 137 } | 135 } |
| 138 } | 136 } |
| 139 | 137 |
| 140 SimpleFileSystem::~SimpleFileSystem() { | 138 SimpleFileSystem::~SimpleFileSystem() { |
| 141 } | 139 } |
| 142 | 140 |
| 143 void SimpleFileSystem::OpenFileSystem( | 141 void SimpleFileSystem::OpenFileSystem( |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 | 224 |
| 227 FileSystemOperation* SimpleFileSystem::GetNewOperation( | 225 FileSystemOperation* SimpleFileSystem::GetNewOperation( |
| 228 WebFileSystemCallbacks* callbacks) { | 226 WebFileSystemCallbacks* callbacks) { |
| 229 SimpleFileSystemCallbackDispatcher* dispatcher = | 227 SimpleFileSystemCallbackDispatcher* dispatcher = |
| 230 new SimpleFileSystemCallbackDispatcher(AsWeakPtr(), callbacks); | 228 new SimpleFileSystemCallbackDispatcher(AsWeakPtr(), callbacks); |
| 231 FileSystemOperation* operation = new FileSystemOperation( | 229 FileSystemOperation* operation = new FileSystemOperation( |
| 232 dispatcher, base::MessageLoopProxy::current(), | 230 dispatcher, base::MessageLoopProxy::current(), |
| 233 file_system_context_.get()); | 231 file_system_context_.get()); |
| 234 return operation; | 232 return operation; |
| 235 } | 233 } |
| OLD | NEW |