Closed Bug 306217 Opened 14 years ago Closed 14 years ago

nsXBLService::OnStopRequest() doesn't fire for custom protocol

Categories

(Core :: XBL, defect)

x86
Windows XP
defect
Not set

Tracking

()

RESOLVED INVALID

People

(Reporter: WeirdAl, Unassigned)

References

()

Details

(Keywords: testcase)

Attachments

(1 file)

I've constructed a new protocol handler and channel as JS-based components, and
for the most part the pair seem to work fine.  The protocol loads HTML pages,
XUL documents, etc.  But when it comes to loading a XBL binding onto a XUL
element, things get dicey.

For XBL bindings, my protocol receives calls to OnStartRequest() and
OnDataAvailable(), but not for OnStopRequest().  Because of this, the bindings
never apply, and the document essentially never finishes loading.

I'm attaching a XULRunner testcase (.tar.gz) in a few moments.
Attached file XULRunner testcase
Steps to reproduce:

(1) Use XULRunner debug build.	You need the debug console to see the results. 
(If this is unreasonable, I can add UI tinkering and make everything go into a
multiline textbox instead.)
(2) Extract the .tar.gz and execute "xulrunner verbosio\application.ini"
(3) Click the bottom button.  Button will be disabled.	When it re-enables (10
second delay), click it again.	Wait a few seconds for page to load.
Expected results:  Above the document,
http://lxr.mozilla.org/seamonkey/source/netwerk/base/public/nsIBufferedStreams.idl#18
loads, scrolled correctly.
Debug console shows onStartRequest, onDataAvailable, and onStopRequest.  The
last should have a status code of 0.
(4) Click the bottom button.
Expected results:  After a short delay, an XBL binding is applied.  
Debug console shows onStartRequest, onDataAvailable, and onStopRequest.  The
last should have a status code of 0.
(5) Click the newly-rendered button.
Expected results:  The word "Hello" is printed to the debug console.
(6) Click the bottom button.  Wait a few moments.
Expected results:  After a short delay, an XBL binding is applied.  
Debug console shows onStartRequest, onDataAvailable, and onStopRequest.  The
last should have a status code of 0.
(7) Click the newly-rendered button.
Expected results:  The number 1 is printed to the debug console.
(8) Close the window.
Expected results:  Window closes relatively cleanly.  No onStopRequest calls
appear.

Actual results:
(6) onStartRequest appears, as does onDataAvailable.  onStopRequest is missing.

(7) In debug console:
JavaScript strict warning:
virtual://chrome//verbosio/content/virtualTestHost4.xul, line 1: reference to
undefined property foo.bar
undefined
Note this testcase will likely not work until bug 304048 is fixed.
your open() method returns a nonblocking input stream. don't do that. (but I
don't know if that's the cause of your problem)
Attachment #194083 - Attachment mime type: application/octet-stream → application/x-gzip
What does this have to do with XBL?  Is the channel's OnStopRequest being
called?  If not, it's a problem in the channel impl or necko, not in XBL...
I am dumb.  Very dumb.

Adding this line to my set originalURI call fixed the stoppage:

    bufOutStream.close();

Many thanks to biesi and bz for their patience in remote debugging.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.