mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 04:58:00 +00:00
Fix for propigating stream destruction reason code to NPP_DestroyStream bug 115119 r=av sr=attinasi
This commit is contained in:
parent
520794cff3
commit
45263bb992
@ -120,7 +120,7 @@ ns4xPluginStreamListener::~ns4xPluginStreamListener(void)
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
nsresult ns4xPluginStreamListener::CleanUpStream()
|
||||
nsresult ns4xPluginStreamListener::CleanUpStream(NPReason reason)
|
||||
{
|
||||
if(!mStreamStarted || mStreamCleanedUp)
|
||||
return NS_OK;
|
||||
@ -141,18 +141,17 @@ nsresult ns4xPluginStreamListener::CleanUpStream()
|
||||
|
||||
if (callbacks->destroystream != NULL)
|
||||
{
|
||||
// XXX need to convert status to NPReason
|
||||
PRLibrary* lib = nsnull;
|
||||
lib = mInst->fLibrary;
|
||||
|
||||
NS_TRY_SAFE_CALL_RETURN(error, CallNPP_DestroyStreamProc(callbacks->destroystream,
|
||||
npp,
|
||||
&mNPStream,
|
||||
NPRES_DONE), lib);
|
||||
reason), lib);
|
||||
|
||||
NPP_PLUGIN_LOG(PLUGIN_LOG_NORMAL,
|
||||
("NPP DestroyStream called: this=%p, npp=%p, return=%d, url=%s\n",
|
||||
this, npp, error, mNPStream.url));
|
||||
("NPP DestroyStream called: this=%p, npp=%p, reason=%d, return=%d, url=%s\n",
|
||||
this, npp, reason, error, mNPStream.url));
|
||||
|
||||
if(error != NPERR_NO_ERROR)
|
||||
return NS_ERROR_FAILURE;
|
||||
@ -607,7 +606,7 @@ ns4xPluginStreamListener::OnStopBinding(nsIPluginStreamInfo* pluginInfo,
|
||||
// see bug 91140
|
||||
nsresult rv = NS_OK;
|
||||
if(mStreamType != nsPluginStreamType_Seek)
|
||||
rv = CleanUpStream();
|
||||
rv = CleanUpStream(NPRES_DONE);
|
||||
|
||||
if(rv != NPERR_NO_ERROR)
|
||||
return NS_ERROR_FAILURE;
|
||||
@ -771,7 +770,7 @@ NS_IMETHODIMP ns4xPluginInstance::Stop(void)
|
||||
// clean up open streams
|
||||
for(nsInstanceStream *is = mStreams; is != nsnull;) {
|
||||
if(is->mPluginStreamListener)
|
||||
is->mPluginStreamListener->CleanUpStream();
|
||||
is->mPluginStreamListener->CleanUpStream(NPRES_USER_BREAK);
|
||||
|
||||
nsInstanceStream *next = is->mNext;
|
||||
delete is;
|
||||
|
@ -63,7 +63,7 @@ public:
|
||||
ns4xPluginStreamListener(nsIPluginInstance* inst, void* notifyData);
|
||||
virtual ~ns4xPluginStreamListener();
|
||||
PRBool IsStarted();
|
||||
nsresult CleanUpStream();
|
||||
nsresult CleanUpStream(NPReason reason);
|
||||
|
||||
protected:
|
||||
void* mNotifyData;
|
||||
|
Loading…
x
Reference in New Issue
Block a user