Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: third_party/WebKit/Source/core/dom/VisitedLinkState.cpp

Issue 1417943002: Load the table of visited links from database file asynchronously. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Load the table of visited links asynchronously and inform render about finish loading process. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 if (isHTMLAnchorElement(element)) 52 if (isHTMLAnchorElement(element))
53 return toHTMLAnchorElement(element).visitedLinkHash(); 53 return toHTMLAnchorElement(element).visitedLinkHash();
54 return visitedLinkHash(element.document().baseURL(), attribute.isNull() ? li nkAttribute(element) : attribute); 54 return visitedLinkHash(element.document().baseURL(), attribute.isNull() ? li nkAttribute(element) : attribute);
55 } 55 }
56 56
57 VisitedLinkState::VisitedLinkState(const Document& document) 57 VisitedLinkState::VisitedLinkState(const Document& document)
58 : m_document(document) 58 : m_document(document)
59 { 59 {
60 } 60 }
61 61
62 void VisitedLinkState::invalidateStyleForAllLinks() 62 void VisitedLinkState::invalidateStyleForAllLinks(bool invalidateVisitedLinkHash es)
63 { 63 {
64 if (m_linksCheckedForVisitedState.isEmpty()) 64 if (m_linksCheckedForVisitedState.isEmpty())
65 return; 65 return;
66 for (Node& node : NodeTraversal::startsAt(document().firstChild())) { 66 for (Node& node : NodeTraversal::startsAt(document().firstChild())) {
67 if (node.isLink()) 67 if (node.isLink()) {
68 if (invalidateVisitedLinkHashes && isHTMLAnchorElement(node))
brettw 2015/12/08 00:54:42 Although I'm in the root-level owners file, I'm no
69 toHTMLAnchorElement(node).invalidateCachedVisitedLinkHash();
68 node.setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTra cing::create(StyleChangeReason::VisitedLink)); 70 node.setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTra cing::create(StyleChangeReason::VisitedLink));
71 }
69 } 72 }
70 } 73 }
71 74
72 void VisitedLinkState::invalidateStyleForLink(LinkHash linkHash) 75 void VisitedLinkState::invalidateStyleForLink(LinkHash linkHash)
73 { 76 {
74 if (!m_linksCheckedForVisitedState.contains(linkHash)) 77 if (!m_linksCheckedForVisitedState.contains(linkHash))
75 return; 78 return;
76 for (Node& node : NodeTraversal::startsAt(document().firstChild())) { 79 for (Node& node : NodeTraversal::startsAt(document().firstChild())) {
77 if (node.isLink() && linkHashForElement(toElement(node)) == linkHash) 80 if (node.isLink() && linkHashForElement(toElement(node)) == linkHash)
78 node.setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTra cing::create(StyleChangeReason::VisitedLink)); 81 node.setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTra cing::create(StyleChangeReason::VisitedLink));
(...skipping 26 matching lines...) Expand all
105 108
106 return InsideUnvisitedLink; 109 return InsideUnvisitedLink;
107 } 110 }
108 111
109 DEFINE_TRACE(VisitedLinkState) 112 DEFINE_TRACE(VisitedLinkState)
110 { 113 {
111 visitor->trace(m_document); 114 visitor->trace(m_document);
112 } 115 }
113 116
114 } // namespace blink 117 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698