mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 20:35:50 +00:00
Merge m-c and birch.
This commit is contained in:
commit
84b5a5cc76
@ -830,6 +830,10 @@ already_AddRefed<nsFrameSelection>
|
||||
XULTextFieldAccessible::FrameSelection()
|
||||
{
|
||||
nsCOMPtr<nsIContent> inputContent(GetInputField());
|
||||
NS_ASSERTION(inputContent, "No input content");
|
||||
if (!inputContent)
|
||||
return nullptr;
|
||||
|
||||
nsIFrame* frame = inputContent->GetPrimaryFrame();
|
||||
return frame ? frame->GetFrameSelection() : nullptr;
|
||||
}
|
||||
|
@ -632,7 +632,7 @@ pref("plugins.hide_infobar_for_outdated_plugin", false);
|
||||
pref("plugins.update.url", "https://www.mozilla.org/%LOCALE%/plugincheck/");
|
||||
pref("plugins.update.notifyUser", false);
|
||||
|
||||
pref("plugins.click_to_play", false);
|
||||
pref("plugins.click_to_play", true);
|
||||
|
||||
// display door hanger if flash not installed
|
||||
pref("plugins.notifyMissingFlash", true);
|
||||
|
@ -48,6 +48,14 @@ function test() {
|
||||
function installListener(next, aManifest) {
|
||||
let expectEvent = "onInstalling";
|
||||
let prefname = getManifestPrefname(aManifest);
|
||||
// wait for the actual removal to call next
|
||||
SocialService.registerProviderListener(function providerListener(topic, data) {
|
||||
if (topic == "provider-removed") {
|
||||
SocialService.unregisterProviderListener(providerListener);
|
||||
executeSoon(next);
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
onInstalling: function(addon) {
|
||||
is(expectEvent, "onInstalling", "install started");
|
||||
@ -73,7 +81,6 @@ function installListener(next, aManifest) {
|
||||
is(addon.manifest.origin, aManifest.origin, "provider uninstalled");
|
||||
ok(!Services.prefs.prefHasUserValue(prefname), "manifest is not in user-prefs");
|
||||
AddonManager.removeAddonListener(this);
|
||||
next();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -55,17 +55,18 @@ var tests = {
|
||||
setAndUpdateBlocklist(blocklistURL, function() {
|
||||
try {
|
||||
SocialService.addProvider(manifest, function(provider) {
|
||||
if (provider) {
|
||||
try {
|
||||
SocialService.removeProvider(provider.origin, function() {
|
||||
ok(true, "added and removed provider");
|
||||
finish(true);
|
||||
});
|
||||
} else {
|
||||
} catch(e) {
|
||||
ok(false, "SocialService.removeProvider threw exception: " + e);
|
||||
finish(false);
|
||||
}
|
||||
});
|
||||
} catch(e) {
|
||||
dump(e+" - "+e.stack+"\n");
|
||||
ok(false, "SocialService.addProvider threw exception: " + e);
|
||||
finish(false);
|
||||
}
|
||||
});
|
||||
@ -80,15 +81,11 @@ var tests = {
|
||||
setAndUpdateBlocklist(blocklistURL, function() {
|
||||
try {
|
||||
SocialService.addProvider(manifest_bad, function(provider) {
|
||||
if (provider) {
|
||||
SocialService.removeProvider(provider.origin, function() {
|
||||
finish(false);
|
||||
});
|
||||
} else {
|
||||
finish(true);
|
||||
}
|
||||
ok(false, "SocialService.addProvider should throw blocklist exception");
|
||||
finish(false);
|
||||
});
|
||||
} catch(e) {
|
||||
ok(true, "SocialService.addProvider should throw blocklist exception");
|
||||
finish(true);
|
||||
}
|
||||
});
|
||||
|
@ -149,6 +149,7 @@ function runSocialTestWithProvider(manifest, callback, finishcallback) {
|
||||
function runSocialTests(tests, cbPreTest, cbPostTest, cbFinish) {
|
||||
let testIter = Iterator(tests);
|
||||
let providersAtStart = Social.providers.length;
|
||||
info("runSocialTests: start test run with " + providersAtStart + " providers");
|
||||
|
||||
if (cbPreTest === undefined) {
|
||||
cbPreTest = function(cb) {cb()};
|
||||
@ -164,6 +165,7 @@ function runSocialTests(tests, cbPreTest, cbPostTest, cbFinish) {
|
||||
} catch (err if err instanceof StopIteration) {
|
||||
// out of items:
|
||||
(cbFinish || defaultFinishChecks)();
|
||||
info("runSocialTests: finish test run with " + Social.providers.length + " providers");
|
||||
return;
|
||||
}
|
||||
// We run on a timeout as the frameworker also makes use of timeouts, so
|
||||
@ -174,7 +176,7 @@ function runSocialTests(tests, cbPreTest, cbPostTest, cbFinish) {
|
||||
cbPostTest(runNextTest);
|
||||
}
|
||||
cbPreTest(function() {
|
||||
is(providersAtStart, Social.providers.length, "no new providers left enabled");
|
||||
is(providersAtStart, Social.providers.length, "pre-test: no new providers left enabled");
|
||||
info("sub-test " + name + " starting");
|
||||
try {
|
||||
func.call(tests, cleanupAndRunNextTest);
|
||||
|
@ -321,17 +321,6 @@ let PermissionDefaults = {
|
||||
Services.prefs.setBoolPref("dom.disable_open_during_load", value);
|
||||
},
|
||||
|
||||
get plugins() {
|
||||
if (Services.prefs.getBoolPref("plugins.click_to_play")) {
|
||||
return this.UNKNOWN;
|
||||
}
|
||||
return this.ALLOW;
|
||||
},
|
||||
set plugins(aValue) {
|
||||
let value = (aValue != this.ALLOW);
|
||||
Services.prefs.setBoolPref("plugins.click_to_play", value);
|
||||
},
|
||||
|
||||
get fullscreen() {
|
||||
if (!Services.prefs.getBoolPref("full-screen-api.enabled")) {
|
||||
return this.DENY;
|
||||
@ -380,7 +369,7 @@ let AboutPermissions = {
|
||||
*
|
||||
* Potential future additions: "sts/use", "sts/subd"
|
||||
*/
|
||||
_supportedPermissions: ["password", "cookie", "geo", "indexedDB", "popup", "plugins", "fullscreen"],
|
||||
_supportedPermissions: ["password", "cookie", "geo", "indexedDB", "popup", "fullscreen"],
|
||||
|
||||
/**
|
||||
* Permissions that don't have a global "Allow" option.
|
||||
@ -390,7 +379,7 @@ let AboutPermissions = {
|
||||
/**
|
||||
* Permissions that don't have a global "Deny" option.
|
||||
*/
|
||||
_noGlobalDeny: ["plugins"],
|
||||
_noGlobalDeny: [],
|
||||
|
||||
_stringBundle: Services.strings.
|
||||
createBundle("chrome://browser/locale/preferences/aboutPermissions.properties"),
|
||||
@ -412,7 +401,6 @@ let AboutPermissions = {
|
||||
Services.prefs.addObserver("geo.enabled", this, false);
|
||||
Services.prefs.addObserver("dom.indexedDB.enabled", this, false);
|
||||
Services.prefs.addObserver("dom.disable_open_during_load", this, false);
|
||||
Services.prefs.addObserver("plugins.click_to_play", this, false);
|
||||
Services.prefs.addObserver("full-screen-api.enabled", this, false);
|
||||
|
||||
Services.obs.addObserver(this, "perm-changed", false);
|
||||
@ -434,7 +422,6 @@ let AboutPermissions = {
|
||||
Services.prefs.removeObserver("geo.enabled", this, false);
|
||||
Services.prefs.removeObserver("dom.indexedDB.enabled", this, false);
|
||||
Services.prefs.removeObserver("dom.disable_open_during_load", this, false);
|
||||
Services.prefs.removeObserver("plugins.click_to_play", this, false);
|
||||
Services.prefs.removeObserver("full-screen-api.enabled", this, false);
|
||||
|
||||
Services.obs.removeObserver(this, "perm-changed");
|
||||
@ -758,18 +745,11 @@ let AboutPermissions = {
|
||||
if (!this._selectedSite) {
|
||||
// If there is no selected site, we are updating the default permissions interface.
|
||||
permissionValue = PermissionDefaults[aType];
|
||||
if (aType == "plugins")
|
||||
document.getElementById("plugins-pref-item").hidden = false;
|
||||
else if (aType == "cookie")
|
||||
if (aType == "cookie")
|
||||
// cookie-9 corresponds to ALLOW_FIRST_PARTY_ONLY, which is reserved
|
||||
// for site-specific preferences only.
|
||||
document.getElementById("cookie-9").hidden = true;
|
||||
} else {
|
||||
if (aType == "plugins") {
|
||||
document.getElementById("plugins-pref-item").hidden =
|
||||
!Services.prefs.getBoolPref("plugins.click_to_play");
|
||||
return;
|
||||
}
|
||||
if (aType == "cookie")
|
||||
document.getElementById("cookie-9").hidden = false;
|
||||
let result = {};
|
||||
|
@ -191,27 +191,6 @@
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
<!-- Opt-in activation of Plug-ins -->
|
||||
<hbox id="plugins-pref-item"
|
||||
class="pref-item" align="top">
|
||||
<image class="pref-icon" type="plugins"/>
|
||||
<vbox>
|
||||
<label class="pref-title" value="&plugins.label;"/>
|
||||
<hbox>
|
||||
<menulist id="plugins-menulist"
|
||||
class="pref-menulist"
|
||||
type="plugins"
|
||||
oncommand="AboutPermissions.onPermissionCommand(event);">
|
||||
<menupopup>
|
||||
<menuitem id="plugins-0" value="0" label="&permission.alwaysAsk;"/>
|
||||
<menuitem id="plugins-1" value="1" label="&permission.allow;"/>
|
||||
<menuitem id="plugins-2" value="2" label="&permission.block;"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
<!-- Fullscreen -->
|
||||
<hbox id="fullscreen-pref-item"
|
||||
class="pref-item" align="top">
|
||||
|
@ -26,7 +26,6 @@ const TEST_PERMS = {
|
||||
"geo": PERM_UNKNOWN,
|
||||
"indexedDB": PERM_UNKNOWN,
|
||||
"popup": PERM_DENY,
|
||||
"plugins" : PERM_ALLOW,
|
||||
"fullscreen" : PERM_UNKNOWN,
|
||||
};
|
||||
|
||||
@ -37,7 +36,7 @@ const NO_GLOBAL_ALLOW = [
|
||||
];
|
||||
|
||||
// number of managed permissions in the interface
|
||||
const TEST_PERMS_COUNT = 7;
|
||||
const TEST_PERMS_COUNT = 6;
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
@ -113,7 +113,7 @@ crashedpluginsMessage.submitButton.accesskey=S
|
||||
crashedpluginsMessage.learnMore=Learn More…
|
||||
|
||||
## Plugin doorhanger strings
|
||||
# LOCALIZATION NOTE (pluginActivateNw.message): Used for newly-installed
|
||||
# LOCALIZATION NOTE (pluginActivateNew.message): Used for newly-installed
|
||||
# plugins which are not known to be unsafe. %1$S is the plugin name and %2$S
|
||||
# is the site domain.
|
||||
pluginActivateNew.message=Allow %2$S to run "%1$S"?
|
||||
@ -160,7 +160,7 @@ pluginContinue.accesskey=C
|
||||
|
||||
# in-page UI
|
||||
PluginClickToActivate=Activate %S.
|
||||
PluginVulnerableUpdatable=Thus plugin is vulnerable and should be updated.
|
||||
PluginVulnerableUpdatable=This plugin is vulnerable and should be updated.
|
||||
PluginVulnerableNoUpdate=This plugin has security vulnerabilities.
|
||||
|
||||
# Sanitize
|
||||
|
@ -1,69 +1,69 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!-- 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/. -->
|
||||
|
||||
<?xml-stylesheet href="chrome://browser/skin/platform.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/skin/browser.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/content/browser.css" type="text/css"?>
|
||||
|
||||
<!DOCTYPE window []>
|
||||
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<vbox flex="1">
|
||||
<hbox>
|
||||
<richgrid id="grid1" seltype="single" flex="1">
|
||||
<richgriditem value="about:blank" id="grid1_item1" label="First item"/>
|
||||
</richgrid>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<richgrid id="emptygrid" seltype="single" flex="1"/>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<richgrid id="grid2" seltype="single" flex="1">
|
||||
<richgriditem value="about:blank" id="grid2_item1" label="First item"/>
|
||||
<richgriditem value="about:blank" id="grid2_item2" label="2nd item"/>
|
||||
</richgrid>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<richgrid id="grid3" seltype="single" flex="1">
|
||||
<richgriditem value="about:blank" id="grid3_item1" label="First item"/>
|
||||
<richgriditem value="about:blank" id="grid3_item2" label="2nd item"/>
|
||||
</richgrid>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<richgrid id="grid4" seltype="single" flex="1">
|
||||
<richgriditem value="about:blank" id="grid4_item1" label="First item"/>
|
||||
<richgriditem value="about:blank" id="grid4_item2" label="2nd item"/>
|
||||
</richgrid>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<richgrid id="grid5" seltype="single" flex="1">
|
||||
<richgriditem value="about:blank" id="grid5_item1" label="First item"/>
|
||||
<richgriditem value="http://bugzilla.mozilla.org/" id="grid5_item2" label="2nd item"/>
|
||||
<richgriditem value="about:blank" id="grid5_item3" label="3rd item"/>
|
||||
<richgriditem value="http://bugzilla.mozilla.org/" id="grid5_item4" label="4th item"/>
|
||||
</richgrid>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<richgrid id="grid6" seltype="single" flex="1">
|
||||
<richgriditem value="about:blank" id="grid6_item1" label="First item"/>
|
||||
</richgrid>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<richgrid id="grid-select1" seltype="single" flex="1">
|
||||
<richgriditem value="about:blank" id="grid-select1_item1" label="First item"/>
|
||||
<richgriditem value="about:blank" id="grid-select1_item2" label="2nd item"/>
|
||||
</richgrid>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<richgrid id="grid-select2" seltype="multiple" flex="1">
|
||||
<richgriditem value="about:blank" id="grid-select2_item1" label="First item"/>
|
||||
<richgriditem value="about:blank" id="grid-select2_item2" label="2nd item"/>
|
||||
</richgrid>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</window>
|
||||
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!-- 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/. -->
|
||||
|
||||
<?xml-stylesheet href="chrome://browser/skin/platform.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/skin/browser.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/content/browser.css" type="text/css"?>
|
||||
|
||||
<!DOCTYPE window []>
|
||||
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<vbox flex="1">
|
||||
<hbox>
|
||||
<richgrid id="grid1" seltype="single" flex="1">
|
||||
<richgriditem value="about:blank" id="grid1_item1" label="First item"/>
|
||||
</richgrid>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<richgrid id="emptygrid" seltype="single" flex="1"/>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<richgrid id="grid2" seltype="single" flex="1">
|
||||
<richgriditem value="about:blank" id="grid2_item1" label="First item"/>
|
||||
<richgriditem value="about:blank" id="grid2_item2" label="2nd item"/>
|
||||
</richgrid>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<richgrid id="grid3" seltype="single" flex="1">
|
||||
<richgriditem value="about:blank" id="grid3_item1" label="First item"/>
|
||||
<richgriditem value="about:blank" id="grid3_item2" label="2nd item"/>
|
||||
</richgrid>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<richgrid id="grid4" seltype="single" flex="1">
|
||||
<richgriditem value="about:blank" id="grid4_item1" label="First item"/>
|
||||
<richgriditem value="about:blank" id="grid4_item2" label="2nd item"/>
|
||||
</richgrid>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<richgrid id="grid5" seltype="single" flex="1">
|
||||
<richgriditem value="about:blank" id="grid5_item1" label="First item"/>
|
||||
<richgriditem value="http://bugzilla.mozilla.org/" id="grid5_item2" label="2nd item"/>
|
||||
<richgriditem value="about:blank" id="grid5_item3" label="3rd item"/>
|
||||
<richgriditem value="http://bugzilla.mozilla.org/" id="grid5_item4" label="4th item"/>
|
||||
</richgrid>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<richgrid id="grid6" seltype="single" flex="1">
|
||||
<richgriditem value="about:blank" id="grid6_item1" label="First item"/>
|
||||
</richgrid>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<richgrid id="grid-select1" seltype="single" flex="1">
|
||||
<richgriditem value="about:blank" id="grid-select1_item1" label="First item"/>
|
||||
<richgriditem value="about:blank" id="grid-select1_item2" label="2nd item"/>
|
||||
</richgrid>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<richgrid id="grid-select2" seltype="multiple" flex="1">
|
||||
<richgriditem value="about:blank" id="grid-select2_item1" label="First item"/>
|
||||
<richgriditem value="about:blank" id="grid-select2_item2" label="2nd item"/>
|
||||
</richgrid>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</window>
|
||||
|
||||
|
@ -1,349 +1,349 @@
|
||||
let doc;
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
Task.spawn(function(){
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
|
||||
info(chromeRoot + "browser_tilegrid.xul");
|
||||
yield addTab(chromeRoot + "browser_tilegrid.xul");
|
||||
doc = Browser.selectedTab.browser.contentWindow.document;
|
||||
}).then(runTests);
|
||||
}
|
||||
|
||||
gTests.push({
|
||||
desc: "richgrid binding is applied",
|
||||
run: function() {
|
||||
ok(doc, "doc got defined");
|
||||
|
||||
let grid = doc.querySelector("#grid1");
|
||||
ok(grid, "#grid1 is found");
|
||||
is(typeof grid.clearSelection, "function", "#grid1 has the binding applied");
|
||||
|
||||
is(grid.children.length, 1, "#grid1 has a single item");
|
||||
is(grid.children[0].control, grid, "#grid1 item's control points back at #grid1'");
|
||||
}
|
||||
});
|
||||
|
||||
gTests.push({
|
||||
desc: "item clicks are handled",
|
||||
run: function() {
|
||||
let grid = doc.querySelector("#grid1");
|
||||
is(typeof grid.handleItemClick, "function", "grid.handleItemClick is a function");
|
||||
let handleStub = stubMethod(grid, 'handleItemClick');
|
||||
let itemId = "grid1_item1"; // grid.children[0].getAttribute("id");
|
||||
|
||||
// send click to item and wait for next tick;
|
||||
EventUtils.sendMouseEvent({type: 'click'}, itemId, doc.defaultView);
|
||||
yield waitForMs(0);
|
||||
|
||||
is(handleStub.callCount, 1, "handleItemClick was called when we clicked an item");
|
||||
handleStub.restore();
|
||||
|
||||
// if the grid has a controller, it should be called too
|
||||
let gridController = {
|
||||
handleItemClick: function() {}
|
||||
};
|
||||
let controllerHandleStub = stubMethod(gridController, "handleItemClick");
|
||||
let origController = grid.controller;
|
||||
grid.controller = gridController;
|
||||
|
||||
// send click to item and wait for next tick;
|
||||
EventUtils.sendMouseEvent({type: 'click'}, itemId, doc.defaultView);
|
||||
yield waitForMs(0);
|
||||
|
||||
is(controllerHandleStub.callCount, 1, "controller.handleItemClick was called when we clicked an item");
|
||||
is(controllerHandleStub.calledWith[0], doc.getElementById(itemId), "controller.handleItemClick was passed the grid item");
|
||||
grid.controller = origController;
|
||||
}
|
||||
});
|
||||
|
||||
gTests.push({
|
||||
desc: "arrangeItems",
|
||||
run: function() {
|
||||
// implements an arrangeItems method, with optional cols, rows signature
|
||||
let grid = doc.querySelector("#grid1");
|
||||
is(typeof grid.arrangeItems, "function", "arrangeItems is a function on the grid");
|
||||
todo(false, "Test outcome of arrangeItems with cols and rows arguments");
|
||||
}
|
||||
});
|
||||
|
||||
gTests.push({
|
||||
desc: "appendItem",
|
||||
run: function() {
|
||||
// implements an appendItem with signature title, uri, returns item element
|
||||
// appendItem triggers arrangeItems
|
||||
let grid = doc.querySelector("#emptygrid");
|
||||
|
||||
is(grid.itemCount, 0, "0 itemCount when empty");
|
||||
is(grid.children.length, 0, "0 children when empty");
|
||||
is(typeof grid.appendItem, "function", "appendItem is a function on the grid");
|
||||
|
||||
let arrangeStub = stubMethod(grid, "arrangeItems");
|
||||
let newItem = grid.appendItem("test title", "about:blank");
|
||||
|
||||
ok(newItem && grid.children[0]==newItem, "appendItem gives back the item");
|
||||
is(grid.itemCount, 1, "itemCount is incremented when we appendItem");
|
||||
is(newItem.getAttribute("label"), "test title", "title ends up on label attribute");
|
||||
is(newItem.getAttribute("value"), "about:blank", "url ends up on value attribute");
|
||||
|
||||
is(arrangeStub.callCount, 1, "arrangeItems is called when we appendItem");
|
||||
arrangeStub.restore();
|
||||
}
|
||||
});
|
||||
|
||||
gTests.push({
|
||||
desc: "getItemAtIndex",
|
||||
run: function() {
|
||||
// implements a getItemAtIndex method
|
||||
let grid = doc.querySelector("#grid2");
|
||||
is(typeof grid.getItemAtIndex, "function", "getItemAtIndex is a function on the grid");
|
||||
is(grid.getItemAtIndex(0).getAttribute("id"), "grid2_item1", "getItemAtIndex retrieves the first item");
|
||||
is(grid.getItemAtIndex(1).getAttribute("id"), "grid2_item2", "getItemAtIndex item at index 2");
|
||||
ok(!grid.getItemAtIndex(5), "getItemAtIndex out-of-bounds index returns falsy");
|
||||
}
|
||||
});
|
||||
|
||||
gTests.push({
|
||||
desc: "removeItemAt",
|
||||
run: function() {
|
||||
// implements a removeItemAt method, with 'index' signature
|
||||
// removeItemAt triggers arrangeItems
|
||||
let grid = doc.querySelector("#grid2");
|
||||
|
||||
is(grid.itemCount, 2, "2 items initially");
|
||||
is(typeof grid.removeItemAt, "function", "removeItemAt is a function on the grid");
|
||||
|
||||
let arrangeStub = stubMethod(grid, "arrangeItems");
|
||||
let removedItem = grid.removeItemAt(0);
|
||||
|
||||
ok(removedItem, "removeItemAt gives back an item");
|
||||
is(removedItem.getAttribute("id"), "grid2_item1", "removeItemAt gives back the correct item");
|
||||
is(grid.children[0].getAttribute("id"), "grid2_item2", "2nd item becomes the first item");
|
||||
is(grid.itemCount, 1, "itemCount is decremented when we removeItemAt");
|
||||
|
||||
is(arrangeStub.callCount, 1, "arrangeItems is called when we removeItemAt");
|
||||
arrangeStub.restore();
|
||||
}
|
||||
});
|
||||
|
||||
gTests.push({
|
||||
desc: "insertItemAt",
|
||||
run: function() {
|
||||
// implements an insertItemAt method, with index, title, uri.spec signature
|
||||
// insertItemAt triggers arrangeItems
|
||||
let grid = doc.querySelector("#grid3");
|
||||
|
||||
is(grid.itemCount, 2, "2 items initially");
|
||||
is(typeof grid.insertItemAt, "function", "insertItemAt is a function on the grid");
|
||||
|
||||
let arrangeStub = stubMethod(grid, "arrangeItems");
|
||||
let insertedItem = grid.insertItemAt(1, "inserted item", "http://example.com/inserted");
|
||||
|
||||
ok(insertedItem, "insertItemAt gives back an item");
|
||||
is(grid.children[1], insertedItem, "item is inserted at the correct index");
|
||||
is(insertedItem.getAttribute("label"), "inserted item", "insertItemAt creates item with the correct label");
|
||||
is(insertedItem.getAttribute("value"), "http://example.com/inserted", "insertItemAt creates item with the correct url value");
|
||||
is(grid.children[2].getAttribute("id"), "grid3_item2", "following item ends up at the correct index");
|
||||
is(grid.itemCount, 3, "itemCount is incremented when we insertItemAt");
|
||||
|
||||
is(arrangeStub.callCount, 1, "arrangeItems is called when we insertItemAt");
|
||||
arrangeStub.restore();
|
||||
}
|
||||
});
|
||||
|
||||
gTests.push({
|
||||
desc: "getIndexOfItem",
|
||||
run: function() {
|
||||
// implements a getIndexOfItem method, with item (element) signature
|
||||
// insertItemAt triggers arrangeItems
|
||||
let grid = doc.querySelector("#grid4");
|
||||
|
||||
is(grid.itemCount, 2, "2 items initially");
|
||||
is(typeof grid.getIndexOfItem, "function", "getIndexOfItem is a function on the grid");
|
||||
|
||||
let item = doc.getElementById("grid4_item2");
|
||||
let badItem = doc.createElement("richgriditem");
|
||||
|
||||
is(grid.getIndexOfItem(item), 1, "getIndexOfItem returns the correct value for an item");
|
||||
is(grid.getIndexOfItem(badItem), -1, "getIndexOfItem returns -1 for items it doesn't contain");
|
||||
}
|
||||
});
|
||||
|
||||
gTests.push({
|
||||
desc: "getItemsByUrl",
|
||||
run: function() {
|
||||
let grid = doc.querySelector("#grid5");
|
||||
|
||||
is(grid.itemCount, 4, "4 items total");
|
||||
is(typeof grid.getItemsByUrl, "function", "getItemsByUrl is a function on the grid");
|
||||
|
||||
['about:blank', 'http://bugzilla.mozilla.org/'].forEach(function(testUrl) {
|
||||
let items = grid.getItemsByUrl(testUrl);
|
||||
is(items.length, 2, "2 matching items in the test grid");
|
||||
is(items.item(0).url, testUrl, "Matched item has correct url property");
|
||||
is(items.item(1).url, testUrl, "Matched item has correct url property");
|
||||
});
|
||||
|
||||
let badUrl = 'http://gopher.well.com:70/';
|
||||
let items = grid.getItemsByUrl(badUrl);
|
||||
is(items.length, 0, "0 items matched url: "+badUrl);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
gTests.push({
|
||||
desc: "removeItem",
|
||||
run: function() {
|
||||
let grid = doc.querySelector("#grid5");
|
||||
|
||||
is(grid.itemCount, 4, "4 items total");
|
||||
is(typeof grid.removeItem, "function", "removeItem is a function on the grid");
|
||||
|
||||
let arrangeStub = stubMethod(grid, "arrangeItems");
|
||||
let removedFirst = grid.removeItem( grid.children[0] );
|
||||
|
||||
is(arrangeStub.callCount, 1, "arrangeItems is called when we removeItem");
|
||||
|
||||
let removed2nd = grid.removeItem( grid.children[0], true);
|
||||
is(removed2nd.getAttribute("label"), "2nd item", "the next item was returned");
|
||||
is(grid.itemCount, 2, "2 items remain");
|
||||
|
||||
// callCount should still be at 1
|
||||
is(arrangeStub.callCount, 1, "arrangeItems is not called when we pass the truthy skipArrange param");
|
||||
|
||||
let otherItem = grid.ownerDocument.querySelector("#grid6_item1");
|
||||
let removedFail = grid.removeItem(otherItem);
|
||||
ok(!removedFail, "Falsy value returned when non-child item passed");
|
||||
is(grid.itemCount, 2, "2 items remain");
|
||||
|
||||
// callCount should still be at 1
|
||||
is(arrangeStub.callCount, 1, "arrangeItems is not called when nothing is matched");
|
||||
|
||||
arrangeStub.restore();
|
||||
}
|
||||
});
|
||||
|
||||
gTests.push({
|
||||
desc: "selections (single)",
|
||||
run: function() {
|
||||
// when seltype is single,
|
||||
// maintains a selectedItem property
|
||||
// maintains a selectedIndex property
|
||||
// clearSelection, selectItem, toggleItemSelection methods are implemented
|
||||
// 'select' events are implemented
|
||||
let grid = doc.querySelector("#grid-select1");
|
||||
|
||||
is(typeof grid.clearSelection, "function", "clearSelection is a function on the grid");
|
||||
is(typeof grid.selectedItems, "object", "selectedItems is a property on the grid");
|
||||
is(typeof grid.toggleItemSelection, "function", "toggleItemSelection is function on the grid");
|
||||
is(typeof grid.selectItem, "function", "selectItem is a function on the grid");
|
||||
|
||||
is(grid.itemCount, 2, "2 items initially");
|
||||
is(grid.selectedItems.length, 0, "nothing selected initially");
|
||||
|
||||
grid.toggleItemSelection(grid.children[1]);
|
||||
ok(grid.children[1].selected, "toggleItemSelection sets truthy selected prop on previously-unselected item");
|
||||
is(grid.selectedIndex, 1, "selectedIndex is correct");
|
||||
|
||||
grid.toggleItemSelection(grid.children[1]);
|
||||
ok(!grid.children[1].selected, "toggleItemSelection sets falsy selected prop on previously-selected item");
|
||||
is(grid.selectedIndex, -1, "selectedIndex reports correctly with nothing selected");
|
||||
|
||||
// item selection
|
||||
grid.selectItem(grid.children[1]);
|
||||
ok(grid.children[1].selected, "Item selected property is truthy after grid.selectItem");
|
||||
ok(grid.children[1].getAttribute("selected"), "Item selected attribute is truthy after grid.selectItem");
|
||||
ok(grid.selectedItems.length, "There are selectedItems after grid.selectItem");
|
||||
|
||||
// clearSelection
|
||||
grid.selectItem(grid.children[0]);
|
||||
grid.selectItem(grid.children[1]);
|
||||
grid.clearSelection();
|
||||
is(grid.selectedItems.length, 0, "Nothing selected when we clearSelection");
|
||||
is(grid.selectedIndex, -1, "selectedIndex resets after clearSelection");
|
||||
|
||||
// select events
|
||||
// in seltype=single mode, select is like the default action for the tile
|
||||
// (think <a>, not <select multiple>)
|
||||
let handler = {
|
||||
handleEvent: function(aEvent) {}
|
||||
};
|
||||
let handlerStub = stubMethod(handler, "handleEvent");
|
||||
doc.defaultView.addEventListener("select", handler, false);
|
||||
info("select listener added");
|
||||
|
||||
info("calling selectItem, currently it is:" + grid.children[0].selected);
|
||||
// Note: A richgrid in seltype=single mode fires "select" events from selectItem
|
||||
grid.selectItem(grid.children[0]);
|
||||
info("calling selectItem, now it is:" + grid.children[0].selected);
|
||||
yield waitForMs(0);
|
||||
|
||||
is(handlerStub.callCount, 1, "select event handler was called when we selected an item");
|
||||
is(handlerStub.calledWith[0].type, "select", "handler got a select event");
|
||||
is(handlerStub.calledWith[0].target, grid, "select event had the originating grid as the target");
|
||||
handlerStub.restore();
|
||||
doc.defaultView.removeEventListener("select", handler, false);
|
||||
}
|
||||
});
|
||||
|
||||
gTests.push({
|
||||
desc: "selections (multiple)",
|
||||
run: function() {
|
||||
// when seltype is multiple,
|
||||
// maintains a selectedItems property
|
||||
// clearSelection, selectItem, toggleItemSelection methods are implemented
|
||||
// 'selectionchange' events are implemented
|
||||
let grid = doc.querySelector("#grid-select2");
|
||||
|
||||
is(typeof grid.clearSelection, "function", "clearSelection is a function on the grid");
|
||||
is(typeof grid.selectedItems, "object", "selectedItems is a property on the grid");
|
||||
is(typeof grid.toggleItemSelection, "function", "toggleItemSelection is function on the grid");
|
||||
is(typeof grid.selectItem, "function", "selectItem is a function on the grid");
|
||||
|
||||
is(grid.itemCount, 2, "2 items initially");
|
||||
is(grid.selectedItems.length, 0, "nothing selected initially");
|
||||
|
||||
grid.toggleItemSelection(grid.children[1]);
|
||||
ok(grid.children[1].selected, "toggleItemSelection sets truthy selected prop on previously-unselected item");
|
||||
is(grid.selectedItems.length, 1, "1 item selected when we first toggleItemSelection");
|
||||
is(grid.selectedItems[0], grid.children[1], "the right item is selected");
|
||||
is(grid.selectedIndex, 1, "selectedIndex is correct");
|
||||
|
||||
grid.toggleItemSelection(grid.children[1]);
|
||||
is(grid.selectedItems.length, 0, "Nothing selected when we toggleItemSelection again");
|
||||
|
||||
// clearSelection
|
||||
grid.children[0].selected=true;
|
||||
grid.children[1].selected=true;
|
||||
is(grid.selectedItems.length, 2, "Both items are selected before calling clearSelection");
|
||||
grid.clearSelection();
|
||||
is(grid.selectedItems.length, 0, "Nothing selected when we clearSelection");
|
||||
ok(!(grid.children[0].selected || grid.children[1].selected), "selected properties all falsy when we clearSelection");
|
||||
|
||||
// selectionchange events
|
||||
// in seltype=multiple mode, we track selected state on all items
|
||||
// (think <select multiple> not <a>)
|
||||
let handler = {
|
||||
handleEvent: function(aEvent) {}
|
||||
};
|
||||
let handlerStub = stubMethod(handler, "handleEvent");
|
||||
doc.defaultView.addEventListener("selectionchange", handler, false);
|
||||
info("selectionchange listener added");
|
||||
|
||||
info("calling toggleItemSelection, currently it is:" + grid.children[0].selected);
|
||||
// Note: A richgrid in seltype=single mode fires "select" events from selectItem
|
||||
grid.toggleItemSelection(grid.children[0]);
|
||||
info("/calling toggleItemSelection, now it is:" + grid.children[0].selected);
|
||||
yield waitForMs(0);
|
||||
|
||||
is(handlerStub.callCount, 1, "selectionchange event handler was called when we selected an item");
|
||||
is(handlerStub.calledWith[0].type, "selectionchange", "handler got a selectionchange event");
|
||||
is(handlerStub.calledWith[0].target, grid, "select event had the originating grid as the target");
|
||||
handlerStub.restore();
|
||||
doc.defaultView.removeEventListener("selectionchange", handler, false);
|
||||
}
|
||||
});
|
||||
|
||||
// implements a getItemAtIndex method (or grid.children[idx] ?)
|
||||
|
||||
let doc;
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
Task.spawn(function(){
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
|
||||
info(chromeRoot + "browser_tilegrid.xul");
|
||||
yield addTab(chromeRoot + "browser_tilegrid.xul");
|
||||
doc = Browser.selectedTab.browser.contentWindow.document;
|
||||
}).then(runTests);
|
||||
}
|
||||
|
||||
gTests.push({
|
||||
desc: "richgrid binding is applied",
|
||||
run: function() {
|
||||
ok(doc, "doc got defined");
|
||||
|
||||
let grid = doc.querySelector("#grid1");
|
||||
ok(grid, "#grid1 is found");
|
||||
is(typeof grid.clearSelection, "function", "#grid1 has the binding applied");
|
||||
|
||||
is(grid.children.length, 1, "#grid1 has a single item");
|
||||
is(grid.children[0].control, grid, "#grid1 item's control points back at #grid1'");
|
||||
}
|
||||
});
|
||||
|
||||
gTests.push({
|
||||
desc: "item clicks are handled",
|
||||
run: function() {
|
||||
let grid = doc.querySelector("#grid1");
|
||||
is(typeof grid.handleItemClick, "function", "grid.handleItemClick is a function");
|
||||
let handleStub = stubMethod(grid, 'handleItemClick');
|
||||
let itemId = "grid1_item1"; // grid.children[0].getAttribute("id");
|
||||
|
||||
// send click to item and wait for next tick;
|
||||
EventUtils.sendMouseEvent({type: 'click'}, itemId, doc.defaultView);
|
||||
yield waitForMs(0);
|
||||
|
||||
is(handleStub.callCount, 1, "handleItemClick was called when we clicked an item");
|
||||
handleStub.restore();
|
||||
|
||||
// if the grid has a controller, it should be called too
|
||||
let gridController = {
|
||||
handleItemClick: function() {}
|
||||
};
|
||||
let controllerHandleStub = stubMethod(gridController, "handleItemClick");
|
||||
let origController = grid.controller;
|
||||
grid.controller = gridController;
|
||||
|
||||
// send click to item and wait for next tick;
|
||||
EventUtils.sendMouseEvent({type: 'click'}, itemId, doc.defaultView);
|
||||
yield waitForMs(0);
|
||||
|
||||
is(controllerHandleStub.callCount, 1, "controller.handleItemClick was called when we clicked an item");
|
||||
is(controllerHandleStub.calledWith[0], doc.getElementById(itemId), "controller.handleItemClick was passed the grid item");
|
||||
grid.controller = origController;
|
||||
}
|
||||
});
|
||||
|
||||
gTests.push({
|
||||
desc: "arrangeItems",
|
||||
run: function() {
|
||||
// implements an arrangeItems method, with optional cols, rows signature
|
||||
let grid = doc.querySelector("#grid1");
|
||||
is(typeof grid.arrangeItems, "function", "arrangeItems is a function on the grid");
|
||||
todo(false, "Test outcome of arrangeItems with cols and rows arguments");
|
||||
}
|
||||
});
|
||||
|
||||
gTests.push({
|
||||
desc: "appendItem",
|
||||
run: function() {
|
||||
// implements an appendItem with signature title, uri, returns item element
|
||||
// appendItem triggers arrangeItems
|
||||
let grid = doc.querySelector("#emptygrid");
|
||||
|
||||
is(grid.itemCount, 0, "0 itemCount when empty");
|
||||
is(grid.children.length, 0, "0 children when empty");
|
||||
is(typeof grid.appendItem, "function", "appendItem is a function on the grid");
|
||||
|
||||
let arrangeStub = stubMethod(grid, "arrangeItems");
|
||||
let newItem = grid.appendItem("test title", "about:blank");
|
||||
|
||||
ok(newItem && grid.children[0]==newItem, "appendItem gives back the item");
|
||||
is(grid.itemCount, 1, "itemCount is incremented when we appendItem");
|
||||
is(newItem.getAttribute("label"), "test title", "title ends up on label attribute");
|
||||
is(newItem.getAttribute("value"), "about:blank", "url ends up on value attribute");
|
||||
|
||||
is(arrangeStub.callCount, 1, "arrangeItems is called when we appendItem");
|
||||
arrangeStub.restore();
|
||||
}
|
||||
});
|
||||
|
||||
gTests.push({
|
||||
desc: "getItemAtIndex",
|
||||
run: function() {
|
||||
// implements a getItemAtIndex method
|
||||
let grid = doc.querySelector("#grid2");
|
||||
is(typeof grid.getItemAtIndex, "function", "getItemAtIndex is a function on the grid");
|
||||
is(grid.getItemAtIndex(0).getAttribute("id"), "grid2_item1", "getItemAtIndex retrieves the first item");
|
||||
is(grid.getItemAtIndex(1).getAttribute("id"), "grid2_item2", "getItemAtIndex item at index 2");
|
||||
ok(!grid.getItemAtIndex(5), "getItemAtIndex out-of-bounds index returns falsy");
|
||||
}
|
||||
});
|
||||
|
||||
gTests.push({
|
||||
desc: "removeItemAt",
|
||||
run: function() {
|
||||
// implements a removeItemAt method, with 'index' signature
|
||||
// removeItemAt triggers arrangeItems
|
||||
let grid = doc.querySelector("#grid2");
|
||||
|
||||
is(grid.itemCount, 2, "2 items initially");
|
||||
is(typeof grid.removeItemAt, "function", "removeItemAt is a function on the grid");
|
||||
|
||||
let arrangeStub = stubMethod(grid, "arrangeItems");
|
||||
let removedItem = grid.removeItemAt(0);
|
||||
|
||||
ok(removedItem, "removeItemAt gives back an item");
|
||||
is(removedItem.getAttribute("id"), "grid2_item1", "removeItemAt gives back the correct item");
|
||||
is(grid.children[0].getAttribute("id"), "grid2_item2", "2nd item becomes the first item");
|
||||
is(grid.itemCount, 1, "itemCount is decremented when we removeItemAt");
|
||||
|
||||
is(arrangeStub.callCount, 1, "arrangeItems is called when we removeItemAt");
|
||||
arrangeStub.restore();
|
||||
}
|
||||
});
|
||||
|
||||
gTests.push({
|
||||
desc: "insertItemAt",
|
||||
run: function() {
|
||||
// implements an insertItemAt method, with index, title, uri.spec signature
|
||||
// insertItemAt triggers arrangeItems
|
||||
let grid = doc.querySelector("#grid3");
|
||||
|
||||
is(grid.itemCount, 2, "2 items initially");
|
||||
is(typeof grid.insertItemAt, "function", "insertItemAt is a function on the grid");
|
||||
|
||||
let arrangeStub = stubMethod(grid, "arrangeItems");
|
||||
let insertedItem = grid.insertItemAt(1, "inserted item", "http://example.com/inserted");
|
||||
|
||||
ok(insertedItem, "insertItemAt gives back an item");
|
||||
is(grid.children[1], insertedItem, "item is inserted at the correct index");
|
||||
is(insertedItem.getAttribute("label"), "inserted item", "insertItemAt creates item with the correct label");
|
||||
is(insertedItem.getAttribute("value"), "http://example.com/inserted", "insertItemAt creates item with the correct url value");
|
||||
is(grid.children[2].getAttribute("id"), "grid3_item2", "following item ends up at the correct index");
|
||||
is(grid.itemCount, 3, "itemCount is incremented when we insertItemAt");
|
||||
|
||||
is(arrangeStub.callCount, 1, "arrangeItems is called when we insertItemAt");
|
||||
arrangeStub.restore();
|
||||
}
|
||||
});
|
||||
|
||||
gTests.push({
|
||||
desc: "getIndexOfItem",
|
||||
run: function() {
|
||||
// implements a getIndexOfItem method, with item (element) signature
|
||||
// insertItemAt triggers arrangeItems
|
||||
let grid = doc.querySelector("#grid4");
|
||||
|
||||
is(grid.itemCount, 2, "2 items initially");
|
||||
is(typeof grid.getIndexOfItem, "function", "getIndexOfItem is a function on the grid");
|
||||
|
||||
let item = doc.getElementById("grid4_item2");
|
||||
let badItem = doc.createElement("richgriditem");
|
||||
|
||||
is(grid.getIndexOfItem(item), 1, "getIndexOfItem returns the correct value for an item");
|
||||
is(grid.getIndexOfItem(badItem), -1, "getIndexOfItem returns -1 for items it doesn't contain");
|
||||
}
|
||||
});
|
||||
|
||||
gTests.push({
|
||||
desc: "getItemsByUrl",
|
||||
run: function() {
|
||||
let grid = doc.querySelector("#grid5");
|
||||
|
||||
is(grid.itemCount, 4, "4 items total");
|
||||
is(typeof grid.getItemsByUrl, "function", "getItemsByUrl is a function on the grid");
|
||||
|
||||
['about:blank', 'http://bugzilla.mozilla.org/'].forEach(function(testUrl) {
|
||||
let items = grid.getItemsByUrl(testUrl);
|
||||
is(items.length, 2, "2 matching items in the test grid");
|
||||
is(items.item(0).url, testUrl, "Matched item has correct url property");
|
||||
is(items.item(1).url, testUrl, "Matched item has correct url property");
|
||||
});
|
||||
|
||||
let badUrl = 'http://gopher.well.com:70/';
|
||||
let items = grid.getItemsByUrl(badUrl);
|
||||
is(items.length, 0, "0 items matched url: "+badUrl);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
gTests.push({
|
||||
desc: "removeItem",
|
||||
run: function() {
|
||||
let grid = doc.querySelector("#grid5");
|
||||
|
||||
is(grid.itemCount, 4, "4 items total");
|
||||
is(typeof grid.removeItem, "function", "removeItem is a function on the grid");
|
||||
|
||||
let arrangeStub = stubMethod(grid, "arrangeItems");
|
||||
let removedFirst = grid.removeItem( grid.children[0] );
|
||||
|
||||
is(arrangeStub.callCount, 1, "arrangeItems is called when we removeItem");
|
||||
|
||||
let removed2nd = grid.removeItem( grid.children[0], true);
|
||||
is(removed2nd.getAttribute("label"), "2nd item", "the next item was returned");
|
||||
is(grid.itemCount, 2, "2 items remain");
|
||||
|
||||
// callCount should still be at 1
|
||||
is(arrangeStub.callCount, 1, "arrangeItems is not called when we pass the truthy skipArrange param");
|
||||
|
||||
let otherItem = grid.ownerDocument.querySelector("#grid6_item1");
|
||||
let removedFail = grid.removeItem(otherItem);
|
||||
ok(!removedFail, "Falsy value returned when non-child item passed");
|
||||
is(grid.itemCount, 2, "2 items remain");
|
||||
|
||||
// callCount should still be at 1
|
||||
is(arrangeStub.callCount, 1, "arrangeItems is not called when nothing is matched");
|
||||
|
||||
arrangeStub.restore();
|
||||
}
|
||||
});
|
||||
|
||||
gTests.push({
|
||||
desc: "selections (single)",
|
||||
run: function() {
|
||||
// when seltype is single,
|
||||
// maintains a selectedItem property
|
||||
// maintains a selectedIndex property
|
||||
// clearSelection, selectItem, toggleItemSelection methods are implemented
|
||||
// 'select' events are implemented
|
||||
let grid = doc.querySelector("#grid-select1");
|
||||
|
||||
is(typeof grid.clearSelection, "function", "clearSelection is a function on the grid");
|
||||
is(typeof grid.selectedItems, "object", "selectedItems is a property on the grid");
|
||||
is(typeof grid.toggleItemSelection, "function", "toggleItemSelection is function on the grid");
|
||||
is(typeof grid.selectItem, "function", "selectItem is a function on the grid");
|
||||
|
||||
is(grid.itemCount, 2, "2 items initially");
|
||||
is(grid.selectedItems.length, 0, "nothing selected initially");
|
||||
|
||||
grid.toggleItemSelection(grid.children[1]);
|
||||
ok(grid.children[1].selected, "toggleItemSelection sets truthy selected prop on previously-unselected item");
|
||||
is(grid.selectedIndex, 1, "selectedIndex is correct");
|
||||
|
||||
grid.toggleItemSelection(grid.children[1]);
|
||||
ok(!grid.children[1].selected, "toggleItemSelection sets falsy selected prop on previously-selected item");
|
||||
is(grid.selectedIndex, -1, "selectedIndex reports correctly with nothing selected");
|
||||
|
||||
// item selection
|
||||
grid.selectItem(grid.children[1]);
|
||||
ok(grid.children[1].selected, "Item selected property is truthy after grid.selectItem");
|
||||
ok(grid.children[1].getAttribute("selected"), "Item selected attribute is truthy after grid.selectItem");
|
||||
ok(grid.selectedItems.length, "There are selectedItems after grid.selectItem");
|
||||
|
||||
// clearSelection
|
||||
grid.selectItem(grid.children[0]);
|
||||
grid.selectItem(grid.children[1]);
|
||||
grid.clearSelection();
|
||||
is(grid.selectedItems.length, 0, "Nothing selected when we clearSelection");
|
||||
is(grid.selectedIndex, -1, "selectedIndex resets after clearSelection");
|
||||
|
||||
// select events
|
||||
// in seltype=single mode, select is like the default action for the tile
|
||||
// (think <a>, not <select multiple>)
|
||||
let handler = {
|
||||
handleEvent: function(aEvent) {}
|
||||
};
|
||||
let handlerStub = stubMethod(handler, "handleEvent");
|
||||
doc.defaultView.addEventListener("select", handler, false);
|
||||
info("select listener added");
|
||||
|
||||
info("calling selectItem, currently it is:" + grid.children[0].selected);
|
||||
// Note: A richgrid in seltype=single mode fires "select" events from selectItem
|
||||
grid.selectItem(grid.children[0]);
|
||||
info("calling selectItem, now it is:" + grid.children[0].selected);
|
||||
yield waitForMs(0);
|
||||
|
||||
is(handlerStub.callCount, 1, "select event handler was called when we selected an item");
|
||||
is(handlerStub.calledWith[0].type, "select", "handler got a select event");
|
||||
is(handlerStub.calledWith[0].target, grid, "select event had the originating grid as the target");
|
||||
handlerStub.restore();
|
||||
doc.defaultView.removeEventListener("select", handler, false);
|
||||
}
|
||||
});
|
||||
|
||||
gTests.push({
|
||||
desc: "selections (multiple)",
|
||||
run: function() {
|
||||
// when seltype is multiple,
|
||||
// maintains a selectedItems property
|
||||
// clearSelection, selectItem, toggleItemSelection methods are implemented
|
||||
// 'selectionchange' events are implemented
|
||||
let grid = doc.querySelector("#grid-select2");
|
||||
|
||||
is(typeof grid.clearSelection, "function", "clearSelection is a function on the grid");
|
||||
is(typeof grid.selectedItems, "object", "selectedItems is a property on the grid");
|
||||
is(typeof grid.toggleItemSelection, "function", "toggleItemSelection is function on the grid");
|
||||
is(typeof grid.selectItem, "function", "selectItem is a function on the grid");
|
||||
|
||||
is(grid.itemCount, 2, "2 items initially");
|
||||
is(grid.selectedItems.length, 0, "nothing selected initially");
|
||||
|
||||
grid.toggleItemSelection(grid.children[1]);
|
||||
ok(grid.children[1].selected, "toggleItemSelection sets truthy selected prop on previously-unselected item");
|
||||
is(grid.selectedItems.length, 1, "1 item selected when we first toggleItemSelection");
|
||||
is(grid.selectedItems[0], grid.children[1], "the right item is selected");
|
||||
is(grid.selectedIndex, 1, "selectedIndex is correct");
|
||||
|
||||
grid.toggleItemSelection(grid.children[1]);
|
||||
is(grid.selectedItems.length, 0, "Nothing selected when we toggleItemSelection again");
|
||||
|
||||
// clearSelection
|
||||
grid.children[0].selected=true;
|
||||
grid.children[1].selected=true;
|
||||
is(grid.selectedItems.length, 2, "Both items are selected before calling clearSelection");
|
||||
grid.clearSelection();
|
||||
is(grid.selectedItems.length, 0, "Nothing selected when we clearSelection");
|
||||
ok(!(grid.children[0].selected || grid.children[1].selected), "selected properties all falsy when we clearSelection");
|
||||
|
||||
// selectionchange events
|
||||
// in seltype=multiple mode, we track selected state on all items
|
||||
// (think <select multiple> not <a>)
|
||||
let handler = {
|
||||
handleEvent: function(aEvent) {}
|
||||
};
|
||||
let handlerStub = stubMethod(handler, "handleEvent");
|
||||
doc.defaultView.addEventListener("selectionchange", handler, false);
|
||||
info("selectionchange listener added");
|
||||
|
||||
info("calling toggleItemSelection, currently it is:" + grid.children[0].selected);
|
||||
// Note: A richgrid in seltype=single mode fires "select" events from selectItem
|
||||
grid.toggleItemSelection(grid.children[0]);
|
||||
info("/calling toggleItemSelection, now it is:" + grid.children[0].selected);
|
||||
yield waitForMs(0);
|
||||
|
||||
is(handlerStub.callCount, 1, "selectionchange event handler was called when we selected an item");
|
||||
is(handlerStub.calledWith[0].type, "selectionchange", "handler got a selectionchange event");
|
||||
is(handlerStub.calledWith[0].target, grid, "select event had the originating grid as the target");
|
||||
handlerStub.restore();
|
||||
doc.defaultView.removeEventListener("selectionchange", handler, false);
|
||||
}
|
||||
});
|
||||
|
||||
// implements a getItemAtIndex method (or grid.children[idx] ?)
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
* 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/. */
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "nsNullPrincipalURI.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsEscape.h"
|
||||
@ -272,14 +273,14 @@ nsNullPrincipalURI::SchemeIs(const char *aScheme, bool *_schemeIs)
|
||||
//// nsISizeOf
|
||||
|
||||
size_t
|
||||
nsNullPrincipalURI::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
nsNullPrincipalURI::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
return mScheme.SizeOfExcludingThisIfUnshared(aMallocSizeOf) +
|
||||
mPath.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
|
||||
}
|
||||
|
||||
size_t
|
||||
nsNullPrincipalURI::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const {
|
||||
nsNullPrincipalURI::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
|
||||
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsString.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
// {51fcd543-3b52-41f7-b91b-6b54102236e6}
|
||||
#define NS_NULLPRINCIPALURI_IMPLEMENTATION_CID \
|
||||
@ -30,8 +31,8 @@ public:
|
||||
NS_DECL_NSIURI
|
||||
|
||||
// nsISizeOf
|
||||
virtual size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
virtual size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
nsNullPrincipalURI(const nsCString &aSpec);
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
#define FragmentOrElement_h___
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "nsAttrAndChildArray.h" // member
|
||||
#include "nsCycleCollectionParticipant.h" // NS_DECL_CYCLE_*
|
||||
#include "nsIContent.h" // base class
|
||||
@ -298,7 +299,7 @@ public:
|
||||
void Traverse(nsCycleCollectionTraversalCallback &cb, bool aIsXUL);
|
||||
void Unlink(bool aIsXUL);
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
/**
|
||||
* The .style attribute (an interface that forwards to the actual
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "nsPropertyTable.h" // for typedefs
|
||||
#include "nsTObserverArray.h" // for member
|
||||
#include "nsWindowMemoryReporter.h" // for NS_DECL_SIZEOF_EXCLUDING_THIS
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/EventTarget.h" // for base class
|
||||
|
||||
// Including 'windows.h' will #define GetClassInfo to something else.
|
||||
@ -299,7 +300,7 @@ public:
|
||||
// way that |this| points to the start of the allocated object, even in
|
||||
// methods of nsINode's sub-classes, and so |aMallocSizeOf(this)| is always
|
||||
// safe to call no matter which object it was invoked on.
|
||||
virtual size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const {
|
||||
virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
|
||||
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
* utility methods for subclasses, and so forth.
|
||||
*/
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Util.h"
|
||||
#include "mozilla/Likely.h"
|
||||
|
||||
@ -593,7 +594,7 @@ FragmentOrElement::nsDOMSlots::Unlink(bool aIsXUL)
|
||||
}
|
||||
|
||||
size_t
|
||||
FragmentOrElement::nsDOMSlots::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
FragmentOrElement::nsDOMSlots::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
size_t n = aMallocSizeOf(this);
|
||||
|
||||
@ -1834,7 +1835,7 @@ FragmentOrElement::FireNodeRemovedForChildren()
|
||||
}
|
||||
|
||||
size_t
|
||||
FragmentOrElement::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
FragmentOrElement::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
size_t n = 0;
|
||||
n += nsIContent::SizeOfExcludingThis(aMallocSizeOf);
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include "Link.h"
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "nsEventStates.h"
|
||||
#include "nsIURL.h"
|
||||
@ -500,7 +501,7 @@ Link::SetHrefAttribute(nsIURI *aURI)
|
||||
}
|
||||
|
||||
size_t
|
||||
Link::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
Link::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
size_t n = 0;
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
#define mozilla_dom_Link_h__
|
||||
|
||||
#include "mozilla/IHistory.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "nsIContent.h"
|
||||
|
||||
namespace mozilla {
|
||||
@ -98,7 +99,7 @@ public:
|
||||
virtual bool HasDeferredDNSPrefetchRequest() { return true; }
|
||||
|
||||
virtual size_t
|
||||
SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
bool ElementHasHref() const;
|
||||
|
||||
|
@ -8,6 +8,7 @@
|
||||
* the two is unified to minimize footprint.
|
||||
*/
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "nsAttrAndChildArray.h"
|
||||
#include "nsMappedAttributeElement.h"
|
||||
#include "prbit.h"
|
||||
@ -836,7 +837,7 @@ nsAttrAndChildArray::SetChildAtPos(void** aPos, nsIContent* aChild,
|
||||
}
|
||||
|
||||
size_t
|
||||
nsAttrAndChildArray::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
nsAttrAndChildArray::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
size_t n = 0;
|
||||
if (mImpl) {
|
||||
|
@ -12,6 +12,7 @@
|
||||
#define nsAttrAndChildArray_h___
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#include "nscore.h"
|
||||
#include "nsAttrName.h"
|
||||
@ -116,7 +117,7 @@ public:
|
||||
!AttrSlotIsTaken(ATTRCHILD_ARRAY_MAX_ATTR_COUNT - 1);
|
||||
}
|
||||
|
||||
size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
bool HasMappedAttrs() const
|
||||
{
|
||||
return MappedAttrCount();
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "nsAttrValueInlines.h"
|
||||
#include "nsIAtom.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/css/StyleRule.h"
|
||||
#include "mozilla/css/Declaration.h"
|
||||
#include "nsContentUtils.h"
|
||||
@ -1949,7 +1950,7 @@ nsAttrValue::StringToInteger(const nsAString& aValue, bool* aStrict,
|
||||
}
|
||||
|
||||
size_t
|
||||
nsAttrValue::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
nsAttrValue::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
size_t n = 0;
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "SVGAttrValueWrapper.h"
|
||||
#include "nsTArrayForwardDeclare.h"
|
||||
#include "nsIAtom.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/BindingDeclarations.h"
|
||||
|
||||
class nsAString;
|
||||
@ -371,7 +372,7 @@ public:
|
||||
bool ParseStyleAttribute(const nsAString& aString,
|
||||
nsStyledElementNotElementCSSInlineStyle* aElement);
|
||||
|
||||
size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
private:
|
||||
// These have to be the same as in ValueType
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
#include "nsDOMAttributeMap.h"
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/Attr.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/MozNamedAttrMapBinding.h"
|
||||
@ -533,14 +534,14 @@ nsDOMAttributeMap::Enumerate(AttrCache::EnumReadFunction aFunc,
|
||||
size_t
|
||||
AttrCacheSizeEnumerator(const nsAttrKey& aKey,
|
||||
const nsRefPtr<Attr>& aValue,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
MallocSizeOf aMallocSizeOf,
|
||||
void* aUserArg)
|
||||
{
|
||||
return aMallocSizeOf(aValue.get());
|
||||
}
|
||||
|
||||
size_t
|
||||
nsDOMAttributeMap::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
nsDOMAttributeMap::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
size_t n = aMallocSizeOf(this);
|
||||
n += mAttributeCache.SizeOfExcludingThis(AttrCacheSizeEnumerator,
|
||||
|
@ -10,6 +10,7 @@
|
||||
#ifndef nsDOMAttributeMap_h
|
||||
#define nsDOMAttributeMap_h
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/Attr.h"
|
||||
#include "mozilla/ErrorResult.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
@ -181,7 +182,7 @@ public:
|
||||
// No supported names we want to show up in iteration.
|
||||
}
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
private:
|
||||
nsCOMPtr<Element> mContent;
|
||||
|
@ -9,6 +9,7 @@
|
||||
*/
|
||||
|
||||
#include "mozilla/DebugOnly.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Util.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include <algorithm>
|
||||
@ -452,7 +453,7 @@ nsIdentifierMapEntry::HasIdElementExposedAsHTMLDocumentProperty()
|
||||
// static
|
||||
size_t
|
||||
nsIdentifierMapEntry::SizeOfExcludingThis(nsIdentifierMapEntry* aEntry,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
MallocSizeOf aMallocSizeOf,
|
||||
void*)
|
||||
{
|
||||
return aEntry->GetKey().SizeOfExcludingThisIfUnshared(aMallocSizeOf);
|
||||
@ -11066,14 +11067,14 @@ nsIDocument::DocSizeOfIncludingThis(nsWindowSizes* aWindowSizes) const
|
||||
|
||||
static size_t
|
||||
SizeOfStyleSheetsElementIncludingThis(nsIStyleSheet* aStyleSheet,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
MallocSizeOf aMallocSizeOf,
|
||||
void* aData)
|
||||
{
|
||||
return aStyleSheet->SizeOfIncludingThis(aMallocSizeOf);
|
||||
}
|
||||
|
||||
size_t
|
||||
nsDocument::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
nsDocument::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
// This SizeOfExcludingThis() overrides the one from nsINode. But
|
||||
// nsDocuments can only appear at the top of the DOM tree, and we use the
|
||||
|
@ -62,6 +62,7 @@
|
||||
#include "nsISecurityEventSink.h"
|
||||
#include "nsIChannelEventSink.h"
|
||||
#include "imgIRequest.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/DOMImplementation.h"
|
||||
#include "nsIDOMTouchEvent.h"
|
||||
#include "nsIInlineEventHandlers.h"
|
||||
@ -224,7 +225,7 @@ public:
|
||||
};
|
||||
|
||||
static size_t SizeOfExcludingThis(nsIdentifierMapEntry* aEntry,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
mozilla::MallocSizeOf aMallocSizeOf,
|
||||
void* aArg);
|
||||
|
||||
private:
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "mozilla/DebugOnly.h"
|
||||
|
||||
#include "nsGenericDOMDataNode.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsEventListenerManager.h"
|
||||
@ -920,7 +921,7 @@ nsGenericDOMDataNode::GetClassAttributeName() const
|
||||
}
|
||||
|
||||
size_t
|
||||
nsGenericDOMDataNode::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
nsGenericDOMDataNode::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
size_t n = nsIContent::SizeOfExcludingThis(aMallocSizeOf);
|
||||
n += mText.SizeOfExcludingThis(aMallocSizeOf);
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "mozAutoDocUpdate.h"
|
||||
#include "mozilla/CORSMode.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/Util.h"
|
||||
#include "nsAsyncDOMEvent.h"
|
||||
@ -2074,7 +2075,7 @@ nsINode::UnbindObject(nsISupports* aObject)
|
||||
}
|
||||
|
||||
size_t
|
||||
nsINode::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
nsINode::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
size_t n = 0;
|
||||
nsEventListenerManager* elm =
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "nsHTMLStyleSheet.h"
|
||||
#include "nsRuleWalker.h"
|
||||
#include "mozilla/HashFunctions.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
@ -248,7 +249,7 @@ nsMappedAttributes::IndexOfAttr(nsIAtom* aLocalName) const
|
||||
}
|
||||
|
||||
size_t
|
||||
nsMappedAttributes::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
nsMappedAttributes::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
NS_ASSERTION(mAttrCount == mBufferSize,
|
||||
"mBufferSize and mAttrCount are expected to be the same.");
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "nsMappedAttributeElement.h"
|
||||
#include "nsIStyleRule.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
class nsIAtom;
|
||||
class nsHTMLStyleSheet;
|
||||
@ -77,7 +78,7 @@ public:
|
||||
virtual void List(FILE* out = stdout, int32_t aIndent = 0) const MOZ_OVERRIDE;
|
||||
#endif
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
private:
|
||||
nsMappedAttributes(const nsMappedAttributes& aCopy);
|
||||
|
@ -20,6 +20,7 @@
|
||||
* nsIAtom pointers, and the values are void pointers.
|
||||
*/
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "nsPropertyTable.h"
|
||||
#include "pldhash.h"
|
||||
#include "nsError.h"
|
||||
@ -52,7 +53,7 @@ public:
|
||||
return mName == aPropertyName;
|
||||
}
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf);
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf);
|
||||
|
||||
nsCOMPtr<nsIAtom> mName; // property name
|
||||
PLDHashTable mObjectValueMap; // map of object/value pairs
|
||||
@ -340,7 +341,7 @@ nsPropertyTable::PropertyList::DeletePropertyFor(nsPropertyOwner aObject)
|
||||
}
|
||||
|
||||
size_t
|
||||
nsPropertyTable::PropertyList::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf)
|
||||
nsPropertyTable::PropertyList::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
|
||||
{
|
||||
size_t n = aMallocSizeOf(this);
|
||||
n += PL_DHashTableSizeOfExcludingThis(&mObjectValueMap, nullptr, aMallocSizeOf);
|
||||
@ -348,7 +349,7 @@ nsPropertyTable::PropertyList::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSize
|
||||
}
|
||||
|
||||
size_t
|
||||
nsPropertyTable::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
nsPropertyTable::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
size_t n = 0;
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
#ifndef nsPropertyTable_h_
|
||||
#define nsPropertyTable_h_
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "nscore.h"
|
||||
|
||||
class nsIAtom;
|
||||
@ -176,7 +177,7 @@ class nsPropertyTable
|
||||
|
||||
class PropertyList;
|
||||
|
||||
size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
private:
|
||||
NS_HIDDEN_(void) DestroyPropertyList();
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "nsBidiUtils.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "nsUTF8Utils.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/SSE.h"
|
||||
#include "nsTextFragmentImpl.h"
|
||||
#include <algorithm>
|
||||
@ -392,7 +393,7 @@ nsTextFragment::Append(const PRUnichar* aBuffer, uint32_t aLength, bool aUpdateB
|
||||
}
|
||||
|
||||
/* virtual */ size_t
|
||||
nsTextFragment::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
nsTextFragment::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
if (Is2b()) {
|
||||
return aMallocSizeOf(m2b);
|
||||
|
@ -12,6 +12,7 @@
|
||||
#define nsTextFragment_h___
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#include "nsString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
@ -174,7 +175,7 @@ public:
|
||||
uint32_t mLength : 29;
|
||||
};
|
||||
|
||||
size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
private:
|
||||
void ReleaseText();
|
||||
|
@ -4,6 +4,7 @@
|
||||
* 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/. */
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Util.h"
|
||||
|
||||
#include "nsXMLHttpRequest.h"
|
||||
@ -534,7 +535,7 @@ nsXMLHttpRequest::DisconnectFromOwner()
|
||||
|
||||
size_t
|
||||
nsXMLHttpRequest::SizeOfEventTargetIncludingThis(
|
||||
nsMallocSizeOfFun aMallocSizeOf) const
|
||||
MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
size_t n = aMallocSizeOf(this);
|
||||
n += mResponseBody.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include "nsISizeOfEventTarget.h"
|
||||
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/BindingUtils.h"
|
||||
#include "mozilla/dom/TypedArray.h"
|
||||
#include "mozilla/dom/XMLHttpRequestBinding.h"
|
||||
@ -227,7 +228,7 @@ public:
|
||||
|
||||
// nsISizeOfEventTarget
|
||||
virtual size_t
|
||||
SizeOfEventTargetIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
SizeOfEventTargetIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsXHREventTarget)
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "nsWrapperCache.h"
|
||||
|
||||
#include "mozilla/LinkedList.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@ -32,7 +33,7 @@ public:
|
||||
|
||||
void Delete();
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const {
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
|
||||
size_t sizeOfCache = mCache ? mCache->SizeOfIncludingThis(aMallocSizeOf) : 0;
|
||||
return aMallocSizeOf(this) + sizeOfCache;
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include "nsTArray.h"
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
@ -306,7 +307,7 @@ public:
|
||||
|
||||
void Update();
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
return aMallocSizeOf(this) + mTreeData.SizeOfExcludingThis(aMallocSizeOf);
|
||||
}
|
||||
@ -558,7 +559,7 @@ bool WebGLElementArrayCache::Validate(GLenum type, uint32_t maxAllowed, size_t f
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t WebGLElementArrayCache::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const {
|
||||
size_t WebGLElementArrayCache::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
|
||||
size_t uint8TreeSize = mUint8Tree ? mUint8Tree->SizeOfIncludingThis(aMallocSizeOf) : 0;
|
||||
size_t uint16TreeSize = mUint16Tree ? mUint16Tree->SizeOfIncludingThis(aMallocSizeOf) : 0;
|
||||
size_t uint32TreeSize = mUint32Tree ? mUint32Tree->SizeOfIncludingThis(aMallocSizeOf) : 0;
|
||||
|
@ -6,6 +6,7 @@
|
||||
#ifndef WEBGLELEMENTARRAYCACHE_H
|
||||
#define WEBGLELEMENTARRAYCACHE_H
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/StandardInteger.h"
|
||||
#include "nscore.h"
|
||||
#include "GLDefs.h"
|
||||
@ -47,7 +48,7 @@ public:
|
||||
|
||||
~WebGLElementArrayCache();
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
private:
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include "WebGLObjectModel.h"
|
||||
#include "WebGLShader.h"
|
||||
#include "WebGLContext.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/WebGLRenderingContextBinding.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
||||
@ -39,7 +40,7 @@ WebGLShader::Delete() {
|
||||
}
|
||||
|
||||
size_t
|
||||
WebGLShader::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const {
|
||||
WebGLShader::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const {
|
||||
return aMallocSizeOf(this) +
|
||||
mSource.SizeOfExcludingThisIfUnshared(aMallocSizeOf) +
|
||||
mTranslationLog.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "angle/ShaderLang.h"
|
||||
|
||||
#include "mozilla/LinkedList.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@ -39,7 +40,7 @@ public:
|
||||
DeleteOnce();
|
||||
}
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
WebGLuint GLName() { return mGLName; }
|
||||
WebGLenum ShaderType() { return mType; }
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsINameSpaceManager.h"
|
||||
#include "nsIContent.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsView.h"
|
||||
@ -1275,7 +1276,7 @@ nsEventListenerManager::GetEventHandlerInternal(nsIAtom *aEventName)
|
||||
}
|
||||
|
||||
size_t
|
||||
nsEventListenerManager::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf)
|
||||
nsEventListenerManager::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf)
|
||||
const
|
||||
{
|
||||
size_t n = aMallocSizeOf(this);
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "nsTObserverArray.h"
|
||||
#include "nsGUIEvent.h"
|
||||
#include "nsIJSEventListener.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/EventTarget.h"
|
||||
#include "mozilla/dom/EventListenerBinding.h"
|
||||
|
||||
@ -400,7 +401,7 @@ public:
|
||||
|
||||
bool MayHaveMouseEnterLeaveEventListener() { return mMayHaveMouseEnterLeaveEventListener; }
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
void MarkForCC();
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
* 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/. */
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/HTMLAnchorElement.h"
|
||||
#include "mozilla/dom/HTMLAnchorElementBinding.h"
|
||||
|
||||
@ -413,7 +414,7 @@ HTMLAnchorElement::IntrinsicState() const
|
||||
}
|
||||
|
||||
size_t
|
||||
HTMLAnchorElement::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
HTMLAnchorElement::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
return nsGenericHTMLElement::SizeOfExcludingThis(aMallocSizeOf) +
|
||||
Link::SizeOfExcludingThis(aMallocSizeOf);
|
||||
|
@ -4,6 +4,7 @@
|
||||
* 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/. */
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/HTMLAreaElement.h"
|
||||
#include "mozilla/dom/HTMLAreaElementBinding.h"
|
||||
#include "base/compiler_specific.h"
|
||||
@ -232,7 +233,7 @@ HTMLAreaElement::IntrinsicState() const
|
||||
}
|
||||
|
||||
size_t
|
||||
HTMLAreaElement::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
HTMLAreaElement::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
return nsGenericHTMLElement::SizeOfExcludingThis(aMallocSizeOf) +
|
||||
Link::SizeOfExcludingThis(aMallocSizeOf);
|
||||
|
@ -3,6 +3,7 @@
|
||||
* 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/. */
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/HTMLLinkElement.h"
|
||||
|
||||
#include "mozilla/dom/HTMLLinkElementBinding.h"
|
||||
@ -404,7 +405,7 @@ HTMLLinkElement::IntrinsicState() const
|
||||
}
|
||||
|
||||
size_t
|
||||
HTMLLinkElement::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
HTMLLinkElement::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
return nsGenericHTMLElement::SizeOfExcludingThis(aMallocSizeOf) +
|
||||
Link::SizeOfExcludingThis(aMallocSizeOf);
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "nsIXULAppInfo.h"
|
||||
#include "nsPluginArray.h"
|
||||
#include "nsMimeTypeArray.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/DesktopNotification.h"
|
||||
#include "nsGeolocation.h"
|
||||
#include "nsIHttpProtocolHandler.h"
|
||||
@ -1536,7 +1537,7 @@ Navigator::GetMozCameras(nsISupports** aCameraManager)
|
||||
}
|
||||
|
||||
size_t
|
||||
Navigator::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
Navigator::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
size_t n = aMallocSizeOf(this);
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
#ifndef mozilla_dom_Navigator_h
|
||||
#define mozilla_dom_Navigator_h
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "nsIDOMNavigator.h"
|
||||
#include "nsIDOMNavigatorGeolocation.h"
|
||||
#include "nsIDOMNavigatorDeviceStorage.h"
|
||||
@ -200,7 +201,7 @@ public:
|
||||
|
||||
static bool HasDesktopNotificationSupport();
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
/**
|
||||
* For use during document.write where our inner window changes.
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <algorithm>
|
||||
|
||||
/* This must occur *after* base/basictypes.h to avoid typedefs conflicts. */
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Util.h"
|
||||
|
||||
// Local Includes
|
||||
@ -11224,7 +11225,7 @@ nsGlobalWindow::HasIndexedDBSupport()
|
||||
static size_t
|
||||
SizeOfEventTargetObjectsEntryExcludingThisFun(
|
||||
nsPtrHashKey<nsDOMEventTargetHelper> *aEntry,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
MallocSizeOf aMallocSizeOf,
|
||||
void *arg)
|
||||
{
|
||||
nsISupports *supports = aEntry->GetKey();
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "xpcpublic.h"
|
||||
#include "nsIDOMEventListener.h"
|
||||
#include "nsIAtom.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/EventHandlerBinding.h"
|
||||
|
||||
#define NS_IJSEVENTLISTENER_IID \
|
||||
@ -236,7 +237,7 @@ public:
|
||||
mHandler.SetHandler(aHandler);
|
||||
}
|
||||
|
||||
virtual size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
return 0;
|
||||
|
||||
@ -252,7 +253,7 @@ public:
|
||||
// - mEventName: shared with others
|
||||
}
|
||||
|
||||
virtual size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
#ifndef nsISizeOfEventTarget_h___
|
||||
#define nsISizeOfEventTarget_h___
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "nsISupports.h"
|
||||
|
||||
#define NS_ISIZEOFEVENTTARGET_IID \
|
||||
@ -31,7 +32,7 @@ public:
|
||||
* itself.
|
||||
*/
|
||||
virtual size_t
|
||||
SizeOfEventTargetIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const = 0;
|
||||
SizeOfEventTargetIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const = 0;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsISizeOfEventTarget, NS_ISIZEOFEVENTTARGET_IID)
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "nsCRT.h"
|
||||
#include "nsIObserverService.h"
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/Services.h"
|
||||
|
||||
@ -43,7 +44,7 @@ public:
|
||||
nsString mKey;
|
||||
nsGlobalNameStruct mGlobalName;
|
||||
|
||||
size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) {
|
||||
size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) {
|
||||
// Measurement of the following members may be added later if DMD finds it
|
||||
// is worthwhile:
|
||||
// - mGlobalName
|
||||
@ -877,7 +878,7 @@ nsScriptNameSpaceManager::EnumerateGlobalNames(GlobalNameEnumerator aEnumerator,
|
||||
}
|
||||
|
||||
static size_t
|
||||
SizeOfEntryExcludingThis(PLDHashEntryHdr *aHdr, nsMallocSizeOfFun aMallocSizeOf,
|
||||
SizeOfEntryExcludingThis(PLDHashEntryHdr *aHdr, MallocSizeOf aMallocSizeOf,
|
||||
void *aArg)
|
||||
{
|
||||
GlobalNameMapEntry* entry = static_cast<GlobalNameMapEntry*>(aHdr);
|
||||
@ -885,7 +886,7 @@ SizeOfEntryExcludingThis(PLDHashEntryHdr *aHdr, nsMallocSizeOfFun aMallocSizeOf,
|
||||
}
|
||||
|
||||
size_t
|
||||
nsScriptNameSpaceManager::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf)
|
||||
nsScriptNameSpaceManager::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf)
|
||||
{
|
||||
size_t n = 0;
|
||||
n += PL_DHashTableSizeOfExcludingThis(&mGlobalNames,
|
||||
|
@ -21,6 +21,7 @@
|
||||
#ifndef nsScriptNameSpaceManager_h__
|
||||
#define nsScriptNameSpaceManager_h__
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "nsIScriptNameSpaceManager.h"
|
||||
#include "nsString.h"
|
||||
#include "nsID.h"
|
||||
@ -156,7 +157,7 @@ public:
|
||||
void EnumerateGlobalNames(GlobalNameEnumerator aEnumerator,
|
||||
void* aClosure);
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf);
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf);
|
||||
|
||||
private:
|
||||
// Adds a new entry to the hash and returns the nsGlobalNameStruct
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "nsDataHashtable.h"
|
||||
#include "nsWeakReference.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
#include "nsArenaMemoryStats.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
@ -21,15 +22,15 @@
|
||||
// SizeOfExcludingThis from its super-class. SizeOfIncludingThis() need not be
|
||||
// defined, it is inherited from nsINode.
|
||||
#define NS_DECL_SIZEOF_EXCLUDING_THIS \
|
||||
virtual size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
class nsWindowSizes {
|
||||
public:
|
||||
nsWindowSizes(nsMallocSizeOfFun aMallocSizeOf) {
|
||||
nsWindowSizes(mozilla::MallocSizeOf aMallocSizeOf) {
|
||||
memset(this, 0, sizeof(nsWindowSizes));
|
||||
mMallocSizeOf = aMallocSizeOf;
|
||||
}
|
||||
nsMallocSizeOfFun mMallocSizeOf;
|
||||
mozilla::MallocSizeOf mMallocSizeOf;
|
||||
nsArenaMemoryStats mArenaStats;
|
||||
size_t mDOMElementNodes;
|
||||
size_t mDOMTextNodes;
|
||||
|
@ -7,6 +7,7 @@
|
||||
#define nsJSEventListener_h__
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "nsIDOMKeyEvent.h"
|
||||
#include "nsIJSEventListener.h"
|
||||
#include "nsIDOMEventListener.h"
|
||||
@ -33,7 +34,7 @@ public:
|
||||
|
||||
// nsIJSEventListener
|
||||
|
||||
virtual size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const MOZ_OVERRIDE
|
||||
virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE
|
||||
{
|
||||
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
|
||||
}
|
||||
|
@ -701,49 +701,63 @@ NS_IMETHODIMP nsWebBrowser::SetProperty(uint32_t aId, uint32_t aValue)
|
||||
case nsIWebBrowserSetup::SETUP_ALLOW_PLUGINS:
|
||||
{
|
||||
NS_ENSURE_STATE(mDocShell);
|
||||
NS_ENSURE_TRUE((aValue == true || aValue == false), NS_ERROR_INVALID_ARG);
|
||||
NS_ENSURE_TRUE((aValue == static_cast<uint32_t>(true) ||
|
||||
aValue == static_cast<uint32_t>(false)),
|
||||
NS_ERROR_INVALID_ARG);
|
||||
mDocShell->SetAllowPlugins(!!aValue);
|
||||
}
|
||||
break;
|
||||
case nsIWebBrowserSetup::SETUP_ALLOW_JAVASCRIPT:
|
||||
{
|
||||
NS_ENSURE_STATE(mDocShell);
|
||||
NS_ENSURE_TRUE((aValue == true || aValue == false), NS_ERROR_INVALID_ARG);
|
||||
NS_ENSURE_TRUE((aValue == static_cast<uint32_t>(true) ||
|
||||
aValue == static_cast<uint32_t>(false)),
|
||||
NS_ERROR_INVALID_ARG);
|
||||
mDocShell->SetAllowJavascript(!!aValue);
|
||||
}
|
||||
break;
|
||||
case nsIWebBrowserSetup::SETUP_ALLOW_META_REDIRECTS:
|
||||
{
|
||||
NS_ENSURE_STATE(mDocShell);
|
||||
NS_ENSURE_TRUE((aValue == true || aValue == false), NS_ERROR_INVALID_ARG);
|
||||
NS_ENSURE_TRUE((aValue == static_cast<uint32_t>(true) ||
|
||||
aValue == static_cast<uint32_t>(false)),
|
||||
NS_ERROR_INVALID_ARG);
|
||||
mDocShell->SetAllowMetaRedirects(!!aValue);
|
||||
}
|
||||
break;
|
||||
case nsIWebBrowserSetup::SETUP_ALLOW_SUBFRAMES:
|
||||
{
|
||||
NS_ENSURE_STATE(mDocShell);
|
||||
NS_ENSURE_TRUE((aValue == true || aValue == false), NS_ERROR_INVALID_ARG);
|
||||
NS_ENSURE_TRUE((aValue == static_cast<uint32_t>(true) ||
|
||||
aValue == static_cast<uint32_t>(false)),
|
||||
NS_ERROR_INVALID_ARG);
|
||||
mDocShell->SetAllowSubframes(!!aValue);
|
||||
}
|
||||
break;
|
||||
case nsIWebBrowserSetup::SETUP_ALLOW_IMAGES:
|
||||
{
|
||||
NS_ENSURE_STATE(mDocShell);
|
||||
NS_ENSURE_TRUE((aValue == true || aValue == false), NS_ERROR_INVALID_ARG);
|
||||
NS_ENSURE_TRUE((aValue == static_cast<uint32_t>(true) ||
|
||||
aValue == static_cast<uint32_t>(false)),
|
||||
NS_ERROR_INVALID_ARG);
|
||||
mDocShell->SetAllowImages(!!aValue);
|
||||
}
|
||||
break;
|
||||
case nsIWebBrowserSetup::SETUP_ALLOW_DNS_PREFETCH:
|
||||
{
|
||||
NS_ENSURE_STATE(mDocShell);
|
||||
NS_ENSURE_TRUE((aValue == true || aValue == false), NS_ERROR_INVALID_ARG);
|
||||
NS_ENSURE_TRUE((aValue == static_cast<uint32_t>(true) ||
|
||||
aValue == static_cast<uint32_t>(false)),
|
||||
NS_ERROR_INVALID_ARG);
|
||||
mDocShell->SetAllowDNSPrefetch(!!aValue);
|
||||
}
|
||||
break;
|
||||
case nsIWebBrowserSetup::SETUP_USE_GLOBAL_HISTORY:
|
||||
{
|
||||
NS_ENSURE_STATE(mDocShell);
|
||||
NS_ENSURE_TRUE((aValue == true || aValue == false), NS_ERROR_INVALID_ARG);
|
||||
NS_ENSURE_TRUE((aValue == static_cast<uint32_t>(true) ||
|
||||
aValue == static_cast<uint32_t>(false)),
|
||||
NS_ERROR_INVALID_ARG);
|
||||
rv = EnableGlobalHistory(!!aValue);
|
||||
mShouldEnableHistory = aValue;
|
||||
}
|
||||
@ -755,7 +769,9 @@ NS_IMETHODIMP nsWebBrowser::SetProperty(uint32_t aId, uint32_t aValue)
|
||||
break;
|
||||
case nsIWebBrowserSetup::SETUP_IS_CHROME_WRAPPER:
|
||||
{
|
||||
NS_ENSURE_TRUE((aValue == true || aValue == false), NS_ERROR_INVALID_ARG);
|
||||
NS_ENSURE_TRUE((aValue == static_cast<uint32_t>(true) ||
|
||||
aValue == static_cast<uint32_t>(false)),
|
||||
NS_ERROR_INVALID_ARG);
|
||||
SetItemType(aValue ? static_cast<int32_t>(typeChromeWrapper)
|
||||
: static_cast<int32_t>(typeContentWrapper));
|
||||
}
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "mozilla/Base64.h"
|
||||
#include "mozilla/CheckedInt.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#include "gfxASurface.h"
|
||||
#include "gfxContext.h"
|
||||
@ -671,14 +672,14 @@ gfxASurface::RecordMemoryFreed()
|
||||
}
|
||||
|
||||
size_t
|
||||
gfxASurface::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
gfxASurface::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
// We don't measure mSurface because cairo doesn't allow it.
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t
|
||||
gfxASurface::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
gfxASurface::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
|
||||
}
|
||||
|
@ -10,6 +10,7 @@
|
||||
#define MOZ_DUMP_IMAGES
|
||||
#endif
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "gfxTypes.h"
|
||||
#include "gfxRect.h"
|
||||
#include "nsAutoPtr.h"
|
||||
@ -210,8 +211,8 @@ public:
|
||||
|
||||
virtual int32_t KnownMemoryUsed() { return mBytesRecorded; }
|
||||
|
||||
virtual size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
virtual size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
// gfxASurface has many sub-classes. This method indicates if a sub-class
|
||||
// is capable of measuring its own size accurately. If not, the caller
|
||||
// must fall back to a computed size. (Note that gfxASurface can actually
|
||||
|
@ -3,6 +3,7 @@
|
||||
* 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/. */
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Util.h"
|
||||
|
||||
#ifdef MOZ_LOGGING
|
||||
@ -213,7 +214,7 @@ gfxDWriteFontFamily::LocalizedName(nsAString &aLocalizedName)
|
||||
}
|
||||
|
||||
void
|
||||
gfxDWriteFontFamily::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxDWriteFontFamily::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
gfxFontFamily::SizeOfExcludingThis(aMallocSizeOf, aSizes);
|
||||
@ -222,7 +223,7 @@ gfxDWriteFontFamily::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
}
|
||||
|
||||
void
|
||||
gfxDWriteFontFamily::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxDWriteFontFamily::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontListSize += aMallocSizeOf(this);
|
||||
@ -555,7 +556,7 @@ gfxDWriteFontEntry::IsCJKFont()
|
||||
}
|
||||
|
||||
void
|
||||
gfxDWriteFontEntry::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxDWriteFontEntry::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
gfxFontEntry::SizeOfExcludingThis(aMallocSizeOf, aSizes);
|
||||
@ -564,7 +565,7 @@ gfxDWriteFontEntry::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
}
|
||||
|
||||
void
|
||||
gfxDWriteFontEntry::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxDWriteFontEntry::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontListSize += aMallocSizeOf(this);
|
||||
@ -1218,7 +1219,7 @@ gfxDWriteFontList::ResolveFontName(const nsAString& aFontName,
|
||||
}
|
||||
|
||||
void
|
||||
gfxDWriteFontList::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxDWriteFontList::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
gfxPlatformFontList::SizeOfExcludingThis(aMallocSizeOf, aSizes);
|
||||
@ -1236,7 +1237,7 @@ gfxDWriteFontList::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
}
|
||||
|
||||
void
|
||||
gfxDWriteFontList::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxDWriteFontList::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontListSize += aMallocSizeOf(this);
|
||||
|
@ -6,6 +6,7 @@
|
||||
#ifndef GFX_DWRITEFONTLIST_H
|
||||
#define GFX_DWRITEFONTLIST_H
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "gfxDWriteCommon.h"
|
||||
|
||||
#include "gfxFont.h"
|
||||
@ -48,9 +49,9 @@ public:
|
||||
|
||||
void SetForceGDIClassic(bool aForce) { mForceGDIClassic = aForce; }
|
||||
|
||||
virtual void SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
virtual void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
|
||||
protected:
|
||||
@ -152,9 +153,9 @@ public:
|
||||
void SetForceGDIClassic(bool aForce) { mForceGDIClassic = aForce; }
|
||||
bool GetForceGDIClassic() { return mForceGDIClassic; }
|
||||
|
||||
virtual void SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
virtual void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
|
||||
protected:
|
||||
@ -365,9 +366,9 @@ public:
|
||||
|
||||
gfxFloat GetForceGDIClassicMaxFontSize() { return mForceGDIClassicMaxFontSize; }
|
||||
|
||||
virtual void SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
virtual void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
|
||||
private:
|
||||
|
@ -3,6 +3,7 @@
|
||||
* 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/. */
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "gfxDWriteFonts.h"
|
||||
#include "gfxDWriteShaper.h"
|
||||
#include "gfxHarfBuzzShaper.h"
|
||||
@ -668,7 +669,7 @@ gfxDWriteFont::MeasureGlyphWidth(uint16_t aGlyph)
|
||||
}
|
||||
|
||||
void
|
||||
gfxDWriteFont::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxDWriteFont::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const
|
||||
{
|
||||
gfxFont::SizeOfExcludingThis(aMallocSizeOf, aSizes);
|
||||
@ -677,7 +678,7 @@ gfxDWriteFont::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
}
|
||||
|
||||
void
|
||||
gfxDWriteFont::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxDWriteFont::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontInstances += aMallocSizeOf(this);
|
||||
|
@ -6,6 +6,7 @@
|
||||
#ifndef GFX_WINDOWSDWRITEFONTS_H
|
||||
#define GFX_WINDOWSDWRITEFONTS_H
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include <dwrite.h>
|
||||
|
||||
#include "gfxFont.h"
|
||||
@ -58,9 +59,9 @@ public:
|
||||
|
||||
virtual mozilla::TemporaryRef<mozilla::gfx::GlyphRenderingOptions> GetGlyphRenderingOptions();
|
||||
|
||||
virtual void SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const;
|
||||
virtual void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const;
|
||||
|
||||
virtual FontType GetType() const { return FONT_TYPE_DWRITE; }
|
||||
|
@ -3,6 +3,7 @@
|
||||
* 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/. */
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Util.h"
|
||||
|
||||
#if defined(MOZ_WIDGET_GTK2)
|
||||
@ -464,7 +465,7 @@ FT2FontEntry::CopyFontTable(uint32_t aTableTag,
|
||||
}
|
||||
|
||||
void
|
||||
FT2FontEntry::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
FT2FontEntry::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
gfxFontEntry::SizeOfExcludingThis(aMallocSizeOf, aSizes);
|
||||
@ -473,7 +474,7 @@ FT2FontEntry::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
}
|
||||
|
||||
void
|
||||
FT2FontEntry::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
FT2FontEntry::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontListSize += aMallocSizeOf(this);
|
||||
|
@ -6,6 +6,8 @@
|
||||
#ifndef GFX_FT2FONTLIST_H
|
||||
#define GFX_FT2FONTLIST_H
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#ifdef XP_WIN
|
||||
#include "gfxWindowsPlatform.h"
|
||||
#include <windows.h>
|
||||
@ -74,9 +76,9 @@ public:
|
||||
// accordingly so that we avoid using bad font tables
|
||||
void CheckForBrokenFont(gfxFontFamily *aFamily);
|
||||
|
||||
virtual void SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
virtual void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
|
||||
FT_Face mFTFace;
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include "prlog.h"
|
||||
#include "prinit.h"
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
|
||||
// rounding and truncation functions for a Freetype floating point number
|
||||
@ -642,7 +643,7 @@ gfxFT2Font::FillGlyphDataForChar(uint32_t ch, CachedGlyphData *gd)
|
||||
}
|
||||
|
||||
void
|
||||
gfxFT2Font::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxFT2Font::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const
|
||||
{
|
||||
gfxFont::SizeOfExcludingThis(aMallocSizeOf, aSizes);
|
||||
@ -651,7 +652,7 @@ gfxFT2Font::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
}
|
||||
|
||||
void
|
||||
gfxFT2Font::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxFT2Font::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontInstances += aMallocSizeOf(this);
|
||||
|
@ -6,6 +6,7 @@
|
||||
#ifndef GFX_FT2FONTS_H
|
||||
#define GFX_FT2FONTS_H
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "cairo.h"
|
||||
#include "gfxTypes.h"
|
||||
#include "gfxFont.h"
|
||||
@ -63,9 +64,9 @@ public: // new functions
|
||||
return &entry->mData;
|
||||
}
|
||||
|
||||
virtual void SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const;
|
||||
virtual void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const;
|
||||
|
||||
protected:
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include "nsStyleConsts.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
@ -325,10 +326,10 @@ public:
|
||||
mHashKey = 0;
|
||||
}
|
||||
|
||||
size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const {
|
||||
size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const {
|
||||
return mTableData.SizeOfExcludingThis(aMallocSizeOf);
|
||||
}
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const {
|
||||
size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const {
|
||||
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
|
||||
}
|
||||
|
||||
@ -576,7 +577,7 @@ gfxFontEntry::CheckForGraphiteTables()
|
||||
/* static */ size_t
|
||||
gfxFontEntry::FontTableHashEntry::SizeOfEntryExcludingThis
|
||||
(FontTableHashEntry *aEntry,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
MallocSizeOf aMallocSizeOf,
|
||||
void* aUserArg)
|
||||
{
|
||||
FontListSizes *sizes = static_cast<FontListSizes*>(aUserArg);
|
||||
@ -594,7 +595,7 @@ gfxFontEntry::FontTableHashEntry::SizeOfEntryExcludingThis
|
||||
}
|
||||
|
||||
void
|
||||
gfxFontEntry::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxFontEntry::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontListSize += mName.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
|
||||
@ -611,7 +612,7 @@ gfxFontEntry::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
}
|
||||
|
||||
void
|
||||
gfxFontEntry::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxFontEntry::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontListSize += aMallocSizeOf(this);
|
||||
@ -1197,7 +1198,7 @@ gfxFontFamily::FindFont(const nsAString& aPostscriptName)
|
||||
}
|
||||
|
||||
void
|
||||
gfxFontFamily::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxFontFamily::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontListSize +=
|
||||
@ -1216,7 +1217,7 @@ gfxFontFamily::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
}
|
||||
|
||||
void
|
||||
gfxFontFamily::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxFontFamily::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontListSize += aMallocSizeOf(this);
|
||||
@ -1476,7 +1477,7 @@ gfxFontCache::ClearCachedWordsForFont(HashEntry* aHashEntry, void* aUserData)
|
||||
/*static*/
|
||||
size_t
|
||||
gfxFontCache::SizeOfFontEntryExcludingThis(HashEntry* aHashEntry,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
MallocSizeOf aMallocSizeOf,
|
||||
void* aUserArg)
|
||||
{
|
||||
HashEntry *entry = static_cast<HashEntry*>(aHashEntry);
|
||||
@ -1489,7 +1490,7 @@ gfxFontCache::SizeOfFontEntryExcludingThis(HashEntry* aHashEntry,
|
||||
}
|
||||
|
||||
void
|
||||
gfxFontCache::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxFontCache::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const
|
||||
{
|
||||
// TODO: add the overhead of the expiration tracker (generation arrays)
|
||||
@ -1499,7 +1500,7 @@ gfxFontCache::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
}
|
||||
|
||||
void
|
||||
gfxFontCache::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxFontCache::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontInstances += aMallocSizeOf(this);
|
||||
@ -3671,14 +3672,14 @@ gfxFont::SynthesizeSpaceWidth(uint32_t aCh)
|
||||
|
||||
/*static*/ size_t
|
||||
gfxFont::WordCacheEntrySizeOfExcludingThis(CacheHashEntry* aHashEntry,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
MallocSizeOf aMallocSizeOf,
|
||||
void* aUserArg)
|
||||
{
|
||||
return aMallocSizeOf(aHashEntry->mShapedWord.get());
|
||||
}
|
||||
|
||||
void
|
||||
gfxFont::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxFont::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const
|
||||
{
|
||||
for (uint32_t i = 0; i < mGlyphExtentsArray.Length(); ++i) {
|
||||
@ -3691,7 +3692,7 @@ gfxFont::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
}
|
||||
|
||||
void
|
||||
gfxFont::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxFont::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontInstances += aMallocSizeOf(this);
|
||||
@ -3748,7 +3749,7 @@ gfxGlyphExtents::GlyphWidths::~GlyphWidths()
|
||||
}
|
||||
|
||||
uint32_t
|
||||
gfxGlyphExtents::GlyphWidths::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
gfxGlyphExtents::GlyphWidths::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
uint32_t i;
|
||||
uint32_t size = mBlocks.SizeOfExcludingThis(aMallocSizeOf);
|
||||
@ -3812,14 +3813,14 @@ gfxGlyphExtents::SetTightGlyphExtents(uint32_t aGlyphID, const gfxRect& aExtents
|
||||
}
|
||||
|
||||
size_t
|
||||
gfxGlyphExtents::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
gfxGlyphExtents::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
return mContainedGlyphWidths.SizeOfExcludingThis(aMallocSizeOf) +
|
||||
mTightGlyphExtents.SizeOfExcludingThis(nullptr, aMallocSizeOf);
|
||||
}
|
||||
|
||||
size_t
|
||||
gfxGlyphExtents::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
gfxGlyphExtents::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
|
||||
}
|
||||
@ -6547,7 +6548,7 @@ gfxTextRun::ClusterIterator::ClusterAdvance(PropertyProvider *aProvider) const
|
||||
}
|
||||
|
||||
size_t
|
||||
gfxTextRun::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf)
|
||||
gfxTextRun::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf)
|
||||
{
|
||||
// The second arg is how much gfxTextRun::AllocateStorage would have
|
||||
// allocated.
|
||||
@ -6561,7 +6562,7 @@ gfxTextRun::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf)
|
||||
}
|
||||
|
||||
size_t
|
||||
gfxTextRun::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf)
|
||||
gfxTextRun::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf)
|
||||
{
|
||||
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
|
||||
}
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "mozilla/HashFunctions.h"
|
||||
#include "nsIMemoryReporter.h"
|
||||
#include "gfxFontFeatures.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/gfx/Types.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include <algorithm>
|
||||
@ -196,7 +197,7 @@ public:
|
||||
|
||||
void CalcHash() { mHash = GetChecksum(); }
|
||||
|
||||
size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const {
|
||||
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
|
||||
return gfxSparseBitSet::SizeOfExcludingThis(aMallocSizeOf);
|
||||
}
|
||||
|
||||
@ -411,9 +412,9 @@ public:
|
||||
virtual void ReleaseGrFace(gr_face* aFace);
|
||||
|
||||
// For memory reporting
|
||||
virtual void SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
virtual void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
|
||||
nsString mName;
|
||||
@ -620,7 +621,7 @@ private:
|
||||
|
||||
static size_t
|
||||
SizeOfEntryExcludingThis(FontTableHashEntry *aEntry,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
mozilla::MallocSizeOf aMallocSizeOf,
|
||||
void* aUserArg);
|
||||
|
||||
private:
|
||||
@ -781,9 +782,9 @@ public:
|
||||
void CheckForSimpleFamily();
|
||||
|
||||
// For memory reporter
|
||||
virtual void SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
virtual void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
|
||||
// Only used for debugging checks - does a linear search
|
||||
@ -949,9 +950,9 @@ public:
|
||||
mFonts.EnumerateEntries(ClearCachedWordsForFont, nullptr);
|
||||
}
|
||||
|
||||
void SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
void SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const;
|
||||
void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const;
|
||||
|
||||
protected:
|
||||
@ -996,7 +997,7 @@ protected:
|
||||
};
|
||||
|
||||
static size_t SizeOfFontEntryExcludingThis(HashEntry* aHashEntry,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
mozilla::MallocSizeOf aMallocSizeOf,
|
||||
void* aUserArg);
|
||||
|
||||
nsTHashtable<HashEntry> mFonts;
|
||||
@ -1170,8 +1171,8 @@ public:
|
||||
|
||||
int32_t GetAppUnitsPerDevUnit() { return mAppUnitsPerDevUnit; }
|
||||
|
||||
size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
private:
|
||||
class HashEntry : public nsUint32HashKey {
|
||||
@ -1208,7 +1209,7 @@ private:
|
||||
return widths[indexInBlock];
|
||||
}
|
||||
|
||||
uint32_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
uint32_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
~GlyphWidths();
|
||||
|
||||
@ -1675,9 +1676,9 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const;
|
||||
virtual void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const;
|
||||
|
||||
typedef enum {
|
||||
@ -1885,7 +1886,7 @@ protected:
|
||||
|
||||
static size_t
|
||||
WordCacheEntrySizeOfExcludingThis(CacheHashEntry* aHashEntry,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
mozilla::MallocSizeOf aMallocSizeOf,
|
||||
void* aUserArg);
|
||||
|
||||
nsTHashtable<CacheHashEntry> mWordCache;
|
||||
@ -2378,7 +2379,7 @@ protected:
|
||||
return details;
|
||||
}
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) {
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) {
|
||||
return aMallocSizeOf(this) +
|
||||
mDetails.SizeOfExcludingThis(aMallocSizeOf) +
|
||||
mOffsetToIndex.SizeOfExcludingThis(aMallocSizeOf);
|
||||
@ -3136,13 +3137,13 @@ public:
|
||||
|
||||
// return storage used by this run, for memory reporter;
|
||||
// nsTransformedTextRun needs to override this as it holds additional data
|
||||
virtual size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf)
|
||||
virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf)
|
||||
MOZ_MUST_OVERRIDE;
|
||||
virtual size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf)
|
||||
virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
|
||||
MOZ_MUST_OVERRIDE;
|
||||
|
||||
// Get the size, if it hasn't already been gotten, marking as it goes.
|
||||
size_t MaybeSizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) {
|
||||
size_t MaybeSizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) {
|
||||
if (mFlags & gfxTextRunFactory::TEXT_RUN_SIZE_ACCOUNTED) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "nsAutoPtr.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include "mozilla/Endian.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#include "zlib.h"
|
||||
#include <algorithm>
|
||||
@ -257,7 +258,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const {
|
||||
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
|
||||
size_t total = mBlocks.SizeOfExcludingThis(aMallocSizeOf);
|
||||
for (uint32_t i = 0; i < mBlocks.Length(); i++) {
|
||||
if (mBlocks[i]) {
|
||||
@ -267,7 +268,7 @@ public:
|
||||
return total;
|
||||
}
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const {
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
|
||||
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
* 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/. */
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "gfxGDIFont.h"
|
||||
#include "gfxGDIShaper.h"
|
||||
#include "gfxUniscribeShaper.h"
|
||||
@ -551,7 +552,7 @@ gfxGDIFont::GetGlyphWidth(gfxContext *aCtx, uint16_t aGID)
|
||||
}
|
||||
|
||||
void
|
||||
gfxGDIFont::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxGDIFont::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const
|
||||
{
|
||||
gfxFont::SizeOfExcludingThis(aMallocSizeOf, aSizes);
|
||||
@ -560,7 +561,7 @@ gfxGDIFont::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
}
|
||||
|
||||
void
|
||||
gfxGDIFont::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxGDIFont::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontInstances += aMallocSizeOf(this);
|
||||
|
@ -6,6 +6,7 @@
|
||||
#ifndef GFX_GDIFONT_H
|
||||
#define GFX_GDIFONT_H
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "gfxFont.h"
|
||||
#include "gfxGDIFontList.h"
|
||||
|
||||
@ -53,9 +54,9 @@ public:
|
||||
// get hinted glyph width in pixels as 16.16 fixed-point value
|
||||
virtual int32_t GetGlyphWidth(gfxContext *aCtx, uint16_t aGID);
|
||||
|
||||
virtual void SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const;
|
||||
virtual void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const;
|
||||
|
||||
virtual FontType GetType() const { return FONT_TYPE_GDI; }
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "nsISimpleEnumerator.h"
|
||||
#include "nsIWindowsRegKey.h"
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
|
||||
#include <usp10.h>
|
||||
@ -444,7 +445,7 @@ GDIFontEntry::CreateFontEntry(const nsAString& aName,
|
||||
}
|
||||
|
||||
void
|
||||
GDIFontEntry::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
GDIFontEntry::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontListSize += aMallocSizeOf(this);
|
||||
@ -1065,7 +1066,7 @@ gfxGDIFontList::ResolveFontName(const nsAString& aFontName, nsAString& aResolved
|
||||
}
|
||||
|
||||
void
|
||||
gfxGDIFontList::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxGDIFontList::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
gfxPlatformFontList::SizeOfExcludingThis(aMallocSizeOf, aSizes);
|
||||
@ -1081,7 +1082,7 @@ gfxGDIFontList::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
}
|
||||
|
||||
void
|
||||
gfxGDIFontList::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxGDIFontList::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontListSize += aMallocSizeOf(this);
|
||||
|
@ -6,6 +6,7 @@
|
||||
#ifndef GFX_GDIFONTLIST_H
|
||||
#define GFX_GDIFONTLIST_H
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "gfxWindowsPlatform.h"
|
||||
#include "gfxPlatformFontList.h"
|
||||
#include "nsGkAtoms.h"
|
||||
@ -239,7 +240,7 @@ public:
|
||||
|
||||
virtual bool TestCharacterMap(uint32_t aCh);
|
||||
|
||||
virtual void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
|
||||
// create a font entry for a font with a given name
|
||||
@ -321,9 +322,9 @@ public:
|
||||
virtual bool ResolveFontName(const nsAString& aFontName,
|
||||
nsAString& aResolvedFontName);
|
||||
|
||||
virtual void SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
virtual void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
|
||||
private:
|
||||
|
@ -4,6 +4,7 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "gfxAlphaRecovery.h"
|
||||
#include "gfxImageSurface.h"
|
||||
|
||||
@ -197,7 +198,7 @@ gfxImageSurface::ComputeStride(const gfxIntSize& aSize, gfxImageFormat aFormat)
|
||||
}
|
||||
|
||||
size_t
|
||||
gfxImageSurface::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
gfxImageSurface::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
size_t n = gfxASurface::SizeOfExcludingThis(aMallocSizeOf);
|
||||
if (mOwnsData) {
|
||||
@ -207,7 +208,7 @@ gfxImageSurface::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
}
|
||||
|
||||
size_t
|
||||
gfxImageSurface::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
gfxImageSurface::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
|
||||
}
|
||||
|
@ -6,6 +6,7 @@
|
||||
#ifndef GFX_IMAGESURFACE_H
|
||||
#define GFX_IMAGESURFACE_H
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "gfxASurface.h"
|
||||
#include "gfxPoint.h"
|
||||
|
||||
@ -113,9 +114,9 @@ public:
|
||||
|
||||
static long ComputeStride(const gfxIntSize&, gfxImageFormat);
|
||||
|
||||
virtual size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
MOZ_OVERRIDE;
|
||||
virtual size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
MOZ_OVERRIDE;
|
||||
virtual bool SizeOfIsMeasured() const MOZ_OVERRIDE;
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
* 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/. */
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "gfxMacFont.h"
|
||||
#include "gfxCoreTextShaper.h"
|
||||
#include "gfxHarfBuzzShaper.h"
|
||||
@ -410,7 +411,7 @@ gfxMacFont::GetScaledFont(DrawTarget *aTarget)
|
||||
}
|
||||
|
||||
void
|
||||
gfxMacFont::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxMacFont::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const
|
||||
{
|
||||
gfxFont::SizeOfExcludingThis(aMallocSizeOf, aSizes);
|
||||
@ -419,7 +420,7 @@ gfxMacFont::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
}
|
||||
|
||||
void
|
||||
gfxMacFont::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxMacFont::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontInstances += aMallocSizeOf(this);
|
||||
|
@ -6,6 +6,7 @@
|
||||
#ifndef GFX_MACFONT_H
|
||||
#define GFX_MACFONT_H
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "gfxFont.h"
|
||||
#include "gfxMacPlatformFontList.h"
|
||||
#include "mozilla/gfx/2D.h"
|
||||
@ -42,9 +43,9 @@ public:
|
||||
|
||||
virtual mozilla::TemporaryRef<mozilla::gfx::ScaledFont> GetScaledFont(mozilla::gfx::DrawTarget *aTarget);
|
||||
|
||||
virtual void SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const;
|
||||
virtual void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const;
|
||||
|
||||
virtual FontType GetType() const { return FONT_TYPE_MAC; }
|
||||
|
@ -6,6 +6,7 @@
|
||||
#ifndef gfxMacPlatformFontList_H_
|
||||
#define gfxMacPlatformFontList_H_
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "nsDataHashtable.h"
|
||||
#include "nsRefPtrHashtable.h"
|
||||
|
||||
@ -44,7 +45,7 @@ public:
|
||||
// use CGFontRef API to get direct access to system font data
|
||||
virtual hb_blob_t *GetFontTable(uint32_t aTag) MOZ_OVERRIDE;
|
||||
|
||||
virtual void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
|
||||
nsresult ReadCMAP();
|
||||
|
@ -63,6 +63,7 @@
|
||||
#include "nsISimpleEnumerator.h"
|
||||
#include "nsCharTraits.h"
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
|
||||
@ -423,7 +424,7 @@ MacOSFontEntry::HasFontTable(uint32_t aTableTag)
|
||||
}
|
||||
|
||||
void
|
||||
MacOSFontEntry::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
MacOSFontEntry::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontListSize += aMallocSizeOf(this);
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
@ -764,7 +765,7 @@ gfxPlatformFontList::GetPrefsAndStartLoader()
|
||||
static size_t
|
||||
SizeOfFamilyEntryExcludingThis(const nsAString& aKey,
|
||||
const nsRefPtr<gfxFontFamily>& aFamily,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
MallocSizeOf aMallocSizeOf,
|
||||
void* aUserArg)
|
||||
{
|
||||
FontListSizes *sizes = static_cast<FontListSizes*>(aUserArg);
|
||||
@ -782,7 +783,7 @@ SizeOfFamilyEntryExcludingThis(const nsAString& aKey,
|
||||
gfxPlatformFontList::SizeOfFamilyNameEntryExcludingThis
|
||||
(const nsAString& aKey,
|
||||
const nsRefPtr<gfxFontFamily>& aFamily,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
MallocSizeOf aMallocSizeOf,
|
||||
void* aUserArg)
|
||||
{
|
||||
// we don't count the size of the family here, because this is an *extra*
|
||||
@ -793,7 +794,7 @@ gfxPlatformFontList::SizeOfFamilyNameEntryExcludingThis
|
||||
static size_t
|
||||
SizeOfFontNameEntryExcludingThis(const nsAString& aKey,
|
||||
const nsRefPtr<gfxFontEntry>& aFont,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
MallocSizeOf aMallocSizeOf,
|
||||
void* aUserArg)
|
||||
{
|
||||
// the font itself is counted by its owning family; here we only care about
|
||||
@ -805,7 +806,7 @@ static size_t
|
||||
SizeOfPrefFontEntryExcludingThis
|
||||
(const uint32_t& aKey,
|
||||
const nsTArray<nsRefPtr<gfxFontFamily> >& aList,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
MallocSizeOf aMallocSizeOf,
|
||||
void* aUserArg)
|
||||
{
|
||||
// again, we only care about the size of the array itself; we don't follow
|
||||
@ -816,7 +817,7 @@ SizeOfPrefFontEntryExcludingThis
|
||||
|
||||
static size_t
|
||||
SizeOfStringEntryExcludingThis(nsStringHashKey* aHashEntry,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
MallocSizeOf aMallocSizeOf,
|
||||
void* aUserArg)
|
||||
{
|
||||
return aHashEntry->GetKey().SizeOfExcludingThisIfUnshared(aMallocSizeOf);
|
||||
@ -824,7 +825,7 @@ SizeOfStringEntryExcludingThis(nsStringHashKey* aHashEntry,
|
||||
|
||||
static size_t
|
||||
SizeOfSharedCmapExcludingThis(CharMapHashKey* aHashEntry,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
MallocSizeOf aMallocSizeOf,
|
||||
void* aUserArg)
|
||||
{
|
||||
FontListSizes *sizes = static_cast<FontListSizes*>(aUserArg);
|
||||
@ -838,8 +839,8 @@ SizeOfSharedCmapExcludingThis(CharMapHashKey* aHashEntry,
|
||||
}
|
||||
|
||||
void
|
||||
gfxPlatformFontList::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
gfxPlatformFontList::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontListSize +=
|
||||
mFontFamilies.SizeOfExcludingThis(SizeOfFamilyEntryExcludingThis,
|
||||
@ -877,8 +878,8 @@ gfxPlatformFontList::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
}
|
||||
|
||||
void
|
||||
gfxPlatformFontList::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
gfxPlatformFontList::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontListSize += aMallocSizeOf(this);
|
||||
SizeOfExcludingThis(aMallocSizeOf, aSizes);
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
#include "nsIMemoryReporter.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
class CharMapHashKey : public PLDHashEntryHdr
|
||||
{
|
||||
@ -161,9 +162,9 @@ public:
|
||||
// (platforms may override, eg Mac)
|
||||
virtual bool GetStandardFamilyName(const nsAString& aFontName, nsAString& aFamilyName);
|
||||
|
||||
virtual void SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
virtual void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
|
||||
// search for existing cmap that matches the input
|
||||
@ -252,7 +253,7 @@ protected:
|
||||
static size_t
|
||||
SizeOfFamilyNameEntryExcludingThis(const nsAString& aKey,
|
||||
const nsRefPtr<gfxFontFamily>& aFamily,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
mozilla::MallocSizeOf aMallocSizeOf,
|
||||
void* aUserArg);
|
||||
|
||||
// canonical family name ==> family entry (unique, one name per family entry)
|
||||
|
@ -5,6 +5,7 @@
|
||||
|
||||
#include "FrameBlender.h"
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "RasterImage.h"
|
||||
#include "imgFrame.h"
|
||||
|
||||
@ -573,7 +574,7 @@ FrameBlender::Discard()
|
||||
|
||||
size_t
|
||||
FrameBlender::SizeOfDecodedWithComputedFallbackIfHeap(gfxASurface::MemoryLocation aLocation,
|
||||
nsMallocSizeOfFun aMallocSizeOf) const
|
||||
MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
size_t n = 0;
|
||||
for (uint32_t i = 0; i < mFrames.Length(); ++i) {
|
||||
|
@ -8,6 +8,7 @@
|
||||
#define mozilla_imagelib_FrameBlender_h_
|
||||
|
||||
#include "nsTArray.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
#include "gfxASurface.h"
|
||||
|
||||
@ -57,7 +58,7 @@ public:
|
||||
void SetSize(nsIntSize aSize) { mSize = aSize; }
|
||||
|
||||
size_t SizeOfDecodedWithComputedFallbackIfHeap(gfxASurface::MemoryLocation aLocation,
|
||||
nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
void ResetAnimation();
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
#ifndef MOZILLA_IMAGELIB_IMAGE_H_
|
||||
#define MOZILLA_IMAGELIB_IMAGE_H_
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "imgIContainer.h"
|
||||
#include "imgStatusTracker.h"
|
||||
#include "nsIURI.h"
|
||||
@ -77,8 +78,8 @@ public:
|
||||
/**
|
||||
* The components that make up SizeOfData().
|
||||
*/
|
||||
virtual size_t HeapSizeOfSourceWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const = 0;
|
||||
virtual size_t HeapSizeOfDecodedWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const = 0;
|
||||
virtual size_t HeapSizeOfSourceWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const = 0;
|
||||
virtual size_t HeapSizeOfDecodedWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const = 0;
|
||||
virtual size_t NonHeapSizeOfDecoded() const = 0;
|
||||
virtual size_t OutOfProcessSizeOfDecoded() const = 0;
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
* 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/. */
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "ImageWrapper.h"
|
||||
|
||||
using mozilla::layers::LayerManager;
|
||||
@ -38,13 +39,13 @@ ImageWrapper::SizeOfData()
|
||||
}
|
||||
|
||||
size_t
|
||||
ImageWrapper::HeapSizeOfSourceWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
ImageWrapper::HeapSizeOfSourceWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
return mInnerImage->HeapSizeOfSourceWithComputedFallback(aMallocSizeOf);
|
||||
}
|
||||
|
||||
size_t
|
||||
ImageWrapper::HeapSizeOfDecodedWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
ImageWrapper::HeapSizeOfDecodedWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
return mInnerImage->HeapSizeOfDecodedWithComputedFallback(aMallocSizeOf);
|
||||
}
|
||||
|
@ -6,6 +6,7 @@
|
||||
#ifndef MOZILLA_IMAGELIB_IMAGEWRAPPER_H_
|
||||
#define MOZILLA_IMAGELIB_IMAGEWRAPPER_H_
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "Image.h"
|
||||
|
||||
namespace mozilla {
|
||||
@ -29,8 +30,8 @@ public:
|
||||
virtual nsIntRect FrameRect(uint32_t aWhichFrame) MOZ_OVERRIDE;
|
||||
|
||||
virtual uint32_t SizeOfData() MOZ_OVERRIDE;
|
||||
virtual size_t HeapSizeOfSourceWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const MOZ_OVERRIDE;
|
||||
virtual size_t HeapSizeOfDecodedWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const MOZ_OVERRIDE;
|
||||
virtual size_t HeapSizeOfSourceWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE;
|
||||
virtual size_t HeapSizeOfDecodedWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE;
|
||||
virtual size_t NonHeapSizeOfDecoded() const MOZ_OVERRIDE;
|
||||
virtual size_t OutOfProcessSizeOfDecoded() const MOZ_OVERRIDE;
|
||||
|
||||
|
@ -38,6 +38,7 @@
|
||||
|
||||
#include "gfxContext.h"
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/StandardInteger.h"
|
||||
@ -1182,7 +1183,7 @@ RasterImage::UpdateImageContainer()
|
||||
}
|
||||
|
||||
size_t
|
||||
RasterImage::HeapSizeOfSourceWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
RasterImage::HeapSizeOfSourceWithComputedFallback(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
// n == 0 is possible for two reasons.
|
||||
// - This is a zero-length image.
|
||||
@ -1197,7 +1198,7 @@ RasterImage::HeapSizeOfSourceWithComputedFallback(nsMallocSizeOfFun aMallocSizeO
|
||||
|
||||
size_t
|
||||
RasterImage::SizeOfDecodedWithComputedFallbackIfHeap(gfxASurface::MemoryLocation aLocation,
|
||||
nsMallocSizeOfFun aMallocSizeOf) const
|
||||
MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
size_t n = mFrameBlender.SizeOfDecodedWithComputedFallbackIfHeap(aLocation, aMallocSizeOf);
|
||||
|
||||
@ -1209,7 +1210,7 @@ RasterImage::SizeOfDecodedWithComputedFallbackIfHeap(gfxASurface::MemoryLocation
|
||||
}
|
||||
|
||||
size_t
|
||||
RasterImage::HeapSizeOfDecodedWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
RasterImage::HeapSizeOfDecodedWithComputedFallback(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
return SizeOfDecodedWithComputedFallbackIfHeap(gfxASurface::MEMORY_IN_PROCESS_HEAP,
|
||||
aMallocSizeOf);
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "nsThreadUtils.h"
|
||||
#include "DiscardTracker.h"
|
||||
#include "nsISupportsImpl.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/LinkedList.h"
|
||||
@ -176,8 +177,8 @@ public:
|
||||
/* The total number of frames in this image. */
|
||||
uint32_t GetNumFrames() const;
|
||||
|
||||
virtual size_t HeapSizeOfSourceWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
virtual size_t HeapSizeOfDecodedWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
virtual size_t HeapSizeOfSourceWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
virtual size_t HeapSizeOfDecodedWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
virtual size_t NonHeapSizeOfDecoded() const;
|
||||
virtual size_t OutOfProcessSizeOfDecoded() const;
|
||||
|
||||
@ -589,7 +590,7 @@ private:
|
||||
mozilla::TimeStamp GetCurrentImgFrameEndTime() const;
|
||||
|
||||
size_t SizeOfDecodedWithComputedFallbackIfHeap(gfxASurface::MemoryLocation aLocation,
|
||||
nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
inline void EnsureAnimExists()
|
||||
{
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "gfxUtils.h"
|
||||
#include "imgDecoderObserver.h"
|
||||
#include "mozilla/AutoRestore.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/SVGSVGElement.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsIObserverService.h"
|
||||
@ -341,7 +342,7 @@ VectorImage::FrameRect(uint32_t aWhichFrame)
|
||||
}
|
||||
|
||||
size_t
|
||||
VectorImage::HeapSizeOfSourceWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
VectorImage::HeapSizeOfSourceWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
// We're not storing the source data -- we just feed that directly to
|
||||
// our helper SVG document as we receive it, for it to parse.
|
||||
@ -350,7 +351,7 @@ VectorImage::HeapSizeOfSourceWithComputedFallback(nsMallocSizeOfFun aMallocSizeO
|
||||
}
|
||||
|
||||
size_t
|
||||
VectorImage::HeapSizeOfDecodedWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
VectorImage::HeapSizeOfDecodedWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
// XXXdholbert TODO: return num bytes used by helper SVG doc. (bug 590790)
|
||||
return 0;
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "Image.h"
|
||||
#include "nsIStreamListener.h"
|
||||
#include "nsIRequest.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
#include "mozilla/WeakPtr.h"
|
||||
|
||||
@ -43,8 +44,8 @@ public:
|
||||
uint32_t aFlags);
|
||||
virtual nsIntRect FrameRect(uint32_t aWhichFrame) MOZ_OVERRIDE;
|
||||
|
||||
virtual size_t HeapSizeOfSourceWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
virtual size_t HeapSizeOfDecodedWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
virtual size_t HeapSizeOfSourceWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
virtual size_t HeapSizeOfDecodedWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
virtual size_t NonHeapSizeOfDecoded() const;
|
||||
virtual size_t OutOfProcessSizeOfDecoded() const;
|
||||
|
||||
|
@ -19,6 +19,7 @@ static bool gDisableOptimize = false;
|
||||
#include "cairo.h"
|
||||
#include "GeckoProfiler.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#if defined(XP_WIN)
|
||||
|
||||
@ -801,7 +802,7 @@ void imgFrame::SetCompositingFailed(bool val)
|
||||
// |aMallocSizeOf|. If that fails (because the platform doesn't support it) or
|
||||
// it's non-heap memory, we fall back to computing the size analytically.
|
||||
size_t
|
||||
imgFrame::SizeOfExcludingThisWithComputedFallbackIfHeap(gfxASurface::MemoryLocation aLocation, nsMallocSizeOfFun aMallocSizeOf) const
|
||||
imgFrame::SizeOfExcludingThisWithComputedFallbackIfHeap(gfxASurface::MemoryLocation aLocation, mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
// aMallocSizeOf is only used if aLocation==MEMORY_IN_PROCESS_HEAP. It
|
||||
// should be NULL otherwise.
|
||||
|
@ -7,6 +7,7 @@
|
||||
#ifndef imgFrame_h
|
||||
#define imgFrame_h
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "nsRect.h"
|
||||
#include "nsPoint.h"
|
||||
#include "nsSize.h"
|
||||
@ -104,7 +105,7 @@ public:
|
||||
|
||||
size_t SizeOfExcludingThisWithComputedFallbackIfHeap(
|
||||
gfxASurface::MemoryLocation aLocation,
|
||||
nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
uint8_t GetPaletteDepth() const { return mPaletteDepth; }
|
||||
uint32_t PaletteDataLength() const {
|
||||
|
@ -409,7 +409,7 @@ bool Histogram::HasValidRangeChecksum() const {
|
||||
return CalculateRangeChecksum() == range_checksum_;
|
||||
}
|
||||
|
||||
size_t Histogram::SizeOfIncludingThis(size_t (*aMallocSizeOf)(const void*))
|
||||
size_t Histogram::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
|
||||
{
|
||||
size_t n = 0;
|
||||
n += aMallocSizeOf(this);
|
||||
@ -420,7 +420,7 @@ size_t Histogram::SizeOfIncludingThis(size_t (*aMallocSizeOf)(const void*))
|
||||
return n;
|
||||
}
|
||||
|
||||
size_t Histogram::SampleSet::SizeOfExcludingThis(size_t (*aMallocSizeOf)(const void*))
|
||||
size_t Histogram::SampleSet::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf)
|
||||
{
|
||||
// We're not allowed to do deep dives into STL data structures. This
|
||||
// is as close as we can get to measuring this array.
|
||||
|
@ -41,6 +41,8 @@
|
||||
#define BASE_METRICS_HISTOGRAM_H_
|
||||
#pragma once
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@ -316,10 +318,7 @@ class Histogram {
|
||||
const char* description; // Null means end of a list of pairs.
|
||||
};
|
||||
|
||||
// To avoid depending on XPCOM headers, we define our own MallocSizeOf type.
|
||||
typedef size_t (*MallocSizeOf)(const void*);
|
||||
|
||||
size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf);
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Statistic values, developed over the life of the histogram.
|
||||
@ -357,7 +356,7 @@ class Histogram {
|
||||
bool Serialize(Pickle* pickle) const;
|
||||
bool Deserialize(void** iter, const Pickle& pickle);
|
||||
|
||||
size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf);
|
||||
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf);
|
||||
|
||||
protected:
|
||||
// Actual histogram data is stored in buckets, showing the count of values
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/Casting.h"
|
||||
#include "mozilla/DebugOnly.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/PodOperations.h"
|
||||
#include "mozilla/TypeTraits.h"
|
||||
#include "mozilla/Util.h"
|
||||
@ -204,10 +205,10 @@ class HashMap
|
||||
|
||||
// Don't just call |impl.sizeOfExcludingThis()| because there's no
|
||||
// guarantee that |impl| is the first field in HashMap.
|
||||
size_t sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const {
|
||||
size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {
|
||||
return impl.sizeOfExcludingThis(mallocSizeOf);
|
||||
}
|
||||
size_t sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const {
|
||||
size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {
|
||||
return mallocSizeOf(this) + impl.sizeOfExcludingThis(mallocSizeOf);
|
||||
}
|
||||
|
||||
@ -412,10 +413,10 @@ class HashSet
|
||||
|
||||
// Don't just call |impl.sizeOfExcludingThis()| because there's no
|
||||
// guarantee that |impl| is the first field in HashSet.
|
||||
size_t sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const {
|
||||
size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {
|
||||
return impl.sizeOfExcludingThis(mallocSizeOf);
|
||||
}
|
||||
size_t sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const {
|
||||
size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {
|
||||
return mallocSizeOf(this) + impl.sizeOfExcludingThis(mallocSizeOf);
|
||||
}
|
||||
|
||||
@ -1340,12 +1341,12 @@ class HashTable : private AllocPolicy
|
||||
return gen;
|
||||
}
|
||||
|
||||
size_t sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const
|
||||
size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const
|
||||
{
|
||||
return mallocSizeOf(table);
|
||||
}
|
||||
|
||||
size_t sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const
|
||||
size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const
|
||||
{
|
||||
return mallocSizeOf(this) + sizeOfExcludingThis(mallocSizeOf);
|
||||
}
|
||||
|
@ -10,6 +10,8 @@
|
||||
// These declarations are not within jsapi.h because they are highly likely to
|
||||
// change in the future. Depend on them at your own risk.
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "jsalloc.h"
|
||||
@ -363,7 +365,7 @@ struct CompartmentStats
|
||||
|
||||
struct RuntimeStats
|
||||
{
|
||||
RuntimeStats(JSMallocSizeOfFun mallocSizeOf)
|
||||
RuntimeStats(mozilla::MallocSizeOf mallocSizeOf)
|
||||
: runtime(),
|
||||
gcHeapChunkTotal(0),
|
||||
gcHeapDecommittedArenas(0),
|
||||
@ -420,7 +422,7 @@ struct RuntimeStats
|
||||
|
||||
ZoneStats *currZoneStats;
|
||||
|
||||
JSMallocSizeOfFun mallocSizeOf_;
|
||||
mozilla::MallocSizeOf mallocSizeOf_;
|
||||
|
||||
virtual void initExtraCompartmentStats(JSCompartment *c, CompartmentStats *cstats) = 0;
|
||||
virtual void initExtraZoneStats(JS::Zone *zone, ZoneStats *zstats) = 0;
|
||||
|
@ -814,11 +814,6 @@ inline bool IsPoisonedPtr(T *v)
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* This is SpiderMonkey's equivalent to |nsMallocSizeOfFun|.
|
||||
*/
|
||||
typedef size_t(*JSMallocSizeOfFun)(const void *p);
|
||||
|
||||
/* sixgill annotation defines */
|
||||
#ifndef HAVE_STATIC_ANNOTATIONS
|
||||
# define HAVE_STATIC_ANNOTATIONS
|
||||
|
@ -8,6 +8,7 @@
|
||||
#define js_Vector_h
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/TypeTraits.h"
|
||||
|
||||
#include "TemplateLib.h"
|
||||
@ -504,13 +505,13 @@ class Vector : private AllocPolicy
|
||||
/*
|
||||
* Measure the size of the Vector's heap-allocated storage.
|
||||
*/
|
||||
size_t sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const;
|
||||
size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const;
|
||||
|
||||
/*
|
||||
* Like sizeOfExcludingThis, but also measures the size of the Vector
|
||||
* object (which must be heap-allocated) itself.
|
||||
*/
|
||||
size_t sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const;
|
||||
size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const;
|
||||
|
||||
void swap(Vector &other);
|
||||
};
|
||||
@ -1059,14 +1060,14 @@ Vector<T,N,AP>::replaceRawBuffer(T *p, size_t aLength)
|
||||
|
||||
template <class T, size_t N, class AP>
|
||||
inline size_t
|
||||
Vector<T,N,AP>::sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const
|
||||
Vector<T,N,AP>::sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const
|
||||
{
|
||||
return usingInlineStorage() ? 0 : mallocSizeOf(beginNoCheck());
|
||||
}
|
||||
|
||||
template <class T, size_t N, class AP>
|
||||
inline size_t
|
||||
Vector<T,N,AP>::sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const
|
||||
Vector<T,N,AP>::sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const
|
||||
{
|
||||
return mallocSizeOf(this) + sizeOfExcludingThis(mallocSizeOf);
|
||||
}
|
||||
|
@ -21,6 +21,10 @@
|
||||
|
||||
#include "jscntxtinlines.h"
|
||||
|
||||
#ifdef JSGC_GENERATIONAL
|
||||
#include "vm/Shape-inl.h"
|
||||
#endif
|
||||
|
||||
using namespace js;
|
||||
|
||||
using mozilla::ArrayLength;
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
#include "ion/AsmJS.h"
|
||||
#include "vm/ForkJoin.h"
|
||||
#include "vm/Interpreter.h"
|
||||
|
||||
#include "vm/ObjectImpl-inl.h"
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user