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

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

Issue 2633633003: Changed EInsideLink to an enum class with an unsigned type. (Closed)
Patch Set: Rebase. Created 3 years, 11 months 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 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights
6 * reserved. 6 * reserved.
7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
10 * (http://www.torchmobile.com/) 10 * (http://www.torchmobile.com/)
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 EInsideLink VisitedLinkState::determineLinkStateSlowCase( 113 EInsideLink VisitedLinkState::determineLinkStateSlowCase(
114 const Element& element) { 114 const Element& element) {
115 DCHECK(element.isLink()); 115 DCHECK(element.isLink());
116 DCHECK(document().isActive()); 116 DCHECK(document().isActive());
117 DCHECK(document() == element.document()); 117 DCHECK(document() == element.document());
118 118
119 const AtomicString& attribute = linkAttribute(element); 119 const AtomicString& attribute = linkAttribute(element);
120 120
121 if (attribute.isNull()) 121 if (attribute.isNull())
122 return NotInsideLink; // This can happen for <img usemap> 122 return EInsideLink::kNotInsideLink; // This can happen for <img usemap>
123 123
124 // An empty attribute refers to the document itself which is always 124 // An empty attribute refers to the document itself which is always
125 // visited. It is useful to check this explicitly so that visited 125 // visited. It is useful to check this explicitly so that visited
126 // links can be tested in platform independent manner, without 126 // links can be tested in platform independent manner, without
127 // explicit support in the test harness. 127 // explicit support in the test harness.
128 if (attribute.isEmpty()) 128 if (attribute.isEmpty())
129 return InsideVisitedLink; 129 return EInsideLink::kInsideVisitedLink;
130 130
131 if (LinkHash hash = linkHashForElement(element, attribute)) { 131 if (LinkHash hash = linkHashForElement(element, attribute)) {
132 m_linksCheckedForVisitedState.add(hash); 132 m_linksCheckedForVisitedState.add(hash);
133 if (Platform::current()->isLinkVisited(hash)) 133 if (Platform::current()->isLinkVisited(hash))
134 return InsideVisitedLink; 134 return EInsideLink::kInsideVisitedLink;
135 } 135 }
136 136
137 return InsideUnvisitedLink; 137 return EInsideLink::kInsideUnvisitedLink;
138 } 138 }
139 139
140 DEFINE_TRACE(VisitedLinkState) { 140 DEFINE_TRACE(VisitedLinkState) {
141 visitor->trace(m_document); 141 visitor->trace(m_document);
142 } 142 }
143 143
144 } // namespace blink 144 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698