зеркало из https://github.com/mozilla/pjs.git
Partial fix for 66020: /r=valeski; /sr=alecf
This commit is contained in:
Родитель
00eb0db383
Коммит
2ab7b9f9d0
|
@ -39,6 +39,8 @@
|
|||
#include "nsIWebShellServices.h"
|
||||
#include "nsIStringCharsetDetector.h"
|
||||
#include "nsIGenericFactory.h"
|
||||
#include "nsIAppStartupNotifier.h"
|
||||
#include "nsICategoryManager.h"
|
||||
#include "nsMetaCharsetObserver.h"
|
||||
#include "nsXMLEncodingObserver.h"
|
||||
#include "nsDetectionAdaptor.h"
|
||||
|
@ -110,6 +112,24 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(ns2ndBlkDbgDetector);
|
|||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsLastBlkDbgDetector);
|
||||
#endif /* INCLUDE_DBGDETECTOR */
|
||||
|
||||
static NS_METHOD nsMetaCharsetObserverRegistrationProc(nsIComponentManager *aCompMgr,
|
||||
nsIFile *aPath,
|
||||
const char *registryLocation,
|
||||
const char *componentType,
|
||||
const nsModuleComponentInfo *info)
|
||||
{
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsICategoryManager>
|
||||
categoryManager(do_GetService("@mozilla.org/categorymanager;1", &rv));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = categoryManager->AddCategoryEntry(APPSTARTUP_CATEGORY, "Meta Charset",
|
||||
"service," NS_META_CHARSET_CONTRACTID,
|
||||
PR_TRUE, PR_TRUE,
|
||||
nsnull);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
static NS_METHOD nsDetectionAdaptorRegistrationProc(nsIComponentManager *aCompMgr,
|
||||
nsIFile *aPath,
|
||||
const char *registryLocation,
|
||||
|
@ -377,7 +397,7 @@ static nsModuleComponentInfo components[] =
|
|||
{
|
||||
{ "Meta Charset", NS_META_CHARSET_CID,
|
||||
NS_META_CHARSET_CONTRACTID, nsMetaCharsetObserverConstructor,
|
||||
NULL, NULL},
|
||||
nsMetaCharsetObserverRegistrationProc, NULL},
|
||||
{ "Document Charset Info", NS_DOCUMENTCHARSETINFO_CID,
|
||||
NS_DOCUMENTCHARSETINFO_CONTRACTID, nsDocumentCharsetInfoConstructor,
|
||||
NULL, NULL},
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "nsISupports.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsIParser.h"
|
||||
#include "nsIAppStartupNotifier.h"
|
||||
#include "pratom.h"
|
||||
#include "nsCharDetDll.h"
|
||||
#include "nsIServiceManager.h"
|
||||
|
@ -256,10 +257,17 @@ NS_IMETHODIMP nsMetaCharsetObserver::Notify(
|
|||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
NS_IMETHODIMP nsMetaCharsetObserver::Observe(nsISupports*, const PRUnichar*, const PRUnichar*)
|
||||
NS_IMETHODIMP nsMetaCharsetObserver::Observe(nsISupports *aSubject,
|
||||
const PRUnichar *aTopic,
|
||||
const PRUnichar *aData)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
nsresult rv = NS_OK;
|
||||
nsLiteralString aTopicString(aTopic);
|
||||
if (aTopicString.Equals(NS_LITERAL_STRING(APPSTARTUP_CATEGORY))) //"app_startup"
|
||||
rv = Start();
|
||||
return rv;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
NS_IMETHODIMP nsMetaCharsetObserver::Start()
|
||||
{
|
||||
|
|
|
@ -65,9 +65,6 @@
|
|||
|
||||
#include "nsIDOMHTMLSelectElement.h"
|
||||
|
||||
// Charset converter
|
||||
#include "nsMetaCharsetCID.h"
|
||||
#include "nsIMetaCharsetService.h"
|
||||
|
||||
// new widget stuff
|
||||
#ifdef USE_LOCAL_WIDGETS
|
||||
|
@ -113,9 +110,6 @@ static NS_DEFINE_IID(kIPrefIID, NS_IPREF_IID);
|
|||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
static NS_DEFINE_IID(kIXPBaseWindowIID, NS_IXPBASE_WINDOW_IID);
|
||||
|
||||
static NS_DEFINE_IID(kMetaCharsetCID, NS_META_CHARSET_CID);
|
||||
static NS_DEFINE_IID(kIMetaCharsetServiceIID, NS_IMETA_CHARSET_SERVICE_IID);
|
||||
|
||||
static NS_DEFINE_CID(kFormProcessorCID, NS_FORMPROCESSOR_CID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLSelectElementIID, NS_IDOMHTMLSELECTELEMENT_IID);
|
||||
|
||||
|
@ -179,8 +173,6 @@ nsViewerApp::QueryInterface(REFNSIID aIID, void** aInstancePtrResult)
|
|||
void
|
||||
nsViewerApp::Destroy()
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
// Close all of our windows
|
||||
nsBrowserWindow::CloseAllWindows();
|
||||
|
||||
|
@ -191,11 +183,6 @@ nsViewerApp::Destroy()
|
|||
NS_RELEASE(mCrawler);
|
||||
}
|
||||
|
||||
NS_WITH_SERVICE(nsIMetaCharsetService, metacharset, kMetaCharsetCID, &rv);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = metacharset->End();
|
||||
}
|
||||
|
||||
if (nsnull != mPrefs) {
|
||||
mPrefs->ShutDown();
|
||||
NS_RELEASE(mPrefs);
|
||||
|
@ -266,11 +253,6 @@ nsViewerApp::SetupRegistry()
|
|||
|
||||
NS_SetupRegistry();
|
||||
|
||||
NS_WITH_SERVICE(nsIMetaCharsetService, metacharset, kMetaCharsetCID, &rv);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = metacharset->Start();
|
||||
}
|
||||
|
||||
// Register our browser window factory
|
||||
nsIFactory* bwf;
|
||||
NS_NewXPBaseWindowFactory(&bwf);
|
||||
|
|
|
@ -55,9 +55,6 @@
|
|||
#include "nsWidgetsCID.h"
|
||||
#include "nsIRequestObserver.h"
|
||||
|
||||
#include "nsMetaCharsetCID.h"
|
||||
#include "nsIMetaCharsetService.h"
|
||||
|
||||
/* For implementing GetHiddenWindowAndJSContext */
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
#include "jsapi.h"
|
||||
|
@ -68,7 +65,6 @@
|
|||
static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
|
||||
static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
|
||||
static NS_DEFINE_CID(kWindowMediatorCID, NS_WINDOWMEDIATOR_CID);
|
||||
static NS_DEFINE_CID(kMetaCharsetCID, NS_META_CHARSET_CID);
|
||||
static NS_DEFINE_CID(kXPConnectCID, NS_XPCONNECT_CID);
|
||||
|
||||
// copied from nsEventQueue.cpp
|
||||
|
@ -136,22 +132,12 @@ nsAppShellService::Initialize( nsICmdLineService *aCmdLineService,
|
|||
mSplashScreen = do_QueryInterface( aNativeAppSupportOrSplashScreen );
|
||||
}
|
||||
|
||||
NS_WITH_SERVICE(nsIMetaCharsetService, metacharset, kMetaCharsetCID, &rv);
|
||||
if(NS_FAILED(rv)) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
// Create the toplevel window list...
|
||||
rv = NS_NewISupportsArray(getter_AddRefs(mWindowList));
|
||||
if (NS_FAILED(rv)) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
rv = metacharset->Start();
|
||||
if(NS_FAILED(rv)) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
// Create widget application shell
|
||||
rv = nsComponentManager::CreateInstance(kAppShellCID, nsnull,
|
||||
NS_GET_IID(nsIAppShell),
|
||||
|
|
Загрузка…
Ссылка в новой задаче