| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_proxy.h" | 9 #include "base/message_loop_proxy.h" |
| 9 #include "base/scoped_callback_factory.h" | 10 #include "base/scoped_callback_factory.h" |
| 10 #include "base/time.h" | 11 #include "base/time.h" |
| 11 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
| 12 #include "googleurl/src/gurl.h" | 13 #include "googleurl/src/gurl.h" |
| 13 #include "third_party/WebKit/WebKit/chromium/public/WebFileInfo.h" | 14 #include "third_party/WebKit/WebKit/chromium/public/WebFileInfo.h" |
| 14 #include "third_party/WebKit/WebKit/chromium/public/WebFileSystemCallbacks.h" | 15 #include "third_party/WebKit/WebKit/chromium/public/WebFileSystemCallbacks.h" |
| 15 #include "third_party/WebKit/WebKit/chromium/public/WebFileSystemEntry.h" | 16 #include "third_party/WebKit/WebKit/chromium/public/WebFileSystemEntry.h" |
| 16 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" | 17 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" |
| 17 #include "third_party/WebKit/WebKit/chromium/public/WebSecurityOrigin.h" | 18 #include "third_party/WebKit/WebKit/chromium/public/WebSecurityOrigin.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 | 111 |
| 111 private: | 112 private: |
| 112 WeakPtr<SimpleFileSystem> file_system_; | 113 WeakPtr<SimpleFileSystem> file_system_; |
| 113 WebFileSystemCallbacks* callbacks_; | 114 WebFileSystemCallbacks* callbacks_; |
| 114 }; | 115 }; |
| 115 | 116 |
| 116 } // namespace | 117 } // namespace |
| 117 | 118 |
| 118 SimpleFileSystem::SimpleFileSystem() { | 119 SimpleFileSystem::SimpleFileSystem() { |
| 119 if (file_system_dir_.CreateUniqueTempDir()) { | 120 if (file_system_dir_.CreateUniqueTempDir()) { |
| 120 sandboxed_context_.reset(new SandboxedFileSystemContext( | 121 sandboxed_context_ = new SandboxedFileSystemContext( |
| 122 base::MessageLoopProxy::CreateForCurrentThread(), |
| 121 base::MessageLoopProxy::CreateForCurrentThread(), | 123 base::MessageLoopProxy::CreateForCurrentThread(), |
| 122 file_system_dir_.path(), | 124 file_system_dir_.path(), |
| 123 false /* incognito */, | 125 false /* incognito */, |
| 124 true /* allow_file_access */, | 126 true /* allow_file_access */, |
| 125 false /* unlimited_quota */)); | 127 false /* unlimited_quota */); |
| 126 } else { | 128 } else { |
| 127 LOG(WARNING) << "Failed to create a temp dir for the filesystem." | 129 LOG(WARNING) << "Failed to create a temp dir for the filesystem." |
| 128 "FileSystem feature will be disabled."; | 130 "FileSystem feature will be disabled."; |
| 129 } | 131 } |
| 130 } | 132 } |
| 131 | 133 |
| 132 SimpleFileSystem::~SimpleFileSystem() { | 134 SimpleFileSystem::~SimpleFileSystem() { |
| 133 } | 135 } |
| 134 | 136 |
| 135 void SimpleFileSystem::OpenFileSystem( | 137 void SimpleFileSystem::OpenFileSystem( |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 | 240 |
| 239 SandboxedFileSystemOperation* SimpleFileSystem::GetNewOperation( | 241 SandboxedFileSystemOperation* SimpleFileSystem::GetNewOperation( |
| 240 WebFileSystemCallbacks* callbacks) { | 242 WebFileSystemCallbacks* callbacks) { |
| 241 SimpleFileSystemCallbackDispatcher* dispatcher = | 243 SimpleFileSystemCallbackDispatcher* dispatcher = |
| 242 new SimpleFileSystemCallbackDispatcher(AsWeakPtr(), callbacks); | 244 new SimpleFileSystemCallbackDispatcher(AsWeakPtr(), callbacks); |
| 243 SandboxedFileSystemOperation* operation = new SandboxedFileSystemOperation( | 245 SandboxedFileSystemOperation* operation = new SandboxedFileSystemOperation( |
| 244 dispatcher, base::MessageLoopProxy::CreateForCurrentThread(), | 246 dispatcher, base::MessageLoopProxy::CreateForCurrentThread(), |
| 245 sandboxed_context_.get()); | 247 sandboxed_context_.get()); |
| 246 return operation; | 248 return operation; |
| 247 } | 249 } |
| OLD | NEW |