Skip to content
Permalink
Browse files
2010-10-31 Darin Adler <darin@apple.com>
        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.


Canonical link: https://commits.webkit.org/61495@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@70997 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
darinadler committed Oct 31, 2010
1 parent 312df12 commit 067ec62fc10a919a2def0b80ca27edda59b26303
Showing with 49 additions and 10 deletions.
  1. +31 −0 WebKit2/ChangeLog
  2. +11 −4 WebKit2/UIProcess/VisitedLinkProvider.cpp
  3. +3 −2 WebKit2/UIProcess/VisitedLinkProvider.h
  4. +4 −4 WebKit2/UIProcess/WebContext.cpp
@@ -1,3 +1,34 @@
2010-10-31 Darin Adler <darin@apple.com>

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.

2010-10-30 Andreas Kling <kling@webkit.org>

Reviewed by Kenneth Rohde Christiansen.
@@ -39,14 +39,20 @@ static const int VisitedLinkTableMaxLoad = 2;
VisitedLinkProvider::VisitedLinkProvider(WebContext* context)
: m_context(context)
, m_visitedLinksPopulated(false)
, m_webProcessHasVisitedLinkState(false)
, m_keyCount(0)
, m_tableSize(0)
, m_pendingVisitedLinksTimer(RunLoop::main(), this, &VisitedLinkProvider::pendingVisitedLinksTimerFired)
{
}

void VisitedLinkProvider::populateVisitedLinksIfNeeded()
void VisitedLinkProvider::processDidFinishLaunching()
{
m_webProcessHasVisitedLinkState = false;

if (m_keyCount)
m_pendingVisitedLinksTimer.startOneShot(0);

if (m_visitedLinksPopulated)
return;

@@ -63,7 +69,7 @@ void VisitedLinkProvider::addVisitedLink(LinkHash linkHash)
m_pendingVisitedLinksTimer.startOneShot(0);
}

void VisitedLinkProvider::stopVisitedLinksTimer()
void VisitedLinkProvider::processDidClose()
{
m_pendingVisitedLinksTimer.stop();
}
@@ -149,7 +155,7 @@ void VisitedLinkProvider::pendingVisitedLinksTimerFired()

m_keyCount += pendingVisitedLinks.size();

if (currentTableSize != newTableSize) {
if (!m_webProcessHasVisitedLinkState || currentTableSize != newTableSize) {
// Send the new visited link table.

SharedMemory::Handle handle;
@@ -160,13 +166,14 @@ void VisitedLinkProvider::pendingVisitedLinksTimerFired()
}

// We now need to let the web process know that we've added links.
if (addedVisitedLinks.size() <= 20) {
if (m_webProcessHasVisitedLinkState && addedVisitedLinks.size() <= 20) {
m_context->process()->send(Messages::WebProcess::VisitedLinkStateChanged(addedVisitedLinks), 0);
return;
}

// Just recalculate all the visited links.
m_context->process()->send(Messages::WebProcess::AllVisitedLinkStateChanged(), 0);
m_webProcessHasVisitedLinkState = true;
}

} // namespace WebKit
@@ -41,16 +41,17 @@ class VisitedLinkProvider : Noncopyable {
public:
explicit VisitedLinkProvider(WebContext*);

void populateVisitedLinksIfNeeded();
void addVisitedLink(WebCore::LinkHash);

void stopVisitedLinksTimer();
void processDidFinishLaunching();
void processDidClose();

private:
void pendingVisitedLinksTimerFired();

WebContext* m_context;
bool m_visitedLinksPopulated;
bool m_webProcessHasVisitedLinkState;

unsigned m_keyCount;
unsigned m_tableSize;
@@ -189,17 +189,17 @@ void WebContext::ensureWebProcess()
void WebContext::processDidFinishLaunching(WebProcessProxy* process)
{
// FIXME: Once we support multiple processes per context, this assertion won't hold.
ASSERT(process == m_process);
ASSERT_UNUSED(process, process == m_process);

m_visitedLinkProvider.populateVisitedLinksIfNeeded();
m_visitedLinkProvider.processDidFinishLaunching();
}

void WebContext::processDidClose(WebProcessProxy* process)
{
// FIXME: Once we support multiple processes per context, this assertion won't hold.
ASSERT(process == m_process);
ASSERT_UNUSED(process, process == m_process);

m_visitedLinkProvider.stopVisitedLinksTimer();
m_visitedLinkProvider.processDidClose();

m_process = 0;
}

0 comments on commit 067ec62

Please sign in to comment.