diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-07 11:21:11 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-07 11:21:11 +0200 |
commit | 2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 (patch) | |
tree | 988e8c5b116dd0466244ae2fe5af8ee9be926d76 /Source/WebKit/chromium/src/LocalFileSystemChromium.cpp | |
parent | dd91e772430dc294e3bf478c119ef8d43c0a3358 (diff) | |
download | qtwebkit-2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47.tar.gz |
Imported WebKit commit 7e538425aa020340619e927792f3d895061fb54b (http://svn.webkit.org/repository/webkit/trunk@116286)
Diffstat (limited to 'Source/WebKit/chromium/src/LocalFileSystemChromium.cpp')
-rw-r--r-- | Source/WebKit/chromium/src/LocalFileSystemChromium.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp b/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp index be263bea1..5f6d52750 100644 --- a/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp +++ b/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp @@ -33,12 +33,12 @@ #if ENABLE(FILE_SYSTEM) -#include "AsyncFileSystem.h" #include "CrossThreadTask.h" #include "Document.h" #include "ErrorCallback.h" #include "FileSystemCallback.h" #include "FileSystemCallbacks.h" +#include "FileSystemType.h" #include "PlatformString.h" #include "WebFileError.h" #include "platform/WebFileSystem.h" @@ -108,7 +108,8 @@ public: private: AllowFileSystemMainThreadBridge(WebCore::WorkerLoaderProxy* workerLoaderProxy, const String& mode, WebCommonWorkerClient* commonClient) - : m_workerLoaderProxy(workerLoaderProxy) + : m_result(false) + , m_workerLoaderProxy(workerLoaderProxy) { WebWorkerBase::dispatchTaskToMainThread(createCallbackTask(&allowFileSystemTask, mode, AllowCrossThreadAccess(commonClient), this)); } @@ -152,7 +153,7 @@ bool allowFileSystemForWorker(WebCommonWorkerClient* commonClient) return bridge->result(); } -void openFileSystemForWorker(WebCommonWorkerClient* commonClient, WebFileSystem::Type type, long long size, bool create, WebFileSystemCallbacks* callbacks, bool synchronous) +void openFileSystemForWorker(WebCommonWorkerClient* commonClient, WebFileSystem::Type type, long long size, bool create, WebFileSystemCallbacks* callbacks, FileSystemSynchronousType synchronousType) { WorkerScriptController* controller = WorkerScriptController::controllerForContext(); WorkerContext* workerContext = controller->workerContext(); @@ -167,7 +168,7 @@ void openFileSystemForWorker(WebCommonWorkerClient* commonClient, WebFileSystem: RefPtr<WorkerFileSystemCallbacksBridge> bridge = WorkerFileSystemCallbacksBridge::create(workerLoaderProxy, workerContext, callbacks); bridge->postOpenFileSystemToMainThread(commonClient, type, size, create, mode); - if (synchronous) { + if (synchronousType == SynchronousFileSystem) { if (runLoop.runInMode(workerContext, mode) == MessageQueueTerminated) bridge->stop(); } @@ -182,7 +183,7 @@ static void openFileSystemNotAllowed(ScriptExecutionContext*, PassOwnPtr<AsyncFi callbacks->didFail(WebKit::WebFileErrorAbort); } -static void openFileSystemHelper(ScriptExecutionContext* context, AsyncFileSystem::Type type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, bool synchronous, long long size, CreationFlag create) +static void openFileSystemHelper(ScriptExecutionContext* context, FileSystemType type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, FileSystemSynchronousType synchronousType, long long size, CreationFlag create) { bool allowed = true; ASSERT(context); @@ -202,7 +203,7 @@ static void openFileSystemHelper(ScriptExecutionContext* context, AsyncFileSyste if (!allowFileSystemForWorker(webWorker->commonClient())) allowed = false; else - openFileSystemForWorker(webWorker->commonClient(), static_cast<WebFileSystem::Type>(type), size, create == CreateIfNotPresent, new WebFileSystemCallbacksImpl(callbacks, type, context, synchronous), synchronous); + openFileSystemForWorker(webWorker->commonClient(), static_cast<WebFileSystem::Type>(type), size, create == CreateIfNotPresent, new WebFileSystemCallbacksImpl(callbacks, type, context, synchronousType), synchronousType); #else ASSERT_NOT_REACHED(); @@ -215,14 +216,14 @@ static void openFileSystemHelper(ScriptExecutionContext* context, AsyncFileSyste } } -void LocalFileSystem::readFileSystem(ScriptExecutionContext* context, AsyncFileSystem::Type type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, bool synchronous) +void LocalFileSystem::readFileSystem(ScriptExecutionContext* context, FileSystemType type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, FileSystemSynchronousType synchronousType) { - openFileSystemHelper(context, type, callbacks, synchronous, 0, OpenExisting); + openFileSystemHelper(context, type, callbacks, synchronousType, 0, OpenExisting); } -void LocalFileSystem::requestFileSystem(ScriptExecutionContext* context, AsyncFileSystem::Type type, long long size, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, bool synchronous) +void LocalFileSystem::requestFileSystem(ScriptExecutionContext* context, FileSystemType type, long long size, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, FileSystemSynchronousType synchronousType) { - openFileSystemHelper(context, type, callbacks, synchronous, size, CreateIfNotPresent); + openFileSystemHelper(context, type, callbacks, synchronousType, size, CreateIfNotPresent); } } // namespace WebCore |