Hi All,

I wanted to study the basic performance of firefox loading a page.  I
want to exclude network noise and disk access overhead.  So what I
basically did was to load a page in online mode, so that all the
resources will be in the browser cache (I enabled memory cache and
disabled disk cache), and switched to offline mode, and issued a
reload.  But seems like reload didn't really go through the processing
stack from parsing, construction DOM tree, reflow and paint.  I made
all changes in browser.js.  The code I added is as follows:

function instrumentPageLoad(event) {
        if (event.originalTarget instanceof HTMLDocument)
        {
                var doc = event.originalTarget; // doc is document that 
triggered
the event
                var win = doc.defaultView; // win is the window for the doc

                if (win != win.top) return; //only top window

                        var ioService = Services.io;
                        if (!ioService.offline)
                        {
                                BrowserOffline.toggleOfflineStatus();

                                const reloadFlags = 
nsIWebNavigation.LOAD_FLAGS_NONE;
                                var webNav = getWebNavigation();
                                webNav.reload(reloadFlags);
                        }
                        else
                        {
                                BrowserOffline.toggleOfflineStatus();

                                // close command
                                self.close();
                        }

        }
}

window.addEventListener("load", function () {
  gBrowser.addEventListener("load", instrumentPageLoad, true);
}, false);

Any suggestions on this?  I guess I have to play with the reload
flags?  I also tried the following to do reload:

gBrowser.loadURIWithFlags(doc.location.href,
 
nsIWebNavigation.LOAD_FLAGS_FIRST_LOAD,
                                  null, null, null);
But still didn't work.

Any suggestions will be appreciated!

Thanks,
Yuhao
_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout

Reply via email to