WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
impl of new api
impl2.txt (text/plain), 31.44 KB, created by
Michael Nordman
on 2013-02-04 14:58:51 PST
(
hide
)
Description:
impl of new api
Filename:
MIME Type:
Creator:
Michael Nordman
Created:
2013-02-04 14:58:51 PST
Size:
31.44 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 141795) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,34 @@ >+2013-02-04 Michael Nordman <michaeln@google.com> >+ >+ FileSystem mods: Changes to snapshot file creation to reduce dependencies on blob URLs. >+ Adding a new minimal BlobDataHandle class which will be reimplemented/built upon in later CLs. In this >+ patch, it's just enough to refactor the FileSystem code to not function in terms of blobURLs. >+ https://bugs.webkit.org/show_bug.cgi?id=108851 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No new tests (OOPS!). >+ >+ * Modules/filesystem/DOMFileSystem.cpp: >+ (WebCore): >+ (WebCore::DOMFileSystem::createFile): >+ * Modules/filesystem/DOMFileSystemSync.cpp: >+ (WebCore): >+ * platform/AsyncFileSystemCallbacks.h: >+ (AsyncFileSystemCallbacks): >+ (WebCore::AsyncFileSystemCallbacks::didCreateSnapshotFile): >+ * platform/gtk/AsyncFileSystemGtk.cpp: >+ (WebCore::AsyncFileSystemGtk::createSnapshotFileAndReadMetadata): >+ (WebCore): >+ * platform/network/BlobData.cpp: >+ (WebCore): >+ (WebCore::BlobDataHandle::BlobDataHandle): >+ (WebCore::BlobDataHandle::~BlobDataHandle): >+ * platform/network/BlobData.h: >+ (WebCore): >+ (BlobDataHandle): >+ (WebCore::BlobDataHandle::create): >+ > 2013-02-04 Dima Gorbik <dgorbik@apple.com> > > Implemet :lang() pseudo class support for the WebVTT ::cue pseudo element >Index: Source/WebCore/Modules/filesystem/DOMFileSystem.cpp >=================================================================== >--- Source/WebCore/Modules/filesystem/DOMFileSystem.cpp (revision 141791) >+++ Source/WebCore/Modules/filesystem/DOMFileSystem.cpp (working copy) >@@ -148,19 +148,24 @@ void DOMFileSystem::createWriter(const F > > namespace { > >-class GetMetadataCallback : public FileSystemCallbacksBase { >+class SnapshotFileCallback : public FileSystemCallbacksBase { > public: >- static PassOwnPtr<GetMetadataCallback> create(PassRefPtr<DOMFileSystem> filesystem, const String& name, const KURL& url, PassRefPtr<FileCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) >+ static PassOwnPtr<SnapshotFileCallback> create(PassRefPtr<DOMFileSystem> filesystem, const String& name, const KURL& url, PassRefPtr<FileCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) > { >- return adoptPtr(new GetMetadataCallback(filesystem, name, url, successCallback, errorCallback)); >+ return adoptPtr(new SnapshotFileCallback(filesystem, name, url, successCallback, errorCallback)); > } > >- virtual void didReadMetadata(const FileMetadata& metadata) >+ virtual void didCreateSnapshotFile(const FileMetadata& metadata, PassRefPtr<BlobDataHandle> snapshot) > { > ASSERT(!metadata.platformPath.isEmpty()); > if (!m_successCallback) > return; > >+ // We can't directly use the snapshot blob data handle because the content type on it hasn't been set. >+ // The |snapshot| param is here to provide a a chain of custody thru thread bridging that is held onto until >+ // *after* we've coined a File with a new handle that has the correct type set on it. This allows the >+ // blob storage system to track when a temp file can and can't be safely deleted. >+ > // For regular filesystem types (temporary or persistent), we should not cache file metadata as it could change File semantics. > // 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). > // FIXME: We should use the snapshot metadata for all files. >@@ -179,7 +184,7 @@ public: > } > > private: >- GetMetadataCallback(PassRefPtr<DOMFileSystem> filesystem, const String& name, const KURL& url, PassRefPtr<FileCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) >+ SnapshotFileCallback(PassRefPtr<DOMFileSystem> filesystem, const String& name, const KURL& url, PassRefPtr<FileCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) > : FileSystemCallbacksBase(errorCallback) > , m_filesystem(filesystem) > , m_name(name) >@@ -199,7 +204,7 @@ private: > void DOMFileSystem::createFile(const FileEntry* fileEntry, PassRefPtr<FileCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) > { > KURL fileSystemURL = createFileSystemURL(fileEntry); >- m_asyncFileSystem->createSnapshotFileAndReadMetadata(fileSystemURL, GetMetadataCallback::create(this, fileEntry->name(), fileSystemURL, successCallback, errorCallback)); >+ m_asyncFileSystem->createSnapshotFileAndReadMetadata(fileSystemURL, SnapshotFileCallback::create(this, fileEntry->name(), fileSystemURL, successCallback, errorCallback)); > } > > } // namespace WebCore >Index: Source/WebCore/Modules/filesystem/DOMFileSystemSync.cpp >=================================================================== >--- Source/WebCore/Modules/filesystem/DOMFileSystemSync.cpp (revision 141791) >+++ Source/WebCore/Modules/filesystem/DOMFileSystemSync.cpp (working copy) >@@ -113,10 +113,16 @@ public: > { > } > >- void didReadMetadata(const FileMetadata& metadata) >+ virtual void didCreateSnapshotFile(const FileMetadata& metadata, PassRefPtr<BlobDataHandle> snapshot) > { >+ // We can't directly use the snapshot blob data handle because the content type on it hasn't been set. >+ // The |snapshot| param is here to provide a a chain of custody thru thread bridging that is held onto until >+ // *after* we've coined a File with a new handle that has the correct type set on it. This allows the >+ // blob storage system to track when a temp file can and can't be safely deleted. >+ > // For regular filesystem types (temporary or persistent), we should not cache file metadata as it could change File semantics. >- // 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). >+ // 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). > // FIXME: We should use the snapshot metadata for all files. > // https://www.w3.org/Bugs/Public/show_bug.cgi?id=17746 > if (m_type == FileSystemTypeTemporary || m_type == FileSystemTypePersistent) { >Index: Source/WebCore/platform/AsyncFileSystemCallbacks.h >=================================================================== >--- Source/WebCore/platform/AsyncFileSystemCallbacks.h (revision 141791) >+++ Source/WebCore/platform/AsyncFileSystemCallbacks.h (working copy) >@@ -35,6 +35,7 @@ > > #include "AsyncFileSystem.h" > #include "AsyncFileWriter.h" >+#include "BlobData.h" > #include "FileMetadata.h" > #include <wtf/text/WTFString.h> > >@@ -54,6 +55,9 @@ public: > // Called when a file metadata is read successfully. > virtual void didReadMetadata(const FileMetadata&) { ASSERT_NOT_REACHED(); } > >+ // Called when a snapshot file is created successfully. >+ virtual void didCreateSnapshotFile(const FileMetadata&, PassRefPtr<BlobDataHandle> snapshot) { ASSERT_NOT_REACHED(); } >+ > // Called when a directory entry is read. > virtual void didReadDirectoryEntry(const String& name, bool isDirectory) { ASSERT_NOT_REACHED(); } > >Index: Source/WebCore/platform/gtk/AsyncFileSystemGtk.cpp >=================================================================== >--- Source/WebCore/platform/gtk/AsyncFileSystemGtk.cpp (revision 141791) >+++ Source/WebCore/platform/gtk/AsyncFileSystemGtk.cpp (working copy) >@@ -118,6 +118,11 @@ void AsyncFileSystemGtk::createWriter(As > notImplemented(); > } > >+void AsyncFileSystemGtk::createSnapshotFileAndReadMetadata(const KURL&, PassOwnPtr<AsyncFileSystemCallbacks>) >+{ >+ notImplemented(); >+} >+ > } // namespace WebCore > > #endif >Index: Source/WebCore/platform/network/BlobData.cpp >=================================================================== >--- Source/WebCore/platform/network/BlobData.cpp (revision 141791) >+++ Source/WebCore/platform/network/BlobData.cpp (working copy) >@@ -30,6 +30,8 @@ > > #include "config.h" > #include "BlobData.h" >+#include "BlobURL.h" >+#include "ThreadableBlobRegistry.h" > > #include <wtf/OwnPtr.h> > #include <wtf/PassOwnPtr.h> >@@ -101,4 +103,17 @@ void BlobData::swapItems(BlobDataItemLis > m_items.swap(items); > } > >+ >+BlobDataHandle::BlobDataHandle(PassOwnPtr<BlobData> data, long long size) >+{ >+ UNUSED_PARAM(size); >+ m_internalURL = BlobURL::createInternalURL(); >+ ThreadableBlobRegistry::registerBlobURL(m_internalURL, data); >+} >+ >+BlobDataHandle::~BlobDataHandle() >+{ >+ ThreadableBlobRegistry::unregisterBlobURL(m_internalURL); >+} >+ > } // namespace WebCore >Index: Source/WebCore/platform/network/BlobData.h >=================================================================== >--- Source/WebCore/platform/network/BlobData.h (revision 141791) >+++ Source/WebCore/platform/network/BlobData.h (working copy) >@@ -202,6 +202,22 @@ private: > BlobDataItemList m_items; > }; > >+// FIXME: This class is mostly place holder until I get farther along in landing >+// https://codereview.chromium.org/11192017/. >+class BlobDataHandle : public ThreadSafeRefCounted<BlobDataHandle> { >+public: >+ static PassRefPtr<BlobDataHandle> create(PassOwnPtr<BlobData> data, long long size) >+ { >+ return adoptRef(new BlobDataHandle(data, size)); >+ } >+ >+ ~BlobDataHandle(); >+ >+private: >+ BlobDataHandle(PassOwnPtr<BlobData>, long long size); >+ KURL m_internalURL; >+}; >+ > } // namespace WebCore > > #endif // BlobData_h >Index: Source/WebKit/chromium/ChangeLog >=================================================================== >--- Source/WebKit/chromium/ChangeLog (revision 141795) >+++ Source/WebKit/chromium/ChangeLog (working copy) >@@ -1,3 +1,44 @@ >+2013-02-04 Michael Nordman <michaeln@google.com> >+ >+ [Chromium] FileSystem mods: Changes to snapshot file creation to reduce dependencies on blobs. >+ No longer send a |blobURL| to the browser process, no longer expect the browser process >+ to have registered a blob with that url. >+ https://bugs.webkit.org/show_bug.cgi?id=108851 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * src/AsyncFileSystemChromium.cpp: >+ (WebCore): >+ (WebCore::FileWriterHelperCallbacks::didCreateSnapshotFile): >+ (WebCore::AsyncFileSystemChromium::createSnapshotFileAndReadMetadata): >+ * src/AsyncFileSystemChromium.h: >+ (AsyncFileSystemChromium): >+ * src/LocalFileSystemChromium.cpp: >+ (WebCore): >+ * src/WebFileSystemCallbacksImpl.cpp: >+ (WebKit::WebFileSystemCallbacksImpl::didCreateSnapshotFile): >+ (WebKit): >+ * src/WebFileSystemCallbacksImpl.h: >+ (WebCore): >+ (WebFileSystemCallbacksImpl): >+ * src/WorkerAsyncFileSystemChromium.cpp: >+ (WebCore::WorkerAsyncFileSystemChromium::createSnapshotFileAndReadMetadata): >+ (WebCore::WorkerAsyncFileSystemChromium::createWorkerFileSystemCallbacksBridge): >+ * src/WorkerFileSystemCallbacksBridge.cpp: >+ (WebKit::MainThreadFileSystemCallbacks::didCreateSnapshotFile): >+ (MainThreadFileSystemCallbacks): >+ (WebKit::WorkerFileSystemCallbacksBridge::postCreateSnapshotFileToMainThread): >+ (WebKit::WorkerFileSystemCallbacksBridge::createSnapshotFileOnMainThread): >+ (WebKit::WorkerFileSystemCallbacksBridge::didCreateSnapshotFileOnMainThread): >+ (WebKit): >+ (WebKit::WorkerFileSystemCallbacksBridge::WorkerFileSystemCallbacksBridge): >+ (WebKit::WorkerFileSystemCallbacksBridge::didCreateSnapshotFileOnWorkerThread): >+ * src/WorkerFileSystemCallbacksBridge.h: >+ (WebCore): >+ (WebKit): >+ (WebKit::WorkerFileSystemCallbacksBridge::create): >+ (WorkerFileSystemCallbacksBridge): >+ > 2013-02-04 Mark Pilgrim <pilgrim@chromium.org> > > [Chromium] Move IDBFactoryBackendInterface to WebCore >Index: Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp >=================================================================== >--- Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp (revision 141791) >+++ Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp (working copy) >@@ -48,46 +48,6 @@ > > namespace WebCore { > >-namespace { >- >-// Specialized callback class for createSnapshotFileAndReadMetadata. >-class SnapshotFileCallbacks : public AsyncFileSystemCallbacks { >-public: >- static PassOwnPtr<SnapshotFileCallbacks> create(const KURL& internalBlobURL, PassOwnPtr<WebCore::AsyncFileSystemCallbacks> callbacks) >- { >- return adoptPtr(new SnapshotFileCallbacks(internalBlobURL, callbacks)); >- } >- >- virtual void didReadMetadata(const FileMetadata& metadata) >- { >- ASSERT(m_callbacks); >- >- // This will create a new File object using the metadata. >- m_callbacks->didReadMetadata(metadata); >- >- // Now that we've registered the snapshot file, we can unregister our internalBlobURL which has played a placeholder for the file during the IPC. >- ThreadableBlobRegistry::unregisterBlobURL(m_internalBlobURL); >- } >- >- virtual void didFail(int error) >- { >- ASSERT(m_callbacks); >- m_callbacks->didFail(error); >- } >- >-private: >- SnapshotFileCallbacks(const KURL& internalBlobURL, PassOwnPtr<WebCore::AsyncFileSystemCallbacks> callbacks) >- : m_internalBlobURL(internalBlobURL) >- , m_callbacks(callbacks) >- { >- } >- >- KURL m_internalBlobURL; >- OwnPtr<WebCore::AsyncFileSystemCallbacks> m_callbacks; >-}; >- >-} // namespace >- > bool AsyncFileSystem::isAvailable() > { > return true; >@@ -186,7 +146,11 @@ public: > } > delete this; > } >- >+ virtual void didCreateSnapshotFile(const WebKit::WebFileInfo& info) >+ { >+ ASSERT_NOT_REACHED(); >+ delete this; >+ } > virtual void didReadDirectory(const WebKit::WebVector<WebKit::WebFileSystemEntry>& entries, bool hasMore) > { > ASSERT_NOT_REACHED(); >@@ -219,15 +183,7 @@ void AsyncFileSystemChromium::createWrit > > void AsyncFileSystemChromium::createSnapshotFileAndReadMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) > { >- KURL internalBlobURL = BlobURL::createInternalURL(); >- >- // This will create a snapshot file and register the file to a blob using the given internalBlobURL. >- m_webFileSystem->createSnapshotFileAndReadMetadata(internalBlobURL, path, new WebKit::WebFileSystemCallbacksImpl(createSnapshotFileCallback(internalBlobURL, callbacks))); >-} >- >-PassOwnPtr<AsyncFileSystemCallbacks> AsyncFileSystemChromium::createSnapshotFileCallback(const KURL& internalBlobURL, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) const >-{ >- return SnapshotFileCallbacks::create(internalBlobURL, callbacks); >+ m_webFileSystem->createSnapshotFileAndReadMetadata(path, new WebKit::WebFileSystemCallbacksImpl(callbacks)); > } > > } // namespace WebCore >Index: Source/WebKit/chromium/src/AsyncFileSystemChromium.h >=================================================================== >--- Source/WebKit/chromium/src/AsyncFileSystemChromium.h (revision 141791) >+++ Source/WebKit/chromium/src/AsyncFileSystemChromium.h (working copy) >@@ -69,8 +69,6 @@ public: > protected: > AsyncFileSystemChromium(); > >- PassOwnPtr<AsyncFileSystemCallbacks> createSnapshotFileCallback(const KURL& internalBlobURL, PassOwnPtr<AsyncFileSystemCallbacks>) const; >- > WebKit::WebFileSystem* m_webFileSystem; > }; > >Index: Source/WebKit/chromium/src/LocalFileSystemChromium.cpp >=================================================================== >--- Source/WebKit/chromium/src/LocalFileSystemChromium.cpp (revision 141791) >+++ Source/WebKit/chromium/src/LocalFileSystemChromium.cpp (working copy) >@@ -153,7 +153,7 @@ bool allowFileSystemForWorker(WebCommonW > return bridge->result(); > } > >-void openFileSystemForWorker(WebCommonWorkerClient* commonClient, WebFileSystem::Type type, long long size, bool create, WebFileSystemCallbacks* callbacks, FileSystemSynchronousType synchronousType) >+void openFileSystemForWorker(WebCommonWorkerClient* commonClient, WebFileSystem::Type type, long long size, bool create, WebFileSystemCallbacksImpl* callbacks, FileSystemSynchronousType synchronousType) > { > WorkerScriptController* controller = WorkerScriptController::controllerForContext(); > WorkerContext* workerContext = controller->workerContext(); >Index: Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp >=================================================================== >--- Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp (revision 141791) >+++ Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp (working copy) >@@ -76,6 +76,27 @@ void WebFileSystemCallbacksImpl::didRead > delete this; > } > >+void WebFileSystemCallbacksImpl::didCreateSnapshotFile(const WebFileInfo& webFileInfo) >+{ >+ // It's important to create a BlobDataHandle that refers to the platform file path prior >+ // to return from this method so the underlying file will not be deleted. >+ OwnPtr<BlobData> blobData = BlobData::create(); >+ blobData->appendFile(webFileInfo.platformPath); >+ RefPtr<BlobDataHandle> snapshotBlob = BlobDataHandle::create(blobData.release(), webFileInfo.length); >+ didCreateSnapshotFile(webFileInfo, snapshotBlob); >+} >+ >+void WebFileSystemCallbacksImpl::didCreateSnapshotFile(const WebFileInfo& webFileInfo, PassRefPtr<WebCore::BlobDataHandle> snapshot) >+{ >+ FileMetadata fileMetadata; >+ fileMetadata.modificationTime = webFileInfo.modificationTime; >+ fileMetadata.length = webFileInfo.length; >+ fileMetadata.type = static_cast<FileMetadata::Type>(webFileInfo.type); >+ fileMetadata.platformPath = webFileInfo.platformPath; >+ m_callbacks->didCreateSnapshotFile(fileMetadata, snapshot); >+ delete this; >+} >+ > void WebFileSystemCallbacksImpl::didReadDirectory(const WebVector<WebFileSystemEntry>& entries, bool hasMore) > { > for (size_t i = 0; i < entries.size(); ++i) >Index: Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.h >=================================================================== >--- Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.h (revision 141791) >+++ Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.h (working copy) >@@ -40,6 +40,7 @@ > > namespace WebCore { > class AsyncFileSystemCallbacks; >+class BlobDataHandle; > class ScriptExecutionContext; > } > >@@ -56,11 +57,17 @@ public: > virtual ~WebFileSystemCallbacksImpl(); > > virtual void didSucceed(); >- virtual void didReadMetadata(const WebFileInfo& info); >+ virtual void didReadMetadata(const WebFileInfo&); >+ virtual void didCreateSnapshotFile(const WebFileInfo&); > virtual void didReadDirectory(const WebVector<WebFileSystemEntry>& entries, bool hasMore); > virtual void didOpenFileSystem(const WebString& name, const WebURL& rootURL); > virtual void didFail(WebFileError error); > >+ // This internal overload is used by WorkerFileSystemCallbacksBridge to deliver a blob data handle >+ // created on the main thread to an AsyncFileSystemCallback on a background worker thread. The other >+ // virtual method is invoked by the embedder. >+ void didCreateSnapshotFile(const WebFileInfo&, PassRefPtr<WebCore::BlobDataHandle> snapshot); >+ > private: > OwnPtr<WebCore::AsyncFileSystemCallbacks> m_callbacks; > >Index: Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.cpp >=================================================================== >--- Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.cpp (revision 141791) >+++ Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.cpp (working copy) >@@ -179,15 +179,12 @@ void WorkerAsyncFileSystemChromium::crea > > void WorkerAsyncFileSystemChromium::createSnapshotFileAndReadMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) > { >- KURL internalBlobURL = BlobURL::createInternalURL(); >- >- createWorkerFileSystemCallbacksBridge(createSnapshotFileCallback(internalBlobURL, callbacks))->postCreateSnapshotFileToMainThread(m_webFileSystem, internalBlobURL, path, m_modeForCurrentOperation); >+ createWorkerFileSystemCallbacksBridge(callbacks)->postCreateSnapshotFileToMainThread(m_webFileSystem, path, m_modeForCurrentOperation); > } > > PassRefPtr<WorkerFileSystemCallbacksBridge> WorkerAsyncFileSystemChromium::createWorkerFileSystemCallbacksBridge(PassOwnPtr<AsyncFileSystemCallbacks> callbacks) > { > ASSERT(m_synchronousType == AsynchronousFileSystem || !m_bridgeForCurrentOperation); >- (void)m_synchronousType; > > m_modeForCurrentOperation = fileSystemOperationsMode; > m_modeForCurrentOperation.append(String::number(m_workerContext->thread()->runLoop().createUniqueId())); >Index: Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp >=================================================================== >--- Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp (revision 141791) >+++ Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp (working copy) >@@ -33,10 +33,11 @@ > > #if ENABLE(FILE_SYSTEM) && ENABLE(WORKERS) > >+#include "BlobData.h" > #include "CrossThreadTask.h" > #include "KURL.h" > #include "WebCommonWorkerClient.h" >-#include "WebFileSystemCallbacks.h" >+#include "WebFileSystemCallbacksImpl.h" > #include "WebFileSystemEntry.h" > #include "WebWorkerBase.h" > #include "WorkerContext.h" >@@ -124,6 +125,17 @@ public: > delete this; > } > >+ virtual void didCreateSnapshotFile(const WebFileInfo& info) >+ { >+ // It's important to create a BlobDataHandle that refers to the platform file path prior >+ // to return from this method so the underlying file will not be deleted. >+ OwnPtr<BlobData> blobData = BlobData::create(); >+ blobData->appendFile(info.platformPath); >+ RefPtr<BlobDataHandle> snapshotBlob = BlobDataHandle::create(blobData.release(), info.length); >+ m_bridge->didCreateSnapshotFileOnMainThread(info, m_mode, snapshotBlob); >+ delete this; >+ } >+ > virtual void didReadDirectory(const WebVector<WebFileSystemEntry>& entries, bool hasMore) > { > m_bridge->didReadDirectoryOnMainThread(entries, hasMore, m_mode); >@@ -289,13 +301,13 @@ void WorkerFileSystemCallbacksBridge::po > this, mode)); > } > >-void WorkerFileSystemCallbacksBridge::postCreateSnapshotFileToMainThread(WebFileSystem* fileSystem, const KURL& internalBlobURL, const KURL& path, const String& mode) >+void WorkerFileSystemCallbacksBridge::postCreateSnapshotFileToMainThread(WebFileSystem* fileSystem, const KURL& path, const String& mode) > { > ASSERT(fileSystem); > dispatchTaskToMainThread( > createCallbackTask(&createSnapshotFileOnMainThread, > AllowCrossThreadAccess(fileSystem), >- internalBlobURL, path, this, mode)); >+ path, this, mode)); > } > > void WorkerFileSystemCallbacksBridge::openFileSystemOnMainThread(ScriptExecutionContext*, WebCommonWorkerClient* commonClient, WebFileSystem::Type type, long long size, bool create, PassRefPtr<WorkerFileSystemCallbacksBridge> bridge, const String& mode) >@@ -357,9 +369,9 @@ void WorkerFileSystemCallbacksBridge::re > fileSystem->readDirectory(path, MainThreadFileSystemCallbacks::createLeakedPtr(bridge, mode)); > } > >-void WorkerFileSystemCallbacksBridge::createSnapshotFileOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem* fileSystem, const KURL& internalBlobURL, const KURL& path, PassRefPtr<WorkerFileSystemCallbacksBridge> bridge, const String& mode) >+void WorkerFileSystemCallbacksBridge::createSnapshotFileOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem* fileSystem, const KURL& path, PassRefPtr<WorkerFileSystemCallbacksBridge> bridge, const String& mode) > { >- fileSystem->createSnapshotFileAndReadMetadata(internalBlobURL, path, MainThreadFileSystemCallbacks::createLeakedPtr(bridge, mode)); >+ fileSystem->createSnapshotFileAndReadMetadata(path, MainThreadFileSystemCallbacks::createLeakedPtr(bridge, mode)); > } > > void WorkerFileSystemCallbacksBridge::didFailOnMainThread(WebFileError error, const String& mode) >@@ -383,6 +395,11 @@ void WorkerFileSystemCallbacksBridge::di > mayPostTaskToWorker(createCallbackTask(&didReadMetadataOnWorkerThread, this, info), mode); > } > >+void WorkerFileSystemCallbacksBridge::didCreateSnapshotFileOnMainThread(const WebFileInfo& info, const String& mode, PassRefPtr<BlobDataHandle> snapshotBlob) >+{ >+ mayPostTaskToWorker(createCallbackTask(&didCreateSnapshotFileOnWorkerThread, this, info, snapshotBlob), mode); >+} >+ > void WorkerFileSystemCallbacksBridge::didReadDirectoryOnMainThread(const WebVector<WebFileSystemEntry>& entries, bool hasMore, const String& mode) > { > mayPostTaskToWorker( >@@ -390,7 +407,7 @@ void WorkerFileSystemCallbacksBridge::di > this, entries, hasMore), mode); > } > >-WorkerFileSystemCallbacksBridge::WorkerFileSystemCallbacksBridge(WebCore::WorkerLoaderProxy* workerLoaderProxy, ScriptExecutionContext* scriptExecutionContext, WebFileSystemCallbacks* callbacks) >+WorkerFileSystemCallbacksBridge::WorkerFileSystemCallbacksBridge(WebCore::WorkerLoaderProxy* workerLoaderProxy, ScriptExecutionContext* scriptExecutionContext, WebFileSystemCallbacksImpl* callbacks) > : m_workerLoaderProxy(workerLoaderProxy) > , m_workerContext(scriptExecutionContext) > , m_workerContextObserver(WorkerFileSystemContextObserver::create(static_cast<WorkerContext*>(m_workerContext), this).leakPtr()) >@@ -424,6 +441,11 @@ void WorkerFileSystemCallbacksBridge::di > bridge->m_callbacksOnWorkerThread->didReadMetadata(info); > } > >+void WorkerFileSystemCallbacksBridge::didCreateSnapshotFileOnWorkerThread(ScriptExecutionContext*, PassRefPtr<WorkerFileSystemCallbacksBridge> bridge, const WebFileInfo& info, PassRefPtr<BlobDataHandle> snapshotBlob) >+{ >+ bridge->m_callbacksOnWorkerThread->didCreateSnapshotFile(info, snapshotBlob); >+} >+ > void WorkerFileSystemCallbacksBridge::didReadDirectoryOnWorkerThread(ScriptExecutionContext*, PassRefPtr<WorkerFileSystemCallbacksBridge> bridge, const WebVector<WebFileSystemEntry>& entries, bool hasMore) > { > bridge->m_callbacksOnWorkerThread->didReadDirectory(entries, hasMore); >Index: Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h >=================================================================== >--- Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h (revision 141791) >+++ Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h (working copy) >@@ -43,6 +43,7 @@ > #include <wtf/text/WTFString.h> > > namespace WebCore { >+class BlobDataHandle; > class WorkerLoaderProxy; > } > >@@ -52,7 +53,7 @@ class AsyncFileSystem; > class MainThreadFileSystemCallbacks; > class WebCommonWorkerClient; > class ThreadableCallbacksBridgeWrapper; >-class WebFileSystemCallbacks; >+class WebFileSystemCallbacksImpl; > class WorkerFileSystemContextObserver; > struct WebFileInfo; > struct WebFileSystemEntry; >@@ -77,7 +78,7 @@ public: > > void stop(); > >- static PassRefPtr<WorkerFileSystemCallbacksBridge> create(WebCore::WorkerLoaderProxy* workerLoaderProxy, WebCore::ScriptExecutionContext* workerContext, WebFileSystemCallbacks* callbacks) >+ static PassRefPtr<WorkerFileSystemCallbacksBridge> create(WebCore::WorkerLoaderProxy* workerLoaderProxy, WebCore::ScriptExecutionContext* workerContext, WebFileSystemCallbacksImpl* callbacks) > { > return adoptRef(new WorkerFileSystemCallbacksBridge(workerLoaderProxy, workerContext, callbacks)); > } >@@ -94,17 +95,18 @@ public: > void postFileExistsToMainThread(WebFileSystem*, const WebCore::KURL& path, const String& mode); > void postDirectoryExistsToMainThread(WebFileSystem*, const WebCore::KURL& path, const String& mode); > void postReadDirectoryToMainThread(WebFileSystem*, const WebCore::KURL& path, const String& mode); >- void postCreateSnapshotFileToMainThread(WebFileSystem*, const WebCore::KURL& internalBlobURL, const WebCore::KURL& path, const String& mode); >+ void postCreateSnapshotFileToMainThread(WebFileSystem*, const WebCore::KURL& path, const String& mode); > > // Callback methods that are called on the main thread. > void didFailOnMainThread(WebFileError, const String& mode); > void didOpenFileSystemOnMainThread(const String& name, const WebCore::KURL& rootURL, const String& mode); > void didSucceedOnMainThread(const String& mode); > void didReadMetadataOnMainThread(const WebFileInfo&, const String& mode); >+ void didCreateSnapshotFileOnMainThread(const WebFileInfo&, const String& mode, PassRefPtr<WebCore::BlobDataHandle> snapshotBlob); > void didReadDirectoryOnMainThread(const WebVector<WebFileSystemEntry>&, bool hasMore, const String& mode); > > private: >- WorkerFileSystemCallbacksBridge(WebCore::WorkerLoaderProxy*, WebCore::ScriptExecutionContext*, WebFileSystemCallbacks*); >+ WorkerFileSystemCallbacksBridge(WebCore::WorkerLoaderProxy*, WebCore::ScriptExecutionContext*, WebFileSystemCallbacksImpl*); > > // Methods that are to be called on the main thread. > static void openFileSystemOnMainThread(WebCore::ScriptExecutionContext*, WebCommonWorkerClient*, WebFileSystem::Type, long long size, bool create, PassRefPtr<WorkerFileSystemCallbacksBridge>, const String& mode); >@@ -118,7 +120,7 @@ private: > static void fileExistsOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const WebCore::KURL& path, PassRefPtr<WorkerFileSystemCallbacksBridge>, const String& mode); > static void directoryExistsOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const WebCore::KURL& path, PassRefPtr<WorkerFileSystemCallbacksBridge>, const String& mode); > static void readDirectoryOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const WebCore::KURL& path, PassRefPtr<WorkerFileSystemCallbacksBridge>, const String& mode); >- static void createSnapshotFileOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const WebCore::KURL& internalBlobURL, const WebCore::KURL& path, PassRefPtr<WorkerFileSystemCallbacksBridge>, const String& mode); >+ static void createSnapshotFileOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const WebCore::KURL& path, PassRefPtr<WorkerFileSystemCallbacksBridge>, const String& mode); > > friend class MainThreadFileSystemCallbacks; > >@@ -127,6 +129,7 @@ private: > static void didOpenFileSystemOnWorkerThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileSystemCallbacksBridge>, const String& name, const WebCore::KURL& rootPath); > static void didSucceedOnWorkerThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileSystemCallbacksBridge>); > static void didReadMetadataOnWorkerThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileSystemCallbacksBridge>, const WebFileInfo&); >+ static void didCreateSnapshotFileOnWorkerThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileSystemCallbacksBridge>, const WebFileInfo&, PassRefPtr<WebCore::BlobDataHandle> snapshotBlob); > static void didReadDirectoryOnWorkerThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileSystemCallbacksBridge>, const WebVector<WebFileSystemEntry>&, bool hasMore); > > static void runTaskOnMainThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileSystemCallbacksBridge>, PassOwnPtr<WebCore::ScriptExecutionContext::Task>); >@@ -146,7 +149,7 @@ private: > WorkerFileSystemContextObserver* m_workerContextObserver; > > // This is self-destructed and must be fired on the worker thread. >- WebFileSystemCallbacks* m_callbacksOnWorkerThread; >+ WebFileSystemCallbacksImpl* m_callbacksOnWorkerThread; > }; > > } // namespace WebCore
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
buildbot
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 108851
:
186463
|
186466
|
189344
|
192600
|
193004
|
193016