LCOV - code coverage report
Current view: directory - xpcom/glue/standalone - nsXPCOMGlue.cpp (source / functions) Found Hit Coverage
Test: app.info Lines: 253 39 15.4 %
Date: 2012-06-02 Functions: 58 7 12.1 %

       1                 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 : /* vim:set ts=4 sw=4 et cindent: */
       3                 : /* ***** BEGIN LICENSE BLOCK *****
       4                 :  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
       5                 :  *
       6                 :  * The contents of this file are subject to the Mozilla Public License Version
       7                 :  * 1.1 (the "License"); you may not use this file except in compliance with
       8                 :  * the License. You may obtain a copy of the License at
       9                 :  * http://www.mozilla.org/MPL/
      10                 :  *
      11                 :  * Software distributed under the License is distributed on an "AS IS" basis,
      12                 :  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
      13                 :  * for the specific language governing rights and limitations under the
      14                 :  * License.
      15                 :  *
      16                 :  * The Original Code is mozilla.org code.
      17                 :  *
      18                 :  * The Initial Developer of the Original Code is
      19                 :  * Netscape Communications Corporation.
      20                 :  * Portions created by the Initial Developer are Copyright (C) 1998
      21                 :  * the Initial Developer. All Rights Reserved.
      22                 :  *
      23                 :  * Contributor(s):
      24                 :  *
      25                 :  * Alternatively, the contents of this file may be used under the terms of
      26                 :  * either of the GNU General Public License Version 2 or later (the "GPL"),
      27                 :  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
      28                 :  * in which case the provisions of the GPL or the LGPL are applicable instead
      29                 :  * of those above. If you wish to allow use of your version of this file only
      30                 :  * under the terms of either the GPL or the LGPL, and not to allow others to
      31                 :  * use your version of this file under the terms of the MPL, indicate your
      32                 :  * decision by deleting the provisions above and replace them with the notice
      33                 :  * and other provisions required by the GPL or the LGPL. If you do not delete
      34                 :  * the provisions above, a recipient may use your version of this file under
      35                 :  * the terms of any one of the MPL, the GPL or the LGPL.
      36                 :  *
      37                 :  * ***** END LICENSE BLOCK ***** */
      38                 : 
      39                 : #include "nsXPCOMGlue.h"
      40                 : #include "nsGlueLinking.h"
      41                 : 
      42                 : #include "nspr.h"
      43                 : #include "nsDebug.h"
      44                 : #include "nsIServiceManager.h"
      45                 : #include "nsXPCOMPrivate.h"
      46                 : #include "nsCOMPtr.h"
      47                 : #include <stdlib.h>
      48                 : #include <stdio.h>
      49                 : 
      50                 : #ifdef XP_WIN
      51                 : #include <windows.h>
      52                 : #include <mbstring.h>
      53                 : #include <malloc.h>
      54                 : #define snprintf _snprintf
      55                 : #endif
      56                 : 
      57                 : static XPCOMFunctions xpcomFunctions;
      58                 : static bool do_preload = false;
      59                 : 
      60                 : extern "C"
      61              46 : void XPCOMGlueEnablePreload()
      62                 : {
      63              46 :     do_preload = true;
      64              46 : }
      65                 : 
      66                 : extern "C"
      67              46 : nsresult XPCOMGlueStartup(const char* xpcomFile)
      68                 : {
      69              46 :     xpcomFunctions.version = XPCOM_GLUE_VERSION;
      70              46 :     xpcomFunctions.size    = sizeof(XPCOMFunctions);
      71                 : 
      72              46 :     GetFrozenFunctionsFunc func = nsnull;
      73                 : 
      74              46 :     if (!xpcomFile)
      75               0 :         xpcomFile = XPCOM_DLL;
      76                 :     
      77              46 :     nsresult rv = XPCOMGlueLoad(xpcomFile, &func);
      78              46 :     if (NS_FAILED(rv))
      79               0 :         return rv;
      80                 : 
      81              46 :     rv = (*func)(&xpcomFunctions, nsnull);
      82              46 :     if (NS_FAILED(rv)) {
      83               0 :         XPCOMGlueUnload();
      84               0 :         return rv;
      85                 :     }
      86                 : 
      87              46 :     return NS_OK;
      88                 : }
      89                 : 
      90                 : #if defined(XP_WIN)
      91                 : #define READ_TEXTMODE L"rt"
      92                 : #elif defined(XP_OS2)
      93                 : #define READ_TEXTMODE "rt"
      94                 : #else
      95                 : #define READ_TEXTMODE "r"
      96                 : #endif
      97                 : 
      98                 : #ifdef XP_WIN
      99                 : inline FILE *TS_tfopen (const char *path, const wchar_t *mode)
     100                 : {
     101                 :     wchar_t wPath[MAX_PATH];
     102                 :     MultiByteToWideChar(CP_UTF8, 0, path, -1, wPath, MAX_PATH);
     103                 :     return _wfopen(wPath, mode);
     104                 : }
     105                 : #else
     106              46 : inline FILE *TS_tfopen (const char *path, const char *mode)
     107                 : {
     108              46 :     return fopen(path, mode);
     109                 : }
     110                 : #endif
     111                 : 
     112                 : void
     113              46 : XPCOMGlueLoadDependentLibs(const char *xpcomDir, DependentLibsCallback cb)
     114                 : {
     115                 :     char buffer[MAXPATHLEN];
     116                 :     sprintf(buffer, "%s" XPCOM_FILE_PATH_SEPARATOR XPCOM_DEPENDENT_LIBS_LIST,
     117              46 :             xpcomDir);
     118                 : 
     119              46 :     FILE *flist = TS_tfopen(buffer, READ_TEXTMODE);
     120              46 :     if (!flist)
     121               0 :         return;
     122                 : 
     123             598 :     while (fgets(buffer, sizeof(buffer), flist)) {
     124             506 :         int l = strlen(buffer);
     125                 : 
     126                 :         // ignore empty lines and comments
     127             506 :         if (l == 0 || *buffer == '#')
     128               0 :             continue;
     129                 : 
     130                 :         // cut the trailing newline, if present
     131             506 :         if (buffer[l - 1] == '\n')
     132             506 :             buffer[l - 1] = '\0';
     133                 : 
     134                 :         char buffer2[MAXPATHLEN];
     135                 :         snprintf(buffer2, sizeof(buffer2),
     136                 :                  "%s" XPCOM_FILE_PATH_SEPARATOR "%s",
     137             506 :                  xpcomDir, buffer);
     138             506 :         cb(buffer2, do_preload);
     139                 :     }
     140                 : 
     141              46 :     fclose(flist);
     142                 : }
     143                 : 
     144                 : extern "C"
     145              23 : nsresult XPCOMGlueShutdown()
     146                 : {
     147              23 :     XPCOMGlueUnload();
     148                 :     
     149              23 :     memset(&xpcomFunctions, 0, sizeof(xpcomFunctions));
     150              23 :     return NS_OK;
     151                 : }
     152                 : 
     153                 : XPCOM_API(nsresult)
     154               0 : NS_InitXPCOM2(nsIServiceManager* *result, 
     155                 :               nsIFile* binDirectory,
     156                 :               nsIDirectoryServiceProvider* appFileLocationProvider)
     157                 : {
     158               0 :     if (!xpcomFunctions.init)
     159               0 :         return NS_ERROR_NOT_INITIALIZED;
     160               0 :     return xpcomFunctions.init(result, binDirectory, appFileLocationProvider);
     161                 : }
     162                 : 
     163                 : XPCOM_API(nsresult)
     164               0 : NS_ShutdownXPCOM(nsIServiceManager* servMgr)
     165                 : {
     166               0 :     if (!xpcomFunctions.shutdown)
     167               0 :         return NS_ERROR_NOT_INITIALIZED;
     168               0 :     return xpcomFunctions.shutdown(servMgr);
     169                 : }
     170                 : 
     171                 : XPCOM_API(nsresult)
     172               0 : NS_GetServiceManager(nsIServiceManager* *result)
     173                 : {
     174               0 :     if (!xpcomFunctions.getServiceManager)
     175               0 :         return NS_ERROR_NOT_INITIALIZED;
     176               0 :     return xpcomFunctions.getServiceManager(result);
     177                 : }
     178                 : 
     179                 : XPCOM_API(nsresult)
     180               0 : NS_GetComponentManager(nsIComponentManager* *result)
     181                 : {
     182               0 :     if (!xpcomFunctions.getComponentManager)
     183               0 :         return NS_ERROR_NOT_INITIALIZED;
     184               0 :     return xpcomFunctions.getComponentManager(result);
     185                 : }
     186                 : 
     187                 : XPCOM_API(nsresult)
     188               0 : NS_GetComponentRegistrar(nsIComponentRegistrar* *result)
     189                 : {
     190               0 :     if (!xpcomFunctions.getComponentRegistrar)
     191               0 :         return NS_ERROR_NOT_INITIALIZED;
     192               0 :     return xpcomFunctions.getComponentRegistrar(result);
     193                 : }
     194                 : 
     195                 : XPCOM_API(nsresult)
     196               0 : NS_GetMemoryManager(nsIMemory* *result)
     197                 : {
     198               0 :     if (!xpcomFunctions.getMemoryManager)
     199               0 :         return NS_ERROR_NOT_INITIALIZED;
     200               0 :     return xpcomFunctions.getMemoryManager(result);
     201                 : }
     202                 : 
     203                 : XPCOM_API(nsresult)
     204               0 : NS_NewLocalFile(const nsAString &path, bool followLinks, nsILocalFile* *result)
     205                 : {
     206               0 :     if (!xpcomFunctions.newLocalFile)
     207               0 :         return NS_ERROR_NOT_INITIALIZED;
     208               0 :     return xpcomFunctions.newLocalFile(path, followLinks, result);
     209                 : }
     210                 : 
     211                 : XPCOM_API(nsresult)
     212               0 : NS_NewNativeLocalFile(const nsACString &path, bool followLinks, nsILocalFile* *result)
     213                 : {
     214               0 :     if (!xpcomFunctions.newNativeLocalFile)
     215               0 :         return NS_ERROR_NOT_INITIALIZED;
     216               0 :     return xpcomFunctions.newNativeLocalFile(path, followLinks, result);
     217                 : }
     218                 : 
     219                 : XPCOM_API(nsresult)
     220               0 : NS_GetDebug(nsIDebug* *result)
     221                 : {
     222               0 :     if (!xpcomFunctions.getDebug)
     223               0 :         return NS_ERROR_NOT_INITIALIZED;
     224               0 :     return xpcomFunctions.getDebug(result);
     225                 : }
     226                 : 
     227                 : 
     228                 : XPCOM_API(nsresult)
     229               0 : NS_GetTraceRefcnt(nsITraceRefcnt* *result)
     230                 : {
     231               0 :     if (!xpcomFunctions.getTraceRefcnt)
     232               0 :         return NS_ERROR_NOT_INITIALIZED;
     233               0 :     return xpcomFunctions.getTraceRefcnt(result);
     234                 : }
     235                 : 
     236                 : 
     237                 : XPCOM_API(nsresult)
     238               0 : NS_StringContainerInit(nsStringContainer &aStr)
     239                 : {
     240               0 :     if (!xpcomFunctions.stringContainerInit)
     241               0 :         return NS_ERROR_NOT_INITIALIZED;
     242               0 :     return xpcomFunctions.stringContainerInit(aStr);
     243                 : }
     244                 : 
     245                 : XPCOM_API(nsresult)
     246               0 : NS_StringContainerInit2(nsStringContainer &aStr,
     247                 :                         const PRUnichar   *aData,
     248                 :                         PRUint32           aDataLength,
     249                 :                         PRUint32           aFlags)
     250                 : {
     251               0 :     if (!xpcomFunctions.stringContainerInit2)
     252               0 :         return NS_ERROR_NOT_INITIALIZED;
     253               0 :     return xpcomFunctions.stringContainerInit2(aStr, aData, aDataLength, aFlags);
     254                 : }
     255                 : 
     256                 : XPCOM_API(void)
     257               0 : NS_StringContainerFinish(nsStringContainer &aStr)
     258                 : {
     259               0 :     if (xpcomFunctions.stringContainerFinish)
     260               0 :         xpcomFunctions.stringContainerFinish(aStr);
     261               0 : }
     262                 : 
     263                 : XPCOM_API(PRUint32)
     264               0 : NS_StringGetData(const nsAString &aStr, const PRUnichar **aBuf, bool *aTerm)
     265                 : {
     266               0 :     if (!xpcomFunctions.stringGetData) {
     267               0 :         *aBuf = nsnull;
     268               0 :         return 0;
     269                 :     }
     270               0 :     return xpcomFunctions.stringGetData(aStr, aBuf, aTerm);
     271                 : }
     272                 : 
     273                 : XPCOM_API(PRUint32)
     274               0 : NS_StringGetMutableData(nsAString &aStr, PRUint32 aLen, PRUnichar **aBuf)
     275                 : {
     276               0 :     if (!xpcomFunctions.stringGetMutableData) {
     277               0 :         *aBuf = nsnull;
     278               0 :         return 0;
     279                 :     }
     280               0 :     return xpcomFunctions.stringGetMutableData(aStr, aLen, aBuf);
     281                 : }
     282                 : 
     283                 : XPCOM_API(PRUnichar*)
     284               0 : NS_StringCloneData(const nsAString &aStr)
     285                 : {
     286               0 :     if (!xpcomFunctions.stringCloneData)
     287               0 :         return nsnull;
     288               0 :     return xpcomFunctions.stringCloneData(aStr);
     289                 : }
     290                 : 
     291                 : XPCOM_API(nsresult)
     292               0 : NS_StringSetData(nsAString &aStr, const PRUnichar *aBuf, PRUint32 aCount)
     293                 : {
     294               0 :     if (!xpcomFunctions.stringSetData)
     295               0 :         return NS_ERROR_NOT_INITIALIZED;
     296                 : 
     297               0 :     return xpcomFunctions.stringSetData(aStr, aBuf, aCount);
     298                 : }
     299                 : 
     300                 : XPCOM_API(nsresult)
     301               0 : NS_StringSetDataRange(nsAString &aStr, PRUint32 aCutStart, PRUint32 aCutLength,
     302                 :                       const PRUnichar *aBuf, PRUint32 aCount)
     303                 : {
     304               0 :     if (!xpcomFunctions.stringSetDataRange)
     305               0 :         return NS_ERROR_NOT_INITIALIZED;
     306               0 :     return xpcomFunctions.stringSetDataRange(aStr, aCutStart, aCutLength, aBuf, aCount);
     307                 : }
     308                 : 
     309                 : XPCOM_API(nsresult)
     310               0 : NS_StringCopy(nsAString &aDest, const nsAString &aSrc)
     311                 : {
     312               0 :     if (!xpcomFunctions.stringCopy)
     313               0 :         return NS_ERROR_NOT_INITIALIZED;
     314               0 :     return xpcomFunctions.stringCopy(aDest, aSrc);
     315                 : }
     316                 : 
     317                 : XPCOM_API(void)
     318               0 : NS_StringSetIsVoid(nsAString &aStr, const bool aIsVoid)
     319                 : {
     320               0 :     if (xpcomFunctions.stringSetIsVoid)
     321               0 :         xpcomFunctions.stringSetIsVoid(aStr, aIsVoid);
     322               0 : }
     323                 : 
     324                 : XPCOM_API(bool)
     325               0 : NS_StringGetIsVoid(const nsAString &aStr)
     326                 : {
     327               0 :     if (!xpcomFunctions.stringGetIsVoid)
     328               0 :         return false;
     329               0 :     return xpcomFunctions.stringGetIsVoid(aStr);
     330                 : }
     331                 : 
     332                 : XPCOM_API(nsresult)
     333               0 : NS_CStringContainerInit(nsCStringContainer &aStr)
     334                 : {
     335               0 :     if (!xpcomFunctions.cstringContainerInit)
     336               0 :         return NS_ERROR_NOT_INITIALIZED;
     337               0 :     return xpcomFunctions.cstringContainerInit(aStr);
     338                 : }
     339                 : 
     340                 : XPCOM_API(nsresult)
     341               0 : NS_CStringContainerInit2(nsCStringContainer &aStr,
     342                 :                          const char         *aData,
     343                 :                          PRUint32           aDataLength,
     344                 :                          PRUint32           aFlags)
     345                 : {
     346               0 :     if (!xpcomFunctions.cstringContainerInit2)
     347               0 :         return NS_ERROR_NOT_INITIALIZED;
     348               0 :     return xpcomFunctions.cstringContainerInit2(aStr, aData, aDataLength, aFlags);
     349                 : }
     350                 : 
     351                 : XPCOM_API(void)
     352               0 : NS_CStringContainerFinish(nsCStringContainer &aStr)
     353                 : {
     354               0 :     if (xpcomFunctions.cstringContainerFinish)
     355               0 :         xpcomFunctions.cstringContainerFinish(aStr);
     356               0 : }
     357                 : 
     358                 : XPCOM_API(PRUint32)
     359               0 : NS_CStringGetData(const nsACString &aStr, const char **aBuf, bool *aTerm)
     360                 : {
     361               0 :     if (!xpcomFunctions.cstringGetData) {
     362               0 :         *aBuf = nsnull;
     363               0 :         return 0;
     364                 :     }
     365               0 :     return xpcomFunctions.cstringGetData(aStr, aBuf, aTerm);
     366                 : }
     367                 : 
     368                 : XPCOM_API(PRUint32)
     369               0 : NS_CStringGetMutableData(nsACString &aStr, PRUint32 aLen, char **aBuf)
     370                 : {
     371               0 :     if (!xpcomFunctions.cstringGetMutableData) {
     372               0 :         *aBuf = nsnull;
     373               0 :         return 0;
     374                 :     }
     375               0 :     return xpcomFunctions.cstringGetMutableData(aStr, aLen, aBuf);
     376                 : }
     377                 : 
     378                 : XPCOM_API(char*)
     379               0 : NS_CStringCloneData(const nsACString &aStr)
     380                 : {
     381               0 :     if (!xpcomFunctions.cstringCloneData)
     382               0 :         return nsnull;
     383               0 :     return xpcomFunctions.cstringCloneData(aStr);
     384                 : }
     385                 : 
     386                 : XPCOM_API(nsresult)
     387               0 : NS_CStringSetData(nsACString &aStr, const char *aBuf, PRUint32 aCount)
     388                 : {
     389               0 :     if (!xpcomFunctions.cstringSetData)
     390               0 :         return NS_ERROR_NOT_INITIALIZED;
     391               0 :     return xpcomFunctions.cstringSetData(aStr, aBuf, aCount);
     392                 : }
     393                 : 
     394                 : XPCOM_API(nsresult)
     395               0 : NS_CStringSetDataRange(nsACString &aStr, PRUint32 aCutStart, PRUint32 aCutLength,
     396                 :                        const char *aBuf, PRUint32 aCount)
     397                 : {
     398               0 :     if (!xpcomFunctions.cstringSetDataRange)
     399               0 :         return NS_ERROR_NOT_INITIALIZED;
     400               0 :     return xpcomFunctions.cstringSetDataRange(aStr, aCutStart, aCutLength, aBuf, aCount);
     401                 : }
     402                 : 
     403                 : XPCOM_API(nsresult)
     404               0 : NS_CStringCopy(nsACString &aDest, const nsACString &aSrc)
     405                 : {
     406               0 :     if (!xpcomFunctions.cstringCopy)
     407               0 :         return NS_ERROR_NOT_INITIALIZED;
     408               0 :     return xpcomFunctions.cstringCopy(aDest, aSrc);
     409                 : }
     410                 : 
     411                 : XPCOM_API(void)
     412               0 : NS_CStringSetIsVoid(nsACString &aStr, const bool aIsVoid)
     413                 : {
     414               0 :     if (xpcomFunctions.cstringSetIsVoid)
     415               0 :         xpcomFunctions.cstringSetIsVoid(aStr, aIsVoid);
     416               0 : }
     417                 : 
     418                 : XPCOM_API(bool)
     419               0 : NS_CStringGetIsVoid(const nsACString &aStr)
     420                 : {
     421               0 :     if (!xpcomFunctions.cstringGetIsVoid)
     422               0 :         return false;
     423               0 :     return xpcomFunctions.cstringGetIsVoid(aStr);
     424                 : }
     425                 : 
     426                 : XPCOM_API(nsresult)
     427               0 : NS_CStringToUTF16(const nsACString &aSrc, nsCStringEncoding aSrcEncoding, nsAString &aDest)
     428                 : {
     429               0 :     if (!xpcomFunctions.cstringToUTF16)
     430               0 :         return NS_ERROR_NOT_INITIALIZED;
     431               0 :     return xpcomFunctions.cstringToUTF16(aSrc, aSrcEncoding, aDest);
     432                 : }
     433                 : 
     434                 : XPCOM_API(nsresult)
     435               0 : NS_UTF16ToCString(const nsAString &aSrc, nsCStringEncoding aDestEncoding, nsACString &aDest)
     436                 : {
     437               0 :     if (!xpcomFunctions.utf16ToCString)
     438               0 :         return NS_ERROR_NOT_INITIALIZED;
     439               0 :     return xpcomFunctions.utf16ToCString(aSrc, aDestEncoding, aDest);
     440                 : }
     441                 : 
     442                 : XPCOM_API(void*)
     443               0 : NS_Alloc(PRSize size)
     444                 : {
     445               0 :     if (!xpcomFunctions.allocFunc)
     446               0 :         return nsnull;
     447               0 :     return xpcomFunctions.allocFunc(size);
     448                 : }
     449                 : 
     450                 : XPCOM_API(void*)
     451               0 : NS_Realloc(void* ptr, PRSize size)
     452                 : {
     453               0 :     if (!xpcomFunctions.reallocFunc)
     454               0 :         return nsnull;
     455               0 :     return xpcomFunctions.reallocFunc(ptr, size);
     456                 : }
     457                 : 
     458                 : XPCOM_API(void)
     459               0 : NS_Free(void* ptr)
     460                 : {
     461               0 :     if (xpcomFunctions.freeFunc)
     462               0 :         xpcomFunctions.freeFunc(ptr);
     463               0 : }
     464                 : 
     465                 : XPCOM_API(void)
     466               0 : NS_DebugBreak(PRUint32 aSeverity, const char *aStr, const char *aExpr,
     467                 :               const char *aFile, PRInt32 aLine)
     468                 : {
     469               0 :     if (xpcomFunctions.debugBreakFunc)
     470               0 :         xpcomFunctions.debugBreakFunc(aSeverity, aStr, aExpr, aFile, aLine);
     471               0 : }
     472                 : 
     473                 : XPCOM_API(void)
     474              46 : NS_LogInit()
     475                 : {
     476              46 :     if (xpcomFunctions.logInitFunc)
     477              46 :         xpcomFunctions.logInitFunc();
     478              46 : }
     479                 : 
     480                 : XPCOM_API(void)
     481              23 : NS_LogTerm()
     482                 : {
     483              23 :     if (xpcomFunctions.logTermFunc)
     484              23 :         xpcomFunctions.logTermFunc();
     485              23 : }
     486                 : 
     487                 : XPCOM_API(void)
     488               0 : NS_LogAddRef(void *aPtr, nsrefcnt aNewRefCnt,
     489                 :              const char *aTypeName, PRUint32 aInstanceSize)
     490                 : {
     491               0 :     if (xpcomFunctions.logAddRefFunc)
     492                 :         xpcomFunctions.logAddRefFunc(aPtr, aNewRefCnt,
     493               0 :                                      aTypeName, aInstanceSize);
     494               0 : }
     495                 : 
     496                 : XPCOM_API(void)
     497               0 : NS_LogRelease(void *aPtr, nsrefcnt aNewRefCnt, const char *aTypeName)
     498                 : {
     499               0 :     if (xpcomFunctions.logReleaseFunc)
     500               0 :         xpcomFunctions.logReleaseFunc(aPtr, aNewRefCnt, aTypeName);
     501               0 : }
     502                 : 
     503                 : XPCOM_API(void)
     504               0 : NS_LogCtor(void *aPtr, const char *aTypeName, PRUint32 aInstanceSize)
     505                 : {
     506               0 :     if (xpcomFunctions.logCtorFunc)
     507               0 :         xpcomFunctions.logCtorFunc(aPtr, aTypeName, aInstanceSize);
     508               0 : }
     509                 : 
     510                 : XPCOM_API(void)
     511               0 : NS_LogDtor(void *aPtr, const char *aTypeName, PRUint32 aInstanceSize)
     512                 : {
     513               0 :     if (xpcomFunctions.logDtorFunc)
     514               0 :         xpcomFunctions.logDtorFunc(aPtr, aTypeName, aInstanceSize);
     515               0 : }
     516                 : 
     517                 : XPCOM_API(void)
     518               0 : NS_LogCOMPtrAddRef(void *aCOMPtr, nsISupports *aObject)
     519                 : {
     520               0 :     if (xpcomFunctions.logCOMPtrAddRefFunc)
     521               0 :         xpcomFunctions.logCOMPtrAddRefFunc(aCOMPtr, aObject);
     522               0 : }
     523                 : 
     524                 : XPCOM_API(void)
     525               0 : NS_LogCOMPtrRelease(void *aCOMPtr, nsISupports *aObject)
     526                 : {
     527               0 :     if (xpcomFunctions.logCOMPtrReleaseFunc)
     528               0 :         xpcomFunctions.logCOMPtrReleaseFunc(aCOMPtr, aObject);
     529               0 : }
     530                 : 
     531                 : XPCOM_API(nsresult)
     532               0 : NS_GetXPTCallStub(REFNSIID aIID, nsIXPTCProxy* aOuter,
     533                 :                   nsISomeInterface* *aStub)
     534                 : {
     535               0 :     if (!xpcomFunctions.getXPTCallStubFunc)
     536               0 :         return NS_ERROR_NOT_INITIALIZED;
     537                 : 
     538               0 :     return xpcomFunctions.getXPTCallStubFunc(aIID, aOuter, aStub);
     539                 : }
     540                 : 
     541                 : XPCOM_API(void)
     542               0 : NS_DestroyXPTCallStub(nsISomeInterface* aStub)
     543                 : {
     544               0 :     if (xpcomFunctions.destroyXPTCallStubFunc)
     545               0 :         xpcomFunctions.destroyXPTCallStubFunc(aStub);
     546               0 : }
     547                 : 
     548                 : XPCOM_API(nsresult)
     549               0 : NS_InvokeByIndex(nsISupports* that, PRUint32 methodIndex,
     550                 :                  PRUint32 paramCount, nsXPTCVariant* params)
     551                 : {
     552               0 :     if (!xpcomFunctions.invokeByIndexFunc)
     553               0 :         return NS_ERROR_NOT_INITIALIZED;
     554                 : 
     555                 :     return xpcomFunctions.invokeByIndexFunc(that, methodIndex,
     556               0 :                                             paramCount, params);
     557                 : }
     558                 : 
     559                 : XPCOM_API(bool)
     560               0 : NS_CycleCollectorSuspect(nsISupports* obj)
     561                 : {
     562               0 :     if (!xpcomFunctions.cycleSuspectFunc)
     563               0 :         return false;
     564                 : 
     565               0 :     return xpcomFunctions.cycleSuspectFunc(obj);
     566                 : }
     567                 : 
     568                 : XPCOM_API(bool)
     569               0 : NS_CycleCollectorForget(nsISupports* obj)
     570                 : {
     571               0 :     if (!xpcomFunctions.cycleForgetFunc)
     572               0 :         return false;
     573                 : 
     574               0 :     return xpcomFunctions.cycleForgetFunc(obj);
     575                 : }
     576                 : 
     577                 : XPCOM_API(nsPurpleBufferEntry*)
     578               0 : NS_CycleCollectorSuspect2(nsISupports* obj)
     579                 : {
     580               0 :     if (!xpcomFunctions.cycleSuspect2Func)
     581               0 :         return nsnull;
     582                 : 
     583               0 :     return xpcomFunctions.cycleSuspect2Func(obj);
     584                 : }
     585                 : 
     586                 : XPCOM_API(bool)
     587               0 : NS_CycleCollectorForget2(nsPurpleBufferEntry* e)
     588                 : {
     589               0 :     if (!xpcomFunctions.cycleForget2Func)
     590               0 :         return false;
     591                 : 
     592               0 :     return xpcomFunctions.cycleForget2Func(e);
     593                 : }

Generated by: LCOV version 1.7