[BlackBerry] Upstream the filesystem code

https://bugs.webkit.org/show_bug.cgi?id=114437

Patch by Alberto Garcia <agarcia@igalia.com> on 2013-04-12
Reviewed by Rob Buis.

These are the changes for AsyncFileSystemBlackBerry.

This patch contains contributions from many members of the
BlackBerry WebKit team.

* platform/blackberry/AsyncFileSystemBlackBerry.cpp:
(WebCore::AsyncFileSystem::isAvailable):
(WebCore):
(WebCore::AsyncFileSystem::create):
(WebCore::AsyncFileSystem::openFileSystem):
(WebCore::AsyncFileSystemBlackBerry::openFileSystem):
(WebCore::AsyncFileSystem::deleteFileSystem):
(WebCore::AsyncFileSystemBlackBerry::AsyncFileSystemBlackBerry):
(WebCore::AsyncFileSystemBlackBerry::~AsyncFileSystemBlackBerry):
(WebCore::AsyncFileSystemBlackBerry::move):
(WebCore::AsyncFileSystemBlackBerry::copy):
(WebCore::AsyncFileSystemBlackBerry::remove):
(WebCore::AsyncFileSystemBlackBerry::removeRecursively):
(WebCore::AsyncFileSystemBlackBerry::readMetadata):
(WebCore::AsyncFileSystemBlackBerry::createFile):
(WebCore::AsyncFileSystemBlackBerry::createDirectory):
(WebCore::AsyncFileSystemBlackBerry::fileExists):
(WebCore::AsyncFileSystemBlackBerry::directoryExists):
(WebCore::AsyncFileSystemBlackBerry::readDirectory):
(WebCore::AsyncFileSystemBlackBerry::createWriter):
(WebCore::AsyncFileSystemBlackBerry::createSnapshotFileAndReadMetadata):
(WebCore::AsyncFileSystemBlackBerry::fileSystemURLToPath):
* platform/blackberry/AsyncFileSystemBlackBerry.h:
(WTF):
(WTF::BlackBerry::Platform::WebFileSystem):
(WebCore::AsyncFileSystemBlackBerry::create):
(AsyncFileSystemBlackBerry):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148275 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 6f721453
2013-04-12 Alberto Garcia <agarcia@igalia.com>
[BlackBerry] Upstream the filesystem code
https://bugs.webkit.org/show_bug.cgi?id=114437
Reviewed by Rob Buis.
These are the changes for AsyncFileSystemBlackBerry.
This patch contains contributions from many members of the
BlackBerry WebKit team.
* platform/blackberry/AsyncFileSystemBlackBerry.cpp:
(WebCore::AsyncFileSystem::isAvailable):
(WebCore):
(WebCore::AsyncFileSystem::create):
(WebCore::AsyncFileSystem::openFileSystem):
(WebCore::AsyncFileSystemBlackBerry::openFileSystem):
(WebCore::AsyncFileSystem::deleteFileSystem):
(WebCore::AsyncFileSystemBlackBerry::AsyncFileSystemBlackBerry):
(WebCore::AsyncFileSystemBlackBerry::~AsyncFileSystemBlackBerry):
(WebCore::AsyncFileSystemBlackBerry::move):
(WebCore::AsyncFileSystemBlackBerry::copy):
(WebCore::AsyncFileSystemBlackBerry::remove):
(WebCore::AsyncFileSystemBlackBerry::removeRecursively):
(WebCore::AsyncFileSystemBlackBerry::readMetadata):
(WebCore::AsyncFileSystemBlackBerry::createFile):
(WebCore::AsyncFileSystemBlackBerry::createDirectory):
(WebCore::AsyncFileSystemBlackBerry::fileExists):
(WebCore::AsyncFileSystemBlackBerry::directoryExists):
(WebCore::AsyncFileSystemBlackBerry::readDirectory):
(WebCore::AsyncFileSystemBlackBerry::createWriter):
(WebCore::AsyncFileSystemBlackBerry::createSnapshotFileAndReadMetadata):
(WebCore::AsyncFileSystemBlackBerry::fileSystemURLToPath):
* platform/blackberry/AsyncFileSystemBlackBerry.h:
(WTF):
(WTF::BlackBerry::Platform::WebFileSystem):
(WebCore::AsyncFileSystemBlackBerry::create):
(AsyncFileSystemBlackBerry):
2013-04-12 Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Apply our MSVC 2012 optimizer bug workaround to all minor releases
/*
* Copyright (C) 2012 Research In Motion Limited. All rights reserved.
* Copyright (C) 2012, 2013 Research In Motion Limited. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -22,154 +22,130 @@
#include "AsyncFileSystemBlackBerry.h"
#include "AsyncFileSystemCallbacks.h"
#include "AsyncFileWriterBlackBerry.h"
#include "AsyncFileWriterClient.h"
#include "DOMFileSystemBase.h"
#include "ExceptionCode.h"
#include "KURL.h"
#include "NotImplemented.h"
#include "PlatformAsyncFileSystemCallbacks.h"
#include "ScriptExecutionContext.h"
#include "SecurityOrigin.h"
#include <wtf/UnusedParam.h>
#include <wtf/text/CString.h>
#include <wtf/text/StringBuilder.h>
namespace WebCore {
bool AsyncFileSystem::isAvailable()
{
notImplemented();
return false;
return true;
}
// We don't use this one!
PassOwnPtr<AsyncFileSystem> AsyncFileSystem::create()
{
return adoptPtr(new AsyncFileSystemBlackBerry());
ASSERT_NOT_REACHED();
return PassOwnPtr<AsyncFileSystem>();
}
// We don't use this one!
void AsyncFileSystem::openFileSystem(const String& basePath, const String& storageIdentifier, FileSystemType, bool, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
UNUSED_PARAM(basePath);
UNUSED_PARAM(storageIdentifier);
UNUSED_PARAM(callbacks);
ASSERT_NOT_REACHED();
}
notImplemented();
callbacks->didFail(NOT_SUPPORTED_ERR);
void AsyncFileSystemBlackBerry::openFileSystem(const KURL& rootURL, const String& basePath, const String& storageIdentifier, FileSystemType type, long long size, bool create, int playerId, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
BlackBerry::Platform::WebFileSystem::openFileSystem(BlackBerry::Platform::webKitThreadMessageClient(), basePath, storageIdentifier, static_cast<BlackBerry::Platform::WebFileSystem::Type>(type), size, create, new PlatformAsyncFileSystemCallbacks(callbacks, rootURL), playerId);
}
void AsyncFileSystem::deleteFileSystem(const String& basePath, const String& storageIdentifier, FileSystemType type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
UNUSED_PARAM(basePath);
UNUSED_PARAM(storageIdentifier);
UNUSED_PARAM(type);
notImplemented();
callbacks->didFail(NOT_SUPPORTED_ERR);
BlackBerry::Platform::WebFileSystem::deleteFileSystem(BlackBerry::Platform::webKitThreadMessageClient(), basePath, storageIdentifier, static_cast<BlackBerry::Platform::WebFileSystem::Type>(type), new PlatformAsyncFileSystemCallbacks(callbacks));
}
AsyncFileSystemBlackBerry::AsyncFileSystemBlackBerry()
AsyncFileSystemBlackBerry::AsyncFileSystemBlackBerry(PassOwnPtr<BlackBerry::Platform::WebFileSystem> platformFileSystem)
: AsyncFileSystem() // FIXME: type ???
, m_platformFileSystem(platformFileSystem)
{
notImplemented();
}
AsyncFileSystemBlackBerry::~AsyncFileSystemBlackBerry()
{
notImplemented();
}
void AsyncFileSystemBlackBerry::move(const KURL& sourcePath, const KURL& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
UNUSED_PARAM(sourcePath);
UNUSED_PARAM(destinationPath);
UNUSED_PARAM(callbacks);
notImplemented();
m_platformFileSystem->move(fileSystemURLToPath(sourcePath), fileSystemURLToPath(destinationPath), new PlatformAsyncFileSystemCallbacks(callbacks));
}
void AsyncFileSystemBlackBerry::copy(const KURL& sourcePath, const KURL& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
UNUSED_PARAM(sourcePath);
UNUSED_PARAM(destinationPath);
UNUSED_PARAM(callbacks);
notImplemented();
m_platformFileSystem->copy(fileSystemURLToPath(sourcePath), fileSystemURLToPath(destinationPath), new PlatformAsyncFileSystemCallbacks(callbacks));
}
void AsyncFileSystemBlackBerry::remove(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
UNUSED_PARAM(path);
UNUSED_PARAM(callbacks);
notImplemented();
m_platformFileSystem->remove(fileSystemURLToPath(path), new PlatformAsyncFileSystemCallbacks(callbacks));
}
void AsyncFileSystemBlackBerry::removeRecursively(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
UNUSED_PARAM(path);
UNUSED_PARAM(callbacks);
notImplemented();
m_platformFileSystem->removeRecursively(fileSystemURLToPath(path), new PlatformAsyncFileSystemCallbacks(callbacks));
}
void AsyncFileSystemBlackBerry::readMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
UNUSED_PARAM(path);
UNUSED_PARAM(callbacks);
notImplemented();
m_platformFileSystem->readMetadata(fileSystemURLToPath(path), new PlatformAsyncFileSystemCallbacks(callbacks));
}
void AsyncFileSystemBlackBerry::createFile(const KURL& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
UNUSED_PARAM(path);
UNUSED_PARAM(exclusive);
UNUSED_PARAM(callbacks);
notImplemented();
m_platformFileSystem->createFile(fileSystemURLToPath(path), exclusive, new PlatformAsyncFileSystemCallbacks(callbacks));
}
void AsyncFileSystemBlackBerry::createDirectory(const KURL& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
UNUSED_PARAM(path);
UNUSED_PARAM(exclusive);
UNUSED_PARAM(callbacks);
notImplemented();
m_platformFileSystem->createDirectory(fileSystemURLToPath(path), exclusive, new PlatformAsyncFileSystemCallbacks(callbacks));
}
void AsyncFileSystemBlackBerry::fileExists(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
UNUSED_PARAM(path);
UNUSED_PARAM(callbacks);
notImplemented();
m_platformFileSystem->fileExists(fileSystemURLToPath(path), new PlatformAsyncFileSystemCallbacks(callbacks));
}
void AsyncFileSystemBlackBerry::directoryExists(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
UNUSED_PARAM(path);
UNUSED_PARAM(callbacks);
notImplemented();
m_platformFileSystem->directoryExists(fileSystemURLToPath(path), new PlatformAsyncFileSystemCallbacks(callbacks));
}
void AsyncFileSystemBlackBerry::readDirectory(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
UNUSED_PARAM(path);
UNUSED_PARAM(callbacks);
notImplemented();
m_platformFileSystem->readDirectory(fileSystemURLToPath(path), new PlatformAsyncFileSystemCallbacks(callbacks));
}
void AsyncFileSystemBlackBerry::createWriter(AsyncFileWriterClient* client, const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
UNUSED_PARAM(client);
UNUSED_PARAM(path);
UNUSED_PARAM(callbacks);
notImplemented();
BlackBerry::Platform::WebFileWriter::createWriter(m_platformFileSystem.get(), fileSystemURLToPath(path), new PlatformAsyncFileSystemCallbacks(callbacks, client));
}
void AsyncFileSystemBlackBerry::createSnapshotFileAndReadMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
UNUSED_PARAM(path);
UNUSED_PARAM(callbacks);
m_platformFileSystem->createSnapshotFileAndReadMetadata(fileSystemURLToPath(path), new PlatformAsyncFileSystemCallbacks(callbacks));
}
notImplemented();
String AsyncFileSystemBlackBerry::fileSystemURLToPath(const KURL& url)
{
FileSystemType type;
String fullPath;
bool result = DOMFileSystemBase::crackFileSystemURL(url, type, fullPath);
ASSERT_UNUSED(result, result);
return fullPath;
}
} // namespace WebCore
......
......@@ -22,12 +22,33 @@
#if ENABLE(FILE_SYSTEM)
#include "AsyncFileSystem.h"
#include "FileSystemType.h"
#include "KURL.h"
#include <BlackBerryPlatformWebFileSystem.h>
#include <wtf/OwnPtr.h>
#include <wtf/text/WTFString.h>
namespace WTF {
template <> inline void deleteOwnedPtr<BlackBerry::Platform::WebFileSystem>(BlackBerry::Platform::WebFileSystem* ptr)
{
BlackBerry::Platform::deleteGuardedObject(ptr);
}
}
namespace WebCore {
class AsyncFileSystemBlackBerry : public AsyncFileSystem {
public:
AsyncFileSystemBlackBerry();
static PassOwnPtr<AsyncFileSystemBlackBerry> create(PassOwnPtr<BlackBerry::Platform::WebFileSystem> platformFileSystem)
{
return adoptPtr(new AsyncFileSystemBlackBerry(platformFileSystem));
}
static void openFileSystem(const KURL& rootURL, const String& basePath, const String& storageIdentifier, FileSystemType, long long size, bool create, int playerId, PassOwnPtr<AsyncFileSystemCallbacks>);
virtual ~AsyncFileSystemBlackBerry();
virtual void move(const KURL& sourcePath, const KURL& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks>);
virtual void copy(const KURL& sourcePath, const KURL& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks>);
......@@ -41,6 +62,12 @@ public:
virtual void readDirectory(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
virtual void createWriter(AsyncFileWriterClient*, const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
virtual void createSnapshotFileAndReadMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
protected:
AsyncFileSystemBlackBerry(PassOwnPtr<BlackBerry::Platform::WebFileSystem> platformFileSystem);
static String fileSystemURLToPath(const KURL&);
OwnPtr<BlackBerry::Platform::WebFileSystem> m_platformFileSystem;
};
} // namespace WebCore
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment