virtual bool exceededIndexedDatabaseQuota(Frame*, int64_t) { }
#endif
+#if ENABLE(TIZEN_FILE_SYSTEM)
+ virtual bool exceededLocalFileSystemQuota(Frame* frame, int64_t currentUsage) { }
+#endif
+
};
class EmptyFrameLoaderClient : public FrameLoaderClient {
virtual bool exceededIndexedDatabaseQuota(Frame*, int64_t) = 0;
#endif
+#if ENABLE(TIZEN_FILE_SYSTEM)
+ virtual bool exceededLocalFileSystemQuota(Frame*, int64_t currentUsage) = 0;
+#endif
+
protected:
virtual ~ChromeClient() { }
};
GroupSettings::GroupSettings()
: m_localStorageQuotaBytes(5 * 1024 * 1024) // Suggested by the HTML5 spec.
, m_indexedDBQuotaBytes(5 * 1024 * 1024)
+#if ENABLE(TIZEN_FILE_SYSTEM)
+ , m_localFileSystemQuotaBytes(0x6400000) // 100M
+#endif
{
}
m_indexedDBQuotaBytes = quota;
}
+#if ENABLE(TIZEN_FILE_SYSTEM)
+void GroupSettings::setLocalFileSystemQuotaBytes(int64_t quota)
+{
+ m_localFileSystemQuotaBytes = quota;
+}
+#endif
} // namespace WebCore
void setIndexedDBDatabasePath(const String&);
const String& indexedDBDatabasePath() const { return m_indexedDBDatabasePath; }
+#if ENABLE(TIZEN_FILE_SYSTEM)
+ void setLocalFileSystemQuotaBytes(int64_t quota);
+ int64_t localFileSystemQuotaBytes() const { return m_localFileSystemQuotaBytes; }
+#endif
+
private:
GroupSettings();
unsigned m_localStorageQuotaBytes;
String m_indexedDBDatabasePath;
int64_t m_indexedDBQuotaBytes;
+#if ENABLE(TIZEN_FILE_SYSTEM)
+ int64_t m_localFileSystemQuotaBytes;
+#endif
};
} // namespace WebCore
#endif
#if ENABLE(TIZEN_FILE_SYSTEM)
-bool copyFile(const String&, const String&);
-bool linkFile(const String&, const String&);
+bool copyFile(const String& sourcePath, const String& destinationPath);
+bool getDirectorySize(const String& path, long long& size);
+bool linkFile(const String& sourcePath, const String& destinationPath);
bool removeDirectory(const String& path);
-bool renameFile(const String&, const String&);
+bool renameFile(const String& sourcePath, const String& destinationPath);
#endif
} // namespace WebCore
#include "FileMetadata.h"
#include "FileSystem.h"
#include "GOwnPtr.h"
+#include "GroupSettings.h"
#include "LocalFileSystem.h"
#include "NotImplemented.h"
#include "Page.h"
+#include "PageGroup.h"
#include "SecurityOrigin.h"
#include "WorkerContext.h"
#include "WorkerRunLoop.h"
namespace WebCore {
-/*
-// Defined but not used.
-static void openFileSystemNotAllowed(ScriptExecutionContext*, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
-{
- callbacks->didFail(FileError::SECURITY_ERR);
-}
-*/
-
static void openFileSystem(ScriptExecutionContext* context, const String& basePath, const String& identifier, FileSystemType type, bool create, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, FileSystemSynchronousType synchronousType)
{
String typeString = (type == FileSystemTypePersistent) ? "Persistent" : "Temporary";
m_taskController->postTaskToMainThread(createCallbackTask(&moveAsync, AsyncFileSystemCallbacksTizen::create(m_taskController.get(), callbacks, mode), sourceFileSystemPath, destinationFileSystemPath));
}
-static void copyAsync(ScriptExecutionContext*, PassOwnPtr<AsyncFileSystemCallbacksTizen> helperCallbacks, const String& sourcePath, const String& destinationPath)
+static void copyAsync(ScriptExecutionContext* context, PassOwnPtr<AsyncFileSystemCallbacksTizen> helperCallbacks, const String& sourcePath, const String& destinationPath)
{
if (!fileExists(sourcePath)) {
helperCallbacks->didFail(FileError::NOT_FOUND_ERR);
return;
}
+ int errorCode = 0;
+ if (!AsyncFileSystemTizen::checkQuota(context, sourcePath, errorCode)) {
+ helperCallbacks->didFail(errorCode);
+ return;
+ }
+
if (copyFile(sourcePath, destinationPath))
helperCallbacks->didSucceed();
else
m_taskController->postTaskToMainThread(createCallbackTask(&readMetadataAsync, AsyncFileSystemCallbacksTizen::create(m_taskController.get(), callbacks, mode), fileSystemPath));
}
-static void createFileAsync(ScriptExecutionContext*, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacksTizen> helperCallbacks, const String& path)
+static void createFileAsync(ScriptExecutionContext* context, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacksTizen> helperCallbacks, const String& path)
{
if (exclusive && fileExists(path)) {
helperCallbacks->didFail(FileError::PATH_EXISTS_ERR);
return;
}
+ int errorCode = 0;
+ if (!AsyncFileSystemTizen::checkQuota(context, path, errorCode)) {
+ helperCallbacks->didFail(errorCode);
+ return;
+ }
+
PlatformFileHandle handle;
handle = openFile(path, OpenForWrite);
m_taskController->postTaskToMainThread(createCallbackTask(&createFileAsync, exclusive, AsyncFileSystemCallbacksTizen::create(m_taskController.get(), callbacks, mode), fileSystemPath));
}
-static void createDirectoryAsync(ScriptExecutionContext*, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacksTizen> helperCallbacks, const String& path)
+static void createDirectoryAsync(ScriptExecutionContext* context, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacksTizen> helperCallbacks, const String& path)
{
if (exclusive && fileExists(path)) {
helperCallbacks->didFail(FileError::PATH_EXISTS_ERR);
return;
}
+ int errorCode = 0;
+ if (!AsyncFileSystemTizen::checkQuota(context, path, errorCode)) {
+ helperCallbacks->didFail(errorCode);
+ return;
+ }
+
if (makeAllDirectories(path))
helperCallbacks->didSucceed();
else
fileSystemPath.append(origin->databaseIdentifier());
fileSystemPath.append(innerURL.path());
- return String(fileSystemRepresentation(fileSystemPath.toString()).data());
+ return fileSystemPath.toString();
+}
+
+bool AsyncFileSystemTizen::checkQuota(ScriptExecutionContext* context, const String& sourcePath, int& errorCode)
+{
+ if (!sourcePath.startsWith(LocalFileSystem::localFileSystem().fileSystemBasePath())) {
+ errorCode = FileError::NOT_FOUND_ERR;
+ return false;
+ }
+
+ String subPath = sourcePath.substring(LocalFileSystem::localFileSystem().fileSystemBasePath().length());
+ Vector<String> components;
+ subPath.split('/', components);
+ size_t componentsSize = components.size();
+ if (!componentsSize) {
+ errorCode = FileError::NOT_FOUND_ERR;
+ return false;
+ }
+
+ StringBuilder fileSystemPath;
+ fileSystemPath.append(LocalFileSystem::localFileSystem().fileSystemBasePath());
+ if (subPath.startsWith('/'))
+ fileSystemPath.append('/');
+ fileSystemPath.append(components[0]);
+ String originRootPath = String(fileSystemRepresentation(fileSystemPath.toString()).data());
+
+ int64_t usage = 0;
+ if (!getDirectorySize(originRootPath, usage)) {
+ errorCode = FileError::NOT_READABLE_ERR;
+ return false;
+ }
+
+ if (context->isDocument()) {
+ Document* document = static_cast<Document*>(context);
+ int64_t defaultQuota = document->page()->group().groupSettings()->localFileSystemQuotaBytes();
+ int64_t maxQuota = 0x80000000; // 2GB
+ if (usage > maxQuota) {
+ errorCode = FileError::QUOTA_EXCEEDED_ERR;
+ return false;
+ }
+
+ if (usage >= defaultQuota && defaultQuota != maxQuota) {
+ if (document->page()->chrome()->client()->exceededLocalFileSystemQuota(document->frame(), usage))
+ document->page()->group().groupSettings()->setLocalFileSystemQuotaBytes(maxQuota);
+ else {
+ errorCode = FileError::QUOTA_EXCEEDED_ERR;
+ return false;
+ }
+ }
+ } else {
+ WorkerContext* workerContext = static_cast<WorkerContext*>(context);
+ if (usage >= workerContext->groupSettings()->localFileSystemQuotaBytes()) {
+ errorCode = FileError::QUOTA_EXCEEDED_ERR;
+ return false;
+ }
+ }
+
+ return true;
}
} // namespace WebCore
-#endif // ENABLE(FILE_SYSTEM)
+#endif// ENABLE(FILE_SYSTEM)
void setTaskController(PassRefPtr<AsyncFileSystemTaskControllerTizen>);
static String virtualPathToFileSystemPath(const KURL&);
+ static bool checkQuota(ScriptExecutionContext*, const String& path, int& errorCode);
private:
String m_localFileSystemBasePath;
#if ENABLE(TIZEN_FILE_SYSTEM)
+#include "AsyncFileSystemTizen.h"
#include "AsyncFileWriterClientTizen.h"
#include "Blob.h"
#include "BlobRegistryImpl.h"
{
}
-static void writeAsync(ScriptExecutionContext*, PassOwnPtr<AsyncFileWriterClientTizen> helperClient, const String& path, long long position, Blob* data)
+static void writeAsync(ScriptExecutionContext* context, PassOwnPtr<AsyncFileWriterClientTizen> helperClient, const String& path, long long position, Blob* data)
{
int bytesWritten;
PlatformFileHandle handle;
handle = openFile(path, OpenForWrite);
- if (!isHandleValid(handle))
+ if (!isHandleValid(handle)) {
+ helperClient->didFail(FileError::NOT_FOUND_ERR);
+ return;
+ }
+
+ int errorCode = 0;
+ if (!AsyncFileSystemTizen::checkQuota(context, path, errorCode)) {
+ closeFile(handle);
+ helperClient->didFail(static_cast<FileError::ErrorCode>(errorCode));
return;
+ }
RefPtr<BlobStorageData> blobStorage = static_cast<BlobRegistryImpl&>(blobRegistry()).getBlobDataFromURL(data->url());
if (blobStorage) {
#if ENABLE(TIZEN_FILE_SYSTEM)
#include "FileMetadata.h"
+#include <dirent.h>
#include <stdio.h>
#include <sys/stat.h>
#include <unistd.h>
namespace WebCore {
+bool getDirectorySize(const String& path, long long& size)
+{
+ if(!fileExists(path))
+ return false;
+
+ DIR* directory = opendir(fileSystemRepresentation(path).data());
+ if(!directory)
+ return false;
+
+ struct dirent* directoryEntry;
+ struct stat buf;
+
+ while (directoryEntry = readdir(directory)) {
+ if (!strcmp(directoryEntry->d_name, ".") || !strcmp(directoryEntry->d_name, ".."))
+ continue;
+
+ String absolutePath = pathByAppendingComponent(path, String(directoryEntry->d_name));
+
+ if (lstat(absolutePath.utf8().data(), &buf) == -1) {
+ closedir(directory);
+ return false;
+ }
+
+ bool result;
+ if (S_ISDIR(buf.st_mode)) {
+ if (!getDirectorySize(absolutePath, size)) {
+ closedir(directory);
+ return false;
+ }
+ } else
+ size += buf.st_size;
+ }
+
+ closedir(directory);
+ return true;
+}
+
bool getFileMetadata(const String& path, FileMetadata& metadata)
{
CString fsRep = fileSystemRepresentation(path);
m_groupSettings->setLocalStorageQuotaBytes(settings->localStorageQuotaBytes());
m_groupSettings->setIndexedDBQuotaBytes(settings->indexedDBQuotaBytes());
m_groupSettings->setIndexedDBDatabasePath(settings->indexedDBDatabasePath().isolatedCopy());
+#if ENABLE(TIZEN_FILE_SYSTEM)
+ m_groupSettings->setLocalFileSystemQuotaBytes(settings->localFileSystemQuotaBytes());
+#endif
+
}
WorkerThread::WorkerThread(const KURL& scriptURL, const String& userAgent, const GroupSettings* settings, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerReportingProxy& workerReportingProxy, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
toImpl(page)->replyExceededDatabaseQuota(allow);
#endif
}
+
+void WKPageReplyExceededLocalFileSystemQuota(WKPageRef page, bool allow)
+{
+#if ENABLE(TIZEN_FILE_SYSTEM)
+ toImpl(page)->replyExceededLocalFileSystemQuota(allow);
+#endif
+}
//#if ENABLE(TIZEN_INDEXED_DATABASE)
typedef bool (*WKPageExceededIndexedDatabaseQuotaCallback)(WKPageRef page, WKSecurityOriginRef origin, long long currentUsage, WKFrameRef frame, const void* clientInfo);
//#endif
+//#if ENABLE(TIZEN_FILE_SYSTEM)
+typedef bool (*WKPageExceededLocalFileSystemQuotaCallback)(WKPageRef page, WKSecurityOriginRef origin, long long currentUsage, WKFrameRef frame, const void* clientInfo);
+//#endif
struct WKPageTizenClient {
int version;
//#if ENABLE(TIZEN_INDEXED_DATABASE)
WKPageExceededIndexedDatabaseQuotaCallback exceededIndexedDatabaseQuota;
//#endif
+ //#if ENABLE(TIZEN_FILE_SYSTEM)
+ WKPageExceededLocalFileSystemQuotaCallback exceededLocalFileSystemQuota;
+ //#endif
};
typedef struct WKPageTizenClient WKPageTizenClient;
// #if ENABLE(TIZEN_SQL_DATABASE)
WK_EXPORT void WKPageReplyExceededDatabaseQuota(WKPageRef page, bool allow);
// #endif
+
+//#if ENABLE(TIZEN_FILE_SYSTEM)
+WK_EXPORT void WKPageReplyExceededLocalFileSystemQuota(WKPageRef page, bool allow);
+//#endif
+
#ifdef __cplusplus
}
#endif
#if ENABLE(TIZEN_SQL_DATABASE)
Ewk_View_Exceeded_Database_Quota_Callback exceededDatabaseQuotaCallback;
#endif
+#if ENABLE(TIZEN_FILE_SYSTEM)
+ Ewk_View_Exceeded_Local_File_System_Quota_Callback exceededLocalFileSystemQuotaCallback;
+#endif
};
Evas_Object* ewkView;
#if ENABLE(TIZEN_SQL_DATABASE)
OwnPtr<Ewk_View_Callback_Context> exceededDatabaseQuotaContext;
#endif
+#if ENABLE(TIZEN_FILE_SYSTEM)
+ OwnPtr<Ewk_View_Callback_Context> exceededLocalFileSystemQuotaContext;
+#endif
Ewk_Security_Origin* exceededQuotaOrigin;
bool isWaitingForExceededQuotaPopupReply;
#endif // #if OS(TIZEN)
UNUSED_PARAM(allow);
#endif
}
+
+#if ENABLE(TIZEN_FILE_SYSTEM)
+bool ewkViewExceededLocalFileSystemQuota(Evas_Object* ewkView, WKSecurityOriginRef origin, long long currentUsage)
+{
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
+ EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
+
+ if (!impl->exceededLocalFileSystemQuotaContext || !impl->exceededLocalFileSystemQuotaContext->exceededLocalFileSystemQuotaCallback)
+ return false;
+
+ impl->isWaitingForExceededQuotaPopupReply = true;
+ if (impl->exceededQuotaOrigin)
+ deleteSecurityOrigin(impl->exceededQuotaOrigin);
+ impl->exceededQuotaOrigin = createSecurityOrigin(origin);
+
+ TIZEN_LOGI("currentUsage(%lld)", currentUsage);
+
+ return impl->exceededLocalFileSystemQuotaContext->exceededLocalFileSystemQuotaCallback(ewkView, impl->exceededQuotaOrigin , currentUsage, impl->exceededLocalFileSystemQuotaContext->userData) == EINA_TRUE;
+}
+#endif
+
+void ewk_view_exceeded_local_file_system_quota_callback_set(Evas_Object* ewkView, Ewk_View_Exceeded_Indexed_Database_Quota_Callback callback, void* userData)
+{
+#if ENABLE(TIZEN_FILE_SYSTEM)
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
+ EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
+
+ if (!impl->exceededLocalFileSystemQuotaContext)
+ impl->exceededLocalFileSystemQuotaContext = adoptPtr<Ewk_View_Callback_Context>(new Ewk_View_Callback_Context);
+ impl->exceededLocalFileSystemQuotaContext->exceededLocalFileSystemQuotaCallback = callback;
+ impl->exceededLocalFileSystemQuotaContext->userData = userData;
+#else
+ UNUSED_PARAM(ewkView);
+ UNUSED_PARAM(callback);
+ UNUSED_PARAM(userData);
+#endif
+}
+
+void ewk_view_exceeded_local_file_system_quota_reply(Evas_Object* ewkView, Eina_Bool allow)
+{
+#if ENABLE(TIZEN_FILE_SYSTEM)
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
+ EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
+
+ TIZEN_LOGI("allow %d", allow);
+ WKPageReplyExceededLocalFileSystemQuota(toAPI(impl->page()), allow == EINA_TRUE);
+ if (impl->exceededQuotaOrigin)
+ deleteSecurityOrigin(impl->exceededQuotaOrigin);
+ impl->exceededQuotaOrigin = 0;
+ impl->isWaitingForExceededQuotaPopupReply = false;
+#else
+ UNUSED_PARAM(ewkView);
+ UNUSED_PARAM(result);
+#endif
+}
EAPI void ewk_view_exceeded_database_quota_reply(Evas_Object* o, Eina_Bool allow);
// #endif
+//#if ENABLE(TIZEN_FILE_SYSTEM)
+typedef Eina_Bool (*Ewk_View_Exceeded_Local_File_System_Quota_Callback)(Evas_Object* o, Ewk_Security_Origin* origin, long long currentQuota, void* user_data);
+EAPI void ewk_view_exceeded_local_file_system_quota_callback_set(Evas_Object* o, Ewk_View_Exceeded_Local_File_System_Quota_Callback callback, void* user_data);
+EAPI void ewk_view_exceeded_local_file_system_quota_reply(Evas_Object* o, Eina_Bool allow);
+//#endif
+
/**
* Gets the Ewk_Settings of this view.
*
void ewk_view_text_change_in_textfield(Evas_Object* ewkView, const String& name, const String& value);
#endif
+#if ENABLE(TIZEN_FILE_SYSTEM)
+bool ewkViewExceededLocalFileSystemQuota(Evas_Object* ewkView, WKSecurityOriginRef origin, long long currentUsage);
+#endif
+
#endif // ewk_view_private_h
#endif
}
+static bool exceededLocalFileSystemQuota(WKPageRef page, WKSecurityOriginRef origin, long long currentUsage, WKFrameRef frame, const void *clientInfo)
+{
+#if ENABLE(TIZEN_FILE_SYSTEM)
+ return ewkViewExceededLocalFileSystemQuota(static_cast<Evas_Object*>(const_cast<void*>(clientInfo)), origin, currentUsage);
+#else
+ return false;
+#endif
+}
+
void ewkViewTizenClientAttachClient(Evas_Object* ewkView)
{
EINA_SAFETY_ON_NULL_RETURN(ewkView);
decidePolicyForUserMediaPermissionRequest,
processJSBridgePlugin,
decidePolicyForCertificateError,
- exceededIndexedDatabaseQuota
+ exceededIndexedDatabaseQuota,
+ exceededLocalFileSystemQuota
};
WKPageSetPageTizenClient(toAPI(EwkViewImpl::fromEvasObject(ewkView)->page()), &tizenClient);
void replyExceededDatabaseQuota(bool allow);
#endif
+#if ENABLE(TIZEN_FILE_SYSTEM)
+ void replyExceededLocalFileSystemQuota(bool allow);
+#endif
+
private:
WebPageProxy(PageClient*, PassRefPtr<WebProcessProxy>, WebPageGroup*, uint64_t pageID);
void exceededIndexedDatabaseQuota(uint64_t frameID, const String& originIdentifier, int64_t currentUsage, PassRefPtr<Messages::WebPageProxy::ExceededIndexedDatabaseQuota::DelayedReply> reply);
#endif
+#if ENABLE(TIZEN_FILE_SYSTEM)
+ void exceededLocalFileSystemQuota(uint64_t frameID, const String& originIdentifier, int64_t currentUsage, PassRefPtr<Messages::WebPageProxy::ExceededLocalFileSystemQuota::DelayedReply> reply);
+#endif
+
PageClient* m_pageClient;
WebLoaderClient m_loaderClient;
WebPolicyClient m_policyClient;
#if ENABLE(TIZEN_INDEXED_DATABASE)
RefPtr<Messages::WebPageProxy::ExceededIndexedDatabaseQuota::DelayedReply> m_exceededIndexedDatabaseQuotaReply;
#endif
+
+#if ENABLE(TIZEN_FILE_SYSTEM)
+ RefPtr<Messages::WebPageProxy::ExceededLocalFileSystemQuota::DelayedReply> m_exceededLocalFileSystemQuotaReply;
+#endif
};
} // namespace WebKit
#if ENABLE(TIZEN_INDEXED_DATABASE)
ExceededIndexedDatabaseQuota(uint64_t frameID, WTF::String originIdentifier, int64_t currentUsage) -> (bool returnValue) Delayed
#endif
+
+#if ENABLE(TIZEN_FILE_SYSTEM)
+ ExceededLocalFileSystemQuota(uint64_t frameID, WTF::String originIdentifier, int64_t currentUsage) -> (bool allow) Delayed
+#endif
}
}
#endif
+#if ENABLE(TIZEN_FILE_SYSTEM)
+void WebPageProxy::exceededLocalFileSystemQuota(uint64_t frameID, const String& originIdentifier, int64_t currentUsage, PassRefPtr<Messages::WebPageProxy::ExceededLocalFileSystemQuota::DelayedReply> reply)
+{
+ WebFrameProxy* frame = process()->webFrame(frameID);
+ MESSAGE_CHECK(frame);
+
+ // Since exceededLocalFileSystemQuota() can spin a nested run loop we need to turn off the responsiveness timer.
+ process()->responsivenessTimer()->stop();
+ m_exceededLocalFileSystemQuotaReply = reply;
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+ process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(true);
+#endif
+
+ RefPtr<WebSecurityOrigin> origin = WebSecurityOrigin::createFromDatabaseIdentifier(originIdentifier);
+
+ if (!m_tizenClient.exceededLocalFileSystemQuota(this, origin.get(), currentUsage, frame))
+ replyExceededLocalFileSystemQuota(false);
+}
+
+void WebPageProxy::replyExceededLocalFileSystemQuota(bool allow)
+{
+ if (!m_exceededLocalFileSystemQuotaReply)
+ return;
+
+ m_exceededLocalFileSystemQuotaReply->send(allow);
+ m_exceededLocalFileSystemQuotaReply = nullptr;
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+ process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(false);
+#endif
+}
+#endif
+
#endif // #if OS(TIZEN)
void WebPageProxy::handleInputMethodKeydown(bool& handled)
return m_client.exceededIndexedDatabaseQuota(toAPI(page), toAPI(origin), currentUsage, toAPI(frame), m_client.clientInfo);
}
#endif
+
+#if ENABLE(TIZEN_FILE_SYSTEM)
+bool WebTizenClient::exceededLocalFileSystemQuota(WebPageProxy* page, WebSecurityOrigin* origin, long long currentUsage, WebFrameProxy* frame)
+{
+ if (!m_client.exceededLocalFileSystemQuota)
+ return currentUsage;
+
+ return m_client.exceededLocalFileSystemQuota(toAPI(page), toAPI(origin), currentUsage, toAPI(frame), m_client.clientInfo);
+}
+#endif
} // namespace WebKit
#if ENABLE(TIZEN_INDEXED_DATABASE)
bool exceededIndexedDatabaseQuota(WebPageProxy*, WebSecurityOrigin*, long long, WebFrameProxy*);
#endif
+
+#if ENABLE(TIZEN_FILE_SYSTEM)
+ bool exceededLocalFileSystemQuota(WebPageProxy*, WebSecurityOrigin*, long long, WebFrameProxy*);
+#endif
};
} // namespace WebKit
}
#endif
+#if ENABLE(TIZEN_FILE_SYSTEM)
+bool WebChromeClient::exceededLocalFileSystemQuota(Frame* frame, int64_t currentQuota)
+{
+ WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
+ SecurityOrigin* origin = frame->document()->securityOrigin();
+
+ unsigned syncSendFlags = (WebCore::AXObjectCache::accessibilityEnabled()) ? CoreIPC::SpinRunLoopWhileWaitingForReply : 0;
+ bool result = false;
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+ WebProcess::WaitForJavaScriptPopupFinished waiting;
+#endif
+ if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::ExceededLocalFileSystemQuota(webFrame->frameID(), origin->databaseIdentifier(), currentQuota), Messages::WebPageProxy::ExceededLocalFileSystemQuota::Reply(result), m_page->pageID(), CoreIPC::Connection::DefaultTimeout, syncSendFlags))
+ return false;
+
+ return result;
+}
+#endif
+
} // namespace WebKit
virtual bool exceededIndexedDatabaseQuota(Frame*, int64_t) OVERRIDE;
#endif
+#if ENABLE(TIZEN_FILE_SYSTEM)
+ virtual bool exceededLocalFileSystemQuota(Frame*, int64_t currentQuota) OVERRIDE;
+#endif
+
String m_cachedToolTip;
mutable RefPtr<WebFrame> m_cachedFrameSetLargestFrame;
mutable bool m_cachedMainFrameHasHorizontalScrollbar;
settings->setTextAutosizingEnabled(store.getBoolValueForKey(WebPreferencesKey::textAutosizingEnabledKey()));
#endif
+#if ENABLE(TIZEN_FILE_SYSTEM)
+ m_page->group().groupSettings()->setLocalFileSystemQuotaBytes(0x6400000); //100M
+#endif
+
platformPreferencesDidChange(store);
if (m_drawingArea)