Jacek Caban : mshtml: Don't access BSCallback directly in nsio.c.

Alexandre Julliard julliard at winehq.org
Mon Mar 24 07:54:47 CDT 2008


Module: wine
Branch: master
Commit: f792ada40fcbb755f09f3497277fa11adcf79233
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f792ada40fcbb755f09f3497277fa11adcf79233

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Sun Mar 23 02:15:20 2008 +0100

mshtml: Don't access BSCallback directly in nsio.c.

---

 dlls/mshtml/mshtml_private.h |    2 ++
 dlls/mshtml/navigate.c       |   14 ++++++++++++++
 dlls/mshtml/nsio.c           |   22 ++--------------------
 3 files changed, 18 insertions(+), 20 deletions(-)

diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index d26250e..66bb11d 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -434,6 +434,8 @@ HRESULT load_stream(BSCallback*,IStream*);
 void set_document_bscallback(HTMLDocument*,BSCallback*);
 void set_current_mon(HTMLDocument*,IMoniker*);
 
+void channelbsc_set_channel(BSCallback*,nsChannel*,nsIStreamListener*,nsISupports*);
+
 IHTMLSelectionObject *HTMLSelectionObject_Create(HTMLDocument*,nsISelection*);
 IHTMLTxtRange *HTMLTxtRange_Create(HTMLDocument*,nsIDOMRange*);
 IHTMLStyle *HTMLStyle_Create(nsIDOMCSSStyleDeclaration*);
diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c
index cc48b93..66cea25 100644
--- a/dlls/mshtml/navigate.c
+++ b/dlls/mshtml/navigate.c
@@ -908,3 +908,17 @@ HRESULT load_stream(BSCallback *bscallback, IStream *stream)
 
     return hres;
 }
+
+void channelbsc_set_channel(BSCallback *This, nsChannel *channel, nsIStreamListener *listener, nsISupports *context)
+{
+    nsIChannel_AddRef(NSCHANNEL(channel));
+    This->nschannel = channel;
+
+    nsIStreamListener_AddRef(listener);
+    This->nslistener = listener;
+
+    if(context) {
+        nsISupports_AddRef(context);
+        This->nscontext = context;
+    }
+}
diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c
index d55546d..8c996b8 100644
--- a/dlls/mshtml/nsio.c
+++ b/dlls/mshtml/nsio.c
@@ -685,16 +685,7 @@ static nsresult async_open_doc_uri(nsChannel *This, NSContainer *container,
     *open = FALSE;
 
     if(container->bscallback) {
-        nsIChannel_AddRef(NSCHANNEL(This));
-        container->bscallback->nschannel = This;
-
-        nsIStreamListener_AddRef(listener);
-        container->bscallback->nslistener = listener;
-
-        if(context) {
-            nsISupports_AddRef(context);
-            container->bscallback->nscontext = context;
-        }
+        channelbsc_set_channel(container->bscallback, This, listener, context);
 
         if(container->doc && container->doc->mime) {
             DWORD len;
@@ -781,16 +772,7 @@ static nsresult async_open(nsChannel *This, NSContainer *container, nsIStreamLis
     bscallback = create_bscallback(mon);
     IMoniker_Release(mon);
 
-    nsIChannel_AddRef(NSCHANNEL(This));
-    bscallback->nschannel = This;
-
-    nsIStreamListener_AddRef(listener);
-    bscallback->nslistener = listener;
-
-    if(context) {
-        nsISupports_AddRef(context);
-        bscallback->nscontext = context;
-    }
+    channelbsc_set_channel(bscallback, This, listener, context);
 
     task = heap_alloc(sizeof(task_t));
 




More information about the wine-cvs mailing list