Jacek Caban : mshtml: Use NS_Alloc and NS_Free directly instead of via nsIMemory.
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Apr 16 07:56:28 CDT 2015
Module: wine
Branch: master
Commit: ba00e8e0e1159047e52469008ef41fe1f2d6b276
URL: http://source.winehq.org/git/wine.git/?a=commit;h=ba00e8e0e1159047e52469008ef41fe1f2d6b276
Author: Jacek Caban <jacek at codeweavers.com>
Date: Thu Apr 16 12:37:11 2015 +0200
mshtml: Use NS_Alloc and NS_Free directly instead of via nsIMemory.
---
dlls/mshtml/nsembed.c | 18 ++++++------------
dlls/mshtml/nsiface.idl | 15 ---------------
2 files changed, 6 insertions(+), 27 deletions(-)
diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c
index f4d14bc..ac33015 100644
--- a/dlls/mshtml/nsembed.c
+++ b/dlls/mshtml/nsembed.c
@@ -42,7 +42,6 @@ WINE_DECLARE_DEBUG_CHANNEL(gecko);
#define NS_APPSTARTUPNOTIFIER_CONTRACTID "@mozilla.org/embedcomp/appstartup-notifier;1"
#define NS_WEBBROWSER_CONTRACTID "@mozilla.org/embedding/browser/nsWebBrowser;1"
-#define NS_MEMORY_CONTRACTID "@mozilla.org/xpcom/memory-service;1"
#define NS_COMMANDPARAMS_CONTRACTID "@mozilla.org/embedcomp/command-params;1"
#define NS_HTMLSERIALIZER_CONTRACTID "@mozilla.org/layout/contentserializer;1?mimetype=text/html"
#define NS_EDITORCONTROLLER_CONTRACTID "@mozilla.org/editor/editorcontroller;1"
@@ -69,13 +68,14 @@ static nsresult (CDECL *NS_CStringSetData)(nsACString*,const char*,PRUint32);
static nsresult (CDECL *NS_NewLocalFile)(const nsAString*,cpp_bool,nsIFile**);
static PRUint32 (CDECL *NS_StringGetData)(const nsAString*,const PRUnichar **,cpp_bool*);
static PRUint32 (CDECL *NS_CStringGetData)(const nsACString*,const char**,cpp_bool*);
+static void* (CDECL *NS_Alloc)(SIZE_T);
+static void (CDECL *NS_Free)(void*);
static HINSTANCE xul_handle = NULL;
static nsIServiceManager *pServMgr = NULL;
static nsIComponentManager *pCompMgr = NULL;
static nsICategoryManager *cat_mgr;
-static nsIMemory *nsmem = NULL;
static nsIFile *profile_directory, *plugin_directory;
static const WCHAR wszNsContainer[] = {'N','s','C','o','n','t','a','i','n','e','r',0};
@@ -516,6 +516,8 @@ static BOOL load_xul(const PRUnichar *gre_path)
NS_DLSYM(NS_NewLocalFile);
NS_DLSYM(NS_StringGetData);
NS_DLSYM(NS_CStringGetData);
+ NS_DLSYM(NS_Alloc);
+ NS_DLSYM(NS_Free);
#undef NS_DLSYM
@@ -733,11 +735,6 @@ static BOOL init_xpcom(const PRUnichar *gre_path)
init_mutation(pCompMgr);
set_preferences();
- nsres = nsIComponentManager_CreateInstanceByContractID(pCompMgr, NS_MEMORY_CONTRACTID,
- NULL, &IID_nsIMemory, (void**)&nsmem);
- if(NS_FAILED(nsres))
- ERR("Could not get nsIMemory: %08x\n", nsres);
-
nsres = nsIServiceManager_GetServiceByContractID(pServMgr, NS_CATEGORYMANAGER_CONTRACTID,
&IID_nsICategoryManager, (void**)&cat_mgr);
if(NS_FAILED(nsres))
@@ -796,12 +793,12 @@ BOOL load_gecko(void)
void *nsalloc(size_t size)
{
- return nsIMemory_Alloc(nsmem, size);
+ return NS_Alloc(size);
}
void nsfree(void *mem)
{
- nsIMemory_Free(nsmem, mem);
+ NS_Free(mem);
}
static BOOL nsACString_Init(nsACString *str, const char *data)
@@ -1118,9 +1115,6 @@ void close_gecko(void)
if(cat_mgr)
nsICategoryManager_Release(cat_mgr);
- if(nsmem)
- nsIMemory_Release(nsmem);
-
/* Gecko doesn't really support being unloaded */
/* if (hXPCOM) FreeLibrary(hXPCOM); */
diff --git a/dlls/mshtml/nsiface.idl b/dlls/mshtml/nsiface.idl
index 7989e9a..7cc898c 100644
--- a/dlls/mshtml/nsiface.idl
+++ b/dlls/mshtml/nsiface.idl
@@ -227,21 +227,6 @@ interface nsIFactory : nsISupports
[
object,
- uuid(6aef11c4-8615-44a6-9711-98f43805693d),
- local
-]
-interface nsIMemory : nsISupports
-{
- void *Alloc(/*size_t*/ int size);
- void *Realloc(void *_ptr, /*size_t*/ int newSize);
- void Free(void *_ptr);
- nsresult HeapMinimize(bool immediate);
- nsresult IsLowMemory(bool *_retval);
- nsresult IsLowMemoryPlatform(bool *_retval);
-}
-
-[
- object,
uuid(9188bc85-f92e-11d2-81ef-0060083a0bcf),
local
]
More information about the wine-cvs
mailing list