Changeset 70997 in webkit


Ignore:
Timestamp:
Oct 31, 2010 1:20:42 PM (14 years ago)
Author:
Darin Adler
Message:

2010-10-31 Darin Adler <Darin Adler>

Reviewed by Dan Bernstein.

Visited links not populated correctly in new web processes after the first
https://bugs.webkit.org/show_bug.cgi?id=48735
rdar://problem/8442177

  • UIProcess/VisitedLinkProvider.cpp: (WebKit::VisitedLinkProvider::VisitedLinkProvider): Initialize m_webProcessHasVisitedLinkState. (WebKit::VisitedLinkProvider::processDidFinishLaunching): Renamed from populateVisitedLinksIfNeeded. Set m_webProcessHasVisitedLinkState to false, since this is a new process, and also start the timer so the visited links messages will be sent. (WebKit::VisitedLinkProvider::processDidClose): Renamed from stopVisitedLinksTimer. (WebKit::VisitedLinkProvider::pendingVisitedLinksTimerFired): Added logic so we send SetVisitedLinkTable and AllVisitedLinkStateChanged once to each new process and to set m_webProcessHasVisitedLinkState to true once that is done.
  • UIProcess/VisitedLinkProvider.h: Updated for above changes.
  • UIProcess/WebContext.cpp: (WebKit::WebContext::processDidFinishLaunching): Called VisitedLinkProvider function under its new name. Also used ASSERT_UNUSED rather than ASSERT since the argument is used only for the assertion. (WebKit::WebContext::processDidClose): Ditto.
Location:
trunk/WebKit2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r70981 r70997  
     12010-10-31  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        Visited links not populated correctly in new web processes after the first
     6        https://bugs.webkit.org/show_bug.cgi?id=48735
     7        rdar://problem/8442177
     8
     9        * UIProcess/VisitedLinkProvider.cpp:
     10        (WebKit::VisitedLinkProvider::VisitedLinkProvider): Initialize
     11        m_webProcessHasVisitedLinkState.
     12        (WebKit::VisitedLinkProvider::processDidFinishLaunching): Renamed
     13        from populateVisitedLinksIfNeeded. Set m_webProcessHasVisitedLinkState
     14        to false, since this is a new process, and also start the timer
     15        so the visited links messages will be sent.
     16        (WebKit::VisitedLinkProvider::processDidClose): Renamed from
     17        stopVisitedLinksTimer.
     18        (WebKit::VisitedLinkProvider::pendingVisitedLinksTimerFired):
     19        Added logic so we send SetVisitedLinkTable and
     20        AllVisitedLinkStateChanged once to each new process and to set
     21        m_webProcessHasVisitedLinkState to true once that is done.
     22
     23        * UIProcess/VisitedLinkProvider.h: Updated for above changes.
     24
     25        * UIProcess/WebContext.cpp:
     26        (WebKit::WebContext::processDidFinishLaunching): Called
     27        VisitedLinkProvider function under its new name. Also used
     28        ASSERT_UNUSED rather than ASSERT since the argument is used
     29        only for the assertion.
     30        (WebKit::WebContext::processDidClose): Ditto.
     31
    1322010-10-30  Andreas Kling  <kling@webkit.org>
    233
  • trunk/WebKit2/UIProcess/VisitedLinkProvider.cpp

    r70346 r70997  
    4040    : m_context(context)
    4141    , m_visitedLinksPopulated(false)
     42    , m_webProcessHasVisitedLinkState(false)
    4243    , m_keyCount(0)
    4344    , m_tableSize(0)
     
    4647}
    4748
    48 void VisitedLinkProvider::populateVisitedLinksIfNeeded()
     49void VisitedLinkProvider::processDidFinishLaunching()
    4950{
     51    m_webProcessHasVisitedLinkState = false;
     52
     53    if (m_keyCount)
     54        m_pendingVisitedLinksTimer.startOneShot(0);
     55
    5056    if (m_visitedLinksPopulated)
    5157        return;
     
    6470}
    6571
    66 void VisitedLinkProvider::stopVisitedLinksTimer()
     72void VisitedLinkProvider::processDidClose()
    6773{
    6874    m_pendingVisitedLinksTimer.stop();
     
    150156    m_keyCount += pendingVisitedLinks.size();
    151157
    152     if (currentTableSize != newTableSize) {
     158    if (!m_webProcessHasVisitedLinkState || currentTableSize != newTableSize) {
    153159        // Send the new visited link table.
    154160       
     
    161167   
    162168    // We now need to let the web process know that we've added links.
    163     if (addedVisitedLinks.size() <= 20) {
     169    if (m_webProcessHasVisitedLinkState && addedVisitedLinks.size() <= 20) {
    164170        m_context->process()->send(Messages::WebProcess::VisitedLinkStateChanged(addedVisitedLinks), 0);
    165171        return;
     
    168174    // Just recalculate all the visited links.
    169175    m_context->process()->send(Messages::WebProcess::AllVisitedLinkStateChanged(), 0);
     176    m_webProcessHasVisitedLinkState = true;
    170177}
    171178
  • trunk/WebKit2/UIProcess/VisitedLinkProvider.h

    r70346 r70997  
    4242    explicit VisitedLinkProvider(WebContext*);
    4343
    44     void populateVisitedLinksIfNeeded();
    4544    void addVisitedLink(WebCore::LinkHash);
    4645
    47     void stopVisitedLinksTimer();
     46    void processDidFinishLaunching();
     47    void processDidClose();
    4848
    4949private:
     
    5252    WebContext* m_context;
    5353    bool m_visitedLinksPopulated;
     54    bool m_webProcessHasVisitedLinkState;
    5455
    5556    unsigned m_keyCount;
  • trunk/WebKit2/UIProcess/WebContext.cpp

    r70702 r70997  
    190190{
    191191    // FIXME: Once we support multiple processes per context, this assertion won't hold.
    192     ASSERT(process == m_process);
    193 
    194     m_visitedLinkProvider.populateVisitedLinksIfNeeded();
     192    ASSERT_UNUSED(process, process == m_process);
     193
     194    m_visitedLinkProvider.processDidFinishLaunching();
    195195}
    196196
     
    198198{
    199199    // FIXME: Once we support multiple processes per context, this assertion won't hold.
    200     ASSERT(process == m_process);
    201 
    202     m_visitedLinkProvider.stopVisitedLinksTimer();
     200    ASSERT_UNUSED(process, process == m_process);
     201
     202    m_visitedLinkProvider.processDidClose();
    203203
    204204    m_process = 0;
Note: See TracChangeset for help on using the changeset viewer.