By commenting out the code that dealt with NS_SECURE_BROWSER_UI_CONTRACTID , the 7s window startup delay went away. I don't know if it was looking for something that my .mozconfig had configured out, but I figure I don't need it . 
I also commented out the sessionhistory creation here.
This application really has no UI(status bar/menu/buttons),no need for any history, and sites visited will be very controlled. So security UI is not needed.
With these changes the Mozilla window comes up in ~2-3 s on reboot, which in comparison to ~12s is a lot better. But may still need tweaking...
 
Question: Will these changes cause any breakage?
     Could i release the app with such mods(*only stripping down*) to mozilla?
 
Thanks!
 
----------------------------------------------
ChangeDescription
File: /embedding/browser/nsWebBrowser.cpp/nsWebBrowser.cpp
NS_IMETHODIMP nsWebBrowser::Create()
{
.....
   // If the webbrowser is a content docshell item then we won't hear any
   // events from subframes. To solve that we install our own chrome event handler
   // that always gets called (even for subframes) for any bubbling event.
//  REMOVED
#if 0  
   if(!mInitInfo->sessionHistory)
      mInitInfo->sessionHistory = do_CreateInstance(NS_SHISTORY_CONTRACTID);
   NS_ENSURE_TRUE(mInitInfo->sessionHistory, NS_ERROR_FAILURE);
   mDocShellAsNav->SetSessionHistory(mInitInfo->sessionHistory);
   // Hook up global history. Do not fail if we can't - just assert.
   nsresult rv = EnableGlobalHistory(PR_TRUE);
   NS_ASSERTION(NS_SUCCEEDED(rv), "EnableGlobalHistory() failed");
#endif  

   NS_ENSURE_SUCCESS(mDocShellAsWin->Create(), NS_ERROR_FAILURE);

//  REMOVED
#if 0
   // Hook into the OnSecurirtyChange() notification for lock/unlock icon
   // updates
   nsCOMPtr<nsIDOMWindow> domWindow;
   rv = GetContentDOMWindow(getter_AddRefs(domWindow));
   if (NS_SUCCEEDED(rv))
   {
       mSecurityUI = do_CreateInstance(NS_SECURE_BROWSER_UI_CONTRACTID, &rv);
       if (NS_SUCCEEDED(rv))
       {
           mSecurityUI->Init(domWindow);
       }
   }

   mDocShellTreeOwner->AddToWatcher(); // evil twin of Remove in SetDocShell(0)
   mDocShellTreeOwner->AddChromeListeners();
#endif

   delete mInitInfo;
   mInitInfo = nsnull;

   return NS_OK;
}
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to