Closed
Bug 82415
Opened 24 years ago
Closed 24 years ago
nsIPluginStreamListener changed!
Categories
(Core Graveyard :: Plug-ins, defect, P1)
Core Graveyard
Plug-ins
Tracking
(Not tracked)
VERIFIED
FIXED
mozilla0.9.1
People
(Reporter: dougt, Assigned: peterl-bugs)
References
Details
(Whiteboard: [must have for mozilla0.9.1] [have r= & sr=] [NEED a=])
Attachments
(8 files)
2.76 KB,
text/plain
|
Details | |
16.13 KB,
patch
|
Details | Diff | Splinter Review | |
5.15 KB,
patch
|
Details | Diff | Splinter Review | |
3.32 KB,
patch
|
Details | Diff | Splinter Review | |
1.15 KB,
patch
|
Details | Diff | Splinter Review | |
17.71 KB,
patch
|
Details | Diff | Splinter Review | |
17.99 KB,
patch
|
Details | Diff | Splinter Review | |
17.22 KB,
patch
|
Details | Diff | Splinter Review |
The public interface nsIPluginStreamListener has changed! This breaks MRJ. We
need to revert this interface.
TO provent this in the future, we should add a LARGE comment in the header file
regarding the "locked down" state.
Also, take a look at the nsIPluginStreamListener.idl file. The def there is
wrong.
Reporter | ||
Updated•24 years ago
|
Comment 1•24 years ago
|
||
If this is easy, let's do it for 0.9.1. But if it's not, we'd consider backing
out the change and allowing byte range plugins to be broken. -- Phil & PDT.
Comment 2•24 years ago
|
||
This should be simple to fix.
1) Create a new interface with the extra argument in the signature for ODA
2) Hook it all up
3) Back out MRJ changes
Doug, let me know if there is anything else. I'm pulling a fresh tree to set
this up. Mozilla 0.9.1 can't go out the door like this.
Status: NEW → ASSIGNED
OS: Linux → All
Priority: -- → P1
Hardware: PC → All
Whiteboard: [must have for mozilla0.9.1]
Comment 3•24 years ago
|
||
Comment 4•24 years ago
|
||
Comment 5•24 years ago
|
||
Note: You'll ALSO have to use these commands to back out changes in MRJ:
cvs update -j1.6 -j1.5 mozilla/plugin/oji/MRJ/plugin/Source/nsLiveConnect.h
cvs update -j1.5 -j1.4 mozilla/plugin/oji/MRJ/plugin/Source/nsLiveConnect.cpp
cvs update -j1.13 -j1.12 mozilla/plugin/oji/MRJ/plugin/Source/MRJPlugin.h
cvs update -j1.32 -j1.31 mozilla/plugin/oji/MRJ/plugin/Source/MRJPlugin.cpp
cvs update -j1.4 -j1.3 mozilla/plugin/oji/MRJ/plugin/Source/JSEvaluator.h
cvs update -j1.4 -j1.3 mozilla/plugin/oji/MRJ/plugin/Source/JSEvaluator.cpp
To verify this patch did the trick, the MRJ should compile as it did before
DougT's changes.
Comment 6•24 years ago
|
||
Comment 7•24 years ago
|
||
Comment 8•24 years ago
|
||
I tested these patches on the Mac, and doing a complete debug build.
Keywords: patch
Whiteboard: [must have for mozilla0.9.1] → [must have for mozilla0.9.1] [seeking review]
Comment 9•24 years ago
|
||
Reporter | ||
Comment 10•24 years ago
|
||
It is too bad that we have to add a new interface plugin interface. Would it
not be cleaner to just QI'ing the nsIInputStream to some interface that give you
absolute offset positioning?
Since this is needed for 0.9.1 I guess it doesn't matter too much; Couple of
things with the attached patches:
npsimple is part of the 'nix builds.
Add a comment in the header file where you declare the new OnDataAvailable()
call stating that this is part of the nsIPluginStreamListener2 interface.
is the new code for the old ns4xPluginStreamListener::OnDataAvailable exactly
the same prior to my changes?
Comment 11•24 years ago
|
||
Doug, I don't quite see what you mean with using nsInputStream?
And yes, ns4xPluginStreamListener::OnDataAvailable (3) is exactly the same as
before your patch. I was trying to have both ODA call the same code but ran into
some weird problems so I figured going back to what was there before woudln't
hurt.
Beard, can you review these patches as well, especially the ones to the MRJ.
Reporter | ||
Comment 12•24 years ago
|
||
Creating a new implementation behind the nsIInputStream which can be QI'ed to an
interface which can return the absolute position for the current read is cleaner
than adding a new plugin interface.
The reason that this is a cleaner approach is that we do not have to change the
signatures of any public interfaces. Basically, anyone can simply QI the
nsIInputStream parameter of OnDataA for an interface which returns absolute file
positioning.
So, something like:
NS_IMETHODIMP
ns4xPluginStreamListener::OnDataAvailable(nsIPluginStreamInfo* pluginInfo,
nsIInputStream* input,
PRUint32 length)
{
...
// check to see if the input has an absolute offset
nsCOMPtr<nsIByteRangeRequest> brr(do_QueryInterface(input));
if (brr)
brr->GetStartRange(&absoluteOffset);
// use absoluteOffset as needed.
...
Comment 13•24 years ago
|
||
The next attached patch (made from modules/plugin) is ready to go. This patch
actually makes RequestReads work! Here are some testcase from another bug:
http://access.adobe.com/browser/netscape/readtesting/gotopage5.pdf
http://access.adobe.com/browser/netscape/readtesting/starr.pdf
Issues:
=======
I like DougT's suggestion as it is much cleaner, but the mozilla 0.9.1 train is
about to leave and this can't afford to miss it. I'll open another bug after
this is checked in to track this issue.
Sean's check-in last week of a bug to fix a leak actually broke RequestReads
because the stream was being destroyed too early. I've added an extra AddReff to
the stream peer, if and only if, the stream is a byte range. The problem is that
I'm not quite sure where I'm able to release it. I needs to change something so
that a reference is kept to the stream peer in the instance (or instance
peer) and then I can call release when the instance goes away. I'll open a new
bug on that. But for now, I'd like to get in what I have.
Comment 14•24 years ago
|
||
Reporter | ||
Comment 15•24 years ago
|
||
Two nits:
Let put a comment in the nsIPluginStreamListener2 IDL stating that this
interface is for internal use and plugin developer should not use it.
Comment the heck out of that addref in RequestRead. It is going to bite someone
if you don't.
Also, did you figure out the place where you can do a release on that extra
addref in RequestRead? Can you do it when a non-segmented ranges come in
(0-2,1-3)? If not, how much will we leak?
Comment 16•24 years ago
|
||
I've opened [Bug 83183] nsPluginStreamListenerPeer is leaked for Byte Range
requests to deal with the leak. I think the plugin instance my need to keep
around a ref to the stream peer to the stream will get destroyed then the
instance goes away. Av?
Also opened Bugzilla Bug 83186 nsIPluginStreamListener2 should be removed to
address DougT's comments.
Updated patch with Marc's and Doug's latest comments coming. If that patch is
okay with you guys, can I get a sr/r stamp in the bug for approvals?
Thanks!
Comment 17•24 years ago
|
||
Reporter | ||
Comment 18•24 years ago
|
||
r=
Comment 19•24 years ago
|
||
sr=attinasi for a slightly improved patch I saw on Peter's machine. Peter, you
might just want to attach the new patch (it allows QI to both the old and new
interfaces).
Comment 20•24 years ago
|
||
Updated•24 years ago
|
Whiteboard: [must have for mozilla0.9.1] [seeking review] → [must have for mozilla0.9.1] [have r= & sr=] [NEED a=]
Comment 21•24 years ago
|
||
PDT: I know it looks like a lot of code is being added to
ns4xPluginStreamListener::OnDataAvailable, but I'm just reverting ODA back to
exactly what it was before.
Reporter | ||
Comment 22•24 years ago
|
||
Just a little more clarity: There are TWO onDataAvailable calls defined in this
file. The existing one allows for an absolute byte position. The one Peter has
added in his patch is EXACTLY the same as the ODA priot to my hacking. Net
result is both of these functions have been review, super reviewed, and tested.
a=dbaron for 0.9.1.
One thing I noticed while looking at it, though:
---
@@ -670,11 +790,11 @@
if(stream == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(stream); // Stabilize
- nsresult res = stream->QueryInterface(kIPluginStreamListenerIID,
(void**)listener);
+ nsresult res = stream->QueryInterface(kIPluginStreamListener2IID,
(void**)listener);
// Destabilize and avoid leaks.
// Avoid calling delete <interface pointer>
NS_RELEASE(stream);
---
Why did you change the IID used without changing the type of |listener|? These
should always be the same. (Yes, I know nsIPluginStreamListener2 inherits from
nsIPluginStreamListener, but it still seems evil even though it happens to work.)
Comment 24•24 years ago
|
||
Patchs checked in, marking FIXED.
I took David Baron's suggestion and changed the QI line back to what it was.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Comment 25•24 years ago
|
||
verif that the patch was checked in. Marking as such.
Status: RESOLVED → VERIFIED
Updated•3 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•