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

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: Add extra comment and fix compilation error. Created 5 years 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))
69 toHTMLAnchorElement(node).invalidateCachedVisitedLinkHash();
68 toElement(node).pseudoStateChanged(CSSSelector::PseudoLink); 70 toElement(node).pseudoStateChanged(CSSSelector::PseudoLink);
69 toElement(node).pseudoStateChanged(CSSSelector::PseudoVisited); 71 toElement(node).pseudoStateChanged(CSSSelector::PseudoVisited);
70 } 72 }
71 } 73 }
72 } 74 }
73 75
74 void VisitedLinkState::invalidateStyleForLink(LinkHash linkHash) 76 void VisitedLinkState::invalidateStyleForLink(LinkHash linkHash)
75 { 77 {
76 if (!m_linksCheckedForVisitedState.contains(linkHash)) 78 if (!m_linksCheckedForVisitedState.contains(linkHash))
77 return; 79 return;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 111
110 return InsideUnvisitedLink; 112 return InsideUnvisitedLink;
111 } 113 }
112 114
113 DEFINE_TRACE(VisitedLinkState) 115 DEFINE_TRACE(VisitedLinkState)
114 { 116 {
115 visitor->trace(m_document); 117 visitor->trace(m_document);
116 } 118 }
117 119
118 } // namespace blink 120 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/VisitedLinkState.h ('k') | third_party/WebKit/Source/core/page/Page.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698