return false;
}
-PassRefPtrWillBeRawPtr<File> DOMFileSystemBase::createFile(const FileMetadata& metadata, const KURL& fileSystemURL, FileSystemType type, const String name)
+File* DOMFileSystemBase::createFile(const FileMetadata& metadata, const KURL& fileSystemURL, FileSystemType type, const String name)
{
// 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 (type == FileSystemTypeTemporary || type == FileSystemTypePersistent)
return File::createForFileSystemFile(metadata.platformPath, name);
+ const File::UserVisibility userVisibility = (type == FileSystemTypeExternal) ? File::IsUserVisible : File::IsNotUserVisible;
+
if (!metadata.platformPath.isEmpty()) {
- // If the platformPath in the returned metadata is given, we create a File object for the path.
- File::UserVisibility userVisibility = (type == FileSystemTypeExternal) ? File::IsUserVisible : File::IsNotUserVisible;
+ // If the platformPath in the returned metadata is given, we create a File object for the snapshot path.
return File::createForFileSystemFile(name, metadata, userVisibility);
+ } else {
+ // Otherwise we create a File object for the fileSystemURL.
+ return File::createForFileSystemFile(fileSystemURL, metadata, userVisibility);
}
-
- return File::createForFileSystemFile(fileSystemURL, metadata);
}
void DOMFileSystemBase::getMetadata(const EntryBase* entry, MetadataCallback* successCallback, ErrorCallback* errorCallback, SynchronousType synchronousType)
OwnPtr<AsyncFileSystemCallbacks> callbacks(EntryCallbacks::create(successCallback, errorCallback, m_context, this, absolutePath, false));
callbacks->setShouldBlockUntilCompletion(synchronousType == Synchronous);
- if (flags.create)
- fileSystem()->createFile(createFileSystemURL(absolutePath), flags.exclusive, callbacks.release());
+ if (flags.createFlag())
+ fileSystem()->createFile(createFileSystemURL(absolutePath), flags.exclusive(), callbacks.release());
else
fileSystem()->fileExists(createFileSystemURL(absolutePath), callbacks.release());
}
OwnPtr<AsyncFileSystemCallbacks> callbacks(EntryCallbacks::create(successCallback, errorCallback, m_context, this, absolutePath, true));
callbacks->setShouldBlockUntilCompletion(synchronousType == Synchronous);
- if (flags.create)
- fileSystem()->createDirectory(createFileSystemURL(absolutePath), flags.exclusive, callbacks.release());
+ if (flags.createFlag())
+ fileSystem()->createDirectory(createFileSystemURL(absolutePath), flags.exclusive(), callbacks.release());
else
fileSystem()->directoryExists(createFileSystemURL(absolutePath), callbacks.release());
}