Commit 4a633ad7 authored by beidson@apple.com's avatar beidson@apple.com

2010-08-02 Brady Eidson <beidson@apple.com>

        Reviewed by Anders Carlsson.

        Basic WK2 visited link coloring
        https://bugs.webkit.org/show_bug.cgi?id=43377

        No new tests. (No change in behavior)

        * WebCore.exp.in:
        
        * page/PageGroup.cpp:
        (WebCore::PageGroup::addVisitedLinkHash):
        * page/PageGroup.h:
2010-08-02  Brady Eidson  <beidson@apple.com>

        Reviewed by Anders Carlsson.

        Basic WK2 visited link coloring
        https://bugs.webkit.org/show_bug.cgi?id=43377

        Add simple API that allows the WK2 app to add 1 visited link at a time.
        For now, this just pipes each individual LinkHash down to WebCore.
        
        * Shared/CoreIPCSupport/WebProcessMessageKinds.h:
        (WebProcessMessage::):

        * UIProcess/API/C/WKContext.cpp:
        (WKContextAddVisitedLink):
        * UIProcess/API/C/WKContext.h:

        * UIProcess/WebContext.cpp:
        (WebKit::WebContext::addVisitedLink):
        * UIProcess/WebContext.h:

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::addVisitedLinkHash):
        (WebKit::WebProcess::didReceiveMessage):
        * WebProcess/WebProcess.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64492 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 94ae4410
2010-08-02 Brady Eidson <beidson@apple.com>
Reviewed by Anders Carlsson.
Basic WK2 visited link coloring
https://bugs.webkit.org/show_bug.cgi?id=43377
No new tests. (No change in behavior)
* WebCore.exp.in:
* page/PageGroup.cpp:
(WebCore::PageGroup::addVisitedLinkHash):
* page/PageGroup.h:
2010-08-02 Martin Robinson <mrobinson@igalia.com>
Reviewed by Xan Lopez.
......@@ -361,6 +361,7 @@ __ZN7WebCore15StringTruncator5widthERKNS_6StringERKNS_4FontEb
__ZN7WebCore15VisiblePositionC1EPNS_4NodeEiNS_9EAffinityE
__ZN7WebCore15VisiblePositionC1ERKNS_8PositionENS_9EAffinityE
__ZN7WebCore15reportExceptionEPN3JSC9ExecStateENS0_7JSValueE
__ZN7WebCore15visitedLinkHashEPKtj
__ZN7WebCore16AbstractDatabase14setIsAvailableEb
__ZN7WebCore16FontFallbackList15releaseFontDataEv
__ZN7WebCore16FontPlatformDataC1EP6NSFontbb
......@@ -814,6 +815,7 @@ __ZN7WebCore9PageCache11setCapacityEi
__ZN7WebCore9PageCache27releaseAutoreleasedPagesNowEv
__ZN7WebCore9PageGroup14addVisitedLinkEPKtm
__ZN7WebCore9PageGroup17closeLocalStorageEv
__ZN7WebCore9PageGroup18addVisitedLinkHashEy
__ZN7WebCore9PageGroup20addUserScriptToWorldEPNS_15DOMWrapperWorldERKNS_6StringERKNS_4KURLEN3WTF10PassOwnPtrINS9_6VectorIS3_Lm0EEEEESD_NS_23UserScriptInjectionTimeENS_25UserContentInjectedFramesE
__ZN7WebCore9PageGroup20removeAllUserContentEv
__ZN7WebCore9PageGroup21removeAllVisitedLinksEv
......
......@@ -136,6 +136,11 @@ bool PageGroup::isLinkVisited(LinkHash visitedLinkHash)
#endif
}
void PageGroup::addVisitedLinkHash(LinkHash hash)
{
addVisitedLink(hash);
}
inline void PageGroup::addVisitedLink(LinkHash hash)
{
ASSERT(shouldTrackVisitedLinks);
......
......@@ -58,6 +58,7 @@ namespace WebCore {
void addVisitedLink(const KURL&);
void addVisitedLink(const UChar*, size_t);
void addVisitedLinkHash(LinkHash);
void removeVisitedLinks();
static void setShouldTrackVisitedLinks(bool);
......
2010-08-02 Brady Eidson <beidson@apple.com>
Reviewed by Anders Carlsson.
Basic WK2 visited link coloring
https://bugs.webkit.org/show_bug.cgi?id=43377
Add simple API that allows the WK2 app to add 1 visited link at a time.
For now, this just pipes each individual LinkHash down to WebCore.
* Shared/CoreIPCSupport/WebProcessMessageKinds.h:
(WebProcessMessage::):
* UIProcess/API/C/WKContext.cpp:
(WKContextAddVisitedLink):
* UIProcess/API/C/WKContext.h:
* UIProcess/WebContext.cpp:
(WebKit::WebContext::addVisitedLink):
* UIProcess/WebContext.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::addVisitedLinkHash):
(WebKit::WebProcess::didReceiveMessage):
* WebProcess/WebProcess.h:
2010-08-02 Darin Adler <darin@apple.com>
Reviewed by Sam Weinig.
......
......@@ -33,6 +33,7 @@
namespace WebProcessMessage {
enum Kind {
AddVisitedLink,
LoadInjectedBundle,
SetApplicationCacheDirectory,
SetShouldTrackVisitedLinks,
......
......@@ -94,6 +94,11 @@ void WKContextGetStatistics(WKContextRef contextRef, WKContextStatistics* statis
toWK(contextRef)->getStatistics(statistics);
}
void WKContextAddVisitedLink(WKContextRef contextRef, WKStringRef visitedURL)
{
toWK(contextRef)->addVisitedLink(toWK(visitedURL)->string());
}
WKContextRef WKContextRetain(WKContextRef contextRef)
{
toWK(contextRef)->ref();
......
......@@ -74,6 +74,8 @@ WK_EXPORT void WKContextSetInjectedBundleClient(WKContextRef context, const WKCo
WK_EXPORT void WKContextPostMessageToInjectedBundle(WKContextRef context, WKStringRef messageName, WKTypeRef messageBody);
WK_EXPORT void WKContextAddVisitedLink(WKContextRef context, WKStringRef visitedURL);
WK_EXPORT WKContextRef WKContextRetain(WKContextRef context);
WK_EXPORT void WKContextRelease(WKContextRef context);
......
......@@ -39,6 +39,8 @@
#include "WKContextPrivate.h"
#include <WebCore/LinkHash.h>
#ifndef NDEBUG
#include <wtf/RefCountedLeakCounter.h>
#endif
......@@ -364,6 +366,15 @@ void WebContext::registerURLSchemeAsEmptyDocument(const String& urlScheme)
m_process->send(WebProcessMessage::RegisterURLSchemeAsEmptyDocument, 0, CoreIPC::In(urlScheme));
}
void WebContext::addVisitedLink(const String& visitedURL)
{
if (visitedURL.isEmpty())
return;
WebCore::LinkHash hash = visitedLinkHash(visitedURL.characters(), visitedURL.length());
m_process->send(WebProcessMessage::AddVisitedLink, 0, CoreIPC::In(hash));
}
void WebContext::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder& arguments)
{
switch (messageID.get<WebContextMessage::Kind>()) {
......
......@@ -99,6 +99,8 @@ public:
WebCore::String applicationCacheDirectory();
void registerURLSchemeAsEmptyDocument(const WebCore::String&);
void addVisitedLink(const WebCore::String&);
void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder&);
......
......@@ -110,6 +110,17 @@ void WebProcess::registerURLSchemeAsEmptyDocument(const WebCore::String& urlSche
SchemeRegistry::registerURLSchemeAsEmptyDocument(urlScheme);
}
void WebProcess::addVisitedLinkHash(WebCore::LinkHash hash)
{
PageGroup* group = PageGroup::pageGroup("WebKit2Group");
ASSERT(group);
if (!group) {
printf("Cannot find PageGroup named 'WebKit2Group'\n");
return;
}
group->addVisitedLinkHash(hash);
}
WebPage* WebProcess::webPage(uint64_t pageID) const
{
return m_pageMap.get(pageID).get();
......@@ -166,6 +177,14 @@ void WebProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Mes
{
if (messageID.is<CoreIPC::MessageClassWebProcess>()) {
switch (messageID.get<WebProcessMessage::Kind>()) {
case WebProcessMessage::AddVisitedLink: {
WebCore::LinkHash hash;
if (!arguments->decode(CoreIPC::Out(hash)))
return;
addVisitedLinkHash(hash);
return;
}
case WebProcessMessage::LoadInjectedBundle: {
String path;
......
......@@ -28,6 +28,7 @@
#include "Connection.h"
#include "DrawingArea.h"
#include <WebCore/LinkHash.h>
#include <wtf/HashMap.h>
namespace WebCore {
......@@ -73,6 +74,7 @@ private:
#endif
void setApplicationCacheDirectory(const WebCore::String&);
void registerURLSchemeAsEmptyDocument(const WebCore::String&);
void addVisitedLinkHash(WebCore::LinkHash);
// CoreIPC::Connection::Client
void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
......
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