Changeset 145771 in webkit
- Timestamp:
- Mar 13, 2013 5:01:24 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r145768 r145771 1 2013-03-13 Michael Nordman <michaeln@google.com> 2 3 FileSystem mods: Changes to snapshot file creation to reduce dependencies on blob URLs. 4 Adding a new minimal BlobDataHandle class which will be reimplemented/built upon in later CLs. In this 5 patch, it's just enough to refactor the FileSystem code to not function in terms of blobURLs. 6 https://bugs.webkit.org/show_bug.cgi?id=108851 7 8 Reviewed by Adam Barth. 9 10 No new tests. This is strictly a refactoring of the existing code. 11 12 * Modules/filesystem/DOMFileSystem.cpp: 13 (WebCore): 14 (WebCore::DOMFileSystem::createFile): 15 * Modules/filesystem/DOMFileSystemSync.cpp: 16 (WebCore): 17 * platform/AsyncFileSystemCallbacks.h: 18 (AsyncFileSystemCallbacks): 19 (WebCore::AsyncFileSystemCallbacks::didCreateSnapshotFile): 20 * platform/gtk/AsyncFileSystemGtk.cpp: 21 (WebCore::AsyncFileSystemGtk::createSnapshotFileAndReadMetadata): 22 (WebCore): 23 * platform/network/BlobData.cpp: 24 (WebCore): 25 (WebCore::BlobDataHandle::BlobDataHandle): 26 (WebCore::BlobDataHandle::~BlobDataHandle): 27 * platform/network/BlobData.h: 28 (WebCore): 29 (BlobDataHandle): 30 (WebCore::BlobDataHandle::create): 31 1 32 2013-03-13 Ryosuke Niwa <rniwa@webkit.org> 2 33 -
trunk/Source/WebCore/Modules/filesystem/DOMFileSystem.cpp
r125391 r145771 149 149 namespace { 150 150 151 class GetMetadataCallback : public FileSystemCallbacksBase {151 class SnapshotFileCallback : public FileSystemCallbacksBase { 152 152 public: 153 static PassOwnPtr< GetMetadataCallback> create(PassRefPtr<DOMFileSystem> filesystem, const String& name, const KURL& url, PassRefPtr<FileCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)154 { 155 return adoptPtr(new GetMetadataCallback(filesystem, name, url, successCallback, errorCallback));156 } 157 158 virtual void did ReadMetadata(const FileMetadata& metadata)153 static PassOwnPtr<SnapshotFileCallback> create(PassRefPtr<DOMFileSystem> filesystem, const String& name, const KURL& url, PassRefPtr<FileCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) 154 { 155 return adoptPtr(new SnapshotFileCallback(filesystem, name, url, successCallback, errorCallback)); 156 } 157 158 virtual void didCreateSnapshotFile(const FileMetadata& metadata, PassRefPtr<BlobDataHandle> snapshot) 159 159 { 160 160 ASSERT(!metadata.platformPath.isEmpty()); 161 161 if (!m_successCallback) 162 162 return; 163 164 // We can't directly use the snapshot blob data handle because the content type on it hasn't been set. 165 // The |snapshot| param is here to provide a a chain of custody thru thread bridging that is held onto until 166 // *after* we've coined a File with a new handle that has the correct type set on it. This allows the 167 // blob storage system to track when a temp file can and can't be safely deleted. 163 168 164 169 // For regular filesystem types (temporary or persistent), we should not cache file metadata as it could change File semantics. … … 180 185 181 186 private: 182 GetMetadataCallback(PassRefPtr<DOMFileSystem> filesystem, const String& name, const KURL& url, PassRefPtr<FileCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)187 SnapshotFileCallback(PassRefPtr<DOMFileSystem> filesystem, const String& name, const KURL& url, PassRefPtr<FileCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) 183 188 : FileSystemCallbacksBase(errorCallback) 184 189 , m_filesystem(filesystem) … … 200 205 { 201 206 KURL fileSystemURL = createFileSystemURL(fileEntry); 202 m_asyncFileSystem->createSnapshotFileAndReadMetadata(fileSystemURL, GetMetadataCallback::create(this, fileEntry->name(), fileSystemURL, successCallback, errorCallback));207 m_asyncFileSystem->createSnapshotFileAndReadMetadata(fileSystemURL, SnapshotFileCallback::create(this, fileEntry->name(), fileSystemURL, successCallback, errorCallback)); 203 208 } 204 209 -
trunk/Source/WebCore/Modules/filesystem/DOMFileSystemSync.cpp
r125391 r145771 114 114 } 115 115 116 void didReadMetadata(const FileMetadata& metadata) 117 { 116 virtual void didCreateSnapshotFile(const FileMetadata& metadata, PassRefPtr<BlobDataHandle> snapshot) 117 { 118 // We can't directly use the snapshot blob data handle because the content type on it hasn't been set. 119 // The |snapshot| param is here to provide a a chain of custody thru thread bridging that is held onto until 120 // *after* we've coined a File with a new handle that has the correct type set on it. This allows the 121 // blob storage system to track when a temp file can and can't be safely deleted. 122 118 123 // For regular filesystem types (temporary or persistent), we should not cache file metadata as it could change File semantics. 119 // For other filesystem types (which could be platform-specific ones), there's a chance that the files are on remote filesystem. If the port has returned metadata just pass it to File constructor (so we may cache the metadata). 124 // For other filesystem types (which could be platform-specific ones), there's a chance that the files are on remote filesystem. 125 // If the port has returned metadata just pass it to File constructor (so we may cache the metadata). 120 126 // FIXME: We should use the snapshot metadata for all files. 121 127 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=17746 -
trunk/Source/WebCore/platform/AsyncFileSystemCallbacks.h
r127757 r145771 36 36 #include "AsyncFileSystem.h" 37 37 #include "AsyncFileWriter.h" 38 #include "BlobData.h" 38 39 #include "FileMetadata.h" 39 40 #include <wtf/text/WTFString.h> … … 54 55 // Called when a file metadata is read successfully. 55 56 virtual void didReadMetadata(const FileMetadata&) { ASSERT_NOT_REACHED(); } 57 58 // Called when a snapshot file is created successfully. 59 virtual void didCreateSnapshotFile(const FileMetadata&, PassRefPtr<BlobDataHandle> snapshot) { ASSERT_NOT_REACHED(); } 56 60 57 61 // Called when a directory entry is read. -
trunk/Source/WebCore/platform/gtk/AsyncFileSystemGtk.cpp
r129988 r145771 119 119 } 120 120 121 void AsyncFileSystemGtk::createSnapshotFileAndReadMetadata(const KURL&, PassOwnPtr<AsyncFileSystemCallbacks>) 122 { 123 notImplemented(); 124 } 125 121 126 } // namespace WebCore 122 127 -
trunk/Source/WebCore/platform/network/BlobData.cpp
r125391 r145771 31 31 #include "config.h" 32 32 #include "BlobData.h" 33 #include "BlobURL.h" 34 #include "ThreadableBlobRegistry.h" 33 35 34 36 #include <wtf/OwnPtr.h> … … 102 104 } 103 105 106 107 BlobDataHandle::BlobDataHandle(PassOwnPtr<BlobData> data, long long size) 108 { 109 UNUSED_PARAM(size); 110 m_internalURL = BlobURL::createInternalURL(); 111 ThreadableBlobRegistry::registerBlobURL(m_internalURL, data); 112 } 113 114 BlobDataHandle::~BlobDataHandle() 115 { 116 ThreadableBlobRegistry::unregisterBlobURL(m_internalURL); 117 } 118 104 119 } // namespace WebCore -
trunk/Source/WebCore/platform/network/BlobData.h
r144372 r145771 203 203 }; 204 204 205 // FIXME: This class is mostly place holder until I get farther along with 206 // https://bugs.webkit.org/show_bug.cgi?id=108733 and more specifically with landing 207 // https://codereview.chromium.org/11192017/. 208 class BlobDataHandle : public ThreadSafeRefCounted<BlobDataHandle> { 209 public: 210 static PassRefPtr<BlobDataHandle> create(PassOwnPtr<BlobData> data, long long size) 211 { 212 return adoptRef(new BlobDataHandle(data, size)); 213 } 214 215 ~BlobDataHandle(); 216 217 private: 218 BlobDataHandle(PassOwnPtr<BlobData>, long long size); 219 KURL m_internalURL; 220 }; 221 205 222 } // namespace WebCore 206 223 -
trunk/Source/WebKit/chromium/ChangeLog
r145770 r145771 1 2013-03-13 Michael Nordman <michaeln@google.com> 2 3 [Chromium] FileSystem mods: Changes to snapshot file creation to reduce dependencies on blobs. 4 No longer send a |blobURL| to the browser process, no longer expect the browser process 5 to have registered a blob with that url. 6 https://bugs.webkit.org/show_bug.cgi?id=108851 7 8 Reviewed by Adam Barth. 9 10 * src/AsyncFileSystemChromium.cpp: 11 (WebCore): 12 (WebCore::FileWriterHelperCallbacks::didCreateSnapshotFile): 13 (WebCore::AsyncFileSystemChromium::createSnapshotFileAndReadMetadata): 14 * src/AsyncFileSystemChromium.h: 15 (AsyncFileSystemChromium): 16 * src/LocalFileSystemChromium.cpp: 17 (WebCore): 18 * src/WebFileSystemCallbacksImpl.cpp: 19 (WebKit::WebFileSystemCallbacksImpl::didCreateSnapshotFile): 20 (WebKit): 21 * src/WebFileSystemCallbacksImpl.h: 22 (WebCore): 23 (WebFileSystemCallbacksImpl): 24 * src/WorkerAsyncFileSystemChromium.cpp: 25 (WebCore::WorkerAsyncFileSystemChromium::createSnapshotFileAndReadMetadata): 26 (WebCore::WorkerAsyncFileSystemChromium::createWorkerFileSystemCallbacksBridge): 27 * src/WorkerFileSystemCallbacksBridge.cpp: 28 (WebKit::MainThreadFileSystemCallbacks::didCreateSnapshotFile): 29 (MainThreadFileSystemCallbacks): 30 (WebKit::WorkerFileSystemCallbacksBridge::postCreateSnapshotFileToMainThread): 31 (WebKit::WorkerFileSystemCallbacksBridge::createSnapshotFileOnMainThread): 32 (WebKit::WorkerFileSystemCallbacksBridge::didCreateSnapshotFileOnMainThread): 33 (WebKit): 34 (WebKit::WorkerFileSystemCallbacksBridge::WorkerFileSystemCallbacksBridge): 35 (WebKit::WorkerFileSystemCallbacksBridge::didCreateSnapshotFileOnWorkerThread): 36 * src/WorkerFileSystemCallbacksBridge.h: 37 (WebCore): 38 (WebKit): 39 (WebKit::WorkerFileSystemCallbacksBridge::create): 40 (WorkerFileSystemCallbacksBridge): 41 1 42 2013-03-13 Adam Barth <abarth@webkit.org> 2 43 -
trunk/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp
r138798 r145771 48 48 49 49 namespace WebCore { 50 51 namespace {52 53 // Specialized callback class for createSnapshotFileAndReadMetadata.54 class SnapshotFileCallbacks : public AsyncFileSystemCallbacks {55 public:56 static PassOwnPtr<SnapshotFileCallbacks> create(const KURL& internalBlobURL, PassOwnPtr<WebCore::AsyncFileSystemCallbacks> callbacks)57 {58 return adoptPtr(new SnapshotFileCallbacks(internalBlobURL, callbacks));59 }60 61 virtual void didReadMetadata(const FileMetadata& metadata)62 {63 ASSERT(m_callbacks);64 65 // This will create a new File object using the metadata.66 m_callbacks->didReadMetadata(metadata);67 68 // Now that we've registered the snapshot file, we can unregister our internalBlobURL which has played a placeholder for the file during the IPC.69 ThreadableBlobRegistry::unregisterBlobURL(m_internalBlobURL);70 }71 72 virtual void didFail(int error)73 {74 ASSERT(m_callbacks);75 m_callbacks->didFail(error);76 }77 78 private:79 SnapshotFileCallbacks(const KURL& internalBlobURL, PassOwnPtr<WebCore::AsyncFileSystemCallbacks> callbacks)80 : m_internalBlobURL(internalBlobURL)81 , m_callbacks(callbacks)82 {83 }84 85 KURL m_internalBlobURL;86 OwnPtr<WebCore::AsyncFileSystemCallbacks> m_callbacks;87 };88 89 } // namespace90 50 91 51 bool AsyncFileSystem::isAvailable() … … 187 147 delete this; 188 148 } 189 149 virtual void didCreateSnapshotFile(const WebKit::WebFileInfo& info) 150 { 151 ASSERT_NOT_REACHED(); 152 delete this; 153 } 190 154 virtual void didReadDirectory(const WebKit::WebVector<WebKit::WebFileSystemEntry>& entries, bool hasMore) 191 155 { … … 220 184 void AsyncFileSystemChromium::createSnapshotFileAndReadMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) 221 185 { 222 KURL internalBlobURL = BlobURL::createInternalURL(); 223 224 // This will create a snapshot file and register the file to a blob using the given internalBlobURL. 225 m_webFileSystem->createSnapshotFileAndReadMetadata(internalBlobURL, path, new WebKit::WebFileSystemCallbacksImpl(createSnapshotFileCallback(internalBlobURL, callbacks))); 226 } 227 228 PassOwnPtr<AsyncFileSystemCallbacks> AsyncFileSystemChromium::createSnapshotFileCallback(const KURL& internalBlobURL, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) const 229 { 230 return SnapshotFileCallbacks::create(internalBlobURL, callbacks); 186 m_webFileSystem->createSnapshotFileAndReadMetadata(path, new WebKit::WebFileSystemCallbacksImpl(callbacks)); 231 187 } 232 188 -
trunk/Source/WebKit/chromium/src/AsyncFileSystemChromium.h
r116388 r145771 70 70 AsyncFileSystemChromium(); 71 71 72 PassOwnPtr<AsyncFileSystemCallbacks> createSnapshotFileCallback(const KURL& internalBlobURL, PassOwnPtr<AsyncFileSystemCallbacks>) const;73 74 72 WebKit::WebFileSystem* m_webFileSystem; 75 73 }; -
trunk/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp
r145452 r145771 154 154 } 155 155 156 void openFileSystemForWorker(WebCommonWorkerClient* commonClient, WebFileSystem::Type type, long long size, bool create, WebFileSystemCallbacks * callbacks, FileSystemSynchronousType synchronousType)156 void openFileSystemForWorker(WebCommonWorkerClient* commonClient, WebFileSystem::Type type, long long size, bool create, WebFileSystemCallbacksImpl* callbacks, FileSystemSynchronousType synchronousType) 157 157 { 158 158 WorkerScriptController* controller = WorkerScriptController::controllerForContext(); -
trunk/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp
r145452 r145771 77 77 } 78 78 79 void WebFileSystemCallbacksImpl::didCreateSnapshotFile(const WebFileInfo& webFileInfo) 80 { 81 // It's important to create a BlobDataHandle that refers to the platform file path prior 82 // to return from this method so the underlying file will not be deleted. 83 OwnPtr<BlobData> blobData = BlobData::create(); 84 blobData->appendFile(webFileInfo.platformPath); 85 RefPtr<BlobDataHandle> snapshotBlob = BlobDataHandle::create(blobData.release(), webFileInfo.length); 86 didCreateSnapshotFile(webFileInfo, snapshotBlob); 87 } 88 89 void WebFileSystemCallbacksImpl::didCreateSnapshotFile(const WebFileInfo& webFileInfo, PassRefPtr<WebCore::BlobDataHandle> snapshot) 90 { 91 FileMetadata fileMetadata; 92 fileMetadata.modificationTime = webFileInfo.modificationTime; 93 fileMetadata.length = webFileInfo.length; 94 fileMetadata.type = static_cast<FileMetadata::Type>(webFileInfo.type); 95 fileMetadata.platformPath = webFileInfo.platformPath; 96 m_callbacks->didCreateSnapshotFile(fileMetadata, snapshot); 97 delete this; 98 } 99 79 100 void WebFileSystemCallbacksImpl::didReadDirectory(const WebVector<WebFileSystemEntry>& entries, bool hasMore) 80 101 { -
trunk/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.h
r145452 r145771 41 41 namespace WebCore { 42 42 class AsyncFileSystemCallbacks; 43 class BlobDataHandle; 43 44 class ScriptExecutionContext; 44 45 } … … 57 58 58 59 virtual void didSucceed(); 59 virtual void didReadMetadata(const WebFileInfo& info); 60 virtual void didReadMetadata(const WebFileInfo&); 61 virtual void didCreateSnapshotFile(const WebFileInfo&); 60 62 virtual void didReadDirectory(const WebVector<WebFileSystemEntry>& entries, bool hasMore); 61 63 virtual void didOpenFileSystem(const WebString& name, const WebURL& rootURL); 62 64 virtual void didFail(WebFileError error); 65 66 // This internal overload is used by WorkerFileSystemCallbacksBridge to deliver a blob data handle 67 // created on the main thread to an AsyncFileSystemCallback on a background worker thread. The other 68 // virtual method is invoked by the embedder. 69 void didCreateSnapshotFile(const WebFileInfo&, PassRefPtr<WebCore::BlobDataHandle> snapshot); 63 70 64 71 private: -
trunk/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.cpp
r138693 r145771 180 180 void WorkerAsyncFileSystemChromium::createSnapshotFileAndReadMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) 181 181 { 182 KURL internalBlobURL = BlobURL::createInternalURL(); 183 184 createWorkerFileSystemCallbacksBridge(createSnapshotFileCallback(internalBlobURL, callbacks))->postCreateSnapshotFileToMainThread(m_webFileSystem, internalBlobURL, path, m_modeForCurrentOperation); 182 createWorkerFileSystemCallbacksBridge(callbacks)->postCreateSnapshotFileToMainThread(m_webFileSystem, path, m_modeForCurrentOperation); 185 183 } 186 184 … … 188 186 { 189 187 ASSERT(m_synchronousType == AsynchronousFileSystem || !m_bridgeForCurrentOperation); 190 (void)m_synchronousType;191 188 192 189 m_modeForCurrentOperation = fileSystemOperationsMode; -
trunk/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp
r145452 r145771 34 34 #if ENABLE(FILE_SYSTEM) && ENABLE(WORKERS) 35 35 36 #include "BlobData.h" 36 37 #include "CrossThreadTask.h" 37 38 #include "KURL.h" 38 39 #include "WebCommonWorkerClient.h" 40 #include "WebFileSystemCallbacksImpl.h" 39 41 #include "WebWorkerBase.h" 40 42 #include "WorkerContext.h" … … 43 45 #include "WorkerThread.h" 44 46 #include <public/WebFileInfo.h> 45 #include <public/WebFileSystemCallbacks.h>46 47 #include <public/WebFileSystemEntry.h> 47 48 #include <public/WebString.h> … … 125 126 } 126 127 128 virtual void didCreateSnapshotFile(const WebFileInfo& info) 129 { 130 // It's important to create a BlobDataHandle that refers to the platform file path prior 131 // to return from this method so the underlying file will not be deleted. 132 OwnPtr<BlobData> blobData = BlobData::create(); 133 blobData->appendFile(info.platformPath); 134 RefPtr<BlobDataHandle> snapshotBlob = BlobDataHandle::create(blobData.release(), info.length); 135 m_bridge->didCreateSnapshotFileOnMainThread(info, m_mode, snapshotBlob); 136 delete this; 137 } 138 127 139 virtual void didReadDirectory(const WebVector<WebFileSystemEntry>& entries, bool hasMore) 128 140 { … … 290 302 } 291 303 292 void WorkerFileSystemCallbacksBridge::postCreateSnapshotFileToMainThread(WebFileSystem* fileSystem, const KURL& internalBlobURL, const KURL&path, const String& mode)304 void WorkerFileSystemCallbacksBridge::postCreateSnapshotFileToMainThread(WebFileSystem* fileSystem, const KURL& path, const String& mode) 293 305 { 294 306 ASSERT(fileSystem); … … 296 308 createCallbackTask(&createSnapshotFileOnMainThread, 297 309 AllowCrossThreadAccess(fileSystem), 298 internalBlobURL,path, this, mode));310 path, this, mode)); 299 311 } 300 312 … … 358 370 } 359 371 360 void WorkerFileSystemCallbacksBridge::createSnapshotFileOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem* fileSystem, const KURL& internalBlobURL, const KURL&path, PassRefPtr<WorkerFileSystemCallbacksBridge> bridge, const String& mode)361 { 362 fileSystem->createSnapshotFileAndReadMetadata( internalBlobURL,path, MainThreadFileSystemCallbacks::createLeakedPtr(bridge, mode));372 void WorkerFileSystemCallbacksBridge::createSnapshotFileOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem* fileSystem, const KURL& path, PassRefPtr<WorkerFileSystemCallbacksBridge> bridge, const String& mode) 373 { 374 fileSystem->createSnapshotFileAndReadMetadata(path, MainThreadFileSystemCallbacks::createLeakedPtr(bridge, mode)); 363 375 } 364 376 … … 382 394 { 383 395 mayPostTaskToWorker(createCallbackTask(&didReadMetadataOnWorkerThread, this, info), mode); 396 } 397 398 void WorkerFileSystemCallbacksBridge::didCreateSnapshotFileOnMainThread(const WebFileInfo& info, const String& mode, PassRefPtr<BlobDataHandle> snapshotBlob) 399 { 400 mayPostTaskToWorker(createCallbackTask(&didCreateSnapshotFileOnWorkerThread, this, info, snapshotBlob), mode); 384 401 } 385 402 … … 391 408 } 392 409 393 WorkerFileSystemCallbacksBridge::WorkerFileSystemCallbacksBridge(WebCore::WorkerLoaderProxy* workerLoaderProxy, ScriptExecutionContext* scriptExecutionContext, WebFileSystemCallbacks * callbacks)410 WorkerFileSystemCallbacksBridge::WorkerFileSystemCallbacksBridge(WebCore::WorkerLoaderProxy* workerLoaderProxy, ScriptExecutionContext* scriptExecutionContext, WebFileSystemCallbacksImpl* callbacks) 394 411 : m_workerLoaderProxy(workerLoaderProxy) 395 412 , m_workerContext(scriptExecutionContext) … … 425 442 } 426 443 444 void WorkerFileSystemCallbacksBridge::didCreateSnapshotFileOnWorkerThread(ScriptExecutionContext*, PassRefPtr<WorkerFileSystemCallbacksBridge> bridge, const WebFileInfo& info, PassRefPtr<BlobDataHandle> snapshotBlob) 445 { 446 bridge->m_callbacksOnWorkerThread->didCreateSnapshotFile(info, snapshotBlob); 447 } 448 427 449 void WorkerFileSystemCallbacksBridge::didReadDirectoryOnWorkerThread(ScriptExecutionContext*, PassRefPtr<WorkerFileSystemCallbacksBridge> bridge, const WebVector<WebFileSystemEntry>& entries, bool hasMore) 428 450 { -
trunk/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h
r145452 r145771 44 44 45 45 namespace WebCore { 46 class BlobDataHandle; 46 47 class WorkerLoaderProxy; 47 48 } … … 53 54 class WebCommonWorkerClient; 54 55 class ThreadableCallbacksBridgeWrapper; 55 class WebFileSystemCallbacks ;56 class WebFileSystemCallbacksImpl; 56 57 class WorkerFileSystemContextObserver; 57 58 struct WebFileInfo; … … 78 79 void stop(); 79 80 80 static PassRefPtr<WorkerFileSystemCallbacksBridge> create(WebCore::WorkerLoaderProxy* workerLoaderProxy, WebCore::ScriptExecutionContext* workerContext, WebFileSystemCallbacks * callbacks)81 static PassRefPtr<WorkerFileSystemCallbacksBridge> create(WebCore::WorkerLoaderProxy* workerLoaderProxy, WebCore::ScriptExecutionContext* workerContext, WebFileSystemCallbacksImpl* callbacks) 81 82 { 82 83 return adoptRef(new WorkerFileSystemCallbacksBridge(workerLoaderProxy, workerContext, callbacks)); … … 95 96 void postDirectoryExistsToMainThread(WebFileSystem*, const WebCore::KURL& path, const String& mode); 96 97 void postReadDirectoryToMainThread(WebFileSystem*, const WebCore::KURL& path, const String& mode); 97 void postCreateSnapshotFileToMainThread(WebFileSystem*, const WebCore::KURL& internalBlobURL, const WebCore::KURL&path, const String& mode);98 void postCreateSnapshotFileToMainThread(WebFileSystem*, const WebCore::KURL& path, const String& mode); 98 99 99 100 // Callback methods that are called on the main thread. … … 102 103 void didSucceedOnMainThread(const String& mode); 103 104 void didReadMetadataOnMainThread(const WebFileInfo&, const String& mode); 105 void didCreateSnapshotFileOnMainThread(const WebFileInfo&, const String& mode, PassRefPtr<WebCore::BlobDataHandle> snapshotBlob); 104 106 void didReadDirectoryOnMainThread(const WebVector<WebFileSystemEntry>&, bool hasMore, const String& mode); 105 107 106 108 private: 107 WorkerFileSystemCallbacksBridge(WebCore::WorkerLoaderProxy*, WebCore::ScriptExecutionContext*, WebFileSystemCallbacks *);109 WorkerFileSystemCallbacksBridge(WebCore::WorkerLoaderProxy*, WebCore::ScriptExecutionContext*, WebFileSystemCallbacksImpl*); 108 110 109 111 // Methods that are to be called on the main thread. … … 119 121 static void directoryExistsOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const WebCore::KURL& path, PassRefPtr<WorkerFileSystemCallbacksBridge>, const String& mode); 120 122 static void readDirectoryOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const WebCore::KURL& path, PassRefPtr<WorkerFileSystemCallbacksBridge>, const String& mode); 121 static void createSnapshotFileOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const WebCore::KURL& internalBlobURL, const WebCore::KURL&path, PassRefPtr<WorkerFileSystemCallbacksBridge>, const String& mode);123 static void createSnapshotFileOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const WebCore::KURL& path, PassRefPtr<WorkerFileSystemCallbacksBridge>, const String& mode); 122 124 123 125 friend class MainThreadFileSystemCallbacks; … … 128 130 static void didSucceedOnWorkerThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileSystemCallbacksBridge>); 129 131 static void didReadMetadataOnWorkerThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileSystemCallbacksBridge>, const WebFileInfo&); 132 static void didCreateSnapshotFileOnWorkerThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileSystemCallbacksBridge>, const WebFileInfo&, PassRefPtr<WebCore::BlobDataHandle> snapshotBlob); 130 133 static void didReadDirectoryOnWorkerThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileSystemCallbacksBridge>, const WebVector<WebFileSystemEntry>&, bool hasMore); 131 134 … … 147 150 148 151 // This is self-destructed and must be fired on the worker thread. 149 WebFileSystemCallbacks * m_callbacksOnWorkerThread;152 WebFileSystemCallbacksImpl* m_callbacksOnWorkerThread; 150 153 }; 151 154
Note: See TracChangeset
for help on using the changeset viewer.