--- a/xpcom/base/FunctionTimer.h
+++ b/xpcom/base/FunctionTimer.h
@@ -128,32 +128,32 @@
#define NS_TIME_FUNCTION_ELAPSED (0)
#define NS_TIME_FUNCTION_ELAPSED_SINCE_MARK (0)
#define NS_TIME_FUNCTION_LATEST (mozilla::TimeDuration(0))
#endif
namespace mozilla {
-class NS_COM FunctionTimerLog
+class FunctionTimerLog
{
public:
FunctionTimerLog(const char *fname);
~FunctionTimerLog();
void LogString(const char *str);
TimeDuration LatestSinceStartup() const;
private:
void *mFile;
TimeStamp mLatest;
};
-class NS_COM FunctionTimer
+class FunctionTimer
{
static nsAutoPtr<FunctionTimerLog> sLog;
static char *sBuf1;
static char *sBuf2;
static int sBufSize;
static unsigned sDepth;
enum { BUF_LOG_LENGTH = 1024 };
--- a/xpcom/base/nsCycleCollector.h
+++ b/xpcom/base/nsCycleCollector.h
@@ -59,18 +59,18 @@ struct nsCycleCollectionLanguageRuntime
virtual nsCycleCollectionParticipant *ToParticipant(void *p) = 0;
#ifdef DEBUG_CC
virtual void PrintAllReferencesTo(void *p) = 0;
#endif
};
nsresult nsCycleCollector_startup();
// Returns the number of collected nodes.
-NS_COM PRUint32 nsCycleCollector_collect(nsICycleCollectorListener *aListener);
-NS_COM PRUint32 nsCycleCollector_suspectedCount();
+PRUint32 nsCycleCollector_collect(nsICycleCollectorListener *aListener);
+PRUint32 nsCycleCollector_suspectedCount();
void nsCycleCollector_shutdownThreads();
void nsCycleCollector_shutdown();
// The JS runtime is special, it needs to call cycle collection during its GC.
// If the JS runtime is registered nsCycleCollector_collect will call
// nsCycleCollectionJSRuntime::Collect which will call
// nsCycleCollector_doCollect, else nsCycleCollector_collect will call
// nsCycleCollector_doCollect directly.
@@ -83,25 +83,25 @@ struct nsCycleCollectionJSRuntime : publ
/**
* Runs the JavaScript GC.
*/
virtual void Collect() = 0;
};
#ifdef DEBUG
-NS_COM void nsCycleCollector_DEBUG_shouldBeFreed(nsISupports *n);
-NS_COM void nsCycleCollector_DEBUG_wasFreed(nsISupports *n);
+void nsCycleCollector_DEBUG_shouldBeFreed(nsISupports *n);
+void nsCycleCollector_DEBUG_wasFreed(nsISupports *n);
#endif
// Helpers for interacting with language-identified scripts
-NS_COM void nsCycleCollector_registerRuntime(PRUint32 langID, nsCycleCollectionLanguageRuntime *rt);
-NS_COM nsCycleCollectionLanguageRuntime * nsCycleCollector_getRuntime(PRUint32 langID);
-NS_COM void nsCycleCollector_forgetRuntime(PRUint32 langID);
+void nsCycleCollector_registerRuntime(PRUint32 langID, nsCycleCollectionLanguageRuntime *rt);
+nsCycleCollectionLanguageRuntime * nsCycleCollector_getRuntime(PRUint32 langID);
+void nsCycleCollector_forgetRuntime(PRUint32 langID);
#define NS_CYCLE_COLLECTOR_LOGGER_CID \
{ 0x58be81b4, 0x39d2, 0x437c, \
{ 0x94, 0xea, 0xae, 0xde, 0x2c, 0x62, 0x08, 0xd3 } }
extern nsresult
nsCycleCollectorLoggerConstructor(nsISupports* outer,
const nsIID& aIID,
--- a/xpcom/base/nsDebugImpl.cpp
+++ b/xpcom/base/nsDebugImpl.cpp
@@ -528,17 +528,17 @@ nsDebugImpl::Create(nsISupports* outer,
NS_ENSURE_NO_AGGREGATION(outer);
return const_cast<nsDebugImpl*>(&kImpl)->
QueryInterface(aIID, aInstancePtr);
}
////////////////////////////////////////////////////////////////////////////////
-NS_COM nsresult
+nsresult
NS_ErrorAccordingToNSPR()
{
PRErrorCode err = PR_GetError();
switch (err) {
case PR_OUT_OF_MEMORY_ERROR: return NS_ERROR_OUT_OF_MEMORY;
case PR_WOULD_BLOCK_ERROR: return NS_BASE_STREAM_WOULD_BLOCK;
case PR_FILE_NOT_FOUND_ERROR: return NS_ERROR_FILE_NOT_FOUND;
case PR_READ_ONLY_FILESYSTEM_ERROR: return NS_ERROR_FILE_READ_ONLY;
@@ -554,16 +554,16 @@ NS_ErrorAccordingToNSPR()
case PR_NO_ACCESS_RIGHTS_ERROR: return NS_ERROR_FILE_ACCESS_DENIED;
default: return NS_ERROR_FAILURE;
}
}
////////////////////////////////////////////////////////////////////////////////
#ifdef XP_WIN
-NS_COM PRBool sXPCOMHasLoadedNewDLLs = PR_FALSE;
+PRBool sXPCOMHasLoadedNewDLLs = PR_FALSE;
NS_EXPORT void
NS_SetHasLoadedNewDLLs()
{
sXPCOMHasLoadedNewDLLs = PR_TRUE;
}
#endif
--- a/xpcom/base/nsError.h
+++ b/xpcom/base/nsError.h
@@ -322,23 +322,23 @@ inline int NS_SUCCEEDED(nsresult _nsresu
/*
* This will return the nsresult corresponding to the most recent NSPR failure
* returned by PR_GetError.
*
***********************************************************************
* Do not depend on this function. It will be going away!
***********************************************************************
*/
-extern NS_COM nsresult
+extern nsresult
NS_ErrorAccordingToNSPR();
#ifdef _MSC_VER
#pragma warning(disable: 4251) /* 'nsCOMPtr<class nsIInputStream>' needs to have dll-interface to be used by clients of class 'nsInputStream' */
#pragma warning(disable: 4275) /* non dll-interface class 'nsISupports' used as base for dll-interface class 'nsIRDFNode' */
#endif
#ifdef XP_WIN
-extern NS_COM PRBool sXPCOMHasLoadedNewDLLs;
+extern PRBool sXPCOMHasLoadedNewDLLs;
NS_EXPORT void NS_SetHasLoadedNewDLLs();
#endif
#endif
--- a/xpcom/base/nsIMemoryReporter.idl
+++ b/xpcom/base/nsIMemoryReporter.idl
@@ -287,15 +287,15 @@ interface nsIMemoryReporterManager : nsI
#define NS_MEMORY_REPORTER_IMPLEMENT(_c, _p, _k, _u, _a, _d) \
NS_MEMORY_REPORTER_IMPLEMENT_HELPER(_c, _p, _k, _u, _a, _d, _)
#define NS_THREADSAFE_MEMORY_REPORTER_IMPLEMENT(_c, _p, _k, _u, _a, _d) \
NS_MEMORY_REPORTER_IMPLEMENT_HELPER(_c, _p, _k, _u, _a, _d, _THREADSAFE_)
#define NS_MEMORY_REPORTER_NAME(_classname) MemoryReporter_##_classname
-NS_COM nsresult NS_RegisterMemoryReporter (nsIMemoryReporter *reporter);
-NS_COM nsresult NS_RegisterMemoryMultiReporter (nsIMemoryMultiReporter *reporter);
+nsresult NS_RegisterMemoryReporter (nsIMemoryReporter *reporter);
+nsresult NS_RegisterMemoryMultiReporter (nsIMemoryMultiReporter *reporter);
-NS_COM nsresult NS_UnregisterMemoryReporter (nsIMemoryReporter *reporter);
-NS_COM nsresult NS_UnregisterMemoryMultiReporter (nsIMemoryMultiReporter *reporter);
+nsresult NS_UnregisterMemoryReporter (nsIMemoryReporter *reporter);
+nsresult NS_UnregisterMemoryMultiReporter (nsIMemoryMultiReporter *reporter);
%}
--- a/xpcom/base/nsInterfaceRequestorAgg.h
+++ b/xpcom/base/nsInterfaceRequestorAgg.h
@@ -41,14 +41,14 @@
/**
* This function returns an instance of nsIInterfaceRequestor that aggregates
* two nsIInterfaceRequestor instances. Its GetInterface method queries
* aFirst for the requested interface and will query aSecond only if aFirst
* failed to supply the requested interface. Both aFirst and aSecond may
* be null.
*/
-extern NS_COM nsresult
+extern nsresult
NS_NewInterfaceRequestorAggregation(nsIInterfaceRequestor *aFirst,
nsIInterfaceRequestor *aSecond,
nsIInterfaceRequestor **aResult);
#endif // !defined( nsInterfaceRequestorAgg_h__ )
--- a/xpcom/base/nsMemoryReporterManager.cpp
+++ b/xpcom/base/nsMemoryReporterManager.cpp
@@ -741,44 +741,44 @@ NS_IMETHODIMP nsMemoryReporter::GetAmoun
}
NS_IMETHODIMP nsMemoryReporter::GetDescription(nsACString &aDescription)
{
aDescription.Assign(mDesc);
return NS_OK;
}
-NS_COM nsresult
+nsresult
NS_RegisterMemoryReporter (nsIMemoryReporter *reporter)
{
nsCOMPtr<nsIMemoryReporterManager> mgr = do_GetService("@mozilla.org/memory-reporter-manager;1");
if (mgr == nsnull)
return NS_ERROR_FAILURE;
return mgr->RegisterReporter(reporter);
}
-NS_COM nsresult
+nsresult
NS_RegisterMemoryMultiReporter (nsIMemoryMultiReporter *reporter)
{
nsCOMPtr<nsIMemoryReporterManager> mgr = do_GetService("@mozilla.org/memory-reporter-manager;1");
if (mgr == nsnull)
return NS_ERROR_FAILURE;
return mgr->RegisterMultiReporter(reporter);
}
-NS_COM nsresult
+nsresult
NS_UnregisterMemoryReporter (nsIMemoryReporter *reporter)
{
nsCOMPtr<nsIMemoryReporterManager> mgr = do_GetService("@mozilla.org/memory-reporter-manager;1");
if (mgr == nsnull)
return NS_ERROR_FAILURE;
return mgr->UnregisterReporter(reporter);
}
-NS_COM nsresult
+nsresult
NS_UnregisterMemoryMultiReporter (nsIMemoryMultiReporter *reporter)
{
nsCOMPtr<nsIMemoryReporterManager> mgr = do_GetService("@mozilla.org/memory-reporter-manager;1");
if (mgr == nsnull)
return NS_ERROR_FAILURE;
return mgr->UnregisterMultiReporter(reporter);
}
--- a/xpcom/base/nsTraceRefcntImpl.cpp
+++ b/xpcom/base/nsTraceRefcntImpl.cpp
@@ -68,17 +68,17 @@
#include "mozilla/BlockingResourceBase.h"
#ifdef HAVE_DLOPEN
#include <dlfcn.h>
#endif
////////////////////////////////////////////////////////////////////////////////
-NS_COM void
+void
NS_MeanAndStdDev(double n, double sumOfValues, double sumOfSquaredValues,
double *meanResult, double *stdDevResult)
{
double mean = 0.0, var = 0.0, stdDev = 0.0;
if (n > 0.0 && sumOfValues >= 0) {
mean = sumOfValues / n;
double temp = (n * sumOfSquaredValues) - (sumOfValues * sumOfValues);
if (temp < 0.0 || n <= 1)
@@ -502,17 +502,17 @@ class nsDefaultComparator <BloatEntry*,
}
PRBool LessThan(BloatEntry* const& aA, BloatEntry* const& aB) const {
return PL_strcmp(aA->GetClassName(), aB->GetClassName()) < 0;
}
};
#endif /* NS_IMPL_REFCNT_LOGGING */
-NS_COM nsresult
+nsresult
nsTraceRefcntImpl::DumpStatistics(StatisticsType type, FILE* out)
{
#ifdef NS_IMPL_REFCNT_LOGGING
if (gBloatLog == nsnull || gBloatView == nsnull) {
return NS_ERROR_FAILURE;
}
if (out == nsnull) {
out = gBloatLog;
@@ -565,17 +565,17 @@ nsTraceRefcntImpl::DumpStatistics(Statis
gLogging = wasLogging;
UNLOCK_TRACELOG();
#endif
return NS_OK;
}
-NS_COM void
+void
nsTraceRefcntImpl::ResetStatistics()
{
#ifdef NS_IMPL_REFCNT_LOGGING
LOCK_TRACELOG();
if (gBloatView) {
PL_HashTableDestroy(gBloatView);
gBloatView = nsnull;
}
@@ -874,32 +874,32 @@ static void PrintStackFrame(void *aPC, v
NS_DescribeCodeAddress(aPC, &details);
NS_FormatCodeAddressDetails(aPC, &details, buf, sizeof(buf));
fputs(buf, stream);
}
}
-NS_COM void
+void
nsTraceRefcntImpl::WalkTheStack(FILE* aStream)
{
NS_StackWalk(PrintStackFrame, 2, aStream);
}
//----------------------------------------------------------------------
// This thing is exported by libstdc++
// Yes, this is a gcc only hack
#if defined(MOZ_DEMANGLE_SYMBOLS)
#include <cxxabi.h>
#include <stdlib.h> // for free()
#endif // MOZ_DEMANGLE_SYMBOLS
-NS_COM void
+void
nsTraceRefcntImpl::DemangleSymbol(const char * aSymbol,
char * aBuffer,
int aBufLen)
{
NS_ASSERTION(nsnull != aSymbol,"null symbol");
NS_ASSERTION(nsnull != aBuffer,"null buffer");
NS_ASSERTION(aBufLen >= 32 ,"pulled 32 out of you know where");
@@ -1255,22 +1255,22 @@ NS_LogCOMPtrRelease(void* aCOMPtr, nsISu
nsTraceRefcntImpl::WalkTheStack(gCOMPtrLog);
}
UNLOCK_TRACELOG();
}
#endif
}
-NS_COM void
+void
nsTraceRefcntImpl::Startup()
{
}
-NS_COM void
+void
nsTraceRefcntImpl::Shutdown()
{
#ifdef NS_IMPL_REFCNT_LOGGING
if (gBloatView) {
PL_HashTableDestroy(gBloatView);
gBloatView = nsnull;
}
@@ -1304,17 +1304,17 @@ nsTraceRefcntImpl::Shutdown()
}
if (gCOMPtrLog) {
fclose(gCOMPtrLog);
gCOMPtrLog = nsnull;
}
#endif
}
-NS_COM void
+void
nsTraceRefcntImpl::SetActivityIsLegal(PRBool aLegal)
{
#ifdef NS_IMPL_REFCNT_LOGGING
if (gActivityTLS == BAD_TLS_INDEX)
PR_NewThreadPrivateIndex(&gActivityTLS, nsnull);
PR_SetThreadPrivate(gActivityTLS, NS_INT32_TO_PTR(!aLegal));
#endif
--- a/xpcom/base/nsTraceRefcntImpl.h
+++ b/xpcom/base/nsTraceRefcntImpl.h
@@ -43,40 +43,40 @@
class nsTraceRefcntImpl : public nsITraceRefcnt
{
public:
nsTraceRefcntImpl() {}
NS_DECL_ISUPPORTS
NS_DECL_NSITRACEREFCNT
- static NS_COM void Startup();
- static NS_COM void Shutdown();
+ static void Startup();
+ static void Shutdown();
enum StatisticsType {
ALL_STATS,
NEW_STATS
};
- static NS_COM nsresult DumpStatistics(StatisticsType type = ALL_STATS,
+ static nsresult DumpStatistics(StatisticsType type = ALL_STATS,
FILE* out = 0);
- static NS_COM void ResetStatistics(void);
+ static void ResetStatistics(void);
- static NS_COM void DemangleSymbol(const char * aSymbol,
+ static void DemangleSymbol(const char * aSymbol,
char * aBuffer,
int aBufLen);
- static NS_COM void WalkTheStack(FILE* aStream);
+ static void WalkTheStack(FILE* aStream);
/**
* Tell nsTraceRefcnt whether refcounting, allocation, and destruction
* activity is legal. This is used to trigger assertions for any such
* activity that occurs because of static constructors or destructors.
*/
- static NS_COM void SetActivityIsLegal(PRBool aLegal);
+ static void SetActivityIsLegal(PRBool aLegal);
static NS_METHOD Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr);
};
#define NS_TRACE_REFCNT_CONTRACTID "@mozilla.org/xpcom/trace-refcnt;1"
#define NS_TRACE_REFCNT_CLASSNAME "nsTraceRefcnt Interface"
#define NS_TRACE_REFCNT_CID \
{ /* e3e7511e-a395-4924-94b1-d527861cded4 */ \
@@ -84,14 +84,14 @@ public:
0xa395, \
0x4924, \
{0x94, 0xb1, 0xd5, 0x27, 0x86, 0x1c, 0xde, 0xd4} \
} \
////////////////////////////////////////////////////////////////////////////////
// And now for that utility that you've all been asking for...
-extern "C" NS_COM void
+extern "C" void
NS_MeanAndStdDev(double n, double sumOfValues, double sumOfSquaredValues,
double *meanResult, double *stdDevResult);
////////////////////////////////////////////////////////////////////////////////
#endif
--- a/xpcom/base/nscore.h
+++ b/xpcom/base/nscore.h
@@ -29,16 +29,17 @@
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
+
#ifndef nscore_h___
#define nscore_h___
/**
* Make sure that we have the proper platform specific
* c++ definitions needed by nscore.h
*/
#ifndef _XPCOM_CONFIG_H_
@@ -290,20 +291,18 @@
#ifdef _IMPL_NS_COM
#define XPCOM_API(type) EXPORT_XPCOM_API(type)
#elif defined(XPCOM_GLUE)
#define XPCOM_API(type) GLUE_XPCOM_API(type)
#else
#define XPCOM_API(type) IMPORT_XPCOM_API(type)
#endif
-#define NS_COM
-
#ifdef MOZILLA_INTERNAL_API
-# define NS_COM_GLUE NS_COM
+# define NS_COM_GLUE
/*
The frozen string API has different definitions of nsAC?String
classes than the internal API. On systems that explicitly declare
dllexport symbols this is not a problem, but on ELF systems
internal symbols can accidentally "shine through"; we rename the
internal classes to avoid symbol conflicts.
*/
# define nsAString nsAString_internal
--- a/xpcom/build/Services.cpp
+++ b/xpcom/build/Services.cpp
@@ -59,17 +59,17 @@ using namespace mozilla::services;
/*
* Define a global variable and a getter for every service in ServiceList.
* eg. gIOService and GetIOService()
*/
#define MOZ_SERVICE(NAME, TYPE, CONTRACT_ID) \
static TYPE* g##NAME = nsnull; \
\
- NS_COM already_AddRefed<TYPE> \
+ already_AddRefed<TYPE> \
mozilla::services::Get##NAME() \
{ \
if (!g##NAME) { \
nsCOMPtr<TYPE> os = do_GetService(CONTRACT_ID); \
g##NAME = os.forget().get(); \
} \
NS_IF_ADDREF(g##NAME); \
return g##NAME; \
--- a/xpcom/build/Services.h
+++ b/xpcom/build/Services.h
@@ -47,16 +47,16 @@
#include "ServiceList.h"
#undef MOZ_SERVICE
#undef MOZ_USE_NAMESPACE
namespace mozilla {
namespace services {
-#define MOZ_SERVICE(NAME, TYPE, SERVICE_CID) NS_COM already_AddRefed<TYPE> Get##NAME();
+#define MOZ_SERVICE(NAME, TYPE, SERVICE_CID) already_AddRefed<TYPE> Get##NAME();
#include "ServiceList.h"
#undef MOZ_SERVICE
} // namespace services
} // namespace mozilla
#endif
--- a/xpcom/components/nsCategoryManager.cpp
+++ b/xpcom/components/nsCategoryManager.cpp
@@ -737,17 +737,17 @@ nsCategoryManager::SuppressNotifications
* CreateServicesFromCategory()
*
* Given a category, this convenience functions enumerates the category and
* creates a service of every CID or ContractID registered under the category.
* If observerTopic is non null and the service implements nsIObserver,
* this will attempt to notify the observer with the origin, observerTopic string
* as parameter.
*/
-NS_COM void
+void
NS_CreateServicesFromCategory(const char *category,
nsISupports *origin,
const char *observerTopic)
{
NS_TIME_FUNCTION_FMT("NS_CreateServicesFromCategory: %s (%s)",
category, observerTopic ? observerTopic : "(no topic)");
nsresult rv;
--- a/xpcom/components/nsCategoryManagerUtils.h
+++ b/xpcom/components/nsCategoryManagerUtils.h
@@ -35,14 +35,14 @@
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsCategoryManagerUtils_h__
#define nsCategoryManagerUtils_h__
#include "nsICategoryManager.h"
-NS_COM void
+void
NS_CreateServicesFromCategory(const char *category,
nsISupports *origin,
const char *observerTopic);
#endif
--- a/xpcom/components/nsComponentManager.cpp
+++ b/xpcom/components/nsComponentManager.cpp
@@ -41,21 +41,23 @@
* Corporation, 2000
*
* Modifications to Mozilla code or documentation
* identified per MPL Section 3.3
*
* Date Modified by Description of modification
* 04/20/2000 IBM Corp. Added PR_CALLBACK for Optlink use in OS2
*/
+
#include <stdlib.h>
#include "nscore.h"
#include "nsISupports.h"
#include "nspr.h"
#include "nsCRT.h" // for atoll
+
// Arena used by component manager for storing contractid string, dll
// location strings and small objects
// CAUTION: Arena align mask needs to be defined before including plarena.h
// currently from nsComponentManager.h
#define PL_ARENA_CONST_ALIGN_MASK 7
#define NS_CM_BLOCK_SIZE (1024 * 8)
#include "nsCategoryManager.h"
@@ -102,17 +104,17 @@
#include "mozilla/Omnijar.h"
#include "nsJAR.h"
static NS_DEFINE_CID(kZipReaderCID, NS_ZIPREADER_CID);
#include "prlog.h"
using namespace mozilla;
-NS_COM PRLogModuleInfo* nsComponentManagerLog = nsnull;
+PRLogModuleInfo* nsComponentManagerLog = nsnull;
#if 0 || defined (DEBUG_timeless)
#define SHOW_DENIED_ON_SHUTDOWN
#define SHOW_CI_ON_EXISTING_SERVICE
#endif
// Bloated registry buffer size to improve startup performance -- needs to
// be big enough to fit the entire file into memory or it'll thrash.
@@ -1988,38 +1990,38 @@ nsFactoryEntry::GetFactory()
NS_ADDREF(mFactory);
return mFactory.get();
}
////////////////////////////////////////////////////////////////////////////////
// Static Access Functions
////////////////////////////////////////////////////////////////////////////////
-NS_COM nsresult
+nsresult
NS_GetComponentManager(nsIComponentManager* *result)
{
if (!nsComponentManagerImpl::gComponentManager)
return NS_ERROR_NOT_INITIALIZED;
NS_ADDREF(*result = nsComponentManagerImpl::gComponentManager);
return NS_OK;
}
-NS_COM nsresult
+nsresult
NS_GetServiceManager(nsIServiceManager* *result)
{
if (!nsComponentManagerImpl::gComponentManager)
return NS_ERROR_NOT_INITIALIZED;
NS_ADDREF(*result = nsComponentManagerImpl::gComponentManager);
return NS_OK;
}
-NS_COM nsresult
+nsresult
NS_GetComponentRegistrar(nsIComponentRegistrar* *result)
{
if (!nsComponentManagerImpl::gComponentManager)
return NS_ERROR_NOT_INITIALIZED;
NS_ADDREF(*result = nsComponentManagerImpl::gComponentManager);
return NS_OK;
}
--- a/xpcom/ds/TimeStamp.h
+++ b/xpcom/ds/TimeStamp.h
@@ -52,17 +52,17 @@ class TimeStamp;
* Negative durations are allowed, meaning the end is before the start.
*
* Internally the duration is stored as a PRInt64 in units of
* PR_TicksPerSecond() when building with NSPR interval timers, or a
* system-dependent unit when building with system clocks. The
* system-dependent unit must be constant, otherwise the semantics of
* this class would be broken.
*/
-class NS_COM TimeDuration
+class TimeDuration
{
public:
// The default duration is 0.
TimeDuration() : mValue(0) {}
// Allow construction using '0' as the initial value, for readability,
// but no other numbers (so we don't have any implicit unit conversions).
struct _SomethingVeryRandomHere;
TimeDuration(_SomethingVeryRandomHere* aZero) : mValue(0) {
@@ -181,17 +181,17 @@ private:
* meaningless like add two TimeStamps.
*
* Internally this is implemented as either a wrapper around
* - high-resolution, monotonic, system clocks if they exist on this
* platform
* - PRIntervalTime otherwise. We detect wraparounds of
* PRIntervalTime and work around them.
*/
-class NS_COM TimeStamp
+class TimeStamp
{
public:
/**
* Initialize to the "null" moment
*/
TimeStamp() : mValue(0) {}
// Default copy-constructor and assignment are OK
--- a/xpcom/ds/nsAtomTable.cpp
+++ b/xpcom/ds/nsAtomTable.cpp
@@ -414,17 +414,17 @@ class CheckStaticAtomSizes
offsetof(nsStringBuffer, mRefCount)) &&
(offsetof(nsFakeStringBuffer<1>, mSize) ==
offsetof(nsStringBuffer, mStorageSize)) &&
(offsetof(nsFakeStringBuffer<1>, mStringData) ==
sizeof(nsStringBuffer)));
}
};
-NS_COM nsresult
+nsresult
NS_RegisterStaticAtoms(const nsStaticAtom* aAtoms, PRUint32 aAtomCount)
{
// this does three things:
// 1) wraps each static atom in a wrapper, if necessary
// 2) initializes the address pointed to by each mBits slot
// 3) puts the atom into the static atom table as well
if (!gStaticAtomTable && !gStaticAtomTableSealed) {
@@ -485,23 +485,23 @@ NS_RegisterStaticAtoms(const nsStaticAto
gStaticAtomTable->Put(str, atom);
}
#endif
}
return NS_OK;
}
-NS_COM nsIAtom*
+nsIAtom*
NS_NewAtom(const char* aUTF8String)
{
return NS_NewAtom(nsDependentCString(aUTF8String));
}
-NS_COM nsIAtom*
+nsIAtom*
NS_NewAtom(const nsACString& aUTF8String)
{
AtomTableEntry *he = GetAtomHashEntry(aUTF8String.Data(),
aUTF8String.Length());
if (he->mAtom) {
nsIAtom* atom;
NS_ADDREF(atom = he->mAtom);
@@ -516,23 +516,23 @@ NS_NewAtom(const nsACString& aUTF8String
AtomImpl* atom = new AtomImpl(str);
he->mAtom = atom;
NS_ADDREF(atom);
return atom;
}
-NS_COM nsIAtom*
+nsIAtom*
NS_NewAtom(const PRUnichar* aUTF16String)
{
return NS_NewAtom(nsDependentString(aUTF16String));
}
-NS_COM nsIAtom*
+nsIAtom*
NS_NewAtom(const nsAString& aUTF16String)
{
AtomTableEntry *he = GetAtomHashEntry(aUTF16String.Data(),
aUTF16String.Length());
if (he->mAtom) {
nsIAtom* atom;
NS_ADDREF(atom = he->mAtom);
@@ -542,17 +542,17 @@ NS_NewAtom(const nsAString& aUTF16String
AtomImpl* atom = new AtomImpl(aUTF16String);
he->mAtom = atom;
NS_ADDREF(atom);
return atom;
}
-NS_COM nsIAtom*
+nsIAtom*
NS_NewPermanentAtom(const nsAString& aUTF16String)
{
AtomTableEntry *he = GetAtomHashEntry(aUTF16String.Data(),
aUTF16String.Length());
AtomImpl* atom = he->mAtom;
if (atom) {
if (!atom->IsPermanent()) {
@@ -563,31 +563,31 @@ NS_NewPermanentAtom(const nsAString& aUT
atom = new PermanentAtomImpl(aUTF16String);
he->mAtom = atom;
}
// No need to addref since permanent atoms aren't refcounted anyway
return atom;
}
-NS_COM nsrefcnt
+nsrefcnt
NS_GetNumberOfAtoms(void)
{
return gAtomTable.entryCount;
}
-NS_COM nsIAtom*
+nsIAtom*
NS_GetStaticAtom(const nsAString& aUTF16String)
{
NS_PRECONDITION(gStaticAtomTable, "Static atom table not created yet.");
NS_PRECONDITION(gStaticAtomTableSealed, "Static atom table not sealed yet.");
nsIAtom* atom;
if (!gStaticAtomTable->Get(aUTF16String, &atom)) {
atom = nsnull;
}
return atom;
}
-NS_COM void
+void
NS_SealStaticAtomTable()
{
gStaticAtomTableSealed = PR_TRUE;
}
--- a/xpcom/ds/nsByteBuffer.cpp
+++ b/xpcom/ds/nsByteBuffer.cpp
@@ -146,17 +146,17 @@ ByteBufferImpl::Fill(nsresult* aErrorCod
if (NS_SUCCEEDED(*aErrorCode)) {
mLength += nb;
}
else
nb = 0;
return nb;
}
-NS_COM nsresult NS_NewByteBuffer(nsIByteBuffer** aInstancePtrResult,
+nsresult NS_NewByteBuffer(nsIByteBuffer** aInstancePtrResult,
nsISupports* aOuter,
PRUint32 aBufferSize)
{
nsresult rv;
nsIByteBuffer* buf;
rv = ByteBufferImpl::Create(aOuter, NS_GET_IID(nsIByteBuffer), (void**)&buf);
if (NS_FAILED(rv)) return rv;
--- a/xpcom/ds/nsCRT.h
+++ b/xpcom/ds/nsCRT.h
@@ -90,17 +90,17 @@ extern const PRUnichar kIsoLatin1ToUCS2[
::operator delete(ptr); \
}
// Freeing helper
#define CRTFREEIF(x) if (x) { nsCRT::free(x); x = 0; }
/// This is a wrapper class around all the C runtime functions.
-class NS_COM nsCRT {
+class nsCRT {
public:
enum {
LF='\n' /* Line Feed */,
VTAB='\v' /* Vertical Tab */,
CR='\r' /* Carriage Return */
};
/***
--- a/xpcom/ds/nsCheapSets.h
+++ b/xpcom/ds/nsCheapSets.h
@@ -39,17 +39,17 @@
#define __nsCheapSets_h__
#include "nsHashSets.h"
/**
* A string set that takes up minimal size when there are 0 or 1 strings in the
* set. Use for cases where sizes of 0 and 1 are even slightly common.
*/
-class NS_COM nsCheapStringSet {
+class nsCheapStringSet {
public:
nsCheapStringSet() : mValOrHash(nsnull)
{
}
~nsCheapStringSet();
/**
* Put a string into the set
@@ -114,17 +114,17 @@ private:
void* mValOrHash;
};
/**
* An integer set that takes up only 4 bytes when there are 0 or 1 integers
* in the set. Use for cases where sizes of 0 and 1 are even slightly common.
*/
-class NS_COM nsCheapInt32Set {
+class nsCheapInt32Set {
public:
nsCheapInt32Set() : mValOrHash(nsnull)
{
}
~nsCheapInt32Set();
/**
* Put an int into the set
--- a/xpcom/ds/nsDoubleHashtable.h
+++ b/xpcom/ds/nsDoubleHashtable.h
@@ -393,17 +393,17 @@ void CLASSNAME::Remove(const KEY_TYPE aK
*
* XXX It could be advisable (unless COW strings ever happens) to have a
* PLDHashDependentStringEntry
*/
//
// String-key entry
//
-class NS_COM PLDHashStringEntry : public PLDHashEntryHdr
+class PLDHashStringEntry : public PLDHashEntryHdr
{
public:
PLDHashStringEntry(const void* aKey) :
mKey(*static_cast<const nsAString*>(aKey)) { }
~PLDHashStringEntry() { }
static PLDHashNumber HashKey(const void* key) {
return HashString(*static_cast<const nsAString*>(key));
@@ -413,17 +413,17 @@ public:
}
const nsString mKey;
};
//
// CString-key entry
//
-class NS_COM PLDHashCStringEntry : public PLDHashEntryHdr
+class PLDHashCStringEntry : public PLDHashEntryHdr
{
public:
PLDHashCStringEntry(const void* aKey) :
mKey(*static_cast<const nsACString*>(aKey)) { }
~PLDHashCStringEntry() { }
static PLDHashNumber HashKey(const void* key) {
return HashString(*static_cast<const nsACString*>(key));
@@ -433,17 +433,17 @@ public:
}
const nsCString mKey;
};
//
// Int-key entry
//
-class NS_COM PLDHashInt32Entry : public PLDHashEntryHdr
+class PLDHashInt32Entry : public PLDHashEntryHdr
{
public:
PLDHashInt32Entry(const void* aKey) :
mKey(*(static_cast<const PRInt32*>(aKey))) { }
~PLDHashInt32Entry() { }
static PLDHashNumber HashKey(const void* key) {
return *static_cast<const PRInt32*>(key);
@@ -454,17 +454,17 @@ public:
const PRInt32 mKey;
};
//
// Void-key entry
//
-class NS_COM PLDHashVoidEntry : public PLDHashEntryHdr
+class PLDHashVoidEntry : public PLDHashEntryHdr
{
public:
PLDHashVoidEntry(const void* aKey) :
mKey(*(const void**)aKey) { }
~PLDHashVoidEntry() { }
static PLDHashNumber HashKey(const void* key) {
return PLDHashNumber(NS_PTR_TO_INT32(*(const void**)key)) >> 2;
--- a/xpcom/ds/nsFixedSizeAllocator.h
+++ b/xpcom/ds/nsFixedSizeAllocator.h
@@ -129,17 +129,17 @@
#define nsFixedSizeAllocator_h__
#include "nscore.h"
#include "nsError.h"
#include "plarena.h"
#define NS_SIZE_IN_HEAP(_size) (_size)
-class NS_COM nsFixedSizeAllocator
+class nsFixedSizeAllocator
{
protected:
PLArenaPool mPool;
struct Bucket;
struct FreeEntry;
friend struct Bucket;
--- a/xpcom/ds/nsHashPropertyBag.h
+++ b/xpcom/ds/nsHashPropertyBag.h
@@ -43,22 +43,17 @@
#include "nsCOMPtr.h"
#include "nsCOMArray.h"
#include "nsIVariant.h"
#include "nsIWritablePropertyBag.h"
#include "nsIWritablePropertyBag2.h"
#include "nsInterfaceHashtable.h"
-// Set IMETHOD_VISIBILITY to empty so that the class-level NS_COM declaration
-// controls member method visibility.
-#undef IMETHOD_VISIBILITY
-#define IMETHOD_VISIBILITY
-
-class NS_COM nsHashPropertyBag : public nsIWritablePropertyBag
+class nsHashPropertyBag : public nsIWritablePropertyBag
, public nsIWritablePropertyBag2
{
public:
nsHashPropertyBag() { }
virtual ~nsHashPropertyBag() {}
nsresult Init();
@@ -77,12 +72,12 @@ protected:
nsInterfaceHashtable<nsStringHashKey, nsIVariant> mPropertyHash;
};
#undef IMETHOD_VISIBILITY
#define IMETHOD_VISIBILITY NS_VISIBILITY_HIDDEN
// Note: NS_NewHashPropertyBag returns a HPB that
// uses a non-thread-safe internal hash
-extern "C" NS_COM nsresult
+extern "C" nsresult
NS_NewHashPropertyBag(nsIWritablePropertyBag* *_retval);
#endif /* nsHashPropertyBag_h___ */
--- a/xpcom/ds/nsHashSets.h
+++ b/xpcom/ds/nsHashSets.h
@@ -88,17 +88,17 @@ public:
return GetEntry(aKey) ? PR_TRUE : PR_FALSE; \
} \
};
#define DHASH_SET(CLASSNAME,ENTRY_CLASS,KEY_TYPE) \
DHASH_WRAPPER(CLASSNAME##Super,ENTRY_CLASS,KEY_TYPE)
#undef DHASH_EXPORT
-#define DHASH_EXPORT NS_COM
+#define DHASH_EXPORT
DECL_DHASH_SET(nsStringHashSet, PLDHashStringEntry, nsAString&)
DECL_DHASH_SET(nsCStringHashSet,PLDHashCStringEntry,nsACString&)
DECL_DHASH_SET(nsInt32HashSet, PLDHashInt32Entry, PRInt32)
DECL_DHASH_SET(nsVoidHashSet, PLDHashVoidEntry, void*)
#undef DHASH_EXPORT
#define DHASH_EXPORT
--- a/xpcom/ds/nsHashtable.h
+++ b/xpcom/ds/nsHashtable.h
@@ -61,17 +61,17 @@
#include "nsTraceRefcnt.h"
class nsIObjectInputStream;
class nsIObjectOutputStream;
class nsHashtable;
class nsStringKey;
-class NS_COM nsHashKey {
+class nsHashKey {
protected:
nsHashKey(void) {
#ifdef DEBUG
mKeyType = UnknownKey;
#endif
MOZ_COUNT_CTOR(nsHashKey);
}
@@ -123,17 +123,17 @@ typedef nsresult
// NB: may be called with null aKey or aData, to free just one of the two.
typedef void
(* nsHashtableFreeEntryFunc)(nsIObjectInputStream *aStream, nsHashKey *aKey,
void *aData);
typedef nsresult
(* nsHashtableWriteDataFunc)(nsIObjectOutputStream *aStream, void *aData);
-class NS_COM nsHashtable {
+class nsHashtable {
protected:
// members
PRLock* mLock;
PLDHashTable mHashtable;
PRBool mEnumerating;
public:
nsHashtable(PRUint32 aSize = 16, PRBool threadSafe = PR_FALSE);
@@ -158,17 +158,17 @@ class NS_COM nsHashtable {
};
////////////////////////////////////////////////////////////////////////////////
// nsObjectHashtable: an nsHashtable where the elements are C++ objects to be
// deleted
typedef void* (* nsHashtableCloneElementFunc)(nsHashKey *aKey, void *aData, void* aClosure);
-class NS_COM nsObjectHashtable : public nsHashtable {
+class nsObjectHashtable : public nsHashtable {
public:
nsObjectHashtable(nsHashtableCloneElementFunc cloneElementFun,
void* cloneElementClosure,
nsHashtableEnumFunc destroyElementFun,
void* destroyElementClosure,
PRUint32 aSize = 16, PRBool threadSafe = PR_FALSE);
~nsObjectHashtable();
@@ -187,17 +187,17 @@ class NS_COM nsObjectHashtable : public
void* mDestroyElementClosure;
};
////////////////////////////////////////////////////////////////////////////////
// nsSupportsHashtable: an nsHashtable where the elements are nsISupports*
class nsISupports;
-class NS_COM nsSupportsHashtable
+class nsSupportsHashtable
: private nsHashtable
{
public:
typedef PRBool (* EnumFunc) (nsHashKey *aKey, void *aData, void* aClosure);
nsSupportsHashtable(PRUint32 aSize = 16, PRBool threadSafe = PR_FALSE)
: nsHashtable(aSize, threadSafe) {}
~nsSupportsHashtable();
@@ -226,17 +226,17 @@ class NS_COM nsSupportsHashtable
PRUint32 i, void *arg);
};
////////////////////////////////////////////////////////////////////////////////
// nsISupportsKey: Where keys are nsISupports objects that get refcounted.
#include "nsISupports.h"
-class NS_COM nsISupportsKey : public nsHashKey {
+class nsISupportsKey : public nsHashKey {
protected:
nsISupports* mKey;
public:
nsISupportsKey(const nsISupportsKey& aKey) : mKey(aKey.mKey) {
#ifdef DEBUG
mKeyType = SupportsKey;
#endif
@@ -332,17 +332,17 @@ class nsVoidKey : public nsHashKey {
}
void* GetValue() { return mKey; }
};
#include "nsString.h"
// for null-terminated c-strings
-class NS_COM nsCStringKey : public nsHashKey {
+class nsCStringKey : public nsHashKey {
public:
// NB: when serializing, NEVER_OWN keys are deserialized as OWN.
enum Ownership {
NEVER_OWN, // very long lived, even clones don't need to copy it.
OWN_CLONE, // as long lived as this key. But clones make a copy.
OWN // to be free'd in key dtor. Clones make their own copy.
};
@@ -366,17 +366,17 @@ class NS_COM nsCStringKey : public nsHas
protected:
char* mStr;
PRUint32 mStrLen;
Ownership mOwnership;
};
// for null-terminated unicode strings
-class NS_COM nsStringKey : public nsHashKey {
+class nsStringKey : public nsHashKey {
public:
// NB: when serializing, NEVER_OWN keys are deserialized as OWN.
enum Ownership {
NEVER_OWN, // very long lived, even clones don't need to copy it.
OWN_CLONE, // as long lived as this key. But clones make a copy.
OWN // to be free'd in key dtor. Clones make their own copy.
};
--- a/xpcom/ds/nsIAtom.idl
+++ b/xpcom/ds/nsIAtom.idl
@@ -113,60 +113,60 @@ protected:
* count, which requires locking and hurts performance.
*/
/**
* Find an atom that matches the given UTF-8 string.
* The string is assumed to be zero terminated.
*/
-extern NS_COM nsIAtom* NS_NewAtom(const char* aUTF8String);
+extern nsIAtom* NS_NewAtom(const char* aUTF8String);
inline already_AddRefed<nsIAtom> do_GetAtom(const char* aUTF8String)
{ return NS_NewAtom(aUTF8String); }
/**
* Find an atom that matches the given UTF-8 string.
*/
-extern NS_COM nsIAtom* NS_NewAtom(const nsACString& aUTF8String);
+extern nsIAtom* NS_NewAtom(const nsACString& aUTF8String);
inline already_AddRefed<nsIAtom> do_GetAtom(const nsACString& aUTF8String)
{ return NS_NewAtom(aUTF8String); }
/**
* Find an atom that matches the given UTF-16 string.
* The string is assumed to be zero terminated.
*/
-extern NS_COM nsIAtom* NS_NewAtom(const PRUnichar* aUTF16String);
+extern nsIAtom* NS_NewAtom(const PRUnichar* aUTF16String);
inline already_AddRefed<nsIAtom> do_GetAtom(const PRUnichar* aUTF16String)
{ return NS_NewAtom(aUTF16String); }
/**
* Find an atom that matches the given UTF-16 string.
*/
-extern NS_COM nsIAtom* NS_NewAtom(const nsAString& aUTF16String);
-extern NS_COM nsIAtom* NS_NewPermanentAtom(const nsAString& aUTF16String);
+extern nsIAtom* NS_NewAtom(const nsAString& aUTF16String);
+extern nsIAtom* NS_NewPermanentAtom(const nsAString& aUTF16String);
inline already_AddRefed<nsIAtom> do_GetAtom(const nsAString& aUTF16String)
{ return NS_NewAtom(aUTF16String); }
/**
* Return a count of the total number of atoms currently
* alive in the system.
*/
-extern NS_COM nsrefcnt NS_GetNumberOfAtoms(void);
+extern nsrefcnt NS_GetNumberOfAtoms(void);
/**
* Return a pointer for a static atom for the string or null if there's
* no static atom for this string.
*/
-extern NS_COM nsIAtom* NS_GetStaticAtom(const nsAString& aUTF16String);
+extern nsIAtom* NS_GetStaticAtom(const nsAString& aUTF16String);
/**
* Seal the static atom table
*/
-extern NS_COM void NS_SealStaticAtomTable();
+extern void NS_SealStaticAtomTable();
class nsAtomString : public nsString
{
public:
nsAtomString(nsIAtom* aAtom)
{
aAtom->ToString(*this);
}
--- a/xpcom/ds/nsIByteBuffer.h
+++ b/xpcom/ds/nsIByteBuffer.h
@@ -83,15 +83,15 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIByteBuf
{ /* a49d5280-0d6b-11d3-9331-00104ba0fd40 */ \
0xa49d5280, \
0x0d6b, \
0x11d3, \
{0x93, 0x31, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40} \
}
/** Create a new byte buffer using the given buffer size. */
-extern NS_COM nsresult
+extern nsresult
NS_NewByteBuffer(nsIByteBuffer** aInstancePtrResult,
nsISupports* aOuter,
PRUint32 aBufferSize = 0);
#endif /* nsIByteBuffer_h___ */
--- a/xpcom/ds/nsICollection.idl
+++ b/xpcom/ds/nsICollection.idl
@@ -58,17 +58,17 @@ interface nsICollection : nsISerializabl
};
%{C++
#ifndef nsCOMPtr_h__
#include "nsCOMPtr.h"
#endif
-class NS_COM nsQueryElementAt : public nsCOMPtr_helper
+class nsQueryElementAt : public nsCOMPtr_helper
{
public:
nsQueryElementAt( nsICollection* aCollection, PRUint32 aIndex, nsresult* aErrorPtr )
: mCollection(aCollection),
mIndex(aIndex),
mErrorPtr(aErrorPtr)
{
// nothing else to do here
--- a/xpcom/ds/nsISupportsArray.idl
+++ b/xpcom/ds/nsISupportsArray.idl
@@ -62,17 +62,17 @@ class nsISupportsArray;
{0x93, 0x31, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40} \
}
#define NS_SUPPORTSARRAY_CONTRACTID "@mozilla.org/supports-array;1"
#define NS_SUPPORTSARRAY_CLASSNAME "Supports Array"
// Enumerator callback function. Return PR_FALSE to stop
typedef PRBool (*nsISupportsArrayEnumFunc)(nsISupports* aElement, void *aData);
-NS_COM nsresult
+nsresult
NS_NewArrayEnumerator(nsISimpleEnumerator* *result NS_OUTPARAM,
nsISupportsArray* array);
%}
[scriptable, uuid(791eafa0-b9e6-11d1-8031-006008159b5a)]
interface nsISupportsArray : nsICollection {
[notxpcom] boolean Equals([const] in nsISupportsArray other);
@@ -126,18 +126,18 @@ interface nsISupportsArray : nsICollecti
[notxpcom] boolean SizeTo(in long aSize);
};
%{C++
// Construct and return a default implementation of nsISupportsArray:
-extern NS_COM nsresult
+extern nsresult
NS_NewISupportsArray(nsISupportsArray** aInstancePtrResult);
// Construct and return a default implementation of an enumerator for nsISupportsArrays:
-extern NS_COM nsresult
+extern nsresult
NS_NewISupportsArrayEnumerator(nsISupportsArray* array,
nsIBidirectionalEnumerator* *aInstancePtrResult);
%}
--- a/xpcom/ds/nsIUnicharBuffer.h
+++ b/xpcom/ds/nsIUnicharBuffer.h
@@ -54,17 +54,17 @@ public:
NS_IMETHOD_(PRInt32) GetBufferSize() const = 0;
NS_IMETHOD_(PRUnichar*) GetBuffer() const = 0;
NS_IMETHOD_(PRBool) Grow(PRInt32 aNewSize) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIUnicharBuffer, NS_IUNICHARBUFFER_IID)
/// Factory method for nsIUnicharBuffer.
-extern NS_COM nsresult
+extern nsresult
NS_NewUnicharBuffer(nsIUnicharBuffer** aInstancePtrResult,
nsISupports* aOuter,
PRUint32 aBufferSize = 0);
#define NS_UNICHARBUFFER_CID \
{ /* c81fd8f0-0d6b-11d3-9331-00104ba0fd40 */ \
0xc81fd8f0, \
0x0d6b, \
--- a/xpcom/ds/nsRecyclingAllocator.h
+++ b/xpcom/ds/nsRecyclingAllocator.h
@@ -66,17 +66,17 @@
#include "nsIRecyclingAllocator.h"
#define NS_DEFAULT_RECYCLE_TIMEOUT 10 // secs
#define NS_ALLOCATOR_OVERHEAD_BYTES (sizeof(PRSize)) // bytes
class nsITimer;
class nsIMemory;
-class NS_COM nsRecyclingAllocator {
+class nsRecyclingAllocator {
protected:
struct Block {
PRSize bytes;
Block *next;
};
#define DATA(block) ((void *)(((char *)block) + NS_ALLOCATOR_OVERHEAD_BYTES))
#define DATA_TO_BLOCK(data) ((Block *)((char *)(data) - NS_ALLOCATOR_OVERHEAD_BYTES))
--- a/xpcom/ds/nsStaticAtom.h
+++ b/xpcom/ds/nsStaticAtom.h
@@ -72,12 +72,12 @@ struct nsStaticAtom {
template <PRUint32 size>
struct nsFakeStringBuffer {
PRInt32 mRefCnt;
PRUint32 mSize;
nsStaticAtomStringType mStringData[size];
};
// Register static atoms with the atom table
-NS_COM nsresult
+nsresult
NS_RegisterStaticAtoms(const nsStaticAtom*, PRUint32 aAtomCount);
#endif
--- a/xpcom/ds/nsStaticNameTable.h
+++ b/xpcom/ds/nsStaticNameTable.h
@@ -54,17 +54,17 @@
* - It is not an xpcom interface - meant for fast lookup in static tables.
*
* ***REQUIREMENTS***
* - It *requires* that all entries in the table be lowercase only.
* - It *requires* that the table of strings be in memory that lives at least
* as long as this table object - typically a static string array.
*/
-class NS_COM nsStaticCaseInsensitiveNameTable
+class nsStaticCaseInsensitiveNameTable
{
public:
enum { NOT_FOUND = -1 };
PRBool Init(const char* const aNames[], PRInt32 Count);
PRInt32 Lookup(const nsACString& aName);
PRInt32 Lookup(const nsAString& aName);
const nsAFlatCString& GetStringValue(PRInt32 index);
--- a/xpcom/ds/nsStringEnumerator.cpp
+++ b/xpcom/ds/nsStringEnumerator.cpp
@@ -186,74 +186,74 @@ StringEnumeratorTail(T** aResult NS_INPA
NS_ADDREF(*aResult);
return NS_OK;
}
//
// constructors
//
-NS_COM nsresult
+nsresult
NS_NewStringEnumerator(nsIStringEnumerator** aResult,
const nsTArray<nsString>* aArray, nsISupports* aOwner)
{
NS_ENSURE_ARG_POINTER(aResult);
NS_ENSURE_ARG_POINTER(aArray);
*aResult = new nsStringEnumerator(aArray, aOwner);
return StringEnumeratorTail(aResult);
}
-NS_COM nsresult
+nsresult
NS_NewUTF8StringEnumerator(nsIUTF8StringEnumerator** aResult,
const nsTArray<nsCString>* aArray, nsISupports* aOwner)
{
NS_ENSURE_ARG_POINTER(aResult);
NS_ENSURE_ARG_POINTER(aArray);
*aResult = new nsStringEnumerator(aArray, aOwner);
return StringEnumeratorTail(aResult);
}
-NS_COM nsresult
+nsresult
NS_NewAdoptingStringEnumerator(nsIStringEnumerator** aResult,
nsTArray<nsString>* aArray)
{
NS_ENSURE_ARG_POINTER(aResult);
NS_ENSURE_ARG_POINTER(aArray);
*aResult = new nsStringEnumerator(aArray, PR_TRUE);
return StringEnumeratorTail(aResult);
}
-NS_COM nsresult
+nsresult
NS_NewAdoptingUTF8StringEnumerator(nsIUTF8StringEnumerator** aResult,
nsTArray<nsCString>* aArray)
{
NS_ENSURE_ARG_POINTER(aResult);
NS_ENSURE_ARG_POINTER(aArray);
*aResult = new nsStringEnumerator(aArray, PR_TRUE);
return StringEnumeratorTail(aResult);
}
// const ones internally just forward to the non-const equivalents
-NS_COM nsresult
+nsresult
NS_NewStringEnumerator(nsIStringEnumerator** aResult,
const nsTArray<nsString>* aArray)
{
NS_ENSURE_ARG_POINTER(aResult);
NS_ENSURE_ARG_POINTER(aArray);
*aResult = new nsStringEnumerator(aArray, PR_FALSE);
return StringEnumeratorTail(aResult);
}
-NS_COM nsresult
+nsresult
NS_NewUTF8StringEnumerator(nsIUTF8StringEnumerator** aResult,
const nsTArray<nsCString>* aArray)
{
NS_ENSURE_ARG_POINTER(aResult);
NS_ENSURE_ARG_POINTER(aArray);
*aResult = new nsStringEnumerator(aArray, PR_FALSE);
return StringEnumeratorTail(aResult);
--- a/xpcom/ds/nsStringEnumerator.h
+++ b/xpcom/ds/nsStringEnumerator.h
@@ -70,54 +70,54 @@
// array.AppendCString("abc");
// array.AppendCString("def");
// NS_NewStringEnumerator(&enumerator, &array, PR_TRUE);
//
// // call some internal method which iterates the enumerator
// InternalMethod(enumerator);
// NS_RELEASE(enumerator);
//
-NS_COM nsresult
+nsresult
NS_NewStringEnumerator(nsIStringEnumerator** aResult NS_OUTPARAM,
const nsTArray<nsString>* aArray,
nsISupports* aOwner);
-NS_COM nsresult
+nsresult
NS_NewUTF8StringEnumerator(nsIUTF8StringEnumerator** aResult NS_OUTPARAM,
const nsTArray<nsCString>* aArray);
-NS_COM nsresult
+nsresult
NS_NewStringEnumerator(nsIStringEnumerator** aResult NS_OUTPARAM,
const nsTArray<nsString>* aArray);
// Adopting string enumerators assume ownership of the array and will
// call |operator delete| on the array when the enumerator is destroyed
// this is useful when the provider creates an array solely for the
// purpose of creating the enumerator.
// For example:
//
// nsTArray<nsCString>* array = new nsTArray<nsCString>;
// array->AppendString("abcd");
// NS_NewAdoptingStringEnumerator(&result, array);
-NS_COM nsresult
+nsresult
NS_NewAdoptingStringEnumerator(nsIStringEnumerator** aResult NS_OUTPARAM,
nsTArray<nsString>* aArray);
-NS_COM nsresult
+nsresult
NS_NewAdoptingUTF8StringEnumerator(nsIUTF8StringEnumerator** aResult NS_OUTPARAM,
nsTArray<nsCString>* aArray);
// these versions take a refcounted "owner" which will be addreffed
// when the enumerator is created, and destroyed when the enumerator
// is released. This allows providers to give non-owning pointers to
// ns*StringArray member variables without worrying about lifetime
// issues
// For example:
//
// nsresult MyClass::Enumerate(nsIUTF8StringEnumerator** aResult) {
// mCategoryList->AppendString("abcd");
// return NS_NewStringEnumerator(aResult, mCategoryList, this);
// }
//
-NS_COM nsresult
+nsresult
NS_NewUTF8StringEnumerator(nsIUTF8StringEnumerator** aResult NS_OUTPARAM,
const nsTArray<nsCString>* aArray,
nsISupports* aOwner);
--- a/xpcom/ds/nsSupportsArray.cpp
+++ b/xpcom/ds/nsSupportsArray.cpp
@@ -668,17 +668,17 @@ nsSupportsArray::Clone(nsISupportsArray*
nsISupportsArray* newArray;
rv = NS_NewISupportsArray(&newArray);
PRBool ok = EnumerateForwards(CopyElement, newArray);
if (!ok) return NS_ERROR_OUT_OF_MEMORY;
*result = newArray;
return NS_OK;
}
-NS_COM nsresult
+nsresult
NS_NewISupportsArray(nsISupportsArray** aInstancePtrResult)
{
nsresult rv;
rv = nsSupportsArray::Create(NULL, NS_GET_IID(nsISupportsArray),
(void**)aInstancePtrResult);
return rv;
}
--- a/xpcom/ds/nsSupportsArray.h
+++ b/xpcom/ds/nsSupportsArray.h
@@ -39,22 +39,17 @@
#define nsSupportsArray_h__
//#define DEBUG_SUPPORTSARRAY 1
#include "nsISupportsArray.h"
static const PRUint32 kAutoArraySize = 8;
-// Set IMETHOD_VISIBILITY to empty so that the class-level NS_COM declaration
-// controls member method visibility.
-#undef IMETHOD_VISIBILITY
-#define IMETHOD_VISIBILITY
-
-class NS_COM nsSupportsArray : public nsISupportsArray {
+class nsSupportsArray : public nsISupportsArray {
public:
nsSupportsArray(void);
~nsSupportsArray(void); // nonvirtual since we're not subclassed
static nsresult
Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
NS_DECL_ISUPPORTS
--- a/xpcom/ds/nsSupportsArrayEnumerator.cpp
+++ b/xpcom/ds/nsSupportsArrayEnumerator.cpp
@@ -125,17 +125,17 @@ nsSupportsArrayEnumerator::Prev()
if (mCursor >= 0)
return NS_OK;
else
return NS_ERROR_FAILURE;
}
////////////////////////////////////////////////////////////////////////////////
-NS_COM nsresult
+nsresult
NS_NewISupportsArrayEnumerator(nsISupportsArray* array,
nsIBidirectionalEnumerator* *aInstancePtrResult)
{
if (aInstancePtrResult == 0)
return NS_ERROR_NULL_POINTER;
nsSupportsArrayEnumerator* e = new nsSupportsArrayEnumerator(array);
if (e == 0)
return NS_ERROR_OUT_OF_MEMORY;
--- a/xpcom/ds/nsUnicharBuffer.cpp
+++ b/xpcom/ds/nsUnicharBuffer.cpp
@@ -116,17 +116,17 @@ UnicharBufferImpl::Grow(PRInt32 aNewSize
}
delete[] mBuffer;
mBuffer = newbuf;
return PR_TRUE;
}
return PR_FALSE;
}
-NS_COM nsresult
+nsresult
NS_NewUnicharBuffer(nsIUnicharBuffer** aInstancePtrResult,
nsISupports* aOuter,
PRUint32 aBufferSize)
{
nsresult rv;
nsIUnicharBuffer* buf;
rv = UnicharBufferImpl::Create(aOuter, NS_GET_IID(nsIUnicharBuffer),
(void**)&buf);
--- a/xpcom/ds/nsVariant.h
+++ b/xpcom/ds/nsVariant.h
@@ -108,17 +108,17 @@ struct nsDiscriminatedUnion
* these objects. They are created 'empty' and 'writable'.
*
* nsIVariant users won't usually need to see this class.
*
* This class also has static helper methods that nsIVariant *implementors* can
* use to help them do all the 'standard' nsIVariant data conversions.
*/
-class NS_COM nsVariant : public nsIWritableVariant
+class nsVariant : public nsIWritableVariant
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIVARIANT
NS_DECL_NSIWRITABLEVARIANT
nsVariant();
--- a/xpcom/ds/nsWindowsRegKey.h
+++ b/xpcom/ds/nsWindowsRegKey.h
@@ -48,17 +48,17 @@
* via the XPCOM component manager.
*/
#define NS_WINDOWSREGKEY_CONTRACTID "@mozilla.org/windows-registry-key;1"
/**
* This function may be used to instantiate a windows registry key object prior
* to XPCOM being initialized.
*/
-extern "C" NS_COM nsresult
+extern "C" nsresult
NS_NewWindowsRegKey(nsIWindowsRegKey **result);
//-----------------------------------------------------------------------------
#ifdef _IMPL_NS_COM
#define NS_WINDOWSREGKEY_CLASSNAME "nsWindowsRegKey"
--- a/xpcom/glue/nsCycleCollectorUtils.h
+++ b/xpcom/glue/nsCycleCollectorUtils.h
@@ -38,17 +38,17 @@
#define nsCycleCollectorUtils_h__
#include "nscore.h"
#include "mozilla/threads/nsThreadIDs.h"
#if defined(MOZILLA_INTERNAL_API)
#define NS_IsCycleCollectorThread NS_IsCycleCollectorThread_P
#if defined(XP_WIN)
-NS_COM bool NS_IsCycleCollectorThread();
+bool NS_IsCycleCollectorThread();
#elif defined(NS_TLS)
// Defined in nsThreadManager.cpp.
extern NS_TLS mozilla::threads::ID gTLSThreadID;
inline bool NS_IsCycleCollectorThread()
{
return gTLSThreadID == mozilla::threads::CycleCollector;
}
#else
--- a/xpcom/glue/nsThreadUtils.h
+++ b/xpcom/glue/nsThreadUtils.h
@@ -100,17 +100,17 @@ NS_GetCurrentThread(nsIThread **result);
*
* @param result
* The resulting nsIThread object.
*/
extern NS_COM_GLUE NS_METHOD
NS_GetMainThread(nsIThread **result);
#if defined(MOZILLA_INTERNAL_API) && defined(XP_WIN)
-NS_COM bool NS_IsMainThread();
+bool NS_IsMainThread();
#elif defined(MOZILLA_INTERNAL_API) && defined(NS_TLS)
// This is defined in nsThreadManager.cpp and initialized to `Main` for the
// main thread by nsThreadManager::Init.
extern NS_TLS mozilla::threads::ID gTLSThreadID;
inline bool NS_IsMainThread()
{
return gTLSThreadID == mozilla::threads::Main;
}
--- a/xpcom/io/SpecialSystemDirectory.cpp
+++ b/xpcom/io/SpecialSystemDirectory.cpp
@@ -100,31 +100,31 @@ typedef HRESULT (WINAPI* nsGetKnownFolde
HANDLE hToken,
PWSTR *ppszPath);
static nsGetKnownFolderPath gGetKnownFolderPath = NULL;
static HINSTANCE gShell32DLLInst = NULL;
#endif
-NS_COM void StartupSpecialSystemDirectory()
+void StartupSpecialSystemDirectory()
{
#if defined (XP_WIN)
// SHGetKnownFolderPath is only available on Windows Vista
// so that we need to use GetProcAddress to get the pointer.
gShell32DLLInst = LoadLibraryW(L"shell32.dll");
if(gShell32DLLInst)
{
gGetKnownFolderPath = (nsGetKnownFolderPath)
GetProcAddress(gShell32DLLInst, "SHGetKnownFolderPath");
}
#endif
}
-NS_COM void ShutdownSpecialSystemDirectory()
+void ShutdownSpecialSystemDirectory()
{
#if defined (XP_WIN)
if (gShell32DLLInst)
{
FreeLibrary(gShell32DLLInst);
gShell32DLLInst = NULL;
gGetKnownFolderPath = NULL;
}
--- a/xpcom/io/SpecialSystemDirectory.h
+++ b/xpcom/io/SpecialSystemDirectory.h
@@ -45,19 +45,18 @@
#include "nsILocalFile.h"
#ifdef XP_MACOSX
#include <Carbon/Carbon.h>
#include "nsILocalFileMac.h"
#include "prenv.h"
#endif
-
-extern NS_COM void StartupSpecialSystemDirectory();
-extern NS_COM void ShutdownSpecialSystemDirectory();
+extern void StartupSpecialSystemDirectory();
+extern void ShutdownSpecialSystemDirectory();
enum SystemDirectories {
OS_DriveDirectory = 1,
OS_TemporaryDirectory = 2,
OS_CurrentProcessDirectory= 3,
OS_CurrentWorkingDirectory= 4,
XPCOM_CurrentProcessComponentDirectory= 5,
--- a/xpcom/io/nsEscape.cpp
+++ b/xpcom/io/nsEscape.cpp
@@ -151,34 +151,34 @@ static char* nsEscapeCount(
*dst = '\0'; /* tack on eos */
if(out_len)
*out_len = dst - (unsigned char *) result;
return result;
}
//----------------------------------------------------------------------------------------
-NS_COM char* nsEscape(const char * str, nsEscapeMask flags)
+char* nsEscape(const char * str, nsEscapeMask flags)
//----------------------------------------------------------------------------------------
{
if(!str)
return NULL;
return nsEscapeCount(str, flags, NULL);
}
//----------------------------------------------------------------------------------------
-NS_COM char* nsUnescape(char * str)
+char* nsUnescape(char * str)
//----------------------------------------------------------------------------------------
{
nsUnescapeCount(str);
return str;
}
//----------------------------------------------------------------------------------------
-NS_COM PRInt32 nsUnescapeCount(char * str)
+PRInt32 nsUnescapeCount(char * str)
//----------------------------------------------------------------------------------------
{
register char *src = str;
register char *dst = str;
static const char hexChars[] = "0123456789ABCDEFabcdef";
char c1[] = " ";
char c2[] = " ";
@@ -214,17 +214,17 @@ NS_COM PRInt32 nsUnescapeCount(char * st
}
*dst = 0;
return (int)(dst - str);
} /* NET_UnEscapeCnt */
-NS_COM char *
+char *
nsEscapeHTML(const char * string)
{
char *rv = nsnull;
/* XXX Hardcoded max entity len. The +1 is for the trailing null. */
PRUint32 len = PL_strlen(string);
if (len >= (PR_UINT32_MAX / 6))
return nsnull;
@@ -280,17 +280,17 @@ nsEscapeHTML(const char * string)
}
}
*ptr = '\0';
}
return(rv);
}
-NS_COM PRUnichar *
+PRUnichar *
nsEscapeHTML2(const PRUnichar *aSourceBuffer, PRInt32 aSourceBufferLen)
{
// if the caller didn't calculate the length
if (aSourceBufferLen < 0) {
aSourceBufferLen = nsCRT::strlen(aSourceBuffer); // ...then I will
}
/* XXX Hardcoded max entity len. */
@@ -386,17 +386,17 @@ const int EscapeChars[256] =
that already look escaped, which means it already includes
a valid hexcode. This is done to avoid multiple escapes of
a string. Use the following flags to force escaping of a
string:
esc_Forced = 1024
*/
-NS_COM PRBool NS_EscapeURL(const char *part,
+PRBool NS_EscapeURL(const char *part,
PRInt32 partLen,
PRUint32 flags,
nsACString &result)
{
if (!part) {
NS_NOTREACHED("null pointer");
return PR_FALSE;
}
@@ -472,17 +472,17 @@ NS_COM PRBool NS_EscapeURL(const char *p
tempBuffer[tempBufferPos] = '\0';
result += tempBuffer;
}
return writing;
}
#define ISHEX(c) memchr(hexChars, c, sizeof(hexChars)-1)
-NS_COM PRBool NS_UnescapeURL(const char *str, PRInt32 len, PRUint32 flags, nsACString &result)
+PRBool NS_UnescapeURL(const char *str, PRInt32 len, PRUint32 flags, nsACString &result)
{
if (!str) {
NS_NOTREACHED("null pointer");
return PR_FALSE;
}
if (len < 0)
len = strlen(str);
--- a/xpcom/io/nsEscape.h
+++ b/xpcom/io/nsEscape.h
@@ -63,33 +63,33 @@ extern "C" {
/**
* Escape the given string according to mask
* @param str The string to escape
* @param mask How to escape the string
* @return A newly allocated escaped string that must be free'd with
* nsCRT::free, or null on failure
*/
-NS_COM char * nsEscape(const char * str, nsEscapeMask mask);
+char * nsEscape(const char * str, nsEscapeMask mask);
-NS_COM char * nsUnescape(char * str);
+char * nsUnescape(char * str);
/* decode % escaped hex codes into character values,
* modifies the parameter, returns the same buffer
*/
-NS_COM PRInt32 nsUnescapeCount (char * str);
+PRInt32 nsUnescapeCount (char * str);
/* decode % escaped hex codes into character values,
* modifies the parameter buffer, returns the length of the result
* (result may contain \0's).
*/
-NS_COM char *
+char *
nsEscapeHTML(const char * string);
-NS_COM PRUnichar *
+PRUnichar *
nsEscapeHTML2(const PRUnichar *aSourceBuffer,
PRInt32 aSourceBufferLen = -1);
/*
* Escape problem char's for HTML display
*/
#ifdef __cplusplus
@@ -137,33 +137,33 @@ enum EscapeMask {
*
* @param str url segment string
* @param len url segment string length (-1 if unknown)
* @param flags url segment type flag
* @param result result buffer, untouched if part is already escaped
*
* @return TRUE if escaping was performed, FALSE otherwise.
*/
-NS_COM PRBool NS_EscapeURL(const char *str,
+PRBool NS_EscapeURL(const char *str,
PRInt32 len,
PRUint32 flags,
nsACString &result);
/**
* Expands URL escape sequences... beware embedded null bytes!
*
* @param str url string to unescape
* @param len length of |str|
* @param flags only esc_OnlyNonASCII, esc_SkipControl and esc_AlwaysCopy
* are recognized
* @param result result buffer, untouched if |str| is already unescaped
*
* @return TRUE if unescaping was performed, FALSE otherwise.
*/
-NS_COM PRBool NS_UnescapeURL(const char *str,
+PRBool NS_UnescapeURL(const char *str,
PRInt32 len,
PRUint32 flags,
nsACString &result);
/** returns resultant string length **/
inline PRInt32 NS_UnescapeURL(char *str) {
return nsUnescapeCount(str);
}
--- a/xpcom/io/nsIInputStreamTee.idl
+++ b/xpcom/io/nsIInputStreamTee.idl
@@ -58,19 +58,19 @@ interface nsIInputStreamTee : nsIInputSt
* storage-policy is STORE_ON_DISK_AS_FILE, copying to sink happens
* synchronously while reading from the source.
*/
attribute nsIEventTarget eventTarget;
};
%{C++
// factory methods
-extern NS_COM nsresult
+extern nsresult
NS_NewInputStreamTee(nsIInputStream **tee, // read from this input stream
nsIInputStream *source,
nsIOutputStream *sink);
-extern NS_COM nsresult
+extern nsresult
NS_NewInputStreamTeeAsync(nsIInputStream **tee, // read from this input stream
nsIInputStream *source,
nsIOutputStream *sink,
nsIEventTarget *eventTarget);
%}
--- a/xpcom/io/nsIPipe.idl
+++ b/xpcom/io/nsIPipe.idl
@@ -156,17 +156,17 @@ interface nsISearchableInputStream : nsI
* specifies the max number of segments (pass 0 to use default value)
* passing PR_UINT32_MAX here causes the pipe to have "infinite" space.
* this mode can be useful in some cases, but should always be used with
* caution. the default value for this parameter is a finite value.
* @param segmentAlloc
* pass reference to nsIMemory to have all pipe allocations use this
* allocator (pass null to use the default allocator)
*/
-extern NS_COM nsresult
+extern nsresult
NS_NewPipe2(nsIAsyncInputStream **pipeIn,
nsIAsyncOutputStream **pipeOut,
PRBool nonBlockingInput = PR_FALSE,
PRBool nonBlockingOutput = PR_FALSE,
PRUint32 segmentSize = 0,
PRUint32 segmentCount = 0,
nsIMemory *segmentAlloc = nsnull);
@@ -193,17 +193,17 @@ NS_NewPipe2(nsIAsyncInputStream **pipeIn
* @param nonBlockingInput
* true specifies non-blocking input stream behavior
* @param nonBlockingOutput
* true specifies non-blocking output stream behavior
* @param segmentAlloc
* pass reference to nsIMemory to have all pipe allocations use this
* allocator (pass null to use the default allocator)
*/
-extern NS_COM nsresult
+extern nsresult
NS_NewPipe(nsIInputStream **pipeIn,
nsIOutputStream **pipeOut,
PRUint32 segmentSize = 0,
PRUint32 maxSize = 0,
PRBool nonBlockingInput = PR_FALSE,
PRBool nonBlockingOutput = PR_FALSE,
nsIMemory *segmentAlloc = nsnull);
--- a/xpcom/io/nsIStorageStream.idl
+++ b/xpcom/io/nsIStorageStream.idl
@@ -97,11 +97,11 @@ interface nsIStorageStream : nsISupports
/**
* True, when output stream has not yet been Close'ed
*/
readonly attribute boolean writeInProgress;
};
%{C++
// Factory method
-NS_COM nsresult
+nsresult
NS_NewStorageStream(PRUint32 segmentSize, PRUint32 maxSize, nsIStorageStream **result);
%}
--- a/xpcom/io/nsInputStreamTee.cpp
+++ b/xpcom/io/nsInputStreamTee.cpp
@@ -333,17 +333,17 @@ nsInputStreamTee::SetEventTarget(nsIEven
NS_IMETHODIMP
nsInputStreamTee::GetEventTarget(nsIEventTarget **anEventTarget)
{
NS_IF_ADDREF(*anEventTarget = mEventTarget);
return NS_OK;
}
-NS_COM nsresult
+nsresult
NS_NewInputStreamTeeAsync(nsIInputStream **result,
nsIInputStream *source,
nsIOutputStream *sink,
nsIEventTarget *anEventTarget)
{
nsresult rv;
nsCOMPtr<nsIInputStreamTee> tee = new nsInputStreamTee();
@@ -358,15 +358,15 @@ NS_NewInputStreamTeeAsync(nsIInputStream
rv = tee->SetEventTarget(anEventTarget);
if (NS_FAILED(rv)) return rv;
NS_ADDREF(*result = tee);
return rv;
}
-NS_COM nsresult
+nsresult
NS_NewInputStreamTee(nsIInputStream **result,
nsIInputStream *source,
nsIOutputStream *sink)
{
return NS_NewInputStreamTeeAsync(result, source, sink, nsnull);
}
--- a/xpcom/io/nsLinebreakConverter.h
+++ b/xpcom/io/nsLinebreakConverter.h
@@ -33,23 +33,22 @@
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsLinebreakConverter_h_
#define nsLinebreakConverter_h_
-
#include "nscore.h"
#include "nsString.h"
// utility class for converting between different line breaks.
-class NS_COM nsLinebreakConverter
+class nsLinebreakConverter
{
public:
// Note: enum must match char* array in GetLinebreakString
typedef enum {
eLinebreakAny, // any kind of linebreak (i.e. "don't care" source)
eLinebreakPlatform, // platform linebreak
@@ -147,12 +146,9 @@ public:
* terminated string.
* @param aOutLen: used to return character length of returned buffer, if not null.
*/
static nsresult ConvertUnicharLineBreaksInSitu(PRUnichar **ioBuffer, ELinebreakType aSrcBreaks, ELinebreakType aDestBreaks,
PRInt32 aSrcLen = kIgnoreLen, PRInt32* aOutLen = nsnull);
};
-
-
-
#endif // nsLinebreakConverter_h_
--- a/xpcom/io/nsLocalFileOS2.h
+++ b/xpcom/io/nsLocalFileOS2.h
@@ -62,18 +62,18 @@
#define INCL_DOSERRORS
#define INCL_WINCOUNTRY
#define INCL_WINWORKPLACE
#include <os2.h>
class TypeEaEnumerator;
-class NS_COM nsLocalFile : public nsILocalFileOS2,
- public nsIHashable
+class nsLocalFile : public nsILocalFileOS2,
+ public nsIHashable
{
public:
NS_DEFINE_STATIC_CID_ACCESSOR(NS_LOCAL_FILE_CID)
nsLocalFile();
static nsresult nsLocalFileConstructor(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr);
--- a/xpcom/io/nsLocalFileUnix.cpp
+++ b/xpcom/io/nsLocalFileUnix.cpp
@@ -127,17 +127,17 @@ static nsresult MacErrorMapper(OSErr inE
#define CHECK_mPath() \
PR_BEGIN_MACRO \
if (mPath.IsEmpty()) \
return NS_ERROR_NOT_INITIALIZED; \
PR_END_MACRO
/* directory enumerator */
-class NS_COM
+class
nsDirEnumeratorUnix : public nsISimpleEnumerator,
public nsIDirectoryEnumerator
{
public:
nsDirEnumeratorUnix();
// nsISupports interface
NS_DECL_ISUPPORTS
--- a/xpcom/io/nsLocalFileUnix.h
+++ b/xpcom/io/nsLocalFileUnix.h
@@ -103,17 +103,17 @@
#define LSTAT lstat64
#define HAVE_STATS64 1
#else
#define STAT stat
#define LSTAT lstat
#endif
-class NS_COM nsLocalFile :
+class nsLocalFile :
#ifdef XP_MACOSX
public nsILocalFileMac,
#else
public nsILocalFile,
#endif
public nsIHashable
{
public:
--- a/xpcom/io/nsNativeCharsetUtils.cpp
+++ b/xpcom/io/nsNativeCharsetUtils.cpp
@@ -46,24 +46,24 @@
// XP_MACOSX or ANDROID
//-----------------------------------------------------------------------------
#if defined(XP_MACOSX) || defined(ANDROID)
#include "nsAString.h"
#include "nsReadableUtils.h"
#include "nsString.h"
-NS_COM nsresult
+nsresult
NS_CopyNativeToUnicode(const nsACString &input, nsAString &output)
{
CopyUTF8toUTF16(input, output);
return NS_OK;
}
-NS_COM nsresult
+nsresult
NS_CopyUnicodeToNative(const nsAString &input, nsACString &output)
{
CopyUTF16toUTF8(input, output);
return NS_OK;
}
void
NS_StartupNativeCharsetUtils()
@@ -797,17 +797,17 @@ nsNativeCharsetConverter::IsNativeUTF8()
}
#endif // USE_STDCONV
//-----------------------------------------------------------------------------
// API implementation
//-----------------------------------------------------------------------------
-NS_COM nsresult
+nsresult
NS_CopyNativeToUnicode(const nsACString &input, nsAString &output)
{
output.Truncate();
PRUint32 inputLen = input.Length();
nsACString::const_iterator iter;
input.BeginReading(iter);
@@ -834,17 +834,17 @@ NS_CopyNativeToUnicode(const nsACString
nsresult rv = conv.NativeToUnicode(&buf, &bufLeft, &result, &resultLeft);
if (NS_SUCCEEDED(rv)) {
NS_ASSERTION(bufLeft == 0, "did not consume entire input buffer");
output.SetLength(inputLen - resultLeft);
}
return rv;
}
-NS_COM nsresult
+nsresult
NS_CopyUnicodeToNative(const nsAString &input, nsACString &output)
{
output.Truncate();
nsAString::const_iterator iter, end;
input.BeginReading(iter);
input.EndReading(end);
@@ -863,17 +863,17 @@ NS_CopyUnicodeToNative(const nsAString &
if (NS_FAILED(rv)) return rv;
if (tempLeft < sizeof(temp))
output.Append(temp, sizeof(temp) - tempLeft);
}
return NS_OK;
}
-NS_COM PRBool
+PRBool
NS_IsNativeUTF8()
{
return nsNativeCharsetConverter::IsNativeUTF8();
}
void
NS_StartupNativeCharsetUtils()
{
@@ -900,17 +900,17 @@ NS_ShutdownNativeCharsetUtils()
// XP_WIN
//-----------------------------------------------------------------------------
#elif defined(XP_WIN)
#include <windows.h>
#include "nsAString.h"
#include "nsReadableUtils.h"
-NS_COM nsresult
+nsresult
NS_CopyNativeToUnicode(const nsACString &input, nsAString &output)
{
PRUint32 inputLen = input.Length();
nsACString::const_iterator iter;
input.BeginReading(iter);
const char *buf = iter.get();
@@ -930,17 +930,17 @@ NS_CopyNativeToUnicode(const nsACString
PRUnichar *result = out_iter.get();
::MultiByteToWideChar(CP_ACP, 0, buf, inputLen, result, resultLen);
}
return NS_OK;
}
-NS_COM nsresult
+nsresult
NS_CopyUnicodeToNative(const nsAString &input, nsACString &output)
{
PRUint32 inputLen = input.Length();
nsAString::const_iterator iter;
input.BeginReading(iter);
const PRUnichar *buf = iter.get();
@@ -967,23 +967,23 @@ NS_CopyUnicodeToNative(const nsAString
::WideCharToMultiByte(CP_ACP, 0, buf, inputLen, result, resultLen,
&defaultChar, NULL);
}
return NS_OK;
}
// moved from widget/src/windows/nsToolkit.cpp
-NS_COM PRInt32
+PRInt32
NS_ConvertAtoW(const char *aStrInA, int aBufferSize, PRUnichar *aStrOutW)
{
return MultiByteToWideChar(CP_ACP, 0, aStrInA, -1, aStrOutW, aBufferSize);
}
-NS_COM PRInt32
+PRInt32
NS_ConvertWtoA(const PRUnichar *aStrInW, int aBufferSizeOut,
char *aStrOutA, const char *aDefault)
{
if ((!aStrInW) || (!aStrOutA) || (aBufferSizeOut <= 0))
return 0;
int numCharsConverted = WideCharToMultiByte(CP_ACP, 0, aStrInW, -1,
aStrOutA, aBufferSizeOut,
@@ -1017,17 +1017,17 @@ NS_ConvertWtoA(const PRUnichar *aStrInW,
#include <uconv.h>
#include "nsAString.h"
#include "nsReadableUtils.h"
#include <ulserrno.h>
#include "nsNativeCharsetUtils.h"
static UconvObject UnicodeConverter = NULL;
-NS_COM nsresult
+nsresult
NS_CopyNativeToUnicode(const nsACString &input, nsAString &output)
{
PRUint32 inputLen = input.Length();
nsACString::const_iterator iter;
input.BeginReading(iter);
const char *inputStr = iter.get();
@@ -1057,17 +1057,17 @@ NS_CopyNativeToUnicode(const nsACString
}
// Need to update string length to reflect how many bytes were actually
// written.
output.Truncate(resultLen - resultLeft);
return NS_OK;
}
-NS_COM nsresult
+nsresult
NS_CopyUnicodeToNative(const nsAString &input, nsACString &output)
{
size_t inputLen = input.Length();
nsAString::const_iterator iter;
input.BeginReading(iter);
UniChar* inputStr = (UniChar*) const_cast<PRUnichar*>(iter.get());
@@ -1131,24 +1131,24 @@ NS_ShutdownNativeCharsetUtils()
{
::UniFreeUconvObject(UnicodeConverter);
}
#else
#include "nsReadableUtils.h"
-NS_COM nsresult
+nsresult
NS_CopyNativeToUnicode(const nsACString &input, nsAString &output)
{
CopyASCIItoUTF16(input, output);
return NS_OK;
}
-NS_COM nsresult
+nsresult
NS_CopyUnicodeToNative(const nsAString &input, nsACString &output)
{
LossyCopyUTF16toASCII(input, output);
return NS_OK;
}
void
NS_StartupNativeCharsetUtils()
--- a/xpcom/io/nsNativeCharsetUtils.h
+++ b/xpcom/io/nsNativeCharsetUtils.h
@@ -49,34 +49,34 @@
* for converting *FILENAMES* between native and unicode. They are not *
* designed or tested for general encoding converter use. *
* *
\*****************************************************************************/
/**
* thread-safe conversion routines that do not depend on uconv libraries.
*/
-NS_COM nsresult NS_CopyNativeToUnicode(const nsACString &input, nsAString &output);
-NS_COM nsresult NS_CopyUnicodeToNative(const nsAString &input, nsACString &output);
+nsresult NS_CopyNativeToUnicode(const nsACString &input, nsAString &output);
+nsresult NS_CopyUnicodeToNative(const nsAString &input, nsACString &output);
/*
* This function indicates whether the character encoding used in the file
* system (more exactly what's used for |GetNativeFoo| and |SetNativeFoo|
* of |nsILocalFile|) is UTF-8 or not. Knowing that helps us avoid an
* unncessary encoding conversion in some cases. For instance, to get the leaf
* name in UTF-8 out of nsILocalFile, we can just use |GetNativeLeafName| rather
* than using |GetLeafName| and converting the result to UTF-8 if the file
* system encoding is UTF-8.
* On Unix (but not on Mac OS X), it depends on the locale and is not known
* in advance (at the compilation time) so that this function needs to be
* a real function. On Mac OS X it's always UTF-8 while on Windows
* and other platforms (e.g. OS2), it's never UTF-8.
*/
#if defined(XP_UNIX) && !defined(XP_MACOSX) && !defined(ANDROID)
-NS_COM PRBool NS_IsNativeUTF8();
+PRBool NS_IsNativeUTF8();
#else
inline PRBool NS_IsNativeUTF8()
{
#if defined(XP_MACOSX) || defined(ANDROID)
return PR_TRUE;
#else
return PR_FALSE;
#endif
--- a/xpcom/io/nsPipe3.cpp
+++ b/xpcom/io/nsPipe3.cpp
@@ -1253,17 +1253,17 @@ nsPipeOutputStream::AsyncWait(nsIOutputS
mCallbackFlags = flags;
}
}
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
-NS_COM nsresult
+nsresult
NS_NewPipe(nsIInputStream **pipeIn,
nsIOutputStream **pipeOut,
PRUint32 segmentSize,
PRUint32 maxSize,
PRBool nonBlockingInput,
PRBool nonBlockingOutput,
nsIMemory *segmentAlloc)
{
@@ -1283,17 +1283,17 @@ NS_NewPipe(nsIInputStream **pipeIn,
segmentSize, segmentCount, segmentAlloc);
if (NS_FAILED(rv)) return rv;
*pipeIn = in;
*pipeOut = out;
return NS_OK;
}
-NS_COM nsresult
+nsresult
NS_NewPipe2(nsIAsyncInputStream **pipeIn,
nsIAsyncOutputStream **pipeOut,
PRBool nonBlockingInput,
PRBool nonBlockingOutput,
PRUint32 segmentSize,
PRUint32 segmentCount,
nsIMemory *segmentAlloc)
{
--- a/xpcom/io/nsSegmentedBuffer.cpp
+++ b/xpcom/io/nsSegmentedBuffer.cpp
@@ -163,17 +163,17 @@ nsSegmentedBuffer::Empty()
nsMemory::Free(mSegmentArray);
mSegmentArray = nsnull;
}
mSegmentArrayCount = NS_SEGMENTARRAY_INITIAL_COUNT;
mFirstSegmentIndex = mLastSegmentIndex = 0;
}
#if 0
-NS_COM void
+void
TestSegmentedBuffer()
{
nsSegmentedBuffer* buf = new nsSegmentedBuffer();
NS_ASSERTION(buf, "out of memory");
buf->Init(4, 16);
char* seg;
PRBool empty;
seg = buf->AppendNewSegment();
--- a/xpcom/io/nsSegmentedBuffer.h
+++ b/xpcom/io/nsSegmentedBuffer.h
@@ -51,32 +51,32 @@ public:
mFirstSegmentIndex(0), mLastSegmentIndex(0) {}
~nsSegmentedBuffer() {
Empty();
NS_IF_RELEASE(mSegAllocator);
}
- NS_COM nsresult Init(PRUint32 segmentSize, PRUint32 maxSize,
+ nsresult Init(PRUint32 segmentSize, PRUint32 maxSize,
nsIMemory* allocator = nsnull);
- NS_COM char* AppendNewSegment(); // pushes at end
+ char* AppendNewSegment(); // pushes at end
// returns true if no more segments remain:
PRBool DeleteFirstSegment(); // pops from beginning
// returns true if no more segments remain:
PRBool DeleteLastSegment(); // pops from beginning
// Call Realloc() on last segment. This is used to reduce memory
// consumption when data is not an exact multiple of segment size.
PRBool ReallocLastSegment(size_t newSize);
- NS_COM void Empty(); // frees all segments
+ void Empty(); // frees all segments
inline PRUint32 GetSegmentCount() {
if (mFirstSegmentIndex <= mLastSegmentIndex)
return mLastSegmentIndex - mFirstSegmentIndex;
else
return mSegmentArrayCount + mLastSegmentIndex - mFirstSegmentIndex;
}
--- a/xpcom/io/nsStorageStream.cpp
+++ b/xpcom/io/nsStorageStream.cpp
@@ -538,17 +538,17 @@ nsStorageInputStream::Seek(PRUint32 aPos
mReadCursor = mStorageStream->mSegmentedBuffer->GetSegment(mSegmentNum) +
segmentOffset;
PRUint32 available = length - aPosition;
mSegmentEnd = mReadCursor + NS_MIN(mSegmentSize - segmentOffset, available);
mLogicalCursor = aPosition;
return NS_OK;
}
-NS_COM nsresult
+nsresult
NS_NewStorageStream(PRUint32 segmentSize, PRUint32 maxSize, nsIStorageStream **result)
{
NS_ENSURE_ARG(result);
nsStorageStream* storageStream = new nsStorageStream();
if (!storageStream) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(storageStream);
--- a/xpcom/io/nsStreamUtils.cpp
+++ b/xpcom/io/nsStreamUtils.cpp
@@ -202,31 +202,31 @@ private:
nsCOMPtr<nsIEventTarget> mTarget;
};
NS_IMPL_THREADSAFE_ISUPPORTS2(nsOutputStreamReadyEvent, nsIRunnable,
nsIOutputStreamCallback)
//-----------------------------------------------------------------------------
-NS_COM nsresult
+nsresult
NS_NewInputStreamReadyEvent(nsIInputStreamCallback **event,
nsIInputStreamCallback *callback,
nsIEventTarget *target)
{
NS_ASSERTION(callback, "null callback");
NS_ASSERTION(target, "null target");
nsInputStreamReadyEvent *ev = new nsInputStreamReadyEvent(callback, target);
if (!ev)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*event = ev);
return NS_OK;
}
-NS_COM nsresult
+nsresult
NS_NewOutputStreamReadyEvent(nsIOutputStreamCallback **event,
nsIOutputStreamCallback *callback,
nsIEventTarget *target)
{
NS_ASSERTION(callback, "null callback");
NS_ASSERTION(target, "null target");
nsOutputStreamReadyEvent *ev = new nsOutputStreamReadyEvent(callback, target);
if (!ev)
@@ -579,17 +579,17 @@ public:
mSink->WriteSegments(FillOutputBuffer, &state, mChunkSize, &n);
*sourceCondition = state.mSourceCondition;
return n;
}
};
//-----------------------------------------------------------------------------
-NS_COM nsresult
+nsresult
NS_AsyncCopy(nsIInputStream *source,
nsIOutputStream *sink,
nsIEventTarget *target,
nsAsyncCopyMode mode,
PRUint32 chunkSize,
nsAsyncCopyCallbackFun callback,
void *closure,
PRBool closeSource,
@@ -621,27 +621,27 @@ NS_AsyncCopy(nsIInputStream *sou
}
NS_RELEASE(copier);
return rv;
}
//-----------------------------------------------------------------------------
-NS_COM nsresult
+nsresult
NS_CancelAsyncCopy(nsISupports *aCopierCtx, nsresult aReason)
{
nsAStreamCopier *copier = static_cast<nsAStreamCopier *>(
static_cast<nsIRunnable *>(aCopierCtx));
return copier->Cancel(aReason);
}
//-----------------------------------------------------------------------------
-NS_COM nsresult
+nsresult
NS_ConsumeStream(nsIInputStream *stream, PRUint32 maxCount, nsACString &result)
{
nsresult rv = NS_OK;
result.Truncate();
while (maxCount) {
PRUint32 avail;
rv = stream->Available(&avail);
@@ -686,17 +686,17 @@ TestInputStream(nsIInputStream *inStr,
PRUint32 count,
PRUint32 *countWritten)
{
PRBool *result = static_cast<PRBool *>(closure);
*result = PR_TRUE;
return NS_ERROR_ABORT; // don't call me anymore
}
-NS_COM PRBool
+PRBool
NS_InputStreamIsBuffered(nsIInputStream *stream)
{
PRBool result = PR_FALSE;
PRUint32 n;
nsresult rv = stream->ReadSegments(TestInputStream,
&result, 1, &n);
return result || NS_SUCCEEDED(rv);
}
@@ -709,28 +709,28 @@ TestOutputStream(nsIOutputStream *outStr
PRUint32 count,
PRUint32 *countRead)
{
PRBool *result = static_cast<PRBool *>(closure);
*result = PR_TRUE;
return NS_ERROR_ABORT; // don't call me anymore
}
-NS_COM PRBool
+PRBool
NS_OutputStreamIsBuffered(nsIOutputStream *stream)
{
PRBool result = PR_FALSE;
PRUint32 n;
stream->WriteSegments(TestOutputStream, &result, 1, &n);
return result;
}
//-----------------------------------------------------------------------------
-NS_COM NS_METHOD
+NS_METHOD
NS_CopySegmentToStream(nsIInputStream *inStr,
void *closure,
const char *buffer,
PRUint32 offset,
PRUint32 count,
PRUint32 *countWritten)
{
nsIOutputStream *outStr = static_cast<nsIOutputStream *>(closure);
@@ -742,45 +742,45 @@ NS_CopySegmentToStream(nsIInputStream *i
return rv;
buffer += n;
count -= n;
*countWritten += n;
}
return NS_OK;
}
-NS_COM NS_METHOD
+NS_METHOD
NS_CopySegmentToBuffer(nsIInputStream *inStr,
void *closure,
const char *buffer,
PRUint32 offset,
PRUint32 count,
PRUint32 *countWritten)
{
char *toBuf = static_cast<char *>(closure);
memcpy(&toBuf[offset], buffer, count);
*countWritten = count;
return NS_OK;
}
-NS_COM NS_METHOD
+NS_METHOD
NS_DiscardSegment(nsIInputStream *inStr,
void *closure,
const char *buffer,
PRUint32 offset,
PRUint32 count,
PRUint32 *countWritten)
{
*countWritten = count;
return NS_OK;
}
//-----------------------------------------------------------------------------
-NS_COM NS_METHOD
+NS_METHOD
NS_WriteSegmentThunk(nsIInputStream *inStr,
void *closure,
const char *buffer,
PRUint32 offset,
PRUint32 count,
PRUint32 *countWritten)
{
nsWriteSegmentThunk *thunk = static_cast<nsWriteSegmentThunk *>(closure);
--- a/xpcom/io/nsStreamUtils.h
+++ b/xpcom/io/nsStreamUtils.h
@@ -51,32 +51,32 @@ class nsIEventTarget;
* proxy object's OnInputStreamReady function may only be called once! The
* proxy object ensures that the real notify object will be free'd on the
* thread corresponding to the given event target regardless of what thread
* the proxy object is destroyed on.
*
* This function is designed to be used to implement AsyncWait when the
* aTarget parameter is non-null.
*/
-extern NS_COM nsresult
+extern nsresult
NS_NewInputStreamReadyEvent(nsIInputStreamCallback **aEvent,
nsIInputStreamCallback *aNotify,
nsIEventTarget *aTarget);
/**
* A "one-shot" proxy of the OnOutputStreamReady callback. The resulting
* proxy object's OnOutputStreamReady function may only be called once! The
* proxy object ensures that the real notify object will be free'd on the
* thread corresponding to the given event target regardless of what thread
* the proxy object is destroyed on.
*
* This function is designed to be used to implement AsyncWait when the
* aTarget parameter is non-null.
*/
-extern NS_COM nsresult
+extern nsresult
NS_NewOutputStreamReadyEvent(nsIOutputStreamCallback **aEvent,
nsIOutputStreamCallback *aNotify,
nsIEventTarget *aTarget);
/* ------------------------------------------------------------------------- */
enum nsAsyncCopyMode {
NS_ASYNCCOPY_VIA_READSEGMENTS,
@@ -100,17 +100,17 @@ typedef void (* nsAsyncCopyCallbackFun)(
* to determine when to resume copying.
*
* Source and sink are closed by default when copying finishes or when error
* occurs. Caller can prevent closing source or sink by setting aCloseSource
* or aCloseSink to PR_FALSE.
*
* Caller can obtain aCopierCtx to be able to cancel copying.
*/
-extern NS_COM nsresult
+extern nsresult
NS_AsyncCopy(nsIInputStream *aSource,
nsIOutputStream *aSink,
nsIEventTarget *aTarget,
nsAsyncCopyMode aMode = NS_ASYNCCOPY_VIA_READSEGMENTS,
PRUint32 aChunkSize = 4096,
nsAsyncCopyCallbackFun aCallbackFun = nsnull,
void *aCallbackClosure = nsnull,
PRBool aCloseSource = PR_TRUE,
@@ -121,17 +121,17 @@ NS_AsyncCopy(nsIInputStream *aSo
* This function cancels copying started by function NS_AsyncCopy.
*
* @param aCopierCtx
* Copier context returned by NS_AsyncCopy.
* @param aReason
* A failure code indicating why the operation is being canceled.
* It is an error to pass a success code.
*/
-extern NS_COM nsresult
+extern nsresult
NS_CancelAsyncCopy(nsISupports *aCopierCtx, nsresult aReason);
/**
* This function copies all of the available data from the stream (up to at
* most aMaxCount bytes) into the given buffer. The buffer is truncated at
* the start of the function.
*
* If an error occurs while reading from the stream or while attempting to
@@ -147,101 +147,101 @@ NS_CancelAsyncCopy(nsISupports *aCopierC
* The maximum number of bytes to consume from the stream. Pass the
* value PR_UINT32_MAX to consume the entire stream. The number of
* bytes actually read is given by the length of aBuffer upon return.
* @param aBuffer
* The string object that will contain the stream data upon return.
* Note: The data copied to the string may contain null bytes and may
* contain non-ASCII values.
*/
-extern NS_COM nsresult
+extern nsresult
NS_ConsumeStream(nsIInputStream *aSource, PRUint32 aMaxCount,
nsACString &aBuffer);
/**
* This function tests whether or not the input stream is buffered. A buffered
* input stream is one that implements readSegments. The test for this is to
* simply call readSegments, without actually consuming any data from the
* stream, to verify that it functions.
*
* NOTE: If the stream is non-blocking and has no data available yet, then this
* test will fail. In that case, we return false even though the test is not
* really conclusive.
*
* @param aInputStream
* The input stream to test.
*/
-extern NS_COM PRBool
+extern PRBool
NS_InputStreamIsBuffered(nsIInputStream *aInputStream);
/**
* This function tests whether or not the output stream is buffered. A
* buffered output stream is one that implements writeSegments. The test for
* this is to simply call writeSegments, without actually writing any data into
* the stream, to verify that it functions.
*
* NOTE: If the stream is non-blocking and has no available space yet, then
* this test will fail. In that case, we return false even though the test is
* not really conclusive.
*
* @param aOutputStream
* The output stream to test.
*/
-extern NS_COM PRBool
+extern PRBool
NS_OutputStreamIsBuffered(nsIOutputStream *aOutputStream);
/**
* This function is intended to be passed to nsIInputStream::ReadSegments to
* copy data from the nsIInputStream into a nsIOutputStream passed as the
* aClosure parameter to the ReadSegments function.
*
* @see nsIInputStream.idl for a description of this function's parameters.
*/
-extern NS_COM NS_METHOD
+extern NS_METHOD
NS_CopySegmentToStream(nsIInputStream *aInputStream, void *aClosure,
const char *aFromSegment, PRUint32 aToOffset,
PRUint32 aCount, PRUint32 *aWriteCount);
/**
* This function is intended to be passed to nsIInputStream::ReadSegments to
* copy data from the nsIInputStream into a character buffer passed as the
* aClosure parameter to the ReadSegments function. The character buffer
* must be at least as large as the aCount parameter passed to ReadSegments.
*
* @see nsIInputStream.idl for a description of this function's parameters.
*/
-extern NS_COM NS_METHOD
+extern NS_METHOD
NS_CopySegmentToBuffer(nsIInputStream *aInputStream, void *aClosure,
const char *aFromSegment, PRUint32 aToOffset,
PRUint32 aCount, PRUint32 *aWriteCount);
/**
* This function is intended to be passed to nsIInputStream::ReadSegments to
* discard data from the nsIInputStream. This can be used to efficiently read
* data from the stream without actually copying any bytes.
*
* @see nsIInputStream.idl for a description of this function's parameters.
*/
-extern NS_COM NS_METHOD
+extern NS_METHOD
NS_DiscardSegment(nsIInputStream *aInputStream, void *aClosure,
const char *aFromSegment, PRUint32 aToOffset,
PRUint32 aCount, PRUint32 *aWriteCount);
/**
* This function is intended to be passed to nsIInputStream::ReadSegments to
* adjust the aInputStream parameter passed to a consumer's WriteSegmentFun.
* The aClosure parameter must be a pointer to a nsWriteSegmentThunk object.
* The mStream and mClosure members of that object will be passed to the mFun
* function, with the remainder of the parameters being what are passed to
* NS_WriteSegmentThunk.
*
* This function comes in handy when implementing ReadSegments in terms of an
* inner stream's ReadSegments.
*/
-extern NS_COM NS_METHOD
+extern NS_METHOD
NS_WriteSegmentThunk(nsIInputStream *aInputStream, void *aClosure,
const char *aFromSegment, PRUint32 aToOffset,
PRUint32 aCount, PRUint32 *aWriteCount);
struct nsWriteSegmentThunk {
nsIInputStream *mStream;
nsWriteSegmentFun mFun;
void *mClosure;
--- a/xpcom/io/nsStringStream.cpp
+++ b/xpcom/io/nsStringStream.cpp
@@ -382,17 +382,17 @@ nsStringInputStream::Write(IPC::Message
using IPC::WriteParam;
nsCAutoString value;
GetData(value);
WriteParam(aMsg, value);
}
-NS_COM nsresult
+nsresult
NS_NewByteInputStream(nsIInputStream** aStreamResult,
const char* aStringToRead, PRInt32 aLength,
nsAssignmentType aAssignment)
{
NS_PRECONDITION(aStreamResult, "null out ptr");
nsStringInputStream* stream = new nsStringInputStream();
if (! stream)
@@ -420,33 +420,33 @@ NS_NewByteInputStream(nsIInputStream** a
NS_RELEASE(stream);
return rv;
}
*aStreamResult = stream;
return NS_OK;
}
-NS_COM nsresult
+nsresult
NS_NewStringInputStream(nsIInputStream** aStreamResult,
const nsAString& aStringToRead)
{
char* data = ToNewCString(aStringToRead); // truncates high-order bytes
if (!data)
return NS_ERROR_OUT_OF_MEMORY;
nsresult rv = NS_NewByteInputStream(aStreamResult, data,
aStringToRead.Length(),
NS_ASSIGNMENT_ADOPT);
if (NS_FAILED(rv))
NS_Free(data);
return rv;
}
-NS_COM nsresult
+nsresult
NS_NewCStringInputStream(nsIInputStream** aStreamResult,
const nsACString& aStringToRead)
{
nsACString::const_iterator data;
aStringToRead.BeginReading(data);
return NS_NewByteInputStream(aStreamResult, data.get(), data.size_forward(),
NS_ASSIGNMENT_COPY);
--- a/xpcom/io/nsStringStream.h
+++ b/xpcom/io/nsStringStream.h
@@ -75,34 +75,34 @@
*
* If aAssignment is NS_ASSIGNMENT_ADOPT, then the resulting stream refers
* directly to the given buffer (aStringToRead) and will free aStringToRead
* once the stream is closed.
*
* If aLength is less than zero, then the length of aStringToRead will be
* determined by scanning the buffer for the first null byte.
*/
-extern NS_COM nsresult
+extern nsresult
NS_NewByteInputStream(nsIInputStream** aStreamResult,
const char* aStringToRead, PRInt32 aLength = -1,
nsAssignmentType aAssignment = NS_ASSIGNMENT_DEPEND);
/**
* Factory method to get an nsInputStream from an nsAString. Result will
* implement nsIStringInputStream and nsISeekableStream.
*
* The given string data will be converted to a single-byte data buffer via
* truncation (i.e., the high-order byte of each character will be discarded).
* This could result in data-loss, so be careful when using this function.
*/
-extern NS_COM nsresult
+extern nsresult
NS_NewStringInputStream(nsIInputStream** aStreamResult,
const nsAString& aStringToRead);
/**
* Factory method to get an nsInputStream from an nsACString. Result will
* implement nsIStringInputStream and nsISeekableStream.
*/
-extern NS_COM nsresult
+extern nsresult
NS_NewCStringInputStream(nsIInputStream** aStreamResult,
const nsACString& aStringToRead);
#endif // nsStringStream_h__
--- a/xpcom/io/nsUnicharInputStream.h
+++ b/xpcom/io/nsUnicharInputStream.h
@@ -51,15 +51,15 @@ class nsSimpleUnicharStreamFactory :
private nsISimpleUnicharStreamFactory
{
public:
nsSimpleUnicharStreamFactory() {}
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIFACTORY
NS_DECL_NSISIMPLEUNICHARSTREAMFACTORY
- static NS_COM nsSimpleUnicharStreamFactory* GetInstance();
+ static nsSimpleUnicharStreamFactory* GetInstance();
private:
static const nsSimpleUnicharStreamFactory kInstance;
};
#endif // nsUnicharInputStream_h__
--- a/xpcom/io/nsWildCard.cpp
+++ b/xpcom/io/nsWildCard.cpp
@@ -165,23 +165,23 @@ static int
template<class T>
int
NS_WildCardValid_(const T *expr)
{
int x = ::_valid_subexp(expr, T('\0'), T('\0'));
return (x < 0 ? x : VALID_SXP);
}
-NS_COM int
+int
NS_WildCardValid(const char *expr)
{
return NS_WildCardValid_(expr);
}
-NS_COM int
+int
NS_WildCardValid(const PRUnichar *expr)
{
return NS_WildCardValid_(expr);
}
/* ----------------------------- _shexp_match ----------------------------- */
@@ -439,33 +439,33 @@ ns_WildCardMatch(const T *str, const T *
if (ret == MATCH)
ret = ::_shexp_match(str, expr, case_insensitive, 0);
NS_Free(expr);
return ret;
}
template<class T>
-NS_COM int
+int
NS_WildCardMatch_(const T *str, const T *expr, PRBool case_insensitive)
{
int is_valid = NS_WildCardValid(expr);
switch(is_valid) {
case INVALID_SXP:
return -1;
default:
return ::ns_WildCardMatch(str, expr, case_insensitive);
}
}
-NS_COM int
+int
NS_WildCardMatch(const char *str, const char *xp,
PRBool case_insensitive)
{
return NS_WildCardMatch_(str, xp, case_insensitive);
}
-NS_COM int
+int
NS_WildCardMatch(const PRUnichar *str, const PRUnichar *xp,
PRBool case_insensitive)
{
return NS_WildCardMatch_(str, xp, case_insensitive);
}
--- a/xpcom/io/nsWildCard.h
+++ b/xpcom/io/nsWildCard.h
@@ -65,32 +65,32 @@
* INVALID_SXP if exp is a shell expression, but invalid
* VALID_SXP if exp is a valid shell expression
*/
#define NON_SXP -1
#define INVALID_SXP -2
#define VALID_SXP 1
-NS_COM int NS_WildCardValid(const char *expr);
+int NS_WildCardValid(const char *expr);
-NS_COM int NS_WildCardValid(const PRUnichar *expr);
+int NS_WildCardValid(const PRUnichar *expr);
/* return values for the search routines */
#define MATCH 0
#define NOMATCH 1
#define ABORTED -1
/*
* NS_WildCardMatch
*
* Takes a prevalidated shell expression exp, and a string str.
*
* Returns 0 on match and 1 on non-match.
*/
-NS_COM int NS_WildCardMatch(const char *str, const char *expr,
+int NS_WildCardMatch(const char *str, const char *expr,
PRBool case_insensitive);
-NS_COM int NS_WildCardMatch(const PRUnichar *str, const PRUnichar *expr,
+int NS_WildCardMatch(const PRUnichar *str, const PRUnichar *expr,
PRBool case_insensitive);
#endif /* nsWildCard_h__ */
--- a/xpcom/proxy/public/nsIProxyObjectManager.idl
+++ b/xpcom/proxy/public/nsIProxyObjectManager.idl
@@ -132,13 +132,13 @@ interface nsIProxyObjectManager : nsISup
#ifdef MOZILLA_INTERNAL_API
/**
* Helper function for code that already has a link-time dependency on the
* internal API (MOZILLA_INTERNAL_API) and needs to get proxies in a bunch of
* different places. This way, the caller isn't forced to get the proxy object
* manager themselves every single time, thus making the calling code more
* readable. The parameters are the same as for GetProxyForObject.
*/
-extern NS_COM nsresult
+extern nsresult
NS_GetProxyForObject(nsIEventTarget *target, REFNSIID iid, nsISupports* object,
PRInt32 proxyType, void** result);
#endif
%}
--- a/xpcom/proxy/src/nsProxyObjectManager.cpp
+++ b/xpcom/proxy/src/nsProxyObjectManager.cpp
@@ -321,17 +321,17 @@ nsProxyObjectManager::GetClass(REFNSIID
/**
* Helper function for code that already has a link-time dependency on
* libxpcom and needs to get proxies in a bunch of different places.
* This way, the caller isn't forced to get the proxy object manager
* themselves every single time, thus making the calling code more
* readable.
*/
-NS_COM nsresult
+nsresult
NS_GetProxyForObject(nsIEventTarget *target,
REFNSIID aIID,
nsISupports* aObj,
PRInt32 proxyType,
void** aProxyObject)
{
static NS_DEFINE_CID(proxyObjMgrCID, NS_PROXYEVENT_MANAGER_CID);
--- a/xpcom/string/public/nsAString.h
+++ b/xpcom/string/public/nsAString.h
@@ -69,17 +69,17 @@
#include "nsTSubstring.h"
#include "string-template-undef.h"
/**
* ASCII case-insensitive comparator. (for Unicode case-insensitive
* comparision, see nsUnicharUtils.h)
*/
-class NS_COM nsCaseInsensitiveCStringComparator
+class nsCaseInsensitiveCStringComparator
: public nsCStringComparator
{
public:
nsCaseInsensitiveCStringComparator() {}
typedef char char_type;
virtual int operator()( const char_type*, const char_type*, PRUint32, PRUint32 ) const;
};
--- a/xpcom/string/public/nsCharTraits.h
+++ b/xpcom/string/public/nsCharTraits.h
@@ -146,17 +146,17 @@ template <class CharT> struct nsCharTrai
NS_SPECIALIZE_TEMPLATE
struct nsCharTraits<PRUnichar>
{
typedef PRUnichar char_type;
typedef PRUint16 unsigned_char_type;
typedef char incompatible_char_type;
- NS_COM static char_type *sEmptyBuffer;
+ static char_type *sEmptyBuffer;
static
void
assign( char_type& lhs, char_type rhs )
{
lhs = rhs;
}
@@ -436,17 +436,17 @@ struct nsCharTraits<PRUnichar>
NS_SPECIALIZE_TEMPLATE
struct nsCharTraits<char>
{
typedef char char_type;
typedef unsigned char unsigned_char_type;
typedef PRUnichar incompatible_char_type;
- NS_COM static char_type *sEmptyBuffer;
+ static char_type *sEmptyBuffer;
static
void
assign( char_type& lhs, char_type rhs )
{
lhs = rhs;
}
--- a/xpcom/string/public/nsPrintfCString.h
+++ b/xpcom/string/public/nsPrintfCString.h
@@ -62,17 +62,17 @@
* to get a wide version of your formatted data, you must, e.g.,
*
* CopyASCIItoUTF16(nsPrintfCString("%f", 13.917"), myStr);
*
* That's another good reason to avoid this class for anything but numbers ... as strings can be
* much more efficiently handled with |NS_LITERAL_[C]STRING| and |nsLiteral[C]String|.
*/
-class NS_COM nsPrintfCString : public nsCString
+class nsPrintfCString : public nsCString
{
typedef nsCString string_type;
enum { kLocalBufferSize=15 };
// ought to be large enough for most things ... a |long long| needs at most 20 (so you'd better ask)
// pinkerton suggests 7. We should measure and decide what's appropriate
public:
--- a/xpcom/string/public/nsReadableUtils.h
+++ b/xpcom/string/public/nsReadableUtils.h
@@ -54,189 +54,188 @@ inline size_t Distance( const nsReadingI
{
return end.get() - start.get();
}
inline size_t Distance( const nsReadingIterator<char>& start, const nsReadingIterator<char>& end )
{
return end.get() - start.get();
}
-NS_COM void LossyCopyUTF16toASCII( const nsAString& aSource, nsACString& aDest NS_OUTPARAM );
-NS_COM void CopyASCIItoUTF16( const nsACString& aSource, nsAString& aDest NS_OUTPARAM );
+void LossyCopyUTF16toASCII( const nsAString& aSource, nsACString& aDest NS_OUTPARAM );
+void CopyASCIItoUTF16( const nsACString& aSource, nsAString& aDest NS_OUTPARAM );
-NS_COM void LossyCopyUTF16toASCII( const PRUnichar* aSource, nsACString& aDest NS_OUTPARAM );
-NS_COM void CopyASCIItoUTF16( const char* aSource, nsAString& aDest NS_OUTPARAM );
+void LossyCopyUTF16toASCII( const PRUnichar* aSource, nsACString& aDest NS_OUTPARAM );
+void CopyASCIItoUTF16( const char* aSource, nsAString& aDest NS_OUTPARAM );
-NS_COM void CopyUTF16toUTF8( const nsAString& aSource, nsACString& aDest NS_OUTPARAM );
-NS_COM void CopyUTF8toUTF16( const nsACString& aSource, nsAString& aDest NS_OUTPARAM );
+void CopyUTF16toUTF8( const nsAString& aSource, nsACString& aDest NS_OUTPARAM );
+void CopyUTF8toUTF16( const nsACString& aSource, nsAString& aDest NS_OUTPARAM );
-NS_COM void CopyUTF16toUTF8( const PRUnichar* aSource, nsACString& aDest NS_OUTPARAM );
-NS_COM void CopyUTF8toUTF16( const char* aSource, nsAString& aDest NS_OUTPARAM );
+void CopyUTF16toUTF8( const PRUnichar* aSource, nsACString& aDest NS_OUTPARAM );
+void CopyUTF8toUTF16( const char* aSource, nsAString& aDest NS_OUTPARAM );
-NS_COM void LossyAppendUTF16toASCII( const nsAString& aSource, nsACString& aDest );
-NS_COM void AppendASCIItoUTF16( const nsACString& aSource, nsAString& aDest );
+void LossyAppendUTF16toASCII( const nsAString& aSource, nsACString& aDest );
+void AppendASCIItoUTF16( const nsACString& aSource, nsAString& aDest );
-NS_COM void LossyAppendUTF16toASCII( const PRUnichar* aSource, nsACString& aDest );
-NS_COM void AppendASCIItoUTF16( const char* aSource, nsAString& aDest );
+void LossyAppendUTF16toASCII( const PRUnichar* aSource, nsACString& aDest );
+void AppendASCIItoUTF16( const char* aSource, nsAString& aDest );
-NS_COM void AppendUTF16toUTF8( const nsAString& aSource, nsACString& aDest );
-NS_COM void AppendUTF8toUTF16( const nsACString& aSource, nsAString& aDest );
+void AppendUTF16toUTF8( const nsAString& aSource, nsACString& aDest );
+void AppendUTF8toUTF16( const nsACString& aSource, nsAString& aDest );
-NS_COM void AppendUTF16toUTF8( const PRUnichar* aSource, nsACString& aDest );
-NS_COM void AppendUTF8toUTF16( const char* aSource, nsAString& aDest );
+void AppendUTF16toUTF8( const PRUnichar* aSource, nsACString& aDest );
+void AppendUTF8toUTF16( const char* aSource, nsAString& aDest );
/**
* Returns a new |char| buffer containing a zero-terminated copy of |aSource|.
*
* Allocates and returns a new |char| buffer which you must free with |nsMemory::Free|.
* Performs a lossy encoding conversion by chopping 16-bit wide characters down to 8-bits wide while copying |aSource| to your new buffer.
* This conversion is not well defined; but it reproduces legacy string behavior.
* The new buffer is zero-terminated, but that may not help you if |aSource| contains embedded nulls.
*
* @param aSource a 16-bit wide string
* @return a new |char| buffer you must free with |nsMemory::Free|.
*/
-NS_COM char* ToNewCString( const nsAString& aSource );
+char* ToNewCString( const nsAString& aSource );
/**
* Returns a new |char| buffer containing a zero-terminated copy of |aSource|.
*
* Allocates and returns a new |char| buffer which you must free with |nsMemory::Free|.
* The new buffer is zero-terminated, but that may not help you if |aSource| contains embedded nulls.
*
* @param aSource an 8-bit wide string
* @return a new |char| buffer you must free with |nsMemory::Free|.
*/
-NS_COM char* ToNewCString( const nsACString& aSource );
+char* ToNewCString( const nsACString& aSource );
/**
* Returns a new |char| buffer containing a zero-terminated copy of |aSource|.
*
* Allocates and returns a new |char| buffer which you must free with
* |nsMemory::Free|.
* Performs an encoding conversion from a UTF-16 string to a UTF-8 string
* copying |aSource| to your new buffer.
* The new buffer is zero-terminated, but that may not help you if |aSource|
* contains embedded nulls.
*
* @param aSource a UTF-16 string (made of PRUnichar's)
* @param aUTF8Count the number of 8-bit units that was returned
* @return a new |char| buffer you must free with |nsMemory::Free|.
*/
-NS_COM char* ToNewUTF8String( const nsAString& aSource, PRUint32 *aUTF8Count = nsnull );
+char* ToNewUTF8String( const nsAString& aSource, PRUint32 *aUTF8Count = nsnull );
/**
* Returns a new |PRUnichar| buffer containing a zero-terminated copy of
* |aSource|.
*
* Allocates and returns a new |PRUnichar| buffer which you must free with
* |nsMemory::Free|.
* The new buffer is zero-terminated, but that may not help you if |aSource|
* contains embedded nulls.
*
* @param aSource a UTF-16 string
* @return a new |PRUnichar| buffer you must free with |nsMemory::Free|.
*/
-NS_COM PRUnichar* ToNewUnicode( const nsAString& aSource );
+PRUnichar* ToNewUnicode( const nsAString& aSource );
/**
* Returns a new |PRUnichar| buffer containing a zero-terminated copy of |aSource|.
*
* Allocates and returns a new |PRUnichar| buffer which you must free with |nsMemory::Free|.
* Performs an encoding conversion by 0-padding 8-bit wide characters up to 16-bits wide while copying |aSource| to your new buffer.
* This conversion is not well defined; but it reproduces legacy string behavior.
* The new buffer is zero-terminated, but that may not help you if |aSource| contains embedded nulls.
*
* @param aSource an 8-bit wide string (a C-string, NOT UTF-8)
* @return a new |PRUnichar| buffer you must free with |nsMemory::Free|.
*/
-NS_COM PRUnichar* ToNewUnicode( const nsACString& aSource );
+PRUnichar* ToNewUnicode( const nsACString& aSource );
/**
* Returns a new |PRUnichar| buffer containing a zero-terminated copy
* of |aSource|.
*
* Allocates and returns a new |char| buffer which you must free with
* |nsMemory::Free|. Performs an encoding conversion from UTF-8 to UTF-16
* while copying |aSource| to your new buffer. This conversion is well defined
* for a valid UTF-8 string. The new buffer is zero-terminated, but that
* may not help you if |aSource| contains embedded nulls.
*
* @param aSource an 8-bit wide string, UTF-8 encoded
* @param aUTF16Count the number of 16-bit units that was returned
* @return a new |PRUnichar| buffer you must free with |nsMemory::Free|.
* (UTF-16 encoded)
*/
-NS_COM PRUnichar* UTF8ToNewUnicode( const nsACString& aSource, PRUint32 *aUTF16Count = nsnull );
+PRUnichar* UTF8ToNewUnicode( const nsACString& aSource, PRUint32 *aUTF16Count = nsnull );
/**
* Copies |aLength| 16-bit code units from the start of |aSource| to the
* |PRUnichar| buffer |aDest|.
*
* After this operation |aDest| is not null terminated.
*
* @param aSource a UTF-16 string
* @param aSrcOffset start offset in the source string
* @param aDest a |PRUnichar| buffer
* @param aLength the number of 16-bit code units to copy
* @return pointer to destination buffer - identical to |aDest|
*/
-NS_COM PRUnichar* CopyUnicodeTo( const nsAString& aSource,
+PRUnichar* CopyUnicodeTo( const nsAString& aSource,
PRUint32 aSrcOffset,
PRUnichar* aDest,
PRUint32 aLength );
/**
* Copies 16-bit characters between iterators |aSrcStart| and
* |aSrcEnd| to the writable string |aDest|. Similar to the
* |nsString::Mid| method.
*
* After this operation |aDest| is not null terminated.
*
* @param aSrcStart start source iterator
* @param aSrcEnd end source iterator
* @param aDest destination for the copy
*/
-NS_COM void CopyUnicodeTo( const nsAString::const_iterator& aSrcStart,
+void CopyUnicodeTo( const nsAString::const_iterator& aSrcStart,
const nsAString::const_iterator& aSrcEnd,
nsAString& aDest );
/**
* Appends 16-bit characters between iterators |aSrcStart| and
* |aSrcEnd| to the writable string |aDest|.
*
* After this operation |aDest| is not null terminated.
*
* @param aSrcStart start source iterator
* @param aSrcEnd end source iterator
* @param aDest destination for the copy
*/
-NS_COM void AppendUnicodeTo( const nsAString::const_iterator& aSrcStart,
+void AppendUnicodeTo( const nsAString::const_iterator& aSrcStart,
const nsAString::const_iterator& aSrcEnd,
nsAString& aDest );
/**
* Returns |PR_TRUE| if |aString| contains only ASCII characters, that is, characters in the range (0x00, 0x7F).
*
* @param aString a 16-bit wide string to scan
*/
-NS_COM PRBool IsASCII( const nsAString& aString );
+PRBool IsASCII( const nsAString& aString );
/**
* Returns |PR_TRUE| if |aString| contains only ASCII characters, that is, characters in the range (0x00, 0x7F).
*
* @param aString a 8-bit wide string to scan
*/
-NS_COM PRBool IsASCII( const nsACString& aString );
-
+PRBool IsASCII( const nsACString& aString );
/**
* Returns |PR_TRUE| if |aString| is a valid UTF-8 string.
* XXX This is not bullet-proof and nor an all-purpose UTF-8 validator.
* It is mainly written to replace and roughly equivalent to
*
* str.Equals(NS_ConvertUTF16toUTF8(NS_ConvertUTF8toUTF16(str)))
*
@@ -246,51 +245,51 @@ NS_COM PRBool IsASCII( const nsACString&
* of surrogate codepoints and non-characters ( 0xFFFE and 0xFFFF
* in planes 0 through 16.) as well as overlong UTF-8 sequences.
* Also note that it regards UTF-8 sequences corresponding to
* codepoints above 0x10FFFF as invalid in accordance with
* http://www.ietf.org/internet-drafts/draft-yergeau-rfc2279bis-04.txt
*
* @param aString an 8-bit wide string to scan
*/
-NS_COM PRBool IsUTF8( const nsACString& aString );
+PRBool IsUTF8( const nsACString& aString );
-NS_COM PRBool ParseString(const nsACString& aAstring, char aDelimiter,
+PRBool ParseString(const nsACString& aAstring, char aDelimiter,
nsTArray<nsCString>& aArray);
/**
* Converts case in place in the argument string.
*/
-NS_COM void ToUpperCase( nsACString& );
+void ToUpperCase( nsACString& );
-NS_COM void ToLowerCase( nsACString& );
+void ToLowerCase( nsACString& );
-NS_COM void ToUpperCase( nsCSubstring& );
+void ToUpperCase( nsCSubstring& );
-NS_COM void ToLowerCase( nsCSubstring& );
+void ToLowerCase( nsCSubstring& );
/**
* Converts case from string aSource to aDest.
*/
-NS_COM void ToUpperCase( const nsACString& aSource, nsACString& aDest );
+void ToUpperCase( const nsACString& aSource, nsACString& aDest );
-NS_COM void ToLowerCase( const nsACString& aSource, nsACString& aDest );
+void ToLowerCase( const nsACString& aSource, nsACString& aDest );
/**
* Finds the leftmost occurrence of |aPattern|, if any in the range |aSearchStart|..|aSearchEnd|.
*
* Returns |PR_TRUE| if a match was found, and adjusts |aSearchStart| and |aSearchEnd| to
* point to the match. If no match was found, returns |PR_FALSE| and makes |aSearchStart == aSearchEnd|.
*
* Currently, this is equivalent to the O(m*n) implementation previously on |ns[C]String|.
* If we need something faster, then we can implement that later.
*/
-NS_COM PRBool FindInReadable( const nsAString& aPattern, nsAString::const_iterator&, nsAString::const_iterator&, const nsStringComparator& = nsDefaultStringComparator() );
-NS_COM PRBool FindInReadable( const nsACString& aPattern, nsACString::const_iterator&, nsACString::const_iterator&, const nsCStringComparator& = nsDefaultCStringComparator() );
+PRBool FindInReadable( const nsAString& aPattern, nsAString::const_iterator&, nsAString::const_iterator&, const nsStringComparator& = nsDefaultStringComparator() );
+PRBool FindInReadable( const nsACString& aPattern, nsACString::const_iterator&, nsACString::const_iterator&, const nsCStringComparator& = nsDefaultCStringComparator() );
/* sometimes we don't care about where the string was, just that we
* found it or not */
inline PRBool FindInReadable( const nsAString& aPattern, const nsAString& aSource, const nsStringComparator& compare = nsDefaultStringComparator() )
{
nsAString::const_iterator start, end;
aSource.BeginReading(start);
aSource.EndReading(end);
@@ -301,80 +300,79 @@ inline PRBool FindInReadable( const nsAC
{
nsACString::const_iterator start, end;
aSource.BeginReading(start);
aSource.EndReading(end);
return FindInReadable(aPattern, start, end, compare);
}
-NS_COM PRBool CaseInsensitiveFindInReadable( const nsACString& aPattern, nsACString::const_iterator&, nsACString::const_iterator& );
+PRBool CaseInsensitiveFindInReadable( const nsACString& aPattern, nsACString::const_iterator&, nsACString::const_iterator& );
/**
* Finds the rightmost occurrence of |aPattern|
* Returns |PR_TRUE| if a match was found, and adjusts |aSearchStart| and |aSearchEnd| to
* point to the match. If no match was found, returns |PR_FALSE| and makes |aSearchStart == aSearchEnd|.
*
*/
-NS_COM PRBool RFindInReadable( const nsAString& aPattern, nsAString::const_iterator&, nsAString::const_iterator&, const nsStringComparator& = nsDefaultStringComparator() );
-NS_COM PRBool RFindInReadable( const nsACString& aPattern, nsACString::const_iterator&, nsACString::const_iterator&, const nsCStringComparator& = nsDefaultCStringComparator() );
+PRBool RFindInReadable( const nsAString& aPattern, nsAString::const_iterator&, nsAString::const_iterator&, const nsStringComparator& = nsDefaultStringComparator() );
+PRBool RFindInReadable( const nsACString& aPattern, nsACString::const_iterator&, nsACString::const_iterator&, const nsCStringComparator& = nsDefaultCStringComparator() );
/**
* Finds the leftmost occurrence of |aChar|, if any in the range
* |aSearchStart|..|aSearchEnd|.
*
* Returns |PR_TRUE| if a match was found, and adjusts |aSearchStart| to
* point to the match. If no match was found, returns |PR_FALSE| and
* makes |aSearchStart == aSearchEnd|.
*/
-NS_COM PRBool FindCharInReadable( PRUnichar aChar, nsAString::const_iterator& aSearchStart, const nsAString::const_iterator& aSearchEnd );
-NS_COM PRBool FindCharInReadable( char aChar, nsACString::const_iterator& aSearchStart, const nsACString::const_iterator& aSearchEnd );
+PRBool FindCharInReadable( PRUnichar aChar, nsAString::const_iterator& aSearchStart, const nsAString::const_iterator& aSearchEnd );
+PRBool FindCharInReadable( char aChar, nsACString::const_iterator& aSearchStart, const nsACString::const_iterator& aSearchEnd );
/**
* Finds the number of occurences of |aChar| in the string |aStr|
*/
-NS_COM PRUint32 CountCharInReadable( const nsAString& aStr,
+PRUint32 CountCharInReadable( const nsAString& aStr,
PRUnichar aChar );
-NS_COM PRUint32 CountCharInReadable( const nsACString& aStr,
+PRUint32 CountCharInReadable( const nsACString& aStr,
char aChar );
-NS_COM PRBool
+PRBool
StringBeginsWith( const nsAString& aSource, const nsAString& aSubstring,
const nsStringComparator& aComparator =
nsDefaultStringComparator() );
-NS_COM PRBool
+PRBool
StringBeginsWith( const nsACString& aSource, const nsACString& aSubstring,
const nsCStringComparator& aComparator =
nsDefaultCStringComparator() );
-NS_COM PRBool
+PRBool
StringEndsWith( const nsAString& aSource, const nsAString& aSubstring,
const nsStringComparator& aComparator =
nsDefaultStringComparator() );
-NS_COM PRBool
+PRBool
StringEndsWith( const nsACString& aSource, const nsACString& aSubstring,
const nsCStringComparator& aComparator =
nsDefaultCStringComparator() );
-NS_COM const nsAFlatString& EmptyString();
-NS_COM const nsAFlatCString& EmptyCString();
-
+const nsAFlatString& EmptyString();
+const nsAFlatCString& EmptyCString();
/**
* Compare a UTF-8 string to an UTF-16 string.
*
* Returns 0 if the strings are equal, -1 if aUTF8String is less
* than aUTF16Count, and 1 in the reverse case. In case of fatal
* error (eg the strings are not valid UTF8 and UTF16 respectively),
* this method will return PR_INT32_MIN.
*/
-NS_COM PRInt32
+PRInt32
CompareUTF8toUTF16(const nsASingleFragmentCString& aUTF8String,
const nsASingleFragmentString& aUTF16String);
-NS_COM void
+void
AppendUCS4ToUTF16(const PRUint32 aSource, nsAString& aDest);
template<class T>
inline PRBool EnsureStringLength(T& aStr, PRUint32 aLen)
{
aStr.SetLength(aLen);
return (aStr.Length() == aLen);
}
--- a/xpcom/string/public/nsStringBuffer.h
+++ b/xpcom/string/public/nsStringBuffer.h
@@ -68,41 +68,41 @@ class nsStringBuffer
* buffer by calling the Data method to fetch the raw data pointer. Care
* must be taken to properly null terminate the character array. The
* storage size can be greater than the length of the actual string
* (i.e., it is not required that the null terminator appear in the last
* storage unit of the string buffer's data).
*
* @return new string buffer or null if out of memory.
*/
- NS_COM static nsStringBuffer* Alloc(size_t storageSize);
+ static nsStringBuffer* Alloc(size_t storageSize);
/**
* Resizes the given string buffer to the specified storage size. This
* method must not be called on a readonly string buffer. Use this API
* carefully!!
*
* This method behaves like the ANSI-C realloc function. (i.e., If the
* allocation fails, null will be returned and the given string buffer
* will remain unmodified.)
*
* @see IsReadonly
*/
- NS_COM static nsStringBuffer* Realloc(nsStringBuffer* buf, size_t storageSize);
+ static nsStringBuffer* Realloc(nsStringBuffer* buf, size_t storageSize);
/**
* Increment the reference count on this string buffer.
*/
- NS_COM void NS_FASTCALL AddRef();
+ void NS_FASTCALL AddRef();
/**
* Decrement the reference count on this string buffer. The string
* buffer will be destroyed when its reference count reaches zero.
*/
- NS_COM void NS_FASTCALL Release();
+ void NS_FASTCALL Release();
/**
* This method returns the string buffer corresponding to the given data
* pointer. The data pointer must have been returned previously by a
* call to the nsStringBuffer::Data method.
*/
static nsStringBuffer* FromData(void* data)
{
@@ -143,32 +143,32 @@ class nsStringBuffer
/**
* The FromString methods return a string buffer for the given string
* object or null if the string object does not have a string buffer.
* The reference count of the string buffer is NOT incremented by these
* methods. If the caller wishes to hold onto the returned value, then
* the returned string buffer must have its reference count incremented
* via a call to the AddRef method.
*/
- NS_COM static nsStringBuffer* FromString(const nsAString &str);
- NS_COM static nsStringBuffer* FromString(const nsACString &str);
+ static nsStringBuffer* FromString(const nsAString &str);
+ static nsStringBuffer* FromString(const nsACString &str);
/**
* The ToString methods assign this string buffer to a given string
* object. If the string object does not support sharable string
* buffers, then its value will be set to a copy of the given string
* buffer. Otherwise, these methods increment the reference count of the
* given string buffer. It is important to specify the length (in
* storage units) of the string contained in the string buffer since the
* length of the string may be less than its storage size. The string
* must have a null terminator at the offset specified by |len|.
*
* NOTE: storage size is measured in bytes even for wide strings;
* however, string length is always measured in storage units
* (2-byte units for wide strings).
*/
- NS_COM void ToString(PRUint32 len, nsAString &str,
+ void ToString(PRUint32 len, nsAString &str,
PRBool aMoveOwnership = PR_FALSE);
- NS_COM void ToString(PRUint32 len, nsACString &str,
+ void ToString(PRUint32 len, nsACString &str,
PRBool aMoveOwnership = PR_FALSE);
};
#endif /* !defined(nsStringBuffer_h__ */
--- a/xpcom/string/public/nsTDependentString.h
+++ b/xpcom/string/public/nsTDependentString.h
@@ -112,17 +112,17 @@ class nsTDependentString_CharT : public
* allow this class to be bound to a different string...
*/
void Rebind( const char_type* data )
{
Rebind(data, PRUint32(char_traits::length(data)));
}
- NS_COM void Rebind( const char_type* data, size_type length );
+ void Rebind( const char_type* data, size_type length );
void Rebind( const char_type* start, const char_type* end )
{
Rebind(start, PRUint32(end - start));
}
private:
--- a/xpcom/string/public/nsTDependentSubstring.h
+++ b/xpcom/string/public/nsTDependentSubstring.h
@@ -52,19 +52,19 @@
class nsTDependentSubstring_CharT : public nsTSubstring_CharT
{
public:
typedef nsTDependentSubstring_CharT self_type;
public:
- NS_COM void Rebind( const substring_type&, PRUint32 startPos, PRUint32 length = size_type(-1) );
+ void Rebind( const substring_type&, PRUint32 startPos, PRUint32 length = size_type(-1) );
- NS_COM void Rebind( const char_type* start, const char_type* end );
+ void Rebind( const char_type* start, const char_type* end );
nsTDependentSubstring_CharT( const substring_type& str, PRUint32 startPos, PRUint32 length = size_type(-1) )
: substring_type()
{
Rebind(str, startPos, length);
}
nsTDependentSubstring_CharT( const char_type* start, const char_type* end )
--- a/xpcom/string/public/nsTPromiseFlatString.h
+++ b/xpcom/string/public/nsTPromiseFlatString.h
@@ -94,17 +94,17 @@
class nsTPromiseFlatString_CharT : public nsTString_CharT
{
public:
typedef nsTPromiseFlatString_CharT self_type;
private:
- NS_COM void Init( const substring_type& );
+ void Init( const substring_type& );
// NOT TO BE IMPLEMENTED
void operator=( const self_type& );
// NOT TO BE IMPLEMENTED
nsTPromiseFlatString_CharT();
public:
--- a/xpcom/string/public/nsTString.h
+++ b/xpcom/string/public/nsTString.h
@@ -145,137 +145,137 @@ class nsTString_CharT : public nsTSubstr
* @param aString is substring to be sought in this
* @param aIgnoreCase selects case sensitivity
* @param aOffset tells us where in this string to start searching
* @param aCount tells us how far from the offset we are to search. Use
* -1 to search the whole string.
* @return offset in string, or kNotFound
*/
- NS_COM PRInt32 Find( const nsCString& aString, PRBool aIgnoreCase=PR_FALSE, PRInt32 aOffset=0, PRInt32 aCount=-1 ) const;
- NS_COM PRInt32 Find( const char* aString, PRBool aIgnoreCase=PR_FALSE, PRInt32 aOffset=0, PRInt32 aCount=-1 ) const;
+ PRInt32 Find( const nsCString& aString, PRBool aIgnoreCase=PR_FALSE, PRInt32 aOffset=0, PRInt32 aCount=-1 ) const;
+ PRInt32 Find( const char* aString, PRBool aIgnoreCase=PR_FALSE, PRInt32 aOffset=0, PRInt32 aCount=-1 ) const;
#ifdef CharT_is_PRUnichar
- NS_COM PRInt32 Find( const nsAFlatString& aString, PRInt32 aOffset=0, PRInt32 aCount=-1 ) const;
- NS_COM PRInt32 Find( const PRUnichar* aString, PRInt32 aOffset=0, PRInt32 aCount=-1 ) const;
+ PRInt32 Find( const nsAFlatString& aString, PRInt32 aOffset=0, PRInt32 aCount=-1 ) const;
+ PRInt32 Find( const PRUnichar* aString, PRInt32 aOffset=0, PRInt32 aCount=-1 ) const;
#endif
/**
* This methods scans the string backwards, looking for the given string
*
* @param aString is substring to be sought in this
* @param aIgnoreCase tells us whether or not to do caseless compare
* @param aOffset tells us where in this string to start searching.
* Use -1 to search from the end of the string.
* @param aCount tells us how many iterations to make starting at the
* given offset.
* @return offset in string, or kNotFound
*/
- NS_COM PRInt32 RFind( const nsCString& aString, PRBool aIgnoreCase=PR_FALSE, PRInt32 aOffset=-1, PRInt32 aCount=-1 ) const;
- NS_COM PRInt32 RFind( const char* aCString, PRBool aIgnoreCase=PR_FALSE, PRInt32 aOffset=-1, PRInt32 aCount=-1 ) const;
+ PRInt32 RFind( const nsCString& aString, PRBool aIgnoreCase=PR_FALSE, PRInt32 aOffset=-1, PRInt32 aCount=-1 ) const;
+ PRInt32 RFind( const char* aCString, PRBool aIgnoreCase=PR_FALSE, PRInt32 aOffset=-1, PRInt32 aCount=-1 ) const;
#ifdef CharT_is_PRUnichar
- NS_COM PRInt32 RFind( const nsAFlatString& aString, PRInt32 aOffset=-1, PRInt32 aCount=-1 ) const;
- NS_COM PRInt32 RFind( const PRUnichar* aString, PRInt32 aOffset=-1, PRInt32 aCount=-1 ) const;
+ PRInt32 RFind( const nsAFlatString& aString, PRInt32 aOffset=-1, PRInt32 aCount=-1 ) const;
+ PRInt32 RFind( const PRUnichar* aString, PRInt32 aOffset=-1, PRInt32 aCount=-1 ) const;
#endif
/**
* Search for given char within this string
*
* @param aChar is the character to search for
* @param aOffset tells us where in this string to start searching
* @param aCount tells us how far from the offset we are to search.
* Use -1 to search the whole string.
* @return offset in string, or kNotFound
*/
// PRInt32 FindChar( PRUnichar aChar, PRInt32 aOffset=0, PRInt32 aCount=-1 ) const;
- NS_COM PRInt32 RFindChar( PRUnichar aChar, PRInt32 aOffset=-1, PRInt32 aCount=-1 ) const;
+ PRInt32 RFindChar( PRUnichar aChar, PRInt32 aOffset=-1, PRInt32 aCount=-1 ) const;
/**
* This method searches this string for the first character found in
* the given string.
*
* @param aString contains set of chars to be found
* @param aOffset tells us where in this string to start searching
* (counting from left)
* @return offset in string, or kNotFound
*/
- NS_COM PRInt32 FindCharInSet( const char* aString, PRInt32 aOffset=0 ) const;
+ PRInt32 FindCharInSet( const char* aString, PRInt32 aOffset=0 ) const;
PRInt32 FindCharInSet( const self_type& aString, PRInt32 aOffset=0 ) const
{
return FindCharInSet(aString.get(), aOffset);
}
#ifdef CharT_is_PRUnichar
- NS_COM PRInt32 FindCharInSet( const PRUnichar* aString, PRInt32 aOffset=0 ) const;
+ PRInt32 FindCharInSet( const PRUnichar* aString, PRInt32 aOffset=0 ) const;
#endif
/**
* This method searches this string for the last character found in
* the given string.
*
* @param aString contains set of chars to be found
* @param aOffset tells us where in this string to start searching
* (counting from left)
* @return offset in string, or kNotFound
*/
- NS_COM PRInt32 RFindCharInSet( const char_type* aString, PRInt32 aOffset=-1 ) const;
+ PRInt32 RFindCharInSet( const char_type* aString, PRInt32 aOffset=-1 ) const;
PRInt32 RFindCharInSet( const self_type& aString, PRInt32 aOffset=-1 ) const
{
return RFindCharInSet(aString.get(), aOffset);
}
/**
* Compares a given string to this string.
*
* @param aString is the string to be compared
* @param aIgnoreCase tells us how to treat case
* @param aCount tells us how many chars to compare
* @return -1,0,1
*/
#ifdef CharT_is_char
- NS_COM PRInt32 Compare( const char* aString, PRBool aIgnoreCase=PR_FALSE, PRInt32 aCount=-1 ) const;
+ PRInt32 Compare( const char* aString, PRBool aIgnoreCase=PR_FALSE, PRInt32 aCount=-1 ) const;
#endif
/**
* Equality check between given string and this string.
*
* @param aString is the string to check
* @param aIgnoreCase tells us how to treat case
* @param aCount tells us how many chars to compare
* @return boolean
*/
#ifdef CharT_is_char
PRBool EqualsIgnoreCase( const char* aString, PRInt32 aCount=-1 ) const {
return Compare(aString, PR_TRUE, aCount) == 0;
}
#else
- NS_COM PRBool EqualsIgnoreCase( const char* aString, PRInt32 aCount=-1 ) const;
+ PRBool EqualsIgnoreCase( const char* aString, PRInt32 aCount=-1 ) const;
#endif // !CharT_is_PRUnichar
/**
* Perform string to double-precision float conversion.
*
* @param aErrorCode will contain error if one occurs
* @return double-precision float rep of string value
*/
- NS_COM double ToDouble( PRInt32* aErrorCode ) const;
+ double ToDouble( PRInt32* aErrorCode ) const;
/**
* Perform string to single-precision float conversion.
*
* @param aErrorCode will contain error if one occurs
* @return single-precision float rep of string value
*/
float ToFloat( PRInt32* aErrorCode ) const {
@@ -284,17 +284,17 @@ class nsTString_CharT : public nsTSubstr
/**
* Perform string to int conversion.
* @param aErrorCode will contain error if one occurs
* @param aRadix tells us which radix to assume; kAutoDetect tells us to determine the radix for you.
* @return int rep of string value, and possible (out) error code
*/
- NS_COM PRInt32 ToInteger( PRInt32* aErrorCode, PRUint32 aRadix=kRadix10 ) const;
+ PRInt32 ToInteger( PRInt32* aErrorCode, PRUint32 aRadix=kRadix10 ) const;
PRInt32 ToInteger( nsresult* aErrorCode, PRUint32 aRadix=kRadix10 ) const {
return ToInteger(reinterpret_cast<PRInt32*>(aErrorCode), aRadix);
}
/**
* |Left|, |Mid|, and |Right| are annoying signatures that seem better almost
* any _other_ way than they are now. Consider these alternatives
*
@@ -306,17 +306,17 @@ class nsTString_CharT : public nsTSubstr
*
* aReadable.Left(aWritable, 17); // ...a member function that does the assignment
*
* or maybe just stamping them out in favor of |Substring|, they are just duplicate functionality
*
* aWritable = Substring(aReadable, 0, 17);
*/
- NS_COM size_type Mid( self_type& aResult, PRUint32 aStartPos, PRUint32 aCount ) const;
+ size_type Mid( self_type& aResult, PRUint32 aStartPos, PRUint32 aCount ) const;
size_type Left( self_type& aResult, size_type aCount ) const
{
return Mid(aResult, 0, aCount);
}
size_type Right( self_type& aResult, size_type aCount ) const
{
@@ -328,76 +328,76 @@ class nsTString_CharT : public nsTSubstr
/**
* Set a char inside this string at given index
*
* @param aChar is the char you want to write into this string
* @param anIndex is the ofs where you want to write the given char
* @return TRUE if successful
*/
- NS_COM PRBool SetCharAt( PRUnichar aChar, PRUint32 aIndex );
+ PRBool SetCharAt( PRUnichar aChar, PRUint32 aIndex );
/**
* These methods are used to remove all occurrences of the
* characters found in aSet from this string.
*
* @param aSet -- characters to be cut from this
*/
- NS_COM void StripChars( const char* aSet );
+ void StripChars( const char* aSet );
/**
* This method strips whitespace throughout the string.
*/
- NS_COM void StripWhitespace();
+ void StripWhitespace();
/**
* swaps occurence of 1 string for another
*/
- NS_COM void ReplaceChar( char_type aOldChar, char_type aNewChar );
- NS_COM void ReplaceChar( const char* aSet, char_type aNewChar );
- NS_COM void ReplaceSubstring( const self_type& aTarget, const self_type& aNewValue);
- NS_COM void ReplaceSubstring( const char_type* aTarget, const char_type* aNewValue);
+ void ReplaceChar( char_type aOldChar, char_type aNewChar );
+ void ReplaceChar( const char* aSet, char_type aNewChar );
+ void ReplaceSubstring( const self_type& aTarget, const self_type& aNewValue);
+ void ReplaceSubstring( const char_type* aTarget, const char_type* aNewValue);
/**
* This method trims characters found in aTrimSet from
* either end of the underlying string.
*
* @param aSet -- contains chars to be trimmed from both ends
* @param aEliminateLeading
* @param aEliminateTrailing
* @param aIgnoreQuotes -- if true, causes surrounding quotes to be ignored
* @return this
*/
- NS_COM void Trim( const char* aSet, PRBool aEliminateLeading=PR_TRUE, PRBool aEliminateTrailing=PR_TRUE, PRBool aIgnoreQuotes=PR_FALSE );
+ void Trim( const char* aSet, PRBool aEliminateLeading=PR_TRUE, PRBool aEliminateTrailing=PR_TRUE, PRBool aIgnoreQuotes=PR_FALSE );
/**
* This method strips whitespace from string.
* You can control whether whitespace is yanked from start and end of
* string as well.
*
* @param aEliminateLeading controls stripping of leading ws
* @param aEliminateTrailing controls stripping of trailing ws
*/
- NS_COM void CompressWhitespace( PRBool aEliminateLeading=PR_TRUE, PRBool aEliminateTrailing=PR_TRUE );
+ void CompressWhitespace( PRBool aEliminateLeading=PR_TRUE, PRBool aEliminateTrailing=PR_TRUE );
/**
* assign/append/insert with _LOSSY_ conversion
*/
- NS_COM void AssignWithConversion( const nsTAString_IncompatibleCharT& aString );
- NS_COM void AssignWithConversion( const incompatible_char_type* aData, PRInt32 aLength=-1 );
+ void AssignWithConversion( const nsTAString_IncompatibleCharT& aString );
+ void AssignWithConversion( const incompatible_char_type* aData, PRInt32 aLength=-1 );
- NS_COM void AppendWithConversion( const nsTAString_IncompatibleCharT& aString );
- NS_COM void AppendWithConversion( const incompatible_char_type* aData, PRInt32 aLength=-1 );
+ void AppendWithConversion( const nsTAString_IncompatibleCharT& aString );
+ void AppendWithConversion( const incompatible_char_type* aData, PRInt32 aLength=-1 );
#endif // !MOZ_STRING_WITH_OBSOLETE_API
protected:
explicit
nsTString_CharT( PRUint32 flags )
@@ -696,16 +696,16 @@ class nsTAdoptingString_CharT : public n
// |operator=| does not inherit, so we must define our own
self_type& operator=( const substring_type& str ) { Assign(str); return *this; }
self_type& operator=( const substring_tuple_type& tuple ) { Assign(tuple); return *this; }
// Adopt(), if possible, when assigning to a self_type&. Note
// that this violates the constness of str, str is always
// truncated when this operator is called.
- NS_COM self_type& operator=( const self_type& str );
+ self_type& operator=( const self_type& str );
private:
// NOT TO BE IMPLEMENTED.
self_type& operator=( const char_type* data );
self_type& operator=( char_type* data );
};
--- a/xpcom/string/public/nsTSubstring.h
+++ b/xpcom/string/public/nsTSubstring.h
@@ -38,31 +38,31 @@
#ifndef MOZILLA_INTERNAL_API
#error Cannot use internal string classes without MOZILLA_INTERNAL_API defined. Use the frozen header nsStringAPI.h instead.
#endif
/**
* The base for string comparators
*/
-class NS_COM nsTStringComparator_CharT
+class nsTStringComparator_CharT
{
public:
typedef CharT char_type;
nsTStringComparator_CharT() {}
virtual int operator()( const char_type*, const char_type*, PRUint32, PRUint32 ) const = 0;
};
/**
* The default string comparator (case-sensitive comparision)
*/
-class NS_COM nsTDefaultStringComparator_CharT
+class nsTDefaultStringComparator_CharT
: public nsTStringComparator_CharT
{
public:
typedef CharT char_type;
nsTDefaultStringComparator_CharT() {}
virtual int operator()( const char_type*, const char_type*, PRUint32, PRUint32 ) const;
@@ -247,42 +247,42 @@ class nsTSubstring_CharT
inline
char_type Last() const
{
NS_ASSERTION(mLength > 0, "|Last()| called on an empty string");
return mData[mLength - 1];
}
- NS_COM size_type NS_FASTCALL CountChar( char_type ) const;
- NS_COM PRInt32 NS_FASTCALL FindChar( char_type, index_type offset = 0 ) const;
+ size_type NS_FASTCALL CountChar( char_type ) const;
+ PRInt32 NS_FASTCALL FindChar( char_type, index_type offset = 0 ) const;
/**
* equality
*/
- NS_COM PRBool NS_FASTCALL Equals( const self_type& ) const;
- NS_COM PRBool NS_FASTCALL Equals( const self_type&, const comparator_type& ) const;
+ PRBool NS_FASTCALL Equals( const self_type& ) const;
+ PRBool NS_FASTCALL Equals( const self_type&, const comparator_type& ) const;
- NS_COM PRBool NS_FASTCALL Equals( const char_type* data ) const;
- NS_COM PRBool NS_FASTCALL Equals( const char_type* data, const comparator_type& comp ) const;
+ PRBool NS_FASTCALL Equals( const char_type* data ) const;
+ PRBool NS_FASTCALL Equals( const char_type* data, const comparator_type& comp ) const;
/**
* An efficient comparison with ASCII that can be used even
* for wide strings. Call this version when you know the
* length of 'data'.
*/
- NS_COM PRBool NS_FASTCALL EqualsASCII( const char* data, size_type len ) const;
+ PRBool NS_FASTCALL EqualsASCII( const char* data, size_type len ) const;
/**
* An efficient comparison with ASCII that can be used even
* for wide strings. Call this version when 'data' is
* null-terminated.
*/
- NS_COM PRBool NS_FASTCALL EqualsASCII( const char* data ) const;
+ PRBool NS_FASTCALL EqualsASCII( const char* data ) const;
// EqualsLiteral must ONLY be applied to an actual literal string.
// Do not attempt to use it with a regular char* pointer, or with a char
// array variable.
// The template trick to acquire the array length at compile time without
// using a macro is due to Corey Kosak, with much thanks.
#ifdef NS_DISABLE_LITERAL_TEMPLATE
inline PRBool EqualsLiteral( const char* str ) const
@@ -303,18 +303,18 @@ class nsTSubstring_CharT
}
#endif
// The LowerCaseEquals methods compare the lower case version of
// this string to some ASCII/Literal string. The ASCII string is
// *not* lowercased for you. If you compare to an ASCII or literal
// string that contains an uppercase character, it is guaranteed to
// return false. We will throw assertions too.
- NS_COM PRBool NS_FASTCALL LowerCaseEqualsASCII( const char* data, size_type len ) const;
- NS_COM PRBool NS_FASTCALL LowerCaseEqualsASCII( const char* data ) const;
+ PRBool NS_FASTCALL LowerCaseEqualsASCII( const char* data, size_type len ) const;
+ PRBool NS_FASTCALL LowerCaseEqualsASCII( const char* data ) const;
// LowerCaseEqualsLiteral must ONLY be applied to an actual
// literal string. Do not attempt to use it with a regular char*
// pointer, or with a char array variable. Use
// LowerCaseEqualsASCII for them.
#ifdef NS_DISABLE_LITERAL_TEMPLATE
inline PRBool LowerCaseEqualsLiteral( const char* str ) const
{
@@ -333,23 +333,23 @@ class nsTSubstring_CharT
return LowerCaseEqualsASCII(s, N-1);
}
#endif
/**
* assignment
*/
- NS_COM void NS_FASTCALL Assign( char_type c );
- NS_COM void NS_FASTCALL Assign( const char_type* data, size_type length = size_type(-1) );
- NS_COM void NS_FASTCALL Assign( const self_type& );
- NS_COM void NS_FASTCALL Assign( const substring_tuple_type& );
+ void NS_FASTCALL Assign( char_type c );
+ void NS_FASTCALL Assign( const char_type* data, size_type length = size_type(-1) );
+ void NS_FASTCALL Assign( const self_type& );
+ void NS_FASTCALL Assign( const substring_tuple_type& );
- NS_COM void NS_FASTCALL AssignASCII( const char* data, size_type length );
- NS_COM void NS_FASTCALL AssignASCII( const char* data );
+ void NS_FASTCALL AssignASCII( const char* data, size_type length );
+ void NS_FASTCALL AssignASCII( const char* data );
// AssignLiteral must ONLY be applied to an actual literal string.
// Do not attempt to use it with a regular char* pointer, or with a char
// array variable. Use AssignASCII for those.
#ifdef NS_DISABLE_LITERAL_TEMPLATE
void AssignLiteral( const char* str )
{ AssignASCII(str); }
#else
@@ -361,39 +361,39 @@ class nsTSubstring_CharT
{ AssignASCII(str, N-1); }
#endif
self_type& operator=( char_type c ) { Assign(c); return *this; }
self_type& operator=( const char_type* data ) { Assign(data); return *this; }
self_type& operator=( const self_type& str ) { Assign(str); return *this; }
self_type& operator=( const substring_tuple_type& tuple ) { Assign(tuple); return *this; }
- NS_COM void NS_FASTCALL Adopt( char_type* data, size_type length = size_type(-1) );
+ void NS_FASTCALL Adopt( char_type* data, size_type length = size_type(-1) );
/**
* buffer manipulation
*/
- NS_COM void NS_FASTCALL Replace( index_type cutStart, size_type cutLength, char_type c );
- NS_COM void NS_FASTCALL Replace( index_type cutStart, size_type cutLength, const char_type* data, size_type length = size_type(-1) );
+ void NS_FASTCALL Replace( index_type cutStart, size_type cutLength, char_type c );
+ void NS_FASTCALL Replace( index_type cutStart, size_type cutLength, const char_type* data, size_type length = size_type(-1) );
void Replace( index_type cutStart, size_type cutLength, const self_type& str ) { Replace(cutStart, cutLength, str.Data(), str.Length()); }
- NS_COM void NS_FASTCALL Replace( index_type cutStart, size_type cutLength, const substring_tuple_type& tuple );
+ void NS_FASTCALL Replace( index_type cutStart, size_type cutLength, const substring_tuple_type& tuple );
- NS_COM void NS_FASTCALL ReplaceASCII( index_type cutStart, size_type cutLength, const char* data, size_type length = size_type(-1) );
+ void NS_FASTCALL ReplaceASCII( index_type cutStart, size_type cutLength, const char* data, size_type length = size_type(-1) );
void Append( char_type c ) { Replace(mLength, 0, c); }
void Append( const char_type* data, size_type length = size_type(-1) ) { Replace(mLength, 0, data, length); }
void Append( const self_type& str ) { Replace(mLength, 0, str); }
void Append( const substring_tuple_type& tuple ) { Replace(mLength, 0, tuple); }
void AppendASCII( const char* data, size_type length = size_type(-1) ) { ReplaceASCII(mLength, 0, data, length); }
// AppendPrintf truncates output to 31 ASCII characters
- NS_COM void AppendPrintf( const char* format, ... );
+ void AppendPrintf( const char* format, ... );
void AppendInt( PRInt32 aInteger )
{ AppendPrintf( "%d", aInteger ); }
void AppendInt( PRInt32 aInteger, int aRadix )
{
const char *fmt = aRadix == 10 ? "%d" : aRadix == 8 ? "%o" : "%x";
AppendPrintf( fmt, aInteger );
}
void AppendInt( PRUint32 aInteger )
@@ -421,17 +421,17 @@ class nsTSubstring_CharT
/**
* Append the given float to this string
*/
void AppendFloat( float aFloat )
{ DoAppendFloat(aFloat, 6); }
void AppendFloat( double aFloat )
{ DoAppendFloat(aFloat, 15); }
private:
- NS_COM void NS_FASTCALL DoAppendFloat( double aFloat, int digits );
+ void NS_FASTCALL DoAppendFloat( double aFloat, int digits );
public:
// AppendLiteral must ONLY be applied to an actual literal string.
// Do not attempt to use it with a regular char* pointer, or with a char
// array variable. Use AppendASCII for those.
#ifdef NS_DISABLE_LITERAL_TEMPLATE
void AppendLiteral( const char* str )
{ AppendASCII(str); }
@@ -464,19 +464,19 @@ class nsTSubstring_CharT
/**
* Attempts to set the capacity to the given size, without affecting
* the length of the string. Also ensures that the buffer is mutable.
*
* @returns PR_TRUE on success
* PR_FALSE on out-of-memory, or if requesting a size bigger
* than a string can hold (2^31 chars).
*/
- NS_COM PRBool NS_FASTCALL SetCapacity( size_type newCapacity );
+ PRBool NS_FASTCALL SetCapacity( size_type newCapacity );
- NS_COM void NS_FASTCALL SetLength( size_type newLength );
+ void NS_FASTCALL SetLength( size_type newLength );
void Truncate( size_type newLength = 0 )
{
NS_ASSERTION(newLength <= mLength, "Truncate cannot make string longer");
SetLength(newLength);
}
@@ -520,37 +520,37 @@ class nsTSubstring_CharT
}
/**
* string data is never null, but can be marked void. if true, the
* string will be truncated. @see nsTSubstring::IsVoid
*/
- NS_COM void NS_FASTCALL SetIsVoid( PRBool );
+ void NS_FASTCALL SetIsVoid( PRBool );
/**
* This method is used to remove all occurrences of aChar from this
* string.
*
* @param aChar -- char to be stripped
* @param aOffset -- where in this string to start stripping chars
*/
- NS_COM void StripChar( char_type aChar, PRInt32 aOffset=0 );
+ void StripChar( char_type aChar, PRInt32 aOffset=0 );
/**
* This method is used to remove all occurrences of aChars from this
* string.
*
* @param aChars -- chars to be stripped
* @param aOffset -- where in this string to start stripping chars
*/
- NS_COM void StripChars( const char_type* aChars, PRUint32 aOffset=0 );
+ void StripChars( const char_type* aChars, PRUint32 aOffset=0 );
/**
* If the string uses a shared buffer, this method
* clears the pointer without releasing the buffer.
*/
void ForgetSharedBuffer()
{
if (mFlags & nsSubstring::F_SHARED)
@@ -579,17 +579,17 @@ class nsTSubstring_CharT
* allows for direct initialization of a nsTSubstring object.
*
* NOTE: this constructor is declared public _only_ for convenience
* inside the string implementation.
*/
// XXXbz or can I just include nscore.h and use NS_BUILD_REFCNT_LOGGING?
#if defined(DEBUG) || defined(FORCE_BUILD_REFCNT_LOGGING)
#define XPCOM_STRING_CONSTRUCTOR_OUT_OF_LINE
- NS_COM nsTSubstring_CharT( char_type *data, size_type length, PRUint32 flags );
+ nsTSubstring_CharT( char_type *data, size_type length, PRUint32 flags );
#else
#undef XPCOM_STRING_CONSTRUCTOR_OUT_OF_LINE
nsTSubstring_CharT( char_type *data, size_type length, PRUint32 flags )
: mData(data),
mLength(length),
mFlags(flags) {}
#endif /* DEBUG || FORCE_BUILD_REFCNT_LOGGING */
@@ -623,17 +623,17 @@ class nsTSubstring_CharT
mLength(str.mLength),
mFlags(str.mFlags & (F_TERMINATED | F_VOIDED)) {}
/**
* this function releases mData and does not change the value of
* any of its member variables. in other words, this function acts
* like a destructor.
*/
- void NS_COM NS_FASTCALL Finalize();
+ void NS_FASTCALL Finalize();
/**
* this function prepares mData to be mutated.
*
* @param capacity specifies the required capacity of mData
* @param old_data returns null or the old value of mData
* @param old_flags returns 0 or the old value of mFlags
*
@@ -697,17 +697,17 @@ class nsTSubstring_CharT
* is 0-sized).
*/
size_type NS_FASTCALL Capacity() const;
/**
* this helper function can be called prior to directly manipulating
* the contents of mData. see, for example, BeginWriting.
*/
- NS_COM PRBool NS_FASTCALL EnsureMutable( size_type newLen = size_type(-1) );
+ PRBool NS_FASTCALL EnsureMutable( size_type newLen = size_type(-1) );
/**
* returns true if this string overlaps with the given string fragment.
*/
PRBool IsDependentOn( const char_type *start, const char_type *end ) const
{
/**
* if it _isn't_ the case that one fragment starts after the other ends,
@@ -782,17 +782,16 @@ class nsTSubstring_CharT
// non-terminated substrings are always dependent.
//
// F_VOIDED implies F_TERMINATED, and moreover it implies that mData
// points to char_traits::sEmptyBuffer. Therefore, F_VOIDED is
// mutually exclusive with F_SHARED, F_OWNED, and F_FIXED.
//
};
-NS_COM
int NS_FASTCALL Compare( const nsTSubstring_CharT::base_string_type& lhs, const nsTSubstring_CharT::base_string_type& rhs, const nsTStringComparator_CharT& = nsTDefaultStringComparator_CharT() );
inline
PRBool operator!=( const nsTSubstring_CharT::base_string_type& lhs, const nsTSubstring_CharT::base_string_type& rhs )
{
return !lhs.Equals(rhs);
}
--- a/xpcom/string/public/nsTSubstringTuple.h
+++ b/xpcom/string/public/nsTSubstringTuple.h
@@ -68,30 +68,30 @@ class nsTSubstringTuple_CharT
nsTSubstringTuple_CharT(const self_type& head, const base_string_type* b)
: mHead(&head)
, mFragA(nsnull) // this fragment is ignored when head != nsnull
, mFragB(b) {}
/**
* computes the aggregate string length
*/
- NS_COM size_type Length() const;
+ size_type Length() const;
/**
* writes the aggregate string to the given buffer. bufLen is assumed
* to be equal to or greater than the value returned by the Length()
* method. the string written to |buf| is not null-terminated.
*/
- NS_COM void WriteTo(char_type *buf, PRUint32 bufLen) const;
+ void WriteTo(char_type *buf, PRUint32 bufLen) const;
/**
* returns true if this tuple is dependent on (i.e., overlapping with)
* the given char sequence.
*/
- NS_COM PRBool IsDependentOn(const char_type *start, const char_type *end) const;
+ PRBool IsDependentOn(const char_type *start, const char_type *end) const;
private:
const self_type* mHead;
const base_string_type* mFragA;
const base_string_type* mFragB;
};
--- a/xpcom/string/src/nsReadableUtils.cpp
+++ b/xpcom/string/src/nsReadableUtils.cpp
@@ -36,77 +36,69 @@
*
* ***** END LICENSE BLOCK ***** */
#include "nsReadableUtils.h"
#include "nsMemory.h"
#include "nsString.h"
#include "nsUTF8Utils.h"
-NS_COM
void
LossyCopyUTF16toASCII( const nsAString& aSource, nsACString& aDest )
{
aDest.Truncate();
LossyAppendUTF16toASCII(aSource, aDest);
}
-NS_COM
void
CopyASCIItoUTF16( const nsACString& aSource, nsAString& aDest )
{
aDest.Truncate();
AppendASCIItoUTF16(aSource, aDest);
}
-NS_COM
void
LossyCopyUTF16toASCII( const PRUnichar* aSource, nsACString& aDest )
{
aDest.Truncate();
if (aSource) {
LossyAppendUTF16toASCII(nsDependentString(aSource), aDest);
}
}
-NS_COM
void
CopyASCIItoUTF16( const char* aSource, nsAString& aDest )
{
aDest.Truncate();
if (aSource) {
AppendASCIItoUTF16(nsDependentCString(aSource), aDest);
}
}
-NS_COM
void
CopyUTF16toUTF8( const nsAString& aSource, nsACString& aDest )
{
aDest.Truncate();
AppendUTF16toUTF8(aSource, aDest);
}
-NS_COM
void
CopyUTF8toUTF16( const nsACString& aSource, nsAString& aDest )
{
aDest.Truncate();
AppendUTF8toUTF16(aSource, aDest);
}
-NS_COM
void
CopyUTF16toUTF8( const PRUnichar* aSource, nsACString& aDest )
{
aDest.Truncate();
AppendUTF16toUTF8(aSource, aDest);
}
-NS_COM
void
CopyUTF8toUTF16( const char* aSource, nsAString& aDest )
{
aDest.Truncate();
AppendUTF8toUTF16(aSource, aDest);
}
// Like GetMutableData, but returns false if it can't
@@ -125,17 +117,16 @@ PRBool
SetLengthForWritingC(nsACString& aDest, PRUint32 aDesiredLength)
{
char* dummy;
PRUint32 len = aDest.GetMutableData(&dummy, aDesiredLength);
return (len >= aDesiredLength);
}
-NS_COM
void
LossyAppendUTF16toASCII( const nsAString& aSource, nsACString& aDest )
{
PRUint32 old_dest_length = aDest.Length();
if (!SetLengthForWritingC(aDest, old_dest_length + aSource.Length()))
return;
nsAString::const_iterator fromBegin, fromEnd;
@@ -146,17 +137,16 @@ LossyAppendUTF16toASCII( const nsAString
dest.advance(old_dest_length);
// right now, this won't work on multi-fragment destinations
LossyConvertEncoding16to8 converter(dest.get());
copy_string(aSource.BeginReading(fromBegin), aSource.EndReading(fromEnd), converter);
}
-NS_COM
void
AppendASCIItoUTF16( const nsACString& aSource, nsAString& aDest )
{
PRUint32 old_dest_length = aDest.Length();
if (!SetLengthForWriting(aDest, old_dest_length + aSource.Length()))
return;
nsACString::const_iterator fromBegin, fromEnd;
@@ -167,35 +157,32 @@ AppendASCIItoUTF16( const nsACString& aS
dest.advance(old_dest_length);
// right now, this won't work on multi-fragment destinations
LossyConvertEncoding8to16 converter(dest.get());
copy_string(aSource.BeginReading(fromBegin), aSource.EndReading(fromEnd), converter);
}
-NS_COM
void
LossyAppendUTF16toASCII( const PRUnichar* aSource, nsACString& aDest )
{
if (aSource) {
LossyAppendUTF16toASCII(nsDependentString(aSource), aDest);
}
}
-NS_COM
void
AppendASCIItoUTF16( const char* aSource, nsAString& aDest )
{
if (aSource) {
AppendASCIItoUTF16(nsDependentCString(aSource), aDest);
}
}
-NS_COM
void
AppendUTF16toUTF8( const nsAString& aSource, nsACString& aDest )
{
nsAString::const_iterator source_start, source_end;
CalculateUTF8Size calculator;
copy_string(aSource.BeginReading(source_start),
aSource.EndReading(source_end), calculator);
@@ -216,17 +203,16 @@ AppendUTF16toUTF8( const nsAString& aSou
aSource.EndReading(source_end), converter);
NS_ASSERTION(converter.Size() == count,
"Unexpected disparity between CalculateUTF8Size and "
"ConvertUTF16toUTF8");
}
}
-NS_COM
void
AppendUTF8toUTF16( const nsACString& aSource, nsAString& aDest )
{
nsACString::const_iterator source_start, source_end;
CalculateUTF8Length calculator;
copy_string(aSource.BeginReading(source_start),
aSource.EndReading(source_end), calculator);
@@ -254,26 +240,24 @@ AppendUTF8toUTF16( const nsACString& aSo
if (converter.ErrorEncountered())
{
NS_ERROR("Input wasn't UTF8 or incorrect length was calculated");
aDest.SetLength(old_dest_length);
}
}
}
-NS_COM
void
AppendUTF16toUTF8( const PRUnichar* aSource, nsACString& aDest )
{
if (aSource) {
AppendUTF16toUTF8(nsDependentString(aSource), aDest);
}
}
-NS_COM
void
AppendUTF8toUTF16( const char* aSource, nsAString& aDest )
{
if (aSource) {
AppendUTF8toUTF16(nsDependentCString(aSource), aDest);
}
}
@@ -289,31 +273,29 @@ template <class FromStringT, class ToCha
inline
ToCharT*
AllocateStringCopy( const FromStringT& aSource, ToCharT* )
{
return static_cast<ToCharT*>(nsMemory::Alloc((aSource.Length()+1) * sizeof(ToCharT)));
}
-NS_COM
char*
ToNewCString( const nsAString& aSource )
{
char* result = AllocateStringCopy(aSource, (char*)0);
if (!result)
return nsnull;
nsAString::const_iterator fromBegin, fromEnd;
LossyConvertEncoding16to8 converter(result);
copy_string(aSource.BeginReading(fromBegin), aSource.EndReading(fromEnd), converter).write_terminator();
return result;
}
-NS_COM
char*
ToNewUTF8String( const nsAString& aSource, PRUint32 *aUTF8Count )
{
nsAString::const_iterator start, end;
CalculateUTF8Size calculator;
copy_string(aSource.BeginReading(start), aSource.EndReading(end),
calculator);
@@ -328,63 +310,59 @@ ToNewUTF8String( const nsAString& aSourc
ConvertUTF16toUTF8 converter(result);
copy_string(aSource.BeginReading(start), aSource.EndReading(end),
converter).write_terminator();
NS_ASSERTION(calculator.Size() == converter.Size(), "length mismatch");
return result;
}
-NS_COM
char*
ToNewCString( const nsACString& aSource )
{
// no conversion needed, just allocate a buffer of the correct length and copy into it
char* result = AllocateStringCopy(aSource, (char*)0);
if (!result)
return nsnull;
nsACString::const_iterator fromBegin, fromEnd;
char* toBegin = result;
*copy_string(aSource.BeginReading(fromBegin), aSource.EndReading(fromEnd), toBegin) = char(0);
return result;
}
-NS_COM
PRUnichar*
ToNewUnicode( const nsAString& aSource )
{
// no conversion needed, just allocate a buffer of the correct length and copy into it
PRUnichar* result = AllocateStringCopy(aSource, (PRUnichar*)0);
if (!result)
return nsnull;
nsAString::const_iterator fromBegin, fromEnd;
PRUnichar* toBegin = result;
*copy_string(aSource.BeginReading(fromBegin), aSource.EndReading(fromEnd), toBegin) = PRUnichar(0);
return result;
}
-NS_COM
PRUnichar*
ToNewUnicode( const nsACString& aSource )
{
PRUnichar* result = AllocateStringCopy(aSource, (PRUnichar*)0);
if (!result)
return nsnull;
nsACString::const_iterator fromBegin, fromEnd;
LossyConvertEncoding8to16 converter(result);
copy_string(aSource.BeginReading(fromBegin), aSource.EndReading(fromEnd), converter).write_terminator();
return result;
}
-NS_COM
PRUnichar*
UTF8ToNewUnicode( const nsACString& aSource, PRUint32 *aUTF16Count )
{
nsACString::const_iterator start, end;
CalculateUTF8Length calculator;
copy_string(aSource.BeginReading(start), aSource.EndReading(end),
calculator);
@@ -399,60 +377,56 @@ UTF8ToNewUnicode( const nsACString& aSou
ConvertUTF8toUTF16 converter(result);
copy_string(aSource.BeginReading(start), aSource.EndReading(end),
converter).write_terminator();
NS_ASSERTION(calculator.Length() == converter.Length(), "length mismatch");
return result;
}
-NS_COM
PRUnichar*
CopyUnicodeTo( const nsAString& aSource, PRUint32 aSrcOffset, PRUnichar* aDest, PRUint32 aLength )
{
nsAString::const_iterator fromBegin, fromEnd;
PRUnichar* toBegin = aDest;
copy_string(aSource.BeginReading(fromBegin).advance( PRInt32(aSrcOffset) ), aSource.BeginReading(fromEnd).advance( PRInt32(aSrcOffset+aLength) ), toBegin);
return aDest;
}
-NS_COM
-void
+void
CopyUnicodeTo( const nsAString::const_iterator& aSrcStart,
const nsAString::const_iterator& aSrcEnd,
nsAString& aDest )
{
nsAString::iterator writer;
if (!SetLengthForWriting(aDest, Distance(aSrcStart, aSrcEnd)))
return;
aDest.BeginWriting(writer);
nsAString::const_iterator fromBegin(aSrcStart);
copy_string(fromBegin, aSrcEnd, writer);
}
-NS_COM
-void
+void
AppendUnicodeTo( const nsAString::const_iterator& aSrcStart,
const nsAString::const_iterator& aSrcEnd,
nsAString& aDest )
{
nsAString::iterator writer;
PRUint32 oldLength = aDest.Length();
if(!SetLengthForWriting(aDest, oldLength + Distance(aSrcStart, aSrcEnd)))
return;
aDest.BeginWriting(writer).advance(oldLength);
nsAString::const_iterator fromBegin(aSrcStart);
copy_string(fromBegin, aSrcEnd, writer);
}
-NS_COM
PRBool
IsASCII( const nsAString& aString )
{
static const PRUnichar NOT_ASCII = PRUnichar(~0x007F);
// Don't want to use |copy_string| for this task, since we can stop at the first non-ASCII character
@@ -467,17 +441,16 @@ IsASCII( const nsAString& aString )
{
if ( *c++ & NOT_ASCII )
return PR_FALSE;
}
return PR_TRUE;
}
-NS_COM
PRBool
IsASCII( const nsACString& aString )
{
static const char NOT_ASCII = char(~0x7F);
// Don't want to use |copy_string| for this task, since we can stop at the first non-ASCII character
@@ -492,17 +465,16 @@ IsASCII( const nsACString& aString )
{
if ( *c++ & NOT_ASCII )
return PR_FALSE;
}
return PR_TRUE;
}
-NS_COM
PRBool
IsUTF8( const nsACString& aString )
{
nsReadingIterator<char> done_reading;
aString.EndReading(done_reading);
PRInt32 state = 0;
PRBool overlong = PR_FALSE;
@@ -607,17 +579,16 @@ class ConvertToUpperCase
if ((ch >= 'a') && (ch <= 'z'))
*cp = ch - ('a' - 'A');
++cp;
}
return aSourceLength;
}
};
-NS_COM
void
ToUpperCase( nsCSubstring& aCString )
{
ConvertToUpperCase converter;
char* start;
converter.write(aCString.BeginWriting(start), aCString.Length());
}
@@ -652,17 +623,16 @@ class CopyToUpperCase
mIter.advance(len);
return len;
}
protected:
nsACString::iterator& mIter;
};
-NS_COM
void
ToUpperCase( const nsACString& aSource, nsACString& aDest )
{
nsACString::const_iterator fromBegin, fromEnd;
nsACString::iterator toBegin;
if (!SetLengthForWritingC(aDest, aSource.Length()))
return;
@@ -688,17 +658,16 @@ class ConvertToLowerCase
if ((ch >= 'A') && (ch <= 'Z'))
*cp = ch + ('a' - 'A');
++cp;
}
return aSourceLength;
}
};
-NS_COM
void
ToLowerCase( nsCSubstring& aCString )
{
ConvertToLowerCase converter;
char* start;
converter.write(aCString.BeginWriting(start), aCString.Length());
}
@@ -733,30 +702,28 @@ class CopyToLowerCase
mIter.advance(len);
return len;
}
protected:
nsACString::iterator& mIter;
};
-NS_COM
void
ToLowerCase( const nsACString& aSource, nsACString& aDest )
{
nsACString::const_iterator fromBegin, fromEnd;
nsACString::iterator toBegin;
if (!SetLengthForWritingC(aDest, aSource.Length()))
return;
CopyToLowerCase converter(aDest.BeginWriting(toBegin));
copy_string(aSource.BeginReading(fromBegin), aSource.EndReading(fromEnd), converter);
}
-NS_COM
PRBool
ParseString(const nsACString& aSource, char aDelimiter,
nsTArray<nsCString>& aArray)
{
nsACString::const_iterator start, end;
aSource.BeginReading(start);
aSource.EndReading(end);
@@ -905,85 +872,77 @@ RFindInReadable_Impl( const StringT& aPa
while ( compare(testPattern.get(), testSearch.get(), 1, 1) == 0 );
}
}
aSearchStart = aSearchEnd;
return PR_FALSE;
}
-NS_COM
PRBool
FindInReadable( const nsAString& aPattern, nsAString::const_iterator& aSearchStart, nsAString::const_iterator& aSearchEnd, const nsStringComparator& aComparator )
{
return FindInReadable_Impl(aPattern, aSearchStart, aSearchEnd, aComparator);
}
-NS_COM
PRBool
FindInReadable( const nsACString& aPattern, nsACString::const_iterator& aSearchStart, nsACString::const_iterator& aSearchEnd, const nsCStringComparator& aComparator)
{
return FindInReadable_Impl(aPattern, aSearchStart, aSearchEnd, aComparator);
}
-NS_COM
PRBool
CaseInsensitiveFindInReadable( const nsACString& aPattern, nsACString::const_iterator& aSearchStart, nsACString::const_iterator& aSearchEnd )
{
return FindInReadable_Impl(aPattern, aSearchStart, aSearchEnd, nsCaseInsensitiveCStringComparator());
}
-NS_COM
PRBool
RFindInReadable( const nsAString& aPattern, nsAString::const_iterator& aSearchStart, nsAString::const_iterator& aSearchEnd, const nsStringComparator& aComparator)
{
return RFindInReadable_Impl(aPattern, aSearchStart, aSearchEnd, aComparator);
}
-NS_COM
PRBool
RFindInReadable( const nsACString& aPattern, nsACString::const_iterator& aSearchStart, nsACString::const_iterator& aSearchEnd, const nsCStringComparator& aComparator)
{
return RFindInReadable_Impl(aPattern, aSearchStart, aSearchEnd, aComparator);
}
-NS_COM
-PRBool
+PRBool
FindCharInReadable( PRUnichar aChar, nsAString::const_iterator& aSearchStart, const nsAString::const_iterator& aSearchEnd )
{
PRInt32 fragmentLength = aSearchEnd.get() - aSearchStart.get();
const PRUnichar* charFoundAt = nsCharTraits<PRUnichar>::find(aSearchStart.get(), fragmentLength, aChar);
if ( charFoundAt ) {
aSearchStart.advance( charFoundAt - aSearchStart.get() );
return PR_TRUE;
}
aSearchStart.advance(fragmentLength);
return PR_FALSE;
}
-NS_COM
-PRBool
+PRBool
FindCharInReadable( char aChar, nsACString::const_iterator& aSearchStart, const nsACString::const_iterator& aSearchEnd )
{
PRInt32 fragmentLength = aSearchEnd.get() - aSearchStart.get();
const char* charFoundAt = nsCharTraits<char>::find(aSearchStart.get(), fragmentLength, aChar);
if ( charFoundAt ) {
aSearchStart.advance( charFoundAt - aSearchStart.get() );
return PR_TRUE;
}
aSearchStart.advance(fragmentLength);
return PR_FALSE;
- }
+ }
-NS_COM
-PRUint32
+PRUint32
CountCharInReadable( const nsAString& aStr,
PRUnichar aChar )
{
PRUint32 count = 0;
nsAString::const_iterator begin, end;
aStr.BeginReading(begin);
aStr.EndReading(end);
@@ -993,18 +952,17 @@ CountCharInReadable( const nsAString& aS
++count;
}
++begin;
}
return count;
}
-NS_COM
-PRUint32
+PRUint32
CountCharInReadable( const nsACString& aStr,
char aChar )
{
PRUint32 count = 0;
nsACString::const_iterator begin, end;
aStr.BeginReading(begin);
aStr.EndReading(end);
@@ -1014,85 +972,83 @@ CountCharInReadable( const nsACString& a
++count;
}
++begin;
}
return count;
}
-NS_COM PRBool
+PRBool
StringBeginsWith( const nsAString& aSource, const nsAString& aSubstring,
const nsStringComparator& aComparator )
{
nsAString::size_type src_len = aSource.Length(),
sub_len = aSubstring.Length();
if (sub_len > src_len)
return PR_FALSE;
return Substring(aSource, 0, sub_len).Equals(aSubstring, aComparator);
}
-NS_COM PRBool
+PRBool
StringBeginsWith( const nsACString& aSource, const nsACString& aSubstring,
const nsCStringComparator& aComparator )
{
nsACString::size_type src_len = aSource.Length(),
sub_len = aSubstring.Length();
if (sub_len > src_len)
return PR_FALSE;
return Substring(aSource, 0, sub_len).Equals(aSubstring, aComparator);
}
-NS_COM PRBool
+PRBool
StringEndsWith( const nsAString& aSource, const nsAString& aSubstring,
const nsStringComparator& aComparator )
{
nsAString::size_type src_len = aSource.Length(),
sub_len = aSubstring.Length();
if (sub_len > src_len)
return PR_FALSE;
return Substring(aSource, src_len - sub_len, sub_len).Equals(aSubstring,
aComparator);
}
-NS_COM PRBool
+PRBool
StringEndsWith( const nsACString& aSource, const nsACString& aSubstring,
const nsCStringComparator& aComparator )
{
nsACString::size_type src_len = aSource.Length(),
sub_len = aSubstring.Length();
if (sub_len > src_len)
return PR_FALSE;
return Substring(aSource, src_len - sub_len, sub_len).Equals(aSubstring,
aComparator);
}
static const PRUnichar empty_buffer[1] = { '\0' };
-NS_COM
const nsAFlatString&
EmptyString()
{
static const nsDependentString sEmpty(empty_buffer);
return sEmpty;
}
-NS_COM
const nsAFlatCString&
EmptyCString()
{
static const nsDependentCString sEmpty((const char *)empty_buffer);
return sEmpty;
}
-NS_COM PRInt32
+PRInt32
CompareUTF8toUTF16(const nsASingleFragmentCString& aUTF8String,
const nsASingleFragmentString& aUTF16String)
{
static const PRUint32 NOT_ASCII = PRUint32(~0x7F);
const char *u8, *u8end;
aUTF8String.BeginReading(u8);
aUTF8String.EndReading(u8end);
@@ -1159,17 +1115,16 @@ CompareUTF8toUTF16(const nsASingleFragme
return -1;
}
// The two strings match.
return 0;
}
-NS_COM
void
AppendUCS4ToUTF16(const PRUint32 aSource, nsAString& aDest)
{
NS_ASSERTION(IS_VALID_CHAR(aSource), "Invalid UCS4 char");
if (IS_IN_BMP(aSource))
{
aDest.Append(PRUnichar(aSource));
}
--- a/xpcom/string/src/nsTString.cpp
+++ b/xpcom/string/src/nsTString.cpp
@@ -32,17 +32,17 @@
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
-NS_COM nsTAdoptingString_CharT&
+nsTAdoptingString_CharT&
nsTAdoptingString_CharT::operator=( const self_type& str )
{
// This'll violate the constness of this argument, that's just
// the nature of this class...
self_type* mutable_str = const_cast<self_type*>(&str);
if (str.mFlags & F_OWNED)
{
--- a/xpcom/string/src/nsTStringComparator.cpp
+++ b/xpcom/string/src/nsTStringComparator.cpp
@@ -31,17 +31,17 @@
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
-NS_COM int NS_FASTCALL
+int NS_FASTCALL
Compare( const nsTSubstring_CharT::base_string_type& lhs, const nsTSubstring_CharT::base_string_type& rhs, const nsTStringComparator_CharT& comp )
{
typedef nsTSubstring_CharT::size_type size_type;
if ( &lhs == &rhs )
return 0;
nsTSubstring_CharT::const_iterator leftIter, rightIter;
--- a/xpcom/tests/TestPipes.cpp
+++ b/xpcom/tests/TestPipes.cpp
@@ -467,17 +467,17 @@ RunTests(PRUint32 segSize, PRUint32 segC
NS_ASSERTION(NS_SUCCEEDED(rv), "TP_NewPipe failed");
rv = TestShortWrites(in, out);
NS_ASSERTION(NS_SUCCEEDED(rv), "TestPipe failed");
}
////////////////////////////////////////////////////////////////////////////////
#if 0
-extern NS_COM void
+extern void
TestSegmentedBuffer();
#endif
int
main(int argc, char* argv[])
{
nsresult rv;
--- a/xpcom/threads/nsEventQueue.h
+++ b/xpcom/threads/nsEventQueue.h
@@ -39,17 +39,17 @@
#ifndef nsEventQueue_h__
#define nsEventQueue_h__
#include <stdlib.h>
#include "mozilla/ReentrantMonitor.h"
#include "nsIRunnable.h"
// A threadsafe FIFO event queue...
-class NS_COM nsEventQueue
+class nsEventQueue
{
typedef mozilla::ReentrantMonitor ReentrantMonitor;
public:
nsEventQueue();
~nsEventQueue();
// This method adds a new event to the pending event queue. The event object
--- a/xpcom/threads/nsThreadUtilsInternal.h
+++ b/xpcom/threads/nsThreadUtilsInternal.h
@@ -49,13 +49,13 @@ class nsIThreadObserver;
* posted to threads. Only one global observer can be set at a time; an
* attempt to change the value without setting it to null first will throw.
* This function does NOT take a reference to the observer; the caller of this
* function is responsible for setting the observer to null when it goes away.
* This method may only be called on the main thread; attempts to do it on
* other threads will return an error.
*/
extern nsresult
-NS_COM NS_SetGlobalThreadObserver(nsIThreadObserver* aObserver);
+NS_SetGlobalThreadObserver(nsIThreadObserver* aObserver);
#endif // MOZILLA_INTERNAL_API
#endif // nsThreadUtilsInternal_h_