Bug 120019 - Document::visitedLinkState() should return a reference
Summary: Document::visitedLinkState() should return a reference
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Pratik Solanki
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-19 12:06 PDT by Pratik Solanki
Modified: 2013-08-19 12:43 PDT (History)
9 users (show)

See Also:


Attachments
Patch (4.12 KB, patch)
2013-08-19 12:11 PDT, Pratik Solanki
kling: review+
kling: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>