Last Comment Bug 551390 - Dead code in content
: Dead code in content
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla6
Assigned To: Ehren Metcalfe
:
: Andrew Overholt [:overholt]
Mentors:
Depends on:
Blocks: deadcode
  Show dependency treegraph
 
Reported: 2010-03-09 21:40 PST by Ehren Metcalfe
Modified: 2011-05-18 02:47 PDT (History)
3 users (show)
mounir: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (29.31 KB, patch)
2010-03-09 21:40 PST, Ehren Metcalfe
jonas: review+
roc: review+
Details | Diff | Splinter Review
patch v2 (23.55 KB, patch)
2010-03-31 19:27 PDT, Ehren Metcalfe
jonas: review+
Details | Diff | Splinter Review
patch for check-in (19.25 KB, patch)
2011-05-16 04:06 PDT, Ehren Metcalfe
ehren.m: review+
Details | Diff | Splinter Review

Description Ehren Metcalfe 2010-03-09 21:40:56 PST
Created attachment 431560 [details] [diff] [review]
patch

These functions are unused: 

in content/base:

PRBool nsParserUtils::GetQuotedAttrNameAt(const nsString&,PRUint32,nsAString_internal&)
http://mxr.mozilla.org/mozilla-central/search?string=GetQuotedAttrNameAt

nsIContent* nsContentUtils::FindFirstChildWithResolvedTag(nsIContent*,PRInt32,nsIAtom*)
http://mxr.mozilla.org/mozilla-central/search?string=FindFirstChildWithResolvedTag

nsIDocShell* nsContentUtils::GetDocShellFromCaller()
http://mxr.mozilla.org/mozilla/search?string=GetDocShellFromCaller

nsIContent* nsContentUtils::GetReferencedElement(nsIURI*,nsIContent*)
http://mxr.mozilla.org/mozilla-central/search?string=GetReferencedElement

void nsXMLNameSpaceMap::RemovePrefix(nsIAtom*)
http://mxr.mozilla.org/mozilla-central/search?string=RemovePrefix

content/html:

void nsGenericHTMLElement::GetHrefURIToMutate(nsIURI**)
http://mxr.mozilla.org/mozilla-central/search?string=GetHrefURIToMutate

nsresult nsGenericHTMLElement::SetFloatAttr(nsIAtom*,float)
http://mxr.mozilla.org/mozilla-central/search?string=SetFloatAttr

nsresult nsGenericHTMLElement::GetFloatAttr(nsIAtom*,float,float*)
http://mxr.mozilla.org/mozilla-central/search?string=GetFloatAttr

nsresult nsHTMLDNSPrefetch::PrefetchHigh(nsAString_internal&)
nsresult nsHTMLDNSPrefetch::PrefetchHigh(Link*)
http://mxr.mozilla.org/mozilla-central/search?string=PrefetchHigh

nsresult nsHTMLDNSPrefetch::PrefetchMedium(nsAString_internal&)
nsresult nsHTMLDNSPrefetch::PrefetchMedium(Link*)
http://mxr.mozilla.org/mozilla-central/search?string=PrefetchMedium

PRBool SinkContext::IsAncestorContainer(nsHTMLTag)
http://mxr.mozilla.org/mozilla-central/search?string=IsAncestorContainer

nsresult nsHTMLFragmentContentSink::AddTextToContent(nsIContent*,const nsAString_internal&)
http://mxr.mozilla.org/mozilla-central/search?string=AddTextToContent

content/media:

nsresult nsMediaCacheStream::ReadFromCache(char*,PRInt64,PRInt64)
http://mxr.mozilla.org/mozilla-central/search?string=ReadFromCache
Comment 1 Boris Zbarsky [:bz] (still a bit busy) 2010-03-10 09:30:41 PST
The content/base list of things removed looks ok to me, though sicking is a better reviewer I think.

GetHrefURIToMutate can go.  But then you should be able to remove the aCloneIfCached argument of GetURIAttr too, right?

>nsresult nsGenericHTMLElement::SetFloatAttr(nsIAtom*,float)
>http://mxr.mozilla.org/mozilla-central/search?string=SetFloatAttr
>
>nsresult nsGenericHTMLElement::GetFloatAttr(nsIAtom*,float,float*)
>http://mxr.mozilla.org/mozilla-central/search?string=GetFloatAttr

Not sure whether we'll need these for upcoming html5 stuff.

> nsresult nsHTMLDNSPrefetch::PrefetchHigh(nsAString_internal&)
> nsresult nsHTMLDNSPrefetch::PrefetchHigh(Link*)
> http://mxr.mozilla.org/mozilla-central/search?string=PrefetchHigh

> nsresult nsHTMLDNSPrefetch::PrefetchMedium(nsAString_internal&)
> nsresult nsHTMLDNSPrefetch::PrefetchMedium(Link*)
> http://mxr.mozilla.org/mozilla-central/search?string=PrefetchMedium

These were meant as forward-looking API, in case someone needs them.

> nsresult nsMediaCacheStream::ReadFromCache(char*,PRInt64,PRInt64)
> http://mxr.mozilla.org/mozilla-central/search?string=ReadFromCache

This needs review from roc.
Comment 2 dwitte@gmail.com 2010-03-10 10:13:57 PST
Awesome to see dead code bugs being filed!
Comment 3 Ehren Metcalfe 2010-03-31 19:27:09 PDT
Created attachment 436403 [details] [diff] [review]
patch v2

Sorry this took so long... 

I put back Prefetch* and *FloatAttr. Also I wonder if I can sneak in nsresult nsPlainTextSerializer::WillProcessTokens() : http://mxr.mozilla.org/mozilla-central/search?string=WillProcessTokens (It looks like it implements an interface method that was removed at some point)
Comment 4 Ehren Metcalfe 2010-03-31 19:29:29 PDT
I also removed aCloneIfCached from GetURIAttr. Should probably try a build with -Wunusedparams ...
Comment 5 :Ms2ger (⌚ UTC+1/+2) 2011-05-15 06:30:19 PDT
Ehren, is there anything left to do before this can land?
Comment 6 Ehren Metcalfe 2011-05-16 04:06:47 PDT
Created attachment 532600 [details] [diff] [review]
patch for check-in

oops, sry for the epic delay.

Here's the rebased patch. Unfortunately/Fortunately nsMediaStream::ReadFromCache now has users so I had to take that out of the patch. The rest passed a minimal try server run though so I'll just carry over the r=sicking,roc
Comment 7 Mounir Lamouri (:mounir) 2011-05-18 02:47:43 PDT
Pushed:
http://hg.mozilla.org/mozilla-central/rev/a968d7ebe290

Thank you for your contribution :)

Note You need to log in before you can comment on or make changes to this bug.