Remove trailing semicolons after all uses of MOZ_DECL_CTOR_COUNTER to quiet build warnings on Mac. b=60415 a=brendan@mozilla.org

This commit is contained in:
dbaron%fas.harvard.edu 2001-01-27 23:06:33 +00:00
Родитель 8662b8bbee
Коммит 7a97a55d82
97 изменённых файлов: 135 добавлений и 3103 удалений

Просмотреть файл

@ -491,7 +491,7 @@ nsDOMImplementation::Init(nsIURI* aBaseURI)
// =
// ==================================================================
MOZ_DECL_CTOR_COUNTER(nsDocumentChildNodes);
MOZ_DECL_CTOR_COUNTER(nsDocumentChildNodes)
nsDocumentChildNodes::nsDocumentChildNodes(nsIDocument* aDocument)
{
@ -549,7 +549,7 @@ nsDocumentChildNodes::DropReference()
// =
// ==================================================================
MOZ_DECL_CTOR_COUNTER(nsAnonymousContentList);
MOZ_DECL_CTOR_COUNTER(nsAnonymousContentList)
nsAnonymousContentList::nsAnonymousContentList(nsISupportsArray* aElements)
{

Просмотреть файл

@ -1528,7 +1528,7 @@ StyleSetImpl::PrintTimer(PRUint32 aTimerID)
// this is a comprimise between a sorted-list based lookup and a hash-type
// lookup which is not possible due to non-guaranteed-unique keys.
MOZ_DECL_CTOR_COUNTER(StyleContextCache);
MOZ_DECL_CTOR_COUNTER(StyleContextCache)
StyleContextCache::StyleContextCache(void)
:mHashTable(nsnull, nsnull, HashTableEnumDestroy, nsnull),

Просмотреть файл

@ -127,7 +127,7 @@ protected:
nsIHTMLContent *mContent;
};
MOZ_DECL_CTOR_COUNTER(nsDOMCSSAttributeDeclaration);
MOZ_DECL_CTOR_COUNTER(nsDOMCSSAttributeDeclaration)
nsDOMCSSAttributeDeclaration::nsDOMCSSAttributeDeclaration(nsIHTMLContent *aContent)
{

Просмотреть файл

@ -1194,7 +1194,7 @@ MakeContentObject(nsHTMLTag aNodeType,
//----------------------------------------------------------------------
MOZ_DECL_CTOR_COUNTER(SinkContext);
MOZ_DECL_CTOR_COUNTER(SinkContext)
SinkContext::SinkContext(HTMLContentSink* aSink)
{

Просмотреть файл

@ -63,7 +63,7 @@ static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CI
class CSSLoaderImpl;
MOZ_DECL_CTOR_COUNTER(URLKey);
MOZ_DECL_CTOR_COUNTER(URLKey)
class URLKey: public nsHashKey {
public:
@ -174,7 +174,7 @@ public:
NS_IMPL_ISUPPORTS1(SheetLoadData, nsIStreamLoaderObserver);
MOZ_DECL_CTOR_COUNTER(PendingSheetData);
MOZ_DECL_CTOR_COUNTER(PendingSheetData)
struct PendingSheetData {
PendingSheetData(nsICSSStyleSheet* aSheet, PRInt32 aDocIndex,

Просмотреть файл

@ -59,7 +59,7 @@
//#define ENABLE_COUNTERS // un-comment this to enable counters (bug 15174)
MOZ_DECL_CTOR_COUNTER(SelectorList);
MOZ_DECL_CTOR_COUNTER(SelectorList)
// e.g. "P B, H1 B { ... }" has a selector list with two elements,
// each of which has two selectors.

Просмотреть файл

@ -158,7 +158,7 @@ nsCSSToken::AppendToString(nsString& aBuffer)
}
}
MOZ_DECL_CTOR_COUNTER(nsCSSScanner);
MOZ_DECL_CTOR_COUNTER(nsCSSScanner)
nsCSSScanner::nsCSSScanner()
{

Просмотреть файл

@ -86,7 +86,7 @@ static NS_DEFINE_IID(kCSSPageSID, NS_CSS_PAGE_SID);
#define NS_IF_DELETE(ptr) \
if (nsnull != ptr) { delete ptr; ptr = nsnull; }
MOZ_DECL_CTOR_COUNTER(nsAtomList);
MOZ_DECL_CTOR_COUNTER(nsAtomList)
nsAtomList::nsAtomList(nsIAtom* aAtom)
: mAtom(aAtom),
@ -136,7 +136,7 @@ PRBool nsAtomList::Equals(const nsAtomList* aOther) const
return PR_FALSE;
}
MOZ_DECL_CTOR_COUNTER(nsAttrSelector);
MOZ_DECL_CTOR_COUNTER(nsAttrSelector)
#ifdef DEBUG_REFS
PRUint32 gAttrSelectorCount=0;
@ -275,7 +275,7 @@ void nsAttrSelector::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize)
}
}
MOZ_DECL_CTOR_COUNTER(nsCSSSelector);
MOZ_DECL_CTOR_COUNTER(nsCSSSelector)
#ifdef DEBUG_REFS
PRUint32 gSelectorCount=0;
@ -907,7 +907,7 @@ protected:
nsICSSStyleRule *mRule;
};
MOZ_DECL_CTOR_COUNTER(DOMCSSDeclarationImpl);
MOZ_DECL_CTOR_COUNTER(DOMCSSDeclarationImpl)
DOMCSSDeclarationImpl::DOMCSSDeclarationImpl(nsICSSStyleRule *aRule)
{

Просмотреть файл

@ -1354,7 +1354,7 @@ void CSSStyleSheetImpl::operator delete(void* ptr)
}
}
MOZ_DECL_CTOR_COUNTER(CSSStyleSheetImpl);
MOZ_DECL_CTOR_COUNTER(CSSStyleSheetImpl)
CSSStyleSheetImpl::CSSStyleSheetImpl()
: nsICSSStyleSheet(),

Просмотреть файл

@ -38,7 +38,7 @@
#include "nsIStyleSet.h"
MOZ_DECL_CTOR_COUNTER(HTMLAttribute);
MOZ_DECL_CTOR_COUNTER(HTMLAttribute)
struct HTMLAttribute {
HTMLAttribute(void)
@ -231,7 +231,7 @@ struct HTMLAttribute {
// ----------------
MOZ_DECL_CTOR_COUNTER(nsClassList);
MOZ_DECL_CTOR_COUNTER(nsClassList)
struct nsClassList {
nsClassList(nsIAtom* aAtom)

Просмотреть файл

@ -513,7 +513,7 @@ public:
} mHash;
};
MOZ_DECL_CTOR_COUNTER(AttributeKey);
MOZ_DECL_CTOR_COUNTER(AttributeKey)
AttributeKey::AttributeKey(nsIHTMLMappedAttributes* aAttributes)
: mAttributes(aAttributes)

Просмотреть файл

@ -660,7 +660,7 @@ si_CompareEncryptedToEncrypted(const nsString& crypt1, const nsString& crypt2) {
* Managing Signon List *
************************/
MOZ_DECL_CTOR_COUNTER(si_SignonDataStruct);
MOZ_DECL_CTOR_COUNTER(si_SignonDataStruct)
class si_SignonDataStruct {
public:
@ -677,7 +677,7 @@ public:
PRBool isPassword;
};
MOZ_DECL_CTOR_COUNTER(si_SignonUserStruct);
MOZ_DECL_CTOR_COUNTER(si_SignonUserStruct)
class si_SignonUserStruct {
public:
@ -692,7 +692,7 @@ public:
nsVoidArray * signonData_list;
};
MOZ_DECL_CTOR_COUNTER(si_SignonURLStruct);
MOZ_DECL_CTOR_COUNTER(si_SignonURLStruct)
class si_SignonURLStruct {
public:
@ -709,7 +709,7 @@ public:
nsVoidArray * signonUser_list;
};
MOZ_DECL_CTOR_COUNTER(si_Reject);
MOZ_DECL_CTOR_COUNTER(si_Reject)
class si_Reject {
public:

Просмотреть файл

@ -202,7 +202,7 @@ wallet_GetWalletNotificationPref(void) {
enum PlacementType {DUP_IGNORE, DUP_OVERWRITE, DUP_BEFORE, DUP_AFTER, AT_END, BY_LENGTH};
#define LIST_COUNT(list) ((list) ? (list)->Count() : 0)
MOZ_DECL_CTOR_COUNTER(wallet_Sublist);
MOZ_DECL_CTOR_COUNTER(wallet_Sublist)
class wallet_Sublist {
public:
@ -225,7 +225,7 @@ public:
* item2 is a value. Therefore this generic data structure refers to them simply as
* item1 and item2.
*/
MOZ_DECL_CTOR_COUNTER(wallet_MapElement);
MOZ_DECL_CTOR_COUNTER(wallet_MapElement)
class wallet_MapElement {
public:
@ -290,7 +290,7 @@ PRIVATE nsVoidArray * wallet_DistinguishedSchema_list=0;
#define NO_CAPTURE 0
#define NO_PREVIEW 1
MOZ_DECL_CTOR_COUNTER(wallet_PrefillElement);
MOZ_DECL_CTOR_COUNTER(wallet_PrefillElement)
class wallet_PrefillElement {
public:
@ -3753,7 +3753,7 @@ WLLT_RequestToCapture(nsIPresShell* shell, nsIDOMWindowInternal* win, PRUint32*
Recycle(message);
}
MOZ_DECL_CTOR_COUNTER(si_SignonDataStruct);
MOZ_DECL_CTOR_COUNTER(si_SignonDataStruct)
/* should move this to an include file */
class si_SignonDataStruct {

Просмотреть файл

@ -25,7 +25,7 @@
#include "nsToken.h"
#include "prenv.h"
MOZ_DECL_CTOR_COUNTER(CParserContext);
MOZ_DECL_CTOR_COUNTER(CParserContext)
/**
* Your friendly little constructor. Ok, it's not the friendly, but the only guy

Просмотреть файл

@ -30,11 +30,11 @@
#include "nsIObserverService.h"
#include "nsIServiceManager.h"
MOZ_DECL_CTOR_COUNTER(nsEntryStack);
MOZ_DECL_CTOR_COUNTER(nsDTDContext);
MOZ_DECL_CTOR_COUNTER(nsTokenAllocator);
MOZ_DECL_CTOR_COUNTER(CNodeRecycler);
MOZ_DECL_CTOR_COUNTER(CObserverService);
MOZ_DECL_CTOR_COUNTER(nsEntryStack)
MOZ_DECL_CTOR_COUNTER(nsDTDContext)
MOZ_DECL_CTOR_COUNTER(nsTokenAllocator)
MOZ_DECL_CTOR_COUNTER(CNodeRecycler)
MOZ_DECL_CTOR_COUNTER(CObserverService)
/**************************************************************************************

Просмотреть файл

@ -69,7 +69,7 @@ const int kBufsize=1;
const int kBufsize=64;
#endif
MOZ_DECL_CTOR_COUNTER(nsScanner);
MOZ_DECL_CTOR_COUNTER(nsScanner)
/**
* Use this constructor if you want i/o to be based on

Просмотреть файл

@ -25,7 +25,7 @@
#ifdef MATCH_CTOR_DTOR
MOZ_DECL_CTOR_COUNTER(CToken);
MOZ_DECL_CTOR_COUNTER(CToken)
#endif
static int TokenCount=0;

Просмотреть файл

@ -1,94 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
/**
* MODULE NOTES:
* @update gess 4/1/98
*
*/
#include "nsTokenHandler.h"
#include "nsDebug.h"
#include "nsIDTD.h"
#include "nsToken.h"
#include "nsIParser.h"
MOZ_DECL_CTOR_COUNTER(CTokenHandler);
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CTokenHandler::CTokenHandler(dispatchFP aFP,PRInt32 aType){
MOZ_COUNT_CTOR(CTokenHandler);
mType=aType;
mFP=aFP;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CTokenHandler::~CTokenHandler(){
MOZ_COUNT_DTOR(CTokenHandler);
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRInt32 CTokenHandler::GetTokenType(void){
return mType;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
nsresult CTokenHandler::operator()(CToken* aToken,nsIDTD* aDTD){
nsresult result=NS_OK;
if((0!=aDTD) && (0!=mFP)) {
result=(*mFP)(aToken,aDTD);
}
return result;
}

Просмотреть файл

@ -90,7 +90,7 @@ public:
nsAutoString mTitle;
};
MOZ_DECL_CTOR_COUNTER(nsMenuEntry);
MOZ_DECL_CTOR_COUNTER(nsMenuEntry)
//----------------------------------------------------------------------------
// Class nsCharsetMenu [declaration]

Просмотреть файл

@ -114,7 +114,7 @@ protected:
PLHashTable* mTable;
};
MOZ_DECL_CTOR_COUNTER(UndisplayedNode);
MOZ_DECL_CTOR_COUNTER(UndisplayedNode)
class UndisplayedNode {
public:
@ -2158,7 +2158,7 @@ CompareKeys(void* key1, void* key2)
return key1 == key2;
}
MOZ_DECL_CTOR_COUNTER(FrameHashTable);
MOZ_DECL_CTOR_COUNTER(FrameHashTable)
FrameHashTable::FrameHashTable(PRUint32 aNumBuckets)
{
@ -2436,7 +2436,7 @@ FrameManager::GetInsertionPoint(nsIPresShell* aShell, nsIFrame* aParent, nsIFram
//----------------------------------------------------------------------
MOZ_DECL_CTOR_COUNTER(UndisplayedMap);
MOZ_DECL_CTOR_COUNTER(UndisplayedMap)
UndisplayedMap::UndisplayedMap(PRUint32 aNumBuckets)
{

Просмотреть файл

@ -25,7 +25,7 @@
#include "nsHashtable.h"
#include "nsIStatefulFrame.h" // Get StateType enum
MOZ_DECL_CTOR_COUNTER(HistoryKey);
MOZ_DECL_CTOR_COUNTER(HistoryKey)
class HistoryKey: public nsVoidKey {
public:

Просмотреть файл

@ -28,7 +28,7 @@
static const PRUint32 kGrowArrayBy = 10;
MOZ_DECL_CTOR_COUNTER(nsStyleChangeList);
MOZ_DECL_CTOR_COUNTER(nsStyleChangeList)
nsStyleChangeList::nsStyleChangeList(void)
: mArray(mBuffer),

Просмотреть файл

@ -491,7 +491,7 @@ nsDOMImplementation::Init(nsIURI* aBaseURI)
// =
// ==================================================================
MOZ_DECL_CTOR_COUNTER(nsDocumentChildNodes);
MOZ_DECL_CTOR_COUNTER(nsDocumentChildNodes)
nsDocumentChildNodes::nsDocumentChildNodes(nsIDocument* aDocument)
{
@ -549,7 +549,7 @@ nsDocumentChildNodes::DropReference()
// =
// ==================================================================
MOZ_DECL_CTOR_COUNTER(nsAnonymousContentList);
MOZ_DECL_CTOR_COUNTER(nsAnonymousContentList)
nsAnonymousContentList::nsAnonymousContentList(nsISupportsArray* aElements)
{

Просмотреть файл

@ -25,7 +25,7 @@
#include "nsHashtable.h"
#include "nsIStatefulFrame.h" // Get StateType enum
MOZ_DECL_CTOR_COUNTER(HistoryKey);
MOZ_DECL_CTOR_COUNTER(HistoryKey)
class HistoryKey: public nsVoidKey {
public:

Просмотреть файл

@ -1028,7 +1028,7 @@ nsSpaceManager::DestroyFrameInfo(FrameInfo* aFrameInfo)
/////////////////////////////////////////////////////////////////////////////
// FrameInfo
MOZ_DECL_CTOR_COUNTER(nsSpaceManager::FrameInfo);
MOZ_DECL_CTOR_COUNTER(nsSpaceManager::FrameInfo)
nsSpaceManager::FrameInfo::FrameInfo(nsIFrame* aFrame, const nsRect& aRect)
: mFrame(aFrame), mRect(aRect), mNext(0)
@ -1046,7 +1046,7 @@ nsSpaceManager::FrameInfo::~FrameInfo()
/////////////////////////////////////////////////////////////////////////////
// BandRect
MOZ_DECL_CTOR_COUNTER(BandRect);
MOZ_DECL_CTOR_COUNTER(BandRect)
nsSpaceManager::BandRect::BandRect(nscoord aLeft,
nscoord aTop,

Просмотреть файл

@ -28,7 +28,7 @@
static const PRUint32 kGrowArrayBy = 10;
MOZ_DECL_CTOR_COUNTER(nsStyleChangeList);
MOZ_DECL_CTOR_COUNTER(nsStyleChangeList)
nsStyleChangeList::nsStyleChangeList(void)
: mArray(mBuffer),

Просмотреть файл

@ -1528,7 +1528,7 @@ StyleSetImpl::PrintTimer(PRUint32 aTimerID)
// this is a comprimise between a sorted-list based lookup and a hash-type
// lookup which is not possible due to non-guaranteed-unique keys.
MOZ_DECL_CTOR_COUNTER(StyleContextCache);
MOZ_DECL_CTOR_COUNTER(StyleContextCache)
StyleContextCache::StyleContextCache(void)
:mHashTable(nsnull, nsnull, HashTableEnumDestroy, nsnull),

Просмотреть файл

@ -32,7 +32,7 @@
#define HOVER "hover"
#define FOCUS "focus"
MOZ_DECL_CTOR_COUNTER(nsButtonFrameRenderer);
MOZ_DECL_CTOR_COUNTER(nsButtonFrameRenderer)
nsButtonFrameRenderer::nsButtonFrameRenderer()
{

Просмотреть файл

@ -80,7 +80,7 @@ static NS_DEFINE_IID(kViewCID, NS_VIEW_CID);
MOZ_DECL_CTOR_COUNTER(nsFormControlHelper);
MOZ_DECL_CTOR_COUNTER(nsFormControlHelper)
nsFormControlHelper::nsFormControlHelper()
{

Просмотреть файл

@ -197,7 +197,7 @@ NS_NewEmptyFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
return NS_OK;
}
MOZ_DECL_CTOR_COUNTER(nsFrame);
MOZ_DECL_CTOR_COUNTER(nsFrame)
// Overloaded new operator. Initializes the memory to 0 and relies on an arena
// (which comes from the presShell) to perform the allocation.

Просмотреть файл

@ -83,7 +83,7 @@ public:
PRBool mHasFocus;
};
MOZ_DECL_CTOR_COUNTER(Area);
MOZ_DECL_CTOR_COUNTER(Area)
Area::Area(nsIContent* aArea,
PRBool aSuppress, PRBool aHasURL)

Просмотреть файл

@ -36,7 +36,7 @@ static PRInt32 ctorCount;
PRInt32 nsLineBox::GetCtorCount() { return ctorCount; }
#endif
MOZ_DECL_CTOR_COUNTER(nsLineBox);
MOZ_DECL_CTOR_COUNTER(nsLineBox)
nsLineBox::nsLineBox(nsIFrame* aFrame, PRInt32 aCount, PRBool aIsBlock)
: mFirstChild(aFrame),
@ -903,7 +903,7 @@ nsFloaterCacheFreeList::Append(nsFloaterCache* aFloater)
//----------------------------------------------------------------------
MOZ_DECL_CTOR_COUNTER(nsFloaterCache);
MOZ_DECL_CTOR_COUNTER(nsFloaterCache)
nsFloaterCache::nsFloaterCache()
: mPlaceholder(nsnull),

Просмотреть файл

@ -71,7 +71,7 @@
#define PLACED_LEFT 0x1
#define PLACED_RIGHT 0x2
MOZ_DECL_CTOR_COUNTER(nsLineLayout);
MOZ_DECL_CTOR_COUNTER(nsLineLayout)
nsLineLayout::nsLineLayout(nsIPresContext* aPresContext,
nsISpaceManager* aSpaceManager,

Просмотреть файл

@ -1028,7 +1028,7 @@ nsSpaceManager::DestroyFrameInfo(FrameInfo* aFrameInfo)
/////////////////////////////////////////////////////////////////////////////
// FrameInfo
MOZ_DECL_CTOR_COUNTER(nsSpaceManager::FrameInfo);
MOZ_DECL_CTOR_COUNTER(nsSpaceManager::FrameInfo)
nsSpaceManager::FrameInfo::FrameInfo(nsIFrame* aFrame, const nsRect& aRect)
: mFrame(aFrame), mRect(aRect), mNext(0)
@ -1046,7 +1046,7 @@ nsSpaceManager::FrameInfo::~FrameInfo()
/////////////////////////////////////////////////////////////////////////////
// BandRect
MOZ_DECL_CTOR_COUNTER(BandRect);
MOZ_DECL_CTOR_COUNTER(BandRect)
nsSpaceManager::BandRect::BandRect(nscoord aLeft,
nscoord aTop,

Просмотреть файл

@ -113,7 +113,7 @@ nsTextTransformer::Shutdown()
#define MAX_UNIBYTE 127
MOZ_DECL_CTOR_COUNTER(nsTextTransformer);
MOZ_DECL_CTOR_COUNTER(nsTextTransformer)
nsTextTransformer::nsTextTransformer(nsILineBreaker* aLineBreaker,
nsIWordBreaker* aWordBreaker,

Просмотреть файл

@ -69,7 +69,7 @@ nsDST::NewMemoryArena(PRUint32 aArenaSize)
return new NodeArena(aArenaSize);
}
MOZ_DECL_CTOR_COUNTER(NodeArena);
MOZ_DECL_CTOR_COUNTER(NodeArena)
// Constructor
nsDST::NodeArena::NodeArena(PRUint32 aArenaSize)
@ -193,7 +193,7 @@ nsDST::NodeArena::NumArenas() const
/////////////////////////////////////////////////////////////////////////////
// Digital search tree for doing a radix-search of pointer-based keys
MOZ_DECL_CTOR_COUNTER(nsDST);
MOZ_DECL_CTOR_COUNTER(nsDST)
// Constructor
nsDST::nsDST(NodeArena* aArena, PtrBits aLevelZeroBit)

Просмотреть файл

@ -197,7 +197,7 @@ NS_NewEmptyFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
return NS_OK;
}
MOZ_DECL_CTOR_COUNTER(nsFrame);
MOZ_DECL_CTOR_COUNTER(nsFrame)
// Overloaded new operator. Initializes the memory to 0 and relies on an arena
// (which comes from the presShell) to perform the allocation.

Просмотреть файл

@ -114,7 +114,7 @@ protected:
PLHashTable* mTable;
};
MOZ_DECL_CTOR_COUNTER(UndisplayedNode);
MOZ_DECL_CTOR_COUNTER(UndisplayedNode)
class UndisplayedNode {
public:
@ -2158,7 +2158,7 @@ CompareKeys(void* key1, void* key2)
return key1 == key2;
}
MOZ_DECL_CTOR_COUNTER(FrameHashTable);
MOZ_DECL_CTOR_COUNTER(FrameHashTable)
FrameHashTable::FrameHashTable(PRUint32 aNumBuckets)
{
@ -2436,7 +2436,7 @@ FrameManager::GetInsertionPoint(nsIPresShell* aShell, nsIFrame* aParent, nsIFram
//----------------------------------------------------------------------
MOZ_DECL_CTOR_COUNTER(UndisplayedMap);
MOZ_DECL_CTOR_COUNTER(UndisplayedMap)
UndisplayedMap::UndisplayedMap(PRUint32 aNumBuckets)
{

Просмотреть файл

@ -31,7 +31,7 @@
#undef NOISY_IMAGE_LOADING
#endif
MOZ_DECL_CTOR_COUNTER(nsHTMLImageLoader);
MOZ_DECL_CTOR_COUNTER(nsHTMLImageLoader)
nsHTMLImageLoader::nsHTMLImageLoader()
: mBaseURL(nsnull),

Просмотреть файл

@ -83,7 +83,7 @@ public:
PRBool mHasFocus;
};
MOZ_DECL_CTOR_COUNTER(Area);
MOZ_DECL_CTOR_COUNTER(Area)
Area::Area(nsIContent* aArea,
PRBool aSuppress, PRBool aHasURL)

Просмотреть файл

@ -36,7 +36,7 @@ static PRInt32 ctorCount;
PRInt32 nsLineBox::GetCtorCount() { return ctorCount; }
#endif
MOZ_DECL_CTOR_COUNTER(nsLineBox);
MOZ_DECL_CTOR_COUNTER(nsLineBox)
nsLineBox::nsLineBox(nsIFrame* aFrame, PRInt32 aCount, PRBool aIsBlock)
: mFirstChild(aFrame),
@ -903,7 +903,7 @@ nsFloaterCacheFreeList::Append(nsFloaterCache* aFloater)
//----------------------------------------------------------------------
MOZ_DECL_CTOR_COUNTER(nsFloaterCache);
MOZ_DECL_CTOR_COUNTER(nsFloaterCache)
nsFloaterCache::nsFloaterCache()
: mPlaceholder(nsnull),

Просмотреть файл

@ -71,7 +71,7 @@
#define PLACED_LEFT 0x1
#define PLACED_RIGHT 0x2
MOZ_DECL_CTOR_COUNTER(nsLineLayout);
MOZ_DECL_CTOR_COUNTER(nsLineLayout)
nsLineLayout::nsLineLayout(nsIPresContext* aPresContext,
nsISpaceManager* aSpaceManager,

Просмотреть файл

@ -113,7 +113,7 @@ nsTextTransformer::Shutdown()
#define MAX_UNIBYTE 127
MOZ_DECL_CTOR_COUNTER(nsTextTransformer);
MOZ_DECL_CTOR_COUNTER(nsTextTransformer)
nsTextTransformer::nsTextTransformer(nsILineBreaker* aLineBreaker,
nsIWordBreaker* aWordBreaker,

Просмотреть файл

@ -127,7 +127,7 @@ protected:
nsIHTMLContent *mContent;
};
MOZ_DECL_CTOR_COUNTER(nsDOMCSSAttributeDeclaration);
MOZ_DECL_CTOR_COUNTER(nsDOMCSSAttributeDeclaration)
nsDOMCSSAttributeDeclaration::nsDOMCSSAttributeDeclaration(nsIHTMLContent *aContent)
{

Просмотреть файл

@ -1194,7 +1194,7 @@ MakeContentObject(nsHTMLTag aNodeType,
//----------------------------------------------------------------------
MOZ_DECL_CTOR_COUNTER(SinkContext);
MOZ_DECL_CTOR_COUNTER(SinkContext)
SinkContext::SinkContext(HTMLContentSink* aSink)
{

Просмотреть файл

@ -32,7 +32,7 @@
#define HOVER "hover"
#define FOCUS "focus"
MOZ_DECL_CTOR_COUNTER(nsButtonFrameRenderer);
MOZ_DECL_CTOR_COUNTER(nsButtonFrameRenderer)
nsButtonFrameRenderer::nsButtonFrameRenderer()
{

Просмотреть файл

@ -80,7 +80,7 @@ static NS_DEFINE_IID(kViewCID, NS_VIEW_CID);
MOZ_DECL_CTOR_COUNTER(nsFormControlHelper);
MOZ_DECL_CTOR_COUNTER(nsFormControlHelper)
nsFormControlHelper::nsFormControlHelper()
{

Просмотреть файл

@ -63,7 +63,7 @@ static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CI
class CSSLoaderImpl;
MOZ_DECL_CTOR_COUNTER(URLKey);
MOZ_DECL_CTOR_COUNTER(URLKey)
class URLKey: public nsHashKey {
public:
@ -174,7 +174,7 @@ public:
NS_IMPL_ISUPPORTS1(SheetLoadData, nsIStreamLoaderObserver);
MOZ_DECL_CTOR_COUNTER(PendingSheetData);
MOZ_DECL_CTOR_COUNTER(PendingSheetData)
struct PendingSheetData {
PendingSheetData(nsICSSStyleSheet* aSheet, PRInt32 aDocIndex,

Просмотреть файл

@ -59,7 +59,7 @@
//#define ENABLE_COUNTERS // un-comment this to enable counters (bug 15174)
MOZ_DECL_CTOR_COUNTER(SelectorList);
MOZ_DECL_CTOR_COUNTER(SelectorList)
// e.g. "P B, H1 B { ... }" has a selector list with two elements,
// each of which has two selectors.

Просмотреть файл

@ -1,897 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#include "nsCSSScanner.h"
#include "nsIInputStream.h"
#include "nsIUnicharInputStream.h"
#include "nsString.h"
#include "nsCRT.h"
#ifdef NS_DEBUG
static char* kNullPointer = "null pointer";
#endif
#ifdef CSS_REPORT_PARSE_ERRORS
#include "nsCOMPtr.h"
#include "nsIServiceManager.h"
#include "nsReadableUtils.h"
#include "nsIURI.h"
#include "nsIConsoleService.h"
#include "nsIScriptError.h"
#include "nsComponentManagerUtils.h" // put this higher and gcc barfs...
#endif
// Don't bother collecting whitespace characters in token's mIdent buffer
#undef COLLECT_WHITESPACE
#define BUFFER_SIZE 256
static const PRUnichar CSS_ESCAPE = PRUnichar('\\');
static const PRUint8 IS_LATIN1 = 0x01;
static const PRUint8 IS_DIGIT = 0x02;
static const PRUint8 IS_HEX_DIGIT = 0x04;
static const PRUint8 IS_ALPHA = 0x08;
static const PRUint8 START_IDENT = 0x10;
static const PRUint8 IS_IDENT = 0x20;
static const PRUint8 IS_WHITESPACE = 0x40;
static PRBool gLexTableSetup = PR_FALSE;
static PRUint8 gLexTable[256];
static void BuildLexTable()
{
gLexTableSetup = PR_TRUE;
PRUint8* lt = gLexTable;
int i;
lt[CSS_ESCAPE] = START_IDENT;
lt['-'] |= IS_IDENT;
// XXX add in other whitespace chars
lt[' '] |= IS_WHITESPACE; // space
lt['\t'] |= IS_WHITESPACE; // horizontal tab
lt['\v'] |= IS_WHITESPACE; // vertical tab
lt['\r'] |= IS_WHITESPACE; // carriage return
lt['\n'] |= IS_WHITESPACE; // line feed
lt['\f'] |= IS_WHITESPACE; // form feed
for (i = 161; i <= 255; i++) {
lt[i] |= IS_LATIN1 | IS_IDENT | START_IDENT;
}
for (i = '0'; i <= '9'; i++) {
lt[i] |= IS_DIGIT | IS_HEX_DIGIT | IS_IDENT;
}
for (i = 'A'; i <= 'Z'; i++) {
if ((i >= 'A') && (i <= 'F')) {
lt[i] |= IS_HEX_DIGIT;
lt[i+32] |= IS_HEX_DIGIT;
}
lt[i] |= IS_ALPHA | IS_IDENT | START_IDENT;
lt[i+32] |= IS_ALPHA | IS_IDENT | START_IDENT;
}
}
nsCSSToken::nsCSSToken()
{
mType = eCSSToken_Symbol;
}
void
nsCSSToken::AppendToString(nsString& aBuffer)
{
switch (mType) {
case eCSSToken_AtKeyword:
aBuffer.Append(PRUnichar('@')); // fall through intentional
case eCSSToken_Ident:
case eCSSToken_WhiteSpace:
case eCSSToken_Function:
case eCSSToken_URL:
case eCSSToken_InvalidURL:
case eCSSToken_HTMLComment:
aBuffer.Append(mIdent);
break;
case eCSSToken_Number:
if (mIntegerValid) {
aBuffer.AppendInt(mInteger, 10);
}
else {
aBuffer.AppendFloat(mNumber);
}
break;
case eCSSToken_Percentage:
if (mIntegerValid) {
aBuffer.AppendInt(mInteger, 10);
}
else {
aBuffer.AppendFloat(mNumber);
}
aBuffer.Append(PRUnichar('%')); // STRING USE WARNING: technically, this should be |AppendWithConversion|
break;
case eCSSToken_Dimension:
if (mIntegerValid) {
aBuffer.AppendInt(mInteger, 10);
}
else {
aBuffer.AppendFloat(mNumber);
}
aBuffer.Append(mIdent);
break;
case eCSSToken_String:
aBuffer.Append(mSymbol);
aBuffer.Append(mIdent); // fall through intentional
case eCSSToken_Symbol:
aBuffer.Append(mSymbol);
break;
case eCSSToken_ID:
aBuffer.Append(PRUnichar('#'));
aBuffer.Append(mIdent);
break;
case eCSSToken_Includes:
aBuffer.Append(PRUnichar('~'));
aBuffer.Append(PRUnichar('='));
break;
case eCSSToken_Dashmatch:
aBuffer.Append(PRUnichar('|'));
aBuffer.Append(PRUnichar('='));
break;
default:
NS_ERROR("invalid token type");
break;
}
}
MOZ_DECL_CTOR_COUNTER(nsCSSScanner);
nsCSSScanner::nsCSSScanner()
{
MOZ_COUNT_CTOR(nsCSSScanner);
if (!gLexTableSetup) {
// XXX need a monitor
BuildLexTable();
}
mInput = nsnull;
mBuffer = new PRUnichar[BUFFER_SIZE];
mOffset = 0;
mCount = 0;
mPushback = mLocalPushback;
mPushbackCount = 0;
mPushbackSize = 4;
mLineNumber = 1;
mLastRead = 0;
}
nsCSSScanner::~nsCSSScanner()
{
MOZ_COUNT_DTOR(nsCSSScanner);
Close();
if (nsnull != mBuffer) {
delete [] mBuffer;
mBuffer = nsnull;
}
if (mLocalPushback != mPushback) {
delete [] mPushback;
}
}
void nsCSSScanner::Init(nsIUnicharInputStream* aInput)
{
NS_PRECONDITION(nsnull != aInput, kNullPointer);
Close();
mInput = aInput;
NS_IF_ADDREF(aInput);
}
#ifdef CSS_REPORT_PARSE_ERRORS
void nsCSSScanner::InitErrorReporting(nsIURI* aURI)
{
if (aURI) {
aURI->GetSpec(getter_Copies(mFileName));
} else {
mFileName = "from DOM";
}
mColNumber = 0;
}
void nsCSSScanner::ReportError(const nsAReadableString& aError)
{
printf("CSS Error (%s :%u.%u): %s.\n",
mFileName.get(),
mLineNumber,
mColNumber,
NS_ConvertUCS2toUTF8(aError).GetBuffer());
// Log it to the JavaScript console
nsCOMPtr<nsIConsoleService> consoleService
(do_GetService("@mozilla.org/consoleservice;1"));
nsCOMPtr<nsIScriptError> errorObject
(do_CreateInstance("@mozilla.org/scripterror;1"));
if (consoleService && errorObject) {
nsresult rv;
PRUnichar *error = ToNewUnicode(aError);
rv = errorObject->Init(error,
NS_ConvertASCIItoUCS2(mFileName.get()).GetUnicode(),
NS_LITERAL_STRING(""),
mLineNumber,
mColNumber,
0,
"CSS Parser");
nsMemory::Free(error);
if (NS_SUCCEEDED(rv))
consoleService->LogMessage(errorObject);
}
}
#endif // CSS_REPORT_PARSE_ERRORS
PRUint32 nsCSSScanner::GetLineNumber()
{
return mLineNumber;
}
void nsCSSScanner::Close()
{
NS_IF_RELEASE(mInput);
}
#ifdef CSS_REPORT_PARSE_ERRORS
#define TAB_STOP_WIDTH 8
#endif
// Returns -1 on error or eof
PRInt32 nsCSSScanner::Read(PRInt32& aErrorCode)
{
PRInt32 rv;
if (0 < mPushbackCount) {
rv = PRInt32(mPushback[--mPushbackCount]);
} else {
if (mCount < 0) {
return -1;
}
if (mOffset == mCount) {
mOffset = 0;
aErrorCode = mInput->Read(mBuffer, 0, BUFFER_SIZE, (PRUint32*)&mCount);
if (NS_FAILED(aErrorCode) || mCount == 0) {
mCount = 0;
return -1;
}
}
rv = PRInt32(mBuffer[mOffset++]);
if (((rv == '\n') && (mLastRead != '\r')) || (rv == '\r')) {
mLineNumber++;
#ifdef CSS_REPORT_PARSE_ERRORS
mColNumber = 0;
#endif
}
#ifdef CSS_REPORT_PARSE_ERRORS
else if (rv == '\t') {
mColNumber = ((mColNumber - 1 + TAB_STOP_WIDTH) / TAB_STOP_WIDTH)
* TAB_STOP_WIDTH;
} else if (rv != '\n') {
mColNumber++;
}
#endif
}
mLastRead = rv;
//printf("Read => %x\n", rv);
return rv;
}
PRInt32 nsCSSScanner::Peek(PRInt32& aErrorCode)
{
if (0 == mPushbackCount) {
PRInt32 ch = Read(aErrorCode);
if (ch < 0) {
return -1;
}
mPushback[0] = PRUnichar(ch);
mPushbackCount++;
}
//printf("Peek => %x\n", mLookAhead);
return PRInt32(mPushback[mPushbackCount - 1]);
}
void nsCSSScanner::Unread()
{
NS_PRECONDITION((mLastRead >= 0), "double pushback");
Pushback(PRUnichar(mLastRead));
mLastRead = -1;
}
void nsCSSScanner::Pushback(PRUnichar aChar)
{
if (mPushbackCount == mPushbackSize) { // grow buffer
PRUnichar* newPushback = new PRUnichar[mPushbackSize + 4];
if (nsnull == newPushback) {
return;
}
mPushbackSize += 4;
nsCRT::memcpy(newPushback, mPushback, sizeof(PRUnichar) * mPushbackCount);
if (mPushback != mLocalPushback) {
delete [] mPushback;
}
mPushback = newPushback;
}
mPushback[mPushbackCount++] = aChar;
}
PRBool nsCSSScanner::LookAhead(PRInt32& aErrorCode, PRUnichar aChar)
{
PRInt32 ch = Read(aErrorCode);
if (ch < 0) {
return PR_FALSE;
}
if (ch == aChar) {
return PR_TRUE;
}
Unread();
return PR_FALSE;
}
PRBool nsCSSScanner::EatWhiteSpace(PRInt32& aErrorCode)
{
PRBool eaten = PR_FALSE;
for (;;) {
PRInt32 ch = Read(aErrorCode);
if (ch < 0) {
break;
}
if ((ch == ' ') || (ch == '\n') || (ch == '\r') || (ch == '\t')) {
eaten = PR_TRUE;
continue;
}
Unread();
break;
}
return eaten;
}
PRBool nsCSSScanner::EatNewline(PRInt32& aErrorCode)
{
PRInt32 ch = Read(aErrorCode);
if (ch < 0) {
return PR_FALSE;
}
PRBool eaten = PR_FALSE;
if (ch == '\r') {
eaten = PR_TRUE;
ch = Peek(aErrorCode);
if (ch == '\n') {
(void) Read(aErrorCode);
}
} else if (ch == '\n') {
eaten = PR_TRUE;
} else {
Unread();
}
return eaten;
}
PRBool nsCSSScanner::Next(PRInt32& aErrorCode, nsCSSToken& aToken)
{
PRInt32 ch = Read(aErrorCode);
if (ch < 0) {
return PR_FALSE;
}
if (ch < 256) {
PRUint8* lexTable = gLexTable;
// IDENT
if ((lexTable[ch] & START_IDENT) != 0) {
return ParseIdent(aErrorCode, ch, aToken);
}
if (ch == '-') { // possible ident
PRInt32 nextChar = Peek(aErrorCode);
if ((0 <= nextChar) && (0 != (lexTable[nextChar] & START_IDENT))) {
return ParseIdent(aErrorCode, ch, aToken);
}
}
// AT_KEYWORD
if (ch == '@') {
PRInt32 nextChar = Peek(aErrorCode);
if ((nextChar >= 0) && (nextChar <= 255)) {
if ((lexTable[nextChar] & START_IDENT) != 0) {
return ParseAtKeyword(aErrorCode, ch, aToken);
}
}
}
// NUMBER or DIM
if ((ch == '.') || (ch == '+') || (ch == '-')) {
PRInt32 nextChar = Peek(aErrorCode);
if ((nextChar >= 0) && (nextChar <= 255)) {
if ((lexTable[nextChar] & IS_DIGIT) != 0) {
return ParseNumber(aErrorCode, ch, aToken);
}
else if (('.' == nextChar) && ('.' != ch)) {
PRInt32 holdNext = Read(aErrorCode);
nextChar = Peek(aErrorCode);
if ((0 <= nextChar) && (nextChar <= 255)) {
if ((lexTable[nextChar] & IS_DIGIT) != 0) {
Pushback(holdNext);
return ParseNumber(aErrorCode, ch, aToken);
}
}
Pushback(holdNext);
}
}
}
if ((lexTable[ch] & IS_DIGIT) != 0) {
return ParseNumber(aErrorCode, ch, aToken);
}
// ID
if (ch == '#') {
return ParseID(aErrorCode, ch, aToken);
}
// STRING
if ((ch == '"') || (ch == '\'')) {
return ParseString(aErrorCode, ch, aToken);
}
// WS
if ((lexTable[ch] & IS_WHITESPACE) != 0) {
aToken.mType = eCSSToken_WhiteSpace;
aToken.mIdent.SetLength(0);
aToken.mIdent.Append(PRUnichar(ch));
(void) EatWhiteSpace(aErrorCode);
return PR_TRUE;
}
if (ch == '/') {
PRInt32 nextChar = Peek(aErrorCode);
if (nextChar == '*') {
(void) Read(aErrorCode);
aToken.mIdent.SetLength(0);
aToken.mIdent.Append(PRUnichar(ch));
aToken.mIdent.Append(PRUnichar(nextChar));
return ParseCComment(aErrorCode, aToken);
}
}
if (ch == '<') { // consume HTML comment tags
if (LookAhead(aErrorCode, '!')) {
if (LookAhead(aErrorCode, '-')) {
if (LookAhead(aErrorCode, '-')) {
aToken.mType = eCSSToken_HTMLComment;
aToken.mIdent.SetLength(0);
aToken.mIdent.Append(PRUnichar('<'));
aToken.mIdent.Append(PRUnichar('!'));
aToken.mIdent.Append(PRUnichar('-'));
aToken.mIdent.Append(PRUnichar('-'));
return PR_TRUE;
}
Pushback('-');
}
Pushback('!');
}
}
if (ch == '-') { // check for HTML comment end
if (LookAhead(aErrorCode, '-')) {
if (LookAhead(aErrorCode, '>')) {
aToken.mType = eCSSToken_HTMLComment;
aToken.mIdent.SetLength(0);
aToken.mIdent.AppendWithConversion('-');
aToken.mIdent.AppendWithConversion('-');
aToken.mIdent.AppendWithConversion('>');
return PR_TRUE;
}
Pushback('-');
}
}
// INCLUDES ("~=") and DASHMATCH ("|=")
if (( ch == '|' ) || ( ch == '~')) {
PRInt32 nextChar = Read(aErrorCode);
if ( nextChar == '=' ) {
aToken.mType = (ch == '~') ? eCSSToken_Includes : eCSSToken_Dashmatch;
return PR_TRUE;
} else {
Pushback(nextChar);
}
}
} else {
return ParseIdent(aErrorCode, ch, aToken);
}
aToken.mType = eCSSToken_Symbol;
aToken.mSymbol = ch;
return PR_TRUE;
}
PRBool nsCSSScanner::NextURL(PRInt32& aErrorCode, nsCSSToken& aToken)
{
PRInt32 ch = Read(aErrorCode);
if (ch < 0) {
return PR_FALSE;
}
if (ch < 256) {
PRUint8* lexTable = gLexTable;
// STRING
if ((ch == '"') || (ch == '\'')) {
return ParseString(aErrorCode, ch, aToken);
}
// WS
if ((lexTable[ch] & IS_WHITESPACE) != 0) {
aToken.mType = eCSSToken_WhiteSpace;
aToken.mIdent.SetLength(0);
aToken.mIdent.Append(PRUnichar(ch));
(void) EatWhiteSpace(aErrorCode);
return PR_TRUE;
}
if (ch == '/') {
PRInt32 nextChar = Peek(aErrorCode);
if (nextChar == '*') {
(void) Read(aErrorCode);
aToken.mIdent.SetLength(0);
aToken.mIdent.Append(PRUnichar(ch));
aToken.mIdent.Append(PRUnichar(nextChar));
return ParseCComment(aErrorCode, aToken);
}
}
// Process a url lexical token. A CSS1 url token can contain
// characters beyond identifier characters (e.g. '/', ':', etc.)
// Because of this the normal rules for tokenizing the input don't
// apply very well. To simplify the parser and relax some of the
// requirements on the scanner we parse url's here. If we find a
// malformed URL then we emit a token of type "InvalidURL" so that
// the CSS1 parser can ignore the invalid input. We attempt to eat
// the right amount of input data when an invalid URL is presented.
aToken.mType = eCSSToken_InvalidURL;
nsString& ident = aToken.mIdent;
ident.SetLength(0);
if (ch == ')') {
Pushback(ch);
// empty url spec: this is invalid
} else {
// start of a non-quoted url
Pushback(ch);
PRBool ok = PR_TRUE;
for (;;) {
ch = Read(aErrorCode);
if (ch < 0) break;
if (ch == CSS_ESCAPE) {
ch = ParseEscape(aErrorCode);
if (0 < ch) {
ident.Append(PRUnichar(ch));
}
} else if ((ch == '"') || (ch == '\'') || (ch == '(')) {
// This is an invalid URL spec
ok = PR_FALSE;
} else if ((256 >= ch) && ((gLexTable[ch] & IS_WHITESPACE) != 0)) {
// Whitespace is allowed at the end of the URL
(void) EatWhiteSpace(aErrorCode);
if (LookAhead(aErrorCode, ')')) {
Pushback(')'); // leave the closing symbol
// done!
break;
}
// Whitespace is followed by something other than a
// ")". This is an invalid url spec.
ok = PR_FALSE;
} else if (ch == ')') {
Unread();
// All done
break;
} else {
// A regular url character.
ident.Append(PRUnichar(ch));
}
}
// If the result of the above scanning is ok then change the token
// type to a useful one.
if (ok) {
aToken.mType = eCSSToken_URL;
}
}
}
return PR_TRUE;
}
PRInt32 nsCSSScanner::ParseEscape(PRInt32& aErrorCode)
{
PRUint8* lexTable = gLexTable;
PRInt32 ch = Peek(aErrorCode);
if (ch < 0) {
return CSS_ESCAPE;
}
if ((ch <= 255) && ((lexTable[ch] & IS_HEX_DIGIT) != 0)) {
PRInt32 rv = 0;
int i;
for (i = 0; i < 6; i++) { // up to six digits
ch = Read(aErrorCode);
if (ch < 0) {
// Whoops: error or premature eof
break;
}
if ((lexTable[ch] & IS_HEX_DIGIT) != 0) {
if ((lexTable[ch] & IS_DIGIT) != 0) {
rv = rv * 16 + (ch - '0');
} else {
// Note: c&7 just keeps the low three bits which causes
// upper and lower case alphabetics to both yield their
// "relative to 10" value for computing the hex value.
rv = rv * 16 + ((ch & 0x7) + 9);
}
}
else if ((lexTable[ch] & IS_WHITESPACE) != 0) { // single space ends escape
if (ch == '\r') { // if CR/LF, eat LF too
ch = Peek(aErrorCode);
if (ch == '\n') {
ch = Read(aErrorCode);
}
}
break;
}
else {
Unread();
break;
}
}
if (6 == i) { // look for trailing whitespace and eat it
ch = Peek(aErrorCode);
if ((0 <= ch) && (ch <= 255) &&
((lexTable[ch] & IS_WHITESPACE) != 0)) {
ch = Read(aErrorCode);
// special case: if trailing whitespace is CR/LF, eat both chars (not part of spec, but should be)
if (ch == '\r') {
ch = Peek(aErrorCode);
if (ch == '\n') {
ch = Read(aErrorCode);
}
}
}
}
return rv;
} else {
// "Any character except a hexidecimal digit can be escaped to
// remove its special meaning by putting a backslash in front"
// -- CSS1 spec section 7.1
if (EatNewline(aErrorCode)) { // skip escaped newline
ch = 0;
}
else {
(void) Read(aErrorCode);
}
return ch;
}
}
/**
* Gather up the characters in an identifier. The identfier was
* started by "aChar" which will be appended to aIdent. The result
* will be aIdent with all of the identifier characters appended
* until the first non-identifier character is seen. The termination
* character is unread for the future re-reading.
*/
PRBool nsCSSScanner::GatherIdent(PRInt32& aErrorCode, PRInt32 aChar,
nsString& aIdent)
{
if (aChar == CSS_ESCAPE) {
aChar = ParseEscape(aErrorCode);
}
if (0 < aChar) {
aIdent.Append(PRUnichar(aChar));
}
for (;;) {
aChar = Read(aErrorCode);
if (aChar < 0) break;
if (aChar == CSS_ESCAPE) {
aChar = ParseEscape(aErrorCode);
if (0 < aChar) {
aIdent.Append(PRUnichar(aChar));
}
} else if ((aChar > 255) || ((gLexTable[aChar] & IS_IDENT) != 0)) {
aIdent.Append(PRUnichar(aChar));
} else {
Unread();
break;
}
}
return PR_TRUE;
}
PRBool nsCSSScanner::ParseID(PRInt32& aErrorCode,
PRInt32 aChar,
nsCSSToken& aToken)
{
aToken.mIdent.SetLength(0);
aToken.mType = eCSSToken_ID;
return GatherIdent(aErrorCode, 0, aToken.mIdent);
}
PRBool nsCSSScanner::ParseIdent(PRInt32& aErrorCode,
PRInt32 aChar,
nsCSSToken& aToken)
{
nsString& ident = aToken.mIdent;
ident.SetLength(0);
if (!GatherIdent(aErrorCode, aChar, ident)) {
return PR_FALSE;
}
nsCSSTokenType tokenType = eCSSToken_Ident;
// look for functions (ie: "ident(")
if (PRUnichar('(') == PRUnichar(Peek(aErrorCode))) { // this is a function definition
tokenType = eCSSToken_Function;
}
aToken.mType = tokenType;
return PR_TRUE;
}
PRBool nsCSSScanner::ParseAtKeyword(PRInt32& aErrorCode, PRInt32 aChar,
nsCSSToken& aToken)
{
aToken.mIdent.SetLength(0);
aToken.mType = eCSSToken_AtKeyword;
return GatherIdent(aErrorCode, 0, aToken.mIdent);
}
PRBool nsCSSScanner::ParseNumber(PRInt32& aErrorCode, PRInt32 c,
nsCSSToken& aToken)
{
nsString& ident = aToken.mIdent;
ident.SetLength(0);
PRBool gotDot = (c == '.') ? PR_TRUE : PR_FALSE;
if (c != '+') {
ident.Append(PRUnichar(c));
}
// Gather up characters that make up the number
PRUint8* lexTable = gLexTable;
for (;;) {
c = Read(aErrorCode);
if (c < 0) break;
if (!gotDot && (c == '.')) {
gotDot = PR_TRUE;
} else if ((c > 255) || ((lexTable[c] & IS_DIGIT) == 0)) {
break;
}
ident.Append(PRUnichar(c));
}
// Convert number to floating point
nsCSSTokenType type = eCSSToken_Number;
PRInt32 ec;
float value = ident.ToFloat(&ec);
// Look at character that terminated the number
aToken.mIntegerValid = PR_FALSE;
if (c >= 0) {
if ((c <= 255) && ((lexTable[c] & START_IDENT) != 0)) {
ident.SetLength(0);
if (!GatherIdent(aErrorCode, c, ident)) {
return PR_FALSE;
}
type = eCSSToken_Dimension;
} else if ('%' == c) {
type = eCSSToken_Percentage;
value = value / 100.0f;
ident.SetLength(0);
} else {
// Put back character that stopped numeric scan
Unread();
if (!gotDot) {
aToken.mInteger = ident.ToInteger(&ec);
aToken.mIntegerValid = PR_TRUE;
}
ident.SetLength(0);
}
}
else { // stream ended
if (!gotDot) {
aToken.mInteger = ident.ToInteger(&ec);
aToken.mIntegerValid = PR_TRUE;
}
ident.SetLength(0);
}
aToken.mNumber = value;
aToken.mType = type;
return PR_TRUE;
}
PRBool nsCSSScanner::ParseCComment(PRInt32& aErrorCode, nsCSSToken& aToken)
{
nsString& ident = aToken.mIdent;
for (;;) {
PRInt32 ch = Read(aErrorCode);
if (ch < 0) break;
if (ch == '*') {
if (LookAhead(aErrorCode, '/')) {
ident.Append(PRUnichar(ch)); // STRING USE WARNING: technically, this should be |AppendWithConversion|
ident.AppendWithConversion('/');
break;
}
}
#ifdef COLLECT_WHITESPACE
ident.Append(PRUnichar(ch));
#endif
}
aToken.mType = eCSSToken_WhiteSpace;
return PR_TRUE;
}
#if 0
PRBool nsCSSScanner::ParseEOLComment(PRInt32& aErrorCode, nsCSSToken& aToken)
{
nsString& ident = aToken.mIdent;
ident.SetLength(0);
for (;;) {
if (EatNewline(aErrorCode)) {
break;
}
PRInt32 ch = Read(aErrorCode);
if (ch < 0) {
break;
}
#ifdef COLLECT_WHITESPACE
ident.Append(PRUnichar(ch));
#endif
}
aToken.mType = eCSSToken_WhiteSpace;
return PR_TRUE;
}
#endif // 0
PRBool nsCSSScanner::GatherString(PRInt32& aErrorCode, PRInt32 aStop,
nsString& aBuffer)
{
for (;;) {
if (EatNewline(aErrorCode)) {
break;
}
PRInt32 ch = Read(aErrorCode);
if (ch < 0) {
return PR_FALSE;
}
if (ch == aStop) {
break;
}
if (ch == CSS_ESCAPE) {
ch = ParseEscape(aErrorCode);
if (ch < 0) {
return PR_FALSE;
}
}
if (0 < ch) {
aBuffer.Append(PRUnichar(ch));
}
}
return PR_TRUE;
}
PRBool nsCSSScanner::ParseString(PRInt32& aErrorCode, PRInt32 aStop,
nsCSSToken& aToken)
{
aToken.mIdent.SetLength(0);
aToken.mType = eCSSToken_String;
aToken.mSymbol = PRUnichar(aStop); // remember how it's quoted
return GatherString(aErrorCode, aStop, aToken.mIdent);
}

Просмотреть файл

@ -86,7 +86,7 @@ static NS_DEFINE_IID(kCSSPageSID, NS_CSS_PAGE_SID);
#define NS_IF_DELETE(ptr) \
if (nsnull != ptr) { delete ptr; ptr = nsnull; }
MOZ_DECL_CTOR_COUNTER(nsAtomList);
MOZ_DECL_CTOR_COUNTER(nsAtomList)
nsAtomList::nsAtomList(nsIAtom* aAtom)
: mAtom(aAtom),
@ -136,7 +136,7 @@ PRBool nsAtomList::Equals(const nsAtomList* aOther) const
return PR_FALSE;
}
MOZ_DECL_CTOR_COUNTER(nsAttrSelector);
MOZ_DECL_CTOR_COUNTER(nsAttrSelector)
#ifdef DEBUG_REFS
PRUint32 gAttrSelectorCount=0;
@ -275,7 +275,7 @@ void nsAttrSelector::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize)
}
}
MOZ_DECL_CTOR_COUNTER(nsCSSSelector);
MOZ_DECL_CTOR_COUNTER(nsCSSSelector)
#ifdef DEBUG_REFS
PRUint32 gSelectorCount=0;
@ -907,7 +907,7 @@ protected:
nsICSSStyleRule *mRule;
};
MOZ_DECL_CTOR_COUNTER(DOMCSSDeclarationImpl);
MOZ_DECL_CTOR_COUNTER(DOMCSSDeclarationImpl)
DOMCSSDeclarationImpl::DOMCSSDeclarationImpl(nsICSSStyleRule *aRule)
{

Просмотреть файл

@ -1354,7 +1354,7 @@ void CSSStyleSheetImpl::operator delete(void* ptr)
}
}
MOZ_DECL_CTOR_COUNTER(CSSStyleSheetImpl);
MOZ_DECL_CTOR_COUNTER(CSSStyleSheetImpl)
CSSStyleSheetImpl::CSSStyleSheetImpl()
: nsICSSStyleSheet(),

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -513,7 +513,7 @@ public:
} mHash;
};
MOZ_DECL_CTOR_COUNTER(AttributeKey);
MOZ_DECL_CTOR_COUNTER(AttributeKey)
AttributeKey::AttributeKey(nsIHTMLMappedAttributes* aAttributes)
: mAttributes(aAttributes)

Просмотреть файл

@ -69,7 +69,7 @@ PRBool CanAllocate(PRInt32 aType,
/* ---------- BasicTableLayoutStrategy ---------- */
MOZ_DECL_CTOR_COUNTER(BasicTableLayoutStrategy);
MOZ_DECL_CTOR_COUNTER(BasicTableLayoutStrategy)
BasicTableLayoutStrategy::BasicTableLayoutStrategy(nsTableFrame *aFrame, PRBool aIsNavQuirks)

Просмотреть файл

@ -32,7 +32,7 @@
// CellData
MOZ_DECL_CTOR_COUNTER(CellData);
MOZ_DECL_CTOR_COUNTER(CellData)
CellData::CellData(nsTableCellFrame* aOrigCell)
{
@ -45,7 +45,7 @@ CellData::~CellData()
MOZ_COUNT_DTOR(CellData);
}
MOZ_DECL_CTOR_COUNTER(nsCellMap);
MOZ_DECL_CTOR_COUNTER(nsCellMap)
// nsTableCellMap

Просмотреть файл

@ -63,7 +63,7 @@ static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CI
class CSSLoaderImpl;
MOZ_DECL_CTOR_COUNTER(URLKey);
MOZ_DECL_CTOR_COUNTER(URLKey)
class URLKey: public nsHashKey {
public:
@ -174,7 +174,7 @@ public:
NS_IMPL_ISUPPORTS1(SheetLoadData, nsIStreamLoaderObserver);
MOZ_DECL_CTOR_COUNTER(PendingSheetData);
MOZ_DECL_CTOR_COUNTER(PendingSheetData)
struct PendingSheetData {
PendingSheetData(nsICSSStyleSheet* aSheet, PRInt32 aDocIndex,

Просмотреть файл

@ -59,7 +59,7 @@
//#define ENABLE_COUNTERS // un-comment this to enable counters (bug 15174)
MOZ_DECL_CTOR_COUNTER(SelectorList);
MOZ_DECL_CTOR_COUNTER(SelectorList)
// e.g. "P B, H1 B { ... }" has a selector list with two elements,
// each of which has two selectors.

Просмотреть файл

@ -158,7 +158,7 @@ nsCSSToken::AppendToString(nsString& aBuffer)
}
}
MOZ_DECL_CTOR_COUNTER(nsCSSScanner);
MOZ_DECL_CTOR_COUNTER(nsCSSScanner)
nsCSSScanner::nsCSSScanner()
{

Просмотреть файл

@ -86,7 +86,7 @@ static NS_DEFINE_IID(kCSSPageSID, NS_CSS_PAGE_SID);
#define NS_IF_DELETE(ptr) \
if (nsnull != ptr) { delete ptr; ptr = nsnull; }
MOZ_DECL_CTOR_COUNTER(nsAtomList);
MOZ_DECL_CTOR_COUNTER(nsAtomList)
nsAtomList::nsAtomList(nsIAtom* aAtom)
: mAtom(aAtom),
@ -136,7 +136,7 @@ PRBool nsAtomList::Equals(const nsAtomList* aOther) const
return PR_FALSE;
}
MOZ_DECL_CTOR_COUNTER(nsAttrSelector);
MOZ_DECL_CTOR_COUNTER(nsAttrSelector)
#ifdef DEBUG_REFS
PRUint32 gAttrSelectorCount=0;
@ -275,7 +275,7 @@ void nsAttrSelector::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize)
}
}
MOZ_DECL_CTOR_COUNTER(nsCSSSelector);
MOZ_DECL_CTOR_COUNTER(nsCSSSelector)
#ifdef DEBUG_REFS
PRUint32 gSelectorCount=0;
@ -907,7 +907,7 @@ protected:
nsICSSStyleRule *mRule;
};
MOZ_DECL_CTOR_COUNTER(DOMCSSDeclarationImpl);
MOZ_DECL_CTOR_COUNTER(DOMCSSDeclarationImpl)
DOMCSSDeclarationImpl::DOMCSSDeclarationImpl(nsICSSStyleRule *aRule)
{

Просмотреть файл

@ -1354,7 +1354,7 @@ void CSSStyleSheetImpl::operator delete(void* ptr)
}
}
MOZ_DECL_CTOR_COUNTER(CSSStyleSheetImpl);
MOZ_DECL_CTOR_COUNTER(CSSStyleSheetImpl)
CSSStyleSheetImpl::CSSStyleSheetImpl()
: nsICSSStyleSheet(),

Просмотреть файл

@ -513,7 +513,7 @@ public:
} mHash;
};
MOZ_DECL_CTOR_COUNTER(AttributeKey);
MOZ_DECL_CTOR_COUNTER(AttributeKey)
AttributeKey::AttributeKey(nsIHTMLMappedAttributes* aAttributes)
: mAttributes(aAttributes)

Просмотреть файл

@ -1528,7 +1528,7 @@ StyleSetImpl::PrintTimer(PRUint32 aTimerID)
// this is a comprimise between a sorted-list based lookup and a hash-type
// lookup which is not possible due to non-guaranteed-unique keys.
MOZ_DECL_CTOR_COUNTER(StyleContextCache);
MOZ_DECL_CTOR_COUNTER(StyleContextCache)
StyleContextCache::StyleContextCache(void)
:mHashTable(nsnull, nsnull, HashTableEnumDestroy, nsnull),

Просмотреть файл

@ -69,7 +69,7 @@ PRBool CanAllocate(PRInt32 aType,
/* ---------- BasicTableLayoutStrategy ---------- */
MOZ_DECL_CTOR_COUNTER(BasicTableLayoutStrategy);
MOZ_DECL_CTOR_COUNTER(BasicTableLayoutStrategy)
BasicTableLayoutStrategy::BasicTableLayoutStrategy(nsTableFrame *aFrame, PRBool aIsNavQuirks)

Просмотреть файл

@ -32,7 +32,7 @@
// CellData
MOZ_DECL_CTOR_COUNTER(CellData);
MOZ_DECL_CTOR_COUNTER(CellData)
CellData::CellData(nsTableCellFrame* aOrigCell)
{
@ -45,7 +45,7 @@ CellData::~CellData()
MOZ_COUNT_DTOR(CellData);
}
MOZ_DECL_CTOR_COUNTER(nsCellMap);
MOZ_DECL_CTOR_COUNTER(nsCellMap)
// nsTableCellMap

Просмотреть файл

@ -214,7 +214,7 @@ nsCSecurityContext::GetCertificateID(char* buf, int buflen)
// from nsCSecurityContext:
extern PRUintn tlsIndex3_g;
MOZ_DECL_CTOR_COUNTER(nsCSecurityContext);
MOZ_DECL_CTOR_COUNTER(nsCSecurityContext)
nsCSecurityContext::nsCSecurityContext(JSContext* cx)
: m_pJStoJavaFrame(NULL), m_pJSCX(cx),

Просмотреть файл

@ -33,7 +33,7 @@
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
MOZ_DECL_CTOR_COUNTER(nsAuthEngine);
MOZ_DECL_CTOR_COUNTER(nsAuthEngine)
nsAuthEngine::nsAuthEngine()
{

Просмотреть файл

@ -25,7 +25,7 @@
#include "nsToken.h"
#include "prenv.h"
MOZ_DECL_CTOR_COUNTER(CParserContext);
MOZ_DECL_CTOR_COUNTER(CParserContext)
/**
* Your friendly little constructor. Ok, it's not the friendly, but the only guy

Просмотреть файл

@ -30,11 +30,11 @@
#include "nsIObserverService.h"
#include "nsIServiceManager.h"
MOZ_DECL_CTOR_COUNTER(nsEntryStack);
MOZ_DECL_CTOR_COUNTER(nsDTDContext);
MOZ_DECL_CTOR_COUNTER(nsTokenAllocator);
MOZ_DECL_CTOR_COUNTER(CNodeRecycler);
MOZ_DECL_CTOR_COUNTER(CObserverService);
MOZ_DECL_CTOR_COUNTER(nsEntryStack)
MOZ_DECL_CTOR_COUNTER(nsDTDContext)
MOZ_DECL_CTOR_COUNTER(nsTokenAllocator)
MOZ_DECL_CTOR_COUNTER(CNodeRecycler)
MOZ_DECL_CTOR_COUNTER(CObserverService)
/**************************************************************************************

Просмотреть файл

@ -69,7 +69,7 @@ const int kBufsize=1;
const int kBufsize=64;
#endif
MOZ_DECL_CTOR_COUNTER(nsScanner);
MOZ_DECL_CTOR_COUNTER(nsScanner)
/**
* Use this constructor if you want i/o to be based on

Просмотреть файл

@ -25,7 +25,7 @@
#ifdef MATCH_CTOR_DTOR
MOZ_DECL_CTOR_COUNTER(CToken);
MOZ_DECL_CTOR_COUNTER(CToken)
#endif
static int TokenCount=0;

Просмотреть файл

@ -1,94 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
/**
* MODULE NOTES:
* @update gess 4/1/98
*
*/
#include "nsTokenHandler.h"
#include "nsDebug.h"
#include "nsIDTD.h"
#include "nsToken.h"
#include "nsIParser.h"
MOZ_DECL_CTOR_COUNTER(CTokenHandler);
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CTokenHandler::CTokenHandler(dispatchFP aFP,PRInt32 aType){
MOZ_COUNT_CTOR(CTokenHandler);
mType=aType;
mFP=aFP;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CTokenHandler::~CTokenHandler(){
MOZ_COUNT_DTOR(CTokenHandler);
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRInt32 CTokenHandler::GetTokenType(void){
return mType;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
nsresult CTokenHandler::operator()(CToken* aToken,nsIDTD* aDTD){
nsresult result=NS_OK;
if((0!=aDTD) && (0!=mFP)) {
result=(*mFP)(aToken,aDTD);
}
return result;
}

Просмотреть файл

@ -143,7 +143,7 @@ typedef enum {
eRDFContentSinkState_InEpilog
} RDFContentSinkState;
MOZ_DECL_CTOR_COUNTER(RDFContentSinkImpl::NameSpaceEntry);
MOZ_DECL_CTOR_COUNTER(RDFContentSinkImpl::NameSpaceEntry)
class RDFContentSinkImpl : public nsIRDFContentSink
{

Просмотреть файл

@ -207,7 +207,7 @@ nsCID_Destroy(nsHashKey *aKey, void *aData, void* closure);
// nsFactoryEntry
////////////////////////////////////////////////////////////////////////////////
MOZ_DECL_CTOR_COUNTER(nsFactoryEntry);
MOZ_DECL_CTOR_COUNTER(nsFactoryEntry)
nsFactoryEntry::nsFactoryEntry(const nsCID &aClass,
const char *aLocation,

Просмотреть файл

@ -197,7 +197,7 @@ static PRIntn PR_CALLBACK _hashEnumerate(PLHashEntry *he, PRIntn i, void *arg)
// HashKey
//
MOZ_DECL_CTOR_COUNTER(nsHashKey);
MOZ_DECL_CTOR_COUNTER(nsHashKey)
nsHashKey::nsHashKey(void)
{
@ -212,7 +212,7 @@ nsHashKey::~nsHashKey(void)
MOZ_COUNT_DTOR(nsHashKey);
}
MOZ_DECL_CTOR_COUNTER(nsHashtable);
MOZ_DECL_CTOR_COUNTER(nsHashtable)
nsHashtable::nsHashtable(PRUint32 aInitSize, PRBool threadSafe)
: mLock(NULL), mEnumerating(PR_FALSE)

Просмотреть файл

@ -65,7 +65,7 @@ public:
//----------------------------------------------------------------------
MOZ_DECL_CTOR_COUNTER(SizeOfDataStats);
MOZ_DECL_CTOR_COUNTER(SizeOfDataStats)
SizeOfDataStats::SizeOfDataStats(nsIAtom* aType, PRUint32 aSize)
: mType(aType),

Просмотреть файл

@ -24,7 +24,7 @@
#include "xptiprivate.h"
MOZ_DECL_CTOR_COUNTER(xptiFile);
MOZ_DECL_CTOR_COUNTER(xptiFile)
xptiFile::xptiFile()
: mSize(),

Просмотреть файл

@ -54,7 +54,7 @@ xptiFileType::Type xptiFileType::GetType(const char* name)
/***************************************************************************/
MOZ_DECL_CTOR_COUNTER(xptiAutoLog);
MOZ_DECL_CTOR_COUNTER(xptiAutoLog)
xptiAutoLog::xptiAutoLog(xptiInterfaceInfoManager* mgr,
nsILocalFile* logfile, PRBool append)

Просмотреть файл

@ -24,7 +24,7 @@
#include "xptiprivate.h"
MOZ_DECL_CTOR_COUNTER(xptiTypelibGuts);
MOZ_DECL_CTOR_COUNTER(xptiTypelibGuts)
xptiTypelibGuts::xptiTypelibGuts(XPTHeader* aHeader)
: mHeader(aHeader),

Просмотреть файл

@ -40,7 +40,7 @@ xpti_CompareIIDs(const void *v1, const void *v2)
return (PRIntn) ((const nsID*)v1)->Equals(*((const nsID*)v2));
}
MOZ_DECL_CTOR_COUNTER(xptiWorkingSet);
MOZ_DECL_CTOR_COUNTER(xptiWorkingSet)
xptiWorkingSet::xptiWorkingSet()
: mFileCount(0),

Просмотреть файл

@ -24,7 +24,7 @@
#include "xptiprivate.h"
MOZ_DECL_CTOR_COUNTER(xptiZipItem);
MOZ_DECL_CTOR_COUNTER(xptiZipItem)
xptiZipItem::xptiZipItem()
: mName(nsnull),

Просмотреть файл

@ -36,7 +36,7 @@
* Constructors/Destructor
*----------------------------------------------------------------------*/
#ifdef MOZILLA_CLIENT
MOZ_DECL_CTOR_COUNTER(nsAppleSingleDecoder);
MOZ_DECL_CTOR_COUNTER(nsAppleSingleDecoder)
#endif
nsAppleSingleDecoder::nsAppleSingleDecoder(FSSpec *inSpec, FSSpec *outSpec)

Просмотреть файл

@ -89,7 +89,7 @@ static NS_DEFINE_CID(kCommonDialogsCID, NS_CommonDialog_CID);
static NS_DEFINE_CID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);
static NS_DEFINE_IID(kIStringBundleServiceIID, NS_ISTRINGBUNDLESERVICE_IID);
MOZ_DECL_CTOR_COUNTER(nsInstallInfo);
MOZ_DECL_CTOR_COUNTER(nsInstallInfo)
nsInstallInfo::nsInstallInfo(PRUint32 aInstallType,
nsIFile* aFile,
@ -126,7 +126,7 @@ static NS_DEFINE_IID(kSoftwareUpdateCID, NS_SoftwareUpdate_CID);
static NS_DEFINE_IID(kIZipReaderIID, NS_IZIPREADER_IID);
static NS_DEFINE_IID(kZipReaderCID, NS_ZIPREADER_CID);
MOZ_DECL_CTOR_COUNTER(nsInstall);
MOZ_DECL_CTOR_COUNTER(nsInstall)
nsInstall::nsInstall(nsIZipReader * theJARFile)
{

Просмотреть файл

@ -1,301 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Daniel Veditz <dveditz@netscape.com>
* Douglas Turner <dougt@netscape.com>
*/
#include "prmem.h"
#include "nsFileSpec.h"
#include "VerReg.h"
#include "ScheduledTasks.h"
#include "nsInstallDelete.h"
#include "nsInstallResources.h"
#include "nsInstall.h"
#include "nsIDOMInstallVersion.h"
MOZ_DECL_CTOR_COUNTER(nsInstallDelete);
nsInstallDelete::nsInstallDelete( nsInstall* inInstall,
nsInstallFolder* folderSpec,
const nsString& inPartialPath,
PRInt32 *error)
: nsInstallObject(inInstall)
{
MOZ_COUNT_CTOR(nsInstallDelete);
if ((folderSpec == nsnull) || (inInstall == nsnull))
{
*error = nsInstall::INVALID_ARGUMENTS;
return;
}
mDeleteStatus = DELETE_FILE;
mFinalFile = nsnull;
nsCOMPtr<nsIFile> tmp = folderSpec->GetFileSpec();
if (!tmp)
{
*error = nsInstall::INVALID_ARGUMENTS;
return;
}
tmp->Clone(getter_AddRefs(mFinalFile));;
if (mFinalFile == nsnull)
{
*error = nsInstall::OUT_OF_MEMORY;
return;
}
nsAutoCString tempPartialPath(inPartialPath);
mFinalFile->Append(tempPartialPath);
*error = ProcessInstallDelete();
}
nsInstallDelete::nsInstallDelete( nsInstall* inInstall,
const nsString& inComponentName,
PRInt32 *error)
: nsInstallObject(inInstall)
{
MOZ_COUNT_CTOR(nsInstallDelete);
if (inInstall == NULL)
{
*error = nsInstall::INVALID_ARGUMENTS;
return;
}
mDeleteStatus = DELETE_COMPONENT;
mFinalFile = nsnull;
mRegistryName = inComponentName;
*error = ProcessInstallDelete();
}
nsInstallDelete::~nsInstallDelete()
{
MOZ_COUNT_DTOR(nsInstallDelete);
}
PRInt32 nsInstallDelete::Prepare()
{
// no set-up necessary
return nsInstall::SUCCESS;
}
PRInt32 nsInstallDelete::Complete()
{
PRInt32 err = nsInstall::SUCCESS;
if (mInstall == NULL)
return nsInstall::INVALID_ARGUMENTS;
if (mDeleteStatus == DELETE_COMPONENT)
{
char* temp = mRegistryName.ToNewCString();
if (temp)
{
err = VR_Remove(temp);
Recycle(temp);
}
}
if ((mDeleteStatus == DELETE_FILE) || (err == REGERR_OK))
{
err = NativeComplete();
}
else
{
err = nsInstall::UNEXPECTED_ERROR;
}
return err;
}
void nsInstallDelete::Abort()
{
}
char* nsInstallDelete::toString()
{
char* buffer = new char[1024];
char* rsrcVal = nsnull;
if (buffer == nsnull || !mInstall)
return nsnull;
if (mDeleteStatus == DELETE_COMPONENT)
{
char* temp = mRegistryName.ToNewCString();
rsrcVal = mInstall->GetResourcedString(NS_ConvertASCIItoUCS2("DeleteComponent"));
if (rsrcVal)
{
sprintf( buffer, rsrcVal, temp);
nsCRT::free(rsrcVal);
}
if (temp)
Recycle(temp);
}
else
{
if (mFinalFile)
{
rsrcVal = mInstall->GetResourcedString(NS_ConvertASCIItoUCS2("DeleteComponent"));
if (rsrcVal)
{
char* temp;
mFinalFile->GetPath(&temp);
sprintf( buffer, rsrcVal, temp);
nsCRT::free(rsrcVal);
}
}
}
return buffer;
}
PRBool
nsInstallDelete::CanUninstall()
{
return PR_FALSE;
}
PRBool
nsInstallDelete::RegisterPackageNode()
{
return PR_FALSE;
}
PRInt32 nsInstallDelete::ProcessInstallDelete()
{
PRInt32 err;
char* tempCString = nsnull;
if (mDeleteStatus == DELETE_COMPONENT)
{
/* Check if the component is in the registry */
tempCString = mRegistryName.ToNewCString();
if (tempCString == nsnull)
return nsInstall::OUT_OF_MEMORY;
err = VR_InRegistry( tempCString );
if (err != REGERR_OK)
{
return err;
}
else
{
char* tempRegistryString;
tempRegistryString = (char*)PR_Calloc(MAXREGPATHLEN, sizeof(char));
if (tempRegistryString == nsnull)
return nsInstall::OUT_OF_MEMORY;
err = VR_GetPath( tempCString , MAXREGPATHLEN, tempRegistryString);
if (err == REGERR_OK)
{
//if (mFinalFile)
// delete mFinalFile;
nsCOMPtr<nsILocalFile> tempLocalFile;
NS_NewLocalFile(tempRegistryString, PR_TRUE, getter_AddRefs(tempLocalFile));
mFinalFile = tempLocalFile;
if (mFinalFile == nsnull)
return nsInstall::OUT_OF_MEMORY;
}
PR_FREEIF(tempRegistryString);
}
}
if(tempCString)
Recycle(tempCString);
PRBool flagExists, flagIsFile;
mFinalFile->Exists(&flagExists);
if (flagExists)
{
mFinalFile->IsFile(&flagIsFile);
if (flagIsFile)
{
err = nsInstall::SUCCESS;
}
else
{
err = nsInstall::IS_DIRECTORY;
}
}
else
{
err = nsInstall::DOES_NOT_EXIST;
}
return err;
}
PRInt32 nsInstallDelete::NativeComplete()
{
PRBool flagExists, flagIsFile;
mFinalFile->Exists(&flagExists);
NS_WARN_IF_FALSE(flagExists,"nsInstallDelete::Complete -- file should exist!");
if (flagExists)
{
mFinalFile->IsFile(&flagIsFile);
if (flagIsFile)
{
return DeleteFileNowOrSchedule(mFinalFile);
}
else
{
NS_ASSERTION(0,"nsInstallDelete::Complete -- expected file was a directory!");
return nsInstall::IS_DIRECTORY;
}
}
return nsInstall::DOES_NOT_EXIST;
}

Просмотреть файл

@ -40,7 +40,7 @@
static NS_DEFINE_CID(kIProcessCID, NS_PROCESS_CID);
MOZ_DECL_CTOR_COUNTER(nsInstallExecute);
MOZ_DECL_CTOR_COUNTER(nsInstallExecute)
nsInstallExecute:: nsInstallExecute( nsInstall* inInstall,
const nsString& inJarLocation,

Просмотреть файл

@ -44,7 +44,7 @@
inFinalFileSpec - final location on disk
*/
MOZ_DECL_CTOR_COUNTER(nsInstallFile);
MOZ_DECL_CTOR_COUNTER(nsInstallFile)
nsInstallFile::nsInstallFile(nsInstall* inInstall,
const nsString& inComponentName,

Просмотреть файл

@ -46,7 +46,7 @@ static NS_DEFINE_CID(kIProcessCID, NS_PROCESS_CID);
/* Public Methods */
MOZ_DECL_CTOR_COUNTER(nsInstallFileOpItem);
MOZ_DECL_CTOR_COUNTER(nsInstallFileOpItem)
nsInstallFileOpItem::nsInstallFileOpItem(nsInstall* aInstallObj,
PRInt32 aCommand,

Просмотреть файл

@ -87,7 +87,7 @@ struct DirectoryTable DirectoryTable[] =
};
MOZ_DECL_CTOR_COUNTER(nsInstallFolder);
MOZ_DECL_CTOR_COUNTER(nsInstallFolder)
nsInstallFolder::nsInstallFolder()
{

Просмотреть файл

@ -37,7 +37,7 @@
#include "nsInstall.h"
#include "nsIDOMInstallVersion.h"
MOZ_DECL_CTOR_COUNTER(nsInstallLogComment);
MOZ_DECL_CTOR_COUNTER(nsInstallLogComment)
nsInstallLogComment::nsInstallLogComment( nsInstall* inInstall,
const nsString& inFileOpCommand,

Просмотреть файл

@ -66,7 +66,7 @@ static int32 gdiff_validateFile( pDIFFDATA dd, int file );
static PRBool su_unbind(char* oldsrc, char* newsrc);
#endif
MOZ_DECL_CTOR_COUNTER(nsInstallPatch);
MOZ_DECL_CTOR_COUNTER(nsInstallPatch)
nsInstallPatch::nsInstallPatch( nsInstall* inInstall,
const nsString& inVRName,

Просмотреть файл

@ -34,7 +34,7 @@
extern "C" NS_EXPORT PRInt32 SU_Uninstall(char *regPackageName);
REGERR su_UninstallProcessItem(char *component_path);
MOZ_DECL_CTOR_COUNTER(nsInstallUninstall);
MOZ_DECL_CTOR_COUNTER(nsInstallUninstall)
nsInstallUninstall::nsInstallUninstall( nsInstall* inInstall,
const nsString& regName,

Просмотреть файл

@ -32,7 +32,7 @@
#include "nsIDirectoryService.h"
#include "nsDirectoryServiceDefs.h"
MOZ_DECL_CTOR_COUNTER(nsRegisterItem);
MOZ_DECL_CTOR_COUNTER(nsRegisterItem)
nsRegisterItem:: nsRegisterItem( nsInstall* inInstall,
nsIFile* chrome,

Просмотреть файл

@ -27,7 +27,7 @@
/* Public Methods */
MOZ_DECL_CTOR_COUNTER(nsWinProfile);
MOZ_DECL_CTOR_COUNTER(nsWinProfile)
nsWinProfile::nsWinProfile( nsInstall* suObj, const nsString& folder, const nsString& file )
{

Просмотреть файл

@ -27,7 +27,7 @@
/* Public Methods */
MOZ_DECL_CTOR_COUNTER(nsWinProfileItem);
MOZ_DECL_CTOR_COUNTER(nsWinProfileItem)
nsWinProfileItem::nsWinProfileItem(nsWinProfile* profileObj,
nsString sectionName,

Просмотреть файл

@ -26,7 +26,7 @@
/* Public Methods */
MOZ_DECL_CTOR_COUNTER(nsWinReg);
MOZ_DECL_CTOR_COUNTER(nsWinReg)
nsWinReg::nsWinReg(nsInstall* suObj)
{

Просмотреть файл

@ -29,7 +29,7 @@
/* Public Methods */
MOZ_DECL_CTOR_COUNTER(nsWinRegItem);
MOZ_DECL_CTOR_COUNTER(nsWinRegItem)
nsWinRegItem::nsWinRegItem(nsWinReg* regObj, PRInt32 root, PRInt32 action, const nsString& sub, const nsString& valname, const nsString& val, PRInt32 *aReturn)
: nsInstallObject(regObj->InstallObject())

Просмотреть файл

@ -34,7 +34,7 @@ static NS_DEFINE_IID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
//
// nsXPITriggerItem
//
MOZ_DECL_CTOR_COUNTER(nsXPITriggerItem);
MOZ_DECL_CTOR_COUNTER(nsXPITriggerItem)
nsXPITriggerItem::nsXPITriggerItem( const PRUnichar* aName,
const PRUnichar* aURL,
@ -77,7 +77,7 @@ PRBool nsXPITriggerItem::IsRelativeURL()
// nsXPITriggerInfo
//
MOZ_DECL_CTOR_COUNTER(nsXPITriggerInfo);
MOZ_DECL_CTOR_COUNTER(nsXPITriggerInfo)
nsXPITriggerInfo::nsXPITriggerInfo()
: mCx(0), mGlobal(JSVAL_NULL), mCbval(JSVAL_NULL)