Changeset 116283 in webkit
- Timestamp:
- May 7, 2012 1:57:37 AM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r116282 r116283 1 2012-05-06 Kinuko Yasuda <kinuko@chromium.org> 2 3 Cleanup: Change boolean synchronous flag argument into enum in FileSystem API code 4 https://bugs.webkit.org/show_bug.cgi?id=85741 5 6 Reviewed by David Levin. 7 8 No new tests as this change has no functional effects. 9 10 * Modules/filesystem/DOMWindowFileSystem.cpp: 11 (WebCore::DOMWindowFileSystem::webkitRequestFileSystem): 12 * Modules/filesystem/LocalFileSystem.cpp: 13 (WebCore::LocalFileSystem::requestFileSystem): 14 * Modules/filesystem/LocalFileSystem.h: 15 (LocalFileSystem): 16 * Modules/filesystem/WorkerContextFileSystem.cpp: 17 (WebCore::WorkerContextFileSystem::webkitRequestFileSystem): 18 (WebCore::WorkerContextFileSystem::webkitRequestFileSystemSync): 19 (WebCore::WorkerContextFileSystem::webkitResolveLocalFileSystemSyncURL): 20 * platform/FileSystemType.h: Added FileSystemSynchronousType enum. 21 1 22 2012-05-07 Antti Koivisto <antti@apple.com> 2 23 -
trunk/Source/WebCore/Modules/filesystem/DOMWindowFileSystem.cpp
r116280 r116283 38 38 #include "FileSystemCallback.h" 39 39 #include "FileSystemCallbacks.h" 40 #include "FileSystemType.h" 40 41 #include "LocalFileSystem.h" 41 42 #include "SecurityOrigin.h" … … 71 72 } 72 73 73 LocalFileSystem::localFileSystem().requestFileSystem(document, fileSystemType, size, FileSystemCallbacks::create(successCallback, errorCallback, document), false);74 LocalFileSystem::localFileSystem().requestFileSystem(document, fileSystemType, size, FileSystemCallbacks::create(successCallback, errorCallback, document), AsynchronousFileSystem); 74 75 } 75 76 -
trunk/Source/WebCore/Modules/filesystem/LocalFileSystem.cpp
r111075 r116283 89 89 } 90 90 91 void LocalFileSystem::requestFileSystem(ScriptExecutionContext* context, AsyncFileSystem::Type type, long long, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, bool)91 void LocalFileSystem::requestFileSystem(ScriptExecutionContext* context, AsyncFileSystem::Type type, long long, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, FileSystemSynchronousType) 92 92 { 93 93 // AsyncFileSystem::openFileSystem calls callbacks synchronously, so the method needs to be called asynchronously. -
trunk/Source/WebCore/Modules/filesystem/LocalFileSystem.h
r116280 r116283 56 56 57 57 // Does not create the root path for file system, just reads it if available. 58 void readFileSystem(ScriptExecutionContext*, FileSystemType, PassOwnPtr<AsyncFileSystemCallbacks>, bool synchronous = false);58 void readFileSystem(ScriptExecutionContext*, FileSystemType, PassOwnPtr<AsyncFileSystemCallbacks>, FileSystemSynchronousType = AsynchronousFileSystem); 59 59 60 void requestFileSystem(ScriptExecutionContext*, FileSystemType, long long size, PassOwnPtr<AsyncFileSystemCallbacks>, bool synchronous = false);60 void requestFileSystem(ScriptExecutionContext*, FileSystemType, long long size, PassOwnPtr<AsyncFileSystemCallbacks>, FileSystemSynchronousType = AsynchronousFileSystem); 61 61 62 62 #if !PLATFORM(CHROMIUM) -
trunk/Source/WebCore/Modules/filesystem/WorkerContextFileSystem.cpp
r116280 r116283 42 42 #include "FileSystemCallback.h" 43 43 #include "FileSystemCallbacks.h" 44 #include "FileSystemType.h" 44 45 #include "LocalFileSystem.h" 45 46 #include "SecurityOrigin.h" … … 63 64 } 64 65 65 LocalFileSystem::localFileSystem().requestFileSystem(worker, fileSystemType, size, FileSystemCallbacks::create(successCallback, errorCallback, worker), false);66 LocalFileSystem::localFileSystem().requestFileSystem(worker, fileSystemType, size, FileSystemCallbacks::create(successCallback, errorCallback, worker), AsynchronousFileSystem); 66 67 } 67 68 … … 82 83 83 84 FileSystemSyncCallbackHelper helper; 84 LocalFileSystem::localFileSystem().requestFileSystem(worker, fileSystemType, size, FileSystemCallbacks::create(helper.successCallback(), helper.errorCallback(), worker), true);85 LocalFileSystem::localFileSystem().requestFileSystem(worker, fileSystemType, size, FileSystemCallbacks::create(helper.successCallback(), helper.errorCallback(), worker), SynchronousFileSystem); 85 86 return helper.getResult(ec); 86 87 } … … 123 124 124 125 FileSystemSyncCallbackHelper readFileSystemHelper; 125 LocalFileSystem::localFileSystem().readFileSystem(worker, type, FileSystemCallbacks::create(readFileSystemHelper.successCallback(), readFileSystemHelper.errorCallback(), worker), true);126 LocalFileSystem::localFileSystem().readFileSystem(worker, type, FileSystemCallbacks::create(readFileSystemHelper.successCallback(), readFileSystemHelper.errorCallback(), worker), SynchronousFileSystem); 126 127 RefPtr<DOMFileSystemSync> fileSystem = readFileSystemHelper.getResult(ec); 127 128 if (!fileSystem) -
trunk/Source/WebCore/platform/FileSystemType.h
r116280 r116283 50 50 }; 51 51 52 enum FileSystemSynchronousType { 53 AsynchronousFileSystem, 54 SynchronousFileSystem, 55 }; 56 52 57 } // namespace WebCore 53 58 -
trunk/Source/WebKit/chromium/ChangeLog
r116280 r116283 1 2012-05-06 Kinuko Yasuda <kinuko@chromium.org> 2 3 Cleanup: Change boolean synchronous flag argument into enum in FileSystem API code 4 https://bugs.webkit.org/show_bug.cgi?id=85741 5 6 Reviewed by David Levin. 7 8 * src/LocalFileSystemChromium.cpp: 9 (WebCore::openFileSystemHelper): 10 (WebCore::LocalFileSystem::readFileSystem): 11 (WebCore::LocalFileSystem::requestFileSystem): 12 * src/WebFileSystemCallbacksImpl.cpp: 13 (WebKit::WebFileSystemCallbacksImpl::WebFileSystemCallbacksImpl): 14 (WebKit::WebFileSystemCallbacksImpl::didOpenFileSystem): 15 * src/WebFileSystemCallbacksImpl.h: 16 (WebFileSystemCallbacksImpl): 17 * src/WorkerAsyncFileSystemChromium.cpp: 18 (WebCore::WorkerAsyncFileSystemChromium::WorkerAsyncFileSystemChromium): 19 (WebCore::WorkerAsyncFileSystemChromium::createWorkerFileSystemCallbacksBridge): 20 * src/WorkerAsyncFileSystemChromium.h: 21 (WebCore::WorkerAsyncFileSystemChromium::create): 22 (WorkerAsyncFileSystemChromium): 23 1 24 2012-05-06 Kinuko Yasuda <kinuko@chromium.org> 2 25 -
trunk/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp
r116280 r116283 57 57 // For external filesystem. 58 58 const char externalPathPrefix[] = "external"; 59 const size_t externalPathPrefixLength = sizeof(externalPathPrefix) - 1;60 59 61 60 // Specialized callback class for createSnapshotFileAndReadMetadata. -
trunk/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp
r116280 r116283 154 154 } 155 155 156 void openFileSystemForWorker(WebCommonWorkerClient* commonClient, WebFileSystem::Type type, long long size, bool create, WebFileSystemCallbacks* callbacks, bool synchronous)156 void openFileSystemForWorker(WebCommonWorkerClient* commonClient, WebFileSystem::Type type, long long size, bool create, WebFileSystemCallbacks* callbacks, FileSystemSynchronousType synchronousType) 157 157 { 158 158 WorkerScriptController* controller = WorkerScriptController::controllerForContext(); … … 169 169 bridge->postOpenFileSystemToMainThread(commonClient, type, size, create, mode); 170 170 171 if (synchronous ) {171 if (synchronousType == SynchronousFileSystem) { 172 172 if (runLoop.runInMode(workerContext, mode) == MessageQueueTerminated) 173 173 bridge->stop(); … … 184 184 } 185 185 186 static void openFileSystemHelper(ScriptExecutionContext* context, FileSystemType type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, bool synchronous, long long size, CreationFlag create)186 static void openFileSystemHelper(ScriptExecutionContext* context, FileSystemType type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, FileSystemSynchronousType synchronousType, long long size, CreationFlag create) 187 187 { 188 188 bool allowed = true; … … 204 204 allowed = false; 205 205 else 206 openFileSystemForWorker(webWorker->commonClient(), static_cast<WebFileSystem::Type>(type), size, create == CreateIfNotPresent, new WebFileSystemCallbacksImpl(callbacks, type, context, synchronous ), synchronous);206 openFileSystemForWorker(webWorker->commonClient(), static_cast<WebFileSystem::Type>(type), size, create == CreateIfNotPresent, new WebFileSystemCallbacksImpl(callbacks, type, context, synchronousType), synchronousType); 207 207 208 208 #else … … 217 217 } 218 218 219 void LocalFileSystem::readFileSystem(ScriptExecutionContext* context, FileSystemType type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, bool synchronous)220 { 221 openFileSystemHelper(context, type, callbacks, synchronous , 0, OpenExisting);222 } 223 224 void LocalFileSystem::requestFileSystem(ScriptExecutionContext* context, FileSystemType type, long long size, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, bool synchronous)225 { 226 openFileSystemHelper(context, type, callbacks, synchronous , size, CreateIfNotPresent);219 void LocalFileSystem::readFileSystem(ScriptExecutionContext* context, FileSystemType type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, FileSystemSynchronousType synchronousType) 220 { 221 openFileSystemHelper(context, type, callbacks, synchronousType, 0, OpenExisting); 222 } 223 224 void LocalFileSystem::requestFileSystem(ScriptExecutionContext* context, FileSystemType type, long long size, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, FileSystemSynchronousType synchronousType) 225 { 226 openFileSystemHelper(context, type, callbacks, synchronousType, size, CreateIfNotPresent); 227 227 } 228 228 -
trunk/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp
r116280 r116283 48 48 namespace WebKit { 49 49 50 WebFileSystemCallbacksImpl::WebFileSystemCallbacksImpl(PassOwnPtr<AsyncFileSystemCallbacks> callbacks, FileSystemType type, WebCore::ScriptExecutionContext* context, bool synchronous)50 WebFileSystemCallbacksImpl::WebFileSystemCallbacksImpl(PassOwnPtr<AsyncFileSystemCallbacks> callbacks, FileSystemType type, WebCore::ScriptExecutionContext* context, FileSystemSynchronousType synchronousType) 51 51 : m_callbacks(callbacks) 52 52 , m_type(type) 53 53 , m_context(context) 54 , m_synchronous (synchronous)54 , m_synchronousType(synchronousType) 55 55 { 56 56 ASSERT(m_callbacks); … … 93 93 #if ENABLE(WORKERS) 94 94 if (m_context && m_context->isWorkerContext()) { 95 m_callbacks->didOpenFileSystem(name, WorkerAsyncFileSystemChromium::create(m_context, m_type, rootURL, m_synchronous ));95 m_callbacks->didOpenFileSystem(name, WorkerAsyncFileSystemChromium::create(m_context, m_type, rootURL, m_synchronousType)); 96 96 return; 97 97 } -
trunk/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.h
r116280 r116283 53 53 class WebFileSystemCallbacksImpl : public WebFileSystemCallbacks { 54 54 public: 55 WebFileSystemCallbacksImpl(PassOwnPtr<WebCore::AsyncFileSystemCallbacks>, WebCore::FileSystemType = WebCore::FileSystemTypeTemporary, WebCore::ScriptExecutionContext* = 0, bool synchronous = false);55 WebFileSystemCallbacksImpl(PassOwnPtr<WebCore::AsyncFileSystemCallbacks>, WebCore::FileSystemType = WebCore::FileSystemTypeTemporary, WebCore::ScriptExecutionContext* = 0, WebCore::FileSystemSynchronousType = WebCore::AsynchronousFileSystem); 56 56 virtual ~WebFileSystemCallbacksImpl(); 57 57 … … 70 70 // Used for worker's openFileSystem callbacks. 71 71 WebCore::ScriptExecutionContext* m_context; 72 bool m_synchronous;72 WebCore::FileSystemSynchronousType m_synchronousType; 73 73 }; 74 74 -
trunk/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.cpp
r116280 r116283 58 58 static const char fileSystemOperationsMode[] = "fileSystemOperationsMode"; 59 59 60 WorkerAsyncFileSystemChromium::WorkerAsyncFileSystemChromium(ScriptExecutionContext* context, FileSystemType type, const WebKit::WebURL& rootURL, bool synchronous)60 WorkerAsyncFileSystemChromium::WorkerAsyncFileSystemChromium(ScriptExecutionContext* context, FileSystemType type, const WebKit::WebURL& rootURL, FileSystemSynchronousType synchronousType) 61 61 : AsyncFileSystemChromium(type, rootURL) 62 62 , m_scriptExecutionContext(context) 63 63 , m_workerContext(static_cast<WorkerContext*>(context)) 64 , m_synchronous (synchronous)64 , m_synchronousType(synchronousType) 65 65 { 66 66 ASSERT(m_scriptExecutionContext->isWorkerContext()); … … 220 220 PassRefPtr<WorkerFileSystemCallbacksBridge> WorkerAsyncFileSystemChromium::createWorkerFileSystemCallbacksBridge(PassOwnPtr<AsyncFileSystemCallbacks> callbacks) 221 221 { 222 ASSERT( !m_synchronous|| !m_bridgeForCurrentOperation);222 ASSERT(m_synchronousType == AsynchronousFileSystem || !m_bridgeForCurrentOperation); 223 223 224 224 m_modeForCurrentOperation = fileSystemOperationsMode; -
trunk/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.h
r116280 r116283 35 35 36 36 #include "AsyncFileSystemChromium.h" 37 #include "FileSystemType.h" 37 38 #include <wtf/PassOwnPtr.h> 38 39 #include <wtf/RefPtr.h> … … 53 54 class WorkerAsyncFileSystemChromium : public AsyncFileSystemChromium { 54 55 public: 55 static PassOwnPtr<AsyncFileSystem> create(ScriptExecutionContext* context, FileSystemType type, const WebKit::WebURL& rootURL, bool synchronous)56 static PassOwnPtr<AsyncFileSystem> create(ScriptExecutionContext* context, FileSystemType type, const WebKit::WebURL& rootURL, FileSystemSynchronousType synchronousType) 56 57 { 57 return adoptPtr(new WorkerAsyncFileSystemChromium(context, type, rootURL, synchronous ));58 return adoptPtr(new WorkerAsyncFileSystemChromium(context, type, rootURL, synchronousType)); 58 59 } 59 60 … … 77 78 78 79 private: 79 WorkerAsyncFileSystemChromium(ScriptExecutionContext*, FileSystemType, const WebKit::WebURL& rootURL, bool synchronous);80 WorkerAsyncFileSystemChromium(ScriptExecutionContext*, FileSystemType, const WebKit::WebURL& rootURL, FileSystemSynchronousType); 80 81 81 82 PassRefPtr<WebKit::WorkerFileSystemCallbacksBridge> createWorkerFileSystemCallbacksBridge(PassOwnPtr<AsyncFileSystemCallbacks>); … … 86 87 RefPtr<WebKit::WorkerFileSystemCallbacksBridge> m_bridgeForCurrentOperation; 87 88 String m_modeForCurrentOperation; 88 bool m_synchronous;89 FileSystemSynchronousType m_synchronousType; 89 90 }; 90 91
Note: See TracChangeset
for help on using the changeset viewer.