Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2108)

Unified Diff: Source/modules/filesystem/FileSystemCallbacks.cpp

Issue 23537011: FileAPI: Add WebFileSystem::resolveURL (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/modules/filesystem/FileSystemCallbacks.cpp
diff --git a/Source/modules/filesystem/FileSystemCallbacks.cpp b/Source/modules/filesystem/FileSystemCallbacks.cpp
index c2891784f1a0dc3e4e07967daea7bfc41505e657..a6dfafa4a121b807ae7658180324851a8d4d7f55 100644
--- a/Source/modules/filesystem/FileSystemCallbacks.cpp
+++ b/Source/modules/filesystem/FileSystemCallbacks.cpp
@@ -216,6 +216,24 @@ void ResolveURICallbacks::didOpenFileSystem(const String& name, const KURL& root
root->getDirectory(m_filePath, Dictionary(), m_successCallback, ErrorCallbackWrapper::create(m_successCallback, m_errorCallback, root, m_filePath));
}
+void ResolveURICallbacks::didResolveURL(const String& name, const KURL& rootURL, const String& filePath, bool isDirectory, PassOwnPtr<AsyncFileSystem> asyncFileSystem)
+{
+ ASSERT(asyncFileSystem);
+
+ RefPtr<DOMFileSystem> filesystem = DOMFileSystem::create(m_scriptExecutionContext.get(), name, m_type, rootURL, asyncFileSystem);
+ RefPtr<DirectoryEntry> root = filesystem->root();
+
+ String absolutePath;
+ if (!DOMFileSystemBase::pathToAbsolutePath(m_type, root.get(), filePath, absolutePath))
+ filesystem->scheduleCallback(m_errorCallback.release(), FileError::create(FileError::INVALID_MODIFICATION_ERR));
+
+ if (isDirectory)
+ m_successCallback->handleEvent(DirectoryEntry::create(filesystem, absolutePath).get());
+ else
+ m_successCallback->handleEvent(FileEntry::create(filesystem, absolutePath).get());
+ m_successCallback.clear();
+}
+
// MetadataCallbacks ----------------------------------------------------------
PassOwnPtr<MetadataCallbacks> MetadataCallbacks::create(PassRefPtr<MetadataCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)

Powered by Google App Engine
This is Rietveld 408576698