2007-03-22 10:30:00 -07:00
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is the Mozilla platform.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Benjamin Smedberg <benjamin@smedbergs.us>.
|
|
|
|
*
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2006
|
|
|
|
* the Mozilla Foundation <http://www.mozilla.org/>. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
|
|
|
#include "nsLayoutStatics.h"
|
|
|
|
#include "nscore.h"
|
|
|
|
|
|
|
|
#include "nsAttrValue.h"
|
|
|
|
#include "nsAutoCopyListener.h"
|
|
|
|
#include "nsColorNames.h"
|
|
|
|
#include "nsComputedDOMStyle.h"
|
|
|
|
#include "nsContentDLF.h"
|
|
|
|
#include "nsContentUtils.h"
|
|
|
|
#include "nsCSSAnonBoxes.h"
|
|
|
|
#include "nsCSSFrameConstructor.h"
|
|
|
|
#include "nsCSSKeywords.h"
|
2010-03-02 12:59:32 -08:00
|
|
|
#include "nsCSSParser.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsCSSProps.h"
|
|
|
|
#include "nsCSSPseudoClasses.h"
|
|
|
|
#include "nsCSSPseudoElements.h"
|
|
|
|
#include "nsCSSRendering.h"
|
|
|
|
#include "nsCSSScanner.h"
|
|
|
|
#include "nsICSSStyleSheet.h"
|
|
|
|
#include "nsDOMAttribute.h"
|
|
|
|
#include "nsDOMClassInfo.h"
|
|
|
|
#include "nsEventListenerManager.h"
|
|
|
|
#include "nsFrame.h"
|
|
|
|
#include "nsGenericElement.h" // for nsDOMEventRTTearoff
|
|
|
|
#include "nsGlobalWindow.h"
|
|
|
|
#include "nsGkAtoms.h"
|
|
|
|
#include "nsImageFrame.h"
|
|
|
|
#include "nsLayoutStylesheetCache.h"
|
|
|
|
#include "nsNodeInfo.h"
|
|
|
|
#include "nsRange.h"
|
2009-09-09 18:22:03 -07:00
|
|
|
#include "nsRegion.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsRepeatService.h"
|
2009-01-04 16:39:54 -08:00
|
|
|
#include "nsFloatManager.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsSprocketLayout.h"
|
|
|
|
#include "nsStackLayout.h"
|
|
|
|
#include "nsStyleSet.h"
|
|
|
|
#include "nsTextControlFrame.h"
|
|
|
|
#include "nsXBLWindowKeyHandler.h"
|
|
|
|
#include "txMozillaXSLTProcessor.h"
|
|
|
|
#include "nsDOMStorage.h"
|
|
|
|
#include "nsCellMap.h"
|
2007-05-09 15:02:29 -07:00
|
|
|
#include "nsTextFrameTextRunCache.h"
|
2007-05-10 13:21:12 -07:00
|
|
|
#include "nsCCUncollectableMarker.h"
|
2007-07-02 16:36:59 -07:00
|
|
|
#include "nsTextFragment.h"
|
2007-11-19 12:08:20 -08:00
|
|
|
#include "nsCSSRuleProcessor.h"
|
2008-01-29 22:35:33 -08:00
|
|
|
#include "nsXMLHttpRequest.h"
|
2008-08-16 18:25:01 -07:00
|
|
|
#include "nsDOMThreadService.h"
|
2008-11-07 15:00:26 -08:00
|
|
|
#include "nsHTMLDNSPrefetch.h"
|
2009-06-28 15:44:22 -07:00
|
|
|
#include "nsHtml5Module.h"
|
2009-05-20 16:07:18 -07:00
|
|
|
#include "nsCrossSiteListenerProxy.h"
|
Bug 178324, refactor focus by moving all focus handling into one place and simplifying it, add many tests, fixes many other bugs too numerous to mention in this small checkin comment, r=josh,smichaud,ere,dbaron,marco,neil,gavin,smaug,sr=smaug (CLOSED TREE)
2009-06-10 11:00:39 -07:00
|
|
|
#include "nsFocusManager.h"
|
2009-07-28 05:51:09 -07:00
|
|
|
#include "nsFrameList.h"
|
2009-08-08 15:00:26 -07:00
|
|
|
#include "nsListControlFrame.h"
|
2010-02-11 00:35:49 -08:00
|
|
|
#include "nsFileControlFrame.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#ifdef MOZ_XUL
|
2007-07-23 17:04:36 -07:00
|
|
|
#include "nsXULPopupManager.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsXULContentUtils.h"
|
|
|
|
#include "nsXULElement.h"
|
|
|
|
#include "nsXULPrototypeCache.h"
|
2007-04-12 13:59:01 -07:00
|
|
|
#include "nsXULTooltipListener.h"
|
2007-07-17 22:41:40 -07:00
|
|
|
|
|
|
|
#ifndef MOZ_NO_INSPECTOR_APIS
|
|
|
|
#include "inDOMView.h"
|
|
|
|
#endif
|
2007-03-22 10:30:00 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef MOZ_MATHML
|
|
|
|
#include "nsMathMLAtoms.h"
|
|
|
|
#include "nsMathMLOperators.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef MOZ_SVG
|
|
|
|
PRBool NS_SVGEnabled();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef MOZILLA_PLAINTEXT_EDITOR_ONLY
|
|
|
|
#include "nsHTMLEditor.h"
|
|
|
|
#include "nsTextServicesDocument.h"
|
|
|
|
#endif
|
|
|
|
|
2008-07-09 01:22:20 -07:00
|
|
|
#ifdef MOZ_MEDIA
|
2008-10-19 00:39:21 -07:00
|
|
|
#include "nsMediaDecoder.h"
|
2008-10-29 22:20:08 -07:00
|
|
|
#include "nsHTMLMediaElement.h"
|
2008-07-09 01:22:20 -07:00
|
|
|
#endif
|
|
|
|
|
2008-11-06 12:53:20 -08:00
|
|
|
#ifdef MOZ_SYDNEYAUDIO
|
2008-07-29 23:50:14 -07:00
|
|
|
#include "nsAudioStream.h"
|
|
|
|
#endif
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsError.h"
|
|
|
|
#include "nsTraceRefcnt.h"
|
|
|
|
|
2008-02-20 11:00:10 -08:00
|
|
|
#include "nsCycleCollector.h"
|
2008-09-11 06:20:56 -07:00
|
|
|
#include "nsJSEnvironment.h"
|
2008-02-20 11:00:10 -08:00
|
|
|
|
2009-06-16 02:15:46 -07:00
|
|
|
extern void NS_ShutdownChainItemPool();
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
static nsrefcnt sLayoutStaticRefcnt;
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
nsLayoutStatics::Initialize()
|
|
|
|
{
|
|
|
|
NS_ASSERTION(sLayoutStaticRefcnt == 0,
|
|
|
|
"nsLayoutStatics isn't zero!");
|
|
|
|
|
|
|
|
sLayoutStaticRefcnt = 1;
|
|
|
|
NS_LOG_ADDREF(&sLayoutStaticRefcnt, sLayoutStaticRefcnt,
|
|
|
|
"nsLayoutStatics", 1);
|
|
|
|
|
|
|
|
nsresult rv;
|
|
|
|
|
2007-04-02 10:17:36 -07:00
|
|
|
// Register all of our atoms once
|
|
|
|
nsCSSAnonBoxes::AddRefAtoms();
|
|
|
|
nsCSSPseudoClasses::AddRefAtoms();
|
|
|
|
nsCSSPseudoElements::AddRefAtoms();
|
|
|
|
nsCSSKeywords::AddRefTable();
|
|
|
|
nsCSSProps::AddRefTable();
|
|
|
|
nsColorNames::AddRefTable();
|
|
|
|
nsGkAtoms::AddRefAtoms();
|
|
|
|
|
2008-09-11 06:20:56 -07:00
|
|
|
nsJSRuntime::Startup();
|
2009-09-09 18:22:03 -07:00
|
|
|
rv = nsRegion::InitStatic();
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
NS_ERROR("Could not initialize nsRegion");
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
rv = nsContentUtils::Init();
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
NS_ERROR("Could not initialize nsContentUtils");
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
rv = nsAttrValue::Init();
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
NS_ERROR("Could not initialize nsAttrValue");
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
rv = nsTextFragment::Init();
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
NS_ERROR("Could not initialize nsTextFragment");
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
rv = nsCellMap::Init();
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
NS_ERROR("Could not initialize nsCellMap");
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
rv = nsCSSRendering::Init();
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
NS_ERROR("Could not initialize nsCSSRendering");
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2007-05-09 15:02:29 -07:00
|
|
|
rv = nsTextFrameTextRunCache::Init();
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
NS_ERROR("Could not initialize textframe textrun cache");
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2008-11-07 15:00:26 -08:00
|
|
|
rv = nsHTMLDNSPrefetch::Initialize();
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
NS_ERROR("Could not initialize HTML DNS prefetch");
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
#ifdef MOZ_XUL
|
|
|
|
rv = nsXULContentUtils::Init();
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
NS_ERROR("Could not initialize nsXULContentUtils");
|
|
|
|
return rv;
|
|
|
|
}
|
2007-07-17 22:35:23 -07:00
|
|
|
|
|
|
|
#ifndef MOZ_NO_INSPECTOR_APIS
|
|
|
|
inDOMView::InitAtoms();
|
|
|
|
#endif
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef MOZ_MATHML
|
|
|
|
nsMathMLOperators::AddRefTable();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef MOZ_SVG
|
|
|
|
if (NS_SVGEnabled())
|
|
|
|
nsContentDLF::RegisterSVG();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef MOZILLA_PLAINTEXT_EDITOR_ONLY
|
|
|
|
nsEditProperty::RegisterAtoms();
|
|
|
|
nsTextServicesDocument::RegisterAtoms();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
nsFrame::DisplayReflowStartup();
|
|
|
|
#endif
|
|
|
|
nsDOMAttribute::Initialize();
|
|
|
|
|
2007-07-17 14:15:49 -07:00
|
|
|
rv = txMozillaXSLTProcessor::Startup();
|
2007-03-22 10:30:00 -07:00
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
NS_ERROR("Could not initialize txMozillaXSLTProcessor");
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
rv = nsDOMStorageManager::Initialize();
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
NS_ERROR("Could not initialize nsDOMStorageManager");
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2007-05-10 13:21:12 -07:00
|
|
|
rv = nsCCUncollectableMarker::Init();
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
NS_ERROR("Could not initialize nsCCUncollectableMarker");
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2010-02-24 08:37:02 -08:00
|
|
|
rv = nsCSSRuleProcessor::Startup();
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
NS_ERROR("Could not initialize nsCSSRuleProcessor");
|
|
|
|
return rv;
|
|
|
|
}
|
2008-10-21 00:15:03 -07:00
|
|
|
|
2007-07-23 17:04:36 -07:00
|
|
|
#ifdef MOZ_XUL
|
2007-07-04 08:49:38 -07:00
|
|
|
rv = nsXULPopupManager::Init();
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
NS_ERROR("Could not initialize nsXULPopupManager");
|
|
|
|
return rv;
|
|
|
|
}
|
2007-07-23 17:04:36 -07:00
|
|
|
#endif
|
2007-07-04 08:49:38 -07:00
|
|
|
|
Bug 178324, refactor focus by moving all focus handling into one place and simplifying it, add many tests, fixes many other bugs too numerous to mention in this small checkin comment, r=josh,smichaud,ere,dbaron,marco,neil,gavin,smaug,sr=smaug (CLOSED TREE)
2009-06-10 11:00:39 -07:00
|
|
|
rv = nsFocusManager::Init();
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
NS_ERROR("Could not initialize nsFocusManager");
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2008-07-09 01:22:20 -07:00
|
|
|
#ifdef MOZ_MEDIA
|
2008-10-29 22:20:08 -07:00
|
|
|
nsHTMLMediaElement::InitMediaTypes();
|
2008-07-09 01:22:20 -07:00
|
|
|
#endif
|
|
|
|
|
2008-11-06 12:53:20 -08:00
|
|
|
#ifdef MOZ_SYDNEYAUDIO
|
2008-10-28 09:17:59 -07:00
|
|
|
nsAudioStream::InitLibrary();
|
2008-07-29 23:50:14 -07:00
|
|
|
#endif
|
|
|
|
|
2009-06-28 15:44:22 -07:00
|
|
|
nsHtml5Module::InitializeStatics();
|
|
|
|
|
2009-05-20 16:07:18 -07:00
|
|
|
nsCrossSiteListenerProxy::Startup();
|
|
|
|
|
2009-07-28 05:51:09 -07:00
|
|
|
rv = nsFrameList::Init();
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
NS_ERROR("Could not initialize nsFrameList");
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2009-09-18 08:13:10 -07:00
|
|
|
NS_SealStaticAtomTable();
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsLayoutStatics::Shutdown()
|
|
|
|
{
|
Bug 178324, refactor focus by moving all focus handling into one place and simplifying it, add many tests, fixes many other bugs too numerous to mention in this small checkin comment, r=josh,smichaud,ere,dbaron,marco,neil,gavin,smaug,sr=smaug (CLOSED TREE)
2009-06-10 11:00:39 -07:00
|
|
|
nsFocusManager::Shutdown();
|
2007-07-23 17:04:36 -07:00
|
|
|
#ifdef MOZ_XUL
|
2007-07-04 08:49:38 -07:00
|
|
|
nsXULPopupManager::Shutdown();
|
2007-07-23 17:04:36 -07:00
|
|
|
#endif
|
2007-03-22 10:30:00 -07:00
|
|
|
nsDOMStorageManager::Shutdown();
|
|
|
|
txMozillaXSLTProcessor::Shutdown();
|
|
|
|
nsDOMAttribute::Shutdown();
|
|
|
|
nsDOMEventRTTearoff::Shutdown();
|
|
|
|
nsEventListenerManager::Shutdown();
|
|
|
|
nsComputedDOMStyle::Shutdown();
|
2010-03-02 12:59:32 -08:00
|
|
|
nsCSSParser::Shutdown();
|
2010-02-24 08:37:02 -08:00
|
|
|
nsCSSRuleProcessor::Shutdown();
|
2007-05-09 15:02:29 -07:00
|
|
|
nsTextFrameTextRunCache::Shutdown();
|
2008-11-07 15:00:26 -08:00
|
|
|
nsHTMLDNSPrefetch::Shutdown();
|
2007-03-22 10:30:00 -07:00
|
|
|
nsCSSRendering::Shutdown();
|
|
|
|
#ifdef DEBUG
|
|
|
|
nsFrame::DisplayReflowShutdown();
|
|
|
|
#endif
|
|
|
|
nsCellMap::Shutdown();
|
|
|
|
|
|
|
|
// Release all of our atoms
|
|
|
|
nsColorNames::ReleaseTable();
|
|
|
|
nsCSSProps::ReleaseTable();
|
|
|
|
nsCSSKeywords::ReleaseTable();
|
|
|
|
nsRepeatService::Shutdown();
|
|
|
|
nsStackLayout::Shutdown();
|
|
|
|
nsBox::Shutdown();
|
|
|
|
|
|
|
|
#ifdef MOZ_XUL
|
|
|
|
nsXULContentUtils::Finish();
|
|
|
|
nsXULElement::ReleaseGlobals();
|
|
|
|
nsXULPrototypeCache::ReleaseGlobals();
|
|
|
|
nsSprocketLayout::Shutdown();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef MOZ_MATHML
|
|
|
|
nsMathMLOperators::ReleaseTable();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
nsCSSFrameConstructor::ReleaseGlobals();
|
2009-01-04 16:39:54 -08:00
|
|
|
nsFloatManager::Shutdown();
|
2007-03-22 10:30:00 -07:00
|
|
|
nsImageFrame::ReleaseGlobals();
|
|
|
|
|
|
|
|
nsCSSScanner::ReleaseGlobals();
|
|
|
|
|
|
|
|
NS_IF_RELEASE(nsRuleNode::gLangService);
|
|
|
|
|
|
|
|
nsTextFragment::Shutdown();
|
|
|
|
|
|
|
|
nsAttrValue::Shutdown();
|
|
|
|
nsContentUtils::Shutdown();
|
2008-01-21 01:58:58 -08:00
|
|
|
nsNodeInfo::ClearCache();
|
2007-03-22 10:30:00 -07:00
|
|
|
nsLayoutStylesheetCache::Shutdown();
|
|
|
|
NS_NameSpaceManagerShutdown();
|
|
|
|
|
2008-09-11 06:20:56 -07:00
|
|
|
nsJSRuntime::Shutdown();
|
2007-03-22 10:30:00 -07:00
|
|
|
nsGlobalWindow::ShutDown();
|
|
|
|
nsDOMClassInfo::ShutDown();
|
|
|
|
nsTextControlFrame::ShutDown();
|
2009-08-08 15:00:26 -07:00
|
|
|
nsListControlFrame::Shutdown();
|
2007-03-22 10:30:00 -07:00
|
|
|
nsXBLWindowKeyHandler::ShutDown();
|
|
|
|
nsAutoCopyListener::Shutdown();
|
|
|
|
|
|
|
|
#ifndef MOZILLA_PLAINTEXT_EDITOR_ONLY
|
|
|
|
nsHTMLEditor::Shutdown();
|
|
|
|
nsTextServicesDocument::Shutdown();
|
|
|
|
#endif
|
2008-01-29 22:35:33 -08:00
|
|
|
|
2008-08-16 18:25:01 -07:00
|
|
|
nsDOMThreadService::Shutdown();
|
|
|
|
|
2008-10-29 22:20:08 -07:00
|
|
|
#ifdef MOZ_MEDIA
|
|
|
|
nsHTMLMediaElement::ShutdownMediaTypes();
|
|
|
|
#endif
|
2008-11-06 12:53:20 -08:00
|
|
|
#ifdef MOZ_SYDNEYAUDIO
|
2008-07-29 23:50:14 -07:00
|
|
|
nsAudioStream::ShutdownLibrary();
|
|
|
|
#endif
|
2008-09-30 23:17:15 -07:00
|
|
|
|
2008-10-14 17:12:28 -07:00
|
|
|
nsXMLHttpRequest::ShutdownACCache();
|
2009-06-28 15:44:22 -07:00
|
|
|
|
|
|
|
nsHtml5Module::ReleaseStatics();
|
2009-06-16 02:15:46 -07:00
|
|
|
|
2009-09-09 18:22:03 -07:00
|
|
|
nsRegion::ShutdownStatic();
|
|
|
|
|
2009-06-16 02:15:46 -07:00
|
|
|
NS_ShutdownChainItemPool();
|
2009-07-28 05:51:09 -07:00
|
|
|
|
|
|
|
nsFrameList::Shutdown();
|
2010-02-11 00:35:49 -08:00
|
|
|
|
|
|
|
nsFileControlFrame::DestroyUploadLastDir();
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsLayoutStatics::AddRef()
|
|
|
|
{
|
2010-02-25 13:05:54 -08:00
|
|
|
NS_ASSERTION(NS_IsMainThread(),
|
|
|
|
"nsLayoutStatics reference counting must be on main thread");
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_ASSERTION(sLayoutStaticRefcnt,
|
|
|
|
"nsLayoutStatics already dropped to zero!");
|
|
|
|
|
|
|
|
++sLayoutStaticRefcnt;
|
|
|
|
NS_LOG_ADDREF(&sLayoutStaticRefcnt, sLayoutStaticRefcnt,
|
|
|
|
"nsLayoutStatics", 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsLayoutStatics::Release()
|
|
|
|
{
|
2010-02-25 13:05:54 -08:00
|
|
|
NS_ASSERTION(NS_IsMainThread(),
|
|
|
|
"nsLayoutStatics reference counting must be on main thread");
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
--sLayoutStaticRefcnt;
|
|
|
|
NS_LOG_RELEASE(&sLayoutStaticRefcnt, sLayoutStaticRefcnt,
|
|
|
|
"nsLayoutStatics");
|
|
|
|
|
|
|
|
if (!sLayoutStaticRefcnt)
|
|
|
|
Shutdown();
|
|
|
|
}
|