Bug 120019

Summary: Document::visitedLinkState() should return a reference
Product: WebKit Reporter: Pratik Solanki <psolanki>
Component: WebCore Misc.Assignee: Pratik Solanki <psolanki>
Status: RESOLVED FIXED    
Severity: Normal CC: allan.jensen, commit-queue, esprehn+autocc, glenn, kangil.han, kling, macpherson, menard, psolanki
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch kling: review+, kling: commit-queue-

Description Pratik Solanki 2013-08-19 12:06:05 PDT
m_visitedLinkState is created in Document ctor and never cleared. We can return a reference from visitedLinkState() instead of a pointer.
Comment 1 Pratik Solanki 2013-08-19 12:11:20 PDT
Created attachment 209106 [details]
Patch
Comment 2 Andreas Kling 2013-08-19 12:14:01 PDT
Comment on attachment 209106 [details]
Patch

r=me

As an added precaution, you should make Document::m_visitedLinkState const.
That way it can't be assigned to outside of the Document ctor initializer list.
Comment 3 Pratik Solanki 2013-08-19 12:43:15 PDT
Committed r154291: <http://trac.webkit.org/changeset/154291>