Last Comment Bug 723852 - Use a runnable for canvas.mozFetchAsStream()
: Use a runnable for canvas.mozFetchAsStream()
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Canvas: 2D (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla13
Assigned To: Tim Taubert [:ttaubert] (on PTO, back Aug 29th)
:
Mentors:
Depends on:
Blocks: 720697
  Show dependency treegraph
 
Reported: 2012-02-03 01:37 PST by Tim Taubert [:ttaubert] (on PTO, back Aug 29th)
Modified: 2012-02-04 02:40 PST (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch v1 (3.42 KB, patch)
2012-02-03 02:37 PST, Tim Taubert [:ttaubert] (on PTO, back Aug 29th)
khuey: feedback-
Details | Diff | Splinter Review
patch v2 (1.62 KB, patch)
2012-02-03 05:40 PST, Tim Taubert [:ttaubert] (on PTO, back Aug 29th)
khuey: review+
Details | Diff | Splinter Review

Description Tim Taubert [:ttaubert] (on PTO, back Aug 29th) 2012-02-03 01:37:55 PST
Bug 720697 comment #12:

> >+nsHTMLCanvasElement::MozFetchAsStream(nsIInputStreamCallback *aCallback,
> 
> >+  return aCallback->OnInputStreamReady(asyncData);
> 
> It's generally a bad idea to design an API to be async-friendly, but then
> invoke the callback synchronously - people can start depending on that,
> making your life difficult when it comes time to change it in the future.
> Can you use a runnable here?
Comment 1 Tim Taubert [:ttaubert] (on PTO, back Aug 29th) 2012-02-03 02:37:59 PST
Created attachment 594102 [details] [diff] [review]
patch v1
Comment 2 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2012-02-03 03:12:46 PST
Comment on attachment 594102 [details] [diff] [review]
patch v1

Dispatching the callback on another thread is absolutely not what we want here.
Comment 3 Tim Taubert [:ttaubert] (on PTO, back Aug 29th) 2012-02-03 05:40:51 PST
Created attachment 594145 [details] [diff] [review]
patch v2

Fresh patch, using the main thread.
Comment 4 Tim Taubert [:ttaubert] (on PTO, back Aug 29th) 2012-02-03 06:24:32 PST
https://hg.mozilla.org/integration/fx-team/rev/34b3565192dc
Comment 5 Tim Taubert [:ttaubert] (on PTO, back Aug 29th) 2012-02-04 02:40:52 PST
https://hg.mozilla.org/mozilla-central/rev/34b3565192dc

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