Author: fejj
Date: 2007-12-14 13:05:27 -0500 (Fri, 14 Dec 2007)
New Revision: 91304

Modified:
   trunk/moon/plugin/ChangeLog
   trunk/moon/plugin/downloader.cpp
   trunk/moon/plugin/plugin.cpp
   trunk/moon/plugin/plugin.h
Log:
2007-12-14  Jeffrey Stedfast  <[EMAIL PROTECTED]>

        * downloader.cpp (p_downloader_abort): Set pd->stream to NULL
        after destroying it.

        * plugin.cpp (PluginInstance::TryLoad): Added a comment that we
        should check for errors returned by NPN_GetURLNotify().
        (PluginInstance::UpdateSource): Same.
        (PluginInstance::UrlNotify): Removed a printf.



Modified: trunk/moon/plugin/ChangeLog
===================================================================
--- trunk/moon/plugin/ChangeLog 2007-12-14 17:53:52 UTC (rev 91303)
+++ trunk/moon/plugin/ChangeLog 2007-12-14 18:05:27 UTC (rev 91304)
@@ -1,3 +1,13 @@
+2007-12-14  Jeffrey Stedfast  <[EMAIL PROTECTED]>
+
+       * downloader.cpp (p_downloader_abort): Set pd->stream to NULL
+       after destroying it.
+
+       * plugin.cpp (PluginInstance::TryLoad): Added a comment that we
+       should check for errors returned by NPN_GetURLNotify().
+       (PluginInstance::UpdateSource): Same.
+       (PluginInstance::UrlNotify): Removed a printf.
+
 2007-12-12  Jeffrey Stedfast  <[EMAIL PROTECTED]>
 
        Fixes toward bug #341853

Modified: trunk/moon/plugin/downloader.cpp
===================================================================
--- trunk/moon/plugin/downloader.cpp    2007-12-14 17:53:52 UTC (rev 91303)
+++ trunk/moon/plugin/downloader.cpp    2007-12-14 18:05:27 UTC (rev 91304)
@@ -85,8 +85,7 @@
        PluginDownloader *pd = (PluginDownloader *) state;
        NPP_t *plugin = NULL;
        
-       //      fprintf (stderr, "PluginDownloaderSend: Starting downloader 
again for (%s %s)\n", pd->verb, pd->uri);
-       //
+       //fprintf (stderr, "PluginDownloaderSend: Starting downloader again for 
(%s %s)\n", pd->verb, pd->uri);
        
        if (pd && pd->dl && pd->dl->GetContext ()) {
                // Get the context from the downloader.
@@ -142,14 +141,14 @@
 p_downloader_abort (gpointer state)
 {
        PluginDownloader *pd = (PluginDownloader *) state;
-
+       
        if (downloader_shutdown)
                return;
-
-       if (pd->npp && pd->stream)
+       
+       if (pd->npp && pd->stream) {
                NPN_DestroyStream (pd->npp, pd->stream, NPRES_USER_BREAK);
-       else
-               fprintf (stderr, "moonlight-plugin: no stream available for 
downloader abort  %s\n", pd->uri);
+               pd->stream = NULL;
+       }
 }
 
 void
@@ -165,15 +164,15 @@
 downloader_initialize (void)
 {
        downloader_set_functions (
-                       p_downloader_create_state,
-                       p_downloader_destroy_state,
-                       p_downloader_open,
-                       p_downloader_send,
-                       p_downloader_abort);
+               p_downloader_create_state,
+               p_downloader_destroy_state,
+               p_downloader_open,
+               p_downloader_send,
+               p_downloader_abort);
 }
 
 void
-downloader_destroy ()
+downloader_destroy (void)
 {
        downloader_shutdown = true;
 }

Modified: trunk/moon/plugin/plugin.cpp
===================================================================
--- trunk/moon/plugin/plugin.cpp        2007-12-14 17:53:52 UTC (rev 91303)
+++ trunk/moon/plugin/plugin.cpp        2007-12-14 18:05:27 UTC (rev 91304)
@@ -435,7 +435,7 @@
 void
 PluginInstance::CreateWindow ()
 {
-       DEBUGMSG ("*** creating window2 (%d,%d,%d,%d)", window->x, window->y, 
window->width, window->height);
+       //DEBUGMSG ("*** creating window2 (%d,%d,%d,%d)", window->x, window->y, 
window->width, window->height);
 
        //  GtkPlug container and surface inside
        this->container = gtk_plug_new (reinterpret_cast <GdkNativeWindow> 
(window->window));
@@ -485,10 +485,12 @@
 
        char *pos = strchr (this->source, '#');
        if (pos) {
-               if (strlen(&pos[1]) > 0);
+               if (strlen (&pos[1]) > 0);
                        this->UpdateSourceByReference (&pos[1]);
        } else {
                StreamNotify *notify = new StreamNotify (StreamNotify::SOURCE, 
this->source);
+               
+               // FIXME: check for errors
                NPN_GetURLNotify (this->instance, this->source, NULL, notify);
        }
 }
@@ -557,17 +559,19 @@
 NPError
 PluginInstance::NewStream (NPMIMEType type, NPStream *stream, NPBool seekable, 
uint16_t *stype)
 {
-  //   DEBUGMSG ("NewStream (%s) %s", this->source, stream->url);
-
+       //DEBUGMSG ("NewStream (%s) %s\n", this->source, stream->url);
+       
        if (IS_NOTIFY_SOURCE (stream->notifyData)) {
                *stype = NP_ASFILEONLY;
                return NPERR_NO_ERROR;
        }
-
+       
        if (IS_NOTIFY_DOWNLOADER (stream->notifyData)) {
-               *stype = NP_ASFILE;
                StreamNotify *notify = (StreamNotify *) stream->notifyData;
+               
                downloader_set_stream_data ((Downloader *) notify->pdata, 
instance, stream);
+               *stype = NP_ASFILE;
+               
                return NPERR_NO_ERROR;
        }
 
@@ -605,9 +609,11 @@
                vm_missing_file = g_strdup (xaml_loader->TryLoad (&error));
 
        //printf ("PluginInstance::TryLoad, vm_missing_file: %s, error: %i\n", 
vm_missing_file, error);
-
-       if (vm_missing_file != NULL){
+       
+       if (vm_missing_file != NULL) {
                StreamNotify *notify = new StreamNotify (StreamNotify::REQUEST, 
vm_missing_file);
+               
+               // FIXME: check for errors
                NPN_GetURLNotify (instance, vm_missing_file, NULL, notify);
                return;
        }
@@ -904,7 +910,7 @@
                        
                        switch (reason) {
                        case NPRES_USER_BREAK:
-                               dl->NotifyFailed ("user aborted");
+                               dl->NotifyFailed ("user break");
                                break;
                        case NPRES_NETWORK_ERR:
                                dl->NotifyFailed ("network error");
@@ -913,8 +919,6 @@
                                dl->NotifyFailed ("unknown error");
                                break;
                        }
-               } else {
-                       printf ("UrlNotify: %s failed, but no downloader to 
notify\n", url);
                }
        }
        
@@ -1156,7 +1160,7 @@
 // On error it sets the @error ref to 1
 // Returns the filename that we are missing
 //
-const char*
+const char *
 PluginXamlLoader::TryLoad (int *error)
 {
        DependencyObject *element;

Modified: trunk/moon/plugin/plugin.h
===================================================================
--- trunk/moon/plugin/plugin.h  2007-12-14 17:53:52 UTC (rev 91303)
+++ trunk/moon/plugin/plugin.h  2007-12-14 18:05:27 UTC (rev 91304)
@@ -170,6 +170,7 @@
        {
                base_ref (dob);
        }
+       
        ~StreamNotify ()
        {
                if (type == DOWNLOADER)

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to