From b53c67c4da0ebb9f875894a288b2b36398d41ed5 Mon Sep 17 00:00:00 2001 From: "michaelp%netscape.com" Date: Tue, 29 Sep 1998 22:47:42 +0000 Subject: [PATCH] we only notify the plugin instance via the plugin host and only if the notify data is non-null. git-svn-id: svn://10.0.0.236/trunk@11466 18797224-902f-48f8-a5cc-f745e15eee43 --- .../plugin/base/src/ns4xPluginStream.cpp | 29 ------------------- .../plugin/base/src/nsPluginHostImpl.cpp | 17 ++++++----- .../plugin/nglsrc/ns4xPluginStream.cpp | 29 ------------------- .../plugin/nglsrc/nsPluginHostImpl.cpp | 17 ++++++----- 4 files changed, 20 insertions(+), 72 deletions(-) diff --git a/mozilla/modules/plugin/base/src/ns4xPluginStream.cpp b/mozilla/modules/plugin/base/src/ns4xPluginStream.cpp index e60c894d753..edeb366d756 100644 --- a/mozilla/modules/plugin/base/src/ns4xPluginStream.cpp +++ b/mozilla/modules/plugin/base/src/ns4xPluginStream.cpp @@ -226,35 +226,6 @@ NS_IMETHODIMP ns4xPluginStream::AsFile(const char* filename) NS_IMETHODIMP ns4xPluginStream :: Close(void) { - const NPPluginFuncs *callbacks; - NPP npp; - void *notifydata; - - fInstance->GetCallbacks(&callbacks); - fInstance->GetNPP(&npp); - - fPeer->GetNotifyData(¬ifydata); - - nsPluginReason reason; - - fPeer->GetReason(&reason); - - if (nsnull != notifydata) - { - if (callbacks->urlnotify == NULL) - return NS_OK; - - const char *url; - - fPeer->GetURL(&url); - - CallNPP_URLNotifyProc(callbacks->urlnotify, - npp, - url, - (NPReason)reason, - notifydata); - } - return NS_OK; } diff --git a/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp b/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp index 1e85c5d5442..cdbe499a67b 100644 --- a/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp +++ b/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp @@ -544,15 +544,18 @@ NS_IMETHODIMP nsPluginStreamListener :: OnStopBinding(nsIURL* aURL, PRInt32 aSta if (nsnull != instance) { - const char *url; + if (nsnull != mNotifyData) + { + const char *url; - if (nsnull != mURL) - url = mURL->GetSpec(); - else - url = ""; + if (nsnull != mURL) + url = mURL->GetSpec(); + else + url = ""; - //XXX target is bad. MMP - instance->URLNotify(url, "", reason, mNotifyData); + //XXX target is bad. MMP + instance->URLNotify(url, "", reason, mNotifyData); + } NS_RELEASE(instance); } diff --git a/mozilla/modules/plugin/nglsrc/ns4xPluginStream.cpp b/mozilla/modules/plugin/nglsrc/ns4xPluginStream.cpp index e60c894d753..edeb366d756 100644 --- a/mozilla/modules/plugin/nglsrc/ns4xPluginStream.cpp +++ b/mozilla/modules/plugin/nglsrc/ns4xPluginStream.cpp @@ -226,35 +226,6 @@ NS_IMETHODIMP ns4xPluginStream::AsFile(const char* filename) NS_IMETHODIMP ns4xPluginStream :: Close(void) { - const NPPluginFuncs *callbacks; - NPP npp; - void *notifydata; - - fInstance->GetCallbacks(&callbacks); - fInstance->GetNPP(&npp); - - fPeer->GetNotifyData(¬ifydata); - - nsPluginReason reason; - - fPeer->GetReason(&reason); - - if (nsnull != notifydata) - { - if (callbacks->urlnotify == NULL) - return NS_OK; - - const char *url; - - fPeer->GetURL(&url); - - CallNPP_URLNotifyProc(callbacks->urlnotify, - npp, - url, - (NPReason)reason, - notifydata); - } - return NS_OK; } diff --git a/mozilla/modules/plugin/nglsrc/nsPluginHostImpl.cpp b/mozilla/modules/plugin/nglsrc/nsPluginHostImpl.cpp index 1e85c5d5442..cdbe499a67b 100644 --- a/mozilla/modules/plugin/nglsrc/nsPluginHostImpl.cpp +++ b/mozilla/modules/plugin/nglsrc/nsPluginHostImpl.cpp @@ -544,15 +544,18 @@ NS_IMETHODIMP nsPluginStreamListener :: OnStopBinding(nsIURL* aURL, PRInt32 aSta if (nsnull != instance) { - const char *url; + if (nsnull != mNotifyData) + { + const char *url; - if (nsnull != mURL) - url = mURL->GetSpec(); - else - url = ""; + if (nsnull != mURL) + url = mURL->GetSpec(); + else + url = ""; - //XXX target is bad. MMP - instance->URLNotify(url, "", reason, mNotifyData); + //XXX target is bad. MMP + instance->URLNotify(url, "", reason, mNotifyData); + } NS_RELEASE(instance); }