Last Comment Bug 758227 - NPAPI plugin stream decomtamination: nsIPluginStreamInfo
: NPAPI plugin stream decomtamination: nsIPluginStreamInfo
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Plug-ins (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla16
Assigned To: Josh Aas
:
Mentors:
Depends on: 758224
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-24 08:14 PDT by Josh Aas
Modified: 2012-06-06 08:47 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
fix v1.0 (30.95 KB, patch)
2012-05-24 08:14 PDT, Josh Aas
benjamin: review+
Details | Diff | Splinter Review
fix v1.1 (30.87 KB, patch)
2012-06-04 09:05 PDT, Josh Aas
no flags Details | Diff | Splinter Review

Description Josh Aas 2012-05-24 08:14:40 PDT
Created attachment 626814 [details] [diff] [review]
fix v1.0

nsIPluginStreamInfo is unnecessary and its implementation contributes quite a bit to the complexity of our stream handling.

This patch depends on the fix in bug 758224 - without it this patch will cause a double-free crash.
Comment 1 Benjamin Smedberg [:bsmedberg] 2012-06-04 07:07:34 PDT
Comment on attachment 626814 [details] [diff] [review]
fix v1.0

>diff --git a/dom/plugins/base/nsNPAPIPlugin.cpp b/dom/plugins/base/nsNPAPIPlugin.cpp

>-  nsPluginStreamListenerPeer* peer = listener->GetStreamListenerPeer();
>-  if (!peer)
>+  nsIStreamListener* streamListener = static_cast<nsIStreamListener*>(listener->GetStreamListenerPeer());
>+  if (!streamListener) {
>     return NPERR_GENERIC_ERROR;

Why is the static_cast necessary? It looks like it should be an automatic downcast and is a bit confusing. Please remove.

>-
>-  *aRetainedPeer = (nsISupports*) peer;
>+  }
>+
>+  *aRetainedPeer = static_cast<nsISupports*>(streamListener);

Also unnecessary here.
Comment 2 Josh Aas 2012-06-04 09:05:46 PDT
Created attachment 629795 [details] [diff] [review]
fix v1.1

Try server run:

https://tbpl.mozilla.org/?tree=Try&rev=1a64bb0c5665
Comment 3 Josh Aas 2012-06-04 13:34:35 PDT
Problems with Android try server runs, here is an Android-only retry:

https://tbpl.mozilla.org/?tree=Try&rev=49f978ba6959
Comment 4 Josh Aas 2012-06-05 06:59:42 PDT
pushed to mozilla-inbound:

http://hg.mozilla.org/integration/mozilla-inbound/rev/8dd2e853993e
Comment 5 Ed Morley [:emorley] 2012-06-06 08:47:12 PDT
https://hg.mozilla.org/mozilla-central/rev/8dd2e853993e

Note You need to log in before you can comment on or make changes to this bug.