Thanks for the heads up that a rewrite is pending. I look forward to seeing the first iteration, but will consider submitting a patch if the current Account Manager gets much more popular.
Thanks!
- Don
From:
mozilla-labs-o...@googlegroups.com
[mailto:mozilla-labs-o...@googlegroups.com] On Behalf Of Dan
Mills
Sent: Tuesday, May 18, 2010 9:30 PM
To: mozilla-labs-o...@googlegroups.com
Subject: Re: Account Manager threading badness
I suspect changes will be
nontrivial, and we are going to be rewriting Account Manager soon anyway, so
spending a ton of time on the add-on is wasted time we could be spending on the
rewrite.
However, patches are welcome. I volunteer to review any that get
attached to that bug :)Â Ideally the fix goes into resource.js and makes
available an async interface, or otherwise minimally changes the resource.js
api.
Dan
On Tue, May 18, 2010 at 2:29 PM, donaddon <don.sc@verizon.net> wrote:
I know a bug has been entered, but I don't know who
prioritizes these,
and that implementation is trouble. Â Â It's already causing mysterious
problems and conflicts and I think it's going to cause many more if
the add-on gains popularity. Â Can we get that bug escalated?
Thanks!
 - Don
On May 6, 2:36Â pm, Dan Mills <thun...@mozilla.com>
wrote:
> I filed a bug:
>
> https://bugzilla.mozilla.org/show_bug.cgi?id=564295
>
> Feel free to add more info there; I also linked to this thread.
>
> Dan
>
> On Thu, May 6, 2010 at 2:35 PM, Mike Hanson <mhan...@mozilla.com> wrote:
> > Dan: Are we still using the Weave product/Identity component to track
bugs?
>
> > (That would behttps://bugzilla.mozilla.org/enter_bug.cgi?full=1then
> > click "Weave" and choose the
"Identity" component)
>
> > -m
>
> > On May 6, 2010, at 2:25 PM, donaddon wrote:
>
> > > I've got a repro. Â Is there a public bug database? Â Here are the
> > > steps:
>
> > > 1. Install the account manager.
> > > 2. Run the script below in a protected chrome context. Â You can run it
> > > directly in the browser.xul context using the extension
developer
> > > extension / javascript shell / enumerateWindows / browser.xul
context.
> > > 3. With the account manager disabled, the script is harmless,
with it
> > > enabled, you will get a whole bunch of tabs opened.
> > > 4. You have to restart the browser every time to reproduce:
>
> > > // The otherwise harmless script
> > > var testUrls = [
> > > Â Â Â "http://www.urlpass.com/",
> > > Â Â Â "http://www.polldaddy.com/",
> > > Â Â Â "http://www.communityspark.com/dont-lose-existing-members-of-your-
> > > online-community/",
> > > Â Â Â "http://www.maps.google.com/",
> > > Â Â Â "http://www.yahoo.com/",
> > > Â Â Â "http://us.mcafee.com/root/speedometer/default.asp",
> > > Â Â Â "http://www22.verizon.com/content/verizonglobalhome/
> > > ghp_landing.aspx",
> > > Â Â Â "http://www.bandwidthplace.com/",
> > > Â Â Â "http://fisherbikes.com/",
> > > Â Â Â "http://www.trekbikes.com/us/en/",
> > > Â Â Â "http://www.konaworld.com/"
> > > ]
>
> > > function troubleLoop() {
> > > Â Â Â var nextUrl = function(iUrl) {
> > > Â Â Â Â Â Â Â if(iUrl
== testUrls.length)
> > > Â Â Â Â Â Â Â {
> > > Â Â Â Â Â Â Â Â
   alert("done!");
> > > Â Â Â Â Â Â Â Â
   return;
> > > Â Â Â Â Â Â Â }
>
> > > Â Â Â Â Â Â Â //
Remove the current browser if it exists
> > > Â Â Â Â Â Â Â var
browser = document.getElementById("theBrowser22");
> > > Â Â Â Â Â Â Â
if(browser)
> > > Â Â Â Â Â Â Â {
>
> >
document.getElementById("main-window").removeChild(browser);
> > > Â Â Â Â Â Â Â }
> > > Â Â Â Â Â Â Â browser
= document.createElement("browser");
> > > Â Â Â Â Â Â Â
browser.setAttribute("id", "theBrowser22");
> > > Â Â Â Â Â Â Â
browser.setAttribute("type", "content");
> > > Â Â Â Â Â Â Â
browser.setAttribute("src", testUrls[iUrl]);
> > > Â Â Â Â Â Â Â
browser.setAttribute("style",
> > > "visibility:hidden;overflow:auto;border:0px solid
black;background-
> > > color:white;width:0px;height:0px;");
>
> >
document.getElementById("main-window").appendChild(browser);
>
> > > Â Â Â Â Â Â Â
window.setTimeout(function() { nextUrl(iUrl+1); }, 200);
> > > Â Â Â }
> > > Â Â Â nextUrl(0);
> > > }
>
> > > troubleLoop();
>
> > > On May 6, 1:14 pm, donaddon <dons...@hotmail.com> wrote:
> > >> Hello,
>
> > >> I've been running into a variety of problems caused by the
Account
> > >> Manager extension. Â I traced them back to the synchronous emulation
> > >> routine that uses Thread.processNextEvent.
>
> > >> This is causing re-entrancy in all kinds of code that might
not expect
> > >> it. Â Badness ensues. Â Here's an example:
>
> > >> 1. I have an extension installed that calls removeChild on a
<browser>
> > >> element. Â This may happen before the browser element has finished
> > >> loading (in this case it's an invisible browser element for
background
> > >> loading).
> > >> 2. This results in an nsIWebProgressListener
onChangeState(STATE_STOP)
> > >> event being generated.
> > >> 3. The Account Manager handles this event and goes into one
of these
> > >> Sync wait states while trying to update realm information.
> > >> 4. The hidden browser's nsDocShell is only partially torn
down and the
> > >> request has not yet been cancelled. Â And since we are still processing
> > >> code, the hidden browser element's load operation may complete.
> > >> 5. The URI Loader asks the hidden nsDocShell to handle the
content,
> > >> but because of its partially torn-down state it decides not
to, and
> > >> instead a higher-level content listener handles the event.
> > >> 6. The higher level content listener decides to create a new
tab to
> > >> display the content.
>
> > >> End Result: Â Suprious tabs start showing up while you are using the