Commit 56c89da5 authored by beidson@apple.com's avatar beidson@apple.com

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

WebKit2 icon database.

Reviewed by Sam Weinig.

../WebCore: 

* WebCore.exp.in:

../WebKit2: 

Project file paperwork:
* DerivedSources.make:
* DerivedSources.pro:
* GNUmakefile.am:
* WebKit2.pri:
* WebKit2.pro:
* WebKit2.xcodeproj/project.pbxproj:
* win/WebKit2.vcproj:
* win/WebKit2Common.vsprops:
* Scripts/webkit2/messages.py: Special-case capitalization for messages that start with "URL" to be lowercased
  to "url" instead of "uRL".

Add messaging-related stuff:
* Platform/CoreIPC/MessageID.h:
* UIProcess/WebIconDatabase.messages.in: Added.
* WebProcess/IconDatabase/WebIconDatabaseProxy.messages.in: Added.
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didReceiveMessage):
(WebKit::WebProcessProxy::didReceiveSyncMessage):

Prep to make WebIconDatabase an API object:
* Shared/APIObject.h:

Add an "icon DB is enabled" flag to WebProcessCreationParameters:
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:

Add SPI for client apps to set the icon database path:
* UIProcess/API/C/WKContext.cpp:
(WKContextSetIconDatabasePath):
* UIProcess/API/C/WKContextPrivate.h:
* UIProcess/WebContext.h:
(WebKit::WebContext::setIconDatabasePath):

Hook up initialization, clearing, and messaging for the icon database:
* UIProcess/WebContext.cpp:
(WebKit::WebContext::WebContext):
(WebKit::WebContext::~WebContext):
(WebKit::WebContext::ensureWebProcess):
(WebKit::WebContext::didReceiveMessage):
(WebKit::WebContext::didReceiveSyncMessage):
(WebKit::WebContext::iconDatabasePath):
* UIProcess/gtk/WebContextGtk.cpp:
(WebKit::WebContext::platformDefaultIconDatabasePath):
* UIProcess/mac/WebContextMac.mm:
(WebKit::WebContext::platformDefaultIconDatabasePath):
* UIProcess/qt/WebContextQt.cpp:
(WebKit::WebContext::platformDefaultIconDatabasePath):
* UIProcess/win/WebContextWin.cpp:
(WebKit::WebContext::platformDefaultIconDatabasePath):

Add the UIProcess-side IconDatabase. It will be the "actual database" as well as the API object:
* UIProcess/WebIconDatabase.cpp: Added.
(WebKit::WebIconDatabase::create):
(WebKit::WebIconDatabase::~WebIconDatabase):
(WebKit::WebIconDatabase::WebIconDatabase):
(WebKit::WebIconDatabase::invalidate):
(WebKit::WebIconDatabase::retainIconForPageURL):
(WebKit::WebIconDatabase::releaseIconForPageURL):
(WebKit::WebIconDatabase::setIconURLForPageURL):
(WebKit::WebIconDatabase::setIconDataForIconURL):
(WebKit::WebIconDatabase::iconDataForPageURL):
(WebKit::WebIconDatabase::iconURLForPageURL):
(WebKit::WebIconDatabase::iconDataKnownForIconURL):
(WebKit::WebIconDatabase::loadDecisionForIconURL):
(WebKit::WebIconDatabase::didReceiveMessage):
(WebKit::WebIconDatabase::didReceiveSyncMessage):
* UIProcess/WebIconDatabase.h: Added.
(WebKit::WebIconDatabase::clearContext):
(WebKit::WebIconDatabase::type):

Add the WebProcess-side IconDatabaseProxy. It acts as the WebCore IconDatabase and operates via messaging:
* WebProcess/IconDatabase: Added.
* WebProcess/IconDatabase/WebIconDatabaseProxy.cpp: Added.
(WebKit::WebIconDatabaseProxy::~WebIconDatabaseProxy):
(WebKit::WebIconDatabaseProxy::WebIconDatabaseProxy):
(WebKit::WebIconDatabaseProxy::isEnabled):
(WebKit::WebIconDatabaseProxy::setEnabled):
(WebKit::WebIconDatabaseProxy::iconForPageURL):
(WebKit::WebIconDatabaseProxy::retainIconForPageURL):
(WebKit::WebIconDatabaseProxy::releaseIconForPageURL):
(WebKit::WebIconDatabaseProxy::iconURLForPageURL):
(WebKit::WebIconDatabaseProxy::iconDataKnownForIconURL):
(WebKit::WebIconDatabaseProxy::loadDecisionForIconURL):
(WebKit::WebIconDatabaseProxy::setIconURLForPageURL):
(WebKit::WebIconDatabaseProxy::setIconDataForIconURL):
(WebKit::WebIconDatabaseProxy::urlImportFinished):
(WebKit::WebIconDatabaseProxy::didReceiveMessage):
* WebProcess/IconDatabase/WebIconDatabaseProxy.h: Added.

Hook up initialization and messaging for the icon database proxy:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::WebProcess):
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::didReceiveMessage):
* WebProcess/WebProcess.h:



git-svn-id: svn://svn.chromium.org/blink/trunk@81208 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 5877ecbc
2011-03-15 Brady Eidson <beidson@apple.com>
Reviewed by Sam Weinig.
https://bugs.webkit.org/show_bug.cgi?id=56425
WebKit2 icon database.
* WebCore.exp.in:
2011-03-15 Adam Barth <abarth@webkit.org>
Reviewed by Dimitri Glazkov.
......
......@@ -543,6 +543,7 @@ __ZN7WebCore21mainThreadNormalWorldEv
__ZN7WebCore21markerTextForListItemEPNS_7ElementE
__ZN7WebCore21reportThreadViolationEPKcNS_20ThreadViolationRoundE
__ZN7WebCore21resourceLoadSchedulerEv
__ZN7WebCore21setGlobalIconDatabaseEPNS_16IconDatabaseBaseE
__ZN7WebCore21setPlatformStrategiesEPNS_18PlatformStrategiesE
__ZN7WebCore22ScriptExecutionContext26canSuspendActiveDOMObjectsEv
__ZN7WebCore22applicationIsAppleMailEv
......@@ -1114,6 +1115,7 @@ __ZNK7WebCore15VisiblePosition4nextENS_27EditingBoundaryCrossingRuleE
__ZNK7WebCore15VisiblePosition8previousENS_27EditingBoundaryCrossingRuleE
__ZNK7WebCore16FontFallbackList10fontDataAtEPKNS_4FontEj
__ZNK7WebCore16HTMLInputElement12autoCompleteEv
__ZNK7WebCore16IconDatabaseBase12databasePathEv
__ZNK7WebCore16ResourceResponse13nsURLResponseEv
__ZNK7WebCore16VisibleSelection17isContentEditableEv
__ZNK7WebCore16VisibleSelection17toNormalizedRangeEv
......@@ -1270,6 +1272,7 @@ __ZNK7WebCore9FrameView28isEnclosedInCompositingLayerEv
__ZNK7WebCore9PageCache10frameCountEv
__ZNK7WebCore9PageCache21autoreleasedPageCountEv
__ZTVN7WebCore12ChromeClientE
__ZTVN7WebCore16IconDatabaseBaseE
__ZTVN7WebCore17FileChooserClientE
__ZTVN7WebCore17FrameLoaderClientE
__ZTVN7WebCore25HistoryPropertyListWriterE
......
2011-03-15 Brady Eidson <beidson@apple.com>
Reviewed by Sam Weinig.
https://bugs.webkit.org/show_bug.cgi?id=56425
WebKit2 icon database.
Project file paperwork:
* DerivedSources.make:
* DerivedSources.pro:
* GNUmakefile.am:
* WebKit2.pri:
* WebKit2.pro:
* WebKit2.xcodeproj/project.pbxproj:
* win/WebKit2.vcproj:
* win/WebKit2Common.vsprops:
* Scripts/webkit2/messages.py: Special-case capitalization for messages that start with "URL" to be lowercased
to "url" instead of "uRL".
Add messaging-related stuff:
* Platform/CoreIPC/MessageID.h:
* UIProcess/WebIconDatabase.messages.in: Added.
* WebProcess/IconDatabase/WebIconDatabaseProxy.messages.in: Added.
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didReceiveMessage):
(WebKit::WebProcessProxy::didReceiveSyncMessage):
Prep to make WebIconDatabase an API object:
* Shared/APIObject.h:
Add an "icon DB is enabled" flag to WebProcessCreationParameters:
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
Add SPI for client apps to set the icon database path:
* UIProcess/API/C/WKContext.cpp:
(WKContextSetIconDatabasePath):
* UIProcess/API/C/WKContextPrivate.h:
* UIProcess/WebContext.h:
(WebKit::WebContext::setIconDatabasePath):
Hook up initialization, clearing, and messaging for the icon database:
* UIProcess/WebContext.cpp:
(WebKit::WebContext::WebContext):
(WebKit::WebContext::~WebContext):
(WebKit::WebContext::ensureWebProcess):
(WebKit::WebContext::didReceiveMessage):
(WebKit::WebContext::didReceiveSyncMessage):
(WebKit::WebContext::iconDatabasePath):
* UIProcess/gtk/WebContextGtk.cpp:
(WebKit::WebContext::platformDefaultIconDatabasePath):
* UIProcess/mac/WebContextMac.mm:
(WebKit::WebContext::platformDefaultIconDatabasePath):
* UIProcess/qt/WebContextQt.cpp:
(WebKit::WebContext::platformDefaultIconDatabasePath):
* UIProcess/win/WebContextWin.cpp:
(WebKit::WebContext::platformDefaultIconDatabasePath):
Add the UIProcess-side IconDatabase. It will be the "actual database" as well as the API object:
* UIProcess/WebIconDatabase.cpp: Added.
(WebKit::WebIconDatabase::create):
(WebKit::WebIconDatabase::~WebIconDatabase):
(WebKit::WebIconDatabase::WebIconDatabase):
(WebKit::WebIconDatabase::invalidate):
(WebKit::WebIconDatabase::retainIconForPageURL):
(WebKit::WebIconDatabase::releaseIconForPageURL):
(WebKit::WebIconDatabase::setIconURLForPageURL):
(WebKit::WebIconDatabase::setIconDataForIconURL):
(WebKit::WebIconDatabase::iconDataForPageURL):
(WebKit::WebIconDatabase::iconURLForPageURL):
(WebKit::WebIconDatabase::iconDataKnownForIconURL):
(WebKit::WebIconDatabase::loadDecisionForIconURL):
(WebKit::WebIconDatabase::didReceiveMessage):
(WebKit::WebIconDatabase::didReceiveSyncMessage):
* UIProcess/WebIconDatabase.h: Added.
(WebKit::WebIconDatabase::clearContext):
(WebKit::WebIconDatabase::type):
Add the WebProcess-side IconDatabaseProxy. It acts as the WebCore IconDatabase and operates via messaging:
* WebProcess/IconDatabase: Added.
* WebProcess/IconDatabase/WebIconDatabaseProxy.cpp: Added.
(WebKit::WebIconDatabaseProxy::~WebIconDatabaseProxy):
(WebKit::WebIconDatabaseProxy::WebIconDatabaseProxy):
(WebKit::WebIconDatabaseProxy::isEnabled):
(WebKit::WebIconDatabaseProxy::setEnabled):
(WebKit::WebIconDatabaseProxy::iconForPageURL):
(WebKit::WebIconDatabaseProxy::retainIconForPageURL):
(WebKit::WebIconDatabaseProxy::releaseIconForPageURL):
(WebKit::WebIconDatabaseProxy::iconURLForPageURL):
(WebKit::WebIconDatabaseProxy::iconDataKnownForIconURL):
(WebKit::WebIconDatabaseProxy::loadDecisionForIconURL):
(WebKit::WebIconDatabaseProxy::setIconURLForPageURL):
(WebKit::WebIconDatabaseProxy::setIconDataForIconURL):
(WebKit::WebIconDatabaseProxy::urlImportFinished):
(WebKit::WebIconDatabaseProxy::didReceiveMessage):
* WebProcess/IconDatabase/WebIconDatabaseProxy.h: Added.
Hook up initialization and messaging for the icon database proxy:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::WebProcess):
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::didReceiveMessage):
* WebProcess/WebProcess.h:
2011-03-15 Sam Weinig <sam@webkit.org>
Reviewed by Anders Carlsson.
......
......@@ -28,6 +28,7 @@ VPATH = \
$(WebKit2)/WebProcess/Cookies \
$(WebKit2)/WebProcess/FullScreen \
$(WebKit2)/WebProcess/Geolocation \
$(WebKit2)/WebProcess/IconDatabase \
$(WebKit2)/WebProcess/KeyValueStorage \
$(WebKit2)/WebProcess/Plugins \
$(WebKit2)/WebProcess/ResourceCache \
......@@ -60,6 +61,8 @@ MESSAGE_RECEIVERS = \
WebFullScreenManagerProxy \
WebGeolocationManager \
WebGeolocationManagerProxy \
WebIconDatabase \
WebIconDatabaseProxy \
WebInspector \
WebInspectorProxy \
WebKeyValueStorageManager \
......
......@@ -80,6 +80,7 @@ VPATH = \
WebProcess/Cookies \
WebProcess/FullScreen \
WebProcess/Geolocation \
WebProcess/IconDatabase \
WebProcess/KeyValueStorage \
WebProcess/Plugins \
WebProcess/ResourceCache \
......@@ -107,6 +108,8 @@ MESSAGE_RECEIVERS = \
WebDatabaseManagerProxy.messages.in \
WebGeolocationManager.messages.in \
WebGeolocationManagerProxy.messages.in \
WebIconDatabase.messages.in \
WebIconDatabaseProxy.messages.in \
WebInspectorProxy.messages.in \
WebKeyValueStorageManager.messages.in \
WebKeyValueStorageManagerProxy.messages.in \
......
......@@ -446,6 +446,8 @@ libWebKit2_la_SOURCES = \
Source/WebKit2/UIProcess/WebGeolocationProvider.h \
Source/WebKit2/UIProcess/WebHistoryClient.cpp \
Source/WebKit2/UIProcess/WebHistoryClient.h \
Source/WebKit2/UIProcess/WebIconDatabase.cpp \
Source/WebKit2/UIProcess/WebIconDatabase.h \
Source/WebKit2/UIProcess/WebInspectorProxy.cpp \
Source/WebKit2/UIProcess/WebInspectorProxy.h \
Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp \
......@@ -495,6 +497,8 @@ libWebKit2_la_SOURCES = \
Source/WebKit2/WebProcess/gtk/WebProcessGtk.cpp \
Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.cpp \
Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.h \
Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.cpp \
Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.h \
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h \
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.cpp \
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.h \
......@@ -698,6 +702,7 @@ libWebKit2_la_CPPFLAGS = \
-I$(srcdir)/Source/WebKit2/WebProcess/FullScreen \
-I$(srcdir)/Source/WebKit2/WebProcess/Geolocation \
-I$(srcdir)/Source/WebKit2/WebProcess/gtk \
-I$(srcdir)/Source/WebKit2/WebProcess/IconDatabase \
-I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle \
-I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/API \
-I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/API/c \
......@@ -867,6 +872,10 @@ webkit2_built_sources += \
DerivedSources/WebKit2/WebGeolocationManagerMessages.h \
DerivedSources/WebKit2/WebGeolocationManagerProxyMessageReceiver.cpp \
DerivedSources/WebKit2/WebGeolocationManagerProxyMessages.h \
DerivedSources/WebKit2/WebIconDatabaseMessageReceiver.cpp \
DerivedSources/WebKit2/WebIconDatabaseMessages.h \
DerivedSources/WebKit2/WebIconDatabaseProxyMessageReceiver.cpp \
DerivedSources/WebKit2/WebIconDatabaseProxyMessages.h \
DerivedSources/WebKit2/WebInspectorMessageReceiver.cpp \
DerivedSources/WebKit2/WebInspectorMessages.h \
DerivedSources/WebKit2/WebInspectorProxyMessageReceiver.cpp \
......
......@@ -44,6 +44,7 @@ enum MessageClass {
MessageClassWebDatabaseManager,
MessageClassWebFullScreenManager,
MessageClassWebGeolocationManagerProxy,
MessageClassWebIconDatabaseProxy,
MessageClassWebInspector,
MessageClassWebKeyValueStorageManager,
MessageClassWebPage,
......@@ -61,6 +62,7 @@ enum MessageClass {
MessageClassWebDatabaseManagerProxy,
MessageClassWebFullScreenManagerProxy,
MessageClassWebGeolocationManager,
MessageClassWebIconDatabase,
MessageClassWebInspectorProxy,
MessageClassWebKeyValueStorageManagerProxy,
MessageClassWebPageProxy,
......
......@@ -362,6 +362,8 @@ def generate_messages_header(file):
def handler_function(receiver, message):
if message.name.find('URL') == 0:
return '%s::%s' % (receiver.name, 'url' + message.name[3:])
return '%s::%s' % (receiver.name, message.name[0].lower() + message.name[1:])
......
......@@ -76,6 +76,7 @@ public:
TypeGeolocationManager,
TypeGeolocationPermissionRequest,
TypeGeolocationPosition,
TypeIconDatabase,
TypeInspector,
TypeKeyValueStorageManager,
TypeNavigationData,
......
......@@ -61,6 +61,7 @@ void WebProcessCreationParameters::encode(CoreIPC::ArgumentEncoder* encoder) con
encoder->encode(clearResourceCaches);
encoder->encode(clearApplicationCache);
encoder->encode(shouldAlwaysUseComplexTextCodePath);
encoder->encode(iconDatabaseEnabled);
encoder->encode(languageCode);
encoder->encode(textCheckerState);
encoder->encode(defaultRequestTimeoutInterval);
......@@ -113,6 +114,8 @@ bool WebProcessCreationParameters::decode(CoreIPC::ArgumentDecoder* decoder, Web
return false;
if (!decoder->decode(parameters.shouldAlwaysUseComplexTextCodePath))
return false;
if (!decoder->decode(parameters.iconDatabaseEnabled))
return false;
if (!decoder->decode(parameters.languageCode))
return false;
if (!decoder->decode(parameters.textCheckerState))
......
......@@ -70,6 +70,8 @@ struct WebProcessCreationParameters {
bool shouldAlwaysUseComplexTextCodePath;
bool iconDatabaseEnabled;
String languageCode;
TextCheckerState textCheckerState;
......
......@@ -203,6 +203,11 @@ void WKContextStopMemorySampler(WKContextRef contextRef)
toImpl(contextRef)->stopMemorySampler();
}
void WKContextSetIconDatabasePath(WKContextRef contextRef, WKStringRef iconDatabasePath)
{
toImpl(contextRef)->setIconDatabasePath(toImpl(iconDatabasePath)->string());
}
void WKContextSetDatabaseDirectory(WKContextRef contextRef, WKStringRef databaseDirectory)
{
toImpl(contextRef)->setDatabaseDirectory(toImpl(databaseDirectory)->string());
......
......@@ -54,6 +54,8 @@ WK_EXPORT void WKContextRegisterURLSchemeAsSecure(WKContextRef context, WKString
WK_EXPORT void WKContextSetDomainRelaxationForbiddenForURLScheme(WKContextRef context, WKStringRef urlScheme);
WK_EXPORT void WKContextSetIconDatabasePath(WKContextRef context, WKStringRef iconDatabasePath);
// FIXME: These functions are only effective if called before the Web process is launched. But
// we should really change these settings to be on WebPreferences and changeable at runtime.
WK_EXPORT void WKContextSetDatabaseDirectory(WKContextRef context, WKStringRef databaseDirectory);
......
......@@ -40,6 +40,7 @@
#include "WebCoreArgumentCoders.h"
#include "WebDatabaseManagerProxy.h"
#include "WebGeolocationManagerProxy.h"
#include "WebIconDatabase.h"
#include "WebKeyValueStorageManagerProxy.h"
#include "WebPluginSiteDataManager.h"
#include "WebPageGroup.h"
......@@ -116,6 +117,7 @@ WebContext::WebContext(ProcessModel processModel, const String& injectedBundlePa
, m_cookieManagerProxy(WebCookieManagerProxy::create(this))
, m_databaseManagerProxy(WebDatabaseManagerProxy::create(this))
, m_geolocationManagerProxy(WebGeolocationManagerProxy::create(this))
, m_iconDatabase(WebIconDatabase::create(this))
, m_keyValueStorageManagerProxy(WebKeyValueStorageManagerProxy::create(this))
, m_pluginSiteDataManager(WebPluginSiteDataManager::create(this))
, m_resourceCacheManagerProxy(WebResourceCacheManagerProxy::create(this))
......@@ -147,11 +149,14 @@ WebContext::~WebContext()
m_cookieManagerProxy->invalidate();
m_cookieManagerProxy->clearContext();
m_databaseManagerProxy->invalidate();
m_databaseManagerProxy->clearContext();
m_geolocationManagerProxy->invalidate();
m_geolocationManagerProxy->clearContext();
m_databaseManagerProxy->invalidate();
m_databaseManagerProxy->clearContext();
m_iconDatabase->invalidate();
m_iconDatabase->clearContext();
m_keyValueStorageManagerProxy->invalidate();
m_keyValueStorageManagerProxy->clearContext();
......@@ -237,6 +242,8 @@ void WebContext::ensureWebProcess()
copyToVector(m_schemesToSetDomainRelaxationForbiddenFor, parameters.urlSchemesForWhichDomainRelaxationIsForbidden);
parameters.shouldAlwaysUseComplexTextCodePath = m_alwaysUsesComplexTextCodePath;
parameters.iconDatabaseEnabled = !iconDatabasePath().isEmpty();
parameters.textCheckerState = TextChecker::state();
......@@ -591,6 +598,11 @@ void WebContext::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Mes
m_geolocationManagerProxy->didReceiveMessage(connection, messageID, arguments);
return;
}
if (messageID.is<CoreIPC::MessageClassWebIconDatabase>()) {
m_iconDatabase->didReceiveMessage(connection, messageID, arguments);
return;
}
if (messageID.is<CoreIPC::MessageClassWebKeyValueStorageManagerProxy>()) {
m_keyValueStorageManagerProxy->didReceiveMessage(connection, messageID, arguments);
......@@ -632,6 +644,9 @@ CoreIPC::SyncReplyMode WebContext::didReceiveSyncMessage(CoreIPC::Connection* co
return CoreIPC::AutomaticReply;
}
if (messageID.is<CoreIPC::MessageClassWebIconDatabase>())
return m_iconDatabase->didReceiveSyncMessage(connection, messageID, arguments, reply);
switch (messageID.get<WebContextLegacyMessage::Kind>()) {
case WebContextLegacyMessage::PostSynchronousMessage: {
// FIXME: We should probably encode something in the case that the arguments do not decode correctly.
......@@ -730,6 +745,14 @@ String WebContext::databaseDirectory() const
return platformDefaultDatabaseDirectory();
}
String WebContext::iconDatabasePath() const
{
if (!m_overrideIconDatabasePath.isEmpty())
return m_overrideIconDatabasePath;
return platformDefaultIconDatabasePath();
}
String WebContext::localStorageDirectory() const
{
if (!m_overrideLocalStorageDirectory.isEmpty())
......
......@@ -49,6 +49,7 @@ class WebApplicationCacheManagerProxy;
class WebCookieManagerProxy;
class WebDatabaseManagerProxy;
class WebGeolocationManagerProxy;
class WebIconDatabase;
class WebKeyValueStorageManagerProxy;
class WebPageGroup;
class WebPageProxy;
......@@ -153,6 +154,7 @@ public:
static Statistics& statistics();
void setDatabaseDirectory(const String& dir) { m_overrideDatabaseDirectory = dir; }
void setIconDatabasePath(const String& path) { m_overrideIconDatabasePath = path; }
void setLocalStorageDirectory(const String& dir) { m_overrideLocalStorageDirectory = dir; }
void ensureWebProcess();
......@@ -190,6 +192,9 @@ private:
String databaseDirectory() const;
String platformDefaultDatabaseDirectory() const;
String iconDatabasePath() const;
String platformDefaultIconDatabasePath() const;
String localStorageDirectory() const;
String platformDefaultLocalStorageDirectory() const;
......@@ -232,6 +237,7 @@ private:
RefPtr<WebCookieManagerProxy> m_cookieManagerProxy;
RefPtr<WebDatabaseManagerProxy> m_databaseManagerProxy;
RefPtr<WebGeolocationManagerProxy> m_geolocationManagerProxy;
RefPtr<WebIconDatabase> m_iconDatabase;
RefPtr<WebKeyValueStorageManagerProxy> m_keyValueStorageManagerProxy;
RefPtr<WebPluginSiteDataManager> m_pluginSiteDataManager;
RefPtr<WebResourceCacheManagerProxy> m_resourceCacheManagerProxy;
......@@ -241,6 +247,7 @@ private:
#endif
String m_overrideDatabaseDirectory;
String m_overrideIconDatabasePath;
String m_overrideLocalStorageDirectory;
};
......
/*
* Copyright (C) 2011 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "WebIconDatabase.h"
#include "DataReference.h"
#include <wtf/text/WTFString.h>
namespace WebKit {
PassRefPtr<WebIconDatabase> WebIconDatabase::create(WebContext* context)
{
return adoptRef(new WebIconDatabase(context));
}
WebIconDatabase::~WebIconDatabase()
{
}
WebIconDatabase::WebIconDatabase(WebContext* context)
: m_webContext(context)
{
}
void WebIconDatabase::invalidate()
{
}
void WebIconDatabase::retainIconForPageURL(const String&)
{
}
void WebIconDatabase::releaseIconForPageURL(const String&)
{
}
void WebIconDatabase::setIconURLForPageURL(const String&, const String&)
{
}
void WebIconDatabase::setIconDataForIconURL(const CoreIPC::DataReference&, const String&)
{
}
void WebIconDatabase::iconDataForPageURL(const String&, CoreIPC::DataReference& iconData)
{
iconData = CoreIPC::DataReference();
}
void WebIconDatabase::iconURLForPageURL(const String&, String& iconURL)
{
iconURL = String();
}
void WebIconDatabase::iconDataKnownForIconURL(const String&, bool& iconDataKnown) const
{
iconDataKnown = false;
}
void WebIconDatabase::loadDecisionForIconURL(const String&, int& loadDecision) const
{
loadDecision = (int)WebCore::IconLoadNo;
}
void WebIconDatabase::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* decoder)
{
didReceiveWebIconDatabaseMessage(connection, messageID, decoder);
}
CoreIPC::SyncReplyMode WebIconDatabase::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* decoder, CoreIPC::ArgumentEncoder* reply)
{
return didReceiveSyncWebIconDatabaseMessage(connection, messageID, decoder, reply);
}
} // namespace WebKit
/*
* Copyright (C) 2011 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WebIconDatabase_h
#define WebIconDatabase_h
#include "APIObject.h"
#include "Connection.h"
#include <WebCore/IconDatabaseBase.h>
#include <wtf/Forward.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
namespace CoreIPC {
class ArgumentDecoder;
class DataReference;
class MessageID;
}
namespace WebKit {
class WebContext;
class WebIconDatabase : public APIObject {
public:
static const Type APIType = TypeIconDatabase;
static PassRefPtr<WebIconDatabase> create(WebContext*);
virtual ~WebIconDatabase();
void invalidate();
void clearContext() { m_webContext = 0; }
void retainIconForPageURL(const String&);
void releaseIconForPageURL(const String&);
void setIconURLForPageURL(const String&, const String&);
void setIconDataForIconURL(const CoreIPC::DataReference&, const String&);
void iconDataForPageURL(const String&, CoreIPC::DataReference&);
void iconURLForPageURL(const String&, String&);
void iconDataKnownForIconURL(const String&, bool&) const;
void loadDecisionForIconURL(const String&, int&) const;
void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
CoreIPC::SyncReplyMode didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
private:
WebIconDatabase(WebContext*);
virtual Type type() const { return APIType; }
void didReceiveWebIconDatabaseMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
CoreIPC::SyncReplyMode didReceiveSyncWebIconDatabaseMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
WebContext* m_webContext;
};
} // namespace WebKit
#endif // WebIconDatabase_h
# Copyright (C) 2011 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
messages -> WebIconDatabase {
IconDataForPageURL(WTF::String pageURL) -> (CoreIPC::DataReference iconData)
RetainIconForPageURL(WTF::String pageURL)
ReleaseIconForPageURL(WTF::String pageURL)
IconURLForPageURL(WTF::String pageURL) -> (WTF::String iconURL)
IconDataKnownForIconURL(WTF::String iconURL) -> (bool dataKnown)
LoadDecisionForIconURL(WTF::String iconURL) -> (int loadDecision)
SetIconURLForPageURL(WTF::String iconURL, WTF::String pageURL)
SetIconDataForIconURL(CoreIPC::DataReference iconData, WTF::String iconURL)
}
......@@ -252,6 +252,7 @@ void WebProcessProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC
|| messageID.is<CoreIPC::MessageClassWebCookieManagerProxy>()
|| messageID.is<CoreIPC::MessageClassWebDatabaseManagerProxy>()
|| messageID.is<CoreIPC::MessageClassWebGeolocationManagerProxy>()
|| messageID.is<CoreIPC::MessageClassWebIconDatabase>()
|| messageID.is<CoreIPC::MessageClassWebKeyValueStorageManagerProxy>()
|| messageID.is<CoreIPC::MessageClassWebResourceCacheManagerProxy>()) {
m_context->didReceiveMessage(connection, messageID, arguments);
......@@ -290,7 +291,8 @@ CoreIPC::SyncReplyMode WebProcessProxy::didReceiveSyncMessage(CoreIPC::Connectio
}
#endif
if (messageID.is<CoreIPC::MessageClassWebContext>() || messageID.is<CoreIPC::MessageClassWebContextLegacy>() || messageID.is<CoreIPC::MessageClassDownloadProxy>())
if (messageID.is<CoreIPC::MessageClassWebContext>() || messageID.is<CoreIPC::MessageClassWebContextLegacy>()
|| messageID.is<CoreIPC::MessageClassDownloadProxy>() || messageID.is<CoreIPC::MessageClassWebIconDatabase>())
return m_context->didReceiveSyncMessage(connection, messageID, arguments, reply);
uint64_t pageID = arguments->destinationID();
......
......@@ -46,6 +46,12 @@ String WebContext::platformDefaultDatabaseDirectory() const
return WTF::String::fromUTF8(g_build_filename(g_get_user_data_dir(), "webkit", "databases", NULL));
}
String WebContext::platformDefaultIconDatabasePath() const
{
// FIXME: Implement.
return WTF::String();
}
String WebContext::platformDefaultLocalStorageDirectory() const
{
return WTF::String::fromUTF8(g_build_filename(g_get_user_data_dir(), "webkit", "localstorage", NULL));
......
......@@ -37,6 +37,9 @@ NSString *WebDatabaseDirectoryDefaultsKey = @"WebDatabaseDirectory";
NSString *WebKitLocalCacheDefaultsKey = @"WebKitLocalCache";
NSString *WebStorageDirectoryDefaultsKey = @"WebKitLocalStorageDatabasePathPreferenceKey";
// FIXME: <rdar://problem/9138817> - After this "backwards compatibility" radar is removed, this code should be removed to only return an empty String.
NSString *WebIconDatabaseDirectoryDefaultsKey = @"WebIconDatabaseDirectoryDefaultsKey";
namespace WebKit {
String WebContext::applicationCacheDirectory()
......@@ -108,6 +111,15 @@ String WebContext::platformDefaultDatabaseDirectory() const
return [databasesDirectory stringByStandardizingPath];
}
String WebContext::platformDefaultIconDatabasePath() const
{
// FIXME: <rdar://problem/9138817> - After this "backwards compatibility" radar is removed, this code should be removed to only return an empty String.
NSString *databasesDirectory = [[NSUserDefaults standardUserDefaults] objectForKey:WebIconDatabaseDirectoryDefaultsKey];
if (!databasesDirectory || ![databasesDirectory isKindOfClass:[NSString class]])
databasesDirectory = @"~/Library/Icons/WebpageIcons.db";
return [databasesDirectory stringByStandardizingPath];
}
String WebContext::platformDefaultLocalStorageDirectory() const
{
NSString *localStorageDirectory = [[NSUserDefaults standardUserDefaults] objectForKey:WebStorageDirectoryDefaultsKey];
......
......@@ -53,6 +53,12 @@ String WebContext::platformDefaultDatabaseDirectory() const
return "";
}
String WebContext::platformDefaultIconDatabasePath() const
{
// FIXME: Implement.
return "";
}
String WebContext::platformDefaultLocalStorageDirectory() const
{
// FIXME: Implement.
......
......@@ -81,6 +81,12 @@ String WebContext::platformDefaultDatabaseDirectory() const
return WebCore::pathByAppendingComponent(WebCore::localUserSpecificStorageDirectory(), "Databases");
}
String WebContext::platformDefaultIconDatabasePath() const
{
// IconDatabase should be disabled by default on Windows, and should therefore have no default path.
return String();
}
String WebContext::platformDefaultLocalStorageDirectory() const
{
return WebCore::pathByAppendingComponent(WebCore::localUserSpecificStorageDirectory(), "LocalStorage");
......
......@@ -45,6 +45,7 @@ WEBKIT2_INCLUDEPATH = \
$$SOURCE_DIR/WebKit2/WebProcess/Downloads/qt \
$$SOURCE_DIR/WebKit2/WebProcess/FullScreen \
$$SOURCE_DIR/WebKit2/WebProcess/Geolocation \
$$SOURCE_DIR/WebKit2/WebProcess/IconDatabase \
$$SOURCE_DIR/WebKit2/WebProcess/InjectedBundle \
$$SOURCE_DIR/WebKit2/WebProcess/InjectedBundle/DOM \
$$SOURCE_DIR/WebKit2/WebProcess/InjectedBundle/API/c \
......
......@@ -37,6 +37,8 @@ WEBKIT2_GENERATED_HEADERS = \
$$WEBKIT2_GENERATED_SOURCES_DIR/WebFullScreenManagerProxyMessages.h \
$$WEBKIT2_GENERATED_SOURCES_DIR/WebGeolocationManagerMessages.h \
$$WEBKIT2_GENERATED_SOURCES_DIR/WebGeolocationManagerProxyMessages.h \
$$WEBKIT2_GENERATED_SOURCES_DIR/WebIconDatabaseMessages.h \
$$WEBKIT2_GENERATED_SOURCES_DIR/WebIconDatabaseProxyMessages.h \
$$WEBKIT2_GENERATED_SOURCES_DIR/WebInspectorMessages.h \
$$WEBKIT2_GENERATED_SOURCES_DIR/WebInspectorProxyMessages.h \
$$WEBKIT2_GENERATED_SOURCES_DIR/WebKeyValueStorageManagerMessages.h \
......@@ -68,6 +70,8 @@ WEBKIT2_GENERATED_SOURCES = \
$$WEBKIT2_GENERATED_SOURCES_DIR/WebFullScreenManagerProxyMessageReceiver.cpp \
$$WEBKIT2_GENERATED_SOURCES_DIR/WebGeolocationManagerMessageReceiver.cpp \
$$WEBKIT2_GENERATED_SOURCES_DIR/WebGeolocationManagerProxyMessageReceiver.cpp \
$$WEBKIT2_GENERATED_SOURCES_DIR/WebIconDatabaseMessageReceiver.cpp \
$$WEBKIT2_GENERATED_SOURCES_DIR/WebIconDatabaseProxyMessageReceiver.cpp \
$$WEBKIT2_GENERATED_SOURCES_DIR/WebInspectorMessageReceiver.cpp \
$$WEBKIT2_GENERATED_SOURCES_DIR/WebInspectorProxyMessageReceiver.cpp \
$$WEBKIT2_GENERATED_SOURCES_DIR/WebKeyValueStorageManagerMessageReceiver.cpp \
......@@ -198,6 +202,7 @@ HEADERS += \
UIProcess/WebGeolocationManagerProxy.h \
UIProcess/WebGeolocationProvider.h \
UIProcess/WebHistoryClient.h \
UIProcess/WebIconDatabase.h \
UIProcess/WebInspectorProxy.h \
UIProcess/WebKeyValueStorageManagerProxy.h \
UIProcess/WebLoaderClient.h \
......@@ -222,6 +227,7 @@ HEADERS += \
WebProcess/FullScreen/WebFullScreenManager.h \
WebProcess/Geolocation/GeolocationPermissionRequestManager.h \
WebProcess/Geolocation/WebGeolocationManager.h \
WebProcess/IconDatabase/WebIconDatabaseProxy.h \
WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h \
WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h \
WebProcess/InjectedBundle/InjectedBundle.h \
......@@ -390,6 +396,7 @@ SOURCES += \
UIProcess/WebGeolocationManagerProxy.cpp \
UIProcess/WebGeolocationProvider.cpp \
UIProcess/WebHistoryClient.cpp \
UIProcess/WebIconDatabase.cpp \
UIProcess/WebInspectorProxy.cpp \
UIProcess/WebKeyValueStorageManagerProxy.cpp \
UIProcess/WebLoaderClient.cpp \
......@@ -419,10 +426,11 @@ SOURCES += \
WebProcess/Cookies/WebCookieManager.cpp \
WebProcess/Downloads/Download.cpp \
WebProcess/Downloads/DownloadManager.cpp \
WebProcess/Downloads/qt/DownloadQt.cpp \
WebProcess/FullScreen/WebFullScreenManager.cpp \
WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp \
WebProcess/Geolocation/WebGeolocationManager.cpp \
WebProcess/Downloads/qt/DownloadQt.cpp \
WebProcess/IconDatabase/WebIconDatabaseProxy.cpp \
WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp \
WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp \
WebProcess/InjectedBundle/InjectedBundle.cpp \
......
/*
* Copyright (C) 2011 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "WebIconDatabaseProxy.h"
#include "DataReference.h"
#include "MessageID.h"
#include "WebIconDatabaseMessages.h"
#include "WebProcess.h"
#include <WebCore/SharedBuffer.h>
#include <wtf/text/WTFString.h>
using namespace WebCore;
namespace WebKit {
WebIconDatabaseProxy::~WebIconDatabaseProxy()
{
}
WebIconDatabaseProxy::WebIconDatabaseProxy(WebProcess* process)
: m_isEnabled(false)
, m_process(process)
{
}
bool WebIconDatabaseProxy::isEnabled() const
{
return m_isEnabled;
}
void WebIconDatabaseProxy::setEnabled(bool enabled)
{
if (enabled == m_isEnabled)
return;
m_isEnabled = enabled;
setGlobalIconDatabase(enabled ? this : 0);
}
Image* WebIconDatabaseProxy::iconForPageURL(const String& pageURL, const IntSize& size)
{
CoreIPC::DataReference result;
if (!m_process->connection()->sendSync(Messages::WebIconDatabase::IconDataForPageURL(pageURL), Messages::WebIconDatabase::IconDataForPageURL::Reply(result), 0))
return 0;
// FIXME: Return Image created with the above data.
return 0;
}
void WebIconDatabaseProxy::retainIconForPageURL(const String& pageURL)
{
m_process->connection()->send(Messages::WebIconDatabase::RetainIconForPageURL(pageURL), 0);
}
void WebIconDatabaseProxy::releaseIconForPageURL(const String& pageURL)
{
m_process->connection()->send(Messages::WebIconDatabase::ReleaseIconForPageURL(pageURL), 0);
}
String WebIconDatabaseProxy::iconURLForPageURL(const String& pageURL)
{
// FIXME: This needs to ask the UI process for the iconURL, but it can't do so synchronously because it will slow down page loading.
// The parts in WebCore that need this data will have to be changed to work asycnchronously.
return String();
}
bool WebIconDatabaseProxy::iconDataKnownForIconURL(const String& iconURL)
{
// FIXME: This needs to ask the UI process for the iconURL, but it can't do so synchronously because it will slow down page loading.
// The parts in WebCore that need this data will have to be changed to work asycnchronously.
return false;
}
IconLoadDecision WebIconDatabaseProxy::loadDecisionForIconURL(const String& iconURL, DocumentLoader* documentLoader)
{
// FIXME: This needs to ask the UI process for the iconURL, but it can't do so synchronously because it will slow down page loading.
// The parts in WebCore that need this data will have to be changed to work asycnchronously.
return IconLoadNo;
}
void WebIconDatabaseProxy::setIconURLForPageURL(const String& iconURL, const String& pageURL)
{
m_process->connection()->send(Messages::WebIconDatabase::SetIconURLForPageURL(iconURL, pageURL), 0);
}
void WebIconDatabaseProxy::setIconDataForIconURL(PassRefPtr<SharedBuffer> iconData, const String& iconURL)
{
CoreIPC::DataReference data(reinterpret_cast<const uint8_t*>(iconData->data()), iconData->size());
m_process->connection()->send(Messages::WebIconDatabase::SetIconDataForIconURL(data, iconURL), 0);
}
void WebIconDatabaseProxy::urlImportFinished()
{
}
void WebIconDatabaseProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
{
didReceiveWebIconDatabaseProxyMessage(connection, messageID, arguments);
}
} // namespace WebKit
/*
* Copyright (C) 2011 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WebIconDatabaseProxy_h
#define WebIconDatabaseProxy_h
#include "APIObject.h"
#include <WebCore/IconDatabaseBase.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
namespace CoreIPC {
class ArgumentDecoder;
class Connection;
class MessageID;
}
namespace WebKit {
class WebProcess;
class WebIconDatabaseProxy : public WebCore::IconDatabaseBase {
public:
explicit WebIconDatabaseProxy(WebProcess*);
virtual ~WebIconDatabaseProxy();
virtual bool isEnabled() const;
void setEnabled(bool);
virtual WebCore::Image* iconForPageURL(const String&, const WebCore::IntSize&);
virtual void retainIconForPageURL(const String&);
virtual void releaseIconForPageURL(const String&);
virtual String iconURLForPageURL(const String&);
virtual bool iconDataKnownForIconURL(const String&);
virtual WebCore::IconLoadDecision loadDecisionForIconURL(const String&, WebCore::DocumentLoader*);
virtual void setIconURLForPageURL(const String&, const String&);
virtual void setIconDataForIconURL(PassRefPtr<WebCore::SharedBuffer>, const String&);
void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
private:
void didReceiveWebIconDatabaseProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
// Callbacks from the UIProcess
void urlImportFinished();
bool m_isEnabled;
WebProcess* m_process;
};
} // namespace WebKit
#endif // WebIconDatabaseProxy_h
# Copyright (C) 2011 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
messages -> WebIconDatabaseProxy {
URLImportFinished()
}
......@@ -127,6 +127,7 @@ WebProcess::WebProcess()
#endif
, m_textCheckerState()
, m_geolocationManager(this)
, m_iconDatabaseProxy(this)
{
#if USE(PLATFORM_STRATEGIES)
// Initialize our platform strategies.
......@@ -176,6 +177,10 @@ void WebProcess::initializeWebProcess(const WebProcessCreationParameters& parame
WebDatabaseManager::initialize(parameters.databaseDirectory);
#endif
#if ENABLE(ICONDATABASE)
m_iconDatabaseProxy.setEnabled(parameters.iconDatabaseEnabled);
#endif
#if ENABLE(DOM_STORAGE)
StorageTracker::initializeTracker(parameters.localStorageDirectory);
m_localStorageDirectory = parameters.localStorageDirectory;
......@@ -582,6 +587,11 @@ void WebProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Mes
return;
}
if (messageID.is<CoreIPC::MessageClassWebIconDatabaseProxy>()) {
m_iconDatabaseProxy.didReceiveMessage(connection, messageID, arguments);
return;
}
if (messageID.is<CoreIPC::MessageClassWebKeyValueStorageManager>()) {
WebKeyValueStorageManager::shared().didReceiveMessage(connection, messageID, arguments);
return;
......
......@@ -35,6 +35,7 @@
#include "TextCheckerState.h"
#include "VisitedLinkTable.h"
#include "WebGeolocationManager.h"
#include "WebIconDatabaseProxy.h"
#include "WebPageGroupProxy.h"
#include <WebCore/LinkHash.h>
#include <wtf/Forward.h>
......@@ -206,6 +207,7 @@ private:
TextCheckerState m_textCheckerState;
WebGeolocationManager m_geolocationManager;
WebIconDatabaseProxy m_iconDatabaseProxy;
String m_localStorageDirectory;
};
......
......@@ -1442,6 +1442,22 @@
>
</File>
</Filter>
<Filter
Name="IconDatabase"
>
<File
RelativePath="..\WebProcess\IconDatabase\WebIconDatabaseProxy.cpp"
>
</File>
<File
RelativePath="..\WebProcess\IconDatabase\WebIconDatabaseProxy.h"
>
</File>
<File
RelativePath="..\WebProcess\IconDatabase\WebIconDatabaseProxy.messages.in"
>
</File>
</Filter>
<Filter
Name="KeyValueStorage"
>
......@@ -2578,6 +2594,18 @@
RelativePath="..\UIProcess\WebHistoryClient.h"
>
</File>
<File
RelativePath="..\UIProcess\WebIconDatabase.cpp"
>
</File>
<File
RelativePath="..\UIProcess\WebIconDatabase.h"
>
</File>
<File
RelativePath="..\UIProcess\WebIconDatabase.messages.in"
>
</File>
<File
RelativePath="..\UIProcess\WebInspectorProxy.cpp"
>
......@@ -3622,6 +3650,22 @@
RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebGeolocationManagerProxyMessages.h"
>
</File>
<File
RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebIconDatabaseMessageReceiver.cpp"
>
</File>
<File
RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebIconDatabaseMessages.h"
>
</File>
<File
RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebIconDatabaseProxyMessageReceiver.cpp"
>
</File>
<File
RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebIconDatabaseProxyMessages.h"
>
</File>
<File
RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebInspectorMessageReceiver.cpp"
>
......
......@@ -6,7 +6,7 @@
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(ProjectDir)&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)\..\Platform&quot;;&quot;$(ProjectDir)\..\Platform\cg&quot;;&quot;$(ProjectDir)\..\Platform\CoreIPC&quot;;&quot;$(ProjectDir)\..\PluginProcess&quot;;&quot;$(ProjectDir)\..\Shared&quot;;&quot;$(ProjectDir)\..\Shared\win&quot;;&quot;$(ProjectDir)\..\Shared\cf&quot;;&quot;$(ProjectDir)\..\Shared\API\c&quot;;&quot;$(ProjectDir)\..\Shared\API\c\cf&quot;;&quot;$(ProjectDir)\..\Shared\API\c\win&quot;;&quot;$(ProjectDir)\..\Shared\CoreIPCSupport&quot;;&quot;$(ProjectDir)\..\Shared\Plugins&quot;;&quot;$(ProjectDir)\..\Shared\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\UIProcess&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C\win&quot;;&quot;$(ProjectDir)\..\UIProcess\API\cpp&quot;;&quot;$(ProjectDir)\..\UIProcess\API\win&quot;;&quot;$(ProjectDir)\..\UIProcess\Authentication&quot;;&quot;$(ProjectDir)\..\UIProcess\Downloads&quot;;&quot;$(ProjectDir)\..\UIProcess\Launcher&quot;;&quot;$(ProjectDir)\..\UIProcess\Plugins&quot;;&quot;$(ProjectDir)\..\UIProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport\win&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage\win&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\API\c&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\DOM&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\win&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\WebProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess\ApplicationCache&quot;;&quot;$(ProjectDir)\..\WebProcess\Authentication&quot;;&quot;$(ProjectDir)\..\WebProcess\Cookies&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads\cf&quot;;&quot;$(ProjectDir)\..\WebProcess\FullScreen&quot;;&quot;$(ProjectDir)\..\WebProcess\Geolocation&quot;;&quot;$(ProjectDir)\..\WebProcess\KeyValueStorage&quot;;&quot;$(ProjectDir)\..\WebProcess\ResourceCache&quot;;&quot;$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources&quot;;&quot;$(ConfigurationBuildDir)\Include&quot;;&quot;$(ConfigurationBuildDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include\pthreads&quot;;&quot;$(ConfigurationBuildDir)\Include\JavaScriptCore&quot;;&quot;$(ConfigurationBuildDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\private\JavaScriptCore&quot;;&quot;$(ConfigurationBuildDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;"
AdditionalIncludeDirectories="&quot;$(ProjectDir)&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)\..\Platform&quot;;&quot;$(ProjectDir)\..\Platform\cg&quot;;&quot;$(ProjectDir)\..\Platform\CoreIPC&quot;;&quot;$(ProjectDir)\..\PluginProcess&quot;;&quot;$(ProjectDir)\..\Shared&quot;;&quot;$(ProjectDir)\..\Shared\win&quot;;&quot;$(ProjectDir)\..\Shared\cf&quot;;&quot;$(ProjectDir)\..\Shared\API\c&quot;;&quot;$(ProjectDir)\..\Shared\API\c\cf&quot;;&quot;$(ProjectDir)\..\Shared\API\c\win&quot;;&quot;$(ProjectDir)\..\Shared\CoreIPCSupport&quot;;&quot;$(ProjectDir)\..\Shared\Plugins&quot;;&quot;$(ProjectDir)\..\Shared\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\UIProcess&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C\win&quot;;&quot;$(ProjectDir)\..\UIProcess\API\cpp&quot;;&quot;$(ProjectDir)\..\UIProcess\API\win&quot;;&quot;$(ProjectDir)\..\UIProcess\Authentication&quot;;&quot;$(ProjectDir)\..\UIProcess\Downloads&quot;;&quot;$(ProjectDir)\..\UIProcess\Launcher&quot;;&quot;$(ProjectDir)\..\UIProcess\Plugins&quot;;&quot;$(ProjectDir)\..\UIProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport\win&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage\win&quot;;&quot;$(ProjectDir)\..\WebProcess\IconDatabase&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\API\c&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\DOM&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\win&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\WebProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess\ApplicationCache&quot;;&quot;$(ProjectDir)\..\WebProcess\Authentication&quot;;&quot;$(ProjectDir)\..\WebProcess\Cookies&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads\cf&quot;;&quot;$(ProjectDir)\..\WebProcess\FullScreen&quot;;&quot;$(ProjectDir)\..\WebProcess\Geolocation&quot;;&quot;$(ProjectDir)\..\WebProcess\KeyValueStorage&quot;;&quot;$(ProjectDir)\..\WebProcess\ResourceCache&quot;;&quot;$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources&quot;;&quot;$(ConfigurationBuildDir)\Include&quot;;&quot;$(ConfigurationBuildDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include\pthreads&quot;;&quot;$(ConfigurationBuildDir)\Include\JavaScriptCore&quot;;&quot;$(ConfigurationBuildDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\private\JavaScriptCore&quot;;&quot;$(ConfigurationBuildDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;"
PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;BUILDING_WEBKIT"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="WebKit2Prefix.h"
......
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