Changeset 64492 in webkit


Ignore:
Timestamp:
Aug 2, 2010 2:10:52 PM (14 years ago)
Author:
beidson@apple.com
Message:

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:
Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r64490 r64492  
     12010-08-02  Brady Eidson  <beidson@apple.com>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        Basic WK2 visited link coloring
     6        https://bugs.webkit.org/show_bug.cgi?id=43377
     7
     8        No new tests. (No change in behavior)
     9
     10        * WebCore.exp.in:
     11       
     12        * page/PageGroup.cpp:
     13        (WebCore::PageGroup::addVisitedLinkHash):
     14        * page/PageGroup.h:
     15
    1162010-08-02  Martin Robinson  <mrobinson@igalia.com>
    217
  • trunk/WebCore/WebCore.exp.in

    r64462 r64492  
    362362__ZN7WebCore15VisiblePositionC1ERKNS_8PositionENS_9EAffinityE
    363363__ZN7WebCore15reportExceptionEPN3JSC9ExecStateENS0_7JSValueE
     364__ZN7WebCore15visitedLinkHashEPKtj
    364365__ZN7WebCore16AbstractDatabase14setIsAvailableEb
    365366__ZN7WebCore16FontFallbackList15releaseFontDataEv
     
    815816__ZN7WebCore9PageGroup14addVisitedLinkEPKtm
    816817__ZN7WebCore9PageGroup17closeLocalStorageEv
     818__ZN7WebCore9PageGroup18addVisitedLinkHashEy
    817819__ZN7WebCore9PageGroup20addUserScriptToWorldEPNS_15DOMWrapperWorldERKNS_6StringERKNS_4KURLEN3WTF10PassOwnPtrINS9_6VectorIS3_Lm0EEEEESD_NS_23UserScriptInjectionTimeENS_25UserContentInjectedFramesE
    818820__ZN7WebCore9PageGroup20removeAllUserContentEv
  • trunk/WebCore/page/PageGroup.cpp

    r64344 r64492  
    137137}
    138138
     139void PageGroup::addVisitedLinkHash(LinkHash hash)
     140{
     141    addVisitedLink(hash);
     142}
     143
    139144inline void PageGroup::addVisitedLink(LinkHash hash)
    140145{
  • trunk/WebCore/page/PageGroup.h

    r64344 r64492  
    5959        void addVisitedLink(const KURL&);
    6060        void addVisitedLink(const UChar*, size_t);
     61        void addVisitedLinkHash(LinkHash);
    6162        void removeVisitedLinks();
    6263
  • trunk/WebKit2/ChangeLog

    r64487 r64492  
     12010-08-02  Brady Eidson  <beidson@apple.com>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        Basic WK2 visited link coloring
     6        https://bugs.webkit.org/show_bug.cgi?id=43377
     7
     8        Add simple API that allows the WK2 app to add 1 visited link at a time.
     9        For now, this just pipes each individual LinkHash down to WebCore.
     10       
     11        * Shared/CoreIPCSupport/WebProcessMessageKinds.h:
     12        (WebProcessMessage::):
     13
     14        * UIProcess/API/C/WKContext.cpp:
     15        (WKContextAddVisitedLink):
     16        * UIProcess/API/C/WKContext.h:
     17
     18        * UIProcess/WebContext.cpp:
     19        (WebKit::WebContext::addVisitedLink):
     20        * UIProcess/WebContext.h:
     21
     22        * WebProcess/WebProcess.cpp:
     23        (WebKit::WebProcess::addVisitedLinkHash):
     24        (WebKit::WebProcess::didReceiveMessage):
     25        * WebProcess/WebProcess.h:
     26
    1272010-08-02  Darin Adler  <darin@apple.com>
    228
  • trunk/WebKit2/Shared/CoreIPCSupport/WebProcessMessageKinds.h

    r64380 r64492  
    3434
    3535enum Kind {
     36    AddVisitedLink,
    3637    LoadInjectedBundle,
    3738    SetApplicationCacheDirectory,
  • trunk/WebKit2/UIProcess/API/C/WKContext.cpp

    r64386 r64492  
    9595}
    9696
     97void WKContextAddVisitedLink(WKContextRef contextRef, WKStringRef visitedURL)
     98{
     99    toWK(contextRef)->addVisitedLink(toWK(visitedURL)->string());
     100}
     101
    97102WKContextRef WKContextRetain(WKContextRef contextRef)
    98103{
  • trunk/WebKit2/UIProcess/API/C/WKContext.h

    r64396 r64492  
    7575WK_EXPORT void WKContextPostMessageToInjectedBundle(WKContextRef context, WKStringRef messageName, WKTypeRef messageBody);
    7676
     77WK_EXPORT void WKContextAddVisitedLink(WKContextRef context, WKStringRef visitedURL);
     78
    7779WK_EXPORT WKContextRef WKContextRetain(WKContextRef context);
    7880WK_EXPORT void WKContextRelease(WKContextRef context);
  • trunk/WebKit2/UIProcess/WebContext.cpp

    r64448 r64492  
    4040#include "WKContextPrivate.h"
    4141
     42#include <WebCore/LinkHash.h>
     43
    4244#ifndef NDEBUG
    4345#include <wtf/RefCountedLeakCounter.h>
     
    365367}
    366368
     369void WebContext::addVisitedLink(const String& visitedURL)
     370{
     371    if (visitedURL.isEmpty())
     372        return;
     373
     374    WebCore::LinkHash hash = visitedLinkHash(visitedURL.characters(), visitedURL.length());
     375    m_process->send(WebProcessMessage::AddVisitedLink, 0, CoreIPC::In(hash));
     376}
     377
    367378void WebContext::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder& arguments)
    368379{
  • trunk/WebKit2/UIProcess/WebContext.h

    r64396 r64492  
    100100   
    101101    void registerURLSchemeAsEmptyDocument(const WebCore::String&);
     102   
     103    void addVisitedLink(const WebCore::String&);
    102104
    103105    void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder&);
  • trunk/WebKit2/WebProcess/WebProcess.cpp

    r64380 r64492  
    111111}
    112112
     113void WebProcess::addVisitedLinkHash(WebCore::LinkHash hash)
     114{
     115    PageGroup* group = PageGroup::pageGroup("WebKit2Group");
     116    ASSERT(group);
     117    if (!group) {
     118        printf("Cannot find PageGroup named 'WebKit2Group'\n");
     119        return;
     120    }
     121    group->addVisitedLinkHash(hash);
     122}
     123
    113124WebPage* WebProcess::webPage(uint64_t pageID) const
    114125{
     
    167178    if (messageID.is<CoreIPC::MessageClassWebProcess>()) {
    168179        switch (messageID.get<WebProcessMessage::Kind>()) {
     180            case WebProcessMessage::AddVisitedLink: {
     181                WebCore::LinkHash hash;
     182                if (!arguments->decode(CoreIPC::Out(hash)))
     183                    return;
     184
     185                addVisitedLinkHash(hash);
     186                return;
     187            }
    169188            case WebProcessMessage::LoadInjectedBundle: {
    170189                String path;
  • trunk/WebKit2/WebProcess/WebProcess.h

    r64380 r64492  
    2929#include "Connection.h"
    3030#include "DrawingArea.h"
     31#include <WebCore/LinkHash.h>
    3132#include <wtf/HashMap.h>
    3233
     
    7475    void setApplicationCacheDirectory(const WebCore::String&);
    7576    void registerURLSchemeAsEmptyDocument(const WebCore::String&);
     77    void addVisitedLinkHash(WebCore::LinkHash);
    7678
    7779    // CoreIPC::Connection::Client
Note: See TracChangeset for help on using the changeset viewer.