Difference between revisions of "User:Egmetcalfe/Dead Code"

From CDOT Wiki
Jump to: navigation, search
(mozilla/content/xbl)
Line 458: Line 458:
 
Code Size: 2
 
Code Size: 2
  
===mozilla/dom===
+
Note: ProcessTokens and WillAddTokens must be removed from nsIParserFilter as well.
 +
 
 +
===dom===
  
 
====nsresult nsIScriptGlobalObject::HandleScriptError(nsScriptErrorEvent*,nsEventStatus*)====
 
====nsresult nsIScriptGlobalObject::HandleScriptError(nsScriptErrorEvent*,nsEventStatus*)====
Line 465: Line 467:
  
 
Code Size: 3
 
Code Size: 3
 +
 +
===parser===
 +
 +
====void nsCParserNode::SetGenericState(PRBool)====
 +
 +
[http://mxr.mozilla.org/mozilla-central/search?string=SetGenericState MXR Search]
 +
 +
Code Size: 3
 +
 +
====PRBool nsCParserNode::GetGenericState()====
 +
 +
[http://mxr.mozilla.org/mozilla-central/search?string=GetGenericState MXR Search]
 +
 +
Code Size: 3
 +
  
 
== Bugs/Strangeness ==
 
== Bugs/Strangeness ==
  
===mozilla/layout/xul===
+
===layout/xul===
  
 
====void nsBox::CoordNeedsRecalc(PRInt32&)====
 
====void nsBox::CoordNeedsRecalc(PRInt32&)====

Revision as of 00:20, 24 March 2010

Note: Code Size is a count of the number of GIMPLE instructions during pass cfg.

Contents

Unconditionally Dead

content/base

PRBool nsParserUtils::GetQuotedAttrNameAt(const nsString&,PRUint32,nsAString_internal&)

Declaration Definition MXR Search *

Code Size: 96, Static method

nsIContent* nsContentUtils::FindFirstChildWithResolvedTag(nsIContent*,PRInt32,nsIAtom*)

Declaration Definition MXR Search *

Code Size: 92, Static method

nsIDocShell* nsContentUtils::GetDocShellFromCaller()

Declaration Definition MXR Search *

Code Size: 33, Static method

nsIContent* nsContentUtils::GetReferencedElement(nsIURI*,nsIContent*)

MXR Search *

Code Size: 6, Static method

void nsXMLNameSpaceMap::RemovePrefix(nsIAtom*)

Declaration Definition MXR Search *

Code Size: 3, NS_HIDDEN_

nsresult nsPlainTextSerializer::WillProcessTokens()

MXR Search (forgot to include this in original patch)

Code Size: 2

content/html

void nsGenericHTMLElement::GetHrefURIToMutate(nsIURI**)

MXR Search *

Code Size: 3

nsresult nsGenericHTMLElement::SetFloatAttr(nsIAtom*,float)

Code Size: 6

MXR Search (One use in a dead macro) *

nsresult nsGenericHTMLElement::GetFloatAttr(nsIAtom*,float,float*)

MXR Search (One use in a dead macro) *

Code Size: 15

nsresult nsHTMLDNSPrefetch::PrefetchHigh(nsAString_internal&)

MXR Search *

Code Size: 3

nsresult nsHTMLDNSPrefetch::PrefetchHigh(Link*)

MXR Search *

Code Size: 3

nsresult nsHTMLDNSPrefetch::PrefetchMedium(nsAString_internal&)

MXR Search *

Code Size: 3

nsresult nsHTMLDNSPrefetch::PrefetchMedium(Link*)

MXR Search *

Code Size: 3

PRBool SinkContext::IsAncestorContainer(nsHTMLTag)

MXR Search *

Code Size: 13

nsresult nsHTMLFragmentContentSink::AddTextToContent(nsIContent*,const nsAString_internal&)

MXR Search *

Code Size: 26

content/media

nsresult nsMediaCacheStream::ReadFromCache(char*,PRInt64,PRInt64)

MXR Search *

Code Size: 82


content/events

nsresult nsPrivateTextRange::SetRangeType(PRUint16)

MXR Search

Code Size: 3

nsresult nsPrivateTextRange::SetRangeEnd(PRUint16)

MXR Search

Code Size: 3

nsresult nsPrivateTextRange::SetRangeStart(PRUint16)

MXR Search

Code Size: 3

content/xslt

MBool txDouble::isNeg(double)

MXR Search

Code Size: 5

PRInt32 txNamespaceMap::lookupNamespace(const nsAString_internal&)

MXR Search

Code Size: 8

Note: Only lookupNamespace(nsIAtom*) is used

txXPathNode* txXPathNodeUtils::getDocument(const txXPathNode&)

MXR Search

Code Size: 11

PRBool txEarlyEvalContext::isStripSpaceAllowed(const txXPathNode&)

MXR Search

Code Size: 2

PRBool txExecutionState::isStripSpaceAllowed(const txXPathNode&)

MXR Search

Code Size: 6

PRBool txXSLTParamContext::isStripSpaceAllowed(const txXPathNode&)

MXR Search

Code Size: 2

Note: Difficult to check but all PRBool isStripSpaceAllowed functions are dead. There are a number of MBool isStripSpaceAllowed functions which are not, however.

nsresult txResultRecycler::getNodeSet(const txXPathNode&,txNodeSet**)

MXR Search

Code Size: 29

content/xul

PRBool TestNode::HasAncestor(const ReteNode*)

MXR Search

Code Size: 11

PRBool nsXULDocument::ContextStack::IsInsideXULTemplate()

MXR Search

Code Size: 16

content/xbl

nsCOMArray* nsXBLPrototypeBinding::GetStyleSheets()

MXR Search

Code Size: 6

content/canvas

====PRUint32 mozilla::SimpleBuffer::ElementSize()====

MXR Search

Code Size: 26

void mozilla::SimpleBuffer::Prepare(PRUint32,PRUint32,PRUint32)

MXR Search

Code Size: 9

void mozilla::SimpleBuffer::EnsureCapacity(PRBool,PRUint32)

MXR Search

Code Size: 19

PRBool mozilla::SimpleBuffer::InitFromJSArray(PRUint32,PRUint32,JSContext*,JSObject*,jsuint)

MXR Search

Code Size: 127

Note: SimpleBuffer has been removed in a recent revision

modules/libreg

REGERR NR_RegIsWritable(HREG)

MXR Search

Code Size: 18

REGERR VR_PackRegistry(void*,nr_RegPackCallbackFunc)

MXR Search

Code Size: 9

Path Info: VR_UninstallEnumSharedFiles calls NR_RegEnumEntries

REGERR NR_RegEnumEntries(HREG,RKEY,REGENUM*,char*,uint32,REGINFO*)

MXR Search

Code Size: 60

REGERR VR_UninstallEnumSharedFiles(char*,REGENUM*,char*,uint32)

MXR Search

Code Size: 57

Note: NR_RegEnumEntries is called by nr_addNodesToNewReg which is #ifdef RESURRECT_LATER here http://mxr.mozilla.org/mozilla-central/source/modules/libreg/src/reg.c#3650 (with a comment saying resurrect after mozilla 1)

Path Info: VR_PackRegistry calls NR_RegPack

REGERR NR_RegPack(HREG,void*,nr_RegPackCallbackFunc)

MXR Search

Code Size: 2

REGERR VR_PackRegistry(void*,nr_RegPackCallbackFunc)

MXR Search

Code Size: 9

modules/libpref

nsresult PREF_GetCharPref(const char*,char*,int*,PRBool)

MXR Search

Code Size: 47

accessible

Path info: AddTargetFromChildrenHavingIDRefsAttr calls GetElementsHavingIDRefsAttrImpl

void nsCoreUtils::GetElementsHavingIDRefsAttrImpl(nsIContent*,nsCString&,nsIAtom*,nsIMutableArray*)

MXR Search

Code Size: 42

nsresult nsRelUtils::AddTargetFromChildrenHavingIDRefsAttr(PRUint32,nsIAccessibleRelation**,nsIContent*,nsIContent*,nsIAtom*)

MXR Search

Code Size: 52

already_AddRefed nsAccUtils::QueryAccessibleTable(nsIAccessibleTable*)

MXR Search

Code Size: 7

embedding/components/windowwatcher

nsIScriptGlobalObject* nsWWJSUtils::GetStaticScriptGlobal(JSContext*,JSObject*)

Declaration Definition MXR Search

Code Size: 45, Static method

nsIScriptContext* nsWWJSUtils::GetStaticScriptContext(JSContext*,JSObject*)

Declaration Definition MXR Search

Code Size: 10, Static method

modules/libpref

nsresult PREF_GetCharPref(const char*,char*,int*,PRBool)

Definition MXR Search

Code Size: 47

gfx/thebes/public

Path info: MapCharToGlyph calls MapCharToGlyphFormat4

PRUint32 gfxFontUtils::MapCharToGlyphFormat4(const PRUint8*,PRUnichar)

Declaration Definition MXR Search

Code Size: 92, Static method, class marked THEBES_API

PRUint32 gfxFontUtils::MapCharToGlyph(PRUint8*,PRUint32,PRUnichar)

Declaration Definition MXR Search

Code Size: 11, Static method, class marked THEBES_API

gfx/src/thebes

Path info: GetTextDimensions calls GetTextDimensionsInternal

nsresult nsThebesRenderingContext::GetTextDimensions(const PRUnichar*,PRInt32,PRInt32,PRInt32*,PRInt32,nsTextDimensions&,PRInt32&,nsTextDimensions&,PRInt32*)

MXR Search

Code Size: 56

nsresult nsThebesRenderingContext::GetTextDimensionsInternal(const PRUnichar*,PRInt32,PRInt32,PRInt32*,PRInt32,nsTextDimensions&,PRInt32&,nsTextDimensions&,PRInt32*)

MXR Search

Code Size: 2

MXR Search

Note: The 9 argument versions of these functions are not called. The same functions may be removed from nsIThebesFontMetrics, nsThebesFontMetrics and nsIThebesRenderingContext

nsresult nsThebesRenderingContext::DrawEllipse(const nsRect&)

MXR Search

Code Size: 10

Note: 1-arg func never used. Must be removed from nsIThebesRenderingContext as well

modules/libpr0n

PRUint32 imgFrame::GetImageBytesPerRow()

Declaration Definition MXR Search

Code Size: 11

PRInt32 imgFrame::GetHeight()

Declaration Definition MXR Search (Dead, but a pain to check)

Code Size: 2

PRInt32 imgFrame::GetWidth()

Declaration Definition MXR Search (Dead, but a pain to check)

Code Size: 2

PRInt32 imgFrame::GetY()

Declaration Definition MXR Search (impossible to check)

Code Size: 2

PRInt32 imgFrame::GetX()

Declaration Definition MXR Search (impossible to check)

Code Size: 2

editor

nsresult nsHTMLCSSUtils::RemoveCSSProperty(nsIDOMElement*,const nsAString_internal&)

MXR Search

Code Size: 28

security/manager/ssl

Path Info:

CommonAsyncVerifySignature is called by AsyncVerifySignature and AsyncVerifyDetachedSignature.

nsresult nsCMSMessage::CommonAsyncVerifySignature(nsISMimeVerificationListener*,unsigned char*,PRUint32)

MXR Search

Code Size: 43

nsresult nsCMSMessage::AsyncVerifyDetachedSignature(nsISMimeVerificationListener*,unsigned char*,PRUint32)

MXR Search

Code Size: 6

nsresult nsCMSMessage::AsyncVerifySignature(nsISMimeVerificationListener*)

MXR Search

Code Size: 3

Also Note: AsyncVerifySignature is the only caller of these two operators in mozilla/xpcom/glue:

nsCOMPtr& nsCOMPtr::operator=(nsICMSMessage*)

Code Size: 5

nsCOMPtr& nsCOMPtr::operator=(nsISMimeVerificationListener*)

Code Size: 5

mozilla/intl

PRUint16* MapperToCCMap(nsICharRepresentable*)

MXR Search

Code Size: 15

void nsBufferDecoderSupport::DoubleBuffer()

MXR Search

Code Size: 19

nsresult nsDetectionAdaptor::ProcessTokens()

MXR Search

Code Size: 2

nsresult nsDetectionAdaptor::WillAddToken(CToken&)

MXR Search

Code Size: 2

Note: ProcessTokens and WillAddTokens must be removed from nsIParserFilter as well.

dom

nsresult nsIScriptGlobalObject::HandleScriptError(nsScriptErrorEvent*,nsEventStatus*)

MXR Search

Code Size: 3

parser

void nsCParserNode::SetGenericState(PRBool)

MXR Search

Code Size: 3

PRBool nsCParserNode::GetGenericState()

MXR Search

Code Size: 3


Bugs/Strangeness

layout/xul

void nsBox::CoordNeedsRecalc(PRInt32&)

MXR Search

Code Size: 2

This is declared in the header here as taking an ncoord& parameter however it is defined here as taking PRInt32&. This could be problematic if [NS_COORD_IS_FLOAT http://mxr.mozilla.org/mozilla-central/source/gfx/public/nsCoord.h#74] is defined.