Closed Bug 634176 Opened 13 years ago Closed 13 years ago

LoginManager child script does not need to use WebProgressListener

Categories

(Firefox for Android Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mfinkle, Assigned: mfinkle)

Details

(Keywords: perf, Whiteboard: [has-patch])

Attachments

(1 file, 1 obsolete file)

Attached patch patch (obsolete) — Splinter Review
Historically, the LoginManager XPCOM component used a WebProgressListener (WPL) to be able to listen for page loads, from session history. It did this globally using the docloader service and also used the listener to attach the DOMContentLoaded event.

http://mxr.mozilla.org/mozilla-central/source/toolkit/components/passwordmgr/src/nsLoginManager.js#177
http://mxr.mozilla.org/mozilla-central/source/toolkit/components/passwordmgr/src/nsLoginManager.js#303

When we ported to e10s, we kept the WPL, but used the local docShell / webProgress instance and not the global docloader. We no longer needed to use the listener to attach the DOMContentLoaded event either. The only reason we used the listener in e10s was for listening for pages loaded from session history (back button).

We can do that using pageshow, instead of DOMContentLoaded, at the cost of being slightly later in handling the password auto-fill. "pageshow" fires slightly later than "DOMContentLoaded"

But removing the WPL is worth the small cost. WPL implemented in JS have been shown to slow pageloads.

This patch simply removes the WPL and uses "pageshow" event to handle the new pageloads and session history pageloads.
Attachment #512399 - Flags: review?(wjohnston)
Comment on attachment 512399 [details] [diff] [review]
patch

More eyes is better. And I will make some browser-chrome tests for this in m-b.
Attachment #512399 - Flags: review?(21)
There is a few things I don't understand in the code you remove, I understand the need to use a WPL for pages already in the cache, but I wonder why this code path is checking the "remember" flag and not the traditional pageshow (previously DOMContentLoaded)?
  if (!this._pwmgr._remember)
    return;

(Same question for the check for an HTML Document)
(In reply to comment #2)
> There is a few things I don't understand in the code you remove, I understand
> the need to use a WPL for pages already in the cache, but I wonder why this
> code path is checking the "remember" flag and not the traditional pageshow
> (previously DOMContentLoaded)?
>   if (!this._pwmgr._remember)
>     return;
> 
> (Same question for the check for an HTML Document)

Thats easy to answer. It's a bug from when we ported the code to e10s. Previously, the WPL was used to attach the DOMContentLoaded event, which means both of those tests (rememeber and HTMLDocument) had to pass before we attached the event.

We need to add those checks back into our code, regardless of my changes.
(In reply to comment #3)
> (In reply to comment #2)
> > There is a few things I don't understand in the code you remove, I understand
> > the need to use a WPL for pages already in the cache, but I wonder why this
> > code path is checking the "remember" flag and not the traditional pageshow
> > (previously DOMContentLoaded)?
> >   if (!this._pwmgr._remember)
> >     return;
> > 
> > (Same question for the check for an HTML Document)
> 
> Thats easy to answer. It's a bug from when we ported the code to e10s.
> Previously, the WPL was used to attach the DOMContentLoaded event, which means
> both of those tests (rememeber and HTMLDocument) had to pass before we attached
> the event.
> 
> We need to add those checks back into our code, regardless of my changes.

Does it mean you're going to update your patch here?
(In reply to comment #4)

> > We need to add those checks back into our code, regardless of my changes.
> 
> Does it mean you're going to update your patch here?

Yeah
Summary: LoginManager child script does not need to use WebProgressListsner → LoginManager child script does not need to use WebProgressListener
Keywords: perf
OS: Linux → All
Hardware: x86_64 → All
Whiteboard: [has-patch]
Attached patch patch 2Splinter Review
Same as last patch, but I add 2 checks in the pageshow handler
Assignee: nobody → mark.finkle
Attachment #512399 - Attachment is obsolete: true
Attachment #512673 - Flags: review?(21)
Attachment #512399 - Flags: review?(wjohnston)
Attachment #512399 - Flags: review?(21)
pushed:
http://hg.mozilla.org/mobile-browser/rev/f8ff4f26700f
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: