mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Merge inbound to m-c.
This commit is contained in:
commit
bc09ab2cd9
13
Makefile.in
13
Makefile.in
@ -52,8 +52,10 @@ ifndef MOZ_PROFILE_USE
|
||||
#
|
||||
# We need to explicitly put backend.RecursiveMakeBackend.built here
|
||||
# otherwise the rule in rules.mk doesn't run early enough.
|
||||
default alldep all:: CLOBBER $(topsrcdir)/configure config.status backend.RecursiveMakeBackend.built
|
||||
default all export libs tools:: CLOBBER $(topsrcdir)/configure config.status backend.RecursiveMakeBackend.built
|
||||
$(call SUBMAKE,backend.RecursiveMakeBackend.built,js/src,1)
|
||||
|
||||
default all export::
|
||||
$(call py_action,purge_manifests,-d _build_manifests/purge .)
|
||||
endif
|
||||
|
||||
@ -77,8 +79,7 @@ config.status: $(topsrcdir)/configure
|
||||
@echo "but your build might not succeed."
|
||||
@exit 1
|
||||
|
||||
# Build pseudo-external modules first when export is explicitly called
|
||||
export::
|
||||
default all export::
|
||||
$(RM) -r $(DIST)/sdk
|
||||
|
||||
ifdef ENABLE_TESTS
|
||||
@ -89,10 +90,12 @@ endif
|
||||
# Hacky way for precompile tier to bypass default tier traversal mechanism.
|
||||
TIER_precompile_CUSTOM := 1
|
||||
|
||||
default all export::
|
||||
$(call py_action,process_install_manifest,$(DIST)/include _build_manifests/install/dist_include js/src/_build_manifests/install/dist_include)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
default all alldep::
|
||||
$(call py_action,process_install_manifest,$(DIST)/include _build_manifests/install/dist_include js/src/_build_manifests/install/dist_include)
|
||||
default all::
|
||||
$(call BUILDSTATUS,TIERS $(TIERS))
|
||||
$(foreach tier,$(TIERS),$(call SUBMAKE,tier_$(tier)))
|
||||
|
||||
|
@ -38,6 +38,11 @@ using namespace mozilla::dom;
|
||||
// DocManager
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
DocManager::DocManager()
|
||||
: mDocAccessibleCache(4)
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// DocManager public
|
||||
|
||||
@ -88,8 +93,6 @@ DocManager::IsProcessingRefreshDriverNotification() const
|
||||
bool
|
||||
DocManager::Init()
|
||||
{
|
||||
mDocAccessibleCache.Init(4);
|
||||
|
||||
nsCOMPtr<nsIWebProgress> progress =
|
||||
do_GetService(NS_DOCUMENTLOADER_SERVICE_CONTRACTID);
|
||||
|
||||
|
@ -73,7 +73,7 @@ public:
|
||||
#endif
|
||||
|
||||
protected:
|
||||
DocManager() { }
|
||||
DocManager();
|
||||
|
||||
/**
|
||||
* Initialize the manager.
|
||||
|
@ -29,8 +29,6 @@ NotificationController::NotificationController(DocAccessible* aDocument,
|
||||
EventQueue(aDocument), mObservingState(eNotObservingRefresh),
|
||||
mPresShell(aPresShell)
|
||||
{
|
||||
mTextHash.Init();
|
||||
|
||||
// Schedule initial accessible tree construction.
|
||||
ScheduleProcessing();
|
||||
}
|
||||
|
@ -74,6 +74,9 @@ DocAccessible::
|
||||
nsIPresShell* aPresShell) :
|
||||
HyperTextAccessibleWrap(aRootContent, this),
|
||||
mDocumentNode(aDocument), mScrollPositionChangedTicks(0),
|
||||
// XXX aaronl should we use an algorithm for the initial cache size?
|
||||
mAccessibleCache(kDefaultCacheSize),
|
||||
mNodeToAccessibleMap(kDefaultCacheSize),
|
||||
mLoadState(eTreeConstructionPending), mDocFlags(0), mLoadEventType(0),
|
||||
mVirtualCursor(nullptr),
|
||||
mPresShell(aPresShell)
|
||||
@ -84,11 +87,6 @@ DocAccessible::
|
||||
MOZ_ASSERT(mPresShell, "should have been given a pres shell");
|
||||
mPresShell->SetDocAccessible(this);
|
||||
|
||||
mDependentIDsHash.Init();
|
||||
// XXX aaronl should we use an algorithm for the initial cache size?
|
||||
mAccessibleCache.Init(kDefaultCacheSize);
|
||||
mNodeToAccessibleMap.Init(kDefaultCacheSize);
|
||||
|
||||
// If this is a XUL Document, it should not implement nsHyperText
|
||||
if (mDocumentNode && mDocumentNode->IsXUL())
|
||||
mGenericTypes &= ~eHyperText;
|
||||
|
@ -248,7 +248,7 @@ DocAccessibleWrap::Shutdown()
|
||||
if (nsWinUtils::IsWindowEmulationStarted()) {
|
||||
// Destroy window created for root document.
|
||||
if (mDocFlags & eTabDocument) {
|
||||
nsWinUtils::sHWNDCache.Remove(mHWND);
|
||||
nsWinUtils::sHWNDCache->Remove(mHWND);
|
||||
::DestroyWindow(static_cast<HWND>(mHWND));
|
||||
}
|
||||
|
||||
@ -308,7 +308,7 @@ DocAccessibleWrap::DoInitialUpdate()
|
||||
mHWND = nsWinUtils::CreateNativeWindow(kClassNameTabContent, parentWnd,
|
||||
x, y, width, height, isActive);
|
||||
|
||||
nsWinUtils::sHWNDCache.Put(mHWND, this);
|
||||
nsWinUtils::sHWNDCache->Put(mHWND, this);
|
||||
|
||||
} else {
|
||||
DocAccessible* parentDocument = ParentDocument();
|
||||
|
@ -30,7 +30,7 @@ const PRUnichar* kPropNameTabContent = L"AccessibleTabWindow";
|
||||
static LRESULT CALLBACK WindowProc(HWND hWnd, UINT msg,
|
||||
WPARAM wParam, LPARAM lParam);
|
||||
|
||||
nsRefPtrHashtable<nsPtrHashKey<void>, DocAccessible> nsWinUtils::sHWNDCache;
|
||||
nsRefPtrHashtable<nsPtrHashKey<void>, DocAccessible>* nsWinUtils::sHWNDCache = nullptr;
|
||||
|
||||
already_AddRefed<nsIDOMCSSStyleDeclaration>
|
||||
nsWinUtils::GetComputedStyleDeclaration(nsIContent* aContent)
|
||||
@ -60,7 +60,7 @@ nsWinUtils::MaybeStartWindowEmulation()
|
||||
Compatibility::IsDolphin() ||
|
||||
Preferences::GetBool("browser.tabs.remote")) {
|
||||
RegisterNativeWindow(kClassNameTabContent);
|
||||
sHWNDCache.Init(4);
|
||||
sHWNDCache = new nsRefPtrHashtable<nsPtrHashKey<void>, DocAccessible>(4);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -79,7 +79,7 @@ nsWinUtils::ShutdownWindowEmulation()
|
||||
bool
|
||||
nsWinUtils::IsWindowEmulationStarted()
|
||||
{
|
||||
return sHWNDCache.IsInitialized();
|
||||
return sHWNDCache != nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
@ -145,7 +145,7 @@ WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (lParam == OBJID_CLIENT) {
|
||||
DocAccessible* document =
|
||||
nsWinUtils::sHWNDCache.GetWeak(static_cast<void*>(hWnd));
|
||||
nsWinUtils::sHWNDCache->GetWeak(static_cast<void*>(hWnd));
|
||||
if (document) {
|
||||
IAccessible* msaaAccessible = nullptr;
|
||||
document->GetNativeInterface((void**)&msaaAccessible); // does an addref
|
||||
|
@ -78,7 +78,7 @@ public:
|
||||
* Cache for HWNDs of windows created for document accessibles in windows
|
||||
* emulation mode.
|
||||
*/
|
||||
static nsRefPtrHashtable<nsPtrHashKey<void>, DocAccessible> sHWNDCache;
|
||||
static nsRefPtrHashtable<nsPtrHashKey<void>, DocAccessible>* sHWNDCache;
|
||||
};
|
||||
|
||||
} // namespace a11y
|
||||
|
@ -40,7 +40,8 @@ using namespace mozilla::a11y;
|
||||
XULTreeAccessible::
|
||||
XULTreeAccessible(nsIContent* aContent, DocAccessible* aDoc,
|
||||
nsTreeBodyFrame* aTreeFrame) :
|
||||
AccessibleWrap(aContent, aDoc)
|
||||
AccessibleWrap(aContent, aDoc),
|
||||
mAccessibleCache(kDefaultTreeCacheSize)
|
||||
{
|
||||
mType = eXULTreeType;
|
||||
mGenericTypes |= eSelect;
|
||||
@ -58,8 +59,6 @@ XULTreeAccessible::
|
||||
if (autoCompletePopupElm)
|
||||
mGenericTypes |= eAutoCompletePopup;
|
||||
}
|
||||
|
||||
mAccessibleCache.Init(kDefaultTreeCacheSize);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -267,11 +267,10 @@ XULTreeGridRowAccessible::
|
||||
XULTreeGridRowAccessible(nsIContent* aContent, DocAccessible* aDoc,
|
||||
Accessible* aTreeAcc, nsITreeBoxObject* aTree,
|
||||
nsITreeView* aTreeView, int32_t aRow) :
|
||||
XULTreeItemAccessibleBase(aContent, aDoc, aTreeAcc, aTree, aTreeView, aRow)
|
||||
XULTreeItemAccessibleBase(aContent, aDoc, aTreeAcc, aTree, aTreeView, aRow),
|
||||
mAccessibleCache(kDefaultTreeCacheSize)
|
||||
{
|
||||
mGenericTypes |= eTableRow;
|
||||
|
||||
mAccessibleCache.Init(kDefaultTreeCacheSize);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -118,7 +118,7 @@ libs-preqs = \
|
||||
$(NULL)
|
||||
|
||||
.PHONY: repackage
|
||||
libs repackage:: $(libs-preqs)
|
||||
tools repackage:: $(libs-preqs)
|
||||
rsync -a --exclude "*.in" $(srcdir)/macbuild/Contents $(DIST)/$(APP_NAME).app --exclude English.lproj
|
||||
rsync -a --exclude "*.in" $(srcdir)/macbuild/Contents/Resources/English.lproj/ $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj
|
||||
sed -e "s/%MOZ_APP_VERSION%/$(MOZ_APP_VERSION)/" -e "s/%MOZ_APP_NAME%/$(MOZ_APP_NAME)/" -e "s/%APP_VERSION%/$(APP_VERSION)/" -e "s/%APP_NAME%/$(APP_NAME)/" -e "s/%APP_BINARY%/$(APP_BINARY)/" $(srcdir)/macbuild/Contents/Info.plist.in > $(DIST)/$(APP_NAME).app/Contents/Info.plist
|
||||
|
@ -170,7 +170,7 @@ endif
|
||||
MAC_BUNDLE_VERSION = $(shell $(PYTHON) $(srcdir)/macversion.py --version=$(MOZ_APP_VERSION) --buildid=$(DEPTH)/config/buildid)
|
||||
|
||||
.PHONY: repackage
|
||||
libs repackage:: $(PROGRAM)
|
||||
tools repackage:: $(PROGRAM)
|
||||
$(MKDIR) -p $(dist_dest)/Contents/MacOS
|
||||
$(MKDIR) -p $(dist_dest)/Contents/Resources/$(AB).lproj
|
||||
rsync -a --exclude "*.in" $(srcdir)/macbuild/Contents $(dist_dest) --exclude English.lproj
|
||||
|
@ -8,7 +8,7 @@
|
||||
// Tests that the Web Console CSP messages are displayed
|
||||
|
||||
const TEST_VIOLATION = "https://example.com/browser/browser/devtools/webconsole/test/test_bug_770099_violation.html";
|
||||
const CSP_VIOLATION_MSG = "Content Security Policy: Directive default-src https://example.com:443 violated by http://some.example.com/test.png"
|
||||
const CSP_VIOLATION_MSG = 'Content Security Policy: The page\'s settings blocked the loading of a resource at http://some.example.com/test.png ("default-src https://example.com:443").'
|
||||
|
||||
let hud = undefined;
|
||||
|
||||
|
@ -47,4 +47,4 @@ bookmarks: bookmarks.inc
|
||||
-DAB_CD=$(AB_CD) \
|
||||
$(bookmarks-src) > ../bookmarks.json
|
||||
|
||||
libs:: bookmarks
|
||||
export:: bookmarks
|
||||
|
@ -5,9 +5,9 @@
|
||||
# finds the location of the browser and puts it in the variable $(browser_path)
|
||||
|
||||
ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
|
||||
PROGRAM = $(MOZ_APP_NAME)$(BIN_SUFFIX)
|
||||
program = $(MOZ_APP_NAME)$(BIN_SUFFIX)
|
||||
else
|
||||
PROGRAM = $(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
|
||||
program = $(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
|
||||
endif
|
||||
|
||||
TARGET_DIST = $(TARGET_DEPTH)/dist
|
||||
@ -16,8 +16,8 @@ ifeq ($(MOZ_BUILD_APP),camino)
|
||||
browser_path = $(TARGET_DIST)/Camino.app/Contents/MacOS/Camino
|
||||
else
|
||||
ifeq ($(OS_ARCH),Darwin)
|
||||
browser_path = $(TARGET_DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/$(PROGRAM)
|
||||
browser_path = $(TARGET_DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/$(program)
|
||||
else
|
||||
browser_path = $(TARGET_DIST)/bin/$(PROGRAM)
|
||||
browser_path = $(TARGET_DIST)/bin/$(program)
|
||||
endif
|
||||
endif
|
||||
|
@ -361,7 +361,7 @@ def _checktime(path, stmts):
|
||||
|
||||
return True
|
||||
|
||||
_parsecache = util.MostUsedCache(15, _parsefile, _checktime)
|
||||
_parsecache = util.MostUsedCache(50, _parsefile, _checktime)
|
||||
|
||||
def parsefile(pathname):
|
||||
"""
|
||||
|
@ -140,8 +140,6 @@ nsChromeRegistry::GetService()
|
||||
nsresult
|
||||
nsChromeRegistry::Init()
|
||||
{
|
||||
mOverrideTable.Init();
|
||||
|
||||
// This initialization process is fairly complicated and may cause reentrant
|
||||
// getservice calls to resolve chrome URIs (especially locale files). We
|
||||
// don't want that, so we inform the protocol handler about our existence
|
||||
|
@ -124,9 +124,6 @@ nsChromeRegistryChrome::Init()
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
mOverlayHash.Init();
|
||||
mStyleHash.Init();
|
||||
|
||||
mSelectedLocale = NS_LITERAL_CSTRING("en-US");
|
||||
mSelectedSkin = NS_LITERAL_CSTRING("classic/1.0");
|
||||
|
||||
|
@ -142,7 +142,6 @@ class nsChromeRegistryChrome : public nsChromeRegistry
|
||||
OverlayListHash() { }
|
||||
~OverlayListHash() { }
|
||||
|
||||
void Init() { mTable.Init(); }
|
||||
void Add(nsIURI* aBase, nsIURI* aOverlay);
|
||||
void Clear() { mTable.Clear(); }
|
||||
const nsCOMArray<nsIURI>* GetArray(nsIURI* aBase);
|
||||
|
@ -12,7 +12,6 @@
|
||||
|
||||
nsChromeRegistryContent::nsChromeRegistryContent()
|
||||
{
|
||||
mPackagesHash.Init();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -31,7 +31,6 @@ endif
|
||||
endif # IS_COMPONENT
|
||||
endif # SHARED_LIBRARY
|
||||
endif # !NO_DIST_INSTALL
|
||||
$(LOOP_OVER_DIRS)
|
||||
|
||||
ifndef NO_DIST_INSTALL
|
||||
|
||||
|
37
config/recurse.mk
Normal file
37
config/recurse.mk
Normal file
@ -0,0 +1,37 @@
|
||||
# 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 INCLUDED_RULES_MK
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
endif
|
||||
|
||||
#########################
|
||||
# Tier traversal handling
|
||||
#########################
|
||||
|
||||
define CREATE_SUBTIER_TRAVERSAL_RULE
|
||||
PARALLEL_DIRS_$(1) = $$(addsuffix _$(1),$$(PARALLEL_DIRS))
|
||||
|
||||
.PHONY: $(1) $$(PARALLEL_DIRS_$(1))
|
||||
|
||||
ifdef PARALLEL_DIRS
|
||||
$$(PARALLEL_DIRS_$(1)): %_$(1): %/Makefile
|
||||
+@$$(call SUBMAKE,$(1),$$*)
|
||||
endif
|
||||
|
||||
$(1):: $$(SUBMAKEFILES)
|
||||
ifdef PARALLEL_DIRS
|
||||
+@$(MAKE) $$(PARALLEL_DIRS_$(1))
|
||||
endif
|
||||
$$(LOOP_OVER_DIRS)
|
||||
|
||||
endef
|
||||
|
||||
$(foreach subtier,export libs tools,$(eval $(call CREATE_SUBTIER_TRAVERSAL_RULE,$(subtier))))
|
||||
|
||||
export:: $(SUBMAKEFILES)
|
||||
$(LOOP_OVER_TOOL_DIRS)
|
||||
|
||||
tools:: $(SUBMAKEFILES)
|
||||
$(foreach dir,$(TOOL_DIRS),$(call SUBMAKE,libs,$(dir)))
|
@ -716,35 +716,6 @@ ifneq (,$(DIRS)$(TOOL_DIRS)$(PARALLEL_DIRS))
|
||||
$(LOOP_OVER_TOOL_DIRS)
|
||||
endif
|
||||
|
||||
#########################
|
||||
# Tier traversal handling
|
||||
#########################
|
||||
define CREATE_SUBTIER_TRAVERSAL_RULE
|
||||
PARALLEL_DIRS_$(1) = $$(addsuffix _$(1),$$(PARALLEL_DIRS))
|
||||
|
||||
.PHONY: $(1) $$(PARALLEL_DIRS_$(1))
|
||||
|
||||
ifdef PARALLEL_DIRS
|
||||
$(1):: $$(PARALLEL_DIRS_$(1))
|
||||
|
||||
$$(PARALLEL_DIRS_$(1)): %_$(1): %/Makefile
|
||||
+@$$(call SUBMAKE,$(1),$$*)
|
||||
endif
|
||||
|
||||
endef
|
||||
|
||||
$(foreach subtier,export libs tools,$(eval $(call CREATE_SUBTIER_TRAVERSAL_RULE,$(subtier))))
|
||||
|
||||
export:: $(SUBMAKEFILES)
|
||||
$(LOOP_OVER_DIRS)
|
||||
$(LOOP_OVER_TOOL_DIRS)
|
||||
|
||||
|
||||
tools:: $(SUBMAKEFILES)
|
||||
$(LOOP_OVER_DIRS)
|
||||
$(foreach dir,$(TOOL_DIRS),$(call SUBMAKE,libs,$(dir)))
|
||||
|
||||
|
||||
ifneq (,$(filter-out %.$(LIB_SUFFIX),$(SHARED_LIBRARY_LIBS)))
|
||||
$(error SHARED_LIBRARY_LIBS must contain .$(LIB_SUFFIX) files only)
|
||||
endif
|
||||
|
@ -298,7 +298,7 @@ CSPRep.fromString = function(aStr, self, docRequest, csp) {
|
||||
else if (opt === "eval-script")
|
||||
aCSPR._allowEval = true;
|
||||
else
|
||||
cspWarn(aCSPR, CSPLocalizer.getFormatStr("doNotUnderstandOption",
|
||||
cspWarn(aCSPR, CSPLocalizer.getFormatStr("ignoringUnknownOption",
|
||||
[opt]));
|
||||
}
|
||||
continue directive;
|
||||
@ -361,17 +361,17 @@ CSPRep.fromString = function(aStr, self, docRequest, csp) {
|
||||
if (gETLDService.getBaseDomain(uri) !==
|
||||
gETLDService.getBaseDomain(selfUri)) {
|
||||
cspWarn(aCSPR,
|
||||
CSPLocalizer.getFormatStr("notETLDPlus1",
|
||||
[gETLDService.getBaseDomain(uri)]));
|
||||
CSPLocalizer.getFormatStr("reportURInotETLDPlus1",
|
||||
[gETLDService.getBaseDomain(uri)]));
|
||||
continue;
|
||||
}
|
||||
if (!uri.schemeIs(selfUri.scheme)) {
|
||||
cspWarn(aCSPR, CSPLocalizer.getFormatStr("notSameScheme",
|
||||
cspWarn(aCSPR, CSPLocalizer.getFormatStr("reportURInotSameSchemeAsSelf",
|
||||
[uri.asciiSpec]));
|
||||
continue;
|
||||
}
|
||||
if (uri.port && uri.port !== selfUri.port) {
|
||||
cspWarn(aCSPR, CSPLocalizer.getFormatStr("notSamePort",
|
||||
cspWarn(aCSPR, CSPLocalizer.getFormatStr("reportURInotSamePortAsSelf",
|
||||
[uri.asciiSpec]));
|
||||
continue;
|
||||
}
|
||||
@ -620,19 +620,19 @@ CSPRep.fromStringSpecCompliant = function(aStr, self, docRequest, csp) {
|
||||
if (gETLDService.getBaseDomain(uri) !==
|
||||
gETLDService.getBaseDomain(selfUri)) {
|
||||
cspWarn(aCSPR,
|
||||
CSPLocalizer.getFormatStr("notETLDPlus1",
|
||||
[gETLDService.getBaseDomain(uri)]));
|
||||
CSPLocalizer.getFormatStr("reportURInotETLDPlus1",
|
||||
[gETLDService.getBaseDomain(uri)]));
|
||||
continue;
|
||||
}
|
||||
if (!uri.schemeIs(selfUri.scheme)) {
|
||||
cspWarn(aCSPR,
|
||||
CSPLocalizer.getFormatStr("notSameScheme",
|
||||
cspWarn(aCSPR,
|
||||
CSPLocalizer.getFormatStr("reportURInotSameSchemeAsSelf",
|
||||
[uri.asciiSpec]));
|
||||
continue;
|
||||
}
|
||||
if (uri.port && uri.port !== selfUri.port) {
|
||||
cspWarn(aCSPR,
|
||||
CSPLocalizer.getFormatStr("notSamePort",
|
||||
cspWarn(aCSPR,
|
||||
CSPLocalizer.getFormatStr("reportURInotSamePortAsSelf",
|
||||
[uri.asciiSpec]));
|
||||
continue;
|
||||
}
|
||||
|
@ -180,19 +180,19 @@ ContentSecurityPolicy.prototype = {
|
||||
switch (aViolationType) {
|
||||
case Ci.nsIContentSecurityPolicy.VIOLATION_TYPE_INLINE_STYLE:
|
||||
if (!this._policy.allowsInlineStyles)
|
||||
this._asyncReportViolation('self',null,'inline style base restriction',
|
||||
this._asyncReportViolation('self', null, CSPLocalizer.getStr("inlineStyleBlocked"),
|
||||
'violated base restriction: Inline Stylesheets will not apply',
|
||||
aSourceFile, aScriptSample, aLineNum);
|
||||
break;
|
||||
case Ci.nsIContentSecurityPolicy.VIOLATION_TYPE_INLINE_SCRIPT:
|
||||
if (!this._policy.allowsInlineScripts)
|
||||
this._asyncReportViolation('self', null, 'inline script base restriction',
|
||||
this._asyncReportViolation('self', null, CSPLocalizer.getStr("inlineScriptBlocked"),
|
||||
'violated base restriction: Inline Scripts will not execute',
|
||||
aSourceFile, aScriptSample, aLineNum);
|
||||
break;
|
||||
case Ci.nsIContentSecurityPolicy.VIOLATION_TYPE_EVAL:
|
||||
if (!this._policy.allowsEvalInScripts)
|
||||
this._asyncReportViolation('self', null, 'eval script base restriction',
|
||||
this._asyncReportViolation('self', null, CSPLocalizer.getStr("scriptFromStringBlocked"),
|
||||
'violated base restriction: Code will not be created from strings',
|
||||
aSourceFile, aScriptSample, aLineNum);
|
||||
break;
|
||||
@ -362,9 +362,9 @@ ContentSecurityPolicy.prototype = {
|
||||
|
||||
var violationMessage = null;
|
||||
if (blockedUri["asciiSpec"]) {
|
||||
violationMessage = CSPLocalizer.getFormatStr("directiveViolatedWithURI", [violatedDirective, blockedUri.asciiSpec]);
|
||||
violationMessage = CSPLocalizer.getFormatStr("CSPViolationWithURI", [violatedDirective, blockedUri.asciiSpec]);
|
||||
} else {
|
||||
violationMessage = CSPLocalizer.getFormatStr("directiveViolated", [violatedDirective]);
|
||||
violationMessage = CSPLocalizer.getFormatStr("CSPViolation", [violatedDirective]);
|
||||
}
|
||||
this._policy.log(WARN_FLAG, violationMessage,
|
||||
(aSourceFile) ? aSourceFile : null,
|
||||
|
@ -574,11 +574,11 @@ nsContentUtils::InitializeEventTable() {
|
||||
{ nullptr }
|
||||
};
|
||||
|
||||
sAtomEventTable = new nsDataHashtable<nsISupportsHashKey, EventNameMapping>;
|
||||
sStringEventTable = new nsDataHashtable<nsStringHashKey, EventNameMapping>;
|
||||
sAtomEventTable = new nsDataHashtable<nsISupportsHashKey, EventNameMapping>(
|
||||
int(ArrayLength(eventArray) / 0.75) + 1);
|
||||
sStringEventTable = new nsDataHashtable<nsStringHashKey, EventNameMapping>(
|
||||
int(ArrayLength(eventArray) / 0.75) + 1);
|
||||
sUserDefinedEvents = new nsCOMArray<nsIAtom>(64);
|
||||
sAtomEventTable->Init(int(ArrayLength(eventArray) / 0.75) + 1);
|
||||
sStringEventTable->Init(int(ArrayLength(eventArray) / 0.75) + 1);
|
||||
|
||||
// Subtract one from the length because of the trailing null
|
||||
for (uint32_t i = 0; i < ArrayLength(eventArray) - 1; ++i) {
|
||||
|
@ -82,7 +82,6 @@ public:
|
||||
|
||||
bool Initialize()
|
||||
{
|
||||
mTable.Init();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,6 @@ nsDOMAttributeMap::nsDOMAttributeMap(Element* aContent)
|
||||
{
|
||||
// We don't add a reference to our content. If it goes away,
|
||||
// we'll be told to drop our reference
|
||||
mAttributeCache.Init();
|
||||
SetIsDOMBinding();
|
||||
}
|
||||
|
||||
|
@ -347,7 +347,6 @@ public:
|
||||
mozilla::dom::MutationCallback& aCb)
|
||||
: mOwner(aOwner), mCallback(&aCb), mWaitingForRun(false), mId(++sCount)
|
||||
{
|
||||
mTransientReceivers.Init();
|
||||
SetIsDOMBinding();
|
||||
}
|
||||
virtual ~nsDOMMutationObserver();
|
||||
|
@ -282,7 +282,6 @@ nsIdentifierMapEntry::AddContentChangeCallback(nsIDocument::IDTargetObserver aCa
|
||||
mChangeCallbacks = new nsTHashtable<ChangeCallbackEntry>;
|
||||
if (!mChangeCallbacks)
|
||||
return;
|
||||
mChangeCallbacks->Init();
|
||||
}
|
||||
|
||||
ChangeCallback cc = { aCallback, aData, aForImage };
|
||||
@ -697,8 +696,6 @@ nsOnloadBlocker::SetLoadFlags(nsLoadFlags aLoadFlags)
|
||||
nsExternalResourceMap::nsExternalResourceMap()
|
||||
: mHaveShutDown(false)
|
||||
{
|
||||
mMap.Init();
|
||||
mPendingLoads.Init();
|
||||
}
|
||||
|
||||
nsIDocument*
|
||||
@ -1394,8 +1391,6 @@ nsDocument::nsDocument(const char* aContentType)
|
||||
|
||||
// Start out mLastStyleSheetSet as null, per spec
|
||||
SetDOMStringToNull(mLastStyleSheetSet);
|
||||
|
||||
mLinksToUpdate.Init();
|
||||
}
|
||||
|
||||
static PLDHashOperator
|
||||
@ -1934,11 +1929,6 @@ nsDocument::Init()
|
||||
Preferences::AddUintVarCache(&sOnloadDecodeLimit, "image.onload.decode.limit", 0);
|
||||
}
|
||||
|
||||
mIdentifierMap.Init();
|
||||
mStyledLinks.Init();
|
||||
mRadioGroups.Init();
|
||||
mCustomPrototypes.Init();
|
||||
|
||||
// Force initialization.
|
||||
nsINode::nsSlots* slots = Slots();
|
||||
|
||||
@ -1980,9 +1970,6 @@ nsDocument::Init()
|
||||
|
||||
mScriptLoader = new nsScriptLoader(this);
|
||||
|
||||
mImageTracker.Init();
|
||||
mPlugins.Init();
|
||||
|
||||
mozilla::HoldJSObjects(this);
|
||||
|
||||
return NS_OK;
|
||||
@ -6144,8 +6131,7 @@ nsDocument::GetBoxObjectFor(Element* aElement, ErrorResult& aRv)
|
||||
}
|
||||
|
||||
if (!mBoxObjectTable) {
|
||||
mBoxObjectTable = new nsInterfaceHashtable<nsPtrHashKey<nsIContent>, nsPIBoxObject>;
|
||||
mBoxObjectTable->Init(12);
|
||||
mBoxObjectTable = new nsInterfaceHashtable<nsPtrHashKey<nsIContent>, nsPIBoxObject>(12);
|
||||
} else {
|
||||
nsCOMPtr<nsPIBoxObject> boxObject = mBoxObjectTable->Get(aElement);
|
||||
if (boxObject) {
|
||||
@ -8763,7 +8749,6 @@ nsIDocument::RegisterFreezableElement(nsIContent* aContent)
|
||||
mFreezableElements = new nsTHashtable<nsPtrHashKey<nsIContent> >();
|
||||
if (!mFreezableElements)
|
||||
return;
|
||||
mFreezableElements->Init();
|
||||
}
|
||||
mFreezableElements->PutEntry(aContent);
|
||||
}
|
||||
|
@ -988,7 +988,6 @@ nsFrameScriptExecutor::DidCreateGlobal()
|
||||
if (!sCachedScripts) {
|
||||
sCachedScripts =
|
||||
new nsDataHashtable<nsStringHashKey, nsFrameJSScriptExecutorHolder*>;
|
||||
sCachedScripts->Init();
|
||||
|
||||
nsRefPtr<nsScriptCacheCleaner> scriptCacheCleaner =
|
||||
new nsScriptCacheCleaner();
|
||||
|
@ -34,7 +34,6 @@ nsHostObjectProtocolHandler::AddDataEntry(const nsACString& aScheme,
|
||||
|
||||
if (!gDataTable) {
|
||||
gDataTable = new nsClassHashtable<nsCStringHashKey, DataInfo>;
|
||||
gDataTable->Init();
|
||||
}
|
||||
|
||||
DataInfo* info = new DataInfo;
|
||||
|
@ -74,6 +74,10 @@ private:
|
||||
|
||||
class NameSpaceManagerImpl : public nsINameSpaceManager {
|
||||
public:
|
||||
NameSpaceManagerImpl()
|
||||
: mURIToIDTable(32)
|
||||
{
|
||||
}
|
||||
virtual ~NameSpaceManagerImpl()
|
||||
{
|
||||
}
|
||||
@ -102,8 +106,6 @@ NS_IMPL_ISUPPORTS1(NameSpaceManagerImpl, nsINameSpaceManager)
|
||||
|
||||
nsresult NameSpaceManagerImpl::Init()
|
||||
{
|
||||
mURIToIDTable.Init(32);
|
||||
|
||||
nsresult rv;
|
||||
#define REGISTER_NAMESPACE(uri, id) \
|
||||
rv = AddNameSpace(NS_LITERAL_STRING(uri), id); \
|
||||
|
@ -364,7 +364,6 @@ nsRange::RegisterCommonAncestor(nsINode* aNode)
|
||||
static_cast<RangeHashTable*>(aNode->GetProperty(nsGkAtoms::range));
|
||||
if (!ranges) {
|
||||
ranges = new RangeHashTable;
|
||||
ranges->Init();
|
||||
aNode->SetProperty(nsGkAtoms::range, ranges, RangeHashTableDtor, true);
|
||||
}
|
||||
ranges->PutEntry(this);
|
||||
|
@ -1497,44 +1497,37 @@ nsTreeSanitizer::InitializeStatics()
|
||||
{
|
||||
NS_PRECONDITION(!sElementsHTML, "Initializing a second time.");
|
||||
|
||||
sElementsHTML = new nsTHashtable<nsISupportsHashKey> ();
|
||||
sElementsHTML->Init(ArrayLength(kElementsHTML));
|
||||
sElementsHTML = new nsTHashtable<nsISupportsHashKey>(ArrayLength(kElementsHTML));
|
||||
for (uint32_t i = 0; kElementsHTML[i]; i++) {
|
||||
sElementsHTML->PutEntry(*kElementsHTML[i]);
|
||||
}
|
||||
|
||||
sAttributesHTML = new nsTHashtable<nsISupportsHashKey> ();
|
||||
sAttributesHTML->Init(ArrayLength(kAttributesHTML));
|
||||
sAttributesHTML = new nsTHashtable<nsISupportsHashKey>(ArrayLength(kAttributesHTML));
|
||||
for (uint32_t i = 0; kAttributesHTML[i]; i++) {
|
||||
sAttributesHTML->PutEntry(*kAttributesHTML[i]);
|
||||
}
|
||||
|
||||
sPresAttributesHTML = new nsTHashtable<nsISupportsHashKey> ();
|
||||
sPresAttributesHTML->Init(ArrayLength(kPresAttributesHTML));
|
||||
sPresAttributesHTML = new nsTHashtable<nsISupportsHashKey>(ArrayLength(kPresAttributesHTML));
|
||||
for (uint32_t i = 0; kPresAttributesHTML[i]; i++) {
|
||||
sPresAttributesHTML->PutEntry(*kPresAttributesHTML[i]);
|
||||
}
|
||||
|
||||
sElementsSVG = new nsTHashtable<nsISupportsHashKey> ();
|
||||
sElementsSVG->Init(ArrayLength(kElementsSVG));
|
||||
sElementsSVG = new nsTHashtable<nsISupportsHashKey>(ArrayLength(kElementsSVG));
|
||||
for (uint32_t i = 0; kElementsSVG[i]; i++) {
|
||||
sElementsSVG->PutEntry(*kElementsSVG[i]);
|
||||
}
|
||||
|
||||
sAttributesSVG = new nsTHashtable<nsISupportsHashKey> ();
|
||||
sAttributesSVG->Init(ArrayLength(kAttributesSVG));
|
||||
sAttributesSVG = new nsTHashtable<nsISupportsHashKey>(ArrayLength(kAttributesSVG));
|
||||
for (uint32_t i = 0; kAttributesSVG[i]; i++) {
|
||||
sAttributesSVG->PutEntry(*kAttributesSVG[i]);
|
||||
}
|
||||
|
||||
sElementsMathML = new nsTHashtable<nsISupportsHashKey> ();
|
||||
sElementsMathML->Init(ArrayLength(kElementsMathML));
|
||||
sElementsMathML = new nsTHashtable<nsISupportsHashKey>(ArrayLength(kElementsMathML));
|
||||
for (uint32_t i = 0; kElementsMathML[i]; i++) {
|
||||
sElementsMathML->PutEntry(*kElementsMathML[i]);
|
||||
}
|
||||
|
||||
sAttributesMathML = new nsTHashtable<nsISupportsHashKey> ();
|
||||
sAttributesMathML->Init(ArrayLength(kAttributesMathML));
|
||||
sAttributesMathML = new nsTHashtable<nsISupportsHashKey>(ArrayLength(kAttributesMathML));
|
||||
for (uint32_t i = 0; kAttributesMathML[i]; i++) {
|
||||
sAttributesMathML->PutEntry(*kAttributesMathML[i]);
|
||||
}
|
||||
|
@ -301,8 +301,6 @@ nsXMLHttpRequest::nsXMLHttpRequest()
|
||||
mResultArrayBuffer(nullptr),
|
||||
mXPCOMifier(nullptr)
|
||||
{
|
||||
mAlreadySetHeaders.Init();
|
||||
|
||||
SetIsDOMBinding();
|
||||
#ifdef DEBUG
|
||||
StaticAssertions();
|
||||
|
@ -651,7 +651,7 @@ MOCHITEST_FILES_C= \
|
||||
test_CSP_bug663567.html \
|
||||
file_CSP_bug663567_allows.xml \
|
||||
file_CSP_bug663567_allows.xml^headers^ \
|
||||
file_CSP_bug663567_allows.xsl \
|
||||
file_CSP_bug663567.xsl \
|
||||
file_CSP_bug663567_blocks.xml \
|
||||
file_CSP_bug663567_blocks.xml^headers^ \
|
||||
test_CSP_bug802872.html \
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<?xml-stylesheet type="text/xsl" href="file_CSP_bug663567_allows.xsl"?>
|
||||
<?xml-stylesheet type="text/xsl" href="file_CSP_bug663567.xsl"?>
|
||||
<catalog>
|
||||
<cd>
|
||||
<title>Empire Burlesque</title>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<?xml-stylesheet type="text/xsl" href="http://example.org/tests/content/base/test/file_CSP_bug663567_blocks.xsl"?>
|
||||
<?xml-stylesheet type="text/xsl" href="file_CSP_bug663567.xsl"?>
|
||||
<catalog>
|
||||
<cd>
|
||||
<title>Empire Burlesque</title>
|
||||
|
@ -1 +1 @@
|
||||
Content-Security-Policy: default-src 'self'
|
||||
Content-Security-Policy: default-src *.example.com
|
||||
|
@ -34,7 +34,7 @@ function checkAllowed () {
|
||||
* Content-Security-Policy: default-src 'self'
|
||||
*
|
||||
* we load the xsl file using:
|
||||
* <?xml-stylesheet type="text/xsl" href="file_CSP_bug663467_allows.xsl"?>
|
||||
* <?xml-stylesheet type="text/xsl" href="file_CSP_bug663467.xsl"?>
|
||||
*/
|
||||
try {
|
||||
var cspframe = document.getElementById('xsltframe');
|
||||
@ -49,11 +49,10 @@ function checkAllowed () {
|
||||
|
||||
function checkBlocked () {
|
||||
/* The policy for this test is:
|
||||
* Content-Security-Policy: default-src 'self'
|
||||
* Content-Security-Policy: default-src *.example.com
|
||||
*
|
||||
* we load the xsl file using:
|
||||
* <?xml-stylesheet type="text/xsl"
|
||||
* href="http://example.org/tests/content/base/test/file_CSP_bug663467_blocks.xsl"?>
|
||||
* <?xml-stylesheet type="text/xsl" href="file_CSP_bug663467.xsl"?>
|
||||
*/
|
||||
try {
|
||||
var cspframe = document.getElementById('xsltframe2');
|
||||
|
@ -97,7 +97,6 @@ public:
|
||||
sPrefsInitialized = true;
|
||||
Preferences::AddIntVarCache(&sCanvasImageCacheLimit, "canvas.image.cache.limit", 0);
|
||||
}
|
||||
mCache.Init();
|
||||
}
|
||||
~ImageCache() {
|
||||
AgeAllGenerations();
|
||||
|
@ -77,7 +77,6 @@ WebGLProgram::UpdateInfo()
|
||||
|
||||
if (!mUniformInfoMap) {
|
||||
mUniformInfoMap = new CStringToUniformInfoMap;
|
||||
mUniformInfoMap->Init();
|
||||
for (size_t i = 0; i < mAttachedShaders.Length(); i++) {
|
||||
for (size_t j = 0; j < mAttachedShaders[i]->mUniforms.Length(); j++) {
|
||||
const WebGLMappedIdentifier& uniform = mAttachedShaders[i]->mUniforms[j];
|
||||
|
@ -136,7 +136,6 @@ WebGLProgram::MapIdentifier(const nsACString& name, nsCString *mappedName) {
|
||||
if (!mIdentifierMap) {
|
||||
// if the identifier map doesn't exist yet, build it now
|
||||
mIdentifierMap = new CStringMap;
|
||||
mIdentifierMap->Init();
|
||||
for (size_t i = 0; i < mAttachedShaders.Length(); i++) {
|
||||
for (size_t j = 0; j < mAttachedShaders[i]->mAttributes.Length(); j++) {
|
||||
const WebGLMappedIdentifier& attrib = mAttachedShaders[i]->mAttributes[j];
|
||||
@ -182,7 +181,6 @@ WebGLProgram::ReverseMapIdentifier(const nsACString& name, nsCString *reverseMap
|
||||
if (!mIdentifierReverseMap) {
|
||||
// if the identifier reverse map doesn't exist yet, build it now
|
||||
mIdentifierReverseMap = new CStringMap;
|
||||
mIdentifierReverseMap->Init();
|
||||
for (size_t i = 0; i < mAttachedShaders.Length(); i++) {
|
||||
for (size_t j = 0; j < mAttachedShaders[i]->mAttributes.Length(); j++) {
|
||||
const WebGLMappedIdentifier& attrib = mAttachedShaders[i]->mAttributes[j];
|
||||
|
@ -13,15 +13,13 @@ nsDOMDataContainerEvent::nsDOMDataContainerEvent(
|
||||
nsEvent* aEvent)
|
||||
: nsDOMEvent(aOwner, aPresContext, aEvent)
|
||||
{
|
||||
mData.Init();
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMDataContainerEvent)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsDOMDataContainerEvent,
|
||||
nsDOMEvent)
|
||||
if (tmp->mData.IsInitialized())
|
||||
tmp->mData.Clear();
|
||||
tmp->mData.Clear();
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsDOMDataContainerEvent,
|
||||
@ -41,8 +39,6 @@ nsDOMDataContainerEvent::GetData(const nsAString& aKey, nsIVariant **aData)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aData);
|
||||
|
||||
NS_ENSURE_STATE(mData.IsInitialized());
|
||||
|
||||
mData.Get(aKey, aData);
|
||||
return NS_OK;
|
||||
}
|
||||
@ -54,7 +50,6 @@ nsDOMDataContainerEvent::SetData(const nsAString& aKey, nsIVariant *aData)
|
||||
|
||||
// Make sure this event isn't already being dispatched.
|
||||
NS_ENSURE_STATE(!mEvent->mFlags.mIsBeingDispatched);
|
||||
NS_ENSURE_STATE(mData.IsInitialized());
|
||||
mData.Put(aKey, aData);
|
||||
return NS_OK;
|
||||
}
|
||||
@ -101,4 +96,3 @@ nsDOMDataContainerEvent::TraverseEntry(const nsAString& aKey,
|
||||
|
||||
return PL_DHASH_NEXT;
|
||||
}
|
||||
|
||||
|
@ -95,6 +95,7 @@ MOCHITEST_FILES = \
|
||||
test_bug847597.html \
|
||||
test_bug855741.html \
|
||||
test_dblclick_explicit_original_target.html \
|
||||
test_all_synthetic_events.html \
|
||||
$(NULL)
|
||||
|
||||
ifeq (,$(filter gonk,$(MOZ_WIDGET_TOOLKIT)))
|
||||
|
439
content/events/test/test_all_synthetic_events.html
Normal file
439
content/events/test/test_all_synthetic_events.html
Normal file
@ -0,0 +1,439 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test all synthetic events</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
|
||||
/**
|
||||
* kEventConstructors is a helper and database of all events.
|
||||
* The sort order of the definition is by A to Z (ignore the Event postfix).
|
||||
*
|
||||
* XXX: should we move this into EventUtils.js?
|
||||
*
|
||||
* create: function or null. If this is null, it's impossible to create untrusted event for it.
|
||||
* Otherwise, create(aName, aProps) returns an instance of the event initialized with aProps.
|
||||
* aName specifies the event's type name. See each create() code for the detail of aProps.
|
||||
*/
|
||||
const kEventConstructors = {
|
||||
Event: { create: function (aName, aProps) {
|
||||
return new Event(aName, aProps);
|
||||
},
|
||||
},
|
||||
AnimationEvent: { create: function (aName, aProps) {
|
||||
return new AnimationEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
AudioProcessingEvent: { create: null, // Cannot create untrusted event from JS.
|
||||
},
|
||||
BeforeUnloadEvent: { create: function (aName, aProps) {
|
||||
var e = document.createEvent("beforeunloadevent");
|
||||
e.initEvent(aName, aProps.bubbles, aProps.cancelable);
|
||||
return e;
|
||||
},
|
||||
},
|
||||
BlobEvent: { create: function (aName, aProps) {
|
||||
return new BlobEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
BluetoothDeviceEvent: { create: function (aName, aProps) {
|
||||
return new BluetoothDeviceEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
BluetoothStatusChangedEvent: { create: function (aName, aProps) {
|
||||
return new BluetoothStatusChangedEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
CallEvent: { create: function (aName, aProps) {
|
||||
return new CallEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
CFStateChangeEvent: { create: function (aName, aProps) {
|
||||
return new CFStateChangeEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
CloseEvent: { create: function (aName, aProps) {
|
||||
return new CloseEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
ClipboardEvent: { create: function (aName, aProps) {
|
||||
return new ClipboardEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
CommandEvent: { create: function (aName, aProps) {
|
||||
var e = document.createEvent("commandevent");
|
||||
e.initCommandEvent(aName, aProps.bubbles, aProps.cancelable,
|
||||
aProps.command);
|
||||
return e;
|
||||
},
|
||||
},
|
||||
CompositionEvent: { create: function (aName, aProps) {
|
||||
var e = document.createEvent("compositionevent");
|
||||
e.initCompositionEvent(aName, aProps.bubbles, aProps.cancelable,
|
||||
aProps.view, aProps.data, aProps.locale);
|
||||
return e;
|
||||
},
|
||||
},
|
||||
CustomEvent: { create: function (aName, aProps) {
|
||||
return new CustomEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
DataErrorEvent: { create: function (aName, aProps) {
|
||||
return new DataErrorEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
DataContainerEvent: { create: function (aName, aProps) {
|
||||
var e = document.createEvent("datacontainerevent");
|
||||
e.initEvent(aName, aProps.bubbles, aProps.cancelable);
|
||||
return e;
|
||||
},
|
||||
},
|
||||
DeviceLightEvent: { create: function (aName, aProps) {
|
||||
return new DeviceLightEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
DeviceMotionEvent: { create: function (aName, aProps) {
|
||||
var e = document.createEvent("devicemotionevent");
|
||||
e.initDeviceMotionEvent(aName, aProps.bubbles, aProps.cancelable, aProps.acceleration,
|
||||
aProps.accelerationIncludingGravity, aProps.rotationRate,
|
||||
aProps.interval || 0.0);
|
||||
return e;
|
||||
},
|
||||
},
|
||||
DeviceOrientationEvent: { create: function (aName, aProps) {
|
||||
return new DeviceOrientationEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
DeviceProximityEvent: { create: function (aName, aProps) {
|
||||
return new DeviceProximityEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
DeviceStorageChangeEvent: { create: function (aName, aProps) {
|
||||
return new DeviceStorageChangeEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
DOMTransactionEvent: { create: function (aName, aProps) {
|
||||
return new DOMTransactionEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
DragEvent: { create: function (aName, aProps) {
|
||||
var e = document.createEvent("dragevent");
|
||||
e.initDragEvent(aName, aProps.bubbles, aProps.cancelable,
|
||||
aProps.view, aProps.detail,
|
||||
aProps.screenX, aProps.screenY,
|
||||
aProps.clientX, aProps.clientY,
|
||||
aProps.ctrlKey, aProps.altKey, aProps.shiftKey, aProps.metaKey,
|
||||
aProps.button, aProps.relatedTarget, aProps.dataTransfer);
|
||||
return e;
|
||||
},
|
||||
},
|
||||
ElementReplaceEvent: { create: function (aName, aProps) {
|
||||
return new ElementReplaceEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
FocusEvent: { create: function (aName, aProps) {
|
||||
return new FocusEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
GamepadEvent: { create: function (aName, aProps) {
|
||||
return new GamepadEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
GamepadAxisMoveEvent: { create: function (aName, aProps) {
|
||||
return new GamepadAxisMoveEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
GamepadButtonEvent: { create: function (aName, aProps) {
|
||||
return new GamepadButtonEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
HashChangeEvent: { create: function (aName, aProps) {
|
||||
return new HashChangeEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
IccCardLockErrorEvent: { create: function (aName, aProps) {
|
||||
return new IccCardLockErrorEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
IDBVersionChangeEvent: { create: function (aName, aProps) {
|
||||
return new IDBVersionChangeEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
KeyEvent: { create: function (aName, aProps) {
|
||||
var e = document.createEvent("keyboardevent");
|
||||
e.initKeyEvent(aName, aProps.bubbles, aProps.cancelable,
|
||||
aProps.view,
|
||||
aProps.ctrlKey, aProps.altKey, aProps.shiftKey, aProps.metaKey,
|
||||
aProps.keyCode, aProps.charCode);
|
||||
return e;
|
||||
},
|
||||
},
|
||||
KeyboardEvent: { create: function (aName, aProps) {
|
||||
var e = document.createEvent("keyboardevent");
|
||||
e.initKeyEvent(aName, aProps.bubbles, aProps.cancelable,
|
||||
aProps.view, aProps.ctrlKey, aProps.altKey, aProps.shiftKey, aProps.metaKey,
|
||||
aProps.keyCode, aProps.charCode);
|
||||
return e;
|
||||
},
|
||||
},
|
||||
MediaStreamEvent: { create: function (aName, aProps) {
|
||||
return new MediaStreamEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
MessageEvent: { create: function (aName, aProps) {
|
||||
var e = document.createEvent("messageevent");
|
||||
e.initMessageEvent(aName, aProps.bubbles, aProps.cancelable,
|
||||
aProps.data, aProps.origin,
|
||||
aProps.lastEventId, aProps.source);
|
||||
return e;
|
||||
},
|
||||
},
|
||||
MouseEvent: { create: function (aName, aProps) {
|
||||
return new MouseEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
MouseScrollEvent: { create: function (aName, aProps) {
|
||||
var e = document.createEvent("mousescrollevents");
|
||||
e.initMouseScrollEvent(aName, aProps.bubbles, aProps.cancelable,
|
||||
aProps.view, aProps.detail,
|
||||
aProps.screenX, aProps.screenY,
|
||||
aProps.clientX, aProps.clientY,
|
||||
aProps.ctrlKey, aProps.altKey, aProps.shiftKey, aProps.metaKey,
|
||||
aProps.button, aProps.relatedTarget, aProps.axis);
|
||||
return e;
|
||||
},
|
||||
},
|
||||
MozApplicationEvent: { create: function (aName, aProps) {
|
||||
return new MozApplicationEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
MozCellBroadcastEvent: { create: function (aName, aProps) {
|
||||
return new MozCellBroadcastEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
MozContactChangeEvent: { create: function (aName, aProps) {
|
||||
return new MozContactChangeEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
MozEmergencyCbModeEvent: { create: function (aName, aProps) {
|
||||
return new MozEmergencyCbModeEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
MozMmsEvent: { create: function (aName, aProps) {
|
||||
return new MozMmsEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
MozOtaStatusEvent: { create: function (aName, aProps) {
|
||||
return new MozOtaStatusEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
MozSettingsEvent: { create: function (aName, aProps) {
|
||||
return new MozSettingsEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
MozSmsEvent: { create: function (aName, aProps) {
|
||||
return new MozSmsEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
MozStkCommandEvent: { create: null, // Cannot create untrusted event from JS.
|
||||
},
|
||||
MozVoicemailEvent: { create: function (aName, aProps) {
|
||||
return new MozVoicemailEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
MozWifiConnectionInfoEvent: { create: function (aName, aProps) {
|
||||
return new MozWifiConnectionInfoEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
MozWifiStatusChangeEvent: { create: function (aName, aProps) {
|
||||
return new MozWifiStatusChangeEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
MutationEvent: { create: function (aName, aProps) {
|
||||
var e = document.createEvent("mutationevent");
|
||||
e.initMutationEvent(aName, aProps.bubbles, aProps.cancelable,
|
||||
aProps.relatedNode, aProps.prevValue, aProps.newValue,
|
||||
aProps.attrName, aProps.attrChange);
|
||||
return e;
|
||||
},
|
||||
},
|
||||
NotifyAudioAvailableEvent: { create: function (aName, aProps) {
|
||||
var e = document.createEvent("mozaudioavailableevent");
|
||||
e.initAudioAvailableEvent(aName, aProps.bubbles, aProps.cancelable,
|
||||
aProps.frameBuffer, aProps.frameBufferLength,
|
||||
aProps.time || 0.0, aProps.allowAudioData);
|
||||
return e;
|
||||
},
|
||||
},
|
||||
NotifyPaintEvent: { create: function (aName, aProps) {
|
||||
var e = document.createEvent("notifypaintevent");
|
||||
e.initEvent(aName, aProps.bubbles, aProps.cancelable);
|
||||
return e;
|
||||
},
|
||||
},
|
||||
OfflineAudioCompletionEvent: { create: null, // Cannot create untrusted event from JS.
|
||||
},
|
||||
PageTransitionEvent: { create: function (aName, aProps) {
|
||||
return new PageTransitionEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
PopStateEvent: { create: function (aName, aProps) {
|
||||
return new PopStateEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
PopupBlockedEvent: { create: function (aName, aProps) {
|
||||
return new PopupBlockedEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
ProgressEvent: { create: function (aName, aProps) {
|
||||
return new ProgressEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
RecordErrorEvent: { create: function (aName, aProps) {
|
||||
return new RecordErrorEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
RTCDataChannelEvent: { create: function (aName, aProps) {
|
||||
return new RTCDataChannelEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
RTCPeerConnectionIceEvent: { create: function (aName, aProps) {
|
||||
return new RTCPeerConnectionIceEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
ScrollAreaEvent: { create: function (aName, aProps) {
|
||||
var e = document.createEvent("scrollareaevent");
|
||||
e.initScrollAreaEvent(aName, aProps.bubbles, aProps.cancelable,
|
||||
aProps.view, aProps.details,
|
||||
aProps.x || 0.0, aProps.y || 0.0,
|
||||
aProps.width || 0.0, aProps.height || 0.0);
|
||||
return e;
|
||||
},
|
||||
},
|
||||
SimpleGestureEvent: { create: function (aName, aProps) {
|
||||
var e = document.createEvent("simplegestureevent");
|
||||
e.initSimpleGestureEvent(aName, aProps.bubbles, aProps.cancelable,
|
||||
aProps.view, aProps.detail,
|
||||
aProps.screenX, aProps.screenY,
|
||||
aProps.clientX, aProps.clientY,
|
||||
aProps.ctrlKey, aProps.altKey, aProps.shiftKey, aProps.metaKey,
|
||||
aProps.button, aProps.relatedTarget,
|
||||
aProps.allowedDirections, aProps.direction, aProps.delta || 0.0,
|
||||
aProps.clickCount);
|
||||
return e;
|
||||
},
|
||||
},
|
||||
SmartCardEvent: { create: function (aName, aProps) {
|
||||
return new SmartCardEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
SpeechRecognitionEvent: { create: function (aName, aProps) {
|
||||
return new SpeechRecognitionEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
SpeechSynthesisEvent: { create: function (aName, aProps) {
|
||||
return new SpeechSynthesisEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
StorageEvent: { create: function (aName, aProps) {
|
||||
return new StorageEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
StyleRuleChangeEvent: { create: function (aName, aProps) {
|
||||
return new StyleRuleChangeEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
StyleSheetApplicableStateChangeEvent: { create: function (aName, aProps) {
|
||||
return new StyleSheetApplicableStateChangeEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
StyleSheetChangeEvent: { create: function (aName, aProps) {
|
||||
return new StyleSheetChangeEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
SVGZoomEvent: { create: function (aName, aProps) {
|
||||
var e = document.createEvent("svgzoomevent");
|
||||
e.initUIEvent(aName, aProps.bubbles, aProps.cancelable,
|
||||
aProps.view, aProps.detail);
|
||||
return e;
|
||||
},
|
||||
},
|
||||
TimeEvent: { create: function (aName, aProps) {
|
||||
var e = document.createEvent("timeevent");
|
||||
e.initTimeEvent(aName, aProps.view, aProps.detail);
|
||||
return e;
|
||||
},
|
||||
},
|
||||
TouchEvent: { create: function (aName, aProps) {
|
||||
var e = document.createEvent("touchevent");
|
||||
e.initTouchEvent(aName, aProps.bubbles, aProps.cancelable,
|
||||
aProps.view, aProps.detail,
|
||||
aProps.ctrlKey, aProps.altKey, aProps.shiftKey, aProps.metaKey,
|
||||
aProps.touches, aProps.targetTouches, aProps.changedTouches);
|
||||
return e;
|
||||
},
|
||||
},
|
||||
TransitionEvent: { create: function (aName, aProps) {
|
||||
return new TransitionEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
UIEvent: { create: function (aName, aProps) {
|
||||
return new UIEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
UserProximityEvent: { create: function (aName, aProps) {
|
||||
return new UserProximityEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
USSDReceivedEvent: { create: function (aName, aProps) {
|
||||
return new USSDReceivedEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
WheelEvent: { create: function (aName, aProps) {
|
||||
return new WheelEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
var props = Object.getOwnPropertyNames(window);
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
// Assume that event object must be named as "FooBarEvent".
|
||||
if (!props[i].match(/^([A-Z][a-zA-Z]+)?Event$/)) {
|
||||
continue;
|
||||
}
|
||||
if (!kEventConstructors[props[i]]) {
|
||||
ok(false, "Unknown event found: " + props[i]);
|
||||
continue;
|
||||
}
|
||||
if (!kEventConstructors[props[i]].create) {
|
||||
todo(false, "Cannot create untrusted event of " + props[i]);
|
||||
continue;
|
||||
}
|
||||
ok(true, "Creating " + props[i] + "...");
|
||||
var event = kEventConstructors[props[i]].create("foo", {});
|
||||
if (!event) {
|
||||
ok(false, "Failed to create untrusted event: " + props[i]);
|
||||
continue;
|
||||
}
|
||||
if (typeof(event.getModifierState) == "function") {
|
||||
const kModifiers = [ "Shift", "Control", "Alt", "AltGr", "Meta", "CapsLock", "ScrollLock", "NumLock", "OS", "Fn", "SymbolLock" ];
|
||||
for (var j = 0; j < kModifiers.length; j++) {
|
||||
ok(true, "Calling " + props[i] + ".getModifierState(" + kModifiers[j] + ")...");
|
||||
var modifierState = event.getModifierState(kModifiers[j]);
|
||||
ok(true, props[i] + ".getModifierState(" + kModifiers[j] + ") = " + modifierState);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
@ -105,8 +105,6 @@ public:
|
||||
nsFormControlList(HTMLFormElement* aForm);
|
||||
virtual ~nsFormControlList();
|
||||
|
||||
nsresult Init();
|
||||
|
||||
void DropFormReference();
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
@ -232,6 +230,9 @@ ShouldBeInElements(nsIFormControl* aFormControl)
|
||||
|
||||
HTMLFormElement::HTMLFormElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
: nsGenericHTMLElement(aNodeInfo),
|
||||
mSelectedRadioButtons(4),
|
||||
mRequiredRadioButtonCounts(4),
|
||||
mValueMissingRadioGroups(4),
|
||||
mGeneratingSubmit(false),
|
||||
mGeneratingReset(false),
|
||||
mIsSubmitting(false),
|
||||
@ -245,11 +246,11 @@ HTMLFormElement::HTMLFormElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
mDefaultSubmitElement(nullptr),
|
||||
mFirstSubmitInElements(nullptr),
|
||||
mFirstSubmitNotInElements(nullptr),
|
||||
mImageNameLookupTable(NS_FORM_CONTROL_LIST_HASHTABLE_SIZE),
|
||||
mPastNameLookupTable(NS_FORM_CONTROL_LIST_HASHTABLE_SIZE),
|
||||
mInvalidElementsCount(0),
|
||||
mEverTriedInvalidSubmit(false)
|
||||
{
|
||||
mImageNameLookupTable.Init(NS_FORM_CONTROL_LIST_HASHTABLE_SIZE);
|
||||
mPastNameLookupTable.Init(NS_FORM_CONTROL_LIST_HASHTABLE_SIZE);
|
||||
}
|
||||
|
||||
HTMLFormElement::~HTMLFormElement()
|
||||
@ -265,19 +266,6 @@ nsresult
|
||||
HTMLFormElement::Init()
|
||||
{
|
||||
mControls = new nsFormControlList(this);
|
||||
|
||||
nsresult rv = mControls->Init();
|
||||
|
||||
if (NS_FAILED(rv))
|
||||
{
|
||||
mControls = nullptr;
|
||||
return rv;
|
||||
}
|
||||
|
||||
mSelectedRadioButtons.Init(4);
|
||||
mRequiredRadioButtonCounts.Init(4);
|
||||
mValueMissingRadioGroups.Init(4);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -2351,7 +2339,8 @@ nsFormControlList::nsFormControlList(HTMLFormElement* aForm) :
|
||||
mForm(aForm),
|
||||
// Initialize the elements list to have an initial capacity
|
||||
// of 8 to reduce allocations on small forms.
|
||||
mElements(8)
|
||||
mElements(8),
|
||||
mNameLookupTable(NS_FORM_CONTROL_LIST_HASHTABLE_SIZE)
|
||||
{
|
||||
SetIsDOMBinding();
|
||||
}
|
||||
@ -2362,12 +2351,6 @@ nsFormControlList::~nsFormControlList()
|
||||
Clear();
|
||||
}
|
||||
|
||||
nsresult nsFormControlList::Init()
|
||||
{
|
||||
mNameLookupTable.Init(NS_FORM_CONTROL_LIST_HASHTABLE_SIZE);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsFormControlList::DropFormReference()
|
||||
{
|
||||
|
@ -1845,7 +1845,6 @@ HTMLMediaElement::AddMediaElementToURITable()
|
||||
"Should not have entry for element in element table before addition");
|
||||
if (!gElementTable) {
|
||||
gElementTable = new MediaElementURITable();
|
||||
gElementTable->Init();
|
||||
}
|
||||
MediaElementSetForURI* entry = gElementTable->PutEntry(mLoadingSrc);
|
||||
entry->mElements.AppendElement(this);
|
||||
|
@ -50,7 +50,6 @@ HTMLPropertiesCollection::HTMLPropertiesCollection(nsGenericHTMLElement* aRoot)
|
||||
if (mDoc) {
|
||||
mDoc->AddMutationObserver(this);
|
||||
}
|
||||
mNamedItemEntries.Init();
|
||||
}
|
||||
|
||||
HTMLPropertiesCollection::~HTMLPropertiesCollection()
|
||||
|
@ -850,7 +850,6 @@ MediaCache::SwapBlocks(int32_t aBlockIndex1, int32_t aBlockIndex2)
|
||||
mFreeBlocks.NotifyBlockSwapped(aBlockIndex1, aBlockIndex2);
|
||||
|
||||
nsTHashtable<nsPtrHashKey<MediaCacheStream> > visitedStreams;
|
||||
visitedStreams.Init();
|
||||
|
||||
for (int32_t i = 0; i < 2; ++i) {
|
||||
for (uint32_t j = 0; j < blocks[i]->mOwners.Length(); ++j) {
|
||||
|
@ -363,7 +363,7 @@ private:
|
||||
*/
|
||||
class BlockList {
|
||||
public:
|
||||
BlockList() : mFirstBlock(-1), mCount(0) { mEntries.Init(); }
|
||||
BlockList() : mFirstBlock(-1), mCount(0) {}
|
||||
~BlockList() {
|
||||
NS_ASSERTION(mFirstBlock == -1 && mCount == 0,
|
||||
"Destroying non-empty block list");
|
||||
|
@ -664,7 +664,6 @@ VorbisState::GetTags()
|
||||
NS_ASSERTION(mComment.user_comments, "no vorbis comment strings!");
|
||||
NS_ASSERTION(mComment.comment_lengths, "no vorbis comment lengths!");
|
||||
tags = new MetadataTags;
|
||||
tags->Init();
|
||||
for (int i = 0; i < mComment.comments; i++) {
|
||||
AddVorbisComment(tags, mComment.user_comments[i],
|
||||
mComment.comment_lengths[i]);
|
||||
@ -1066,7 +1065,6 @@ MetadataTags* OpusState::GetTags()
|
||||
MetadataTags* tags;
|
||||
|
||||
tags = new MetadataTags;
|
||||
tags->Init();
|
||||
for (uint32_t i = 0; i < mTags.Length(); i++) {
|
||||
AddVorbisComment(tags, mTags[i].Data(), mTags[i].Length());
|
||||
}
|
||||
@ -1543,7 +1541,6 @@ bool SkeletonState::DecodeHeader(ogg_packet* aPacket)
|
||||
LOG(PR_LOG_DEBUG, ("Skeleton segment length: %lld", mLength));
|
||||
|
||||
// Initialize the serialno-to-index map.
|
||||
mIndex.Init();
|
||||
return true;
|
||||
} else if (IsSkeletonIndex(aPacket) && mVersion >= SKELETON_VERSION(4,0)) {
|
||||
return DecodeIndex(aPacket);
|
||||
|
@ -447,7 +447,7 @@ public:
|
||||
nsSeekTarget& aResult);
|
||||
|
||||
bool HasIndex() const {
|
||||
return mIndex.IsInitialized() && mIndex.Count() > 0;
|
||||
return mIndex.Count() > 0;
|
||||
}
|
||||
|
||||
// Returns the duration of the active tracks in the media, if we have
|
||||
|
@ -1876,7 +1876,6 @@ nsresult OggReader::GetBuffered(TimeRanges* aBuffered, int64_t aStartTime)
|
||||
OggCodecStore::OggCodecStore()
|
||||
: mMonitor("CodecStore")
|
||||
{
|
||||
mCodecStates.Init();
|
||||
}
|
||||
|
||||
void OggCodecStore::Add(uint32_t serial, OggCodecState* codecState)
|
||||
|
@ -577,7 +577,6 @@ WaveReader::LoadListChunk(uint32_t aChunkSize,
|
||||
const char* const end = chunk.get() + aChunkSize;
|
||||
|
||||
aTags = new HTMLMediaElement::MetadataTags;
|
||||
aTags->Init();
|
||||
|
||||
while (p + 8 < end) {
|
||||
uint32_t id = ReadUint32BE(&p);
|
||||
|
@ -62,11 +62,6 @@ AudioContext::AudioContext(nsPIDOMWindow* aWindow,
|
||||
mDestination->Stream()->AddAudioOutput(&gWebAudioOutputKey);
|
||||
nsDOMEventTargetHelper::BindToOwner(aWindow);
|
||||
SetIsDOMBinding();
|
||||
|
||||
mPannerNodes.Init();
|
||||
mAudioBufferSourceNodes.Init();
|
||||
mOscillatorNodes.Init();
|
||||
mScriptProcessorNodes.Init();
|
||||
}
|
||||
|
||||
AudioContext::~AudioContext()
|
||||
|
@ -45,7 +45,6 @@ TemporaryRef<HRTFDatabaseLoader> HRTFDatabaseLoader::createAndLoadAsynchronously
|
||||
|
||||
if (!s_loaderMap) {
|
||||
s_loaderMap = new nsTHashtable<LoaderByRateEntry>();
|
||||
s_loaderMap->Init();
|
||||
}
|
||||
|
||||
LoaderByRateEntry* entry = s_loaderMap->PutEntry(sampleRate);
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
#define VIDEO_RATE USECS_PER_S
|
||||
#define AUDIO_RATE 16000
|
||||
|
||||
#define AUDIO_FRAME_LENGTH ((AUDIO_RATE * MediaEngine::DEFAULT_AUDIO_TIMER_MS) / 1000)
|
||||
namespace mozilla {
|
||||
|
||||
NS_IMPL_ISUPPORTS1(MediaEngineDefaultVideoSource, nsITimerCallback)
|
||||
@ -258,6 +258,51 @@ MediaEngineDefaultVideoSource::NotifyPull(MediaStreamGraph* aGraph,
|
||||
}
|
||||
}
|
||||
|
||||
// generate 1k sine wave per second
|
||||
class SineWaveGenerator : public RefCounted<SineWaveGenerator>
|
||||
{
|
||||
public:
|
||||
static const int bytesPerSample = 2;
|
||||
static const int millisecondsPerSecond = 1000;
|
||||
static const int frequency = 1000;
|
||||
|
||||
SineWaveGenerator(int aSampleRate) :
|
||||
mTotalLength(aSampleRate / frequency),
|
||||
mReadLength(0) {
|
||||
MOZ_ASSERT(mTotalLength * frequency == aSampleRate);
|
||||
mAudioBuffer = new int16_t[mTotalLength];
|
||||
for(int i = 0; i < mTotalLength; i++) {
|
||||
// Set volume to -20db. It's from 32768.0 * 10^(-20/20) = 3276.8
|
||||
mAudioBuffer[i] = (3276.8f * sin(2 * M_PI * i / mTotalLength));
|
||||
}
|
||||
}
|
||||
|
||||
void generate(int16_t* aBuffer, int16_t aLengthInSamples) {
|
||||
int16_t remaining = aLengthInSamples;
|
||||
|
||||
while (remaining) {
|
||||
int16_t processSamples = 0;
|
||||
|
||||
if (mTotalLength - mReadLength >= remaining) {
|
||||
processSamples = remaining;
|
||||
} else {
|
||||
processSamples = mTotalLength - mReadLength;
|
||||
}
|
||||
memcpy(aBuffer, mAudioBuffer + mReadLength, processSamples * bytesPerSample);
|
||||
aBuffer += processSamples;
|
||||
mReadLength += processSamples;
|
||||
remaining -= processSamples;
|
||||
if (mReadLength == mTotalLength) {
|
||||
mReadLength = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
nsAutoArrayPtr<int16_t> mAudioBuffer;
|
||||
int16_t mTotalLength;
|
||||
int16_t mReadLength;
|
||||
};
|
||||
|
||||
/**
|
||||
* Default audio source.
|
||||
@ -295,6 +340,8 @@ MediaEngineDefaultAudioSource::Allocate(const MediaEnginePrefs &aPrefs)
|
||||
}
|
||||
|
||||
mState = kAllocated;
|
||||
// generate 1Khz sine wave
|
||||
mSineGenerator = new SineWaveGenerator(AUDIO_RATE);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -334,7 +381,7 @@ MediaEngineDefaultAudioSource::Start(SourceMediaStream* aStream, TrackID aID)
|
||||
|
||||
// 1 Audio frame per 10ms
|
||||
mTimer->InitWithCallback(this, MediaEngine::DEFAULT_AUDIO_TIMER_MS,
|
||||
nsITimer::TYPE_REPEATING_SLACK);
|
||||
nsITimer::TYPE_REPEATING_PRECISE);
|
||||
mState = kStarted;
|
||||
|
||||
return NS_OK;
|
||||
@ -370,10 +417,13 @@ NS_IMETHODIMP
|
||||
MediaEngineDefaultAudioSource::Notify(nsITimer* aTimer)
|
||||
{
|
||||
AudioSegment segment;
|
||||
nsRefPtr<SharedBuffer> buffer = SharedBuffer::Create(AUDIO_FRAME_LENGTH * sizeof(int16_t));
|
||||
int16_t* dest = static_cast<int16_t*>(buffer->Data());
|
||||
|
||||
// Notify timer is set every DEFAULT_AUDIO_TIMER_MS milliseconds.
|
||||
segment.InsertNullDataAtStart((AUDIO_RATE * MediaEngine::DEFAULT_AUDIO_TIMER_MS) / 1000);
|
||||
|
||||
mSineGenerator->generate(dest, AUDIO_FRAME_LENGTH);
|
||||
nsAutoTArray<const int16_t*,1> channels;
|
||||
channels.AppendElement(dest);
|
||||
segment.AppendFrames(buffer.forget(), channels, AUDIO_FRAME_LENGTH);
|
||||
mSource->AppendToTrack(mTrackID, &segment);
|
||||
|
||||
return NS_OK;
|
||||
|
@ -81,6 +81,8 @@ protected:
|
||||
int mCr;
|
||||
};
|
||||
|
||||
class SineWaveGenerator;
|
||||
|
||||
class MediaEngineDefaultAudioSource : public nsITimerCallback,
|
||||
public MediaEngineAudioSource
|
||||
{
|
||||
@ -117,6 +119,7 @@ protected:
|
||||
nsCOMPtr<nsITimer> mTimer;
|
||||
|
||||
SourceMediaStream* mSource;
|
||||
nsRefPtr<SineWaveGenerator> mSineGenerator;
|
||||
};
|
||||
|
||||
|
||||
|
@ -355,8 +355,6 @@ public:
|
||||
, mCameraManager(aCameraManager)
|
||||
, mWindowId(aWindowId)
|
||||
{
|
||||
mVideoSources.Init();
|
||||
mAudioSources.Init();
|
||||
}
|
||||
#else
|
||||
MediaEngineWebRTC()
|
||||
@ -366,8 +364,6 @@ public:
|
||||
, mVideoEngineInit(false)
|
||||
, mAudioEngineInit(false)
|
||||
{
|
||||
mVideoSources.Init();
|
||||
mAudioSources.Init();
|
||||
}
|
||||
#endif
|
||||
~MediaEngineWebRTC() { Shutdown(); }
|
||||
|
@ -77,12 +77,10 @@ SpeechSynthesis::SpeechSynthesis(nsPIDOMWindow* aParent)
|
||||
: mParent(aParent)
|
||||
{
|
||||
SetIsDOMBinding();
|
||||
mVoiceCache.Init();
|
||||
}
|
||||
|
||||
SpeechSynthesis::~SpeechSynthesis()
|
||||
{
|
||||
mVoiceCache.Clear();
|
||||
}
|
||||
|
||||
JSObject*
|
||||
|
@ -102,8 +102,6 @@ NS_IMPL_ISUPPORTS1(nsSynthVoiceRegistry, nsISynthVoiceRegistry)
|
||||
nsSynthVoiceRegistry::nsSynthVoiceRegistry()
|
||||
: mSpeechSynthChild(nullptr)
|
||||
{
|
||||
mUriVoiceMap.Init();
|
||||
|
||||
if (XRE_GetProcessType() == GeckoProcessType_Content) {
|
||||
|
||||
mSpeechSynthChild = new SpeechSynthesisChild();
|
||||
|
@ -33,9 +33,6 @@ nsSMILAnimationController::nsSMILAnimationController(nsIDocument* aDoc)
|
||||
{
|
||||
NS_ABORT_IF_FALSE(aDoc, "need a non-null document");
|
||||
|
||||
mAnimationElementTable.Init();
|
||||
mChildContainerTable.Init();
|
||||
|
||||
nsRefreshDriver* refreshDriver = GetRefreshDriver();
|
||||
if (refreshDriver) {
|
||||
mStartTime = refreshDriver->MostRecentRefresh();
|
||||
@ -381,8 +378,7 @@ nsSMILAnimationController::DoSample(bool aSkipUnchangedContainers)
|
||||
//
|
||||
// When we sample the child time containers they will simply record the sample
|
||||
// time in document time.
|
||||
TimeContainerHashtable activeContainers;
|
||||
activeContainers.Init(mChildContainerTable.Count());
|
||||
TimeContainerHashtable activeContainers(mChildContainerTable.Count());
|
||||
SampleTimeContainerParams tcParams = { &activeContainers,
|
||||
aSkipUnchangedContainers };
|
||||
mChildContainerTable.EnumerateEntries(SampleTimeContainer, &tcParams);
|
||||
@ -409,8 +405,7 @@ nsSMILAnimationController::DoSample(bool aSkipUnchangedContainers)
|
||||
|
||||
// Create the compositor table
|
||||
nsAutoPtr<nsSMILCompositorTable>
|
||||
currentCompositorTable(new nsSMILCompositorTable());
|
||||
currentCompositorTable->Init(0);
|
||||
currentCompositorTable(new nsSMILCompositorTable(0));
|
||||
|
||||
SampleAnimationParams saParams = { &activeContainers,
|
||||
currentCompositorTable };
|
||||
|
@ -474,46 +474,35 @@ nsSMILParserUtils::ParseSemicolonDelimitedProgressList(const nsAString& aSpec,
|
||||
bool aNonDecreasing,
|
||||
nsTArray<double>& aArray)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
NS_ConvertUTF16toUTF8 spec(aSpec);
|
||||
const char* start = spec.BeginReading();
|
||||
const char* end = spec.EndReading();
|
||||
|
||||
SkipBeginWsp(start, end);
|
||||
nsCharSeparatedTokenizerTemplate<IsSpace> tokenizer(aSpec, ';');
|
||||
|
||||
double previousValue = -1.0;
|
||||
|
||||
while (start != end) {
|
||||
double value = GetFloat(start, end, &rv);
|
||||
if (NS_FAILED(rv))
|
||||
break;
|
||||
while (tokenizer.hasMoreTokens()) {
|
||||
NS_ConvertUTF16toUTF8 utf8Token(tokenizer.nextToken());
|
||||
const char *token = utf8Token.get();
|
||||
if (*token == '\0') {
|
||||
return NS_ERROR_FAILURE; // empty string (e.g. two ';' in a row)
|
||||
}
|
||||
|
||||
char *end;
|
||||
double value = PR_strtod(token, &end);
|
||||
if (*end != '\0') {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (value > 1.0 || value < 0.0 ||
|
||||
(aNonDecreasing && value < previousValue)) {
|
||||
rv = NS_ERROR_FAILURE;
|
||||
break;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (!aArray.AppendElement(value)) {
|
||||
rv = NS_ERROR_OUT_OF_MEMORY;
|
||||
break;
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
previousValue = value;
|
||||
|
||||
SkipBeginWsp(start, end);
|
||||
if (start == end)
|
||||
break;
|
||||
|
||||
if (*start++ != ';') {
|
||||
rv = NS_ERROR_FAILURE;
|
||||
break;
|
||||
}
|
||||
|
||||
SkipBeginWsp(start, end);
|
||||
}
|
||||
|
||||
return rv;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Helper class for ParseValues
|
||||
@ -571,7 +560,7 @@ nsresult
|
||||
nsSMILParserUtils::ParseValuesGeneric(const nsAString& aSpec,
|
||||
GenericValueParser& aParser)
|
||||
{
|
||||
nsCharSeparatedTokenizer tokenizer(aSpec, ';');
|
||||
nsCharSeparatedTokenizerTemplate<IsSpace> tokenizer(aSpec, ';');
|
||||
if (!tokenizer.hasMoreTokens()) { // Empty list
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
@ -232,7 +232,6 @@ nsSMILTimedElement::nsSMILTimedElement()
|
||||
mSimpleDur.SetIndefinite();
|
||||
mMin.SetMillis(0L);
|
||||
mMax.SetIndefinite();
|
||||
mTimeDependents.Init();
|
||||
}
|
||||
|
||||
nsSMILTimedElement::~nsSMILTimedElement()
|
||||
|
@ -22,11 +22,12 @@ template<class SimpleType, class TearoffType>
|
||||
class nsSVGAttrTearoffTable
|
||||
{
|
||||
public:
|
||||
#ifdef DEBUG
|
||||
~nsSVGAttrTearoffTable()
|
||||
{
|
||||
NS_ABORT_IF_FALSE(mTable.Count() == 0,
|
||||
"Tear-off objects remain in hashtable at shutdown.");
|
||||
NS_ABORT_IF_FALSE(!mTable, "Tear-off objects remain in hashtable at shutdown.");
|
||||
}
|
||||
#endif
|
||||
|
||||
TearoffType* GetTearoff(SimpleType* aSimple);
|
||||
|
||||
@ -38,14 +39,14 @@ private:
|
||||
typedef nsPtrHashKey<SimpleType> SimpleTypePtrKey;
|
||||
typedef nsDataHashtable<SimpleTypePtrKey, TearoffType* > TearoffTable;
|
||||
|
||||
TearoffTable mTable;
|
||||
TearoffTable* mTable;
|
||||
};
|
||||
|
||||
template<class SimpleType, class TearoffType>
|
||||
TearoffType*
|
||||
nsSVGAttrTearoffTable<SimpleType, TearoffType>::GetTearoff(SimpleType* aSimple)
|
||||
{
|
||||
if (!mTable.IsInitialized())
|
||||
if (!mTable)
|
||||
return nullptr;
|
||||
|
||||
TearoffType *tearoff = nullptr;
|
||||
@ -53,7 +54,7 @@ nsSVGAttrTearoffTable<SimpleType, TearoffType>::GetTearoff(SimpleType* aSimple)
|
||||
#ifdef DEBUG
|
||||
bool found =
|
||||
#endif
|
||||
mTable.Get(aSimple, &tearoff);
|
||||
mTable->Get(aSimple, &tearoff);
|
||||
NS_ABORT_IF_FALSE(!found || tearoff,
|
||||
"NULL pointer stored in attribute tear-off map");
|
||||
|
||||
@ -65,18 +66,18 @@ void
|
||||
nsSVGAttrTearoffTable<SimpleType, TearoffType>::AddTearoff(SimpleType* aSimple,
|
||||
TearoffType* aTearoff)
|
||||
{
|
||||
if (!mTable.IsInitialized()) {
|
||||
mTable.Init();
|
||||
if (!mTable) {
|
||||
mTable = new TearoffTable;
|
||||
}
|
||||
|
||||
// We shouldn't be adding a tear-off if there already is one. If that happens,
|
||||
// something is wrong.
|
||||
if (mTable.Get(aSimple, nullptr)) {
|
||||
if (mTable->Get(aSimple, nullptr)) {
|
||||
NS_ABORT_IF_FALSE(false, "There is already a tear-off for this object.");
|
||||
return;
|
||||
}
|
||||
|
||||
mTable.Put(aSimple, aTearoff);
|
||||
mTable->Put(aSimple, aTearoff);
|
||||
}
|
||||
|
||||
template<class SimpleType, class TearoffType>
|
||||
@ -84,13 +85,17 @@ void
|
||||
nsSVGAttrTearoffTable<SimpleType, TearoffType>::RemoveTearoff(
|
||||
SimpleType* aSimple)
|
||||
{
|
||||
if (!mTable.IsInitialized()) {
|
||||
if (!mTable) {
|
||||
// Perhaps something happened in between creating the SimpleType object and
|
||||
// registering it
|
||||
return;
|
||||
}
|
||||
|
||||
mTable.Remove(aSimple);
|
||||
mTable->Remove(aSimple);
|
||||
if (mTable->Count() == 0) {
|
||||
delete mTable;
|
||||
mTable = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // NS_SVGATTRTEAROFFTABLE_H_
|
||||
|
@ -190,14 +190,14 @@ NS_IMPL_CYCLE_COLLECTION_CLASS(nsBindingManager)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsBindingManager)
|
||||
tmp->mDestroyed = true;
|
||||
|
||||
if (tmp->mBoundContentSet.IsInitialized())
|
||||
tmp->mBoundContentSet.Clear();
|
||||
if (tmp->mBoundContentSet)
|
||||
tmp->mBoundContentSet->Clear();
|
||||
|
||||
if (tmp->mDocumentTable.IsInitialized())
|
||||
tmp->mDocumentTable.Clear();
|
||||
if (tmp->mDocumentTable)
|
||||
tmp->mDocumentTable->Clear();
|
||||
|
||||
if (tmp->mLoadingDocTable.IsInitialized())
|
||||
tmp->mLoadingDocTable.Clear();
|
||||
if (tmp->mLoadingDocTable)
|
||||
tmp->mLoadingDocTable->Clear();
|
||||
|
||||
if (tmp->mWrapperTable.ops)
|
||||
PL_DHashTableFinish(&(tmp->mWrapperTable));
|
||||
@ -237,10 +237,10 @@ LoadingDocHashtableTraverser(nsIURI* key,
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsBindingManager)
|
||||
// The hashes keyed on nsIContent are traversed from the nsIContent itself.
|
||||
if (tmp->mDocumentTable.IsInitialized())
|
||||
tmp->mDocumentTable.EnumerateRead(&DocumentInfoHashtableTraverser, &cb);
|
||||
if (tmp->mLoadingDocTable.IsInitialized())
|
||||
tmp->mLoadingDocTable.EnumerateRead(&LoadingDocHashtableTraverser, &cb);
|
||||
if (tmp->mDocumentTable)
|
||||
tmp->mDocumentTable->EnumerateRead(&DocumentInfoHashtableTraverser, &cb);
|
||||
if (tmp->mLoadingDocTable)
|
||||
tmp->mLoadingDocTable->EnumerateRead(&LoadingDocHashtableTraverser, &cb);
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAttachedStack)
|
||||
// No need to traverse mProcessAttachedQueueEvent, since it'll just
|
||||
// fire at some point or become revoke and drop its ref to us.
|
||||
@ -282,18 +282,17 @@ nsBindingManager::GetBindingWithContent(nsIContent* aContent)
|
||||
void
|
||||
nsBindingManager::AddBoundContent(nsIContent* aContent)
|
||||
{
|
||||
if (!mBoundContentSet.IsInitialized()) {
|
||||
mBoundContentSet.Init();
|
||||
if (!mBoundContentSet) {
|
||||
mBoundContentSet = new nsTHashtable<nsRefPtrHashKey<nsIContent> >;
|
||||
}
|
||||
|
||||
mBoundContentSet.PutEntry(aContent);
|
||||
mBoundContentSet->PutEntry(aContent);
|
||||
}
|
||||
|
||||
void
|
||||
nsBindingManager::RemoveBoundContent(nsIContent* aContent)
|
||||
{
|
||||
if (mBoundContentSet.IsInitialized()) {
|
||||
mBoundContentSet.RemoveEntry(aContent);
|
||||
if (mBoundContentSet) {
|
||||
mBoundContentSet->RemoveEntry(aContent);
|
||||
}
|
||||
|
||||
// The death of the bindings means the death of the JS wrapper.
|
||||
@ -556,9 +555,9 @@ void
|
||||
nsBindingManager::ExecuteDetachedHandlers()
|
||||
{
|
||||
// Walk our hashtable of bindings.
|
||||
if (mBoundContentSet.IsInitialized()) {
|
||||
if (mBoundContentSet) {
|
||||
BindingTableReadClosure closure;
|
||||
mBoundContentSet.EnumerateEntries(AccumulateBindingsToDetach, &closure);
|
||||
mBoundContentSet->EnumerateEntries(AccumulateBindingsToDetach, &closure);
|
||||
uint32_t i, count = closure.mBindings.Length();
|
||||
for (i = 0; i < count; ++i) {
|
||||
closure.mBindings[i]->ExecuteDetachedHandler();
|
||||
@ -571,11 +570,11 @@ nsBindingManager::PutXBLDocumentInfo(nsXBLDocumentInfo* aDocumentInfo)
|
||||
{
|
||||
NS_PRECONDITION(aDocumentInfo, "Must have a non-null documentinfo!");
|
||||
|
||||
if (!mDocumentTable.IsInitialized())
|
||||
mDocumentTable.Init(16);
|
||||
if (!mDocumentTable) {
|
||||
mDocumentTable = new nsRefPtrHashtable<nsURIHashKey,nsXBLDocumentInfo>(16);
|
||||
}
|
||||
|
||||
mDocumentTable.Put(aDocumentInfo->DocumentURI(),
|
||||
aDocumentInfo);
|
||||
mDocumentTable->Put(aDocumentInfo->DocumentURI(), aDocumentInfo);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -583,18 +582,18 @@ nsBindingManager::PutXBLDocumentInfo(nsXBLDocumentInfo* aDocumentInfo)
|
||||
void
|
||||
nsBindingManager::RemoveXBLDocumentInfo(nsXBLDocumentInfo* aDocumentInfo)
|
||||
{
|
||||
if (mDocumentTable.IsInitialized()) {
|
||||
mDocumentTable.Remove(aDocumentInfo->DocumentURI());
|
||||
if (mDocumentTable) {
|
||||
mDocumentTable->Remove(aDocumentInfo->DocumentURI());
|
||||
}
|
||||
}
|
||||
|
||||
nsXBLDocumentInfo*
|
||||
nsBindingManager::GetXBLDocumentInfo(nsIURI* aURL)
|
||||
{
|
||||
if (!mDocumentTable.IsInitialized())
|
||||
if (!mDocumentTable)
|
||||
return nullptr;
|
||||
|
||||
return mDocumentTable.GetWeak(aURL);
|
||||
return mDocumentTable->GetWeak(aURL);
|
||||
}
|
||||
|
||||
nsresult
|
||||
@ -602,10 +601,10 @@ nsBindingManager::PutLoadingDocListener(nsIURI* aURL, nsIStreamListener* aListen
|
||||
{
|
||||
NS_PRECONDITION(aListener, "Must have a non-null listener!");
|
||||
|
||||
if (!mLoadingDocTable.IsInitialized())
|
||||
mLoadingDocTable.Init(16);
|
||||
|
||||
mLoadingDocTable.Put(aURL, aListener);
|
||||
if (!mLoadingDocTable) {
|
||||
mLoadingDocTable = new nsInterfaceHashtable<nsURIHashKey,nsIStreamListener>(16);
|
||||
}
|
||||
mLoadingDocTable->Put(aURL, aListener);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -613,17 +612,17 @@ nsBindingManager::PutLoadingDocListener(nsIURI* aURL, nsIStreamListener* aListen
|
||||
nsIStreamListener*
|
||||
nsBindingManager::GetLoadingDocListener(nsIURI* aURL)
|
||||
{
|
||||
if (!mLoadingDocTable.IsInitialized())
|
||||
if (!mLoadingDocTable)
|
||||
return nullptr;
|
||||
|
||||
return mLoadingDocTable.GetWeak(aURL);
|
||||
return mLoadingDocTable->GetWeak(aURL);
|
||||
}
|
||||
|
||||
void
|
||||
nsBindingManager::RemoveLoadingDocListener(nsIURI* aURL)
|
||||
{
|
||||
if (mLoadingDocTable.IsInitialized()) {
|
||||
mLoadingDocTable.Remove(aURL);
|
||||
if (mLoadingDocTable) {
|
||||
mLoadingDocTable->Remove(aURL);
|
||||
}
|
||||
}
|
||||
|
||||
@ -647,8 +646,8 @@ MarkForDeath(nsRefPtrHashKey<nsIContent> *aKey, void* aClosure)
|
||||
void
|
||||
nsBindingManager::FlushSkinBindings()
|
||||
{
|
||||
if (mBoundContentSet.IsInitialized()) {
|
||||
mBoundContentSet.EnumerateEntries(MarkForDeath, nullptr);
|
||||
if (mBoundContentSet) {
|
||||
mBoundContentSet->EnumerateEntries(MarkForDeath, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@ -812,16 +811,16 @@ static PLDHashOperator
|
||||
EnumRuleProcessors(nsRefPtrHashKey<nsIContent> *aKey, void* aClosure)
|
||||
{
|
||||
nsIContent *boundContent = aKey->GetKey();
|
||||
RuleProcessorSet *set = static_cast<RuleProcessorSet*>(aClosure);
|
||||
nsAutoPtr<RuleProcessorSet> *set = static_cast<nsAutoPtr<RuleProcessorSet>*>(aClosure);
|
||||
for (nsXBLBinding *binding = boundContent->GetXBLBinding(); binding;
|
||||
binding = binding->GetBaseBinding()) {
|
||||
nsIStyleRuleProcessor *ruleProc =
|
||||
binding->PrototypeBinding()->GetRuleProcessor();
|
||||
if (ruleProc) {
|
||||
if (!set->IsInitialized()) {
|
||||
set->Init(16);
|
||||
if (!(*set)) {
|
||||
*set = new RuleProcessorSet;
|
||||
}
|
||||
set->PutEntry(ruleProc);
|
||||
(*set)->PutEntry(ruleProc);
|
||||
}
|
||||
}
|
||||
return PL_DHASH_NEXT;
|
||||
@ -848,17 +847,17 @@ void
|
||||
nsBindingManager::WalkAllRules(nsIStyleRuleProcessor::EnumFunc aFunc,
|
||||
ElementDependentRuleProcessorData* aData)
|
||||
{
|
||||
if (!mBoundContentSet.IsInitialized()) {
|
||||
if (!mBoundContentSet) {
|
||||
return;
|
||||
}
|
||||
|
||||
RuleProcessorSet set;
|
||||
mBoundContentSet.EnumerateEntries(EnumRuleProcessors, &set);
|
||||
if (!set.IsInitialized())
|
||||
nsAutoPtr<RuleProcessorSet> set;
|
||||
mBoundContentSet->EnumerateEntries(EnumRuleProcessors, &set);
|
||||
if (!set)
|
||||
return;
|
||||
|
||||
WalkAllRulesData data = { aFunc, aData };
|
||||
set.EnumerateEntries(EnumWalkAllRules, &data);
|
||||
set->EnumerateEntries(EnumWalkAllRules, &data);
|
||||
}
|
||||
|
||||
struct MediumFeaturesChangedData {
|
||||
@ -885,17 +884,18 @@ nsBindingManager::MediumFeaturesChanged(nsPresContext* aPresContext,
|
||||
bool* aRulesChanged)
|
||||
{
|
||||
*aRulesChanged = false;
|
||||
if (!mBoundContentSet.IsInitialized()) {
|
||||
if (!mBoundContentSet) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
RuleProcessorSet set;
|
||||
mBoundContentSet.EnumerateEntries(EnumRuleProcessors, &set);
|
||||
if (!set.IsInitialized())
|
||||
nsAutoPtr<RuleProcessorSet> set;
|
||||
mBoundContentSet->EnumerateEntries(EnumRuleProcessors, &set);
|
||||
if (!set) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
MediumFeaturesChangedData data = { aPresContext, aRulesChanged };
|
||||
set.EnumerateEntries(EnumMediumFeaturesChanged, &data);
|
||||
set->EnumerateEntries(EnumMediumFeaturesChanged, &data);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -921,8 +921,8 @@ EnumAppendAllSheets(nsRefPtrHashKey<nsIContent> *aKey, void* aClosure)
|
||||
void
|
||||
nsBindingManager::AppendAllSheets(nsTArray<nsCSSStyleSheet*>& aArray)
|
||||
{
|
||||
if (mBoundContentSet.IsInitialized()) {
|
||||
mBoundContentSet.EnumerateEntries(EnumAppendAllSheets, &aArray);
|
||||
if (mBoundContentSet) {
|
||||
mBoundContentSet->EnumerateEntries(EnumAppendAllSheets, &aArray);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1095,8 +1095,8 @@ nsBindingManager::DropDocumentReference()
|
||||
mProcessAttachedQueueEvent->Revoke();
|
||||
}
|
||||
|
||||
if (mBoundContentSet.IsInitialized()) {
|
||||
mBoundContentSet.Clear();
|
||||
if (mBoundContentSet) {
|
||||
mBoundContentSet->Clear();
|
||||
}
|
||||
|
||||
mDocument = nullptr;
|
||||
@ -1116,7 +1116,7 @@ nsBindingManager::Traverse(nsIContent *aContent,
|
||||
return;
|
||||
}
|
||||
|
||||
if (mBoundContentSet.IsInitialized() && mBoundContentSet.Contains(aContent)) {
|
||||
if (mBoundContentSet && mBoundContentSet->Contains(aContent)) {
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "[via binding manager] mBoundContentSet entry");
|
||||
cb.NoteXPCOMChild(aContent);
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ protected:
|
||||
// MEMBER VARIABLES
|
||||
protected:
|
||||
// A set of nsIContent that currently have a binding installed.
|
||||
nsTHashtable<nsRefPtrHashKey<nsIContent> > mBoundContentSet;
|
||||
nsAutoPtr<nsTHashtable<nsRefPtrHashKey<nsIContent> > > mBoundContentSet;
|
||||
|
||||
// A mapping from nsIContent* to nsIXPWrappedJS* (an XPConnect
|
||||
// wrapper for JS objects). For XBL bindings that implement XPIDL
|
||||
@ -174,12 +174,12 @@ protected:
|
||||
// A mapping from a URL (a string) to nsXBLDocumentInfo*. This table
|
||||
// is the cache of all binding documents that have been loaded by a
|
||||
// given bound document.
|
||||
nsRefPtrHashtable<nsURIHashKey,nsXBLDocumentInfo> mDocumentTable;
|
||||
nsAutoPtr<nsRefPtrHashtable<nsURIHashKey,nsXBLDocumentInfo> > mDocumentTable;
|
||||
|
||||
// A mapping from a URL (a string) to a nsIStreamListener. This
|
||||
// table is the currently loading binding docs. If they're in this
|
||||
// table, they have not yet finished loading.
|
||||
nsInterfaceHashtable<nsURIHashKey,nsIStreamListener> mLoadingDocTable;
|
||||
nsAutoPtr<nsInterfaceHashtable<nsURIHashKey,nsIStreamListener> > mLoadingDocTable;
|
||||
|
||||
// A queue of binding attached event handlers that are awaiting execution.
|
||||
nsBindingList mAttachedStack;
|
||||
|
@ -104,7 +104,6 @@ nsXBLPrototypeBinding::nsXBLPrototypeBinding()
|
||||
mBaseNameSpaceID(kNameSpaceID_None)
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsXBLPrototypeBinding);
|
||||
mInterfaceTable.Init();
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -368,7 +368,6 @@ txEXSLTFunctionCall::evaluate(txIEvalContext *aContext,
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsTHashtable<nsStringHashKey> hash;
|
||||
hash.Init();
|
||||
|
||||
int32_t i, len = nodes->size();
|
||||
for (i = 0; i < len; ++i) {
|
||||
|
@ -18,8 +18,6 @@ const int32_t txExecutionState::kMaxRecursionDepth = 20000;
|
||||
|
||||
nsresult txLoadedDocumentsHash::init(txXPathNode* aSourceDocument)
|
||||
{
|
||||
Init(8);
|
||||
|
||||
mSourceDocument = aSourceDocument;
|
||||
|
||||
nsAutoString baseURI;
|
||||
@ -37,10 +35,6 @@ nsresult txLoadedDocumentsHash::init(txXPathNode* aSourceDocument)
|
||||
|
||||
txLoadedDocumentsHash::~txLoadedDocumentsHash()
|
||||
{
|
||||
if (!IsInitialized()) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsAutoString baseURI;
|
||||
txXPathNodeUtils::getBaseURI(*mSourceDocument, baseURI);
|
||||
|
||||
|
@ -56,6 +56,10 @@ public:
|
||||
class txLoadedDocumentsHash : public nsTHashtable<txLoadedDocumentEntry>
|
||||
{
|
||||
public:
|
||||
txLoadedDocumentsHash()
|
||||
: nsTHashtable<txLoadedDocumentEntry>(8)
|
||||
{
|
||||
}
|
||||
~txLoadedDocumentsHash();
|
||||
nsresult init(txXPathNode* aSourceDocument);
|
||||
|
||||
|
@ -179,7 +179,9 @@ class txKeyHash
|
||||
{
|
||||
public:
|
||||
txKeyHash(const txOwningExpandedNameMap<txXSLKey>& aKeys)
|
||||
: mKeys(aKeys)
|
||||
: mKeyValues(8)
|
||||
, mIndexedKeys(1)
|
||||
, mKeys(aKeys)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -239,8 +239,6 @@ txKeyHash::getKeyNodes(const txExpandedName& aKeyName,
|
||||
nsresult
|
||||
txKeyHash::init()
|
||||
{
|
||||
mKeyValues.Init(8);
|
||||
mIndexedKeys.Init(1);
|
||||
mEmptyNodeSet = new txNodeSet(nullptr);
|
||||
|
||||
return NS_OK;
|
||||
|
@ -332,10 +332,12 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(XULDocument, XMLDocument)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPrototypes);
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mLocalStore)
|
||||
|
||||
if (tmp->mOverlayLoadObservers.IsInitialized())
|
||||
tmp->mOverlayLoadObservers.EnumerateRead(TraverseObservers, &cb);
|
||||
if (tmp->mPendingOverlayLoadNotifications.IsInitialized())
|
||||
tmp->mPendingOverlayLoadNotifications.EnumerateRead(TraverseObservers, &cb);
|
||||
if (tmp->mOverlayLoadObservers) {
|
||||
tmp->mOverlayLoadObservers->EnumerateRead(TraverseObservers, &cb);
|
||||
}
|
||||
if (tmp->mPendingOverlayLoadNotifications) {
|
||||
tmp->mPendingOverlayLoadNotifications->EnumerateRead(TraverseObservers, &cb);
|
||||
}
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(XULDocument, XMLDocument)
|
||||
@ -1894,7 +1896,6 @@ XULDocument::SetTemplateBuilderFor(nsIContent* aContent,
|
||||
return NS_OK;
|
||||
}
|
||||
mTemplateBuilderTable = new BuilderTable;
|
||||
mTemplateBuilderTable->Init();
|
||||
}
|
||||
|
||||
if (aBuilder) {
|
||||
@ -1985,8 +1986,6 @@ XULDocument::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const
|
||||
nsresult
|
||||
XULDocument::Init()
|
||||
{
|
||||
mRefMap.Init();
|
||||
|
||||
nsresult rv = XMLDocument::Init();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
@ -2673,22 +2672,22 @@ XULDocument::LoadOverlay(const nsAString& aURL, nsIObserver* aObserver)
|
||||
|
||||
if (aObserver) {
|
||||
nsIObserver* obs = nullptr;
|
||||
if (!mOverlayLoadObservers.IsInitialized()) {
|
||||
mOverlayLoadObservers.Init();
|
||||
if (!mOverlayLoadObservers) {
|
||||
mOverlayLoadObservers = new nsInterfaceHashtable<nsURIHashKey,nsIObserver>;
|
||||
}
|
||||
obs = mOverlayLoadObservers.GetWeak(uri);
|
||||
obs = mOverlayLoadObservers->GetWeak(uri);
|
||||
|
||||
if (obs) {
|
||||
// We don't support loading the same overlay twice into the same
|
||||
// document - that doesn't make sense anyway.
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
mOverlayLoadObservers.Put(uri, aObserver);
|
||||
mOverlayLoadObservers->Put(uri, aObserver);
|
||||
}
|
||||
bool shouldReturn, failureFromContent;
|
||||
rv = LoadOverlayInternal(uri, true, &shouldReturn, &failureFromContent);
|
||||
if (NS_FAILED(rv) && mOverlayLoadObservers.IsInitialized())
|
||||
mOverlayLoadObservers.Remove(uri); // remove the observer if LoadOverlayInternal generated an error
|
||||
if (NS_FAILED(rv) && mOverlayLoadObservers)
|
||||
mOverlayLoadObservers->Remove(uri); // remove the observer if LoadOverlayInternal generated an error
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -2879,7 +2878,9 @@ FirePendingMergeNotification(nsIURI* aKey, nsCOMPtr<nsIObserver>& aObserver, voi
|
||||
|
||||
typedef nsInterfaceHashtable<nsURIHashKey,nsIObserver> table;
|
||||
table* observers = static_cast<table*>(aClosure);
|
||||
observers->Remove(aKey);
|
||||
if (observers) {
|
||||
observers->Remove(aKey);
|
||||
}
|
||||
|
||||
return PL_DHASH_REMOVE;
|
||||
}
|
||||
@ -3125,16 +3126,16 @@ XULDocument::ResumeWalk()
|
||||
continue;
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
if (mOverlayLoadObservers.IsInitialized()) {
|
||||
nsIObserver *obs = mOverlayLoadObservers.GetWeak(overlayURI);
|
||||
if (mOverlayLoadObservers) {
|
||||
nsIObserver *obs = mOverlayLoadObservers->GetWeak(overlayURI);
|
||||
if (obs) {
|
||||
// This overlay has an unloaded overlay, so it will never
|
||||
// notify. The best we can do is to notify for the unloaded
|
||||
// overlay instead, assuming nobody is already notifiable
|
||||
// for it. Note that this will confuse the observer.
|
||||
if (!mOverlayLoadObservers.GetWeak(uri))
|
||||
mOverlayLoadObservers.Put(uri, obs);
|
||||
mOverlayLoadObservers.Remove(overlayURI);
|
||||
if (!mOverlayLoadObservers->GetWeak(uri))
|
||||
mOverlayLoadObservers->Put(uri, obs);
|
||||
mOverlayLoadObservers->Remove(overlayURI);
|
||||
}
|
||||
}
|
||||
if (shouldReturn)
|
||||
@ -3226,19 +3227,20 @@ XULDocument::DoneWalking()
|
||||
|
||||
// Walk the set of pending load notifications and notify any observers.
|
||||
// See below for detail.
|
||||
if (mPendingOverlayLoadNotifications.IsInitialized())
|
||||
mPendingOverlayLoadNotifications.Enumerate(FirePendingMergeNotification, (void*)&mOverlayLoadObservers);
|
||||
if (mPendingOverlayLoadNotifications)
|
||||
mPendingOverlayLoadNotifications->Enumerate(
|
||||
FirePendingMergeNotification, mOverlayLoadObservers.get());
|
||||
}
|
||||
else {
|
||||
if (mOverlayLoadObservers.IsInitialized()) {
|
||||
if (mOverlayLoadObservers) {
|
||||
nsCOMPtr<nsIURI> overlayURI = mCurrentPrototype->GetURI();
|
||||
nsCOMPtr<nsIObserver> obs;
|
||||
if (mInitialLayoutComplete) {
|
||||
// We have completed initial layout, so just send the notification.
|
||||
mOverlayLoadObservers.Get(overlayURI, getter_AddRefs(obs));
|
||||
mOverlayLoadObservers->Get(overlayURI, getter_AddRefs(obs));
|
||||
if (obs)
|
||||
obs->Observe(overlayURI, "xul-overlay-merged", EmptyString().get());
|
||||
mOverlayLoadObservers.Remove(overlayURI);
|
||||
mOverlayLoadObservers->Remove(overlayURI);
|
||||
}
|
||||
else {
|
||||
// If we have not yet displayed the document for the first time
|
||||
@ -3258,15 +3260,16 @@ XULDocument::DoneWalking()
|
||||
// XXXbz really, we shouldn't be firing binding constructors
|
||||
// until after StartLayout returns!
|
||||
|
||||
if (!mPendingOverlayLoadNotifications.IsInitialized()) {
|
||||
mPendingOverlayLoadNotifications.Init();
|
||||
if (!mPendingOverlayLoadNotifications) {
|
||||
mPendingOverlayLoadNotifications =
|
||||
new nsInterfaceHashtable<nsURIHashKey,nsIObserver>;
|
||||
}
|
||||
|
||||
mPendingOverlayLoadNotifications.Get(overlayURI, getter_AddRefs(obs));
|
||||
mPendingOverlayLoadNotifications->Get(overlayURI, getter_AddRefs(obs));
|
||||
if (!obs) {
|
||||
mOverlayLoadObservers.Get(overlayURI, getter_AddRefs(obs));
|
||||
mOverlayLoadObservers->Get(overlayURI, getter_AddRefs(obs));
|
||||
NS_ASSERTION(obs, "null overlay load observer?");
|
||||
mPendingOverlayLoadNotifications.Put(overlayURI, obs);
|
||||
mPendingOverlayLoadNotifications->Put(overlayURI, obs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -719,9 +719,9 @@ protected:
|
||||
*/
|
||||
PLDHashTable* mBroadcasterMap;
|
||||
|
||||
nsInterfaceHashtable<nsURIHashKey,nsIObserver> mOverlayLoadObservers;
|
||||
nsInterfaceHashtable<nsURIHashKey,nsIObserver> mPendingOverlayLoadNotifications;
|
||||
|
||||
nsAutoPtr<nsInterfaceHashtable<nsURIHashKey,nsIObserver> > mOverlayLoadObservers;
|
||||
nsAutoPtr<nsInterfaceHashtable<nsURIHashKey,nsIObserver> > mPendingOverlayLoadNotifications;
|
||||
|
||||
bool mInitialLayoutComplete;
|
||||
|
||||
class nsDelayedBroadcastUpdate
|
||||
|
@ -90,15 +90,6 @@ nsXULPrototypeCache::GetInstance()
|
||||
if (!sInstance) {
|
||||
NS_ADDREF(sInstance = new nsXULPrototypeCache());
|
||||
|
||||
sInstance->mPrototypeTable.Init();
|
||||
sInstance->mStyleSheetTable.Init();
|
||||
sInstance->mScriptTable.Init();
|
||||
sInstance->mXBLDocTable.Init();
|
||||
|
||||
sInstance->mCacheURITable.Init();
|
||||
sInstance->mInputStreamTable.Init();
|
||||
sInstance->mOutputStreamTable.Init();
|
||||
|
||||
UpdategDisableXULCache();
|
||||
|
||||
Preferences::RegisterCallback(DisableXULCacheChangedCallback,
|
||||
|
@ -171,9 +171,6 @@ nsXULTemplateBuilder::InitGlobals()
|
||||
gXULTemplateLog = PR_NewLogModule("nsXULTemplateBuilder");
|
||||
#endif
|
||||
|
||||
if (!mMatchMap.IsInitialized())
|
||||
mMatchMap.Init();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -244,9 +241,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsXULTemplateBuilder)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mRootResult)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mListeners)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mQueryProcessor)
|
||||
if (tmp->mMatchMap.IsInitialized()) {
|
||||
tmp->mMatchMap.Enumerate(DestroyMatchList, nullptr);
|
||||
}
|
||||
tmp->mMatchMap.Enumerate(DestroyMatchList, nullptr);
|
||||
for (uint32_t i = 0; i < tmp->mQuerySets.Length(); ++i) {
|
||||
nsTemplateQuerySet* qs = tmp->mQuerySets[i];
|
||||
delete qs;
|
||||
@ -266,8 +261,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsXULTemplateBuilder)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mRootResult)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mListeners)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mQueryProcessor)
|
||||
if (tmp->mMatchMap.IsInitialized())
|
||||
tmp->mMatchMap.EnumerateRead(TraverseMatchList, &cb);
|
||||
tmp->mMatchMap.EnumerateRead(TraverseMatchList, &cb);
|
||||
{
|
||||
uint32_t i, count = tmp->mQuerySets.Length();
|
||||
for (i = 0; i < count; ++i) {
|
||||
|
@ -99,17 +99,11 @@ RuleToBindingTraverser(nsISupports* key, RDFBindingSet* binding, void* userArg)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsXULTemplateQueryProcessorRDF)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDB)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mLastRef)
|
||||
if (tmp->mBindingDependencies.IsInitialized()) {
|
||||
tmp->mBindingDependencies.EnumerateRead(BindingDependenciesTraverser,
|
||||
&cb);
|
||||
}
|
||||
if (tmp->mMemoryElementToResultMap.IsInitialized()) {
|
||||
tmp->mMemoryElementToResultMap.EnumerateRead(MemoryElementTraverser,
|
||||
&cb);
|
||||
}
|
||||
if (tmp->mRuleToBindingsMap.IsInitialized()) {
|
||||
tmp->mRuleToBindingsMap.EnumerateRead(RuleToBindingTraverser, &cb);
|
||||
}
|
||||
tmp->mBindingDependencies.EnumerateRead(BindingDependenciesTraverser,
|
||||
&cb);
|
||||
tmp->mMemoryElementToResultMap.EnumerateRead(MemoryElementTraverser,
|
||||
&cb);
|
||||
tmp->mRuleToBindingsMap.EnumerateRead(RuleToBindingTraverser, &cb);
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mQueries)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
@ -305,13 +299,6 @@ nsXULTemplateQueryProcessorRDF::InitializeForBuilding(nsISupports* aDatasource,
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
if (!mMemoryElementToResultMap.IsInitialized())
|
||||
mMemoryElementToResultMap.Init();
|
||||
if (!mBindingDependencies.IsInitialized())
|
||||
mBindingDependencies.Init();
|
||||
if (!mRuleToBindingsMap.IsInitialized())
|
||||
mRuleToBindingsMap.Init();
|
||||
|
||||
mQueryProcessorRDFInited = true;
|
||||
}
|
||||
|
||||
|
@ -89,18 +89,14 @@ TraverseRuleToBindingsMap(nsISupports* aKey, nsXMLBindingSet* aMatch, void* aCon
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsXULTemplateQueryProcessorXML)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsXULTemplateQueryProcessorXML)
|
||||
if (tmp->mRuleToBindingsMap.IsInitialized()) {
|
||||
tmp->mRuleToBindingsMap.Clear();
|
||||
}
|
||||
tmp->mRuleToBindingsMap.Clear();
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mRoot)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mEvaluator)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mTemplateBuilder)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mRequest)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsXULTemplateQueryProcessorXML)
|
||||
if (tmp->mRuleToBindingsMap.IsInitialized()) {
|
||||
tmp->mRuleToBindingsMap.EnumerateRead(TraverseRuleToBindingsMap, &cb);
|
||||
}
|
||||
tmp->mRuleToBindingsMap.EnumerateRead(TraverseRuleToBindingsMap, &cb);
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mRoot)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mEvaluator)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTemplateBuilder)
|
||||
@ -223,9 +219,6 @@ nsXULTemplateQueryProcessorXML::InitializeForBuilding(nsISupports* aDatasource,
|
||||
mEvaluator = do_CreateInstance("@mozilla.org/dom/xpath-evaluator;1");
|
||||
NS_ENSURE_TRUE(mEvaluator, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
if (!mRuleToBindingsMap.IsInitialized())
|
||||
mRuleToBindingsMap.Init();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -234,8 +227,7 @@ nsXULTemplateQueryProcessorXML::Done()
|
||||
{
|
||||
mGenerationStarted = false;
|
||||
|
||||
if (mRuleToBindingsMap.IsInitialized())
|
||||
mRuleToBindingsMap.Clear();
|
||||
mRuleToBindingsMap.Clear();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -74,9 +74,6 @@ AudioChannelService::AudioChannelService()
|
||||
, mCurrentVisibleHigherChannel(AUDIO_CHANNEL_LAST)
|
||||
, mActiveContentChildIDsFrozen(false)
|
||||
{
|
||||
// Creation of the hash table.
|
||||
mAgents.Init();
|
||||
|
||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
||||
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
|
||||
if (obs) {
|
||||
@ -313,7 +310,6 @@ AudioChannelService::SendAudioChannelChangedNotification(uint64_t aChildID)
|
||||
}
|
||||
|
||||
nsRefPtr<nsHashPropertyBag> props = new nsHashPropertyBag();
|
||||
props->Init();
|
||||
props->SetPropertyAsUint64(NS_LITERAL_STRING("childID"), aChildID);
|
||||
|
||||
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
|
||||
|
@ -1033,10 +1033,6 @@ nsGlobalWindow::nsGlobalWindow(nsGlobalWindow *aOuterWindow)
|
||||
{
|
||||
nsLayoutStatics::AddRef();
|
||||
|
||||
#ifdef MOZ_GAMEPAD
|
||||
mGamepads.Init();
|
||||
#endif
|
||||
|
||||
// Initialize the PRCList (this).
|
||||
PR_INIT_CLIST(this);
|
||||
|
||||
@ -1124,8 +1120,6 @@ nsGlobalWindow::nsGlobalWindow(nsGlobalWindow *aOuterWindow)
|
||||
if (sWindowsById) {
|
||||
sWindowsById->Put(mWindowID, this);
|
||||
}
|
||||
|
||||
mEventTargetObjects.Init();
|
||||
}
|
||||
|
||||
/* static */
|
||||
@ -1142,7 +1136,6 @@ nsGlobalWindow::Init()
|
||||
#endif
|
||||
|
||||
sWindowsById = new WindowByIdTable();
|
||||
sWindowsById->Init();
|
||||
}
|
||||
|
||||
static PLDHashOperator
|
||||
@ -1283,9 +1276,9 @@ nsGlobalWindow::ShutDown()
|
||||
void
|
||||
nsGlobalWindow::CleanupCachedXBLHandlers(nsGlobalWindow* aWindow)
|
||||
{
|
||||
if (aWindow->mCachedXBLPrototypeHandlers.IsInitialized() &&
|
||||
aWindow->mCachedXBLPrototypeHandlers.Count() > 0) {
|
||||
aWindow->mCachedXBLPrototypeHandlers.Clear();
|
||||
if (aWindow->mCachedXBLPrototypeHandlers &&
|
||||
aWindow->mCachedXBLPrototypeHandlers->Count() > 0) {
|
||||
aWindow->mCachedXBLPrototypeHandlers->Clear();
|
||||
mozilla::DropJSObjects(aWindow);
|
||||
}
|
||||
}
|
||||
@ -1572,8 +1565,8 @@ MarkXBLHandlers(nsXBLPrototypeHandler* aKey, JS::Heap<JSObject*>& aData, void* a
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(nsGlobalWindow)
|
||||
if (tmp->IsBlackForCC()) {
|
||||
if (tmp->mCachedXBLPrototypeHandlers.IsInitialized()) {
|
||||
tmp->mCachedXBLPrototypeHandlers.Enumerate(MarkXBLHandlers, nullptr);
|
||||
if (tmp->mCachedXBLPrototypeHandlers) {
|
||||
tmp->mCachedXBLPrototypeHandlers->Enumerate(MarkXBLHandlers, nullptr);
|
||||
}
|
||||
nsEventListenerManager* elm = tmp->GetListenerManager(false);
|
||||
if (elm) {
|
||||
@ -1739,9 +1732,9 @@ TraceXBLHandlers(nsXBLPrototypeHandler* aKey, JS::Heap<JSObject*>& aData, void*
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsGlobalWindow)
|
||||
if (tmp->mCachedXBLPrototypeHandlers.IsInitialized()) {
|
||||
if (tmp->mCachedXBLPrototypeHandlers) {
|
||||
TraceData data = { aCallbacks, aClosure };
|
||||
tmp->mCachedXBLPrototypeHandlers.Enumerate(TraceXBLHandlers, &data);
|
||||
tmp->mCachedXBLPrototypeHandlers->Enumerate(TraceXBLHandlers, &data);
|
||||
}
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_END
|
||||
|
||||
@ -7611,8 +7604,8 @@ nsGlobalWindow::GetCachedXBLPrototypeHandler(nsXBLPrototypeHandler* aKey)
|
||||
{
|
||||
AutoSafeJSContext cx;
|
||||
JS::Rooted<JSObject*> handler(cx);
|
||||
if (mCachedXBLPrototypeHandlers.IsInitialized()) {
|
||||
mCachedXBLPrototypeHandlers.Get(aKey, handler.address());
|
||||
if (mCachedXBLPrototypeHandlers) {
|
||||
mCachedXBLPrototypeHandlers->Get(aKey, handler.address());
|
||||
}
|
||||
return handler;
|
||||
}
|
||||
@ -7621,15 +7614,15 @@ void
|
||||
nsGlobalWindow::CacheXBLPrototypeHandler(nsXBLPrototypeHandler* aKey,
|
||||
JS::Handle<JSObject*> aHandler)
|
||||
{
|
||||
if (!mCachedXBLPrototypeHandlers.IsInitialized()) {
|
||||
mCachedXBLPrototypeHandlers.Init();
|
||||
if (!mCachedXBLPrototypeHandlers) {
|
||||
mCachedXBLPrototypeHandlers = new nsJSThingHashtable<nsPtrHashKey<nsXBLPrototypeHandler>, JSObject*>();
|
||||
}
|
||||
|
||||
if (!mCachedXBLPrototypeHandlers.Count()) {
|
||||
if (!mCachedXBLPrototypeHandlers->Count()) {
|
||||
mozilla::HoldJSObjects(this);
|
||||
}
|
||||
|
||||
mCachedXBLPrototypeHandlers.Put(aKey, aHandler);
|
||||
mCachedXBLPrototypeHandlers->Put(aKey, aHandler);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1239,7 +1239,7 @@ protected:
|
||||
|
||||
nsCOMPtr<nsIDOMOfflineResourceList> mApplicationCache;
|
||||
|
||||
nsJSThingHashtable<nsPtrHashKey<nsXBLPrototypeHandler>, JSObject*> mCachedXBLPrototypeHandlers;
|
||||
nsAutoPtr<nsJSThingHashtable<nsPtrHashKey<nsXBLPrototypeHandler>, JSObject*> > mCachedXBLPrototypeHandlers;
|
||||
|
||||
nsCOMPtr<nsIDocument> mSuspendedDoc;
|
||||
|
||||
|
@ -22,7 +22,6 @@ using namespace mozilla;
|
||||
nsWindowMemoryReporter::nsWindowMemoryReporter()
|
||||
: mCheckForGhostWindowsCallbackPending(false)
|
||||
{
|
||||
mDetachedWindows.Init();
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS3(nsWindowMemoryReporter, nsIMemoryMultiReporter, nsIObserver,
|
||||
@ -334,14 +333,11 @@ nsWindowMemoryReporter::CollectReports(nsIMemoryMultiReporterCallback* aCb,
|
||||
|
||||
// Get the IDs of all the "ghost" windows.
|
||||
nsTHashtable<nsUint64HashKey> ghostWindows;
|
||||
ghostWindows.Init();
|
||||
CheckForGhostWindows(&ghostWindows);
|
||||
|
||||
WindowPaths windowPaths;
|
||||
windowPaths.Init();
|
||||
|
||||
WindowPaths topWindowPaths;
|
||||
topWindowPaths.Init();
|
||||
|
||||
// Collect window memory usage.
|
||||
nsWindowSizes windowTotalSizes(NULL);
|
||||
@ -650,7 +646,6 @@ nsWindowMemoryReporter::CheckForGhostWindows(
|
||||
}
|
||||
|
||||
nsTHashtable<nsCStringHashKey> nonDetachedWindowDomains;
|
||||
nonDetachedWindowDomains.Init();
|
||||
|
||||
// Populate nonDetachedWindowDomains.
|
||||
GetNonDetachedWindowDomainsEnumeratorData nonDetachedEnumData =
|
||||
@ -739,7 +734,6 @@ GhostURLsReporter::CollectReports(
|
||||
{
|
||||
// Get the IDs of all the ghost windows in existance.
|
||||
nsTHashtable<nsUint64HashKey> ghostWindows;
|
||||
ghostWindows.Init();
|
||||
mWindowReporter->CheckForGhostWindows(&ghostWindows);
|
||||
|
||||
ReportGhostWindowsEnumeratorData reportGhostWindowsEnumData =
|
||||
@ -775,7 +769,6 @@ int64_t
|
||||
nsWindowMemoryReporter::NumGhostsReporter::Amount()
|
||||
{
|
||||
nsTHashtable<nsUint64HashKey> ghostWindows;
|
||||
ghostWindows.Init();
|
||||
mWindowReporter->CheckForGhostWindows(&ghostWindows);
|
||||
return ghostWindows.Count();
|
||||
}
|
||||
|
@ -311,7 +311,6 @@ protected:
|
||||
BluetoothService()
|
||||
: mEnabled(false)
|
||||
{
|
||||
mBluetoothSignalObserverTable.Init();
|
||||
}
|
||||
|
||||
virtual ~BluetoothService();
|
||||
|
@ -173,7 +173,7 @@ static const char* sBluetoothDBusSignals[] =
|
||||
*
|
||||
*/
|
||||
static nsRefPtr<RawDBusConnection> gThreadConnection;
|
||||
static nsDataHashtable<nsStringHashKey, DBusMessage* > sPairingReqTable;
|
||||
static nsDataHashtable<nsStringHashKey, DBusMessage* >* sPairingReqTable;
|
||||
static nsTArray<uint32_t> sAuthorizedServiceClass;
|
||||
static nsString sAdapterPath;
|
||||
static Atomic<int32_t> sIsPairing(0);
|
||||
@ -1093,7 +1093,7 @@ AgentEventFilter(DBusConnection *conn, DBusMessage *msg, void *data)
|
||||
signal.value() = v;
|
||||
|
||||
if (isPairingReq) {
|
||||
sPairingReqTable.Put(
|
||||
sPairingReqTable->Put(
|
||||
GetAddressFromObjectPath(NS_ConvertUTF8toUTF16(objectPath)), msg);
|
||||
|
||||
// Increase ref count here because we need this message later.
|
||||
@ -1669,8 +1669,8 @@ BluetoothDBusService::StartInternal()
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (!sPairingReqTable.IsInitialized()) {
|
||||
sPairingReqTable.Init();
|
||||
if (!sPairingReqTable) {
|
||||
sPairingReqTable = new nsDataHashtable<nsStringHashKey, DBusMessage* >;
|
||||
}
|
||||
|
||||
BluetoothValue v;
|
||||
@ -1744,8 +1744,8 @@ BluetoothDBusService::StopInternal()
|
||||
gThreadConnection = nullptr;
|
||||
|
||||
// unref stored DBusMessages before clear the hashtable
|
||||
sPairingReqTable.EnumerateRead(UnrefDBusMessages, nullptr);
|
||||
sPairingReqTable.Clear();
|
||||
sPairingReqTable->EnumerateRead(UnrefDBusMessages, nullptr);
|
||||
sPairingReqTable->Clear();
|
||||
|
||||
sIsPairing = 0;
|
||||
sConnectedDeviceCount = 0;
|
||||
@ -2458,7 +2458,7 @@ BluetoothDBusService::SetPinCodeInternal(const nsAString& aDeviceAddress,
|
||||
nsAutoString errorStr;
|
||||
BluetoothValue v = true;
|
||||
DBusMessage *msg;
|
||||
if (!sPairingReqTable.Get(aDeviceAddress, &msg)) {
|
||||
if (!sPairingReqTable->Get(aDeviceAddress, &msg)) {
|
||||
BT_WARNING("%s: Couldn't get original request message.", __FUNCTION__);
|
||||
errorStr.AssignLiteral("Couldn't get original request message.");
|
||||
DispatchBluetoothReply(aRunnable, v, errorStr);
|
||||
@ -2493,7 +2493,7 @@ BluetoothDBusService::SetPinCodeInternal(const nsAString& aDeviceAddress,
|
||||
dbus_message_unref(msg);
|
||||
dbus_message_unref(reply);
|
||||
|
||||
sPairingReqTable.Remove(aDeviceAddress);
|
||||
sPairingReqTable->Remove(aDeviceAddress);
|
||||
DispatchBluetoothReply(aRunnable, v, errorStr);
|
||||
return result;
|
||||
}
|
||||
@ -2506,7 +2506,7 @@ BluetoothDBusService::SetPasskeyInternal(const nsAString& aDeviceAddress,
|
||||
nsAutoString errorStr;
|
||||
BluetoothValue v = true;
|
||||
DBusMessage *msg;
|
||||
if (!sPairingReqTable.Get(aDeviceAddress, &msg)) {
|
||||
if (!sPairingReqTable->Get(aDeviceAddress, &msg)) {
|
||||
BT_WARNING("%s: Couldn't get original request message.", __FUNCTION__);
|
||||
errorStr.AssignLiteral("Couldn't get original request message.");
|
||||
DispatchBluetoothReply(aRunnable, v, errorStr);
|
||||
@ -2539,7 +2539,7 @@ BluetoothDBusService::SetPasskeyInternal(const nsAString& aDeviceAddress,
|
||||
dbus_message_unref(msg);
|
||||
dbus_message_unref(reply);
|
||||
|
||||
sPairingReqTable.Remove(aDeviceAddress);
|
||||
sPairingReqTable->Remove(aDeviceAddress);
|
||||
DispatchBluetoothReply(aRunnable, v, errorStr);
|
||||
return result;
|
||||
}
|
||||
@ -2553,7 +2553,7 @@ BluetoothDBusService::SetPairingConfirmationInternal(
|
||||
nsAutoString errorStr;
|
||||
BluetoothValue v = true;
|
||||
DBusMessage *msg;
|
||||
if (!sPairingReqTable.Get(aDeviceAddress, &msg)) {
|
||||
if (!sPairingReqTable->Get(aDeviceAddress, &msg)) {
|
||||
BT_WARNING("%s: Couldn't get original request message.", __FUNCTION__);
|
||||
errorStr.AssignLiteral("Couldn't get original request message.");
|
||||
DispatchBluetoothReply(aRunnable, v, errorStr);
|
||||
@ -2584,7 +2584,7 @@ BluetoothDBusService::SetPairingConfirmationInternal(
|
||||
dbus_message_unref(msg);
|
||||
dbus_message_unref(reply);
|
||||
|
||||
sPairingReqTable.Remove(aDeviceAddress);
|
||||
sPairingReqTable->Remove(aDeviceAddress);
|
||||
DispatchBluetoothReply(aRunnable, v, errorStr);
|
||||
return result;
|
||||
}
|
||||
|
@ -49,8 +49,7 @@ GetCameraLog()
|
||||
* GonkCameraManager.cpp and FallbackCameraManager.cpp.
|
||||
*/
|
||||
|
||||
WindowTable nsDOMCameraManager::sActiveWindows;
|
||||
bool nsDOMCameraManager::sActiveWindowsInitialized = false;
|
||||
WindowTable* nsDOMCameraManager::sActiveWindows = nullptr;
|
||||
|
||||
nsDOMCameraManager::nsDOMCameraManager(nsPIDOMWindow* aWindow)
|
||||
: mWindowId(aWindow->WindowID())
|
||||
@ -91,9 +90,8 @@ already_AddRefed<nsDOMCameraManager>
|
||||
nsDOMCameraManager::CreateInstance(nsPIDOMWindow* aWindow)
|
||||
{
|
||||
// Initialize the shared active window tracker
|
||||
if (!sActiveWindowsInitialized) {
|
||||
sActiveWindows.Init();
|
||||
sActiveWindowsInitialized = true;
|
||||
if (!sActiveWindows) {
|
||||
sActiveWindows = new WindowTable();
|
||||
}
|
||||
|
||||
nsRefPtr<nsDOMCameraManager> cameraManager =
|
||||
@ -141,10 +139,10 @@ nsDOMCameraManager::Register(nsDOMCameraControl* aDOMCameraControl)
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
// Put the camera control into the hash table
|
||||
CameraControls* controls = sActiveWindows.Get(mWindowId);
|
||||
CameraControls* controls = sActiveWindows->Get(mWindowId);
|
||||
if (!controls) {
|
||||
controls = new CameraControls;
|
||||
sActiveWindows.Put(mWindowId, controls);
|
||||
sActiveWindows->Put(mWindowId, controls);
|
||||
}
|
||||
controls->AppendElement(aDOMCameraControl);
|
||||
}
|
||||
@ -155,7 +153,7 @@ nsDOMCameraManager::Shutdown(uint64_t aWindowId)
|
||||
DOM_CAMERA_LOGI(">>> Shutdown( aWindowId = 0x%llx )\n", aWindowId);
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
CameraControls* controls = sActiveWindows.Get(aWindowId);
|
||||
CameraControls* controls = sActiveWindows->Get(aWindowId);
|
||||
if (!controls) {
|
||||
return;
|
||||
}
|
||||
@ -167,7 +165,7 @@ nsDOMCameraManager::Shutdown(uint64_t aWindowId)
|
||||
}
|
||||
controls->Clear();
|
||||
|
||||
sActiveWindows.Remove(aWindowId);
|
||||
sActiveWindows->Remove(aWindowId);
|
||||
}
|
||||
|
||||
void
|
||||
@ -179,7 +177,8 @@ nsDOMCameraManager::XpComShutdown()
|
||||
nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
|
||||
obs->RemoveObserver(this, "xpcom-shutdown");
|
||||
|
||||
sActiveWindows.Clear();
|
||||
delete sActiveWindows;
|
||||
sActiveWindows = nullptr;
|
||||
}
|
||||
|
||||
nsresult
|
||||
@ -203,11 +202,11 @@ nsDOMCameraManager::IsWindowStillActive(uint64_t aWindowId)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (!sActiveWindowsInitialized) {
|
||||
if (!sActiveWindows) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !!sActiveWindows.Get(aWindowId);
|
||||
return !!sActiveWindows->Get(aWindowId);
|
||||
}
|
||||
|
||||
JSObject*
|
||||
|
@ -85,8 +85,7 @@ protected:
|
||||
* 'mActiveWindows' is only ever accessed while in the main thread,
|
||||
* so it is not otherwise protected.
|
||||
*/
|
||||
static WindowTable sActiveWindows;
|
||||
static bool sActiveWindowsInitialized;
|
||||
static WindowTable* sActiveWindows;
|
||||
};
|
||||
|
||||
class GetCameraTask : public nsRunnable
|
||||
|
@ -40,8 +40,6 @@ FileService::~FileService()
|
||||
nsresult
|
||||
FileService::Init()
|
||||
{
|
||||
mFileStorageInfos.Init();
|
||||
|
||||
nsresult rv;
|
||||
mStreamTransportTarget =
|
||||
do_GetService(NS_STREAMTRANSPORTSERVICE_CONTRACTID, &rv);
|
||||
|
@ -159,8 +159,6 @@ private:
|
||||
private:
|
||||
FileStorageInfo()
|
||||
{
|
||||
mFilesReading.Init();
|
||||
mFilesWriting.Init();
|
||||
}
|
||||
|
||||
nsTArray<nsRefPtr<LockedFileQueue> > mLockedFileQueues;
|
||||
|
@ -59,8 +59,7 @@ Client::InitOrigin(const nsACString& aOrigin, UsageRunnable* aUsageRunnable)
|
||||
|
||||
nsAutoTArray<nsString, 20> subdirsToProcess;
|
||||
nsAutoTArray<nsCOMPtr<nsIFile> , 20> unknownFiles;
|
||||
nsTHashtable<nsStringHashKey> validSubdirs;
|
||||
validSubdirs.Init(20);
|
||||
nsTHashtable<nsStringHashKey> validSubdirs(20);
|
||||
|
||||
nsCOMPtr<nsISimpleEnumerator> entries;
|
||||
rv = directory->GetDirectoryEntries(getter_AddRefs(entries));
|
||||
|
@ -151,7 +151,6 @@ DatabaseInfo::Put(DatabaseInfo* aInfo)
|
||||
|
||||
if (!gDatabaseHash) {
|
||||
nsAutoPtr<DatabaseHash> databaseHash(new DatabaseHash());
|
||||
databaseHash->Init();
|
||||
gDatabaseHash = databaseHash.forget();
|
||||
}
|
||||
|
||||
@ -221,7 +220,6 @@ DatabaseInfo::PutObjectStore(ObjectStoreInfo* aInfo)
|
||||
|
||||
if (!objectStoreHash) {
|
||||
nsAutoPtr<ObjectStoreInfoHash> hash(new ObjectStoreInfoHash());
|
||||
hash->Init();
|
||||
objectStoreHash = hash.forget();
|
||||
}
|
||||
|
||||
@ -261,7 +259,6 @@ DatabaseInfo::Clone()
|
||||
|
||||
if (objectStoreHash) {
|
||||
dbInfo->objectStoreHash = new ObjectStoreInfoHash();
|
||||
dbInfo->objectStoreHash->Init();
|
||||
objectStoreHash->EnumerateRead(CloneObjectStoreInfo,
|
||||
dbInfo->objectStoreHash);
|
||||
}
|
||||
|
@ -67,8 +67,6 @@ FileManager::Init(nsIFile* aDirectory,
|
||||
NS_ASSERTION(aDirectory, "Null directory!");
|
||||
NS_ASSERTION(aConnection, "Null connection!");
|
||||
|
||||
mFileInfos.Init();
|
||||
|
||||
bool exists;
|
||||
nsresult rv = aDirectory->Exists(&exists);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
@ -117,11 +117,7 @@ IDBTransaction::CreateInternal(IDBDatabase* aDatabase,
|
||||
|
||||
IndexedDBTransactionChild* actor = nullptr;
|
||||
|
||||
transaction->mCreatedFileInfos.Init();
|
||||
|
||||
if (IndexedDatabaseManager::IsMainProcess()) {
|
||||
transaction->mCachedStatements.Init();
|
||||
|
||||
if (aMode != IDBTransaction::VERSION_CHANGE) {
|
||||
TransactionThreadPool* pool = TransactionThreadPool::GetOrCreate();
|
||||
NS_ENSURE_TRUE(pool, nullptr);
|
||||
@ -377,9 +373,6 @@ IDBTransaction::GetOrCreateConnection(mozIStorageConnection** aResult)
|
||||
function = new UpdateRefcountFunction(Database()->Manager());
|
||||
NS_ENSURE_TRUE(function, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
rv = function->Init();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = connection->CreateFunction(
|
||||
NS_LITERAL_CSTRING("update_refcount"), 2, function);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
@ -987,14 +980,6 @@ CommitHelper::RevertAutoIncrementCounts()
|
||||
}
|
||||
}
|
||||
|
||||
nsresult
|
||||
UpdateRefcountFunction::Init()
|
||||
{
|
||||
mFileInfoEntries.Init();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(UpdateRefcountFunction, mozIStorageFunction)
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -373,8 +373,6 @@ public:
|
||||
~UpdateRefcountFunction()
|
||||
{ }
|
||||
|
||||
nsresult Init();
|
||||
|
||||
void ClearFileInfoEntries()
|
||||
{
|
||||
mFileInfoEntries.Clear();
|
||||
|
@ -130,8 +130,6 @@ IndexedDatabaseManager::IndexedDatabaseManager()
|
||||
: mFileMutex("IndexedDatabaseManager.mFileMutex")
|
||||
{
|
||||
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
|
||||
|
||||
mFileManagers.Init();
|
||||
}
|
||||
|
||||
IndexedDatabaseManager::~IndexedDatabaseManager()
|
||||
|
@ -122,8 +122,6 @@ TransactionThreadPool::Init()
|
||||
{
|
||||
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
|
||||
|
||||
mTransactionsInProgress.Init();
|
||||
|
||||
nsresult rv;
|
||||
mThreadPool = do_CreateInstance(NS_THREADPOOL_CONTRACTID, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
@ -86,9 +86,6 @@ protected:
|
||||
{
|
||||
MOZ_COUNT_CTOR(TransactionInfo);
|
||||
|
||||
blockedOn.Init();
|
||||
blocking.Init();
|
||||
|
||||
transaction = aTransaction;
|
||||
queue = new TransactionQueue(aTransaction);
|
||||
}
|
||||
@ -127,9 +124,6 @@ protected:
|
||||
DatabaseTransactionInfo()
|
||||
{
|
||||
MOZ_COUNT_CTOR(DatabaseTransactionInfo);
|
||||
|
||||
transactions.Init();
|
||||
blockingTransactions.Init();
|
||||
}
|
||||
|
||||
~DatabaseTransactionInfo()
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user