Bug 826632. Part 3: Create nsViewManagers directly instead of using XPCOM. r=tnikkel

--HG--
extra : rebase_source : f6286a4bcffa2f80bd9d444f7c04005644b8cb2f
This commit is contained in:
Robert O'Callahan 2013-01-05 16:12:49 +13:00
parent 8eb09029ac
commit e39041c9dd
6 changed files with 4 additions and 43 deletions

View File

@ -40,7 +40,6 @@
#include "nsLayoutStylesheetCache.h"
#include "mozilla/Preferences.h"
#include "nsViewsCID.h"
#include "nsIDeviceContextSpec.h"
#include "nsViewManager.h"
#include "nsView.h"
@ -497,8 +496,6 @@ private:
//------------------------------------------------------------------
// nsDocumentViewer
//------------------------------------------------------------------
// Class IDs
static NS_DEFINE_CID(kViewManagerCID, NS_VIEW_MANAGER_CID);
//------------------------------------------------------------------
nsresult
@ -2272,14 +2269,11 @@ nsDocumentViewer::MakeWindow(const nsSize& aSize, nsView* aContainerView)
DetachFromTopLevelWidget();
}
nsresult rv;
mViewManager = do_CreateInstance(kViewManagerCID, &rv);
if (NS_FAILED(rv))
return rv;
mViewManager = new nsViewManager();
nsDeviceContext *dx = mPresContext->DeviceContext();
rv = mViewManager->Init(dx);
nsresult rv = mViewManager->Init(dx);
if (NS_FAILED(rv))
return rv;

View File

@ -72,7 +72,6 @@
#include "nsCaret.h"
#include "nsIDOMHTMLDocument.h"
#include "nsIDOMXMLDocument.h"
#include "nsViewsCID.h"
#include "nsFrameManager.h"
#include "nsEventStateManager.h"
#include "nsIMEStateManager.h"
@ -7926,8 +7925,6 @@ nsIPresShell::RemoveRefreshObserverExternal(nsARefreshObserver* aObserver,
#include "nsIURL.h"
#include "nsILinkHandler.h"
static NS_DEFINE_CID(kViewManagerCID, NS_VIEW_MANAGER_CID);
static void
LogVerifyMessage(nsIFrame* k1, nsIFrame* k2, const char* aMsg)
{
@ -8270,7 +8267,7 @@ PresShell::VerifyIncrementalReflow()
nsIWidget* parentWidget = rootView->GetWidget();
// Create a new view manager.
nsRefPtr<nsViewManager> vm = do_CreateInstance(kViewManagerCID);
nsRefPtr<nsViewManager> vm = new nsViewManager();
NS_ENSURE_TRUE(vm, false);
rv = vm->Init(dc);
NS_ENSURE_SUCCESS(rv, false);

View File

@ -66,8 +66,6 @@
#include "nsChannelPolicy.h"
// view stuff
#include "nsViewsCID.h"
#include "nsViewManager.h"
#include "nsContentCreatorFunctions.h"
// DOM includes
@ -594,8 +592,6 @@ _InstanceClass##Constructor(nsISupports *aOuter, REFNSIID aIID, \
return rv; \
} \
NS_GENERIC_FACTORY_CONSTRUCTOR(nsViewManager)
static nsresult
CreateHTMLImgElement(nsISupports* aOuter, REFNSIID aIID, void** aResult)
{
@ -755,7 +751,6 @@ NS_DEFINE_NAMED_CID(NS_JSPROTOCOLHANDLER_CID);
NS_DEFINE_NAMED_CID(NS_JSURI_CID);
NS_DEFINE_NAMED_CID(NS_WINDOWCOMMANDTABLE_CID);
NS_DEFINE_NAMED_CID(NS_WINDOWCONTROLLER_CID);
NS_DEFINE_NAMED_CID(NS_VIEW_MANAGER_CID);
NS_DEFINE_NAMED_CID(NS_PLUGINDOCLOADERFACTORY_CID);
NS_DEFINE_NAMED_CID(NS_PLUGINDOCUMENT_CID);
#ifdef MOZ_MEDIA
@ -1039,7 +1034,6 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
{ &kNS_JSURI_CID, false, NULL, nsJSURIConstructor },
{ &kNS_WINDOWCOMMANDTABLE_CID, false, NULL, CreateWindowCommandTableConstructor },
{ &kNS_WINDOWCONTROLLER_CID, false, NULL, CreateWindowControllerWithSingletonCommandTable },
{ &kNS_VIEW_MANAGER_CID, false, NULL, nsViewManagerConstructor },
{ &kNS_PLUGINDOCLOADERFACTORY_CID, false, NULL, CreateContentDLF },
{ &kNS_PLUGINDOCUMENT_CID, false, NULL, CreatePluginDocument },
#ifdef MOZ_MEDIA
@ -1189,7 +1183,6 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = {
{ CONTENT_DLF_CONTRACTID, &kNS_CONTENT_DOCUMENT_LOADER_FACTORY_CID },
{ NS_JSPROTOCOLHANDLER_CONTRACTID, &kNS_JSPROTOCOLHANDLER_CID },
{ NS_WINDOWCONTROLLER_CONTRACTID, &kNS_WINDOWCONTROLLER_CID },
{ "@mozilla.org/view-manager;1", &kNS_VIEW_MANAGER_CID },
{ PLUGIN_DLF_CONTRACTID, &kNS_PLUGINDOCLOADERFACTORY_CID },
{ NS_STYLESHEETSERVICE_CONTRACTID, &kNS_STYLESHEETSERVICE_CID },
{ TRANSFORMIIX_XSLT_PROCESSOR_CONTRACTID, &kTRANSFORMIIX_XSLT_PROCESSOR_CID },

View File

@ -87,7 +87,6 @@ static const char kPrintingPromptService[] = "@mozilla.org/embedcomp/printingpro
#include "nsLayoutUtils.h"
#include "mozilla/Preferences.h"
#include "nsViewsCID.h"
#include "nsWidgetsCID.h"
#include "nsIDeviceContextSpec.h"
#include "nsViewManager.h"
@ -216,9 +215,6 @@ protected:
bool mSuppressed;
};
// Class IDs
static NS_DEFINE_CID(kViewManagerCID, NS_VIEW_MANAGER_CID);
NS_IMPL_ISUPPORTS3(nsPrintEngine, nsIWebProgressListener,
nsISupportsWeakReference, nsIObserver)
@ -2197,8 +2193,7 @@ nsPrintEngine::ReflowPrintObject(nsPrintObject * aPO)
nsresult rv = aPO->mPresContext->Init(mPrt->mPrintDC);
NS_ENSURE_SUCCESS(rv, rv);
aPO->mViewManager = do_CreateInstance(kViewManagerCID, &rv);
NS_ENSURE_SUCCESS(rv,rv);
aPO->mViewManager = new nsViewManager();
rv = aPO->mViewManager->Init(mPrt->mPrintDC);
NS_ENSURE_SUCCESS(rv,rv);

View File

@ -15,7 +15,6 @@ MODULE = view
EXPORTS = \
nsView.h \
nsViewManager.h \
nsViewsCID.h \
nsIScrollPositionListener.h \
$(NULL)

View File

@ -1,17 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsViewsCID_h__
#define nsViewsCID_h__
#include "nsISupports.h"
#include "nsIFactory.h"
#include "nsIComponentManager.h"
#define NS_VIEW_MANAGER_CID \
{ 0xc95f1831, 0xc376, 0x11d1, \
{0xb7, 0x21, 0x0, 0x60, 0x8, 0x91, 0xd8, 0xc9}}
#endif // nsViewsCID_h__