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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 private: | 125 private: |
126 WeakPtr<SimpleFileSystem> file_system_; | 126 WeakPtr<SimpleFileSystem> file_system_; |
127 WebFileSystemCallbacks* callbacks_; | 127 WebFileSystemCallbacks* callbacks_; |
128 }; | 128 }; |
129 | 129 |
130 } // namespace | 130 } // namespace |
131 | 131 |
132 SimpleFileSystem::SimpleFileSystem() { | 132 SimpleFileSystem::SimpleFileSystem() { |
133 if (file_system_dir_.CreateUniqueTempDir()) { | 133 if (file_system_dir_.CreateUniqueTempDir()) { |
134 file_system_context_ = new FileSystemContext( | 134 file_system_context_ = new FileSystemContext( |
135 base::MessageLoopProxy::CreateForCurrentThread(), | 135 base::MessageLoopProxy::current(), |
136 base::MessageLoopProxy::CreateForCurrentThread(), | 136 base::MessageLoopProxy::current(), |
137 NULL /* special storage policy */, | 137 NULL /* special storage policy */, |
138 NULL /* quota manager */, | 138 NULL /* quota manager */, |
139 file_system_dir_.path(), | 139 file_system_dir_.path(), |
140 false /* incognito */, | 140 false /* incognito */, |
141 true /* allow_file_access */, | 141 true /* allow_file_access */, |
142 true /* unlimited_quota */, | 142 true /* unlimited_quota */, |
143 NULL); | 143 NULL); |
144 } else { | 144 } else { |
145 LOG(WARNING) << "Failed to create a temp dir for the filesystem." | 145 LOG(WARNING) << "Failed to create a temp dir for the filesystem." |
146 "FileSystem feature will be disabled."; | 146 "FileSystem feature will be disabled."; |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 WebFileWriter* SimpleFileSystem::createFileWriter( | 291 WebFileWriter* SimpleFileSystem::createFileWriter( |
292 const WebURL& path, WebFileWriterClient* client) { | 292 const WebURL& path, WebFileWriterClient* client) { |
293 return new SimpleFileWriter(path, client, file_system_context_.get()); | 293 return new SimpleFileWriter(path, client, file_system_context_.get()); |
294 } | 294 } |
295 | 295 |
296 FileSystemOperation* SimpleFileSystem::GetNewOperation( | 296 FileSystemOperation* SimpleFileSystem::GetNewOperation( |
297 WebFileSystemCallbacks* callbacks) { | 297 WebFileSystemCallbacks* callbacks) { |
298 SimpleFileSystemCallbackDispatcher* dispatcher = | 298 SimpleFileSystemCallbackDispatcher* dispatcher = |
299 new SimpleFileSystemCallbackDispatcher(AsWeakPtr(), callbacks); | 299 new SimpleFileSystemCallbackDispatcher(AsWeakPtr(), callbacks); |
300 FileSystemOperation* operation = new FileSystemOperation( | 300 FileSystemOperation* operation = new FileSystemOperation( |
301 dispatcher, base::MessageLoopProxy::CreateForCurrentThread(), | 301 dispatcher, base::MessageLoopProxy::current(), |
302 file_system_context_.get(), NULL); | 302 file_system_context_.get(), NULL); |
303 return operation; | 303 return operation; |
304 } | 304 } |
OLD | NEW |