Jacek Caban : mshtml: Added heuristic hack that decides if run the page from moniker or gecko channel .

Alexandre Julliard julliard at wine.codeweavers.com
Thu Nov 2 15:46:46 CST 2006


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Nov  2 17:26:38 2006 +0100

mshtml: Added heuristic hack that decides if run the page from moniker or gecko channel.

---

 dlls/mshtml/nsio.c |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c
index 46acb67..568434d 100644
--- a/dlls/mshtml/nsio.c
+++ b/dlls/mshtml/nsio.c
@@ -568,6 +568,29 @@ static nsresult NSAPI nsChannel_Open(nsI
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
+static BOOL do_load_from_moniker_hack(nsChannel *This)
+{
+    PRBool b = FALSE;
+
+    /* 
+     * We should always load the page from IMoniker, but Wine is not yet
+     * ready for this. This function is a heuristic, that decides which
+     * way of loading is better (Gecko implementation or IMoniker). The
+     * aim is to always return TRUE.
+     */
+
+    /* Load from moniker if there is no Gecko channel available */
+    if(!This->channel)
+        return TRUE;
+
+    /* Load about protocol from moniker */
+    nsIWineURI_SchemeIs(This->uri, "about", &b);
+    if(b)
+        return TRUE;
+
+    return FALSE;
+}
+
 static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListener *aListener,
                                           nsISupports *aContext)
 {
@@ -602,7 +625,7 @@ static nsresult NSAPI nsChannel_AsyncOpe
 
             nsIWebBrowserChrome_Release(NSWBCHROME(container));
 
-            if(!This->channel) {
+            if(do_load_from_moniker_hack(This)) {
                 if(This->load_group) {
                     nsres = nsILoadGroup_AddRequest(This->load_group,
                                                     (nsIRequest*)NSCHANNEL(This), NULL);




More information about the wine-cvs mailing list